@swirls/cli 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swirls/cli",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Swirls command line application",
5
5
  "author": {
6
6
  "name": "Swirls",
@@ -8,8 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "bin": {
11
- "__cli_bash_complete": "./dist/bash-complete.js",
12
- "cli": "./dist/cli.js",
11
+ "cli": "./dist/cli-shim.js",
13
12
  "swirls": "./dist/cli.js"
14
13
  },
15
14
  "files": [
@@ -18,36 +17,30 @@
18
17
  "scripts": {
19
18
  "prebuild": "tsc -p tsconfig.json",
20
19
  "build": "if [ \"$SWIRLS_ENV\" = 'production' ]; then tsup; elif command -v op >/dev/null 2>&1; then op run --no-masking --env-file=.env.development -- tsup; else tsup; fi",
21
- "postbuild": "chmod +x ./dist/cli.js ./dist/bash-complete.js",
20
+ "postbuild": "cp scripts/cli-shim.js dist/cli-shim.js && chmod +x ./dist/cli.js ./dist/cli-shim.js",
22
21
  "dev": "op run --no-masking --env-file=.env.development -- tsup --watch",
23
22
  "pkg:publish": "bun publish",
23
+ "pkg:publish:dry": "bun publish --dry-run",
24
24
  "prepublishOnly": "SWIRLS_ENV=production bun run build"
25
25
  },
26
- "dependencies": {
26
+ "devDependencies": {
27
27
  "@byteslice/result": "0.3.0",
28
+ "@clack/prompts": "1.0.0",
28
29
  "@clerk/clerk-js": "5.109.2",
29
30
  "@clerk/shared": "3.44.0",
30
31
  "@orpc/client": "1.12.2",
31
32
  "@orpc/contract": "1.12.2",
32
- "@stricli/auto-complete": "1.2.4",
33
33
  "@stricli/core": "1.2.4",
34
- "@swirls/sdk": "0.0.4",
35
- "ink": "6.4.0",
36
- "ink-select-input": "6.2.0",
37
- "ink-spinner": "5.0.0",
38
- "ink-text-input": "^6.0.0",
39
- "jiti": "2.6.1",
40
- "open": "10.2.0",
41
- "zod": "4.3.5"
42
- },
43
- "devDependencies": {
44
34
  "@swirls/core": "0.0.1",
35
+ "@swirls/sdk": "0.0.13",
45
36
  "@types/node": "24.10.0",
46
- "@types/react": "19.2.6",
37
+ "console-table-printer": "2.15.0",
47
38
  "dotenv": "16.4.7",
48
- "react": "19.2.1",
39
+ "open": "10.2.0",
40
+ "sucrase": "3.35.1",
49
41
  "tsup": "8.5.1",
50
- "typescript": "5.9.3"
42
+ "typescript": "5.9.3",
43
+ "zod": "4.3.5"
51
44
  },
52
45
  "engines": {
53
46
  "node": ">=22"
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env node
2
- var Zo=Object.create;var ht=Object.defineProperty;var Jo=Object.getOwnPropertyDescriptor;var en=Object.getOwnPropertyNames;var tn=Object.getPrototypeOf,rn=Object.prototype.hasOwnProperty;var S=(e,r)=>()=>(e&&(r=e(e=0)),r);var we=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),B=(e,r)=>{for(var n in r)ht(e,n,{get:r[n],enumerable:!0})},on=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of en(r))!rn.call(e,i)&&i!==n&&ht(e,i,{get:()=>r[i],enumerable:!(s=Jo(r,i))||s.enumerable});return e};var b=(e,r,n)=>(n=e!=null?Zo(tn(e)):{},on(r||!e||!e.__esModule?ht(n,"default",{value:e,enumerable:!0}):n,e));import fi from"path";import{fileURLToPath as mi}from"url";var l=S(()=>{"use strict"});import nn from"http";import{withResult as pr}from"@byteslice/result";import*as ae from"zod";function un(e){if(!e.url)throw new Error("No URL found in callback response.");let r=new URL(e.url,wt);return ae.parse(sn,Object.fromEntries(r.searchParams.entries()))}function mr(e){e.writeHead(400,{"Content-Type":"text/html"}),e.end(cn)}function ln(e){e.writeHead(200,{"Content-Type":"text/html"}),e.end(an)}function gr(e){return new Promise((r,n)=>{let s=nn.createServer(async(i,c)=>{let p=await pr(()=>un(i),m=>m);if(p.failure){mr(c),n(p.failure);return}let E=await pr(()=>e(p.data),m=>m);if(E.failure){mr(c),n(E.failure);return}ln(c),s.close(()=>{r()})});s.listen(dr)})}var dr,wt,sn,an,cn,hr=S(()=>{"use strict";l();dr=8765,wt=`http://localhost:${dr}`,sn=ae.object({code:ae.string(),state:ae.string()}),an=`
3
- <!DOCTYPE html>
4
- <html lang="en">
5
- <head>
6
- <meta charset="UTF-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <title>Authentication Successful</title>
9
- <script src="https://cdn.tailwindcss.com"></script>
10
- </head>
11
- <body class="bg-gray-100 flex items-center justify-center min-h-screen">
12
- <div class="bg-white p-8 rounded-2xl shadow-lg text-center max-w-md">
13
- <svg class="w-16 h-16 text-green-500 mx-auto" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
14
- <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
15
- </svg>
16
- <h1 class="text-2xl font-semibold mt-4">Authentication Successful</h1>
17
- <p class="text-gray-600 mt-2">You can now return to your terminal and close this browser.</p>
18
- </div>
19
- </body>
20
- </html>
21
- `,cn=`
22
- <!DOCTYPE html>
23
- <html lang="en">
24
- <head>
25
- <meta charset="UTF-8">
26
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
27
- <title>Authentication Failed</title>
28
- <script src="https://cdn.tailwindcss.com"></script>
29
- </head>
30
- <body class="bg-gray-100 flex items-center justify-center min-h-screen">
31
- <div class="bg-white p-8 rounded-2xl shadow-lg text-center max-w-md">
32
- <svg class="w-16 h-16 text-red-500 mx-auto" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
33
- <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
34
- </svg>
35
- <h1 class="text-2xl font-semibold mt-4">Authentication Failed</h1>
36
- <p class="text-gray-600 mt-2">Something bad happened while trying to authenticate you. Please try again.</p>
37
- <p class="text-gray-600 mt-2">If the problem persists, <a href="mailto:help@byteslice.co" target="_blank" class="text-amber-500 hover:text-amber-600">please let us know</a>.</p>
38
- </div>
39
- </body>
40
- </html>
41
- `});import fn from"@clerk/clerk-js/headless/index.js";async function wr(e){let r=new pn(e);return await r.load({standardBrowser:!1}),r}async function yr(e,r){let n=await e.client?.signIn.create({ticket:r,strategy:"ticket"});if(!n||!n.createdSessionId)throw new Error("Failed to sign in.");return{createdSessionId:n.createdSessionId}}var pn,vr=S(()=>{"use strict";l();pn=fn.Clerk});async function yt(e,r){await e.fsPromise.stat(r).then(()=>!0).catch(()=>!1)||await e.fsPromise.mkdir(r,{recursive:!0})}function Ie(e){if(!e.path)throw new Error("No `path` found in context.");if(!e.os)throw new Error("No `os` found in context.");let r=e.os.homedir();return e.path.join(r,".swirls")}var vt=S(()=>{"use strict";l()});import*as J from"zod";function _t(e){return`${Ie(e)}/credentials`}async function _r(e){let r=_t(e);await e.fsPromise.stat(r).then(()=>!0).catch(()=>!1)&&await e.fsPromise.unlink(r)}async function Ke(e){let r=_t(e),n=await e.fsPromise.readFile(r,"utf8");return J.parse(mn,JSON.parse(n))}async function Et(e,r,n,s){let i=_t(e);await yt(e,Ie(e)),await e.fsPromise.writeFile(i,JSON.stringify({idToken:r,jwt:n,sessionId:s}))}var mn,bt=S(()=>{"use strict";l();vt();mn=J.object({idToken:J.string(),jwt:J.string(),sessionId:J.string()})});import dn from"open";function Er(e=32){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=new Uint8Array(e);crypto.getRandomValues(n);let s="";for(let i of n)s+=r[i%r.length];return s}function br(e){let r=new URLSearchParams({client_id:e.clientId,redirect_uri:e.redirectUri,response_type:"code",scope:"openid profile email",state:e.state});dn(`${e.authorizeUri}?${r}`)}var Cr=S(()=>{"use strict";l()});import*as ce from"zod";var gn,hn,Qe,Ct=S(()=>{"use strict";l();gn=ce.object({API_URL:ce.string(),OAUTH_AUTHORIZE_URL:ce.string()}),hn={API_URL:"https://swirls.ai/api",OAUTH_AUTHORIZE_URL:"https://clerk.swirls.ai/oauth/authorize"},Qe=ce.parse(gn,hn)});import{withResult as wn}from"@byteslice/result";import{createORPCClient as yn,onError as vn}from"@orpc/client";import{RPCLink as _n}from"@orpc/client/fetch";async function U(e){let r=new _n({url:`${Qe.API_URL}/rpc`,headers:async()=>{let s=await wn(()=>Ke(e),p=>new Error("Failed to read credentials file",{cause:p.message}));if(s.failure)return{};let{idToken:i,jwt:c}=s.data;return{Authorization:`Bearer ${c||i}`}},interceptors:[vn(s=>{s instanceof Error&&s.name==="AbortError"||console.error(s)})]});return yn(r)}var W=S(()=>{"use strict";l();bt();Ct()});var xr=we(Xe=>{"use strict";l();var En=Symbol.for("react.transitional.element"),bn=Symbol.for("react.fragment");function Tr(e,r,n){var s=null;if(n!==void 0&&(s=""+n),r.key!==void 0&&(s=""+r.key),"key"in r){n={};for(var i in r)i!=="key"&&(n[i]=r[i])}else n=r;return r=n.ref,{$$typeof:En,type:e,key:s,ref:r!==void 0?r:null,props:n}}Xe.Fragment=bn;Xe.jsx=Tr;Xe.jsxs=Tr});var $r=we(h=>{"use strict";l();var Rt=Symbol.for("react.transitional.element"),Cn=Symbol.for("react.portal"),Tn=Symbol.for("react.fragment"),xn=Symbol.for("react.strict_mode"),Rn=Symbol.for("react.profiler"),kn=Symbol.for("react.consumer"),Sn=Symbol.for("react.context"),Pn=Symbol.for("react.forward_ref"),jn=Symbol.for("react.suspense"),An=Symbol.for("react.memo"),jr=Symbol.for("react.lazy"),On=Symbol.for("react.activity"),Rr=Symbol.iterator;function Ln(e){return e===null||typeof e!="object"?null:(e=Rr&&e[Rr]||e["@@iterator"],typeof e=="function"?e:null)}var Ar={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Or=Object.assign,Lr={};function ve(e,r,n){this.props=e,this.context=r,this.refs=Lr,this.updater=n||Ar}ve.prototype.isReactComponent={};ve.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")};ve.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ir(){}Ir.prototype=ve.prototype;function kt(e,r,n){this.props=e,this.context=r,this.refs=Lr,this.updater=n||Ar}var St=kt.prototype=new Ir;St.constructor=kt;Or(St,ve.prototype);St.isPureReactComponent=!0;var kr=Array.isArray;function xt(){}var A={H:null,A:null,T:null,S:null},Nr=Object.prototype.hasOwnProperty;function Pt(e,r,n){var s=n.ref;return{$$typeof:Rt,type:e,key:r,ref:s!==void 0?s:null,props:n}}function In(e,r){return Pt(e.type,r,e.props)}function jt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rt}function Nn(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return r[n]})}var Sr=/\/+/g;function Tt(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Nn(""+e.key):r.toString(36)}function $n(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(xt,xt):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ye(e,r,n,s,i){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var p=!1;if(e===null)p=!0;else switch(c){case"bigint":case"string":case"number":p=!0;break;case"object":switch(e.$$typeof){case Rt:case Cn:p=!0;break;case jr:return p=e._init,ye(p(e._payload),r,n,s,i)}}if(p)return i=i(e),p=s===""?"."+Tt(e,0):s,kr(i)?(n="",p!=null&&(n=p.replace(Sr,"$&/")+"/"),ye(i,r,n,"",function(O){return O})):i!=null&&(jt(i)&&(i=In(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Sr,"$&/")+"/")+p)),r.push(i)),1;p=0;var E=s===""?".":s+":";if(kr(e))for(var m=0;m<e.length;m++)s=e[m],c=E+Tt(s,m),p+=ye(s,r,n,c,i);else if(m=Ln(e),typeof m=="function")for(e=m.call(e),m=0;!(s=e.next()).done;)s=s.value,c=E+Tt(s,m++),p+=ye(s,r,n,c,i);else if(c==="object"){if(typeof e.then=="function")return ye($n(e),r,n,s,i);throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return p}function Ze(e,r,n){if(e==null)return e;var s=[],i=0;return ye(e,s,"","",function(c){return r.call(n,c,i++)}),s}function Un(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var Pr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Fn={map:Ze,forEach:function(e,r,n){Ze(e,function(){r.apply(this,arguments)},n)},count:function(e){var r=0;return Ze(e,function(){r++}),r},toArray:function(e){return Ze(e,function(r){return r})||[]},only:function(e){if(!jt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};h.Activity=On;h.Children=Fn;h.Component=ve;h.Fragment=Tn;h.Profiler=Rn;h.PureComponent=kt;h.StrictMode=xn;h.Suspense=jn;h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A;h.__COMPILER_RUNTIME={__proto__:null,c:function(e){return A.H.useMemoCache(e)}};h.cache=function(e){return function(){return e.apply(null,arguments)}};h.cacheSignal=function(){return null};h.cloneElement=function(e,r,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=Or({},e.props),i=e.key;if(r!=null)for(c in r.key!==void 0&&(i=""+r.key),r)!Nr.call(r,c)||c==="key"||c==="__self"||c==="__source"||c==="ref"&&r.ref===void 0||(s[c]=r[c]);var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){for(var p=Array(c),E=0;E<c;E++)p[E]=arguments[E+2];s.children=p}return Pt(e.type,i,s)};h.createContext=function(e){return e={$$typeof:Sn,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:kn,_context:e},e};h.createElement=function(e,r,n){var s,i={},c=null;if(r!=null)for(s in r.key!==void 0&&(c=""+r.key),r)Nr.call(r,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(i[s]=r[s]);var p=arguments.length-2;if(p===1)i.children=n;else if(1<p){for(var E=Array(p),m=0;m<p;m++)E[m]=arguments[m+2];i.children=E}if(e&&e.defaultProps)for(s in p=e.defaultProps,p)i[s]===void 0&&(i[s]=p[s]);return Pt(e,c,i)};h.createRef=function(){return{current:null}};h.forwardRef=function(e){return{$$typeof:Pn,render:e}};h.isValidElement=jt;h.lazy=function(e){return{$$typeof:jr,_payload:{_status:-1,_result:e},_init:Un}};h.memo=function(e,r){return{$$typeof:An,type:e,compare:r===void 0?null:r}};h.startTransition=function(e){var r=A.T,n={};A.T=n;try{var s=e(),i=A.S;i!==null&&i(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(xt,Pr)}catch(c){Pr(c)}finally{r!==null&&n.types!==null&&(r.types=n.types),A.T=r}};h.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()};h.use=function(e){return A.H.use(e)};h.useActionState=function(e,r,n){return A.H.useActionState(e,r,n)};h.useCallback=function(e,r){return A.H.useCallback(e,r)};h.useContext=function(e){return A.H.useContext(e)};h.useDebugValue=function(){};h.useDeferredValue=function(e,r){return A.H.useDeferredValue(e,r)};h.useEffect=function(e,r){return A.H.useEffect(e,r)};h.useEffectEvent=function(e){return A.H.useEffectEvent(e)};h.useId=function(){return A.H.useId()};h.useImperativeHandle=function(e,r,n){return A.H.useImperativeHandle(e,r,n)};h.useInsertionEffect=function(e,r){return A.H.useInsertionEffect(e,r)};h.useLayoutEffect=function(e,r){return A.H.useLayoutEffect(e,r)};h.useMemo=function(e,r){return A.H.useMemo(e,r)};h.useOptimistic=function(e,r){return A.H.useOptimistic(e,r)};h.useReducer=function(e,r,n){return A.H.useReducer(e,r,n)};h.useRef=function(e){return A.H.useRef(e)};h.useState=function(e){return A.H.useState(e)};h.useSyncExternalStore=function(e,r,n){return A.H.useSyncExternalStore(e,r,n)};h.useTransition=function(){return A.H.useTransition()};h.version="19.2.1"});var Ur=we((g,Je)=>{"use strict";l();process.env.NODE_ENV!=="production"&&(function(){function e(t,o){Object.defineProperty(s.prototype,t,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",o[0],o[1])}})}function r(t){return t===null||typeof t!="object"?null:(t=Be&&t[Be]||t["@@iterator"],typeof t=="function"?t:null)}function n(t,o){t=(t=t.constructor)&&(t.displayName||t.name)||"ReactClass";var u=t+"."+o;Jt[u]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",o,t),Jt[u]=!0)}function s(t,o,u){this.props=t,this.context=o,this.refs=dt,this.updater=u||er}function i(){}function c(t,o,u){this.props=t,this.context=o,this.refs=dt,this.updater=u||er}function p(){}function E(t){return""+t}function m(t){try{E(t);var o=!1}catch{o=!0}if(o){o=console;var u=o.error,f=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return u.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",f),E(t)}}function O(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Go?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case de:return"Fragment";case a:return"Profiler";case Ae:return"StrictMode";case ie:return"Suspense";case Oe:return"SuspenseList";case ge:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case je:return"Portal";case j:return t.displayName||"Context";case w:return(t._context.displayName||"Context")+".Consumer";case $:var o=t.render;return t=t.displayName,t||(t=o.displayName||o.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case N:return o=t.displayName||null,o!==null?o:O(t.type)||"Memo";case M:o=t._payload,t=t._init;try{return O(t(o))}catch{}}return null}function L(t){if(t===de)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===M)return"<...>";try{var o=O(t);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function Re(){var t=C.A;return t===null?null:t.getOwner()}function ke(){return Error("react-stack-top-frame")}function oe(t){if(We.call(t,"key")){var o=Object.getOwnPropertyDescriptor(t,"key").get;if(o&&o.isReactWarning)return!1}return t.key!==void 0}function Ye(t,o){function u(){nr||(nr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}u.isReactWarning=!0,Object.defineProperty(t,"key",{get:u,configurable:!0})}function lt(){var t=O(this.type);return ir[t]||(ir[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function ne(t,o,u,f,d,T){var _=u.ref;return t={$$typeof:me,type:t,key:o,props:u,_owner:f},(_!==void 0?_:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:lt}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:d}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function ft(t,o){return o=ne(t.type,o,t.props,t._owner,t._debugStack,t._debugTask),t._store&&(o._store.validated=t._store.validated),o}function ze(t){V(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===M&&(t._payload.status==="fulfilled"?V(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function V(t){return typeof t=="object"&&t!==null&&t.$$typeof===me}function pt(t){var o={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(u){return o[u]})}function Se(t,o){return typeof t=="object"&&t!==null&&t.key!=null?(m(t.key),pt(""+t.key)):o.toString(36)}function mt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(p,p):(t.status="pending",t.then(function(o){t.status==="pending"&&(t.status="fulfilled",t.value=o)},function(o){t.status==="pending"&&(t.status="rejected",t.reason=o)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function K(t,o,u,f,d){var T=typeof t;(T==="undefined"||T==="boolean")&&(t=null);var _=!1;if(t===null)_=!0;else switch(T){case"bigint":case"string":case"number":_=!0;break;case"object":switch(t.$$typeof){case me:case je:_=!0;break;case M:return _=t._init,K(_(t._payload),o,u,f,d)}}if(_){_=t,d=d(_);var P=f===""?"."+Se(_,0):f;return rr(d)?(u="",P!=null&&(u=P.replace(cr,"$&/")+"/"),K(d,o,u,"",function(Z){return Z})):d!=null&&(V(d)&&(d.key!=null&&(_&&_.key===d.key||m(d.key)),u=ft(d,u+(d.key==null||_&&_.key===d.key?"":(""+d.key).replace(cr,"$&/")+"/")+P),f!==""&&_!=null&&V(_)&&_.key==null&&_._store&&!_._store.validated&&(u._store.validated=2),d=u),o.push(d)),1}if(_=0,P=f===""?".":f+":",rr(t))for(var x=0;x<t.length;x++)f=t[x],T=P+Se(f,x),_+=K(f,o,u,T,d);else if(x=r(t),typeof x=="function")for(x===t.entries&&(ar||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ar=!0),t=x.call(t),x=0;!(f=t.next()).done;)f=f.value,T=P+Se(f,x++),_+=K(f,o,u,T,d);else if(T==="object"){if(typeof t.then=="function")return K(mt(t),o,u,f,d);throw o=String(t),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return _}function le(t,o,u){if(t==null)return t;var f=[],d=0;return K(t,f,"","",function(T){return o.call(u,T,d++)}),f}function Pe(t){if(t._status===-1){var o=t._ioInfo;o!=null&&(o.start=o.end=performance.now()),o=t._result;var u=o();if(u.then(function(d){if(t._status===0||t._status===-1){t._status=1,t._result=d;var T=t._ioInfo;T!=null&&(T.end=performance.now()),u.status===void 0&&(u.status="fulfilled",u.value=d)}},function(d){if(t._status===0||t._status===-1){t._status=2,t._result=d;var T=t._ioInfo;T!=null&&(T.end=performance.now()),u.status===void 0&&(u.status="rejected",u.reason=d)}}),o=t._ioInfo,o!=null){o.value=u;var f=u.displayName;typeof f=="string"&&(o.name=f)}t._status===-1&&(t._status=0,t._result=u)}if(t._status===1)return o=t._result,o===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
42
-
43
- Your code should look like:
44
- const MyComponent = lazy(() => import('./MyComponent'))
45
-
46
- Did you accidentally put curly braces around the import?`,o),"default"in o||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
47
-
48
- Your code should look like:
49
- const MyComponent = lazy(() => import('./MyComponent'))`,o),o.default;throw t._result}function I(){var t=C.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
50
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
51
- 2. You might be breaking the Rules of Hooks
52
- 3. You might have more than one copy of React in the same app
53
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t}function He(){C.asyncTransitions--}function Q(t){if(qe===null)try{var o=("require"+Math.random()).slice(0,7);qe=(Je&&Je[o]).call(Je,"timers").setImmediate}catch{qe=function(f){lr===!1&&(lr=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var d=new MessageChannel;d.port1.onmessage=f,d.port2.postMessage(void 0)}}return qe(t)}function X(t){return 1<t.length&&typeof AggregateError=="function"?new AggregateError(t):t[0]}function fe(t,o){o!==Ge-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Ge=o}function se(t,o,u){var f=C.actQueue;if(f!==null)if(f.length!==0)try{pe(f),Q(function(){return se(t,o,u)});return}catch(d){C.thrownErrors.push(d)}else C.actQueue=null;0<C.thrownErrors.length?(f=X(C.thrownErrors),C.thrownErrors.length=0,u(f)):o(t)}function pe(t){if(!gt){gt=!0;var o=0;try{for(;o<t.length;o++){var u=t[o];do{C.didUsePromise=!1;var f=u(!1);if(f!==null){if(C.didUsePromise){t[o]=u,t.splice(0,o);return}u=f}else break}while(!0)}t.length=0}catch(d){t.splice(0,o+1),C.thrownErrors.push(d)}finally{gt=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var me=Symbol.for("react.transitional.element"),je=Symbol.for("react.portal"),de=Symbol.for("react.fragment"),Ae=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),j=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),Be=Symbol.iterator,Jt={},er={isMounted:function(){return!1},enqueueForceUpdate:function(t){n(t,"forceUpdate")},enqueueReplaceState:function(t){n(t,"replaceState")},enqueueSetState:function(t){n(t,"setState")}},tr=Object.assign,dt={};Object.freeze(dt),s.prototype.isReactComponent={},s.prototype.setState=function(t,o){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,o,"setState")},s.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var Y={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Le in Y)Y.hasOwnProperty(Le)&&e(Le,Y[Le]);i.prototype=s.prototype,Y=c.prototype=new i,Y.constructor=c,tr(Y,s.prototype),Y.isPureReactComponent=!0;var rr=Array.isArray,Go=Symbol.for("react.client.reference"),C={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},We=Object.prototype.hasOwnProperty,or=console.createTask?console.createTask:function(){return null};Y={react_stack_bottom_frame:function(t){return t()}};var nr,sr,ir={},Vo=Y.react_stack_bottom_frame.bind(Y,ke)(),Ko=or(L(ke)),ar=!1,cr=/\/+/g,ur=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},lr=!1,qe=null,Ge=0,Ve=!1,gt=!1,fr=typeof queueMicrotask=="function"?function(t){queueMicrotask(function(){return queueMicrotask(t)})}:Q;Y=Object.freeze({__proto__:null,c:function(t){return I().useMemoCache(t)}});var Le={map:le,forEach:function(t,o,u){le(t,function(){o.apply(this,arguments)},u)},count:function(t){var o=0;return le(t,function(){o++}),o},toArray:function(t){return le(t,function(o){return o})||[]},only:function(t){if(!V(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};g.Activity=ge,g.Children=Le,g.Component=s,g.Fragment=de,g.Profiler=a,g.PureComponent=c,g.StrictMode=Ae,g.Suspense=ie,g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,g.__COMPILER_RUNTIME=Y,g.act=function(t){var o=C.actQueue,u=Ge;Ge++;var f=C.actQueue=o!==null?o:[],d=!1;try{var T=t()}catch(x){C.thrownErrors.push(x)}if(0<C.thrownErrors.length)throw fe(o,u),t=X(C.thrownErrors),C.thrownErrors.length=0,t;if(T!==null&&typeof T=="object"&&typeof T.then=="function"){var _=T;return fr(function(){d||Ve||(Ve=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(x,Z){d=!0,_.then(function(he){if(fe(o,u),u===0){try{pe(f),Q(function(){return se(he,x,Z)})}catch(Xo){C.thrownErrors.push(Xo)}if(0<C.thrownErrors.length){var Qo=X(C.thrownErrors);C.thrownErrors.length=0,Z(Qo)}}else x(he)},function(he){fe(o,u),0<C.thrownErrors.length&&(he=X(C.thrownErrors),C.thrownErrors.length=0),Z(he)})}}}var P=T;if(fe(o,u),u===0&&(pe(f),f.length!==0&&fr(function(){d||Ve||(Ve=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),C.actQueue=null),0<C.thrownErrors.length)throw t=X(C.thrownErrors),C.thrownErrors.length=0,t;return{then:function(x,Z){d=!0,u===0?(C.actQueue=f,Q(function(){return se(P,x,Z)})):x(P)}}},g.cache=function(t){return function(){return t.apply(null,arguments)}},g.cacheSignal=function(){return null},g.captureOwnerStack=function(){var t=C.getCurrentStack;return t===null?null:t()},g.cloneElement=function(t,o,u){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var f=tr({},t.props),d=t.key,T=t._owner;if(o!=null){var _;e:{if(We.call(o,"ref")&&(_=Object.getOwnPropertyDescriptor(o,"ref").get)&&_.isReactWarning){_=!1;break e}_=o.ref!==void 0}_&&(T=Re()),oe(o)&&(m(o.key),d=""+o.key);for(P in o)!We.call(o,P)||P==="key"||P==="__self"||P==="__source"||P==="ref"&&o.ref===void 0||(f[P]=o[P])}var P=arguments.length-2;if(P===1)f.children=u;else if(1<P){_=Array(P);for(var x=0;x<P;x++)_[x]=arguments[x+2];f.children=_}for(f=ne(t.type,d,f,T,t._debugStack,t._debugTask),d=2;d<arguments.length;d++)ze(arguments[d]);return f},g.createContext=function(t){return t={$$typeof:j,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:w,_context:t},t._currentRenderer=null,t._currentRenderer2=null,t},g.createElement=function(t,o,u){for(var f=2;f<arguments.length;f++)ze(arguments[f]);f={};var d=null;if(o!=null)for(x in sr||!("__self"in o)||"key"in o||(sr=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),oe(o)&&(m(o.key),d=""+o.key),o)We.call(o,x)&&x!=="key"&&x!=="__self"&&x!=="__source"&&(f[x]=o[x]);var T=arguments.length-2;if(T===1)f.children=u;else if(1<T){for(var _=Array(T),P=0;P<T;P++)_[P]=arguments[P+2];Object.freeze&&Object.freeze(_),f.children=_}if(t&&t.defaultProps)for(x in T=t.defaultProps,T)f[x]===void 0&&(f[x]=T[x]);d&&Ye(f,typeof t=="function"?t.displayName||t.name||"Unknown":t);var x=1e4>C.recentlyCreatedOwnerStacks++;return ne(t,d,f,Re(),x?Error("react-stack-top-frame"):Vo,x?or(L(t)):Ko)},g.createRef=function(){var t={current:null};return Object.seal(t),t},g.forwardRef=function(t){t!=null&&t.$$typeof===N?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof t!="function"?console.error("forwardRef requires a render function but was given %s.",t===null?"null":typeof t):t.length!==0&&t.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",t.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),t!=null&&t.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var o={$$typeof:$,render:t},u;return Object.defineProperty(o,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(f){u=f,t.name||t.displayName||(Object.defineProperty(t,"name",{value:f}),t.displayName=f)}}),o},g.isValidElement=V,g.lazy=function(t){t={_status:-1,_result:t};var o={$$typeof:M,_payload:t,_init:Pe},u={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return t._ioInfo=u,o._debugInfo=[{awaited:u}],o},g.memo=function(t,o){t==null&&console.error("memo: The first argument must be a component. Instead received: %s",t===null?"null":typeof t),o={$$typeof:N,type:t,compare:o===void 0?null:o};var u;return Object.defineProperty(o,"displayName",{enumerable:!1,configurable:!0,get:function(){return u},set:function(f){u=f,t.name||t.displayName||(Object.defineProperty(t,"name",{value:f}),t.displayName=f)}}),o},g.startTransition=function(t){var o=C.T,u={};u._updatedFibers=new Set,C.T=u;try{var f=t(),d=C.S;d!==null&&d(u,f),typeof f=="object"&&f!==null&&typeof f.then=="function"&&(C.asyncTransitions++,f.then(He,He),f.then(p,ur))}catch(T){ur(T)}finally{o===null&&u._updatedFibers&&(t=u._updatedFibers.size,u._updatedFibers.clear(),10<t&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),o!==null&&u.types!==null&&(o.types!==null&&o.types!==u.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),o.types=u.types),C.T=o}},g.unstable_useCacheRefresh=function(){return I().useCacheRefresh()},g.use=function(t){return I().use(t)},g.useActionState=function(t,o,u){return I().useActionState(t,o,u)},g.useCallback=function(t,o){return I().useCallback(t,o)},g.useContext=function(t){var o=I();return t.$$typeof===w&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),o.useContext(t)},g.useDebugValue=function(t,o){return I().useDebugValue(t,o)},g.useDeferredValue=function(t,o){return I().useDeferredValue(t,o)},g.useEffect=function(t,o){return t==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useEffect(t,o)},g.useEffectEvent=function(t){return I().useEffectEvent(t)},g.useId=function(){return I().useId()},g.useImperativeHandle=function(t,o,u){return I().useImperativeHandle(t,o,u)},g.useInsertionEffect=function(t,o){return t==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useInsertionEffect(t,o)},g.useLayoutEffect=function(t,o){return t==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useLayoutEffect(t,o)},g.useMemo=function(t,o){return I().useMemo(t,o)},g.useOptimistic=function(t,o){return I().useOptimistic(t,o)},g.useReducer=function(t,o,u){return I().useReducer(t,o,u)},g.useRef=function(t){return I().useRef(t)},g.useState=function(t){return I().useState(t)},g.useSyncExternalStore=function(t,o,u){return I().useSyncExternalStore(t,o,u)},g.useTransition=function(){return I().useTransition()},g.version="19.2.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Ne=we((Bi,At)=>{"use strict";l();process.env.NODE_ENV==="production"?At.exports=$r():At.exports=Ur()});var Fr=we(et=>{"use strict";l();process.env.NODE_ENV!=="production"&&(function(){function e(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===He?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case ne:return"Fragment";case ze:return"Profiler";case ft:return"StrictMode";case mt:return"Suspense";case K:return"SuspenseList";case I:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case lt:return"Portal";case pt:return a.displayName||"Context";case V:return(a._context.displayName||"Context")+".Consumer";case Se:var w=a.render;return a=a.displayName,a||(a=w.displayName||w.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case le:return w=a.displayName||null,w!==null?w:e(a.type)||"Memo";case Pe:w=a._payload,a=a._init;try{return e(a(w))}catch{}}return null}function r(a){return""+a}function n(a){try{r(a);var w=!1}catch{w=!0}if(w){w=console;var j=w.error,$=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return j.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$),r(a)}}function s(a){if(a===ne)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===Pe)return"<...>";try{var w=e(a);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function i(){var a=Q.A;return a===null?null:a.getOwner()}function c(){return Error("react-stack-top-frame")}function p(a){if(X.call(a,"key")){var w=Object.getOwnPropertyDescriptor(a,"key").get;if(w&&w.isReactWarning)return!1}return a.key!==void 0}function E(a,w){function j(){pe||(pe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",w))}j.isReactWarning=!0,Object.defineProperty(a,"key",{get:j,configurable:!0})}function m(){var a=e(this.type);return me[a]||(me[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function O(a,w,j,$,ie,Oe){var N=j.ref;return a={$$typeof:Ye,type:a,key:w,props:j,_owner:$},(N!==void 0?N:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:m}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ie}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Oe}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function L(a,w,j,$,ie,Oe){var N=w.children;if(N!==void 0)if($)if(fe(N)){for($=0;$<N.length;$++)Re(N[$]);Object.freeze&&Object.freeze(N)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Re(N);if(X.call(w,"key")){N=e(a);var M=Object.keys(w).filter(function(Be){return Be!=="key"});$=0<M.length?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}",Ae[N+$]||(M=0<M.length?"{"+M.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
54
- let props = %s;
55
- <%s {...props} />
56
- React keys must be passed directly to JSX without using spread:
57
- let props = %s;
58
- <%s key={someKey} {...props} />`,$,N,M,N),Ae[N+$]=!0)}if(N=null,j!==void 0&&(n(j),N=""+j),p(w)&&(n(w.key),N=""+w.key),"key"in w){j={};for(var ge in w)ge!=="key"&&(j[ge]=w[ge])}else j=w;return N&&E(j,typeof a=="function"?a.displayName||a.name||"Unknown":a),O(a,N,j,i(),ie,Oe)}function Re(a){ke(a)?a._store&&(a._store.validated=1):typeof a=="object"&&a!==null&&a.$$typeof===Pe&&(a._payload.status==="fulfilled"?ke(a._payload.value)&&a._payload.value._store&&(a._payload.value._store.validated=1):a._store&&(a._store.validated=1))}function ke(a){return typeof a=="object"&&a!==null&&a.$$typeof===Ye}var oe=Ne(),Ye=Symbol.for("react.transitional.element"),lt=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),ft=Symbol.for("react.strict_mode"),ze=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),pt=Symbol.for("react.context"),Se=Symbol.for("react.forward_ref"),mt=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),He=Symbol.for("react.client.reference"),Q=oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,fe=Array.isArray,se=console.createTask?console.createTask:function(){return null};oe={react_stack_bottom_frame:function(a){return a()}};var pe,me={},je=oe.react_stack_bottom_frame.bind(oe,c)(),de=se(s(c)),Ae={};et.Fragment=ne,et.jsx=function(a,w,j){var $=1e4>Q.recentlyCreatedOwnerStacks++;return L(a,w,j,!1,$?Error("react-stack-top-frame"):je,$?se(s(a)):de)},et.jsxs=function(a,w,j){var $=1e4>Q.recentlyCreatedOwnerStacks++;return L(a,w,j,!0,$?Error("react-stack-top-frame"):je,$?se(s(a)):de)}})()});var R=we((Vi,Ot)=>{"use strict";l();process.env.NODE_ENV==="production"?Ot.exports=xr():Ot.exports=Fr()});import{Box as Dn,Text as Dr}from"ink";function k(e){return(0,$e.jsxs)(Dn,{flexDirection:"column",children:[(0,$e.jsx)(Dr,{color:"red",children:e.message}),(0,$e.jsx)(Dr,{children:"If this issue persists, send us an email at help@byteslice.co, and we can help you out."})]})}var $e,z=S(()=>{"use strict";l();$e=b(R(),1)});import{Text as Mn}from"ink";function F(e){return(0,Mr.jsx)(Mn,{color:"green",children:e.message})}var Mr,q=S(()=>{"use strict";l();Mr=b(R(),1)});import{Text as Yn}from"ink";function Yr(e){return(0,zr.jsx)(Yn,{color:"yellow",children:e.message})}var zr,Hr=S(()=>{"use strict";l();zr=b(R(),1)});function zn(e){return`${Ie(e)}/project`}async function Br(e){let r=zn(e);await e.fsPromise.stat(r).then(()=>!0).catch(()=>!1)&&await e.fsPromise.unlink(r)}var Wr=S(()=>{"use strict";l();vt()});var Lt={};B(Lt,{login:()=>Bn,logout:()=>Wn});import{withResult as H}from"@byteslice/result";import{render as ue}from"ink";async function Hn(e,r,n){let s=await H(async()=>await(await U(e)).cli.exchangeToken({code:n.code}),O=>new Error("Failed to exchange callback code for token",{cause:O.message}));if(s.failure)throw s.failure;await Et(e,s.data.idToken,"","");let i=await H(async()=>await(await U(e)).cli.createSignInTicket(),O=>new Error("Failed to exchange ID token code for a sign-in ticket",{cause:O.message}));if(i.failure)throw i.failure;let c=await wr(r.clerkPublishableKey),p=await H(()=>yr(c,i.data.token),O=>new Error("Failed to create a new sign-in for this device",{cause:O.message}));if(p.failure)throw p.failure;let E=await H(async()=>await(await U(e)).cli.createJwt({sessionId:p.data.createdSessionId}),O=>new Error("Failed to create a session JWT",{cause:O.message}));if(E.failure)throw E.failure;let m=await H(()=>Et(e,s.data.idToken,E.data,p.data.createdSessionId),O=>new Error("Failed to save your credentials to disk",{cause:O.message}));if(m.failure)throw m.failure}async function Bn(){let e=await U(this),r=Er(),n=await H(()=>e.cli.getConfig(),i=>new Error("Failed to retrieve authentication configuration",{cause:i.message}));n.failure&&(ue((0,ee.jsx)(k,{message:n.failure.message})),process.exit(1)),br({authorizeUri:Qe.OAUTH_AUTHORIZE_URL,clientId:n.data.clientId,redirectUri:wt,state:r});let s=await H(()=>gr(async i=>{if(i.state!==r)throw new Error("Invalid state.");await Hn(this,n.data,i)}),i=>i);s.failure&&(ue((0,ee.jsx)(k,{message:s.failure.message})),process.exit(1)),ue((0,ee.jsx)(F,{message:"Success! You are now logged in."}))}async function Wn(){let e=await H(()=>Ke(this),c=>c);e.failure&&(ue((0,ee.jsx)(k,{message:"There was an issue reading your credentials. You are probably already logged out."})),process.exit(1));let r=await U(this),n=await H(()=>r.cli.getConfig(),c=>new Error("Failed to retrieve authentication configuration",{cause:c.message}));n.failure&&(ue((0,ee.jsx)(k,{message:n.failure.message})),process.exit(1)),(await H(async()=>r.cli.revokeSession({sessionId:e.data.sessionId}),c=>c)).failure&&ue((0,ee.jsx)(Yr,{message:"There was an issue revoking your session. You are probably already logged out. Purging credentials file..."}));let i=await H(async()=>{await _r(this),await Br(this)},c=>c);if(i.failure)throw i.failure;ue((0,ee.jsx)(F,{message:"Success! You are now logged out."}))}var ee,It=S(()=>{"use strict";l();hr();vr();bt();Cr();W();z();q();Hr();Ct();Wr();ee=b(R(),1)});import{Box as Kn,Text as Vr}from"ink";import Qn from"ink-spinner";function Kr(e){return(0,_e.jsxs)(Kn,{children:[(0,_e.jsx)(Vr,{color:"cyan",children:(0,_e.jsx)(Qn,{type:"dots"})}),(0,_e.jsxs)(Vr,{children:[" ",e.message]})]})}var _e,Qr=S(()=>{"use strict";l();_e=b(R(),1)});import{existsSync as Xn}from"fs";import{resolve as Zn}from"path";import{configFileName as Xr,configSchema as Jn}from"@swirls/sdk/config";import{createJiti as es}from"jiti";async function Zr(){let e=Zn(process.cwd(),Xr);if(!Xn(e))throw new Error(`Config file not found in project root: ${Xr}`);let n=await es(import.meta.url).import(e,{default:!0});return Jn.parse(n)}var Jr=S(()=>{"use strict";l()});async function eo(e,r){let n=await U(e),{results:s}=await n.forms.listForms({projectId:r});function i(p){return p.schema!=null}return s.filter(i).map(p=>({id:p.id,name:p.name,schema:p.schema}))}var to=S(()=>{"use strict";l();W()});import ro from"fs/promises";import ts from"path";async function tt(e,r){let n=ts.dirname(e);await ro.mkdir(n,{recursive:!0}),await ro.writeFile(e,r,"utf-8")}var Nt=S(()=>{"use strict";l()});var oo={};B(oo,{generateCode:()=>os});import $t from"process";import{withResult as Ut}from"@byteslice/result";import{generateFormsCode as rs}from"@swirls/sdk/form/generate";import{render as Ue}from"ink";async function os(){let e=await Ut(()=>Zr(),c=>new Error("Failed to load configuration",{cause:c}));e.failure&&(Ue((0,Ee.jsx)(k,{message:e.failure.message})),$t.exit(1));let{projectId:r,genPath:n}=e.data;Ue((0,Ee.jsx)(Kr,{message:"Generating form code..."}));let s=await Ut(async()=>{let c=['// This file was generated by "@swirls/cli dev generate"',"// Do not edit this file manually",""],p=await eo(this,r);return rs(p,c)},c=>new Error(`Failed to generate form code: ${c.message}`,{cause:c}));s.failure&&(Ue((0,Ee.jsx)(k,{message:s.failure.message})),$t.exit(1));let i=await Ut(()=>tt(n,s.data),c=>new Error("Failed to write code file",{cause:c}));i.failure&&(Ue((0,Ee.jsx)(k,{message:i.failure.message})),$t.exit(1)),Ue((0,Ee.jsx)(F,{message:`Success! Generated code at ${n}`}))}var Ee,no=S(()=>{"use strict";l();z();Qr();q();Jr();to();Nt();Ee=b(R(),1)});import{Box as so,render as ns,Text as io}from"ink";import ss from"ink-text-input";import{z as is}from"zod";function as(e){let[r,n]=(0,Ft.useState)(""),[s,i]=(0,Ft.useState)(null);return(0,te.jsxs)(so,{flexDirection:"column",children:[(0,te.jsxs)(so,{children:[(0,te.jsx)(io,{children:"Enter project ID (UUID): "}),(0,te.jsx)(ss,{value:r,onChange:E=>{i(null),n(E)},onSubmit:E=>{if(i(null),E.trim()===""){setImmediate(()=>e.onInput());return}let m=is.uuid().safeParse(E);if(!m.success){i("Invalid UUID. Please try again."),n("");return}setImmediate(()=>e.onInput(m.data))}})]}),s&&(0,te.jsx)(io,{color:"red",children:s})]})}async function ao(){return new Promise(e=>{let r=ns((0,te.jsx)(as,{onInput:n=>{r.unmount(),e(n)}}))})}var Ft,te,co=S(()=>{"use strict";l();Ft=b(Ne(),1),te=b(R(),1)});var uo={};B(uo,{initializeConfig:()=>ms});import{existsSync as cs}from"fs";import{resolve as us}from"path";import Dt from"process";import{withResult as ls}from"@byteslice/result";import{configFileName as fs,generateConfig as ps}from"@swirls/sdk/config";import{render as Mt}from"ink";async function ms(){let e=us(Dt.cwd(),fs);cs(e)&&(Mt((0,rt.jsx)(k,{message:`Configuration already exists at ${e}.`})),Dt.exit(1));let r=await ao(),n=await ls(async()=>{let s=ps(r);await tt(e,s)},s=>new Error("Failed to create configuration",{cause:s}));n.failure&&(Mt((0,rt.jsx)(k,{message:n.failure.message})),Dt.exit(1)),Mt((0,rt.jsx)(F,{message:`Success! Created configuration at ${e}`}))}var rt,lo=S(()=>{"use strict";l();z();q();co();Nt();rt=b(R(),1)});import{render as ws}from"ink";import ys from"open";async function ot(e){let r=`${vs}/${e.id}`;await ys(r),ws((0,mo.jsx)(F,{message:`Opened project "${e.name}" in browser.`}))}var mo,vs,Yt=S(()=>{"use strict";l();q();mo=b(R(),1),vs="https://swirls.ai/projects"});import{Box as zt,render as _s,Text as Es}from"ink";import bs from"ink-text-input";function Cs(e){let[r,n]=(0,go.useState)(""),s=i=>{let c=i.trim().toLowerCase(),p=c===""||c==="y"||c==="yes";setImmediate(()=>e.onAnswer(p))};return(0,re.jsx)(zt,{flexDirection:"column",children:(0,re.jsxs)(zt,{children:[(0,re.jsxs)(Es,{children:[e.message," "]}),(0,re.jsx)(bs,{value:r,onChange:n,onSubmit:s})]})})}async function ho(e){let{above:r}=e??{};return new Promise(n=>{let s=_s((0,re.jsxs)(zt,{flexDirection:"column",children:[r,(0,re.jsx)(Cs,{message:"Open project in browser? (Y/n)",onAnswer:i=>{s.unmount(),n(i)}})]}))})}var go,re,wo=S(()=>{"use strict";l();go=b(Ne(),1),re=b(R(),1)});var yo={};B(yo,{createProject:()=>Rs});import{withResult as Ts}from"@byteslice/result";import{render as xs}from"ink";async function Rs(e,r){let n=await U(this),s=await Ts(()=>n.projects.createProject({name:r}),c=>new Error(`Failed to create project: ${c.message}`,{cause:c}));s.failure&&(xs((0,Ht.jsx)(k,{message:s.failure.message})),process.exit(1)),await ho({above:(0,Ht.jsx)(F,{message:`Success! Created "${r}" project: ${s.data.id}`})})&&await ot(s.data)}var Ht,vo=S(()=>{"use strict";l();W();z();q();Yt();wo();Ht=b(R(),1)});var Eo={};B(Eo,{openProject:()=>Ss});import{withResult as ks}from"@byteslice/result";import{render as _o}from"ink";async function Ss(e,r){let n=await U(this),s=await ks(()=>n.projects.getProject({projectId:r}),i=>new Error(`Failed to get project: ${i.message}`,{cause:i}));s.failure&&(_o((0,Bt.jsx)(k,{message:s.failure.message})),process.exit(1)),s.data||(_o((0,Bt.jsx)(k,{message:"Project not found."})),process.exit(1)),await ot(s.data)}var Bt,bo=S(()=>{"use strict";l();W();z();Yt();Bt=b(R(),1)});import{Box as be,Text as nt}from"ink";function Os(e){return typeof e=="boolean"?e?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(nt,{color:"green",children:"\u2714"})," yes"]}):"no":String(e)}function Ls(e,r){return r.map(n=>{let s=n.key in e?Os(e[n.key]):null;return{column:n,value:s}})}function Is(e,r,n=1){return r.map(s=>{let i=String(s).length,c=e.map(E=>s in E&&(typeof E[s]=="string"||typeof E[s]=="number")?String(E[s]).length:0),p=Math.max(...c,i)+n*2;return{name:String(s),key:s,width:p}})}function Wt(e){return(0,D.jsx)(nt,{children:Array(e.width).fill("\u2500").join("")})}function Ro(e){let r=Is(e.data,e.keys),n=r.reduce((s,i)=>s+i.width,0);return(0,D.jsxs)(be,{flexDirection:"column",width:n,children:[(0,D.jsx)(Wt,{width:n}),(0,D.jsx)(be,{flexDirection:"row",children:r.map(s=>(0,D.jsx)(be,{width:s.width,children:(0,D.jsx)(nt,{bold:!0,color:"blue",children:s.name})},s.name))}),(0,D.jsx)(Wt,{width:n}),(0,D.jsx)(be,{flexDirection:"column",children:e.data.map((s,i)=>{let c=Ls(s,r);return(0,D.jsxs)(xo.Fragment,{children:[(0,D.jsx)(be,{flexDirection:"row",children:c.map(p=>(0,D.jsx)(be,{width:p.column.width,children:(0,D.jsx)(nt,{children:p.value})},p.column.name))}),(0,D.jsx)(Wt,{width:n})]},`row-${i}`)})})]})}var xo,D,ko=S(()=>{"use strict";l();xo=b(Ne(),1),D=b(R(),1)});import{existsSync as Ns}from"fs";import{resolve as $s}from"path";import{configFileName as So,configSchema as Us}from"@swirls/sdk/config";import{createJiti as Fs}from"jiti";async function G(e){if(e)return e;let r=$s(process.cwd(),So);if(!Ns(r))throw new Error(`No project specified and no ${So} found. Use --project flag or run from a project directory.`);let s=await Fs(import.meta.url).import(r,{default:!0});return Us.parse(s).projectId}var Ce=S(()=>{"use strict";l()});var jo={};B(jo,{list:()=>Ds});import{withResult as Po}from"@byteslice/result";import{render as qt}from"ink";async function Ds(e,r){let n=await Po(()=>G(e.project),m=>new Error(m.message));n.failure&&(qt((0,st.jsx)(k,{message:n.failure.message})),process.exit(1));let s=await U(this),i=await Po(()=>s.buckets.listFiles({projectId:n.data,path:r}),m=>new Error(`Failed to list files: ${m.message}`,{cause:m}));i.failure&&(qt((0,st.jsx)(k,{message:i.failure.message})),process.exit(1));let{files:c,folders:p}=i.data;if(p.length===0&&c.length===0){console.log("No files or folders found.");return}let E=[...p.map(m=>({type:"folder",name:m.name,size:"-"})),...c.map(m=>({type:"file",name:m.name,size:m.size?Ms(m.size):"-"}))];qt((0,st.jsx)(Ro,{keys:["type","name","size"],data:E}))}function Ms(e){if(e===0)return"0 B";let r=1024,n=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/r**s).toFixed(2))} ${n[s]}`}var st,Ao=S(()=>{"use strict";l();W();z();ko();Ce();st=b(R(),1)});var Oo={};B(Oo,{upload:()=>Hs});import{readFile as Ys}from"fs/promises";import{basename as zs}from"path";import{withResult as it}from"@byteslice/result";import{render as Fe}from"ink";async function Hs(e,r,n){let s=await it(()=>G(e.project),L=>new Error(L.message));s.failure&&(Fe((0,Te.jsx)(k,{message:s.failure.message})),process.exit(1));let i=await it(()=>Ys(r),L=>new Error(`Failed to read file: ${L.message}`,{cause:L}));i.failure&&(Fe((0,Te.jsx)(k,{message:i.failure.message})),process.exit(1));let c=zs(r),p=n?`${n}/${c}`:c,E=await U(this),m=await it(()=>E.buckets.createSignedUploadUrl({projectId:s.data,path:p}),L=>new Error(`Failed to get upload URL: ${L.message}`,{cause:L}));m.failure&&(Fe((0,Te.jsx)(k,{message:m.failure.message})),process.exit(1));let O=await it(async()=>{let L=await fetch(m.data.signedUrl,{method:"PUT",headers:{"Content-Type":"application/octet-stream","x-upsert":"true"},body:i.data});if(!L.ok)throw new Error(`Upload failed: ${L.statusText}`);return L},L=>new Error(`Failed to upload file: ${L.message}`,{cause:L}));O.failure&&(Fe((0,Te.jsx)(k,{message:O.failure.message})),process.exit(1)),Fe((0,Te.jsx)(F,{message:`Uploaded ${c} to ${p}`}))}var Te,Lo=S(()=>{"use strict";l();W();z();q();Ce();Te=b(R(),1)});var Io={};B(Io,{download:()=>Ws});import{writeFile as Bs}from"fs/promises";import{withResult as at}from"@byteslice/result";import{render as De}from"ink";async function Ws(e,r,n){let s=await at(()=>G(e.project),m=>new Error(m.message));s.failure&&(De((0,xe.jsx)(k,{message:s.failure.message})),process.exit(1));let i=await U(this),c=await at(()=>i.buckets.createSignedUrl({projectId:s.data,path:r}),m=>new Error(`Failed to get download URL: ${m.message}`,{cause:m}));c.failure&&(De((0,xe.jsx)(k,{message:c.failure.message})),process.exit(1));let p=await at(async()=>{let m=await fetch(c.data.signedUrl);if(!m.ok)throw new Error(`Download failed: ${m.statusText}`);return m.arrayBuffer()},m=>new Error(`Failed to download file: ${m.message}`,{cause:m}));p.failure&&(De((0,xe.jsx)(k,{message:p.failure.message})),process.exit(1));let E=await at(()=>Bs(n,Buffer.from(p.data)),m=>new Error(`Failed to write file: ${m.message}`,{cause:m}));E.failure&&(De((0,xe.jsx)(k,{message:E.failure.message})),process.exit(1)),De((0,xe.jsx)(F,{message:`Downloaded ${r} to ${n}`}))}var xe,No=S(()=>{"use strict";l();W();z();q();Ce();xe=b(R(),1)});var Uo={};B(Uo,{deleteFile:()=>qs});import{withResult as $o}from"@byteslice/result";import{render as Gt}from"ink";async function qs(e,r){let n=await $o(()=>G(e.project),c=>new Error(c.message));n.failure&&(Gt((0,ct.jsx)(k,{message:n.failure.message})),process.exit(1));let s=await U(this),i=await $o(()=>s.buckets.deleteFile({projectId:n.data,path:r}),c=>new Error(`Failed to delete file: ${c.message}`,{cause:c}));i.failure&&(Gt((0,ct.jsx)(k,{message:i.failure.message})),process.exit(1)),Gt((0,ct.jsx)(F,{message:`Deleted ${r}`}))}var ct,Fo=S(()=>{"use strict";l();W();z();q();Ce();ct=b(R(),1)});var Mo={};B(Mo,{url:()=>Gs});import{withResult as Do}from"@byteslice/result";import{render as Vt}from"ink";async function Gs(e,r){let n=await Do(()=>G(e.project),c=>new Error(c.message));n.failure&&(Vt((0,ut.jsx)(k,{message:n.failure.message})),process.exit(1));let s=await U(this),i=await Do(()=>s.buckets.createSignedUrl({projectId:n.data,path:r,expiresIn:e.expires}),c=>new Error(`Failed to create signed URL: ${c.message}`,{cause:c}));i.failure&&(Vt((0,ut.jsx)(k,{message:i.failure.message})),process.exit(1)),console.log(i.data.signedUrl),Vt((0,ut.jsx)(F,{message:`URL expires at ${i.data.expiresAt}`}))}var ut,Yo=S(()=>{"use strict";l();W();z();q();Ce();ut=b(R(),1)});l();import{proposeCompletions as qo}from"@stricli/core";l();import{buildInstallCommand as ei,buildUninstallCommand as ti}from"@stricli/auto-complete";import{buildApplication as ri,buildRouteMap as oi}from"@stricli/core";l();import{buildCommand as qr,buildRouteMap as qn}from"@stricli/core";var Gn=qr({loader:async()=>{let{login:e}=await Promise.resolve().then(()=>(It(),Lt));return e},parameters:{positional:{kind:"tuple",parameters:[]}},docs:{brief:"Log in with an existing account"}}),Vn=qr({loader:async()=>{let{logout:e}=await Promise.resolve().then(()=>(It(),Lt));return e},parameters:{positional:{kind:"tuple",parameters:[]}},docs:{brief:"Log out of an existing account"}}),Gr=qn({routes:{login:Gn,logout:Vn},docs:{brief:"Auth commands"}});l();import{buildCommand as fo,buildRouteMap as ds}from"@stricli/core";var gs=fo({loader:async()=>{let{generateCode:e}=await Promise.resolve().then(()=>(no(),oo));return e},parameters:{positional:{kind:"tuple",parameters:[]}},docs:{brief:"Generate application code and types"}}),hs=fo({loader:async()=>{let{initializeConfig:e}=await Promise.resolve().then(()=>(lo(),uo));return e},parameters:{positional:{kind:"tuple",parameters:[]}},docs:{brief:"Initialize Swirls configuration file"}}),po=ds({routes:{gen:gs,init:hs},docs:{brief:"Developer commands"}});l();import{buildCommand as Co,buildRouteMap as Ps}from"@stricli/core";var js=Co({loader:async()=>{let{createProject:e}=await Promise.resolve().then(()=>(vo(),yo));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Project name",parse:String,placeholder:"name"}]}},docs:{brief:"Create a new project"}}),As=Co({loader:async()=>{let{openProject:e}=await Promise.resolve().then(()=>(bo(),Eo));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Project ID",parse:String,placeholder:"project-id"}]}},docs:{brief:"Open project in browser"}}),To=Ps({routes:{create:js,open:As},docs:{brief:"Project commands"}});l();import{buildCommand as Me,buildRouteMap as Vs}from"@stricli/core";var Ks=Me({loader:async()=>{let{list:e}=await Promise.resolve().then(()=>(Ao(),jo));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Path to list (optional)",parse:String,placeholder:"path",optional:!0}]},flags:{project:{kind:"parsed",brief:"Project ID (uses config if not specified)",parse:String,optional:!0}}},docs:{brief:"List files in storage"}}),Qs=Me({loader:async()=>{let{upload:e}=await Promise.resolve().then(()=>(Lo(),Oo));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Local file path to upload",parse:String,placeholder:"file"},{brief:"Destination path in storage (optional)",parse:String,placeholder:"dest",optional:!0}]},flags:{project:{kind:"parsed",brief:"Project ID (uses config if not specified)",parse:String,optional:!0}}},docs:{brief:"Upload a file to storage"}}),Xs=Me({loader:async()=>{let{download:e}=await Promise.resolve().then(()=>(No(),Io));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Path to file in storage",parse:String,placeholder:"path"},{brief:"Local destination path",parse:String,placeholder:"dest"}]},flags:{project:{kind:"parsed",brief:"Project ID (uses config if not specified)",parse:String,optional:!0}}},docs:{brief:"Download a file from storage"}}),Zs=Me({loader:async()=>{let{deleteFile:e}=await Promise.resolve().then(()=>(Fo(),Uo));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Path to file in storage",parse:String,placeholder:"path"}]},flags:{project:{kind:"parsed",brief:"Project ID (uses config if not specified)",parse:String,optional:!0}}},docs:{brief:"Delete a file from storage"}}),Js=Me({loader:async()=>{let{url:e}=await Promise.resolve().then(()=>(Yo(),Mo));return e},parameters:{positional:{kind:"tuple",parameters:[{brief:"Path to file in storage",parse:String,placeholder:"path"}]},flags:{project:{kind:"parsed",brief:"Project ID (uses config if not specified)",parse:String,optional:!0},expires:{kind:"parsed",brief:"Expiration time in seconds (default: 86400 = 24 hours)",parse:Number,optional:!0}}},docs:{brief:"Get a signed URL for a file"}}),zo=Vs({routes:{list:Ks,upload:Qs,download:Xs,delete:Zs,url:Js},docs:{brief:"Storage commands"}});var Ho="@swirls/cli",Bo="0.0.21",Wo="Swirls command line application";var ni=oi({routes:{auth:Gr,dev:po,project:To,storage:zo,install:ei("cli",{bash:"__cli_bash_complete"}),uninstall:ti("cli",{bash:!0})},docs:{brief:Wo,hideRoute:{install:!0,uninstall:!0}}}),Qt=ri(ni,{name:Ho,versionInfo:{currentVersion:Bo}});l();import si from"fs";import ii from"fs/promises";import ai from"os";import ci from"path";function Xt(e){return{fs:si,fsPromise:ii,os:ai,path:ci,process:e}}var Zt=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&Zt.push("");await qo(Qt,Zt,Xt(process));try{for(let{completion:e}of await qo(Qt,Zt,Xt(process)))process.stdout.write(`${e}
59
- `)}catch{}
60
- /*! Bundled license information:
61
-
62
- react/cjs/react-jsx-runtime.production.js:
63
- (**
64
- * @license React
65
- * react-jsx-runtime.production.js
66
- *
67
- * Copyright (c) Meta Platforms, Inc. and affiliates.
68
- *
69
- * This source code is licensed under the MIT license found in the
70
- * LICENSE file in the root directory of this source tree.
71
- *)
72
-
73
- react/cjs/react.production.js:
74
- (**
75
- * @license React
76
- * react.production.js
77
- *
78
- * Copyright (c) Meta Platforms, Inc. and affiliates.
79
- *
80
- * This source code is licensed under the MIT license found in the
81
- * LICENSE file in the root directory of this source tree.
82
- *)
83
-
84
- react/cjs/react.development.js:
85
- (**
86
- * @license React
87
- * react.development.js
88
- *
89
- * Copyright (c) Meta Platforms, Inc. and affiliates.
90
- *
91
- * This source code is licensed under the MIT license found in the
92
- * LICENSE file in the root directory of this source tree.
93
- *)
94
-
95
- react/cjs/react-jsx-runtime.development.js:
96
- (**
97
- * @license React
98
- * react-jsx-runtime.development.js
99
- *
100
- * Copyright (c) Meta Platforms, Inc. and affiliates.
101
- *
102
- * This source code is licensed under the MIT license found in the
103
- * LICENSE file in the root directory of this source tree.
104
- *)
105
- */