UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 1.64 MB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/expression-runtime-stub-BeS_QaqS.js","assets/expression-runtime-stub-DDm9ecP_.js"])))=>i.map(i=>d[i]); (function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.13.4`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`c0601e15-2f11-430d-aa4f-5f33e15d0e08`,e._sentryDebugIdIdentifier=`sentry-dbid-c0601e15-2f11-430d-aa4f-5f33e15d0e08`)})()}catch{}import{a as e,n as t,o as n,r,t as i}from"./chunk-DxpFCn6T.js";import{a,c as o,d as s,f as c,i as l,l as u,m as d,n as f,o as p,t as m,u as h}from"./_MapCache-CUJwh2qp.js";import{Ot as g,S as _,T as v,b as y,na as b,v as x,x as S,y as C}from"./src-wni2AGA3.js";import{C as w,S as T,a as E,b as D,c as O,d as ee,g as te,h as k,i as A,l as ne,m as j,n as re,o as ie,p as ae,r as oe,s as se,u as ce,v as le}from"./sanitize-html-my1ogl5v.js";import{A as ue,C as de,D as fe,E as pe,M as me,O as he,S as ge,T as _e,_ as ve,a as ye,b as be,c as xe,f as Se,g as Ce,h as we,i as Te,j as Ee,k as De,l as Oe,m as ke,o as Ae,p as je,s as Me,t as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./merge-BqvKZ38d.js";import{a as Re,i as ze,r as Be}from"./expression-runtime-stub-DDm9ecP_.js";let Ve=function(e){return e.DUPLICATE=`duplicate`,e.DOWNLOAD=`download`,e.IMPORT_FROM_URL=`import-from-url`,e.IMPORT_FROM_FILE=`import-from-file`,e.PUSH=`push`,e.EDIT_DESCRIPTION=`edit-description`,e.SETTINGS=`settings`,e.DELETE=`delete`,e.ARCHIVE=`archive`,e.UNARCHIVE=`unarchive`,e.RENAME=`rename`,e.CHANGE_OWNER=`change-owner`,e.UNPUBLISH=`unpublish`,e.SHARE=`share`,e}({});const He=600,Ue=15,We=12e3,Ge=175,Ke=150,qe=`@n8n/n8n-nodes-langchain`,Je=100,Ye=`authentication`,Xe={MFA_TOKEN:`MFA_TOKEN`,MFA_RECOVERY_CODE:`MFA_RECOVERY_CODE`},Ze=998,Qe=997,$e=6,et=36,tt=[`ftp`,`ftps`,`dict`,`imap`,`imaps`,`ldap`,`ldaps`,`mqtt`,`pop`,`pop3s`,`rtmp`,`rtsp`,`scp`,`sftp`,`smb`,`smbs`,`smtp`,`smtps`,`telnet`,`tftp`],nt={ftp:`FTP`,ftps:`FTP`,ldap:`LDAP`,ldaps:`LDAP`,mqtt:`MQTT`,imap:`IMAP`,imaps:`IMAP`},rt=1e3,it=500,at=15e3,ot=5e3,st={SECOND:1e3,MINUTE:60*1e3,HOUR:3600*1e3,DAY:1440*60*1e3},ct=3*st.DAY,lt=7*st.DAY,ut=180*st.DAY,dt=1e3;function ft(e){let t=sessionStorage.getItem(`N8N_DEBOUNCE_MULTIPLIER`),n=t===null?1:parseFloat(t);return Math.round(e*(Number.isNaN(n)?1:n))}const pt={UI:{RESIZE:50,QUICK:10},INPUT:{VALIDATION:100,TEXT_CHANGE:200,SEARCH:300},API:{RESOURCE_SEARCH:500,HEAVY_OPERATION:1e3,AUTOSAVE:1500,AUTOSAVE_MAX_WAIT:5e3},TELEMETRY:{BATCH:2e3,TRACK:1e3},COLLABORATION:{ACTIVITY:100},CONNECTION:{WEBSOCKET_DISCONNECT:500}},mt={AdvancedExecutionFilters:`advancedExecutionFilters`,Sharing:`sharing`,Ldap:`ldap`,LogStreaming:`logStreaming`,Variables:`variables`,Saml:`saml`,Oidc:`oidc`,EnforceMFA:`mfaEnforcement`,SourceControl:`sourceControl`,ExternalSecrets:`externalSecrets`,AuditLogs:`auditLogs`,DebugInEditor:`debugInEditor`,WorkerView:`workerView`,AdvancedPermissions:`advancedPermissions`,ApiKeyScopes:`apiKeyScopes`,NamedVersions:`namedVersions`,Provisioning:`provisioning`,PersonalSpacePolicy:`personalSpacePolicy`,CustomRoles:`customRoles`};function ht(e,t){return{name:e,...t??{control:`control`,variant:`variant`}}}const gt=ht(`canvas_zoomed_view`),_t=ht(`ndv_in_focus_panel`),vt=ht(`034_extra_template_links`),yt=ht(`035_template_onboarding`,{control:`control`,variantStarterPack:`variant-starter-pack`,variantSuggestedTemplates:`variant-suggested-templates`}),bt=ht(`37_onboarding_experiments_batch_aug11`,{control:`control`,variantReadyToRun:`variant-ready-to-run-workflows`,variantReadyToRun2:`variant-ready-to-run-workflows_v2`,variantReadyToRun3:`variant-ready-to-run-workflows_v3`}),xt=ht(`039_template_onboarding_v2`);ht(`042_ready-to-run-worfklow_v2`,{control:`control`,variant1:`variant-1-singlebox`,variant2:`variant-2-twoboxes`});const St=ht(`059_ready-to-run-worfklow_v2-3`,{control:`control`,variant5:`variant-5`,variant6:`variant-6`}),Ct=ht(`044_template_reco_v3`),wt=ht(`048_collection_overhaul`),Tt=ht(`055_template_setup_experience`),Et=ht(`056_ai_builder_template_examples`),Dt=ht(`073_builder_plan_mode`),Ot=ht(`075_ai_builder_review_changes`),kt=ht(`076_merge_ask_build`),At={name:`062_execution_logic_v2`,control:`control`,variant:`variant`},jt=ht(`061_tamper_proof_invite_links`),Mt=ht(`065_credentials_app_selection`),Nt=ht(`063_empty_state_builder_prompt`),Pt=ht(`064_focused_nodes`),Ft=ht(`063_resource_center_0`,{control:`control`,variantResources:`variant-resources`,variantInspiration:`variant-inspiration`}),It=ht(`067_sidebar_expanded`),Lt=ht(`070_empty_screen_layout`,{control:`control`,variantBuilderPrompt:`variant-builder-prompt`,variantTemplates:`variant-templates`}),Rt=ht(`069_setup_panel`,{control:`control`,variant:`variant`}),zt=ht(`071_coding_workflow_builder`,{control:`control`,codeNoPinData:`code-no-pin-data`,codePinData:`code-pin-data`});ht(`079_ai_builder_setup_wizard`);const Bt=ht(`078_experiment_check_aa`),Vt=ht(`077_chat_hub_semantic_search`),Ht=ht(`078_floating_chat_hub_panel`),Ut=[vt.name,yt.name,bt.name,xt.name,St.name,Et.name,Dt.name,Tt.name,Ft.name,At.name,wt.name,jt.name,Mt.name,It.name,Lt.name,Rt.name,zt.name,Nt.name,Pt.name,Ot.name,kt.name,Bt.name,Vt.name,Ht.name],Wt=`workflowId`,Gt=`canvas`,Kt=`canvasNode`,qt=`canvasNodeHandle`,Jt=Symbol(`PopOutWindow`),Yt=Symbol(`ExpressionLocalResolveContext`),Xt=Symbol(`TelemetryContext`),Zt=Symbol(`WorkflowState`),Qt=Symbol(`WorkflowDocumentStore`),$t=Symbol(`ChatHubToolContext`),en=1024*1024*16,tn=2048,nn=1024*1024*12,rn=1024*1024,an=1024*1024*4,on=1024*512,sn=`N8N_HIDE_ACTIVATION_ALERT`,cn=`N8N_PIN_DATA_DISCOVERY_NDV`,ln=`N8N_PIN_DATA_DISCOVERY_CANVAS`,un=`N8N_MAIN_PANEL_RELATIVE_WIDTH`,dn=`N8N_THEME`,fn=`N8N_EXPERIMENT_OVERRIDES`,pn=`N8N_HIDE_HIDE_GITHUB_STAR_BUTTON`,mn=`N8N_LOGS_PANEL_OPEN`,hn=`N8N_LOGS_SYNC_SELECTION_ENABLED`,gn=`N8N_LOGS_DETAILS_PANEL`,_n=`N8N_LOGS_DETAILS_PANEL_SUB_NODE`,vn=`N8N_WORKFLOWS_LIST_PREFERENCES`,yn=`N8N_READ_WHATS_NEW_ARTICLES`,bn=`N8N_DISMISSED_WHATS_NEW_CALLOUT`,xn=`N8N_FOCUS_PANEL`,Sn=`N8N_EXPERIMENTAL_DISMISSED_SUGGESTED_WORKFLOWS`,Cn=`N8N_DATA_WORKER`,wn=e=>`${e}_N8N_CHAT_HUB_SELECTED_MODEL`,Tn=e=>`${e}_N8N_CHAT_HUB_CREDENTIALS`,En=e=>`${e}_N8N_CHAT_HUB_HAD_CONVERSATION_BEFORE`,Dn=`N8N_SIDEBAR_WIDTH`,On=`N8N_BROWSER_NOTIFICATION_METADATA`,kn=`N8N_FLOATING_CHAT_WINDOW`,An=`cancel`,jn=`confirm`,Mn=`close`,Nn=`about`,Pn=`chatEmbed`,Fn=`changePassword`,In=`confirmPassword`,Ln=`duplicate`,Rn=`importWorkflowUrl`,zn=`versions`,Bn=`settings`,Vn=`workflowShare`,Hn=`npsSurvey`,Un=`activation`,Wn=`importCurl`,Gn=`settingsLogStream`,Kn=`mfaSetup`,qn=`promptMfaCode`,Jn=`workflowHistoryVersionRestore`,Yn=`workflowHistoryVersionUnpublish`,Xn=`workflowHistoryNameVersion`,Zn=`setupCredentials`,Qn=`newAssistantSession`,$n=`externalSecretsProvider`,er=`secretsProviderConnection`,tr=`deleteSecretsProvider`,nr=`workflowActivationConflictingWebhook`,rr=`fromAiParameters`,ir=`stopManyExecutions`,ar=`workflowExtractionName`,or=`whatsNew`,sr=`workflowDiff`,cr=`templateRecoV2`,lr=`templateRecoV3`,ur=`binaryDataView`,dr=`workflowDescription`,fr=`workflowPublish`,pr=`workflowHistoryPublish`,mr=`workflowHistoryDiff`,hr=`credentialResolverEdit`,gr=`aiBuilderDiff`;let _r=function(e){return e.HOMEPAGE=`Homepage`,e.COLLECTION=`TemplatesCollectionView`,e.EXECUTIONS=`Executions`,e.EXECUTION_PREVIEW=`ExecutionPreview`,e.EXECUTION_DEBUG=`ExecutionDebug`,e.EXECUTION_HOME=`ExecutionsLandingPage`,e.TEMPLATE=`TemplatesWorkflowView`,e.TEMPLATE_SETUP=`TemplatesWorkflowSetupView`,e.TEMPLATES=`TemplatesSearchView`,e.CREDENTIALS=`CredentialsView`,e.NEW_WORKFLOW=`NodeViewNew`,e.WORKFLOW=`NodeViewExisting`,e.DEMO=`WorkflowDemo`,e.DEMO_DIFF=`WorkflowDemoDiff`,e.TEMPLATE_IMPORT=`WorkflowTemplate`,e.WORKFLOW_ONBOARDING=`WorkflowOnboarding`,e.SIGNIN=`SigninView`,e.SIGNUP=`SignupView`,e.SIGNOUT=`SignoutView`,e.SETUP=`SetupView`,e.FORGOT_PASSWORD=`ForgotMyPasswordView`,e.CHANGE_PASSWORD=`ChangePasswordView`,e.SETTINGS=`Settings`,e.USERS_SETTINGS=`UsersSettings`,e.LDAP_SETTINGS=`LdapSettings`,e.PERSONAL_SETTINGS=`PersonalSettings`,e.SECURITY_SETTINGS=`SecuritySettings`,e.API_SETTINGS=`APISettings`,e.NOT_FOUND=`NotFoundView`,e.COMMUNITY_NODES=`CommunityNodes`,e.WORKFLOWS=`WorkflowsView`,e.WORKFLOW_EXECUTIONS=`WorkflowExecutions`,e.EVALUATION=`Evaluation`,e.EVALUATION_EDIT=`EvaluationEdit`,e.EVALUATION_RUNS_DETAIL=`EvaluationRunsDetail`,e.USAGE=`Usage`,e.LOG_STREAMING_SETTINGS=`LogStreamingSettingsView`,e.SSO_SETTINGS=`SSoSettings`,e.EXTERNAL_SECRETS_SETTINGS=`ExternalSecretsSettings`,e.SAML_ONBOARDING=`SamlOnboarding`,e.SOURCE_CONTROL=`SourceControl`,e.MFA_VIEW=`MfaView`,e.WORKFLOW_HISTORY=`WorkflowHistory`,e.WORKER_VIEW=`WorkerView`,e.PROJECTS=`Projects`,e.PROJECT_DETAILS=`ProjectDetails`,e.PROJECTS_WORKFLOWS=`ProjectsWorkflows`,e.PROJECTS_CREDENTIALS=`ProjectsCredentials`,e.PROJECT_SETTINGS=`ProjectSettings`,e.PROJECTS_EXECUTIONS=`ProjectsExecutions`,e.PROJECT_ROLES_SETTINGS=`ProjectRolesSettingsView`,e.PROJECT_ROLE_SETTINGS=`ProjectRoleSettingsView`,e.PROJECT_NEW_ROLE=`ProjectNewRoleView`,e.PROJECT_ROLE_VIEW=`ProjectRoleViewView`,e.PROJECTS_VARIABLES=`ProjectsVariables`,e.HOME_VARIABLES=`HomeVariables`,e.FOLDERS=`Folders`,e.PROJECTS_FOLDERS=`ProjectsFolders`,e.INSIGHTS=`Insights`,e.SHARED_WITH_ME=`SharedWithMe`,e.SHARED_WORKFLOWS=`SharedWorkflows`,e.SHARED_CREDENTIALS=`SharedCredentials`,e.ENTITY_NOT_FOUND=`EntityNotFound`,e.ENTITY_UNAUTHORIZED=`EntityUnAuthorized`,e.PRE_BUILT_AGENT_TEMPLATES=`PreBuiltAgentTemplates`,e.AI_SETTINGS=`AISettingsView`,e.OAUTH_CONSENT=`OAuthConsent`,e.MIGRATION_REPORT=`MigrationReport`,e.MIGRATION_RULE_REPORT=`MigrationRuleReport`,e.RESOLVERS=`Resolvers`,e.RESOURCE_CENTER=`ResourceCenter`,e.RESOURCE_CENTER_SECTION=`ResourceCenterSection`,e}({});const vr=[_r.WORKFLOW,_r.NEW_WORKFLOW,_r.EXECUTION_DEBUG];let yr=function(e){return e.WORKFLOW=`workflow`,e.EXECUTIONS=`executions`,e.SETTINGS=`settings`,e.EVALUATION=`evaluation`,e}({});var br;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(br||={});var xr;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(xr||={});const M=br.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Sr=e=>{switch(typeof e){case`undefined`:return M.undefined;case`string`:return M.string;case`number`:return Number.isNaN(e)?M.nan:M.number;case`boolean`:return M.boolean;case`function`:return M.function;case`bigint`:return M.bigint;case`symbol`:return M.symbol;case`object`:return Array.isArray(e)?M.array:e===null?M.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?M.promise:typeof Map<`u`&&e instanceof Map?M.map:typeof Set<`u`&&e instanceof Set?M.set:typeof Date<`u`&&e instanceof Date?M.date:M.object;default:return M.unknown}},N=br.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`]);var Cr=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,br.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let 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()}};Cr.create=e=>new Cr(e);var wr=(e,t)=>{let n;switch(e.code){case N.invalid_type:n=e.received===M.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case N.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,br.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:n=`Unrecognized key(s) in object: ${br.joinValues(e.keys,`, `)}`;break;case N.invalid_union:n=`Invalid input`;break;case N.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${br.joinValues(e.options)}`;break;case N.invalid_enum_value:n=`Invalid enum value. Expected ${br.joinValues(e.options)}, received '${e.received}'`;break;case N.invalid_arguments:n=`Invalid function arguments`;break;case N.invalid_return_type:n=`Invalid function return type`;break;case N.invalid_date:n=`Invalid date`;break;case N.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(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}"`:br.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case N.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`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 N.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case N.custom:n=`Invalid input`;break;case N.invalid_intersection_types:n=`Intersection results could not be merged`;break;case N.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case N.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,br.assertNever(e)}return{message:n}},Tr=wr;function Er(){return Tr}const Dr=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function P(e,t){let n=Er(),r=Dr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===wr?void 0:wr].filter(e=>!!e)});e.common.issues.push(r)}var Or=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return kr;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return kr;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const kr=Object.freeze({status:`aborted`}),Ar=e=>({status:`dirty`,value:e}),jr=e=>({status:`valid`,value:e}),Mr=e=>e.status===`aborted`,Nr=e=>e.status===`dirty`,Pr=e=>e.status===`valid`,Fr=e=>typeof Promise<`u`&&e instanceof Promise;var F;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(F||={});var Ir=class{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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Lr=(e,t)=>{if(Pr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new Cr(e.common.issues),this._error}}};function Rr(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var zr=class{get description(){return this._def.description}_getType(e){return Sr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Or,ctx:{common:e.parent.common,data:e.data,parsedType:Sr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Fr(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sr(e)};return Lr(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sr(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Pr(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Pr(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sr(e)},r=this._parse({data:e,path:n.path,parent:n});return Lr(n,await(Fr(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:N.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Hi({schema:this,typeName:$i.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:e=>this[`~validate`](e)}}optional(){return Ui.create(this,this._def)}nullable(){return Wi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ci.create(this)}promise(){return Vi.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return Ai.create(this,e,this._def)}transform(e){return new Hi({...Rr(this._def),schema:this,typeName:$i.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Gi({...Rr(this._def),innerType:this,defaultValue:t,typeName:$i.ZodDefault})}brand(){return new Ji({typeName:$i.ZodBranded,type:this,...Rr(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Ki({...Rr(this._def),innerType:this,catchValue:t,typeName:$i.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Yi.create(this,e)}readonly(){return Xi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Br=/^c[^\s-]{8,}$/i,Vr=/^[0-9a-z]+$/,Hr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ur=/^[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,Wr=/^[a-z0-9_-]{21}$/i,Gr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Kr=/^[-+]?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)?)??$/,qr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jr=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Yr,Xr=/^(?:(?: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])$/,Zr=/^(?:(?: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])$/,Qr=/^(([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]))$/,$r=/^(([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])$/,ei=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ti=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ni=`((\\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])))`,ri=RegExp(`^${ni}$`);function ii(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function ai(e){return RegExp(`^${ii(e)}$`)}function oi(e){let t=`${ni}T${ii(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function si(e,t){return!!((t===`v4`||!t)&&Xr.test(e)||(t===`v6`||!t)&&Qr.test(e))}function ci(e,t){if(!Gr.test(e))return!1;try{let[n]=e.split(`.`),r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function li(e,t){return!!((t===`v4`||!t)&&Zr.test(e)||(t===`v6`||!t)&&$r.test(e))}var ui=class e extends zr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.string,received:t.parsedType}),kr}let t=new Or,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?P(n,{code:N.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&P(n,{code:N.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)qr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`email`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Yr||=new RegExp(Jr,`u`),Yr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`emoji`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Ur.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`uuid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Wr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`nanoid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Br.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`cuid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Vr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`cuid2`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Hr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`ulid`,code:N.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),P(n,{validation:`url`,code:N.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`regex`,code:N.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?oi(r).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?ri.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?ai(r).test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:N.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Kr.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`duration`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?si(e.data,r.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`ip`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?ci(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`jwt`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?li(e.data,r.version)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`cidr`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?ei.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`base64`,code:N.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?ti.test(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{validation:`base64url`,code:N.invalid_string,message:r.message}),t.dirty()):br.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:N.invalid_string,...F.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...F.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...F.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...F.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...F.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...F.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...F.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...F.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...F.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...F.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...F.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...F.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...F.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...F.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...F.errToObj(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({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...F.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...F.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...F.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...F.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...F.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...F.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...F.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...F.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...F.errToObj(t)})}nonempty(e){return this.min(1,F.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...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(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};ui.create=e=>new ui({checks:[],typeName:$i.ZodString,coerce:e?.coerce??!1,...Rr(e)});function di(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var fi=class e extends zr{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)!==M.number){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.number,received:t.parsedType}),kr}let t,n=new Or;for(let r of this._def.checks)r.kind===`int`?br.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),P(t,{code:N.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?di(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),P(t,{code:N.not_finite,message:r.message}),n.dirty()):br.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,F.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,F.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,F.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,F.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:F.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:F.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:F.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:F.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:F.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:F.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&br.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};fi.create=e=>new fi({checks:[],typeName:$i.ZodNumber,coerce:e?.coerce||!1,...Rr(e)});var pi=class e extends zr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==M.bigint)return this._getInvalidInput(e);let t,n=new Or;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),P(t,{code:N.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):br.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.bigint,received:t.parsedType}),kr}gte(e,t){return this.setLimit(`min`,e,!0,F.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,F.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,F.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,F.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:F.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:F.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};pi.create=e=>new pi({checks:[],typeName:$i.ZodBigInt,coerce:e?.coerce??!1,...Rr(e)});var mi=class extends zr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.boolean,received:t.parsedType}),kr}return jr(e.data)}};mi.create=e=>new mi({typeName:$i.ZodBoolean,coerce:e?.coerce||!1,...Rr(e)});var hi=class e extends zr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.date,received:t.parsedType}),kr}if(Number.isNaN(e.data.getTime()))return P(this._getOrReturnCtx(e),{code:N.invalid_date}),kr;let t=new Or,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),P(n,{code:N.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):br.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:F.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:F.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};hi.create=e=>new hi({checks:[],coerce:e?.coerce||!1,typeName:$i.ZodDate,...Rr(e)});var gi=class extends zr{_parse(e){if(this._getType(e)!==M.symbol){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.symbol,received:t.parsedType}),kr}return jr(e.data)}};gi.create=e=>new gi({typeName:$i.ZodSymbol,...Rr(e)});var _i=class extends zr{_parse(e){if(this._getType(e)!==M.undefined){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.undefined,received:t.parsedType}),kr}return jr(e.data)}};_i.create=e=>new _i({typeName:$i.ZodUndefined,...Rr(e)});var vi=class extends zr{_parse(e){if(this._getType(e)!==M.null){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.null,received:t.parsedType}),kr}return jr(e.data)}};vi.create=e=>new vi({typeName:$i.ZodNull,...Rr(e)});var yi=class extends zr{constructor(){super(...arguments),this._any=!0}_parse(e){return jr(e.data)}};yi.create=e=>new yi({typeName:$i.ZodAny,...Rr(e)});var bi=class extends zr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jr(e.data)}};bi.create=e=>new bi({typeName:$i.ZodUnknown,...Rr(e)});var xi=class extends zr{_parse(e){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.never,received:t.parsedType}),kr}};xi.create=e=>new xi({typeName:$i.ZodNever,...Rr(e)});var Si=class extends zr{_parse(e){if(this._getType(e)!==M.undefined){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.void,received:t.parsedType}),kr}return jr(e.data)}};Si.create=e=>new Si({typeName:$i.ZodVoid,...Rr(e)});var Ci=class e extends zr{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==M.array)return P(t,{code:N.invalid_type,expected:M.array,received:t.parsedType}),kr;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(P(t,{code:e?N.too_big:N.too_small,minimum:i?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(r.minLength!==null&&t.data.length<r.minLength.value&&(P(t,{code:N.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(P(t,{code:N.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 Ir(t,e,t.path,n)))).then(e=>Or.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Ir(t,e,t.path,n)));return Or.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(e){return this.min(1,e)}};Ci.create=(e,t)=>new Ci({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$i.ZodArray,...Rr(t)});function wi(e){if(e instanceof Ti){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ui.create(wi(r))}return new Ti({...e._def,shape:()=>t})}else if(e instanceof Ci)return new Ci({...e._def,type:wi(e.element)});else if(e instanceof Ui)return Ui.create(wi(e.unwrap()));else if(e instanceof Wi)return Wi.create(wi(e.unwrap()));else if(e instanceof ji)return ji.create(e.items.map(e=>wi(e)));else return e}var Ti=class e extends zr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:br.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==M.object){let t=this._getOrReturnCtx(e);return P(t,{code:N.invalid_type,expected:M.object,received:t.parsedType}),kr}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof xi&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Ir(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof xi){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(P(n,{code:N.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Ir(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Or.mergeObjectSync(t,e)):Or.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:F.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$i.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of br.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of br.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return wi(this)}partial(t){let n={};for(let e of br.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of br.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ui;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ri(br.objectKeys(this.shape))}};Ti.create=(e,t)=>new Ti({shape:()=>e,unknownKeys:`strip`,catchall:xi.create(),typeName:$i.ZodObject,...Rr(t)}),Ti.strictCreate=(e,t)=>new Ti({shape:()=>e,unknownKeys:`strict`,catchall:xi.create(),typeName:$i.ZodObject,...Rr(t)}),Ti.lazycreate=(e,t)=>new Ti({shape:e,unknownKeys:`strip`,catchall:xi.create(),typeName:$i.ZodObject,...Rr(t)});var Ei=class extends zr{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Cr(e.ctx.common.issues));return P(t,{code:N.invalid_union,unionErrors:n}),kr}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!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;let i=r.map(e=>new Cr(e));return P(t,{code:N.invalid_union,unionErrors:i}),kr}}get options(){return this._def.options}};Ei.create=(e,t)=>new Ei({options:e,typeName:$i.ZodUnion,...Rr(t)});var Di=e=>e instanceof Ii?Di(e.schema