@animaapp/anima-sdk-react 0.1.0
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/.turbo/turbo-build.log +21 -0
- package/dist/index.cjs +22 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +5293 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
- package/src/index.ts +2 -0
- package/src/useAnimaCodegen.ts +202 -0
- package/src/useFigmaFile.ts +44 -0
- package/vite.config.ts +27 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
Debugger listening on ws://127.0.0.1:54355/b2a3eedc-d0d3-406c-9c88-8e3c9508ca46
|
|
3
|
+
For help, see: https://nodejs.org/en/docs/inspector
|
|
4
|
+
Debugger attached.
|
|
5
|
+
Debugger listening on ws://127.0.0.1:54357/1e98b399-c669-4aea-b93e-70d958a55aee
|
|
6
|
+
For help, see: https://nodejs.org/en/docs/inspector
|
|
7
|
+
Debugger attached.
|
|
8
|
+
[36mvite v6.0.11 [32mbuilding for production...[36m[39m
|
|
9
|
+
[2K[1Gtransforming (1) [2msrc/index.ts[22m[2K[1G../node_modules/swr/dist/_internal/config-context-client-Cm1JTDEP.mjs (1:0): Module level directives cause errors when bundled, "use client" in "../node_modules/swr/dist/_internal/config-context-client-Cm1JTDEP.mjs" was ignored.
|
|
10
|
+
[2K[1G[32m✓[39m 24 modules transformed.
|
|
11
|
+
[2K[1Grendering chunks (1)...[2K[1G[32m
|
|
12
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
13
|
+
[2K[1Gcomputing gzip size (0)...[2K[1Gcomputing gzip size (1)...[2K[1G[2mdist/[22m[36mindex.cjs [39m[1m[2m111.57 kB[22m[1m[22m[2m │ gzip: 32.45 kB[22m[2m │ map: 405.56 kB[22m
|
|
14
|
+
[32m[36m[vite:dts][32m Start rollup declaration files...[39m
|
|
15
|
+
Analysis will use the bundled TypeScript version 5.7.2
|
|
16
|
+
[32m[36m[vite:dts][32m Declaration files built in 1870ms.
|
|
17
|
+
[39m
|
|
18
|
+
[2K[1Grendering chunks (1)...[2K[1G[2K[1Gcomputing gzip size (1)...[2K[1G[2mdist/[22m[36mindex.js [39m[1m[2m164.95 kB[22m[1m[22m[2m │ gzip: 40.89 kB[22m[2m │ map: 422.53 kB[22m
|
|
19
|
+
[32m✓ built in 2.32s[39m
|
|
20
|
+
Waiting for the debugger to disconnect...
|
|
21
|
+
Waiting for the debugger to disconnect...
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";var ta=Object.defineProperty,na=Object.defineProperties;var ra=Object.getOwnPropertyDescriptors;var Vr=Object.getOwnPropertySymbols;var sa=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable;var Ur=(t,e,n)=>e in t?ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Be=(t,e)=>{for(var n in e||(e={}))sa.call(e,n)&&Ur(t,n,e[n]);if(Vr)for(var n of Vr(e))aa.call(e,n)&&Ur(t,n,e[n]);return t},Br=(t,e)=>na(t,ra(e));var ot=(t,e,n)=>new Promise((r,s)=>{var a=u=>{try{o(n.next(u))}catch(c){s(c)}},i=u=>{try{o(n.throw(u))}catch(c){s(c)}},o=u=>u.done?r(u.value):Promise.resolve(u.value).then(a,i);o((n=n.apply(t,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react");var ia=Object.defineProperty,oa=Object.defineProperties,ua=Object.getOwnPropertyDescriptors,qr=Object.getOwnPropertySymbols,ca=Object.prototype.hasOwnProperty,da=Object.prototype.propertyIsEnumerable,Kr=(t,e,n)=>e in t?ia(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,d=(t,e)=>{for(var n in e||(e={}))ca.call(e,n)&&Kr(t,n,e[n]);if(qr)for(var n of qr(e))da.call(e,n)&&Kr(t,n,e[n]);return t},k=(t,e)=>oa(t,ua(e)),Ee=(t,e,n)=>new Promise((r,s)=>{var a=u=>{try{o(n.next(u))}catch(c){s(c)}},i=u=>{try{o(n.throw(u))}catch(c){s(c)}},o=u=>u.done?r(u.value):Promise.resolve(u.value).then(a,i);o((n=n.apply(t,e)).next())}),C;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},t.getValidEnumValues=s=>{const a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(const i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(C||(C={}));var Bn;(function(t){t.mergeShapes=(e,n)=>d(d({},e),n)})(Bn||(Bn={}));const _=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pe=t=>{switch(typeof t){case"undefined":return _.undefined;case"string":return _.string;case"number":return isNaN(t)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(t)?_.array:t===null?_.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_.promise:typeof Map!="undefined"&&t instanceof Map?_.map:typeof Set!="undefined"&&t instanceof Set?_.set:typeof Date!="undefined"&&t instanceof Date?_.date:_.object;default:return _.unknown}},l=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),la=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class ie extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let o=r,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return s(this),r}static assert(e){if(!(e instanceof ie))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ie.create=t=>new ie(t);const mt=(t,e)=>{let n;switch(t.code){case l.invalid_type:t.received===_.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case l.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,C.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:n=`Unrecognized key(s) in object: ${C.joinValues(t.keys,", ")}`;break;case l.invalid_union:n="Invalid input";break;case l.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${C.joinValues(t.options)}`;break;case l.invalid_enum_value:n=`Invalid enum value. Expected ${C.joinValues(t.options)}, received '${t.received}'`;break;case l.invalid_arguments:n="Invalid function arguments";break;case l.invalid_return_type:n="Invalid function return type";break;case l.invalid_date:n="Invalid date";break;case l.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:C.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case l.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case l.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case l.custom:n="Invalid input";break;case l.invalid_intersection_types:n="Intersection results could not be merged";break;case l.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case l.not_finite:n="Number must be finite";break;default:n=e.defaultError,C.assertNever(t)}return{message:n}};let ks=mt;function fa(t){ks=t}function dn(){return ks}const ln=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,a=[...n,...s.path||[]],i=k(d({},s),{path:a});if(s.message!==void 0)return k(d({},s),{path:a,message:s.message});let o="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return k(d({},s),{path:a,message:o})},ha=[];function p(t,e){const n=dn(),r=ln({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===mt?void 0:mt].filter(s=>!!s)});t.common.issues.push(r)}class G{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return E;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static mergeObjectAsync(e,n){return Ee(this,null,function*(){const r=[];for(const s of n){const a=yield s.key,i=yield s.value;r.push({key:a,value:i})}return G.mergeObjectSync(e,r)})}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return E;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value!="undefined"||s.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const E=Object.freeze({status:"aborted"}),fn=t=>({status:"dirty",value:t}),ee=t=>({status:"valid",value:t}),qn=t=>t.status==="aborted",Kn=t=>t.status==="dirty",Xe=t=>t.status==="valid",Nt=t=>typeof Promise!="undefined"&&t instanceof Promise;function hn(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Es(t,e,n,r,s){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var b;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var Et,xt;class xe{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Hr=(t,e)=>{if(Xe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ie(t.common.issues);return this._error=n,this._error}}};function S(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,i)=>{var o,u;const{message:c}=t;return a.code==="invalid_enum_value"?{message:c!=null?c:i.defaultError}:typeof i.data=="undefined"?{message:(o=c!=null?c:r)!==null&&o!==void 0?o:i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:(u=c!=null?c:n)!==null&&u!==void 0?u:i.defaultError}},description:s}}class T{get description(){return this._def.description}_getType(e){return Pe(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new G,ctx:{common:e.parent.common,data:e.data,parsedType:Pe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Nt(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pe(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Hr(s,a)}"~validate"(e){var n,r;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pe(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:s});return Xe(a)?{value:a.value}:{issues:s.common.issues}}catch(a){!((r=(n=a==null?void 0:a.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(a=>Xe(a)?{value:a.value}:{issues:s.common.issues})}parseAsync(e,n){return Ee(this,null,function*(){const r=yield this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error})}safeParseAsync(e,n){return Ee(this,null,function*(){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pe(e)},s=this._parse({data:e,path:r.path,parent:r}),a=yield Nt(s)?s:Promise.resolve(s);return Hr(r,a)})}refine(e,n){const r=s=>typeof n=="string"||typeof n=="undefined"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue(d({code:l.custom},r(s)));return typeof Promise!="undefined"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new ye({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ke.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return gt.create(this,this._def)}or(e){return Dt.create([this,e],this._def)}and(e){return Mt.create(this,e,this._def)}transform(e){return new ye(k(d({},S(this._def)),{schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){const n=typeof e=="function"?e:()=>e;return new zt(k(d({},S(this._def)),{innerType:this,defaultValue:n,typeName:w.ZodDefault}))}brand(){return new Or(d({typeName:w.ZodBranded,type:this},S(this._def)))}catch(e){const n=typeof e=="function"?e:()=>e;return new Vt(k(d({},S(this._def)),{innerType:this,catchValue:n,typeName:w.ZodCatch}))}describe(e){const n=this.constructor;return new n(k(d({},this._def),{description:e}))}pipe(e){return Gt.create(this,e)}readonly(){return Ut.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pa=/^c[^\s-]{8,}$/i,ma=/^[0-9a-z]+$/,ya=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ga=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_a=/^[a-z0-9_-]{21}$/i,va=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ba=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ka="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Rn;const Ea=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Sa=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Oa=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ta=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Aa=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xs="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ca=new RegExp(`^${xs}$`);function Ss(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ra(t){return new RegExp(`^${Ss(t)}$`)}function Os(t){let e=`${xs}T${Ss(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Pa(t,e){return!!((e==="v4"||!e)&&Ea.test(t)||(e==="v6"||!e)&&Sa.test(t))}function Na(t,e){if(!va.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||!s.typ||!s.alg||e&&s.alg!==e)}catch(n){return!1}}function ja(t,e){return!!((e==="v4"||!e)&&xa.test(t)||(e==="v6"||!e)&&Oa.test(t))}class pe extends T{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const s=this._getOrReturnCtx(e);return p(s,{code:l.invalid_type,expected:_.string,received:s.parsedType}),E}const n=new G;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:l.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:l.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,i=e.data.length<s.value;(a||i)&&(r=this._getOrReturnCtx(e,r),a?p(r,{code:l.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):i&&p(r,{code:l.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")wa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"email",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Rn||(Rn=new RegExp(ka,"u")),Rn.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"emoji",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ga.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"uuid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")_a.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"nanoid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")pa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ma.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid2",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ya.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ulid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch(a){r=this._getOrReturnCtx(e,r),p(r,{validation:"url",code:l.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"regex",code:l.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),p(r,{code:l.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),p(r,{code:l.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),p(r,{code:l.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Os(s).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:l.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Ca.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:l.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Ra(s).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:l.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?ba.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"duration",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Pa(e.data,s.version)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ip",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Na(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"jwt",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?ja(e.data,s.version)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cidr",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ta.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"base64",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Aa.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"base64url",code:l.invalid_string,message:s.message}),n.dirty()):C.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),d({validation:n,code:l.invalid_string},b.errToObj(r)))}_addCheck(e){return new pe(k(d({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(d({kind:"email"},b.errToObj(e)))}url(e){return this._addCheck(d({kind:"url"},b.errToObj(e)))}emoji(e){return this._addCheck(d({kind:"emoji"},b.errToObj(e)))}uuid(e){return this._addCheck(d({kind:"uuid"},b.errToObj(e)))}nanoid(e){return this._addCheck(d({kind:"nanoid"},b.errToObj(e)))}cuid(e){return this._addCheck(d({kind:"cuid"},b.errToObj(e)))}cuid2(e){return this._addCheck(d({kind:"cuid2"},b.errToObj(e)))}ulid(e){return this._addCheck(d({kind:"ulid"},b.errToObj(e)))}base64(e){return this._addCheck(d({kind:"base64"},b.errToObj(e)))}base64url(e){return this._addCheck(d({kind:"base64url"},b.errToObj(e)))}jwt(e){return this._addCheck(d({kind:"jwt"},b.errToObj(e)))}ip(e){return this._addCheck(d({kind:"ip"},b.errToObj(e)))}cidr(e){return this._addCheck(d({kind:"cidr"},b.errToObj(e)))}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(d({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1},b.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(d({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},b.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(d({kind:"duration"},b.errToObj(e)))}regex(e,n){return this._addCheck(d({kind:"regex",regex:e},b.errToObj(n)))}includes(e,n){return this._addCheck(d({kind:"includes",value:e,position:n==null?void 0:n.position},b.errToObj(n==null?void 0:n.message)))}startsWith(e,n){return this._addCheck(d({kind:"startsWith",value:e},b.errToObj(n)))}endsWith(e,n){return this._addCheck(d({kind:"endsWith",value:e},b.errToObj(n)))}min(e,n){return this._addCheck(d({kind:"min",value:e},b.errToObj(n)))}max(e,n){return this._addCheck(d({kind:"max",value:e},b.errToObj(n)))}length(e,n){return this._addCheck(d({kind:"length",value:e},b.errToObj(n)))}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new pe(k(d({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new pe(k(d({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new pe(k(d({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pe.create=t=>{var e;return new pe(d({checks:[],typeName:w.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1},S(t)))};function Ia(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,a=parseInt(t.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}class Le extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){const s=this._getOrReturnCtx(e);return p(s,{code:l.invalid_type,expected:_.number,received:s.parsedType}),E}let n;const r=new G;for(const s of this._def.checks)s.kind==="int"?C.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:l.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:l.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:l.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?Ia(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),p(n,{code:l.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),p(n,{code:l.not_finite,message:s.message}),r.dirty()):C.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,r,s){return new Le(k(d({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:b.toString(s)}]}))}_addCheck(e){return new Le(k(d({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Le.create=t=>new Le(d({checks:[],typeName:w.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1},S(t)));class $e extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(s){return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let n;const r=new G;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:l.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),p(n,{code:l.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),p(n,{code:l.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):C.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.bigint,received:n.parsedType}),E}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,r,s){return new $e(k(d({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:b.toString(s)}]}))}_addCheck(e){return new $e(k(d({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}$e.create=t=>{var e;return new $e(d({checks:[],typeName:w.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1},S(t)))};class jt extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.boolean,received:n.parsedType}),E}return ee(e.data)}}jt.create=t=>new jt(d({typeName:w.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1},S(t)));class Ye extends T{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const s=this._getOrReturnCtx(e);return p(s,{code:l.invalid_type,expected:_.date,received:s.parsedType}),E}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return p(s,{code:l.invalid_date}),E}const n=new G;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:l.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:l.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):C.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ye(k(d({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ye.create=t=>new Ye(d({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:w.ZodDate},S(t)));class pn extends T{_parse(e){if(this._getType(e)!==_.symbol){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.symbol,received:n.parsedType}),E}return ee(e.data)}}pn.create=t=>new pn(d({typeName:w.ZodSymbol},S(t)));class It extends T{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.undefined,received:n.parsedType}),E}return ee(e.data)}}It.create=t=>new It(d({typeName:w.ZodUndefined},S(t)));class Zt extends T{_parse(e){if(this._getType(e)!==_.null){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.null,received:n.parsedType}),E}return ee(e.data)}}Zt.create=t=>new Zt(d({typeName:w.ZodNull},S(t)));class yt extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return ee(e.data)}}yt.create=t=>new yt(d({typeName:w.ZodAny},S(t)));class Je extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ee(e.data)}}Je.create=t=>new Je(d({typeName:w.ZodUnknown},S(t)));class je extends T{_parse(e){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.never,received:n.parsedType}),E}}je.create=t=>new je(d({typeName:w.ZodNever},S(t)));class mn extends T{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.void,received:n.parsedType}),E}return ee(e.data)}}mn.create=t=>new mn(d({typeName:w.ZodVoid},S(t)));class me extends T{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==_.array)return p(n,{code:l.invalid_type,expected:_.array,received:n.parsedType}),E;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,o=n.data.length<s.exactLength.value;(i||o)&&(p(n,{code:i?l.too_big:l.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:l.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:l.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,o)=>s.type._parseAsync(new xe(n,i,n.path,o)))).then(i=>G.mergeArray(r,i));const a=[...n.data].map((i,o)=>s.type._parseSync(new xe(n,i,n.path,o)));return G.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new me(k(d({},this._def),{minLength:{value:e,message:b.toString(n)}}))}max(e,n){return new me(k(d({},this._def),{maxLength:{value:e,message:b.toString(n)}}))}length(e,n){return new me(k(d({},this._def),{exactLength:{value:e,message:b.toString(n)}}))}nonempty(e){return this.min(1,e)}}me.create=(t,e)=>new me(d({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray},S(e)));function ut(t){if(t instanceof $){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ke.create(ut(r))}return new $(k(d({},t._def),{shape:()=>e}))}else return t instanceof me?new me(k(d({},t._def),{type:ut(t.element)})):t instanceof ke?ke.create(ut(t.unwrap())):t instanceof We?We.create(ut(t.unwrap())):t instanceof Se?Se.create(t.items.map(e=>ut(e))):t}class $ extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=C.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==_.object){const u=this._getOrReturnCtx(e);return p(u,{code:l.invalid_type,expected:_.object,received:u.parsedType}),E}const{status:n,ctx:r}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof je&&this._def.unknownKeys==="strip"))for(const u in r.data)a.includes(u)||i.push(u);const o=[];for(const u of a){const c=s[u],h=r.data[u];o.push({key:{status:"valid",value:u},value:c._parse(new xe(r,h,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof je){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of i)o.push({key:{status:"valid",value:c},value:{status:"valid",value:r.data[c]}});else if(u==="strict")i.length>0&&(p(r,{code:l.unrecognized_keys,keys:i}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of i){const h=r.data[c];o.push({key:{status:"valid",value:c},value:u._parse(new xe(r,h,r.path,c)),alwaysSet:c in r.data})}}return r.common.async?Promise.resolve().then(()=>Ee(this,null,function*(){const u=[];for(const c of o){const h=yield c.key,f=yield c.value;u.push({key:h,value:f,alwaysSet:c.alwaysSet})}return u})).then(u=>G.mergeObjectSync(n,u)):G.mergeObjectSync(n,o)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new $(d(k(d({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(n,r)=>{var s,a,i,o;const u=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(o=b.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}))}strip(){return new $(k(d({},this._def),{unknownKeys:"strip"}))}passthrough(){return new $(k(d({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new $(k(d({},this._def),{shape:()=>d(d({},this._def.shape()),e)}))}merge(e){return new $({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>d(d({},this._def.shape()),e._def.shape()),typeName:w.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new $(k(d({},this._def),{catchall:e}))}pick(e){const n={};return C.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new $(k(d({},this._def),{shape:()=>n}))}omit(e){const n={};return C.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new $(k(d({},this._def),{shape:()=>n}))}deepPartial(){return ut(this)}partial(e){const n={};return C.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}),new $(k(d({},this._def),{shape:()=>n}))}required(e){const n={};return C.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof ke;)s=s._def.innerType;n[r]=s}}),new $(k(d({},this._def),{shape:()=>n}))}keyof(){return Ts(C.objectKeys(this.shape))}}$.create=(t,e)=>new $(d({shape:()=>t,unknownKeys:"strip",catchall:je.create(),typeName:w.ZodObject},S(e)));$.strictCreate=(t,e)=>new $(d({shape:()=>t,unknownKeys:"strict",catchall:je.create(),typeName:w.ZodObject},S(e)));$.lazycreate=(t,e)=>new $(d({shape:t,unknownKeys:"strip",catchall:je.create(),typeName:w.ZodObject},S(e)));class Dt extends T{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new ie(o.ctx.common.issues));return p(n,{code:l.invalid_union,unionErrors:i}),E}if(n.common.async)return Promise.all(r.map(a=>Ee(this,null,function*(){const i=k(d({},n),{common:k(d({},n.common),{issues:[]}),parent:null});return{result:yield a._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}}))).then(s);{let a;const i=[];for(const u of r){const c=k(d({},n),{common:k(d({},n.common),{issues:[]}),parent:null}),h=u._parseSync({data:n.data,path:n.path,parent:c});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new ie(u));return p(n,{code:l.invalid_union,unionErrors:o}),E}}get options(){return this._def.options}}Dt.create=(t,e)=>new Dt(d({options:t,typeName:w.ZodUnion},S(e)));const Ie=t=>t instanceof $t?Ie(t.schema):t instanceof ye?Ie(t.innerType()):t instanceof Ft?[t.value]:t instanceof Fe?t.options:t instanceof Wt?C.objectValues(t.enum):t instanceof zt?Ie(t._def.innerType):t instanceof It?[void 0]:t instanceof Zt?[null]:t instanceof ke?[void 0,...Ie(t.unwrap())]:t instanceof We?[null,...Ie(t.unwrap())]:t instanceof Or||t instanceof Ut?Ie(t.unwrap()):t instanceof Vt?Ie(t._def.innerType):[];class kn extends T{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return p(n,{code:l.invalid_type,expected:_.object,received:n.parsedType}),E;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:l.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),E)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const a of n){const i=Ie(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new kn(d({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s},S(r)))}}function Hn(t,e){const n=Pe(t),r=Pe(e);if(t===e)return{valid:!0,data:t};if(n===_.object&&r===_.object){const s=C.objectKeys(e),a=C.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i=d(d({},t),e);for(const o of a){const u=Hn(t[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(n===_.array&&r===_.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],u=Hn(i,o);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===_.date&&r===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Mt extends T{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(a,i)=>{if(qn(a)||qn(i))return E;const o=Hn(a.value,i.value);return o.valid?((Kn(a)||Kn(i))&&n.dirty(),{status:n.value,value:o.data}):(p(r,{code:l.invalid_intersection_types}),E)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Mt.create=(t,e,n)=>new Mt(d({left:t,right:e,typeName:w.ZodIntersection},S(n)));class Se extends T{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==_.array)return p(r,{code:l.invalid_type,expected:_.array,received:r.parsedType}),E;if(r.data.length<this._def.items.length)return p(r,{code:l.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:l.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,i)=>{const o=this._def.items[i]||this._def.rest;return o?o._parse(new xe(r,a,r.path,i)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>G.mergeArray(n,a)):G.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Se(k(d({},this._def),{rest:e}))}}Se.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Se(d({items:t,typeName:w.ZodTuple,rest:null},S(e)))};class Lt extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==_.object)return p(r,{code:l.invalid_type,expected:_.object,received:r.parsedType}),E;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)s.push({key:a._parse(new xe(r,o,r.path,o)),value:i._parse(new xe(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?G.mergeObjectAsync(n,s):G.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof T?new Lt(d({keyType:e,valueType:n,typeName:w.ZodRecord},S(r))):new Lt(d({keyType:pe.create(),valueType:e,typeName:w.ZodRecord},S(n)))}}class yn extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==_.map)return p(r,{code:l.invalid_type,expected:_.map,received:r.parsedType}),E;const s=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,u],c)=>({key:s._parse(new xe(r,o,r.path,[c,"key"])),value:a._parse(new xe(r,u,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(()=>Ee(this,null,function*(){for(const u of i){const c=yield u.key,h=yield u.value;if(c.status==="aborted"||h.status==="aborted")return E;(c.status==="dirty"||h.status==="dirty")&&n.dirty(),o.set(c.value,h.value)}return{status:n.value,value:o}}))}else{const o=new Map;for(const u of i){const c=u.key,h=u.value;if(c.status==="aborted"||h.status==="aborted")return E;(c.status==="dirty"||h.status==="dirty")&&n.dirty(),o.set(c.value,h.value)}return{status:n.value,value:o}}}}yn.create=(t,e,n)=>new yn(d({valueType:e,keyType:t,typeName:w.ZodMap},S(n)));class Qe extends T{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==_.set)return p(r,{code:l.invalid_type,expected:_.set,received:r.parsedType}),E;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(p(r,{code:l.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(p(r,{code:l.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function i(u){const c=new Set;for(const h of u){if(h.status==="aborted")return E;h.status==="dirty"&&n.dirty(),c.add(h.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((u,c)=>a._parse(new xe(r,u,r.path,c)));return r.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,n){return new Qe(k(d({},this._def),{minSize:{value:e,message:b.toString(n)}}))}max(e,n){return new Qe(k(d({},this._def),{maxSize:{value:e,message:b.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Qe.create=(t,e)=>new Qe(d({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet},S(e)));class ht extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==_.function)return p(n,{code:l.invalid_type,expected:_.function,received:n.parsedType}),E;function r(o,u){return ln({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dn(),mt].filter(c=>!!c),issueData:{code:l.invalid_arguments,argumentsError:u}})}function s(o,u){return ln({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dn(),mt].filter(c=>!!c),issueData:{code:l.invalid_return_type,returnTypeError:u}})}const a={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof gt){const o=this;return ee(function(...u){return Ee(this,null,function*(){const c=new ie([]),h=yield o._def.args.parseAsync(u,a).catch(m=>{throw c.addIssue(r(u,m)),c}),f=yield Reflect.apply(i,this,h);return yield o._def.returns._def.type.parseAsync(f,a).catch(m=>{throw c.addIssue(s(f,m)),c})})})}else{const o=this;return ee(function(...u){const c=o._def.args.safeParse(u,a);if(!c.success)throw new ie([r(u,c.error)]);const h=Reflect.apply(i,this,c.data),f=o._def.returns.safeParse(h,a);if(!f.success)throw new ie([s(h,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ht(k(d({},this._def),{args:Se.create(e).rest(Je.create())}))}returns(e){return new ht(k(d({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new ht(d({args:e||Se.create([]).rest(Je.create()),returns:n||Je.create(),typeName:w.ZodFunction},S(r)))}}class $t extends T{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}$t.create=(t,e)=>new $t(d({getter:t,typeName:w.ZodLazy},S(e)));class Ft extends T{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:l.invalid_literal,expected:this._def.value}),E}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ft.create=(t,e)=>new Ft(d({value:t,typeName:w.ZodLiteral},S(e)));function Ts(t,e){return new Fe(d({values:t,typeName:w.ZodEnum},S(e)))}class Fe extends T{constructor(){super(...arguments),Et.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:C.joinValues(r),received:n.parsedType,code:l.invalid_type}),E}if(hn(this,Et)||Es(this,Et,new Set(this._def.values)),!hn(this,Et).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:l.invalid_enum_value,options:r}),E}return ee(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Fe.create(e,d(d({},this._def),n))}exclude(e,n=this._def){return Fe.create(this.options.filter(r=>!e.includes(r)),d(d({},this._def),n))}}Et=new WeakMap;Fe.create=Ts;class Wt extends T{constructor(){super(...arguments),xt.set(this,void 0)}_parse(e){const n=C.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==_.string&&r.parsedType!==_.number){const s=C.objectValues(n);return p(r,{expected:C.joinValues(s),received:r.parsedType,code:l.invalid_type}),E}if(hn(this,xt)||Es(this,xt,new Set(C.getValidEnumValues(this._def.values))),!hn(this,xt).has(e.data)){const s=C.objectValues(n);return p(r,{received:r.data,code:l.invalid_enum_value,options:s}),E}return ee(e.data)}get enum(){return this._def.values}}xt=new WeakMap;Wt.create=(t,e)=>new Wt(d({values:t,typeName:w.ZodNativeEnum},S(e)));class gt extends T{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==_.promise&&n.common.async===!1)return p(n,{code:l.invalid_type,expected:_.promise,received:n.parsedType}),E;const r=n.parsedType===_.promise?n.data:Promise.resolve(n.data);return ee(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}gt.create=(t,e)=>new gt(d({type:t,typeName:w.ZodPromise},S(e)));class ye extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{p(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(o=>Ee(this,null,function*(){if(n.value==="aborted")return E;const u=yield this._def.schema._parseAsync({data:o,path:r.path,parent:r});return u.status==="aborted"?E:u.status==="dirty"||n.value==="dirty"?fn(u.value):u}));{if(n.value==="aborted")return E;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?E:o.status==="dirty"||n.value==="dirty"?fn(o.value):o}}if(s.type==="refinement"){const i=o=>{const u=s.refinement(o,a);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?E:(o.status==="dirty"&&n.dirty(),i(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?E:(o.status==="dirty"&&n.dirty(),i(o.value).then(()=>({status:n.value,value:o.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Xe(i))return i;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Xe(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:n.value,value:o})):i);C.assertNever(s)}}ye.create=(t,e,n)=>new ye(d({schema:t,typeName:w.ZodEffects,effect:e},S(n)));ye.createWithPreprocess=(t,e,n)=>new ye(d({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects},S(n)));class ke extends T{_parse(e){return this._getType(e)===_.undefined?ee(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ke.create=(t,e)=>new ke(d({innerType:t,typeName:w.ZodOptional},S(e)));class We extends T{_parse(e){return this._getType(e)===_.null?ee(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}We.create=(t,e)=>new We(d({innerType:t,typeName:w.ZodNullable},S(e)));class zt extends T{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===_.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}zt.create=(t,e)=>new zt(d({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},S(e)));class Vt extends T{_parse(e){const{ctx:n}=this._processInputParams(e),r=k(d({},n),{common:k(d({},n.common),{issues:[]})}),s=this._def.innerType._parse({data:r.data,path:r.path,parent:d({},r)});return Nt(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ie(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ie(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Vt.create=(t,e)=>new Vt(d({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},S(e)));class gn extends T{_parse(e){if(this._getType(e)!==_.nan){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:_.nan,received:n.parsedType}),E}return{status:"valid",value:e.data}}}gn.create=t=>new gn(d({typeName:w.ZodNaN},S(t)));const Za=Symbol("zod_brand");class Or extends T{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Gt extends T{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return Ee(this,null,function*(){const s=yield this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?E:s.status==="dirty"?(n.dirty(),fn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})});{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?E:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Gt({in:e,out:n,typeName:w.ZodPipeline})}}class Ut extends T{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Xe(s)&&(s.value=Object.freeze(s.value)),s);return Nt(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Ut.create=(t,e)=>new Ut(d({innerType:t,typeName:w.ZodReadonly},S(e)));function As(t,e={},n){return t?yt.create().superRefine((r,s)=>{var a,i;if(!t(r)){const o=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:n)!==null&&i!==void 0?i:!0,c=typeof o=="string"?{message:o}:o;s.addIssue(k(d({code:"custom"},c),{fatal:u}))}}):yt.create()}const Da={object:$.lazycreate};var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const Ma=(t,e={message:`Input not instance of ${t.name}`})=>As(n=>n instanceof t,e),Cs=pe.create,Rs=Le.create,La=gn.create,$a=$e.create,Ps=jt.create,Fa=Ye.create,Wa=pn.create,za=It.create,Va=Zt.create,Ua=yt.create,Ba=Je.create,qa=je.create,Ka=mn.create,Ha=me.create,Ga=$.create,Ja=$.strictCreate,Xa=Dt.create,Ya=kn.create,Qa=Mt.create,ei=Se.create,ti=Lt.create,ni=yn.create,ri=Qe.create,si=ht.create,ai=$t.create,ii=Ft.create,oi=Fe.create,ui=Wt.create,ci=gt.create,Gr=ye.create,di=ke.create,li=We.create,fi=ye.createWithPreprocess,hi=Gt.create,pi=()=>Cs().optional(),mi=()=>Rs().optional(),yi=()=>Ps().optional(),gi={string:t=>pe.create(k(d({},t),{coerce:!0})),number:t=>Le.create(k(d({},t),{coerce:!0})),boolean:t=>jt.create(k(d({},t),{coerce:!0})),bigint:t=>$e.create(k(d({},t),{coerce:!0})),date:t=>Ye.create(k(d({},t),{coerce:!0}))},_i=E;var fe=Object.freeze({__proto__:null,defaultErrorMap:mt,setErrorMap:fa,getErrorMap:dn,makeIssue:ln,EMPTY_PATH:ha,addIssueToContext:p,ParseStatus:G,INVALID:E,DIRTY:fn,OK:ee,isAborted:qn,isDirty:Kn,isValid:Xe,isAsync:Nt,get util(){return C},get objectUtil(){return Bn},ZodParsedType:_,getParsedType:Pe,ZodType:T,datetimeRegex:Os,ZodString:pe,ZodNumber:Le,ZodBigInt:$e,ZodBoolean:jt,ZodDate:Ye,ZodSymbol:pn,ZodUndefined:It,ZodNull:Zt,ZodAny:yt,ZodUnknown:Je,ZodNever:je,ZodVoid:mn,ZodArray:me,ZodObject:$,ZodUnion:Dt,ZodDiscriminatedUnion:kn,ZodIntersection:Mt,ZodTuple:Se,ZodRecord:Lt,ZodMap:yn,ZodSet:Qe,ZodFunction:ht,ZodLazy:$t,ZodLiteral:Ft,ZodEnum:Fe,ZodNativeEnum:Wt,ZodPromise:gt,ZodEffects:ye,ZodTransformer:ye,ZodOptional:ke,ZodNullable:We,ZodDefault:zt,ZodCatch:Vt,ZodNaN:gn,BRAND:Za,ZodBranded:Or,ZodPipeline:Gt,ZodReadonly:Ut,custom:As,Schema:T,ZodSchema:T,late:Da,get ZodFirstPartyTypeKind(){return w},coerce:gi,any:Ua,array:Ha,bigint:$a,boolean:Ps,date:Fa,discriminatedUnion:Ya,effect:Gr,enum:oi,function:si,instanceof:Ma,intersection:Qa,lazy:ai,literal:ii,map:ni,nan:La,nativeEnum:ui,never:qa,null:Va,nullable:li,number:Rs,object:Ga,oboolean:yi,onumber:mi,optional:di,ostring:pi,pipeline:hi,preprocess:fi,promise:ci,record:ti,set:ri,strictObject:Ja,string:Cs,symbol:Wa,transformer:Gr,tuple:ei,undefined:za,union:Xa,unknown:Ba,void:Ka,NEVER:_i,ZodIssueCode:l,quotelessJson:la,ZodError:ie});fe.object({language:fe.enum(["typescript","javascript"]).optional()}).and(fe.union([fe.object({framework:fe.literal("react"),styling:fe.enum(["plain_css","css_modules","styled_components","tailwind","sass","scss","inline_styles"]),uiLibrary:fe.enum(["mui","antd","radix","shadcn"]).optional()}),fe.object({framework:fe.literal("html"),styling:fe.enum(["plain_css","inline_styles"]),enableTranslation:fe.boolean().optional()})]));const vi=t=>Object.entries(t).reduce((e,[n,r])=>(e[n]={content:r.code,isBinary:!1},e),{});var bi=Object.defineProperty,wi=Object.defineProperties,ki=Object.getOwnPropertyDescriptors,Jr=Object.getOwnPropertySymbols,Ei=Object.prototype.hasOwnProperty,xi=Object.prototype.propertyIsEnumerable,Xr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ns=t=>{throw TypeError(t)},Yr=(t,e,n)=>e in t?bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ae=(t,e)=>{for(var n in e||(e={}))Ei.call(e,n)&&Yr(t,n,e[n]);if(Jr)for(var n of Jr(e))xi.call(e,n)&&Yr(t,n,e[n]);return t},Tr=(t,e)=>wi(t,ki(e)),Ar=(t,e,n)=>e.has(t)||Ns("Cannot "+n),P=(t,e,n)=>(Ar(t,e,"read from private field"),n?n.call(t):e.get(t)),de=(t,e,n)=>e.has(t)?Ns("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),H=(t,e,n,r)=>(Ar(t,e,"write to private field"),e.set(t,n),n),be=(t,e,n)=>(Ar(t,e,"access private method"),n),z=(t,e,n)=>new Promise((r,s)=>{var a=u=>{try{o(n.next(u))}catch(c){s(c)}},i=u=>{try{o(n.throw(u))}catch(c){s(c)}},o=u=>u.done?r(u.value):Promise.resolve(u.value).then(a,i);o((n=n.apply(t,e)).next())}),Si=(t,e,n)=>(e=t[Xr("asyncIterator")])?e.call(t):(t=t[Xr("iterator")](),e={},n=(r,s)=>(s=t[r])&&(e[r]=a=>new Promise((i,o,u)=>(a=s.call(t,a),u=a.done,Promise.resolve(a.value).then(c=>i({value:c,done:u}),o)))),n("next"),n("return"),e),Oi=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ti(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gn={exports:{}},Ai=Gn.exports,Qr;function Ci(){return Qr||(Qr=1,function(t,e){(function(n,r){t.exports=r()})(Ai,function(){var n=typeof Promise=="function",r=typeof self=="object"?self:Oi,s=typeof Symbol!="undefined",a=typeof Map!="undefined",i=typeof Set!="undefined",o=typeof WeakMap!="undefined",u=typeof WeakSet!="undefined",c=typeof DataView!="undefined",h=s&&typeof Symbol.iterator!="undefined",f=s&&typeof Symbol.toStringTag!="undefined",m=i&&typeof Set.prototype.entries=="function",g=a&&typeof Map.prototype.entries=="function",x=m&&Object.getPrototypeOf(new Set().entries()),y=g&&Object.getPrototypeOf(new Map().entries()),O=h&&typeof Array.prototype[Symbol.iterator]=="function",v=O&&Object.getPrototypeOf([][Symbol.iterator]()),U=h&&typeof String.prototype[Symbol.iterator]=="function",W=U&&Object.getPrototypeOf(""[Symbol.iterator]()),te=8,B=-1;function J(D){var M=typeof D;if(M!=="object")return M;if(D===null)return"null";if(D===r)return"global";if(Array.isArray(D)&&(f===!1||!(Symbol.toStringTag in D)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&D===window.location)return"Location";if(typeof window.document=="object"&&D===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&D===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&D===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&D instanceof window.HTMLElement){if(D.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(D.tagName==="TD")return"HTMLTableDataCellElement";if(D.tagName==="TH")return"HTMLTableHeaderCellElement"}}var Oe=f&&D[Symbol.toStringTag];if(typeof Oe=="string")return Oe;var I=Object.getPrototypeOf(D);return I===RegExp.prototype?"RegExp":I===Date.prototype?"Date":n&&I===Promise.prototype?"Promise":i&&I===Set.prototype?"Set":a&&I===Map.prototype?"Map":u&&I===WeakSet.prototype?"WeakSet":o&&I===WeakMap.prototype?"WeakMap":c&&I===DataView.prototype?"DataView":a&&I===y?"Map Iterator":i&&I===x?"Set Iterator":O&&I===v?"Array Iterator":U&&I===W?"String Iterator":I===null?"Object":Object.prototype.toString.call(D).slice(te,B)}return J})}(Gn)),Gn.exports}var Ri=Ci();const Pi=Ti(Ri),Cr=typeof Buffer!="undefined",Ni=Cr&&typeof Buffer.from!="undefined",ji=Cr?function(t){return Buffer.isBuffer(t)}:function(){return!1},Ii=Ni?function(t){return Buffer.from(t)}:Cr?function(t){return new Buffer(t)}:function(t){return t};function _t(t){return ji(t)?"Buffer":Pi(t)}const Zi=new Set(["Arguments","Array","Map","Object","Set"]);function Di(t,e,n=null){switch(n||_t(t)){case"Arguments":case"Array":case"Object":return t[e];case"Map":return t.get(e);case"Set":return e}}function Jn(t){return Zi.has(t)}function es(t,e,n,r=null){switch(r||_t(t)){case"Arguments":case"Array":case"Object":t[e]=n;break;case"Map":t.set(e,n);break;case"Set":t.add(n);break}return t}const Mi=typeof globalThis!="undefined"&&globalThis!==null&&globalThis.Object===Object&&globalThis,Li=typeof global!="undefined"&&global!==null&&global.Object===Object&&global,$i=typeof self!="undefined"&&self!==null&&self.Object===Object&&self,Pn=Mi||Li||$i||Function("return this")();function Fi(t){return t.slice(0)}function Wi(t){return new Boolean(t.valueOf())}function zi(t){return new DataView(t.buffer)}function Vi(t){return Ii(t)}function Ui(t){return new Date(t.getTime())}function Bi(t){return new Number(t)}function qi(t){return new RegExp(t.source,t.flags)}function Ki(t){return new String(t)}function Ce(t,e){return Pn[e].from?Pn[e].from(t):new Pn[e](t)}function Y(t){return t}function ts(){return[]}function Hi(){return new Map}function Gi(){return{}}function Ji(){return new Set}const Xi=new Map([["ArrayBuffer",Fi],["Boolean",Wi],["Buffer",Vi],["DataView",zi],["Date",Ui],["Number",Bi],["RegExp",qi],["String",Ki],["Float32Array",Ce],["Float64Array",Ce],["Int16Array",Ce],["Int32Array",Ce],["Int8Array",Ce],["Uint16Array",Ce],["Uint32Array",Ce],["Uint8Array",Ce],["Uint8ClampedArray",Ce],["Array Iterator",Y],["Map Iterator",Y],["Promise",Y],["Set Iterator",Y],["String Iterator",Y],["function",Y],["global",Y],["WeakMap",Y],["WeakSet",Y],["boolean",Y],["null",Y],["number",Y],["string",Y],["symbol",Y],["undefined",Y],["Arguments",ts],["Array",ts],["Map",Hi],["Object",Gi],["Set",Ji]]);function Yi(){}function Xn(t,e=null,n=Yi){arguments.length===2&&typeof e=="function"&&(n=e,e=null);const r=e||_t(t),s=Xi.get(r);if(r==="Object"){const a=n(t,r);if(a!==void 0)return a}return s?s(t,r):t}function kt(t,e={}){typeof e=="function"&&(e={customizer:e});const{customizer:n}=e,r=_t(t);if(!Jn(r))return Yn(t,null,null,null);const s=Xn(t,r,n),a=new WeakMap([[t,s]]),i=new WeakSet([t]);return Yn(t,s,a,i)}function Yn(t,e,n,r,s){const a=_t(t),i=Xn(t,a);if(!Jn(a))return i;let o;switch(a){case"Arguments":case"Array":o=Object.keys(t);break;case"Object":o=Object.keys(t),o.push(...Object.getOwnPropertySymbols(t));break;case"Map":case"Set":o=t.keys();break}for(let u of o){const c=Di(t,u,a);if(r.has(c))es(e,u,n.get(c),a);else{const h=_t(c),f=Xn(c,h);Jn(h)&&(n.set(c,f),r.add(c)),es(e,u,Yn(c,f,n,r),a)}}return e}const Qi=t=>new Promise(e=>setTimeout(e,t));var sn,Ke,an,Qn,js;class eo{constructor({maxAttempts:e=3,func:n}){de(this,Qn),de(this,sn),de(this,Ke),de(this,an),H(this,sn,e),H(this,an,n),H(this,Ke,0)}run(){return z(this,null,function*(){try{return yield P(this,an).call(this)}catch(e){if(H(this,Ke,P(this,Ke)+1),P(this,Ke)>P(this,sn))throw console.error("Max attempts reached"),e;const n=be(this,Qn,js).call(this);return yield Qi(n),yield this.run()}})}}sn=new WeakMap,Ke=new WeakMap,an=new WeakMap,Qn=new WeakSet,js=function(){return P(this,Ke)*1e3*1.5};function to(){return typeof CompressionStream!="undefined"}function no(t){return z(this,null,function*(){const e=new Blob([t]).stream().pipeThrough(new CompressionStream("gzip")),n=[];try{for(var r=Si(e),s,a,i;s=!(a=yield r.next()).done;s=!1){const o=a.value;n.push(o)}}catch(o){i=[o]}finally{try{s&&(a=r.return)&&(yield a.call(r))}finally{if(i)throw i[0]}}return yield ro(n)})}function ro(t){return z(this,null,function*(){const e=yield new Blob(t).arrayBuffer();return new Uint8Array(e)})}class so extends Error{constructor({resource:e,api:n,args:r,cause:s}){if(super(`API Error on resource "${e}" at api "${n}"`),this.causeProperties={},this.name="API Error",this.resource=e,this.api=n,this.cause=s,this.args=r,s instanceof Error)for(const[i,o]of Object.entries(s))if(typeof Headers!="undefined"&&o instanceof Headers){const u={};o.forEach((c,h)=>{u[h]=c}),this.causeProperties[i]=u}else this.causeProperties[i]=o;const a=this.causeProperties.body;a&&typeof a=="object"&&"code"in a&&(this.code=a.code)}}class ns extends Error{constructor({url:e,method:n,statusCode:r,requestHeaders:s,responseHeaders:a,body:i}){if(super("Fetch Error"),this.name="Fetch Error",this.url=e,this.method=n,this.statusNumber=r,this.requestHeaders=s,this.responseHeaders=a,i)try{const o=JSON.parse(i);this.body=o}catch(o){this.body=i}}}class St extends Error{constructor(e={}){const{canceled:n=!1}=e;super("Abort Error"),this.name="Abort Error",this.canceled=n}}class ao extends Error{constructor(e){super(`Async API Error: ${JSON.stringify(e)}`),this.name="Async API Error",this.body=e}}class Nn extends Error{constructor(e){super(e),this.name="Request Validation Error"}}function Is(){return Array.from({length:32},()=>Math.floor(Math.random()*256).toString(16).padStart(2,"0")).join("")}function er(){return Math.floor(Date.now()/1e3).toString()}const io=5*60*1e3,oo=1*1e3;var He,ne,_e,tr,nr,Ot;class uo{constructor({fetch:e=globalThis.fetch.bind(globalThis),baseAddress:n}){de(this,_e),de(this,He),de(this,ne),this.baseAddress=n,H(this,He,e),H(this,ne,{}),this.plugins=[]}get headers(){throw new Error("Missing implementation")}addPlugin(e){this.plugins.push(e)}removePlugin(e){this.plugins=this.plugins.filter(n=>n.name!==e)}withOptions(e={}){return H(this,ne,e),this}get(e){return z(this,arguments,function*(n,r={}){const{overrideBaseAddress:s,overrideDefaultHeaders:a}=r,i=s!=null?s:this.baseAddress;let o=a!=null?a:this.headers;const u=kt(P(this,ne));return H(this,ne,{}),u.extraHeaders&&(o=ae(ae({},o),u.extraHeaders)),u.requestValidation&&(o=Tr(ae({},o),{"X-Request-Nonce":Is(),"X-Request-Timestamp":er()})),u.async?yield be(this,_e,nr).call(this,`${i}${n}`,u.async,{headers:o}):yield be(this,_e,tr).call(this,`${i}${n}`,u,{headers:o})})}post(e,n){return z(this,arguments,function*(r,s,a={}){const i=kt(P(this,ne));return H(this,ne,{}),be(this,_e,Ot).call(this,r,"POST",s,a,i)})}put(e,n){return z(this,arguments,function*(r,s,a={}){const i=kt(P(this,ne));return H(this,ne,{}),be(this,_e,Ot).call(this,r,"PUT",s,a,i)})}delete(e,n){return z(this,arguments,function*(r,s,a={}){const i=kt(P(this,ne));return H(this,ne,{}),be(this,_e,Ot).call(this,r,"DELETE",s,a,i)})}patch(e,n){return z(this,arguments,function*(r,s,a={}){const i=kt(P(this,ne));return H(this,ne,{}),be(this,_e,Ot).call(this,r,"PATCH",s,a,i)})}}He=new WeakMap,ne=new WeakMap,_e=new WeakSet,tr=function(t,e,n){return z(this,null,function*(){const r=()=>z(this,null,function*(){var u,c;try{return yield P(this,He).call(this,t,ae(ae({},n),e.abortSignal&&{signal:e.abortSignal}))}catch(h){throw h instanceof Error&&h.name==="AbortError"?new St({canceled:(c=(u=e.abortSignal)==null?void 0:u.aborted)!=null?c:!1}):h}}),{headers:s}=n!=null?n:{},a=(u,c)=>{var h,f;return((h=u==null?void 0:u.headers)==null?void 0:h.get(c))||((f=u==null?void 0:u.headersObject)==null?void 0:f[c])||""},i=u=>z(this,null,function*(){var c;if(!u.ok){const f=yield u.text().catch();throw new ns({url:t,method:(c=n==null?void 0:n.method)!=null?c:"GET",statusCode:u.status,requestHeaders:s,responseHeaders:u.headers,body:f})}if(e.requestValidation&&process.env.UI_TESTS!==!0)try{const f=a(u,"x-response-nonce"),m=s==null?void 0:s["X-Request-Nonce"];if(!f||f!==m)throw new Nn("Response nonce mismatch");const g=Number(a(u,"x-response-timestamp")),x=Number(er()),y=60*60*24;if(isNaN(g)||Math.abs(x-g)>y)throw new Nn("Invalid response timestamp")}catch(f){const m=f instanceof Error?f.message:"Request validation failed";throw new Nn(m)}let h=yield u.text();try{h=JSON.parse(h)}catch(f){}return h});if(e.retry){const u=yield new eo({maxAttempts:e.retry,func:r}).run();return yield i(u)}const o=yield r();return yield i(o)})},nr=function(t,e,n){return z(this,null,function*(){var r,s;const{onProgress:a,abortSignal:i,pollingInterval:o=()=>oo,maxTimeout:u=io}=e,c=`${t}/async`,h=`${t}/async/job`;let f;try{f=yield P(this,He).call(this,c,ae(ae({},n),i&&{signal:i}))}catch(x){throw x instanceof Error&&x.name==="AbortError"?new St({canceled:(r=i==null?void 0:i.aborted)!=null?r:!1}):x}if(!f.ok){const x=yield f.text().catch();throw new ns({url:t,method:(s=n==null?void 0:n.method)!=null?s:"GET",statusCode:f.status,requestHeaders:this.headers,responseHeaders:f.headers,body:x})}const m=yield f.json(),{job_id:g}=m;if(!g)throw new Error("Job ID not found in response");return new Promise((x,y)=>z(this,null,function*(){const O=setTimeout(()=>{y(new Error("Job timed out"))},u),v=(U=0)=>z(this,null,function*(){if(i!=null&&i.aborted){clearTimeout(O),P(this,He).call(this,`${h}/${g}/cancel`,{method:"POST",headers:this.headers}).then(()=>{y(new St({canceled:!0}))}).catch(W=>{y(new St({canceled:!1}))});return}try{const W=yield(yield P(this,He).call(this,`${h}/${g}`,{headers:this.headers})).json();if(W.status==="success"){clearTimeout(O);const te=W.response_json;x(te)}else if(W.status==="failed")clearTimeout(O),y(new ao(W.response_json));else{a&&a(W.response_json);const te=o(U);setTimeout(()=>v(U+1),te)}}catch(W){y(W)}});v()}))})},Ot=function(t,e,n,r,s){return z(this,null,function*(){const{overrideBaseAddress:a,overrideDefaultHeaders:i}=r,o=a!=null?a:this.baseAddress;let u=i!=null?i:this.headers;s.extraHeaders&&(u=ae(ae({},u),s.extraHeaders)),s.requestValidation&&(u=Tr(ae({},u),{"X-Request-Nonce":Is(),"X-Request-Timestamp":er()}));let c=r.skipBodyJsonStringify?n:JSON.stringify(n);return s.compress&&to()&&(u["Content-Encoding"]="gzip",c=yield no(c)),s.async?yield be(this,_e,nr).call(this,`${o}${t}`,s.async,{method:e,headers:u,body:c}):yield be(this,_e,tr).call(this,`${o}${t}`,s,{method:e,headers:u,body:c})})};const rs=(t,e,n,r)=>t instanceof St?t:new so({resource:e,api:String(n),args:r,cause:t}),jn=(t,e)=>new Proxy(e,{get(n,r){return(...s)=>{var a;for(const o of t.plugins){const u=(a=o.beforeApi)==null?void 0:a.call(o,{resource:n.resourceName,api:r,args:s});if(u!==void 0)return u}let i;try{i=n[r](...s)}catch(o){throw rs(o,n.resourceName,r,s)}return i instanceof Promise?i.catch(o=>{throw rs(o,n.resourceName,r,s)}):i}}});var Tt;class co{constructor(e){de(this,Tt),this.resourceName="Files",H(this,Tt,e)}get(e){return z(this,arguments,function*({fileKey:n,params:r={}}){const s=new URLSearchParams(ae({plugin_data:"857346721138427857"},r)).toString(),a=`v1/files/${n}?${s}`;return yield P(this,Tt).get(a)})}getImageFills(e){return z(this,arguments,function*({fileKey:n}){var r,s;const a=`v1/files/${n}/images`;return(s=(r=(yield P(this,Tt).get(a)).meta)==null?void 0:r.images)!=null?s:{}})}}Tt=new WeakMap;const lo=(t,e,n)=>{const r=e.sort();return`${t}-${r.join("-")}-${n}`},fo=t=>t?t.ts>Date.now()-1e3*30:!1;var ve,rr,Zs;class ho{constructor(e){de(this,rr),de(this,ve),this.resourceName="Images",H(this,ve,e)}get(e){return z(this,arguments,function*({fileKey:n,nodeIds:r,format:s="jpg",scale:a}){const i=lo(n,r,s),o=P(this,ve).cache.images.entries.get(i);if(fo(o))return o.result;o&&P(this,ve).cache.images.entries.delete(i);const u=P(this,ve).cache.images.pendingRequests.get(i);if(u)return u;const c=be(this,rr,Zs).call(this,i,n,r,s,a);P(this,ve).cache.images.pendingRequests.set(i,c);try{return yield c}finally{P(this,ve).cache.images.pendingRequests.delete(i)}})}}ve=new WeakMap,rr=new WeakSet,Zs=function(t,e,n,r,s){return z(this,null,function*(){const a=yield P(this,ve).get(`v1/images/${e}?ids=${n}&format=${r}${s?`&scale=${s}`:""}`);return P(this,ve).cache.images.entries.set(t,{result:a,ts:Date.now()}),a})};var on;class po{constructor(e){de(this,on),this.resourceName="Nodes",H(this,on,e)}get(e){return z(this,arguments,function*({fileKey:n,nodeIds:r,params:s={}}){const a=Tr(ae({},s),{ids:r.join(",")}),i=new URLSearchParams(ae({plugin_data:"857346721138427857"},a)).toString(),o=`v1/files/${n}/nodes?${i}`;return yield P(this,on).get(o)})}}on=new WeakMap;var Ze;class mo extends uo{constructor({baseAddress:e="https://api.figma.com/",fetch:n=globalThis.fetch.bind(globalThis)}={}){super({fetch:n,baseAddress:e}),de(this,Ze,""),this.cache={images:{entries:new Map,pendingRequests:new Map}},this.files=jn(this,new co(this)),this.nodes=jn(this,new po(this)),this.images=jn(this,new ho(this))}set token(e){if(!e.startsWith("figd_")&&!e.startsWith("figu_"))throw new Error("Invalid Figma access token");H(this,Ze,e)}get token(){return P(this,Ze)}get headers(){const e={"Content-Type":"application/json"};return P(this,Ze).startsWith("figd_")?e["X-FIGMA-TOKEN"]=P(this,Ze):P(this,Ze).startsWith("figu_")&&(e.Authorization=`Bearer ${P(this,Ze)}`),e}}Ze=new WeakMap;const yo=t=>Ee(void 0,[t],function*({fileKey:e,authToken:n,figmaRestApi:r=new mo,params:s={}}){n&&(r.token=n);try{return yield r.files.get({fileKey:e,params:s})}catch(a){throw console.error(a),a}});var go=Object.defineProperty,_o=(t,e,n)=>e in t?go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,en=(t,e,n)=>_o(t,typeof e!="symbol"?e+"":e,n);class ss extends Error{constructor(e,n){super(e),en(this,"type"),en(this,"field"),en(this,"value"),en(this,"line"),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}function In(t){}function vo(t){const{onEvent:e=In,onError:n=In,onRetry:r=In,onComment:s}=t;let a="",i=!0,o,u="",c="";function h(y){const O=i?y.replace(/^\xEF\xBB\xBF/,""):y,[v,U]=bo(`${a}${O}`);for(const W of v)f(W);a=U,i=!1}function f(y){if(y===""){g();return}if(y.startsWith(":")){s&&s(y.slice(y.startsWith(": ")?2:1));return}const O=y.indexOf(":");if(O!==-1){const v=y.slice(0,O),U=y[O+1]===" "?2:1,W=y.slice(O+U);m(v,W,y);return}m(y,"",y)}function m(y,O,v){switch(y){case"event":c=O;break;case"data":u=`${u}${O}
|
|
2
|
+
`;break;case"id":o=O.includes("\0")?void 0:O;break;case"retry":/^\d+$/.test(O)?r(parseInt(O,10)):n(new ss(`Invalid \`retry\` value: "${O}"`,{type:"invalid-retry",value:O,line:v}));break;default:n(new ss(`Unknown field "${y.length>20?`${y.slice(0,20)}…`:y}"`,{type:"unknown-field",field:y,value:O,line:v}));break}}function g(){u.length>0&&e({id:o,event:c||void 0,data:u.endsWith(`
|
|
3
|
+
`)?u.slice(0,-1):u}),o=void 0,u="",c=""}function x(y={}){a&&y.consume&&f(a),o=void 0,u="",c="",a=""}return{feed:h,reset:x}}function bo(t){const e=[];let n="";const r=t.length;for(let s=0;s<r;s++){const a=t[s];a==="\r"&&t[s+1]===`
|
|
4
|
+
`?(e.push(n),n="",s++):a==="\r"||a===`
|
|
5
|
+
`?(e.push(n),n=""):n+=a}return[e,n]}class as extends Event{constructor(e,n){var r,s;super(e),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(s=n==null?void 0:n.message)!=null?s:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,n,r){return r(is(this),n)}[Symbol.for("Deno.customInspect")](e,n){return e(is(this),n)}}function wo(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function sr(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(sr).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${sr(t.cause)}`:t.message:`${t}`}function is(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var Ds=t=>{throw TypeError(t)},Rr=(t,e,n)=>e.has(t)||Ds("Cannot "+n),A=(t,e,n)=>(Rr(t,e,"read from private field"),n?n.call(t):e.get(t)),V=(t,e,n)=>e.has(t)?Ds("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Z=(t,e,n,r)=>(Rr(t,e,"write to private field"),e.set(t,n),n),Re=(t,e,n)=>(Rr(t,e,"access private method"),n),re,Ge,ct,un,_n,Rt,ft,Pt,De,dt,pt,lt,At,he,ar,ir,or,os,ur,cr,Ct,dr,lr;class cn extends EventTarget{constructor(e,n){var r,s;super(),V(this,he),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,V(this,re),V(this,Ge),V(this,ct),V(this,un),V(this,_n),V(this,Rt),V(this,ft),V(this,Pt,null),V(this,De),V(this,dt),V(this,pt,null),V(this,lt,null),V(this,At,null),V(this,ir,a=>ot(this,null,function*(){var i;A(this,dt).reset();const{body:o,redirected:u,status:c,headers:h}=a;if(c===204){Re(this,he,Ct).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Z(this,ct,new URL(a.url)):Z(this,ct,void 0),c!==200){Re(this,he,Ct).call(this,`Non-200 status code (${c})`,c);return}if(!(h.get("content-type")||"").startsWith("text/event-stream")){Re(this,he,Ct).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(A(this,re)===this.CLOSED)return;Z(this,re,this.OPEN);const f=new Event("open");if((i=A(this,At))==null||i.call(this,f),this.dispatchEvent(f),typeof o!="object"||!o||!("getReader"in o)){Re(this,he,Ct).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const m=new TextDecoder,g=o.getReader();let x=!0;do{const{done:y,value:O}=yield g.read();O&&A(this,dt).feed(m.decode(O,{stream:!y})),y&&(x=!1,A(this,dt).reset(),Re(this,he,dr).call(this))}while(x)})),V(this,or,a=>{Z(this,De,void 0),!(a.name==="AbortError"||a.type==="aborted")&&Re(this,he,dr).call(this,sr(a))}),V(this,ur,a=>{typeof a.id=="string"&&Z(this,Pt,a.id);const i=new MessageEvent(a.event||"message",{data:a.data,origin:A(this,ct)?A(this,ct).origin:A(this,Ge).origin,lastEventId:a.id||""});A(this,lt)&&(!a.event||a.event==="message")&&A(this,lt).call(this,i),this.dispatchEvent(i)}),V(this,cr,a=>{Z(this,Rt,a)}),V(this,lr,()=>{Z(this,ft,void 0),A(this,re)===this.CONNECTING&&Re(this,he,ar).call(this)});try{if(e instanceof URL)Z(this,Ge,e);else if(typeof e=="string")Z(this,Ge,new URL(e,ko()));else throw new Error("Invalid URL")}catch(a){throw wo("An invalid or illegal string was specified")}Z(this,dt,vo({onEvent:A(this,ur),onRetry:A(this,cr)})),Z(this,re,this.CONNECTING),Z(this,Rt,3e3),Z(this,_n,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Z(this,un,(s=n==null?void 0:n.withCredentials)!=null?s:!1),Re(this,he,ar).call(this)}get readyState(){return A(this,re)}get url(){return A(this,Ge).href}get withCredentials(){return A(this,un)}get onerror(){return A(this,pt)}set onerror(e){Z(this,pt,e)}get onmessage(){return A(this,lt)}set onmessage(e){Z(this,lt,e)}get onopen(){return A(this,At)}set onopen(e){Z(this,At,e)}addEventListener(e,n,r){const s=n;super.addEventListener(e,s,r)}removeEventListener(e,n,r){const s=n;super.removeEventListener(e,s,r)}close(){A(this,ft)&&clearTimeout(A(this,ft)),A(this,re)!==this.CLOSED&&(A(this,De)&&A(this,De).abort(),Z(this,re,this.CLOSED),Z(this,De,void 0))}}re=new WeakMap,Ge=new WeakMap,ct=new WeakMap,un=new WeakMap,_n=new WeakMap,Rt=new WeakMap,ft=new WeakMap,Pt=new WeakMap,De=new WeakMap,dt=new WeakMap,pt=new WeakMap,lt=new WeakMap,At=new WeakMap,he=new WeakSet,ar=function(){Z(this,re,this.CONNECTING),Z(this,De,new AbortController),A(this,_n)(A(this,Ge),Re(this,he,os).call(this)).then(A(this,ir)).catch(A(this,or))},ir=new WeakMap,or=new WeakMap,os=function(){var t;const e={mode:"cors",redirect:"follow",headers:Be({Accept:"text/event-stream"},A(this,Pt)?{"Last-Event-ID":A(this,Pt)}:void 0),cache:"no-store",signal:(t=A(this,De))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},ur=new WeakMap,cr=new WeakMap,Ct=function(t,e){var n;A(this,re)!==this.CLOSED&&Z(this,re,this.CLOSED);const r=new as("error",{code:e,message:t});(n=A(this,pt))==null||n.call(this,r),this.dispatchEvent(r)},dr=function(t,e){var n;if(A(this,re)===this.CLOSED)return;Z(this,re,this.CONNECTING);const r=new as("error",{code:e,message:t});(n=A(this,pt))==null||n.call(this,r),this.dispatchEvent(r),Z(this,ft,setTimeout(A(this,lr),A(this,Rt)))},lr=new WeakMap,cn.CONNECTING=0,cn.OPEN=1,cn.CLOSED=2;function ko(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}var Ms=Symbol.for("immer-nothing"),us=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state"),Eo=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function se(t,...e){if(process.env.NODE_ENV!=="production"){const n=Eo[t],r=typeof n=="function"?n.apply(null,e):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var vt=Object.getPrototypeOf;function bt(t){return!!t&&!!t[oe]}function et(t){var e;return t?Ls(t)||Array.isArray(t)||!!t[us]||!!((e=t.constructor)!=null&&e[us])||xn(t)||Sn(t):!1}var xo=Object.prototype.constructor.toString();function Ls(t){if(!t||typeof t!="object")return!1;const e=vt(t);if(e===null)return!0;const n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===xo}function vn(t,e){En(t)===0?Reflect.ownKeys(t).forEach(n=>{e(n,t[n],t)}):t.forEach((n,r)=>e(r,n,t))}function En(t){const e=t[oe];return e?e.type_:Array.isArray(t)?1:xn(t)?2:Sn(t)?3:0}function fr(t,e){return En(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function $s(t,e,n){const r=En(t);r===2?t.set(e,n):r===3?t.add(n):t[e]=n}function So(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function xn(t){return t instanceof Map}function Sn(t){return t instanceof Set}function qe(t){return t.copy_||t.base_}function hr(t,e){if(xn(t))return new Map(t);if(Sn(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=Ls(t);if(e===!0||e==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(t);delete r[oe];let s=Reflect.ownKeys(r);for(let a=0;a<s.length;a++){const i=s[a],o=r[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(vt(t),r)}else{const r=vt(t);if(r!==null&&n)return Be({},t);const s=Object.create(r);return Object.assign(s,t)}}function Bt(t,e=!1){return On(t)||bt(t)||!et(t)||(En(t)>1&&(t.set=t.add=t.clear=t.delete=Oo),Object.freeze(t),e&&Object.entries(t).forEach(([n,r])=>Bt(r,!0))),t}function Oo(){se(2)}function On(t){return Object.isFrozen(t)}var To={};function tt(t){const e=To[t];return e||se(0,t),e}var qt;function Fs(){return qt}function Ao(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function cs(t,e){e&&(tt("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function pr(t){mr(t),t.drafts_.forEach(Co),t.drafts_=null}function mr(t){t===qt&&(qt=t.parent_)}function ds(t){return qt=Ao(qt,t)}function Co(t){const e=t[oe];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function ls(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[oe].modified_&&(pr(e),se(4)),et(t)&&(t=bn(e,t),e.parent_||wn(e,t)),e.patches_&&tt("Patches").generateReplacementPatches_(n[oe].base_,t,e.patches_,e.inversePatches_)):t=bn(e,n,[]),pr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Ms?t:void 0}function bn(t,e,n){if(On(e))return e;const r=e[oe];if(!r)return vn(e,(s,a)=>fs(t,r,e,s,a,n)),e;if(r.scope_!==t)return e;if(!r.modified_)return wn(t,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let a=s,i=!1;r.type_===3&&(a=new Set(s),s.clear(),i=!0),vn(a,(o,u)=>fs(t,r,s,o,u,n,i)),wn(t,s,!1),n&&t.patches_&&tt("Patches").generatePatches_(r,n,t.patches_,t.inversePatches_)}return r.copy_}function fs(t,e,n,r,s,a,i){if(process.env.NODE_ENV!=="production"&&s===n&&se(5),bt(s)){const o=a&&e&&e.type_!==3&&!fr(e.assigned_,r)?a.concat(r):void 0,u=bn(t,s,o);if($s(n,r,u),bt(u))t.canAutoFreeze_=!1;else return}else i&&n.add(s);if(et(s)&&!On(s)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;bn(t,s),(!e||!e.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&wn(t,s)}}function wn(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Bt(e,n)}function Ro(t,e){const n=Array.isArray(t),r={type_:n?1:0,scope_:e?e.scope_:Fs(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=Pr;n&&(s=[r],a=Kt);const{revoke:i,proxy:o}=Proxy.revocable(s,a);return r.draft_=o,r.revoke_=i,o}var Pr={get(t,e){if(e===oe)return t;const n=qe(t);if(!fr(n,e))return Po(t,n,e);const r=n[e];return t.finalized_||!et(r)?r:r===Zn(t.base_,e)?(Dn(t),t.copy_[e]=gr(r,t)):r},has(t,e){return e in qe(t)},ownKeys(t){return Reflect.ownKeys(qe(t))},set(t,e,n){const r=Ws(qe(t),e);if(r!=null&&r.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const s=Zn(qe(t),e),a=s==null?void 0:s[oe];if(a&&a.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(So(n,s)&&(n!==void 0||fr(t.base_,e)))return!0;Dn(t),yr(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return Zn(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,Dn(t),yr(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=qe(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},defineProperty(){se(11)},getPrototypeOf(t){return vt(t.base_)},setPrototypeOf(){se(12)}},Kt={};vn(Pr,(t,e)=>{Kt[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});Kt.deleteProperty=function(t,e){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(e))&&se(13),Kt.set.call(this,t,e,void 0)};Kt.set=function(t,e,n){return process.env.NODE_ENV!=="production"&&e!=="length"&&isNaN(parseInt(e))&&se(14),Pr.set.call(this,t[0],e,n,t[0])};function Zn(t,e){const n=t[oe];return(n?qe(n):t)[e]}function Po(t,e,n){var s;const r=Ws(e,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(t.draft_):void 0}function Ws(t,e){if(!(e in t))return;let n=vt(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=vt(n)}}function yr(t){t.modified_||(t.modified_=!0,t.parent_&&yr(t.parent_))}function Dn(t){t.copy_||(t.copy_=hr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var No=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,r)=>{if(typeof e=="function"&&typeof n!="function"){const a=n;n=e;const i=this;return function(u=a,...c){return i.produce(u,h=>n.call(this,h,...c))}}typeof n!="function"&&se(6),r!==void 0&&typeof r!="function"&&se(7);let s;if(et(e)){const a=ds(this),i=gr(e,void 0);let o=!0;try{s=n(i),o=!1}finally{o?pr(a):mr(a)}return cs(a,r),ls(s,a)}else if(!e||typeof e!="object"){if(s=n(e),s===void 0&&(s=e),s===Ms&&(s=void 0),this.autoFreeze_&&Bt(s,!0),r){const a=[],i=[];tt("Patches").generateReplacementPatches_(e,s,a,i),r(a,i)}return s}else se(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(i,...o)=>this.produceWithPatches(i,u=>e(u,...o));let r,s;return[this.produce(e,n,(i,o)=>{r=i,s=o}),r,s]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){et(t)||se(8),bt(t)&&(t=jo(t));const e=ds(this),n=gr(t,void 0);return n[oe].isManual_=!0,mr(e),n}finishDraft(t,e){const n=t&&t[oe];(!n||!n.isManual_)&&se(9);const{scope_:r}=n;return cs(r,e),ls(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const s=e[n];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}n>-1&&(e=e.slice(n+1));const r=tt("Patches").applyPatches_;return bt(t)?r(t,e):this.produce(t,s=>r(s,e))}};function gr(t,e){const n=xn(t)?tt("MapSet").proxyMap_(t,e):Sn(t)?tt("MapSet").proxySet_(t,e):Ro(t,e);return(e?e.scope_:Fs()).drafts_.push(n),n}function jo(t){return bt(t)||se(10,t),zs(t)}function zs(t){if(!et(t)||On(t))return t;const e=t[oe];let n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=hr(t,e.scope_.immer_.useStrictShallowCopy_)}else n=hr(t,!0);return vn(n,(r,s)=>{$s(n,r,zs(s))}),e&&(e.finalized_=!1),n}var ue=new No,Io=ue.produce;ue.produceWithPatches.bind(ue);ue.setAutoFreeze.bind(ue);ue.setUseStrictShallowCopy.bind(ue);ue.applyPatches.bind(ue);ue.createDraft.bind(ue);ue.finishDraft.bind(ue);function Zo(t){var e=L.useState(function(){return Bt(typeof t=="function"?t():t,!0)}),n=e[1];return[e[0],L.useCallback(function(r){n(typeof r=="function"?Io(r):Bt(r))},[])]}const hs={status:"idle",error:null,result:null,tasks:{fetchDesign:{status:"pending"},codeGeneration:{status:"pending",progress:0},uploadAssets:{status:"pending"}}},Do=({url:t,method:e="POST"})=>{const[n,r]=Zo(hs);return{getCode:a=>ot(exports,null,function*(){var u;r(c=>{c.status="pending",c.error=null,c.result=null,c.tasks=hs.tasks});const i=new cn(t,{fetch:(c,h)=>fetch(c,Br(Be({},h),{method:e,body:JSON.stringify(a)}))}),o=new Promise(c=>{const h={};i.addEventListener("start",f=>{const m=JSON.parse(f.data);h.sessionId=m.sessionId,r(g=>{g.tasks.fetchDesign.status="running"})}),i.addEventListener("pre_codegen",f=>{JSON.parse(f.data).message==="Anima model built"&&r(g=>{g.tasks.fetchDesign.status="finished",g.tasks.codeGeneration.status="running",g.tasks.uploadAssets.status="running"})}),i.addEventListener("figma_metadata",f=>{const m=JSON.parse(f.data);h.figmaFileName=m.figmaFileName,h.figmaSelectedFrameName=m.figmaSelectedFrameName}),i.addEventListener("aborted",f=>{r(m=>{m.status="aborted"}),c({result:null,error:new Error("The request was aborted")})}),i.addEventListener("generating_code",f=>{const m=JSON.parse(f.data);if(m.payload.status==="success"){const g=m.payload.files;h.files=vi(g)}r(g=>{g.tasks.codeGeneration.progress=m.payload.progress})}),i.addEventListener("codegen_completed",f=>{r(m=>{m.tasks.codeGeneration.status="finished"})}),i.addEventListener("assets_uploaded",f=>{r(m=>{m.tasks.uploadAssets.status="finished"})}),i.addEventListener("error",f=>{if(f instanceof MessageEvent){const m=JSON.parse(f.data);r(g=>{g.status="error",g.error=new Error(m.payload.message)}),c({result:null,error:new Error(m.payload.message)})}else console.error("EventSource error:",f),r(m=>{m.status="error",m.error=new Error("HTTP error: "+f.message)}),c({result:null,error:new Error("HTTP error: "+f.message)})}),i.addEventListener("done",f=>{r(m=>{m.status="success",m.result=h}),c({result:h,error:null})})});try{const{result:c,error:h}=yield o;return h?{result:null,error:h}:Object.keys((u=c==null?void 0:c.files)!=null?u:{}).length===0?{result:null,error:new Error("No files received")}:{result:c,error:h}}finally{i.close()}}),status:n.status,tasks:n.tasks,error:n.error,result:n.result}};var tn={exports:{}},Mn={};/**
|
|
6
|
+
* @license React
|
|
7
|
+
* use-sync-external-store-shim.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/var ps;function Mo(){if(ps)return Mn;ps=1;var t=L;function e(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,s=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function o(f,m){var g=m(),x=r({inst:{value:g,getSnapshot:m}}),y=x[0].inst,O=x[1];return a(function(){y.value=g,y.getSnapshot=m,u(y)&&O({inst:y})},[f,g,m]),s(function(){return u(y)&&O({inst:y}),f(function(){u(y)&&O({inst:y})})},[f]),i(g),g}function u(f){var m=f.getSnapshot;f=f.value;try{var g=m();return!n(f,g)}catch(x){return!0}}function c(f,m){return m()}var h=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?c:o;return Mn.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,Mn}var Ln={};/**
|
|
14
|
+
* @license React
|
|
15
|
+
* use-sync-external-store-shim.development.js
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/var ms;function Lo(){return ms||(ms=1,process.env.NODE_ENV!=="production"&&function(){function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}function e(g,x){h||s.startTransition===void 0||(h=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=x();if(!f){var O=x();a(y,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}O=i({inst:{value:y,getSnapshot:x}});var v=O[0].inst,U=O[1];return u(function(){v.value=y,v.getSnapshot=x,n(v)&&U({inst:v})},[g,y,x]),o(function(){return n(v)&&U({inst:v}),g(function(){n(v)&&U({inst:v})})},[g]),c(y),y}function n(g){var x=g.getSnapshot;g=g.value;try{var y=x();return!a(g,y)}catch(O){return!0}}function r(g,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=L,a=typeof Object.is=="function"?Object.is:t,i=s.useState,o=s.useEffect,u=s.useLayoutEffect,c=s.useDebugValue,h=!1,f=!1,m=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?r:e;Ln.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ln}var ys;function $o(){return ys||(ys=1,process.env.NODE_ENV==="production"?tn.exports=Mo():tn.exports=Lo()),tn.exports}var Fo=$o();const Vs=0,Us=1,Bs=2,gs=3;var _s=Object.prototype.hasOwnProperty;function _r(t,e){var n,r;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&_r(t[r],e[r]););return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(_s.call(t,n)&&++r&&!_s.call(e,n)||!(n in e)||!_r(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const Ne=new WeakMap,Me=()=>{},Q=Me(),vr=Object,R=t=>t===Q,we=t=>typeof t=="function",ze=(t,e)=>Be(Be({},t),e),qs=t=>we(t.then),$n={},nn={},Nr="undefined",Jt=typeof window!=Nr,br=typeof document!=Nr,Wo=Jt&&"Deno"in window,zo=()=>Jt&&typeof window.requestAnimationFrame!=Nr,Ks=(t,e)=>{const n=Ne.get(t);return[()=>!R(e)&&t.get(e)||$n,r=>{if(!R(e)){const s=t.get(e);e in nn||(nn[e]=s),n[5](e,ze(s,r),s||$n)}},n[6],()=>!R(e)&&e in nn?nn[e]:!R(e)&&t.get(e)||$n]};let wr=!0;const Vo=()=>wr,[kr,Er]=Jt&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Me,Me],Uo=()=>{const t=br&&document.visibilityState;return R(t)||t!=="hidden"},Bo=t=>(br&&document.addEventListener("visibilitychange",t),kr("focus",t),()=>{br&&document.removeEventListener("visibilitychange",t),Er("focus",t)}),qo=t=>{const e=()=>{wr=!0,t()},n=()=>{wr=!1};return kr("online",e),kr("offline",n),()=>{Er("online",e),Er("offline",n)}},Ko={isOnline:Vo,isVisible:Uo},Ho={initFocus:Bo,initReconnect:qo},vs=!L.useId,Ht=!Jt||Wo,Go=t=>zo()?window.requestAnimationFrame(t):setTimeout(t,1),Fn=Ht?L.useEffect:L.useLayoutEffect,Wn=typeof navigator!="undefined"&&navigator.connection,bs=!Ht&&Wn&&(["slow-2g","2g"].includes(Wn.effectiveType)||Wn.saveData),rn=new WeakMap,zn=(t,e)=>vr.prototype.toString.call(t)===`[object ${e}]`;let Jo=0;const xr=t=>{const e=typeof t,n=zn(t,"Date"),r=zn(t,"RegExp"),s=zn(t,"Object");let a,i;if(vr(t)===t&&!n&&!r){if(a=rn.get(t),a)return a;if(a=++Jo+"~",rn.set(t,a),Array.isArray(t)){for(a="@",i=0;i<t.length;i++)a+=xr(t[i])+",";rn.set(t,a)}if(s){a="#";const o=vr.keys(t).sort();for(;!R(i=o.pop());)R(t[i])||(a+=i+":"+xr(t[i])+",");rn.set(t,a)}}else a=n?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return a},jr=t=>{if(we(t))try{t=t()}catch(n){t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?xr(t):"",[t,e]};let Xo=0;const Sr=()=>++Xo;function Hs(...t){return ot(this,null,function*(){const[e,n,r,s]=t,a=ze({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let i=a.populateCache;const o=a.rollbackOnError;let u=a.optimisticData;const c=m=>typeof o=="function"?o(m):o!==!1,h=a.throwOnError;if(we(n)){const m=n,g=[],x=e.keys();for(const y of x)!/^\$(inf|sub)\$/.test(y)&&m(e.get(y)._k)&&g.push(y);return Promise.all(g.map(f))}return f(n);function f(m){return ot(this,null,function*(){const[g]=jr(m);if(!g)return;const[x,y]=Ks(e,g),[O,v,U,W]=Ne.get(e),te=()=>{const le=O[g];return(we(a.revalidate)?a.revalidate(x().data,m):a.revalidate!==!1)&&(delete U[g],delete W[g],le&&le[0])?le[0](Bs).then(()=>x().data):x().data};if(t.length<3)return te();let B=r,J;const D=Sr();v[g]=[D,0];const M=!R(u),Oe=x(),I=Oe.data,nt=Oe._c,Ve=R(nt)?I:nt;if(M&&(u=we(u)?u(Ve,I):u,y({data:u,_c:Ve})),we(B))try{B=B(Ve)}catch(le){J=le}if(B&&qs(B))if(B=yield B.catch(le=>{J=le}),D!==v[g][0]){if(J)throw J;return B}else J&&M&&c(J)&&(i=!0,y({data:Ve,_c:Q}));if(i&&!J)if(we(i)){const le=i(B,Ve);y({data:le,error:Q,_c:Q})}else y({data:B,error:Q,_c:Q});if(v[g][1]=Sr(),Promise.resolve(te()).then(()=>{y({_c:Q})}),J){if(h)throw J;return}return B})}})}const ws=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},Yo=(t,e)=>{if(!Ne.has(t)){const n=ze(Ho,e),r={},s=Hs.bind(Q,t);let a=Me;const i={},o=(h,f)=>{const m=i[h]||[];return i[h]=m,m.push(f),()=>m.splice(m.indexOf(f),1)},u=(h,f,m)=>{t.set(h,f);const g=i[h];if(g)for(const x of g)x(f,m)},c=()=>{if(!Ne.has(t)&&(Ne.set(t,[r,{},{},{},s,u,o]),!Ht)){const h=n.initFocus(setTimeout.bind(Q,ws.bind(Q,r,Vs))),f=n.initReconnect(setTimeout.bind(Q,ws.bind(Q,r,Us)));a=()=>{h&&h(),f&&f(),Ne.delete(t)}}};return c(),[t,s,c,a]}return[t,Ne.get(t)[4]]},Qo=(t,e,n,r,s)=>{const a=n.errorRetryCount,i=s.retryCount,o=~~((Math.random()+.5)*(1<<(i<8?i:8)))*n.errorRetryInterval;!R(a)&&i>a||setTimeout(r,o,s)},eu=_r,[Gs,tu]=Yo(new Map),nu=ze({onLoadingSlow:Me,onSuccess:Me,onError:Me,onErrorRetry:Qo,onDiscarded:Me,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:bs?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:bs?5e3:3e3,compare:eu,isPaused:()=>!1,cache:Gs,mutate:tu,fallback:{}},Ko),ru=(t,e)=>{const n=ze(t,e);if(e){const{use:r,fallback:s}=t,{use:a,fallback:i}=e;r&&a&&(n.use=r.concat(a)),s&&i&&(n.fallback=ze(s,i))}return n},su=L.createContext({}),au="$inf$",Js=Jt&&window.__SWR_DEVTOOLS_USE__,iu=Js?window.__SWR_DEVTOOLS_USE__:[],ou=()=>{Js&&(window.__SWR_DEVTOOLS_REACT__=L)},uu=t=>we(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],cu=()=>ze(nu,L.useContext(su)),du=t=>(e,n,r)=>t(e,n&&((...a)=>{const[i]=jr(e),[,,,o]=Ne.get(Gs);if(i.startsWith(au))return n(...a);const u=o[i];return R(u)?n(...a):(delete o[i],u)}),r),lu=iu.concat(du),fu=t=>function(...n){const r=cu(),[s,a,i]=uu(n),o=ru(r,i);let u=t;const{use:c}=o,h=(c||[]).concat(lu);for(let f=h.length;f--;)u=h[f](u);return u(s,a||o.fetcher||null,o)},hu=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const s=r.indexOf(n);s>=0&&(r[s]=r[r.length-1],r.pop())}};ou();const Vn=L.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Un={dedupe:!0},pu=(t,e,n)=>{const{cache:r,compare:s,suspense:a,fallbackData:i,revalidateOnMount:o,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:h,refreshWhenOffline:f,keepPreviousData:m}=n,[g,x,y,O]=Ne.get(r),[v,U]=jr(t),W=L.useRef(!1),te=L.useRef(!1),B=L.useRef(v),J=L.useRef(e),D=L.useRef(n),M=()=>D.current,Oe=()=>M().isVisible()&&M().isOnline(),[I,nt,Ve,le]=Ks(r,v),rt=L.useRef({}).current,Xt=R(i)?R(n.fallback)?Q:n.fallback[v]:i,Ir=(N,j)=>{for(const K in rt){const F=K;if(F==="data"){if(!s(N[F],j[F])&&(!R(N[F])||!s(Qt,j[F])))return!1}else if(j[F]!==N[F])return!1}return!0},Zr=L.useMemo(()=>{const N=!v||!e?!1:R(o)?M().isPaused()||a?!1:u!==!1:o,j=X=>{const Te=ze(X);return delete Te._k,N?Be({isValidating:!0,isLoading:!0},Te):Te},K=I(),F=le(),ge=j(K),it=K===F?ge:j(F);let q=ge;return[()=>{const X=j(I());return Ir(X,q)?(q.data=X.data,q.isLoading=X.isLoading,q.isValidating=X.isValidating,q.error=X.error,q):(q=X,X)},()=>it]},[r,v]),st=Fo.useSyncExternalStore(L.useCallback(N=>Ve(v,(j,K)=>{Ir(K,j)||N()}),[r,v]),Zr[0],Zr[1]),Dr=!W.current,Xs=g[v]&&g[v].length>0,at=st.data,Ue=R(at)?Xt&&qs(Xt)?Vn(Xt):Xt:at,Yt=st.error,Tn=L.useRef(Ue),Qt=m?R(at)?R(Tn.current)?Ue:Tn.current:at:Ue,Mr=Xs&&!R(Yt)?!1:Dr&&!R(o)?o:M().isPaused()?!1:a?R(Ue)?!1:u:R(Ue)||u,Lr=!!(v&&e&&Dr&&Mr),Ys=R(st.isValidating)?Lr:st.isValidating,Qs=R(st.isLoading)?Lr:st.isLoading,wt=L.useCallback(N=>ot(exports,null,function*(){const j=J.current;if(!v||!j||te.current||M().isPaused())return!1;let K,F,ge=!0;const it=N||{},q=!y[v]||!it.dedupe,X=()=>vs?!te.current&&v===B.current&&W.current:v===B.current,Te={isValidating:!1,isLoading:!1},Fr=()=>{nt(Te)},Wr=()=>{const ce=y[v];ce&&ce[1]===F&&delete y[v]},zr={isValidating:!0};R(I().data)&&(zr.isLoading=!0);try{if(q&&(nt(zr),n.loadingTimeout&&R(I().data)&&setTimeout(()=>{ge&&X()&&M().onLoadingSlow(v,n)},n.loadingTimeout),y[v]=[j(U),Sr()]),[K,F]=y[v],K=yield K,q&&setTimeout(Wr,n.dedupingInterval),!y[v]||y[v][1]!==F)return q&&X()&&M().onDiscarded(v),!1;Te.error=Q;const ce=x[v];if(!R(ce)&&(F<=ce[0]||F<=ce[1]||ce[1]===0))return Fr(),q&&X()&&M().onDiscarded(v),!1;const Ae=I().data;Te.data=s(Ae,K)?Ae:K,q&&X()&&M().onSuccess(K,v,n)}catch(ce){Wr();const Ae=M(),{shouldRetryOnError:An}=Ae;Ae.isPaused()||(Te.error=ce,q&&X()&&(Ae.onError(ce,v,Ae),(An===!0||we(An)&&An(ce))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||Oe())&&Ae.onErrorRetry(ce,v,Ae,ea=>{const Cn=g[v];Cn&&Cn[0]&&Cn[0](gs,ea)},{retryCount:(it.retryCount||0)+1,dedupe:!0})))}return ge=!1,Fr(),!0}),[v,r]),$r=L.useCallback((...N)=>Hs(r,B.current,...N),[]);if(Fn(()=>{J.current=e,D.current=n,R(at)||(Tn.current=at)}),Fn(()=>{if(!v)return;const N=wt.bind(Q,Un);let j=0;const F=hu(v,g,(ge,it={})=>{if(ge==Vs){const q=Date.now();M().revalidateOnFocus&&q>j&&Oe()&&(j=q+M().focusThrottleInterval,N())}else if(ge==Us)M().revalidateOnReconnect&&Oe()&&N();else{if(ge==Bs)return wt();if(ge==gs)return wt(it)}});return te.current=!1,B.current=v,W.current=!0,nt({_k:U}),Mr&&(R(Ue)||Ht?N():Go(N)),()=>{te.current=!0,F()}},[v]),Fn(()=>{let N;function j(){const F=we(c)?c(I().data):c;F&&N!==-1&&(N=setTimeout(K,F))}function K(){!I().error&&(h||M().isVisible())&&(f||M().isOnline())?wt(Un).then(j):j()}return j(),()=>{N&&(clearTimeout(N),N=-1)}},[c,h,f,v]),L.useDebugValue(Qt),a&&R(Ue)&&v){if(!vs&&Ht)throw new Error("Fallback data is required when using Suspense in SSR.");J.current=e,D.current=n,te.current=!1;const N=O[v];if(!R(N)){const j=$r(N);Vn(j)}if(R(Yt)){const j=wt(Un);R(Qt)||(j.status="fulfilled",j.value=!0),Vn(j)}else throw Yt}return{mutate:$r,get data(){return rt.data=!0,Qt},get error(){return rt.error=!0,Yt},get isValidating(){return rt.isValidating=!0,Ys},get isLoading(){return rt.isLoading=!0,Qs}}},mu=fu(pu),yu=({fileKey:t,authToken:e,enabled:n=!0,params:r={}})=>{const s=!!(n&&t&&e),{data:a,isLoading:i,error:o}=mu(["figma",t,e,r],()=>s?yo({fileKey:t,authToken:e,params:r}):null,{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:a!=null?a:null,isLoading:i,error:o}};exports.useAnimaCodegen=Do;exports.useFigmaFile=yu;
|
|
22
|
+
//# sourceMappingURL=index.cjs.map
|