@marimo-team/frontend 0.10.10-dev9 → 0.10.10
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/dist/assets/{ConnectedDataExplorerComponent-Bgf4PI0B.js → ConnectedDataExplorerComponent-DuJEjFFt.js} +1 -1
- package/dist/assets/{VegaLite-iangTCDy.js → VegaLite-Bu4nEtrh.js} +1 -1
- package/dist/assets/_baseEach-DoLGNoq1.js +1 -0
- package/dist/assets/_baseMap-DP02EAu_.js +1 -0
- package/dist/assets/{_baseUniq-pqK3c5IH.js → _baseUniq-B1-MT8Wm.js} +1 -1
- package/dist/assets/{any-language-editor-DsDPflxv.js → any-language-editor-yzT7_mfE.js} +1 -1
- package/dist/assets/{architectureDiagram-IFBEXTG3-DuO5sp_F.js → architectureDiagram-IFBEXTG3-BngeutP0.js} +1 -1
- package/dist/assets/{blockDiagram-TCMKQVZ6-I0ulc823.js → blockDiagram-TCMKQVZ6-DMDapR-Z.js} +1 -1
- package/dist/assets/{c4Diagram-ZCSEYPFN-kI07R2f7.js → c4Diagram-ZCSEYPFN-D1qVw6ba.js} +1 -1
- package/dist/assets/channel-DatwID4g.js +1 -0
- package/dist/assets/{chunk-4LC2V6XN-DwFgiIof.js → chunk-4LC2V6XN-D12ptT_9.js} +1 -1
- package/dist/assets/{chunk-5RIWM3LS-CLESvgMQ.js → chunk-5RIWM3LS-CRKqRvUX.js} +1 -1
- package/dist/assets/{chunk-6JKP7OK7-R5_xLiKG.js → chunk-6JKP7OK7-0Mla350c.js} +1 -1
- package/dist/assets/{chunk-NGC4727B-BjgSCyI6.js → chunk-NGC4727B-BX5iMrjA.js} +1 -1
- package/dist/assets/{chunk-REEJFE46-DfcuhJcf.js → chunk-REEJFE46-Dx-v1WcY.js} +1 -1
- package/dist/assets/{chunk-RYO7GUH3-DlGui3Os.js → chunk-RYO7GUH3-CNqE7MZq.js} +1 -1
- package/dist/assets/{chunk-V35ELUW5-DZ8nTO-I.js → chunk-V35ELUW5-CR6onojN.js} +1 -1
- package/dist/assets/{classDiagram-Q73GJZWF-CJOkKhJ9.js → classDiagram-Q73GJZWF-BzoEd27s.js} +1 -1
- package/dist/assets/{classDiagram-v2-C6QPLPW4-DcRAkPGZ.js → classDiagram-v2-C6QPLPW4-DzRGcWW6.js} +1 -1
- package/dist/assets/clone-CTaSWpjq.js +1 -0
- package/dist/assets/{compile-CQjVFt1r.js → compile-2pEtiJTw.js} +1 -1
- package/dist/assets/{dagre-7KT5K2WU-C5E_nMdZ.js → dagre-7KT5K2WU-CQapUTB7.js} +1 -1
- package/dist/assets/{data-editor-gqH1O_Ez.js → data-editor-Bh-my_9O.js} +1 -1
- package/dist/assets/{diagram-AVGMFHF7-Z2lfF-7F.js → diagram-AVGMFHF7-5nqmtYPx.js} +1 -1
- package/dist/assets/edit-page-xXTAKdOJ.js +14 -0
- package/dist/assets/{erDiagram-DKC2X5TE-CSFGJwl5.js → erDiagram-DKC2X5TE-6Ggx0CH8.js} +1 -1
- package/dist/assets/feature-flag-DxjXijq9.js +1 -0
- package/dist/assets/{flowDiagram-NWEUNK3L-BMjKQS4N.js → flowDiagram-NWEUNK3L-B8VXQxgg.js} +1 -1
- package/dist/assets/{ganttDiagram-HLVPPPRE-CH9-kbPR.js → ganttDiagram-HLVPPPRE-I24H10LN.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-Dn6DokdN.js → gitGraph-YCYPL57B-D_AY7hZ0.js} +1 -1
- package/dist/assets/{gitGraphDiagram-JPZ3KUXI-CDrYSgBx.js → gitGraphDiagram-JPZ3KUXI-D0R8CjfG.js} +1 -1
- package/dist/assets/{graph-DeyesDoK.js → graph-DuTueBzh.js} +1 -1
- package/dist/assets/{home-page-DhhMG_vp.js → home-page-C8evxSS3.js} +3 -3
- package/dist/assets/{index-Dp7U4ToI.js → index-A1QgjKcV.js} +1 -1
- package/dist/assets/{index-DdDYKUwd.js → index-B5Sdu_NK.js} +1 -1
- package/dist/assets/index-BEK-FZ0P.js +79 -0
- package/dist/assets/{index-B46iQvp1.js → index-BL7TvEeh.js} +1 -1
- package/dist/assets/{index-UYtDVjQ5.js → index-BNOufnH2.js} +1 -1
- package/dist/assets/{index-CBYoT1IX.js → index-BOBGy-Xx.js} +1 -1
- package/dist/assets/{index--j3pBpD0.js → index-BOqWHWOW.js} +1 -1
- package/dist/assets/{index-DhXuLNKU.js → index-C7Naro79.js} +1 -1
- package/dist/assets/{index-DQB_VfMI.js → index-CO0j1Nci.js} +1 -1
- package/dist/assets/{index-CXqwDCE9.js → index-CR6RpGuj.js} +1 -1
- package/dist/assets/{index-C4G4OxrO.js → index-CoQbbUsl.js} +1 -1
- package/dist/assets/{index-DEOLMKGS.js → index-CoRqvznP.js} +1 -1
- package/dist/assets/{index-DfL0nN81.js → index-DNr-I7XD.js} +1 -1
- package/dist/assets/{index-Cvrcu_Qq.js → index-DZyGNLX_.js} +1 -1
- package/dist/assets/{index-_ajgpZ37.js → index-Danxt8uu.js} +1 -1
- package/dist/assets/{index-BovRgQwv.js → index-d1hpx3RJ.js} +1 -1
- package/dist/assets/{index-CerxjrCg.js → index-jEznWCJk.js} +1 -1
- package/dist/assets/{infoDiagram-RZZSJVI2-CGlhHmAY.js → infoDiagram-RZZSJVI2-5eovKHGL.js} +1 -1
- package/dist/assets/{journeyDiagram-BLD6N6MZ-44XWaY-9.js → journeyDiagram-BLD6N6MZ-CrJmBmGF.js} +1 -1
- package/dist/assets/json-DYbSntZu.js +1 -0
- package/dist/assets/{layout-DF3np8mb.js → layout-NmvBaMvO.js} +1 -1
- package/dist/assets/{linear-BlROKdzC.js → linear-CS60HzLK.js} +1 -1
- package/dist/assets/{mermaid-CSs8kMak.js → mermaid-C454g3NO.js} +3 -3
- package/dist/assets/min-Cg4uovF5.js +1 -0
- package/dist/assets/{mindmap-definition-OEB2RXX2-DjUBBOyZ.js → mindmap-definition-OEB2RXX2-BmFNpo-1.js} +1 -1
- package/dist/assets/{ordinal-BcaZTuz9.js → ordinal-DDUp3AbE.js} +1 -1
- package/dist/assets/{pieDiagram-X7YZ5ZEZ-DFFWFPjy.js → pieDiagram-X7YZ5ZEZ-DmJEkAUi.js} +1 -1
- package/dist/assets/{quadrantDiagram-F36EZAVT-DV4AETIw.js → quadrantDiagram-F36EZAVT-Cp_6EO0K.js} +1 -1
- package/dist/assets/{react-plotly-Bg94K_e3.js → react-plotly-BRMP_i6v.js} +1 -1
- package/dist/assets/{requirementDiagram-JG2LMPGF-M3yARdNn.js → requirementDiagram-JG2LMPGF-C-XPqddZ.js} +1 -1
- package/dist/assets/run-page-BzjWq0KF.js +1 -0
- package/dist/assets/{sankeyDiagram-ATFNWWW6-DLvYHJlU.js → sankeyDiagram-ATFNWWW6-C1YjfR5z.js} +1 -1
- package/dist/assets/save-worker-CBV2-DMU.js +1 -0
- package/dist/assets/{sequenceDiagram-WK7YDQ3N-vioODmNL.js → sequenceDiagram-WK7YDQ3N-BrPj8gwa.js} +1 -1
- package/dist/assets/{slides-component-3cVvmJCt.js → slides-component-C3_Xi3Mb.js} +1 -1
- package/dist/assets/{sortBy-CjQAQCcF.js → sortBy-_MTKRbIY.js} +1 -1
- package/dist/assets/{stateDiagram-4JV6CC6H-CmnzNV1a.js → stateDiagram-4JV6CC6H-Za2eOQbb.js} +1 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-C_vWEFIM.js +1 -0
- package/dist/assets/terminal-DcEKIJuz.js +1 -0
- package/dist/assets/{time-CE21r7jO.js → time-Bh_goDS3.js} +1 -1
- package/dist/assets/{timeline-definition-3ZMEY6HS-Cr8iMPE4.js → timeline-definition-3ZMEY6HS-W9QDLfgs.js} +1 -1
- package/dist/assets/tree-B9nC3xp9.js +14 -0
- package/dist/assets/useMarimoWebSocket-DylalmPq.js +21 -0
- package/dist/assets/{vega-component-CmAd8IvD.js → vega-component-DTBPy6Oz.js} +1 -1
- package/dist/assets/worker-BQUWY2ZY.js +1 -0
- package/dist/assets/{worker-DdR0QIqN.js → worker-CIUac72O.js} +1 -1
- package/dist/assets/{xychartDiagram-KECQ2H5Q-B1Ubvwfi.js → xychartDiagram-KECQ2H5Q-rPLnmpgn.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +31 -28
- package/dist/assets/_baseEach-BGmJ72p8.js +0 -1
- package/dist/assets/_baseMap-CwXxnxLu.js +0 -1
- package/dist/assets/channel-Dk8wWVTs.js +0 -1
- package/dist/assets/clone-BMHuqNnw.js +0 -1
- package/dist/assets/createWsUrl-CUE3SAMD.js +0 -1
- package/dist/assets/edit-page-BdK8yRYa.js +0 -14
- package/dist/assets/index-B6qwT6A2.js +0 -72
- package/dist/assets/json-6Uu1nbVY.js +0 -1
- package/dist/assets/min-DgBMoCuu.js +0 -1
- package/dist/assets/run-page-Sgmcg1b_.js +0 -1
- package/dist/assets/save-worker-Ca3hRSVQ.js +0 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-C9YFXQYu.js +0 -1
- package/dist/assets/terminal-CaPXvOSN.js +0 -1
- package/dist/assets/tree-D1_h0M_C.js +0 -14
- package/dist/assets/useMarimoWebSocket-BM4HeEAa.js +0 -21
- package/dist/assets/worker-BxJ8HeOy.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e,t,n=Object.getOwnPropertyNames,r=(e={"assets/worker-BxJ8HeOy.js"(e,t){function n(e){return e.FS}const r="notebook.py",a="/marimo",s=r,i=e=>{const t=n(e);try{t.mkdir(a)}catch{}t.chdir(a)},o=e=>{n(e).mount(e.FS.filesystems.IDBFS,{root:"."},a)},d=async e=>{await l(e,!0)},c=async e=>{await l(e,!1)},u=e=>{const{pyodide:t,filename:a,code:s}=e,i=n(t);if(a&&a!==r){const e=(e=>{try{return i.readFile(e,{encoding:"utf8"})}catch{return null}})(a);if(e)return{code:e,filename:a}}return i.writeFile(r,s),{code:s,filename:r}};function l(e,t){return new Promise(((r,a)=>{n(e).syncfs(t,(e=>{e?a(e):r()}))}))}var p,h,m;(h=p||(p={})).assertEqual=e=>e,h.assertIs=function(e){},h.assertNever=function(e){throw new Error},h.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},h.getValidEnumValues=e=>{const t=h.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),n={};for(const r of t)n[r]=e[r];return h.objectValues(n)},h.objectValues=e=>h.objectKeys(e).map((function(t){return e[t]})),h.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},h.find=(e,t)=>{for(const n of e)if(t(n))return n},h.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,h.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},h.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(m||(m={})).mergeShapes=(e,t)=>({...e,...t});const f=p.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),y=e=>{switch(typeof e){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(e)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(e)?f.array:null===e?f.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?f.promise:"undefined"!=typeof Map&&e instanceof Map?f.map:"undefined"!=typeof Set&&e instanceof Set?f.set:"undefined"!=typeof Date&&e instanceof Date?f.date:f.object;default:return f.unknown}},g=p.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"]);class v extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof v))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,p.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}v.create=e=>new v(e);const _=(e,t)=>{let n;switch(e.code){case g.invalid_type:n=e.received===f.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case g.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,p.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:n=`Unrecognized key(s) in object: ${p.joinValues(e.keys,", ")}`;break;case g.invalid_union:n="Invalid input";break;case g.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${p.joinValues(e.options)}`;break;case g.invalid_enum_value:n=`Invalid enum value. Expected ${p.joinValues(e.options)}, received '${e.received}'`;break;case g.invalid_arguments:n="Invalid function arguments";break;case g.invalid_return_type:n="Invalid function return type";break;case g.invalid_date:n="Invalid date";break;case g.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:p.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case g.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case g.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case g.custom:n="Invalid input";break;case g.invalid_intersection_types:n="Intersection results could not be merged";break;case g.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case g.not_finite:n="Number must be finite";break;default:n=t.defaultError,p.assertNever(e)}return{message:n}};let w=_;function b(){return w}const k=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function x(e,t){const n=b(),r=k({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===_?void 0:_].filter((e=>!!e))});e.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return T;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return S.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return T;if("aborted"===a.status)return T;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const T=Object.freeze({status:"aborted"}),E=e=>({status:"dirty",value:e}),O=e=>({status:"valid",value:e}),N=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,j=e=>"valid"===e.status,P=e=>"undefined"!=typeof Promise&&e instanceof Promise;function C(e,t,n,r){if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function I(e,t,n,r,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var R,$,A,M;"function"==typeof SuppressedError&&SuppressedError,($=R||(R={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},$.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class F{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 L=(e,t)=>{if(j(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new v(e.common.issues);return this._error=t,this._error}}};function D(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class U{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)}get description(){return this._def.description}_getType(e){return y(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:y(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:y(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(P(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:y(e)},a=this._parseSync({data:e,path:r.path,parent:r});return L(r,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:y(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(P(r)?r:Promise.resolve(r));return L(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:g.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new $e({schema:this,typeName:We.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ae.create(this,this._def)}nullable(){return Me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this,this._def)}promise(){return Re.create(this,this._def)}or(e){return _e.create([this,e],this._def)}and(e){return xe.create(this,e,this._def)}transform(e){return new $e({...D(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Fe({...D(this._def),innerType:this,defaultValue:t,typeName:We.ZodDefault})}brand(){return new qe({typeName:We.ZodBranded,type:this,...D(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Le({...D(this._def),innerType:this,catchValue:t,typeName:We.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ze.create(this,e)}readonly(){return Ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const q=/^c[^\s-]{8,}$/i,z=/^[0-9a-z]+$/,V=/^[0-9A-HJKMNP-TV-Z]{26}$/,B=/^[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,H=/^[a-z0-9_-]{21}$/i,W=/^[-+]?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)?)??$/,K=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let J;const Y=/^(?:(?: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])$/,G=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,X=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Q="((\\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])))",ee=new RegExp(`^${Q}$`);function te(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function ne(e){let t=`${Q}T${te(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}class re extends U{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.string,received:t.parsedType}),T}const t=new S;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?x(n,{code:g.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&x(n,{code:g.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)K.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"email",code:g.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)J||(J=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),J.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"emoji",code:g.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)B.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"uuid",code:g.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)H.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"nanoid",code:g.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)q.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid",code:g.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)z.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid2",code:g.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)V.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ulid",code:g.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(s){n=this._getOrReturnCtx(e,n),x(n,{validation:"url",code:g.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"regex",code:g.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?ne(i).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"date"===i.kind?ee.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:"date",message:i.message}),t.dirty()):"time"===i.kind?new RegExp(`^${te(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:g.invalid_string,validation:"time",message:i.message}),t.dirty()):"duration"===i.kind?W.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"duration",code:g.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(r=e.data,("v4"!==(a=i.version)&&a||!Y.test(r))&&("v6"!==a&&a||!G.test(r))&&(n=this._getOrReturnCtx(e,n),x(n,{validation:"ip",code:g.invalid_string,message:i.message}),t.dirty())):"base64"===i.kind?X.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64",code:g.invalid_string,message:i.message}),t.dirty()):p.assertNever(i);var r,a;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:g.invalid_string,...R.errToObj(n)})}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...R.errToObj(e)})}url(e){return this._addCheck({kind:"url",...R.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...R.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...R.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...R.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...R.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...R.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...R.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...R.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...R.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...R.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...R.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...R.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...R.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...R.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...R.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...R.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...R.errToObj(t)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new re({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new re({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new re({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ae(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}re.create=e=>{var t;return new re({checks:[],typeName:We.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...D(e)})};class se extends U{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)!==f.number){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.number,received:t.parsedType}),T}let t;const n=new S;for(const r of this._def.checks)"int"===r.kind?p.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),x(t,{code:g.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:g.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:g.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==ae(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:g.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),x(t,{code:g.not_finite,message:r.message}),n.dirty()):p.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,R.toString(t))}gt(e,t){return this.setLimit("min",e,!1,R.toString(t))}lte(e,t){return this.setLimit("max",e,!0,R.toString(t))}lt(e,t){return this.setLimit("max",e,!1,R.toString(t))}setLimit(e,t,n,r){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:R.toString(r)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:R.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:R.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&p.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}se.create=e=>new se({checks:[],typeName:We.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...D(e)});class ie extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==f.bigint){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.bigint,received:t.parsedType}),T}let t;const n=new S;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:g.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:g.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),x(t,{code:g.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):p.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,R.toString(t))}gt(e,t){return this.setLimit("min",e,!1,R.toString(t))}lte(e,t){return this.setLimit("max",e,!0,R.toString(t))}lt(e,t){return this.setLimit("max",e,!1,R.toString(t))}setLimit(e,t,n,r){return new ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:R.toString(r)}]})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ie.create=e=>{var t;return new ie({checks:[],typeName:We.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...D(e)})};class oe extends U{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==f.boolean){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.boolean,received:t.parsedType}),T}return O(e.data)}}oe.create=e=>new oe({typeName:We.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...D(e)});class de extends U{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.date,received:t.parsedType}),T}if(isNaN(e.data.getTime()))return x(this._getOrReturnCtx(e),{code:g.invalid_date}),T;const t=new S;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:g.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):p.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new de({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:R.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:R.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}de.create=e=>new de({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:We.ZodDate,...D(e)});class ce extends U{_parse(e){if(this._getType(e)!==f.symbol){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.symbol,received:t.parsedType}),T}return O(e.data)}}ce.create=e=>new ce({typeName:We.ZodSymbol,...D(e)});class ue extends U{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.undefined,received:t.parsedType}),T}return O(e.data)}}ue.create=e=>new ue({typeName:We.ZodUndefined,...D(e)});class le extends U{_parse(e){if(this._getType(e)!==f.null){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.null,received:t.parsedType}),T}return O(e.data)}}le.create=e=>new le({typeName:We.ZodNull,...D(e)});class pe extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}pe.create=e=>new pe({typeName:We.ZodAny,...D(e)});class he extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}he.create=e=>new he({typeName:We.ZodUnknown,...D(e)});class me extends U{_parse(e){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.never,received:t.parsedType}),T}}me.create=e=>new me({typeName:We.ZodNever,...D(e)});class fe extends U{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.void,received:t.parsedType}),T}return O(e.data)}}fe.create=e=>new fe({typeName:We.ZodVoid,...D(e)});class ye extends U{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==f.array)return x(t,{code:g.invalid_type,expected:f.array,received:t.parsedType}),T;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(x(t,{code:e?g.too_big:g.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(x(t,{code:g.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(x(t,{code:g.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new F(t,e,t.path,n))))).then((e=>S.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new F(t,e,t.path,n))));return S.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new ye({...this._def,minLength:{value:e,message:R.toString(t)}})}max(e,t){return new ye({...this._def,maxLength:{value:e,message:R.toString(t)}})}length(e,t){return new ye({...this._def,exactLength:{value:e,message:R.toString(t)}})}nonempty(e){return this.min(1,e)}}function ge(e){if(e instanceof ve){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ae.create(ge(r))}return new ve({...e._def,shape:()=>t})}return e instanceof ye?new ye({...e._def,type:ge(e.element)}):e instanceof Ae?Ae.create(ge(e.unwrap())):e instanceof Me?Me.create(ge(e.unwrap())):e instanceof Se?Se.create(e.items.map((e=>ge(e)))):e}ye.create=(e,t)=>new ye({type:e,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...D(t)});class ve extends U{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=p.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.object,received:t.parsedType}),T}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof me&&"strip"===this._def.unknownKeys))for(const o in n.data)a.includes(o)||s.push(o);const i=[];for(const o of a){const e=r[o],t=n.data[o];i.push({key:{status:"valid",value:o},value:e._parse(new F(n,t,n.path,o)),alwaysSet:o in n.data})}if(this._def.catchall instanceof me){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of s)i.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)s.length>0&&(x(n,{code:g.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new F(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>S.mergeObjectSync(t,e))):S.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return R.errToObj,new ve({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=R.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:We.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){const t={};return p.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new ve({...this._def,shape:()=>t})}omit(e){const t={};return p.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new ve({...this._def,shape:()=>t})}deepPartial(){return ge(this)}partial(e){const t={};return p.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new ve({...this._def,shape:()=>t})}required(e){const t={};return p.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ae;)e=e._def.innerType;t[n]=e}})),new ve({...this._def,shape:()=>t})}keyof(){return Pe(p.objectKeys(this.shape))}}ve.create=(e,t)=>new ve({shape:()=>e,unknownKeys:"strip",catchall:me.create(),typeName:We.ZodObject,...D(t)}),ve.strictCreate=(e,t)=>new ve({shape:()=>e,unknownKeys:"strict",catchall:me.create(),typeName:We.ZodObject,...D(t)}),ve.lazycreate=(e,t)=>new ve({shape:e,unknownKeys:"strip",catchall:me.create(),typeName:We.ZodObject,...D(t)});class _e extends U{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map((e=>new v(e.ctx.common.issues)));return x(t,{code:g.invalid_union,unionErrors:n}),T}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new v(e)));return x(t,{code:g.invalid_union,unionErrors:a}),T}}get options(){return this._def.options}}_e.create=(e,t)=>new _e({options:e,typeName:We.ZodUnion,...D(t)});const we=e=>e instanceof Ze?we(e.schema):e instanceof $e?we(e.innerType()):e instanceof je?[e.value]:e instanceof Ce?e.options:e instanceof Ie?p.objectValues(e.enum):e instanceof Fe?we(e._def.innerType):e instanceof ue?[void 0]:e instanceof le?[null]:e instanceof Ae?[void 0,...we(e.unwrap())]:e instanceof Me?[null,...we(e.unwrap())]:e instanceof qe||e instanceof Ve?we(e.unwrap()):e instanceof Le?we(e._def.innerType):[];class be extends U{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return x(t,{code:g.invalid_type,expected:f.object,received:t.parsedType}),T;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(x(t,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const a of t){const t=we(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new be({typeName:We.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...D(n)})}}function ke(e,t){const n=y(e),r=y(t);if(e===t)return{valid:!0,data:e};if(n===f.object&&r===f.object){const n=p.objectKeys(t),r=p.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const s of r){const n=ke(e[s],t[s]);if(!n.valid)return{valid:!1};a[s]=n.data}return{valid:!0,data:a}}if(n===f.array&&r===f.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=ke(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===f.date&&r===f.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class xe extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(N(e)||N(r))return T;const a=ke(e.value,r.value);return a.valid?((Z(e)||Z(r))&&t.dirty(),{status:t.value,value:a.data}):(x(n,{code:g.invalid_intersection_types}),T)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}xe.create=(e,t,n)=>new xe({left:e,right:t,typeName:We.ZodIntersection,...D(n)});class Se extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return x(n,{code:g.invalid_type,expected:f.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return x(n,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new F(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>S.mergeArray(t,e))):S.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Se({...this._def,rest:e})}}Se.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Se({items:e,typeName:We.ZodTuple,rest:null,...D(t)})};class Te extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return x(n,{code:g.invalid_type,expected:f.object,received:n.parsedType}),T;const r=[],a=this._def.keyType,s=this._def.valueType;for(const i in n.data)r.push({key:a._parse(new F(n,i,n.path,i)),value:s._parse(new F(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?S.mergeObjectAsync(t,r):S.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Te(t instanceof U?{keyType:e,valueType:t,typeName:We.ZodRecord,...D(n)}:{keyType:re.create(),valueType:e,typeName:We.ZodRecord,...D(t)})}}class Ee extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return x(n,{code:g.invalid_type,expected:f.map,received:n.parsedType}),T;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new F(n,e,n.path,[s,"key"])),value:a._parse(new F(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return T;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return T;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}Ee.create=(e,t,n)=>new Ee({valueType:t,keyType:e,typeName:We.ZodMap,...D(n)});class Oe extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return x(n,{code:g.invalid_type,expected:f.set,received:n.parsedType}),T;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(x(n,{code:g.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(x(n,{code:g.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return T;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>a._parse(new F(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new Oe({...this._def,minSize:{value:e,message:R.toString(t)}})}max(e,t){return new Oe({...this._def,maxSize:{value:e,message:R.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Oe.create=(e,t)=>new Oe({valueType:e,minSize:null,maxSize:null,typeName:We.ZodSet,...D(t)});class Ne extends U{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return x(t,{code:g.invalid_type,expected:f.function,received:t.parsedType}),T;function n(e,n){return k({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b(),_].filter((e=>!!e)),issueData:{code:g.invalid_arguments,argumentsError:n}})}function r(e,n){return k({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b(),_].filter((e=>!!e)),issueData:{code:g.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Re){const e=this;return O((async function(...t){const i=new v([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(n(t,e)),i})),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw i.addIssue(r(d,e)),i}))}))}{const e=this;return O((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new v([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new v([r(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ne({...this._def,args:Se.create(e).rest(he.create())})}returns(e){return new Ne({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Ne({args:e||Se.create([]).rest(he.create()),returns:t||he.create(),typeName:We.ZodFunction,...D(n)})}}class Ze extends U{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ze.create=(e,t)=>new Ze({getter:e,typeName:We.ZodLazy,...D(t)});class je extends U{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:g.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Pe(e,t){return new Ce({values:e,typeName:We.ZodEnum,...D(t)})}je.create=(e,t)=>new je({value:e,typeName:We.ZodLiteral,...D(t)});class Ce extends U{constructor(){super(...arguments),A.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return x(t,{expected:p.joinValues(n),received:t.parsedType,code:g.invalid_type}),T}if(C(this,A)||I(this,A,new Set(this._def.values)),!C(this,A).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return x(t,{received:t.data,code:g.invalid_enum_value,options:n}),T}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ce.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ce.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}A=new WeakMap,Ce.create=Pe;class Ie extends U{constructor(){super(...arguments),M.set(this,void 0)}_parse(e){const t=p.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const e=p.objectValues(t);return x(n,{expected:p.joinValues(e),received:n.parsedType,code:g.invalid_type}),T}if(C(this,M)||I(this,M,new Set(p.getValidEnumValues(this._def.values))),!C(this,M).has(e.data)){const e=p.objectValues(t);return x(n,{received:n.data,code:g.invalid_enum_value,options:e}),T}return O(e.data)}get enum(){return this._def.values}}M=new WeakMap,Ie.create=(e,t)=>new Ie({values:e,typeName:We.ZodNativeEnum,...D(t)});class Re extends U{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&!1===t.common.async)return x(t,{code:g.invalid_type,expected:f.promise,received:t.parsedType}),T;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return O(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Re.create=(e,t)=>new Re({type:e,typeName:We.ZodPromise,...D(t)});class $e extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{x(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return T;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?T:"dirty"===r.status||"dirty"===t.value?E(r.value):r}));{if("aborted"===t.value)return T;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?T:"dirty"===r.status||"dirty"===t.value?E(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?T:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?T:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!j(e))return e;const s=r.transform(e.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>j(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}p.assertNever(r)}}$e.create=(e,t,n)=>new $e({schema:e,typeName:We.ZodEffects,effect:t,...D(n)}),$e.createWithPreprocess=(e,t,n)=>new $e({schema:t,effect:{type:"preprocess",transform:e},typeName:We.ZodEffects,...D(n)});class Ae extends U{_parse(e){return this._getType(e)===f.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:We.ZodOptional,...D(t)});class Me extends U{_parse(e){return this._getType(e)===f.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:We.ZodNullable,...D(t)});class Fe extends U{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Fe.create=(e,t)=>new Fe({innerType:e,typeName:We.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...D(t)});class Le extends U{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return P(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new v(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new v(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Le.create=(e,t)=>new Le({innerType:e,typeName:We.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...D(t)});class De extends U{_parse(e){if(this._getType(e)!==f.nan){const t=this._getOrReturnCtx(e);return x(t,{code:g.invalid_type,expected:f.nan,received:t.parsedType}),T}return{status:"valid",value:e.data}}}De.create=e=>new De({typeName:We.ZodNaN,...D(e)});const Ue=Symbol("zod_brand");class qe extends U{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ze extends U{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?T:"dirty"===e.status?(t.dirty(),E(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?T:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ze({in:e,out:t,typeName:We.ZodPipeline})}}class Ve extends U{_parse(e){const t=this._def.innerType._parse(e),n=e=>(j(e)&&(e.value=Object.freeze(e.value)),e);return P(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Be(e,t={},n){return e?pe.create().superRefine(((r,a)=>{var s,i;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i,d="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...d,fatal:o})}})):pe.create()}Ve.create=(e,t)=>new Ve({innerType:e,typeName:We.ZodReadonly,...D(t)});const He={object:ve.lazycreate};var We,Ke;(Ke=We||(We={})).ZodString="ZodString",Ke.ZodNumber="ZodNumber",Ke.ZodNaN="ZodNaN",Ke.ZodBigInt="ZodBigInt",Ke.ZodBoolean="ZodBoolean",Ke.ZodDate="ZodDate",Ke.ZodSymbol="ZodSymbol",Ke.ZodUndefined="ZodUndefined",Ke.ZodNull="ZodNull",Ke.ZodAny="ZodAny",Ke.ZodUnknown="ZodUnknown",Ke.ZodNever="ZodNever",Ke.ZodVoid="ZodVoid",Ke.ZodArray="ZodArray",Ke.ZodObject="ZodObject",Ke.ZodUnion="ZodUnion",Ke.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ke.ZodIntersection="ZodIntersection",Ke.ZodTuple="ZodTuple",Ke.ZodRecord="ZodRecord",Ke.ZodMap="ZodMap",Ke.ZodSet="ZodSet",Ke.ZodFunction="ZodFunction",Ke.ZodLazy="ZodLazy",Ke.ZodLiteral="ZodLiteral",Ke.ZodEnum="ZodEnum",Ke.ZodEffects="ZodEffects",Ke.ZodNativeEnum="ZodNativeEnum",Ke.ZodOptional="ZodOptional",Ke.ZodNullable="ZodNullable",Ke.ZodDefault="ZodDefault",Ke.ZodCatch="ZodCatch",Ke.ZodPromise="ZodPromise",Ke.ZodBranded="ZodBranded",Ke.ZodPipeline="ZodPipeline",Ke.ZodReadonly="ZodReadonly";const Je=re.create,Ye=se.create,Ge=De.create,Xe=ie.create,Qe=oe.create,et=de.create,tt=ce.create,nt=ue.create,rt=le.create,at=pe.create,st=he.create,it=me.create,ot=fe.create,dt=ye.create,ct=ve.create,ut=ve.strictCreate,lt=_e.create,pt=be.create,ht=xe.create,mt=Se.create,ft=Te.create,yt=Ee.create,gt=Oe.create,vt=Ne.create,_t=Ze.create,wt=je.create,bt=Ce.create,kt=Ie.create,xt=Re.create,St=$e.create,Tt=Ae.create,Et=Me.create,Ot=$e.createWithPreprocess,Nt=ze.create,Zt={string:e=>re.create({...e,coerce:!0}),number:e=>se.create({...e,coerce:!0}),boolean:e=>oe.create({...e,coerce:!0}),bigint:e=>ie.create({...e,coerce:!0}),date:e=>de.create({...e,coerce:!0})},jt=T;var Pt=Object.freeze({__proto__:null,defaultErrorMap:_,setErrorMap:function(e){w=e},getErrorMap:b,makeIssue:k,EMPTY_PATH:[],addIssueToContext:x,ParseStatus:S,INVALID:T,DIRTY:E,OK:O,isAborted:N,isDirty:Z,isValid:j,isAsync:P,get util(){return p},get objectUtil(){return m},ZodParsedType:f,getParsedType:y,ZodType:U,datetimeRegex:ne,ZodString:re,ZodNumber:se,ZodBigInt:ie,ZodBoolean:oe,ZodDate:de,ZodSymbol:ce,ZodUndefined:ue,ZodNull:le,ZodAny:pe,ZodUnknown:he,ZodNever:me,ZodVoid:fe,ZodArray:ye,ZodObject:ve,ZodUnion:_e,ZodDiscriminatedUnion:be,ZodIntersection:xe,ZodTuple:Se,ZodRecord:Te,ZodMap:Ee,ZodSet:Oe,ZodFunction:Ne,ZodLazy:Ze,ZodLiteral:je,ZodEnum:Ce,ZodNativeEnum:Ie,ZodPromise:Re,ZodEffects:$e,ZodTransformer:$e,ZodOptional:Ae,ZodNullable:Me,ZodDefault:Fe,ZodCatch:Le,ZodNaN:De,BRAND:Ue,ZodBranded:qe,ZodPipeline:ze,ZodReadonly:Ve,custom:Be,Schema:U,ZodSchema:U,late:He,get ZodFirstPartyTypeKind(){return We},coerce:Zt,any:at,array:dt,bigint:Xe,boolean:Qe,date:et,discriminatedUnion:pt,effect:St,enum:bt,function:vt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Be((t=>t instanceof e),t),intersection:ht,lazy:_t,literal:wt,map:yt,nan:Ge,nativeEnum:kt,never:it,null:rt,nullable:Et,number:Ye,object:ct,oboolean:()=>Qe().optional(),onumber:()=>Ye().optional(),optional:Tt,ostring:()=>Je().optional(),pipeline:Nt,preprocess:Ot,promise:xt,record:ft,set:gt,strictObject:ut,string:Je,symbol:tt,transformer:St,tuple:mt,undefined:nt,union:lt,unknown:st,void:ot,NEVER:jt,ZodIssueCode:g,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:v});const Ct=Pt.object({detail:Pt.string()});function It(e){if(!e)return"Unknown error";if(e instanceof Error){const t=Ct.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const n=Ct.safeParse(t);return n.success?n.data.detail:e}(e.message)}if("object"==typeof e){const t=Ct.safeParse(e);return t.success?t.data.detail:JSON.stringify(e)}try{return JSON.stringify(e)}catch{return String(e)}}const Rt=1e3;function $t(e,t){const n=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`)}function At(e={}){let t={};function n(e){t=e}let r,a={};function s(e){var t;a.unregisterHandler&&a.unregisterHandler(),a=e,null==(t=a.registerHandler)||t.call(a,_)}function i(e){r="function"!=typeof e?(t,n)=>{const r=e[t];if(r)return r(n);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,n)}:e}const{maxRequestTime:o=Rt}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&n(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...n){const r=n[0];return new Promise(((n,s)=>{var i;if(!a.send)throw $t(["send"],"make requests");const l=d<=1e10?++d:d=0,p={type:"request",id:l,method:e,params:r};c.set(l,{resolve:n,reject:s}),o!==1/0&&u.set(l,setTimeout((()=>{u.delete(l),s(new Error("RPC request timed out."))}),o)),null==(i=t.onSend)||i.call(t,p),a.send(p)}))}const p=new Proxy(l,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>l(t,e)}),h=p;function m(e,...n){var r;const s=n[0];if(!a.send)throw $t(["send"],"send messages");const i={type:"message",id:e,payload:s};null==(r=t.onSend)||r.call(t,i),a.send(i)}const f=new Proxy(m,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>m(t,e)}),y=f,g=new Map,v=new Set;async function _(e){var n,s;if(null==(n=t.onReceive)||n.call(t,e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!r)throw $t(["send","requestHandler"],"handle requests");const{id:n,method:o,params:d}=e;let c;try{c={type:"response",id:n,success:!0,payload:await r(o,d)}}catch(i){if(!(i instanceof Error))throw i;c={type:"response",id:n,success:!1,error:i.message}}return null==(s=t.onSend)||s.call(t,c),void a.send(c)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const n of v)n(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const n of t)n(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:n,reject:r}=c.get(e.id)??{};e.success?null==n||n(e.payload):null==r||r(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:f,sendProxy:y,addMessageListener:function(e,t){var n;if(!a.registerHandler)throw $t(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),null==(n=g.get(e))||n.add(t)):v.add(t)},removeMessageListener:function(e,t){var n,r;"*"!==e?(null==(n=g.get(e))||n.delete(t),0===(null==(r=g.get(e))?void 0:r.size)&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:n}}const Mt="[transport-id]";function Ft(e,t={}){const{transportId:n,filter:r,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:n}=t;return null!=n?{[Mt]:n,data:e}:e}(e,{transportId:n}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:n,filter:r}=t,a=null==r?void 0:r();if(null!=n&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(n){if(e[Mt]!==n)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:n,filter:()=>null==r?void 0:r(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}const Lt={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)}},Dt="undefined"!=typeof window&&window.Logger||Lt;function Ut(e,t){if(!e)throw new Error(t)}var qt,zt=Object.defineProperty,Vt=(e,t)=>zt(e,"name",{value:t,configurable:!0}),Bt=(qt=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy(qt,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):qt);function Ht(e){return!isNaN(parseFloat(e))&&isFinite(e)}function Wt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Kt(e){return function(){return this[e]}}Vt(Ht,"_isNumber"),Vt(Wt,"_capitalize"),Vt(Kt,"_getter");var Jt,Yt,Gt=["isConstructor","isEval","isNative","isToplevel"],Xt=["columnNumber","lineNumber"],Qt=["fileName","functionName","source"],en=Gt.concat(Xt,Qt,["args"],["evalOrigin"]);function tn(e){if(e)for(var t=0;t<en.length;t++)void 0!==e[en[t]]&&this["set"+Wt(en[t])](e[en[t]])}for(Vt(tn,"StackFrame"),tn.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof tn)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new tn(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},tn.fromString=Vt((function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),a=e.substring(t+1,n).split(","),s=e.substring(n+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new tn({functionName:r,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Jt=0;Jt<Gt.length;Jt++)tn.prototype["get"+Wt(Gt[Jt])]=Kt(Gt[Jt]),tn.prototype["set"+Wt(Gt[Jt])]=function(e){return function(t){this[e]=!!t}}(Gt[Jt]);for(Yt=0;Yt<Xt.length;Yt++)tn.prototype["get"+Wt(Xt[Yt])]=Kt(Xt[Yt]),tn.prototype["set"+Wt(Xt[Yt])]=function(e){return function(t){if(!Ht(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Xt[Yt]);for(nn=0;nn<Qt.length;nn++)tn.prototype["get"+Wt(Qt[nn])]=Kt(Qt[nn]),tn.prototype["set"+Wt(Qt[nn])]=function(e){return function(t){this[e]=String(t)}}(Qt[nn]);var nn,rn=tn;function an(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Vt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Vt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Vt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;var r=this.extractLocation(n?n[1]:t),a=n&&t||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new rn({functionName:a,fileName:s,lineNumber:r[1],columnNumber:r[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Vt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new rn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=this.extractLocation(e.replace(t,""));return new rn({functionName:r,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Vt(an,"ErrorStackParser");var sn,on,dn,cn,un,ln,pn,hn,mn,fn=new an,yn="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,gn=yn&&typeof t<"u"&&typeof t.exports<"u"&&typeof Bt<"u"&&typeof __dirname<"u",vn=yn&&!gn,_n=typeof Deno<"u",wn=!yn&&!_n,bn=wn&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"object"==typeof sessionStorage&&"function"!=typeof importScripts,kn=wn&&"function"==typeof importScripts&&"object"==typeof self;async function xn(){if(!yn||(sn=(await import("./__vite-browser-external-CIEyP2s7.js")).default,cn=await import("./__vite-browser-external-CIEyP2s7.js"),un=await import("./__vite-browser-external-CIEyP2s7.js"),dn=(await import("./__vite-browser-external-CIEyP2s7.js")).default,on=await import("./__vite-browser-external-CIEyP2s7.js"),pn=on.sep,typeof Bt<"u"))return;let e={fs:cn,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function Sn(e,t){return on.resolve(t||".",e)}function Tn(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function En(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:un.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function On(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}async function Nn(e,t){let{response:n,binary:r}=hn(e,t);if(r)return r;let a=await n;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Vt(xn,"initNodeModules"),Vt(Sn,"node_resolvePath"),Vt(Tn,"browser_resolvePath"),ln=yn?Sn:Tn,yn||(pn="/"),Vt(En,"node_getBinaryResponse"),Vt(On,"browser_getBinaryResponse"),hn=yn?En:On,Vt(Nn,"loadBinaryFile"),bn)mn=Vt((async e=>await import(e)),"loadScript");else if(kn)mn=Vt((async e=>{try{globalThis.importScripts(e)}catch(t){if(!(t instanceof TypeError))throw t;await import(e)}}),"loadScript");else{if(!yn)throw new Error("Cannot determine runtime environment");mn=Zn}async function Zn(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?dn.runInThisContext(await(await fetch(e)).text()):await import(sn.pathToFileURL(e).href)}async function jn(e){if(yn){await xn();let t=await un.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function Pn(){if(gn)return __dirname;let e;try{throw new Error}catch(r){e=r}let t=fn.parse(e)[0].fileName;if(yn&&!t.startsWith("file://")&&(t=`file://${t}`),vn){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(pn);if(-1===n)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,n)}function Cn(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return n.mount.apply(null,arguments)},syncfs:async(e,t,n)=>{try{let r=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:r,o=t?r:s;await a.reconcile(e,i,o),n(null)}catch(r){n(r)}},getLocalSet:e=>{let n=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>r.join2(e,t)}Vt(a,"isRealDir"),Vt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),r=t.stat(e);t.isDir(r.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:"local",entries:n}},getRemoteSet:async e=>{let t=Object.create(null),n=await In(e.opts.fileSystemHandle);for(let[s,i]of n)"."!==s&&(t[r.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?(await i.getFile()).lastModifiedDate:new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:n}},loadLocalEntry:e=>{let r=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return r.contents=n.getFileDataAsTypedArray(r),{timestamp:a.mtime,mode:a.mode,contents:r.contents};throw new Error("node type not supported")},storeLocalEntry:(e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else{if(!t.isFile(n.mode))throw new Error("node type not supported");t.writeFile(e,n.contents,{canOwn:!0})}t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},removeLocalEntry:e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:t.lastModifiedDate}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,n,a)=>{let s=e.get(r.dirname(n)),i=t.isFile(a.mode)?await s.getFileHandle(r.basename(n),{create:!0}):await s.getDirectoryHandle(r.basename(n),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(n,i)},removeRemoteEntry:async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},reconcile:async(e,n,s)=>{let i=0,o=[];Object.keys(n.entries).forEach((function(e){let r=n.entries[e],a=s.entries[e];(!a||t.isFile(r.mode)&&r.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){n.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===n.type?n.handles:s.handles;for(let t of o){let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(n),r=await a.loadRemoteEntry(e);a.storeLocalEntry(t,r)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,n,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,n)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Vt(Zn,"nodeLoadScript"),Vt(jn,"loadLockFile"),Vt(Pn,"calculateDirname"),Vt(Cn,"initializeNativeFS");var In=Vt((async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),"directory"===r.kind&&await n(r)}Vt(n,"collect"),await n(e);let r=new Map;r.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");r.set(t,a)}return r}),"getFsHandles");function Rn(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Ln(e),quit(e,n){throw t.exited={status:e,toThrow:n},n},print:e.stdout,printErr:e.stderr,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Dn(e.indexURL)};return t}function $n(e){return function(t){try{t.FS.mkdirTree(e)}catch(n){console.error(`Error occurred while making a home directory '${e}':`),console.error(n),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function An(e){return function(t){Object.assign(t.ENV,e)}}function Mn(e){return t=>{for(let n of e)t.FS.mkdirTree(n),t.FS.mount(t.FS.filesystems.NODEFS,{root:n},n)}}function Fn(e){let t=Nn(e);return e=>{let n=e._py_version_major(),r=e._py_version_minor();e.FS.mkdirTree("/lib"),e.FS.mkdirTree(`/lib/python${n}.${r}/site-packages`),e.addRunDependency("install-stdlib"),t.then((t=>{e.FS.writeFile(`/lib/python${n}${r}.zip`,t)})).catch((e=>{console.error("Error occurred while installing the standard library:"),console.error(e)})).finally((()=>{e.removeRunDependency("install-stdlib")}))}}function Ln(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[Fn(t),$n(e.env.HOME),An(e.env),Mn(e._node_mounts),Cn]}function Dn(e){let{binary:t,response:n}=hn(e+"pyodide.asm.wasm");return function(e,r){return async function(){try{let a;a=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;typeof WasmOffsetConverter<"u"&&(wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,i)),r(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Vt(Rn,"createSettings"),Vt($n,"createHomeDirectory"),Vt(An,"setEnvironment"),Vt(Mn,"mountLocalDirectories"),Vt(Fn,"installStdlib"),Vt(Ln,"getFileSystemInitializationFuncs"),Vt(Dn,"getInstantiateWasmFunc");var Un="0.26.2";async function qn(e={}){var t,n;await xn();let r=e.indexURL||await Pn();r=ln(r),r.endsWith("/")||(r+="/"),e.indexURL=r;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:r+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:r,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(n=s.env).PYTHONINSPECT??(n.PYTHONINSPECT="1");let i,o=Rn(s),d=o.API;if(d.lockFilePromise=jn(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await mn(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==Un&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Un}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}Vt(qn,"loadPyodide");const zn=new class{constructor(){this.spans=[]}startSpan(e,t={}){const n={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){const r=this.startSpan(t||e.name,n);try{const t=e();return this.endSpan(r),t}catch(a){throw this.endSpan(r,"error"),a}}wrapAsync(e,t,n={}){return async(...r)=>{const a=this.startSpan(t||e.name,n);try{const t=await e(...r);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=zn;class Vn{constructor(){this.pyodide=null}get requirePyodide(){return Ut(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!qn)throw new Error("loadPyodide is not defined");const t=zn.startSpan("loadPyodide");try{const n=await qn({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:!1,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=n,t.end("ok"),n}catch(n){throw Dt.error("Failed to load Pyodide",n),n}}async mountFilesystem(e){const t=zn.startSpan("mountFilesystem");return i(this.requirePyodide),o(this.requirePyodide),await d(this.requirePyodide),t.end("ok"),u({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:n,onMessage:r,queryParameters:a,userConfig:i}=e;self.messenger={callback:r},self.query_params=a,self.user_config=i;const o=zn.startSpan("startSession.runPython"),d=n||s,[c,u,l]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${d}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${d}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);o.end();const p=new Set(l.toJs());return this.loadNotebookDeps(t,p).then((()=>u(i.runtime.auto_instantiate))),c}async loadNotebookDeps(e,t){const n=this.requirePyodide;e.includes("mo.sql")&&(e="import duckdb\n"+(e=`import pandas\n${e}`)),e="import pyodide_http\n"+(e="import jedi\n"+(e="import pygments\n"+(e=`import docutils\n${e}`)));const r=[...t];let a=zn.startSpan("pyodide.loadPackage");await n.loadPackagesFromImports(e,{errorCallback:Dt.error,messageCallback:Dt.log}),a.end(),a=zn.startSpan("micropip.install");const s=r.filter((e=>!n.loadedPackages[e]));s.length>0&&await n.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{Dt.error("Failed to load packages from micropip",e)})),a.end()}}async function Bn(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Vn}}const Hn=zn.startSpan("worker:init"),Wn=new class{constructor(e){this.onMessage=e,this.started=!1,this.push=e=>{this.started?this.onMessage(e):this.buffer.push(e)},this.start=()=>{this.started=!0,this.buffer.forEach((e=>this.onMessage(e))),this.buffer=[]},this.buffer=[]}}((e=>{Gn.send.kernelMessage({message:e})})),Kn=new class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>{this.status="rejected",t(e)},this.resolve=t=>{this.status="resolved",e(t)}}))}};let Jn=!1;const Yn={startSession:async e=>{var t,n;if(await er,Jn)Dt.warn("Session already started");else{Jn=!0;try{Ut(self.controller,"Controller not loaded"),await(null==(n=(t=self.controller).mountFilesystem)?void 0:n.call(t,{code:e.code,filename:e.filename}));const r=zn.wrapAsync(self.controller.startSession.bind(self.controller)),a=function(e){let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}}((()=>{Gn.send.initializingMessage({message:"Initializing notebook..."}),Gn.send.initialized({})}));Gn.send.initializingMessage({message:"Loading notebook and dependencies..."});const s=await r({code:e.code,filename:e.filename,queryParameters:e.queryParameters,userConfig:e.userConfig,onMessage:e=>{a(),Wn.push(e)}});Kn.resolve(s),Hn.end("ok")}catch(r){Gn.send.initializedError({error:It(r)}),Hn.end("error")}}},loadPackages:async e=>{const t=zn.startSpan("loadPackages");await er,e.includes("mo.sql")&&(e="import duckdb\n"+(e=`import pandas\n${e}`)),await self.pyodide.loadPackagesFromImports(e,{messageCallback:Dt.log,errorCallback:Dt.error}),t.end()},readFile:async e=>{const t=zn.startSpan("readFile");await er;const n=self.pyodide.FS.readFile(e,{encoding:"utf8"});return t.end(),n},setInterruptBuffer:async e=>{await er,self.pyodide.setInterruptBuffer(e)},addPackage:async e=>{await er;const{package:t}=e,n=await self.pyodide.runPythonAsync(`\n import micropip\n import json\n response = None\n try:\n await micropip.install("${t}")\n response = {"success": True}\n except Exception as e:\n response = {"success": False, "error": str(e)}\n json.dumps(response)\n `);return JSON.parse(n)},removePackage:async e=>{await er;const{package:t}=e,n=await self.pyodide.runPythonAsync(`\n import micropip\n import json\n response = None\n try:\n micropip.uninstall("${t}")\n response = {"success": True}\n except Exception as e:\n response = {"success": False, "error": str(e)}\n json.dumps(response)\n `);return JSON.parse(n)},listPackages:async()=>{const e=zn.startSpan("listPackages");await er;const t=await self.pyodide.runPythonAsync('\n import json\n import micropip\n\n packages = micropip.list()\n packages = [\n {"name": p.name, "version": p.version}\n for p in packages.values()\n ]\n json.dumps(sorted(packages, key=lambda pkg: pkg["name"]))\n ');return e.end(),{packages:JSON.parse(t)}},bridge:async e=>{const t=zn.startSpan("bridge",{functionName:e.functionName});await er;const{functionName:n,payload:r}=e;"format"===n&&await self.pyodide.runPythonAsync('\n import micropip\n\n try:\n import black\n except ModuleNotFoundError:\n await micropip.install("black")\n '),"export_markdown"===n&&await self.pyodide.runPythonAsync('\n import micropip\n\n try:\n import yaml\n except ModuleNotFoundError:\n await micropip.install("pyyaml")\n ');const a=await Kn.promise,s=null==r?null:"string"==typeof r?r:JSON.stringify(r),i=null==s?await a[n]():await a[n](s);return Qn.has(n)&&c(self.pyodide),t.end(),"string"==typeof i?JSON.parse(i):i}},Gn=function(e){return At(e)}({transport:(Xn={transportId:"marimo-transport"},Ft(self,Xn)),requestHandler:Yn});var Xn;Gn.send("ready",{}),Gn.addMessageListener("consumerReady",(async()=>{await er,Wn.start()}));const Qn=new Set(["save","save_app_config","rename_file","create_file_or_directory","delete_file_or_directory","move_file_or_directory","update_file"]),er=zn.wrapAsync((async function(){try{const e=self.name,t=function(e){return e.includes("dev"),`v${Un}`}(e),n=await zn.wrapAsync(Bn)(e);self.controller=n,Gn.send.initializingMessage({message:"Loading marimo..."}),self.pyodide=await zn.wrapAsync(n.bootstrap.bind(n))({version:e,pyodideVersion:t})}catch(e){Dt.error("Error bootstrapping",e),Gn.send.initializedError({error:It(e)})}}))()}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default r();
|