cross-seed 6.13.6-2 → 7.0.0-1
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/README.md +12 -13
- package/dist/webui/assets/FieldInfo-Bxj_j8SJ.js +1 -0
- package/dist/webui/assets/Page-C3rteCZt.js +1 -0
- package/dist/webui/assets/array-field-DVSC6nHP.js +1 -0
- package/dist/webui/assets/badge-DTZMtS0e.js +1 -0
- package/dist/webui/assets/check-Bu3ldi63.js +1 -0
- package/dist/webui/assets/chevron-down-CRy8M0kJ.js +1 -0
- package/dist/webui/assets/clients-CW8oEZoQ.js +1 -0
- package/dist/webui/assets/connect-YBNsnjWT.js +1 -0
- package/dist/webui/assets/debug-mz8-WYZj.js +1 -0
- package/dist/webui/assets/directories-BSK28RgR.js +1 -0
- package/dist/webui/assets/duration-field-C6xoSlJg.js +1 -0
- package/dist/webui/assets/general-lJJxZhH7.js +1 -0
- package/dist/webui/assets/health-CXbsVrie.js +1 -0
- package/dist/webui/assets/index-Bi48hI2z.js +54 -0
- package/dist/webui/assets/index-C-Ul7GNg.css +1 -0
- package/dist/webui/assets/index-C2cH1Gst.js +1 -0
- package/dist/webui/assets/index-Cc5bDmJr.js +1 -0
- package/dist/webui/assets/jobs-CxmNab9w.js +1 -0
- package/dist/webui/assets/library-vaj2W8sE.js +1 -0
- package/dist/webui/assets/loader-circle-M0gu1gZ-.js +1 -0
- package/dist/webui/assets/logs-Cu9RyKS0.js +1 -0
- package/dist/webui/assets/search-2R5sIdT8.js +1 -0
- package/dist/webui/assets/select-field-BCqNLDrJ.js +1 -0
- package/dist/webui/assets/select-zHgqMzLj.js +1 -0
- package/dist/webui/assets/settings-CMYjpTbZ.js +1 -0
- package/dist/webui/assets/submit-button-BtcnyggQ.js +1 -0
- package/dist/webui/assets/switch-G0W3uJVN.js +1 -0
- package/dist/webui/assets/switch-field-IBd9ORNq.js +1 -0
- package/dist/webui/assets/table-DvgJU7Gh.js +1 -0
- package/dist/webui/assets/test-tube-BIwmoM45.js +1 -0
- package/dist/webui/assets/text-field-DruSbGhy.js +1 -0
- package/dist/webui/assets/time-BSMZjmyW.js +1 -0
- package/dist/webui/assets/trackers-D-OpAe63.js +7 -0
- package/dist/webui/assets/use-form-validation-context-BkAfWAh0.js +1 -0
- package/dist/webui/assets/use-settings-form-submit-CDRh-E9U.js +2 -0
- package/dist/webui/assets/useQuery-A4Hv_4uX.js +1 -0
- package/dist/webui/index.html +13 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.d.ts +261 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.d.ts.map +1 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.js +53 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.js.map +1 -0
- package/node_modules/@cross-seed/shared/dist/constants.d.ts +122 -0
- package/node_modules/@cross-seed/shared/dist/constants.d.ts.map +1 -0
- package/node_modules/@cross-seed/shared/dist/constants.js +127 -0
- package/node_modules/@cross-seed/shared/dist/constants.js.map +1 -0
- package/node_modules/@cross-seed/shared/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@cross-seed/shared/dist/utils.d.ts +6 -0
- package/node_modules/@cross-seed/shared/dist/utils.d.ts.map +1 -0
- package/node_modules/@cross-seed/shared/dist/utils.js +9 -0
- package/node_modules/@cross-seed/shared/dist/utils.js.map +1 -0
- package/node_modules/@cross-seed/shared/package.json +22 -0
- package/package.json +35 -11
- package/dist/Result.js +0 -64
- package/dist/Result.js.map +0 -1
- package/dist/action.js +0 -693
- package/dist/action.js.map +0 -1
- package/dist/arr.js +0 -199
- package/dist/arr.js.map +0 -1
- package/dist/auth.js +0 -25
- package/dist/auth.js.map +0 -1
- package/dist/clients/Deluge.js +0 -698
- package/dist/clients/Deluge.js.map +0 -1
- package/dist/clients/QBittorrent.js +0 -785
- package/dist/clients/QBittorrent.js.map +0 -1
- package/dist/clients/RTorrent.js +0 -654
- package/dist/clients/RTorrent.js.map +0 -1
- package/dist/clients/TorrentClient.js +0 -272
- package/dist/clients/TorrentClient.js.map +0 -1
- package/dist/clients/Transmission.js +0 -404
- package/dist/clients/Transmission.js.map +0 -1
- package/dist/cmd.js +0 -196
- package/dist/cmd.js.map +0 -1
- package/dist/config.template.cjs +0 -353
- package/dist/config.template.cjs.map +0 -1
- package/dist/configSchema.js +0 -667
- package/dist/configSchema.js.map +0 -1
- package/dist/configuration.js +0 -82
- package/dist/configuration.js.map +0 -1
- package/dist/constants.js +0 -281
- package/dist/constants.js.map +0 -1
- package/dist/dataFiles.js +0 -208
- package/dist/dataFiles.js.map +0 -1
- package/dist/db.js +0 -216
- package/dist/db.js.map +0 -1
- package/dist/decide.js +0 -553
- package/dist/decide.js.map +0 -1
- package/dist/diff.js +0 -24
- package/dist/diff.js.map +0 -1
- package/dist/errors.js +0 -16
- package/dist/errors.js.map +0 -1
- package/dist/indexers.js +0 -180
- package/dist/indexers.js.map +0 -1
- package/dist/inject.js +0 -594
- package/dist/inject.js.map +0 -1
- package/dist/jobs.js +0 -146
- package/dist/jobs.js.map +0 -1
- package/dist/logger.js +0 -143
- package/dist/logger.js.map +0 -1
- package/dist/migrations/00-initialSchema.js +0 -30
- package/dist/migrations/00-initialSchema.js.map +0 -1
- package/dist/migrations/01-jobs.js +0 -12
- package/dist/migrations/01-jobs.js.map +0 -1
- package/dist/migrations/02-timestamps.js +0 -21
- package/dist/migrations/02-timestamps.js.map +0 -1
- package/dist/migrations/03-rateLimits.js +0 -14
- package/dist/migrations/03-rateLimits.js.map +0 -1
- package/dist/migrations/04-auth.js +0 -13
- package/dist/migrations/04-auth.js.map +0 -1
- package/dist/migrations/05-caps.js +0 -16
- package/dist/migrations/05-caps.js.map +0 -1
- package/dist/migrations/06-uniqueDecisions.js +0 -29
- package/dist/migrations/06-uniqueDecisions.js.map +0 -1
- package/dist/migrations/07-limits.js +0 -12
- package/dist/migrations/07-limits.js.map +0 -1
- package/dist/migrations/08-rss.js +0 -15
- package/dist/migrations/08-rss.js.map +0 -1
- package/dist/migrations/09-clientAndDataSearchees.js +0 -34
- package/dist/migrations/09-clientAndDataSearchees.js.map +0 -1
- package/dist/migrations/10-indexerNameAudioBookCaps.js +0 -18
- package/dist/migrations/10-indexerNameAudioBookCaps.js.map +0 -1
- package/dist/migrations/11-trackers.js +0 -38
- package/dist/migrations/11-trackers.js.map +0 -1
- package/dist/migrations/migrations.js +0 -31
- package/dist/migrations/migrations.js.map +0 -1
- package/dist/parseTorrent.js +0 -128
- package/dist/parseTorrent.js.map +0 -1
- package/dist/pipeline.js +0 -527
- package/dist/pipeline.js.map +0 -1
- package/dist/preFilter.js +0 -250
- package/dist/preFilter.js.map +0 -1
- package/dist/pushNotifier.js +0 -137
- package/dist/pushNotifier.js.map +0 -1
- package/dist/runtimeConfig.js +0 -11
- package/dist/runtimeConfig.js.map +0 -1
- package/dist/searchee.js +0 -658
- package/dist/searchee.js.map +0 -1
- package/dist/server.js +0 -456
- package/dist/server.js.map +0 -1
- package/dist/startup.js +0 -203
- package/dist/startup.js.map +0 -1
- package/dist/torrent.js +0 -637
- package/dist/torrent.js.map +0 -1
- package/dist/torznab.js +0 -777
- package/dist/torznab.js.map +0 -1
- package/dist/utils.js +0 -637
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/text-field-DruSbGhy.js","assets/index-Bi48hI2z.js","assets/index-C-Ul7GNg.css","assets/FieldInfo-Bxj_j8SJ.js","assets/use-form-validation-context-BkAfWAh0.js","assets/switch-field-IBd9ORNq.js","assets/switch-G0W3uJVN.js","assets/index-C2cH1Gst.js","assets/select-field-BCqNLDrJ.js","assets/select-zHgqMzLj.js","assets/Page-C3rteCZt.js","assets/chevron-down-CRy8M0kJ.js","assets/check-Bu3ldi63.js","assets/array-field-DVSC6nHP.js","assets/duration-field-C6xoSlJg.js","assets/submit-button-BtcnyggQ.js","assets/loader-circle-M0gu1gZ-.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as A,j as N,U as q,_ as de,u as zt,k as rs,I as is,t as yt,l as ns}from"./index-Bi48hI2z.js";function _t(r,e){return e.sort&&r.sort((t,s)=>t.localeCompare(s)),new Intl.ListFormat("en",{style:e.style??"long",type:e.type??"conjunction"}).format(r)}var mt=(r=>(r.SAVE="save",r.INJECT="inject",r))(mt||{}),pt=(r=>(r.STRICT="strict",r.FLEXIBLE="flexible",r.PARTIAL="partial",r))(pt||{}),gt=(r=>(r.SYMLINK="symlink",r.HARDLINK="hardlink",r.REFLINK="reflink",r.REFLINK_OR_COPY="reflinkOrCopy",r))(gt||{}),Ut=(r=>(r.NAME="name",r.NAME_REGEX="nameRegex",r.FOLDER="folder",r.FOLDER_REGEX="folderRegex",r.CATEGORY="category",r.TAG="tag",r.TRACKER="tracker",r.INFOHASH="infoHash",r.SIZE_BELOW="sizeBelow",r.SIZE_ABOVE="sizeAbove",r.LEGACY="legacy",r))(Ut||{});const Wt={blocklistType:`Blocklist item does not start with a valid prefix. Must be of ${_t(Object.values(Ut),{sort:!1,style:"narrow",type:"unit"})}`,emptyString:"cannot have an empty string. If you want to unset it, use null or undefined.",matchModeInvalid:`matchMode must be one of: ${_t(Object.values(pt).map(r=>`"${r}"`),{sort:!1,style:"narrow",type:"unit"})}`},as={delay:30,torznab:[""],useClientTorrents:!1,torrentClients:[],dataDirs:[""],matchMode:"strict",skipRecheck:!0,autoResumeMaxDownload:52428800,linkCategory:null,linkDir:null,linkDirs:[""],linkType:"hardlink",flatLinking:!1,maxDataDepth:2,torrentDir:null,outputDir:"",injectDir:"",includeSingleEpisodes:!1,includeNonVideos:!1,fuzzySizeThreshold:1,seasonFromEpisodes:null,excludeOlder:null,excludeRecentSearch:null,action:"inject",qbittorrentUrl:null,rtorrentRpcUrl:null,transmissionRpcUrl:null,delugeRpcUrl:null,duplicateCategories:!1,notificationWebhookUrls:[""],port:null,host:null,rssCadence:null,searchCadence:null,snatchTimeout:null,searchTimeout:null,searchLimit:null,verbose:!1,torrents:[""],blockList:[""],apiKey:null,radarr:[""],sonarr:[""]},me=new WeakMap,Ne=new WeakMap,$e={current:[]};let Je=!1,Me=0;const xe=new Set,Ce=new Map;function qt(r){const e=Array.from(r).sort((t,s)=>t instanceof G&&t.options.deps.includes(s)?1:s instanceof G&&s.options.deps.includes(t)?-1:0);for(const t of e){if($e.current.includes(t))continue;$e.current.push(t),t.recompute();const s=Ne.get(t);if(s)for(const i of s){const n=me.get(i);n&&qt(n)}}}function os(r){const e={prevVal:r.prevState,currentVal:r.state};for(const t of r.listeners)t(e)}function ls(r){const e={prevVal:r.prevState,currentVal:r.state};for(const t of r.listeners)t(e)}function Gt(r){if(Me>0&&!Ce.has(r)&&Ce.set(r,r.prevState),xe.add(r),!(Me>0)&&!Je)try{for(Je=!0;xe.size>0;){const e=Array.from(xe);xe.clear();for(const t of e){const s=Ce.get(t)??t.prevState;t.prevState=s,os(t)}for(const t of e){const s=me.get(t);s&&($e.current.push(t),qt(s))}for(const t of e){const s=me.get(t);if(s)for(const i of s)ls(i)}}}finally{Je=!1,$e.current=[],Ce.clear()}}function W(r){Me++;try{r()}finally{if(Me--,Me===0){const e=xe.values().next().value;e&&Gt(e)}}}function us(r){return typeof r=="function"}class Ze{constructor(e,t){this.listeners=new Set,this.subscribe=s=>{var i,n;this.listeners.add(s);const a=(n=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:n.call(i,s,this);return()=>{this.listeners.delete(s),a?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,s,i;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(e):us(e)?this.state=e(this.prevState):this.state=e,(i=(s=this.options)==null?void 0:s.onUpdate)==null||i.call(s),Gt(this)}}class G{constructor(e){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const t=this.options.deps.length,s=new Array(t),i=new Array(t);for(let n=0;n<t;n++){const a=this.options.deps[n];s[n]=a.prevState,i[n]=a.state}return this.lastSeenDepValues=i,{prevDepVals:s,currDepVals:i,prevVal:this.prevState??void 0}},this.recompute=()=>{var t,s;this.prevState=this.state;const i=this.getDepVals();this.state=this.options.fn(i),(s=(t=this.options).onUpdate)==null||s.call(t)},this.checkIfRecalculationNeededDeeply=()=>{for(const n of this.options.deps)n instanceof G&&n.checkIfRecalculationNeededDeeply();let t=!1;const s=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let n=0;n<i.length;n++)if(i[n]!==s[n]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const t of this._subscriptions)t()}),this.subscribe=t=>{var s,i;this.listeners.add(t);const n=(i=(s=this.options).onSubscribe)==null?void 0:i.call(s,t,this);return()=>{this.listeners.delete(t),n?.()}},this.options=e,this.state=e.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(e=this.options.deps){for(const t of e)if(t instanceof G)t.registerOnGraph(),this.registerOnGraph(t.options.deps);else if(t instanceof Ze){let s=me.get(t);s||(s=new Set,me.set(t,s)),s.add(this);let i=Ne.get(this);i||(i=new Set,Ne.set(this,i)),i.add(t)}}unregisterFromGraph(e=this.options.deps){for(const t of e)if(t instanceof G)this.unregisterFromGraph(t.options.deps);else if(t instanceof Ze){const s=me.get(t);s&&s.delete(this);const i=Ne.get(this);i&&i.delete(t)}}}function ds(r){return typeof r=="function"}function bt(r,...e){return ds(r)?r(...e):r}function cs(r){return r||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"")}class Kt{#s=!0;#e;#t;#n;#r;#i;#a;#l;#d=0;#h=5;#o=!1;#c=()=>{this.debugLog("Connected to event bus"),this.#i=!0,this.#o=!1,this.debugLog("Emitting queued events",this.#r),this.#r.forEach(e=>this.emitEventToBus(e)),this.#r=[],this.stopConnectLoop(),this.#t().removeEventListener("tanstack-connect-success",this.#c)};#u=()=>{if(this.#d<this.#h){this.#d++,this.dispatchCustomEvent("tanstack-connect",{});return}this.#t().removeEventListener("tanstack-connect",this.#u),this.debugLog("Max retries reached, giving up on connection"),this.stopConnectLoop()};#f=()=>{this.#o||(this.#o=!0,this.#t().addEventListener("tanstack-connect-success",this.#c),this.#u())};constructor({pluginId:e,debug:t=!1,enabled:s=!0,reconnectEveryMs:i=300}){this.#e=e,this.#s=s,this.#t=this.getGlobalTarget,this.#n=t,this.debugLog(" Initializing event subscription for plugin",this.#e),this.#r=[],this.#i=!1,this.#a=null,this.#l=i}startConnectLoop(){this.#a!==null||this.#i||(this.debugLog(`Starting connect loop (every ${this.#l}ms)`),this.#a=setInterval(this.#u,this.#l))}stopConnectLoop(){this.#o=!1,this.#a!==null&&(clearInterval(this.#a),this.#a=null,this.debugLog("Stopped connect loop"))}debugLog(...e){this.#n&&console.log(`🌴 [tanstack-devtools:${this.#e}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<"u"&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog("Using global event target"),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<"u"&&typeof window.addEventListener<"u")return this.debugLog("Using window as event target"),window;const e=typeof EventTarget<"u"?new EventTarget:void 0;return typeof e>"u"||typeof e.addEventListener>"u"?(this.debugLog("No event mechanism available, running in non-web environment"),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog("Using new EventTarget as fallback"),e)}getPluginId(){return this.#e}dispatchCustomEventShim(e,t){try{const s=new Event(e,{detail:t});this.#t().dispatchEvent(s)}catch{this.debugLog("Failed to dispatch shim event")}}dispatchCustomEvent(e,t){try{this.#t().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog("Emitting event to client bus",e),this.dispatchCustomEvent("tanstack-dispatch-event",e)}emit(e,t){if(!this.#s){this.debugLog("Event bus client is disabled, not emitting event",e,t);return}if(!this.#i){this.debugLog("Bus not available, will be pushed as soon as connected"),this.#r.push({type:`${this.#e}:${e}`,payload:t,pluginId:this.#e}),typeof CustomEvent<"u"&&!this.#o&&(this.#f(),this.startConnectLoop());return}return this.emitEventToBus({type:`${this.#e}:${e}`,payload:t,pluginId:this.#e})}on(e,t){const s=`${this.#e}:${e}`;if(!this.#s)return this.debugLog("Event bus client is disabled, not registering event",s),()=>{};const i=n=>{this.debugLog("Received event from bus",n.detail),t(n.detail)};return this.#t().addEventListener(s,i),this.debugLog("Registered event to bus",s),()=>{this.#t().removeEventListener(s,i)}}onAll(e){if(!this.#s)return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const t=s=>{const i=s.detail;e(i)};return this.#t().addEventListener("tanstack-devtools-global",t),()=>this.#t().removeEventListener("tanstack-devtools-global",t)}onAllPluginEvents(e){if(!this.#s)return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const t=s=>{const i=s.detail;this.#e&&i.pluginId!==this.#e||e(i)};return this.#t().addEventListener("tanstack-devtools-global",t),()=>this.#t().removeEventListener("tanstack-devtools-global",t)}}class hs extends Kt{constructor(e){super({pluginId:"pacer",debug:e?.debug})}}const fs=(r,e)=>{Ht.emit(r,e)},Ht=new hs;function kt(){return{executionCount:0,isPending:!1,lastArgs:void 0,lastExecutionTime:0,nextExecutionTime:0,status:"idle",maybeExecuteCount:0}}const ms={enabled:!0,leading:!0,trailing:!0,wait:0};class ps{constructor(e,t){this.fn=e,this.store=new Ze(kt()),this.setOptions=s=>{this.options={...this.options,...s},this.#t()||this.cancel()},this.#e=s=>{this.store.setState(i=>{const n={...i,...s},{isPending:a}=n;return{...n,status:this.#t()?a?"pending":"idle":"disabled"}}),fs("Throttler",this)},this.#t=()=>!!bt(this.options.enabled,this),this.#n=()=>bt(this.options.wait,this),this.maybeExecute=(...s)=>{this.#e({maybeExecuteCount:this.store.state.maybeExecuteCount+1});const i=Date.now(),n=i-this.store.state.lastExecutionTime,a=this.#n();if(this.options.leading&&n>=a)this.#r(...s);else if(this.#e({lastArgs:s}),!this.#s&&this.options.trailing){const o=this.store.state.lastExecutionTime?i-this.store.state.lastExecutionTime:0,l=a-o;this.#e({isPending:!0}),this.#s=setTimeout(()=>{const{lastArgs:u}=this.store.state;u!==void 0&&this.#r(...u)},l)}},this.#r=(...s)=>{if(!this.#t())return;this.fn(...s);const i=Date.now(),n=i+this.#n();this.#i(),this.#e({executionCount:this.store.state.executionCount+1,lastExecutionTime:i,nextExecutionTime:n,isPending:!1,lastArgs:void 0}),this.options.onExecute?.(s,this),setTimeout(()=>{this.store.state.isPending||this.#e({nextExecutionTime:void 0})},this.#n())},this.flush=()=>{this.store.state.isPending&&this.store.state.lastArgs&&this.#r(...this.store.state.lastArgs)},this.#i=()=>{this.#s&&(clearTimeout(this.#s),this.#s=void 0)},this.cancel=()=>{this.#i(),this.#e({lastArgs:void 0,isPending:!1})},this.reset=()=>{this.#e(kt())},this.key=cs(t.key),this.options={...ms,...t},this.#e(this.options.initialState??{}),Ht.on("d-Throttler",s=>{s.payload.key===this.key&&(this.#e(s.payload.store.state),this.setOptions(s.payload.options))})}#s;#e;#t;#n;#r;#i}function gs(r,e){return new ps(r,e).maybeExecute}function Ae(r,e){return typeof r=="function"?r(e):r}function he(r,e){return Ke(e).reduce((s,i)=>{if(s===null)return null;if(typeof s<"u")return s[i]},r)}function Te(r,e,t){const s=Ke(e);function i(n){if(!s.length)return Ae(t,n);const a=s.shift();if(typeof a=="string"||typeof a=="number"&&!Array.isArray(n))return typeof n=="object"?(n===null&&(n={}),{...n,[a]:i(n[a])}):{[a]:i()};if(Array.isArray(n)&&typeof a=="number"){const o=n.slice(0,a);return[...o.length?o:new Array(a),i(n[a]),...n.slice(a+1)]}return[...new Array(a),i()]}return i(r)}function vs(r,e){const t=Ke(e);function s(i){if(!i)return;if(t.length===1){const a=t[0];if(Array.isArray(i)&&typeof a=="number")return i.filter((u,d)=>d!==a);const{[a]:o,...l}=i;return l}const n=t.shift();if((typeof n=="string"||typeof n=="number"&&!Array.isArray(i))&&typeof i=="object")return{...i,[n]:s(i[n])};if(typeof n=="number"&&Array.isArray(i)){if(n>=i.length)return i;const a=i.slice(0,n);return[...a.length?a:new Array(n),s(i[n]),...i.slice(n+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return s(r)}const ys=/^(\d+)$/gm,_s=/\.(\d+)(?=\.)/gm,bs=/^(\d+)\./gm,ks=/\.(\d+$)/gm,xs=/\.{2,}/gm,tt="__int__",Oe=`${tt}$1`;function Ke(r){if(Array.isArray(r))return[...r];if(typeof r!="string")throw new Error("Path must be a string.");return r.replace(/(^\[)|]/gm,"").replace(/\[/g,".").replace(ys,Oe).replace(_s,`.${Oe}.`).replace(bs,`${Oe}.`).replace(ks,`.${Oe}`).replace(xs,".").split(".").map(e=>{if(e.startsWith(tt)){const t=e.substring(tt.length),s=parseInt(t,10);return String(s)===t?s:t}return e})}function xt(r,e){return r.length===0?e:e.length===0?r:e.startsWith("[")||e.startsWith(".")?r+e:`${r}.${e}`}function Ss(r){return!(Array.isArray(r)&&r.length===0)}function st(r,e){const t=s=>s.validators.filter(Boolean).map(i=>({cause:i.cause,validate:i.fn}));return e.validationLogic({form:e.form,validators:e.validators,event:{type:r,async:!1},runValidation:t})}function rt(r,e){const{asyncDebounceMs:t}=e,{onBlurAsyncDebounceMs:s,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:n}=e.validators||{},a=t??0,o=l=>l.validators.filter(Boolean).map(u=>{const d=u?.cause||r;let h=a;switch(d){case"change":h=i??a;break;case"blur":h=s??a;break;case"dynamic":h=n??a;break;case"submit":h=0;break}return r==="submit"&&(h=0),{cause:d,validate:u.fn,debounceMs:h}});return e.validationLogic({form:e.form,validators:e.validators,event:{type:r,async:!0},runValidation:o})}const it=r=>!!r&&typeof r=="object"&&"fields"in r;function te(r,e){if(Object.is(r,e))return!0;if(typeof r!="object"||r===null||typeof e!="object"||e===null)return!1;if(r instanceof Date&&e instanceof Date)return r.getTime()===e.getTime();if(r instanceof Map&&e instanceof Map){if(r.size!==e.size)return!1;for(const[i,n]of r)if(!e.has(i)||!Object.is(n,e.get(i)))return!1;return!0}if(r instanceof Set&&e instanceof Set){if(r.size!==e.size)return!1;for(const i of r)if(!e.has(i))return!1;return!0}const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const i of t)if(!s.includes(i)||!te(r[i],e[i]))return!1;return!0}const St=({newFormValidatorError:r,isPreviousErrorFromFormValidator:e,previousErrorValue:t})=>r?{newErrorValue:r,newSource:"form"}:e?{newErrorValue:void 0,newSource:void 0}:t?{newErrorValue:t,newSource:"field"}:{newErrorValue:void 0,newSource:void 0},Mt=({formLevelError:r,fieldLevelError:e})=>e?{newErrorValue:e,newSource:"field"}:r?{newErrorValue:r,newSource:"form"}:{newErrorValue:void 0,newSource:void 0};function Z(r,e){return r==null?e:{...r,...e}}let oe=256;const De=[];let Ie;for(;oe--;)De[oe]=(oe+256).toString(16).substring(1);function Yt(){let r=0,e,t="";if(!Ie||oe+16>256){for(Ie=new Array(256),r=256;r--;)Ie[r]=256*Math.random()|0;r=0,oe=0}for(;r<16;r++)e=Ie[oe+r],r===6?t+=De[e&15|64]:r===8?t+=De[e&63|128]:t+=De[e],r&1&&r>1&&r<11&&(t+="-");return oe++,t}const fe=r=>{if(!r.validators)return r.runValidation({validators:[],form:r.form});const e=r.event.async,t=e?void 0:{fn:r.validators.onMount,cause:"mount"},s={fn:e?r.validators.onChangeAsync:r.validators.onChange,cause:"change"},i={fn:e?r.validators.onBlurAsync:r.validators.onBlur,cause:"blur"},n={fn:e?r.validators.onSubmitAsync:r.validators.onSubmit,cause:"submit"},a=e?void 0:{fn:()=>{},cause:"server"};switch(r.event.type){case"mount":return r.runValidation({validators:[t],form:r.form});case"submit":return r.runValidation({validators:[s,i,n,a],form:r.form});case"server":return r.runValidation({validators:[],form:r.form});case"blur":return r.runValidation({validators:[i,a],form:r.form});case"change":return r.runValidation({validators:[s,a],form:r.form});default:throw new Error(`Unknown validation event type: ${r.event.type}`)}};function Ms(r,e){const t=new Map;for(const s of r){const i=s.path??[];let n=e,a="";for(let o=0;o<i.length;o++){const l=i[o];if(l===void 0)continue;const u=typeof l=="object"?l.key:l,d=Number(u);Array.isArray(n)&&!Number.isNaN(d)?a+=`[${d}]`:a+=(o>0?".":"")+String(u),typeof n=="object"&&n!==null?n=n[u]:n=void 0}t.set(a,(t.get(a)??[]).concat(s))}return Object.fromEntries(t)}const wt=(r,e)=>{const t=Ms(r,e);return{form:t,fields:t}},pe={validate({value:r,validationSource:e},t){const s=t["~standard"].validate(r);if(s instanceof Promise)throw new Error("async function passed to sync validator");if(s.issues)return e==="field"?s.issues:wt(s.issues,r)},async validateAsync({value:r,validationSource:e},t){const s=await t["~standard"].validate(r);if(s.issues)return e==="field"?s.issues:wt(s.issues,r)}},Jt=r=>!!r&&"~standard"in r,Pe={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function Le(r){function e(d,h,f){const m=a(d,h,"move",f),y=Math.min(h,f),x=Math.max(h,f);for(let _=y;_<=x;_++)m.push(n(d,_));const E=Object.keys(r.fieldInfo).reduce((_,V)=>(V.startsWith(n(d,h))&&_.set(V,r.getFieldMeta(V)),_),new Map);l(m,h<f?"up":"down"),Object.keys(r.fieldInfo).filter(_=>_.startsWith(n(d,f))).forEach(_=>{const V=_.replace(n(d,f),n(d,h)),I=E.get(V);I&&r.setFieldMeta(_,I)})}function t(d,h){const f=a(d,h,"remove");l(f,"up")}function s(d,h,f){a(d,h,"swap",f).forEach(y=>{if(!y.toString().startsWith(n(d,h)))return;const x=y.toString().replace(n(d,h),n(d,f)),[E,_]=[r.getFieldMeta(y),r.getFieldMeta(x)];E&&r.setFieldMeta(x,E),_&&r.setFieldMeta(y,_)})}function i(d,h){const f=a(d,h,"insert");l(f,"down"),f.forEach(m=>{m.toString().startsWith(n(d,h))&&r.setFieldMeta(m,u())})}function n(d,h){return`${d}[${h}]`}function a(d,h,f,m){const y=[n(d,h)];switch(f){case"swap":y.push(n(d,m));break;case"move":{const[x,E]=[Math.min(h,m),Math.max(h,m)];for(let _=x;_<=E;_++)y.push(n(d,_));break}default:{const x=r.getFieldValue(d),E=Array.isArray(x)?x.length:0;for(let _=h+1;_<E;_++)y.push(n(d,_));break}}return Object.keys(r.fieldInfo).filter(x=>y.some(E=>x.startsWith(E)))}function o(d,h){return d.replace(/\[(\d+)\]/,(f,m)=>{const y=parseInt(m,10);return`[${h==="up"?y+1:Math.max(0,y-1)}]`})}function l(d,h){(h==="up"?d:[...d].reverse()).forEach(m=>{const y=o(m.toString(),h),x=r.getFieldMeta(y);x?r.setFieldMeta(m,x):r.setFieldMeta(m,u())})}const u=()=>Pe;return{handleArrayMove:e,handleArrayRemove:t,handleArraySwap:s,handleArrayInsert:i}}class ws extends Kt{constructor(){super({pluginId:"form-devtools",reconnectEveryMs:1e3})}}const z=new ws;function Xe(r){return{values:r.values??{},errorMap:r.errorMap??{},fieldMetaBase:r.fieldMetaBase??{},isSubmitted:r.isSubmitted??!1,isSubmitting:r.isSubmitting??!1,isValidating:r.isValidating??!1,submissionAttempts:r.submissionAttempts??0,isSubmitSuccessful:r.isSubmitSuccessful??!1,validationMetaMap:r.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}class Ft{constructor(e){this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const s=this.fieldMetaDerived.mount(),i=this.store.mount(),n=()=>{s(),i(),z.emit("form-unmounted",{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});const{onMount:a}=this.options.validators||{};return z.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync("mount"),n},this.update=s=>{if(!s)return;const i=this.options;this.options=s;const n=!!s.transform?.deps?.some((l,u)=>l!==this.prevTransformArray[u]),a=s.defaultValues&&!te(s.defaultValues,i.defaultValues)&&!this.state.isTouched,o=!te(s.defaultState,i.defaultState)&&!this.state.isTouched;!a&&!o&&!n||(W(()=>{this.baseStore.setState(()=>Xe(Object.assign({},this.state,o?s.defaultState:{},a?{values:s.defaultValues}:{},n?{_force_re_eval:!this.state._force_re_eval}:{})))}),z.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}))},this.reset=(s,i)=>{const{fieldMeta:n}=this.state,a=this.resetFieldMeta(n);s&&!i?.keepDefaultValues&&(this.options={...this.options,defaultValues:s}),this.baseStore.setState(()=>Xe({...this.options.defaultState,values:s??this.options.defaultValues??this.options.defaultState?.values,fieldMetaBase:a}))},this.validateAllFields=async s=>{const i=[];return W(()=>{Object.values(this.fieldInfo).forEach(a=>{if(!a.instance)return;const o=a.instance;i.push(Promise.resolve().then(()=>o.validate(s,{skipFormValidation:!0}))),a.instance.state.meta.isTouched||a.instance.setMeta(l=>({...l,isTouched:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=async(s,i,n)=>{const a=this.getFieldValue(s),o=Array.isArray(a)?Math.max(a.length-1,0):null,l=[`${s}[${i}]`];for(let f=i+1;f<=(o??0);f++)l.push(`${s}[${f}]`);const u=Object.keys(this.fieldInfo).filter(f=>l.some(m=>f.startsWith(m))),d=[];return W(()=>{u.forEach(f=>{d.push(Promise.resolve().then(()=>this.validateField(f,n)))})}),(await Promise.all(d)).flat()},this.validateField=(s,i)=>{const n=this.fieldInfo[s]?.instance;return n?(n.state.meta.isTouched||n.setMeta(a=>({...a,isTouched:!0})),n.validate(i)):[]},this.validateSync=s=>{const i=st(s,{...this.options,form:this,validationLogic:this.options.validationLogic||fe});let n=!1;const a={};return W(()=>{for(const u of i){if(!u.validate)continue;const d=this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:h,fieldErrors:f}=je(d),m=ke(u.cause);for(const y of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[y]===void 0)continue;const x=this.getFieldMeta(y);if(!x)continue;const{errorMap:E,errorSourceMap:_}=x,V=f?.[y],{newErrorValue:I,newSource:j}=St({newFormValidatorError:V,isPreviousErrorFromFormValidator:_?.[m]==="form",previousErrorValue:E?.[m]});j==="form"&&(a[y]={...a[y],[m]:V}),E?.[m]!==I&&this.setFieldMeta(y,L=>({...L,errorMap:{...L.errorMap,[m]:I},errorSourceMap:{...L.errorSourceMap,[m]:j}}))}this.state.errorMap?.[m]!==h&&this.baseStore.setState(y=>({...y,errorMap:{...y.errorMap,[m]:h}})),(h||f)&&(n=!0)}const o=ke("submit");this.state.errorMap?.[o]&&s!=="submit"&&!n&&this.baseStore.setState(u=>({...u,errorMap:{...u.errorMap,[o]:void 0}}));const l=ke("server");this.state.errorMap?.[l]&&s!=="server"&&!n&&this.baseStore.setState(u=>({...u,errorMap:{...u.errorMap,[l]:void 0}}))}),{hasErrored:n,fieldsErrorMap:a}},this.validateAsync=async s=>{const i=rt(s,{...this.options,form:this,validationLogic:this.options.validationLogic||fe});this.state.isFormValidating||this.baseStore.setState(u=>({...u,isFormValidating:!0}));const n=[];let a;for(const u of i){if(!u.validate)continue;const d=ke(u.cause);this.state.validationMetaMap[d]?.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[d]={lastAbortController:f},n.push(new Promise(async m=>{let y;try{y=await new Promise((V,I)=>{setTimeout(async()=>{if(f.signal.aborted)return V(void 0);try{V(await this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(j){I(j)}},u.debounceMs)})}catch(V){y=V}const{formError:x,fieldErrors:E}=je(y);E&&(a=a?{...a,...E}:E);const _=ke(u.cause);for(const V of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[V]===void 0)continue;const I=this.getFieldMeta(V);if(!I)continue;const{errorMap:j,errorSourceMap:L}=I,J=a?.[V],{newErrorValue:X,newSource:B}=St({newFormValidatorError:J,isPreviousErrorFromFormValidator:L?.[_]==="form",previousErrorValue:j?.[_]});j?.[_]!==X&&this.setFieldMeta(V,Q=>({...Q,errorMap:{...Q.errorMap,[_]:X},errorSourceMap:{...Q.errorSourceMap,[_]:B}}))}this.baseStore.setState(V=>({...V,errorMap:{...V.errorMap,[_]:x}})),m(a?{fieldErrors:a,errorMapKey:_}:void 0)}))}let o=[];const l={};if(n.length){o=await Promise.all(n);for(const u of o)if(u?.fieldErrors){const{errorMapKey:d}=u;for(const[h,f]of Object.entries(u.fieldErrors)){const y={...l[h]||{},[d]:f};l[h]=y}}}return this.baseStore.setState(u=>({...u,isFormValidating:!1})),l},this.validate=s=>{const{hasErrored:i,fieldsErrorMap:n}=this.validateSync(s);return i&&!this.options.asyncAlways?n:this.validateAsync(s)},this.getFieldValue=s=>he(this.state.values,s),this.getFieldMeta=s=>this.state.fieldMeta[s],this.getFieldInfo=s=>this.fieldInfo[s]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(s,i)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[s]:Ae(i,n.fieldMetaBase[s])}}))},this.resetFieldMeta=s=>Object.keys(s).reduce((i,n)=>{const a=n;return i[a]=Pe,i},{}),this.setFieldValue=(s,i,n)=>{const a=n?.dontUpdateMeta??!1,o=n?.dontRunListeners??!1,l=n?.dontValidate??!1;W(()=>{a||this.setFieldMeta(s,u=>({...u,isTouched:!0,isDirty:!0,errorMap:{...u?.errorMap,onMount:void 0}})),this.baseStore.setState(u=>({...u,values:Te(u.values,s,i)}))}),o||this.getFieldInfo(s).instance?.triggerOnChangeListener(),l||this.validateField(s,"change")},this.deleteField=s=>{const n=[...Object.keys(this.fieldInfo).filter(a=>{const o=s.toString();return a!==o&&a.startsWith(o)}),s];this.baseStore.setState(a=>{const o={...a};return n.forEach(l=>{o.values=vs(o.values,l),delete this.fieldInfo[l],delete o.fieldMetaBase[l]}),o})},this.pushFieldValue=(s,i,n)=>{this.setFieldValue(s,a=>[...Array.isArray(a)?a:[],i],n)},this.insertFieldValue=async(s,i,n,a)=>{this.setFieldValue(s,l=>[...l.slice(0,i),n,...l.slice(i)],Z(a,{dontValidate:!0}));const o=a?.dontValidate??!1;o||await this.validateField(s,"change"),Le(this).handleArrayInsert(s,i),o||await this.validateArrayFieldsStartingFrom(s,i,"change")},this.replaceFieldValue=async(s,i,n,a)=>{this.setFieldValue(s,l=>l.map((u,d)=>d===i?n:u),Z(a,{dontValidate:!0})),(a?.dontValidate??!1)||(await this.validateField(s,"change"),await this.validateArrayFieldsStartingFrom(s,i,"change"))},this.removeFieldValue=async(s,i,n)=>{const a=this.getFieldValue(s),o=Array.isArray(a)?Math.max(a.length-1,0):null;if(this.setFieldValue(s,u=>u.filter((d,h)=>h!==i),Z(n,{dontValidate:!0})),Le(this).handleArrayRemove(s,i),o!==null){const u=`${s}[${o}]`;this.deleteField(u)}(n?.dontValidate??!1)||(await this.validateField(s,"change"),await this.validateArrayFieldsStartingFrom(s,i,"change"))},this.swapFieldValues=(s,i,n,a)=>{this.setFieldValue(s,l=>{const u=l[i],d=l[n];return Te(Te(l,`${i}`,d),`${n}`,u)},Z(a,{dontValidate:!0})),Le(this).handleArraySwap(s,i,n),(a?.dontValidate??!1)||(this.validateField(s,"change"),this.validateField(`${s}[${i}]`,"change"),this.validateField(`${s}[${n}]`,"change"))},this.moveFieldValues=(s,i,n,a)=>{this.setFieldValue(s,l=>{const u=[...l];return u.splice(n,0,u.splice(i,1)[0]),u},Z(a,{dontValidate:!0})),Le(this).handleArrayMove(s,i,n),(a?.dontValidate??!1)||(this.validateField(s,"change"),this.validateField(`${s}[${i}]`,"change"),this.validateField(`${s}[${n}]`,"change"))},this.clearFieldValues=(s,i)=>{const n=this.getFieldValue(s),a=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(s,[],Z(i,{dontValidate:!0})),a!==null)for(let l=0;l<=a;l++){const u=`${s}[${l}]`;this.deleteField(u)}(i?.dontValidate??!1)||this.validateField(s,"change")},this.resetField=s=>{this.baseStore.setState(i=>({...i,fieldMetaBase:{...i.fieldMetaBase,[s]:Pe},values:this.options.defaultValues?Te(i.values,s,he(this.options.defaultValues,s)):i.values}))},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((s,[i,n])=>(Object.keys(n).length&&n.errors.length&&(s[i]={errors:n.errors,errorMap:n.errorMap}),s),{})}),this.parseValuesWithSchema=s=>pe.validate({value:this.state.values,validationSource:"form"},s),this.parseValuesWithSchemaAsync=s=>pe.validateAsync({value:this.state.values,validationSource:"form"},s),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Yt(),this._devtoolsSubmissionOverride=!1,this.baseStore=new Ze(Xe({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values})),this.fieldMetaDerived=new G({deps:[this.baseStore],fn:({prevDepVals:s,currDepVals:i,prevVal:n})=>{const a=n,o=s?.[0],l=i[0];let u=0;const d={};for(const h of Object.keys(l.fieldMetaBase)){const f=l.fieldMetaBase[h],m=o?.fieldMetaBase[h],y=a?.[h],x=he(l.values,h);let E=y?.errors;if(!m||f.errorMap!==m.errorMap){E=Object.values(f.errorMap??{}).filter(L=>L!==void 0);const j=this.getFieldInfo(h)?.instance;j&&!j.options.disableErrorFlat&&(E=E.flat(1))}const _=!Ss(E),V=!f.isDirty,I=te(x,he(this.options.defaultValues,h))||te(x,this.getFieldInfo(h)?.instance?.options.defaultValue);if(y&&y.isPristine===V&&y.isValid===_&&y.isDefaultValue===I&&y.errors===E&&f===m){d[h]=y,u++;continue}d[h]={...f,errors:E??[],isPristine:V,isValid:_,isDefaultValue:I}}return Object.keys(l.fieldMetaBase).length&&a&&u===Object.keys(l.fieldMetaBase).length?a:d}}),this.store=new G({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:s,currDepVals:i,prevVal:n})=>{const a=n,o=s?.[0],l=i[0],u=i[1],d=Object.values(u).filter(Boolean),h=d.some(C=>C.isValidating),f=d.every(C=>C.isValid),m=d.some(C=>C.isTouched),y=d.some(C=>C.isBlurred),x=d.every(C=>C.isDefaultValue),E=m&&l.errorMap?.onMount,_=d.some(C=>C.isDirty),V=!_,I=!!(l.errorMap?.onMount||d.some(C=>C?.errorMap?.onMount)),j=!!h;let L=a?.errors??[];(!o||l.errorMap!==o.errorMap)&&(L=Object.values(l.errorMap).reduce((C,ae)=>ae===void 0?C:ae&&it(ae)?(C.push(ae.form),C):(C.push(ae),C),[]));const J=L.length===0,X=f&&J,B=this.options.canSubmitWhenInvalid??!1,Q=l.submissionAttempts===0&&!m&&!I||!j&&!l.isSubmitting&&X||B;let ue=l.errorMap;if(E&&(L=L.filter(C=>C!==l.errorMap.onMount),ue=Object.assign(ue,{onMount:void 0})),a&&o&&a.errorMap===ue&&a.fieldMeta===this.fieldMetaDerived.state&&a.errors===L&&a.isFieldsValidating===h&&a.isFieldsValid===f&&a.isFormValid===J&&a.isValid===X&&a.canSubmit===Q&&a.isTouched===m&&a.isBlurred===y&&a.isPristine===V&&a.isDefaultValue===x&&a.isDirty===_&&te(o,l))return a;let He={...l,errorMap:ue,fieldMeta:this.fieldMetaDerived.state,errors:L,isFieldsValidating:h,isFieldsValid:f,isFormValid:J,isValid:X,canSubmit:Q,isTouched:m,isBlurred:y,isPristine:V,isDefaultValue:x,isDirty:_};const Ye=this.options.transform?.deps??[];if(Ye.length!==this.prevTransformArray.length||Ye.some((C,ae)=>C!==this.prevTransformArray[ae])){const C=Object.assign({},this,{state:He});this.options.transform?.fn(C),He=C.state,this.prevTransformArray=Ye}return He}}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{});const t=gs(s=>z.emit("form-state",{id:this._formId,state:s}),{wait:300});this.store.subscribe(()=>{t(this.store.state)}),z.on("request-form-state",s=>{s.payload.id===this._formId&&z.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}),z.on("request-form-reset",s=>{s.payload.id===this._formId&&this.reset()}),z.on("request-form-force-submit",s=>{s.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return Jt(e.validate)?pe[e.type](e.value,e.validate):e.validate(e.value)}async handleSubmit(e){this.baseStore.setState(i=>({...i,isSubmitted:!1,submissionAttempts:i.submissionAttempts+1,isSubmitSuccessful:!1})),W(()=>{Object.values(this.fieldInfo).forEach(i=>{i.instance&&(i.instance.state.meta.isTouched||i.instance.setMeta(n=>({...n,isTouched:!0})))})});const t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(i=>({...i,isSubmitting:!0}));const s=()=>{this.baseStore.setState(i=>({...i,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){s(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),z.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validateAllFields",errors:Object.values(this.state.fieldMeta).map(i=>i.errors).flat()});return}if(await this.validate("submit"),!this.state.isValid){s(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),z.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validate",errors:this.state.errors});return}W(()=>{Object.values(this.fieldInfo).forEach(i=>{i.instance?.options.listeners?.onSubmit?.({value:i.instance.state.value,fieldApi:i.instance})})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),W(()=>{this.baseStore.setState(i=>({...i,isSubmitted:!0,isSubmitSuccessful:!0})),z.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),s()})}catch(i){throw this.baseStore.setState(n=>({...n,isSubmitSuccessful:!1})),z.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"inflight",onError:i}),s(),i}}setErrorMap(e){W(()=>{Object.entries(e).forEach(([t,s])=>{const i=t;if(it(s)){const{formError:n,fieldErrors:a}=je(s);for(const o of Object.keys(this.fieldInfo))this.getFieldMeta(o)&&this.setFieldMeta(o,u=>({...u,errorMap:{...u.errorMap,[i]:a?.[o]},errorSourceMap:{...u.errorSourceMap,[i]:"form"}}));this.baseStore.setState(o=>({...o,errorMap:{...o.errorMap,[i]:n}}))}else this.baseStore.setState(n=>({...n,errorMap:{...n.errorMap,[i]:s}}))})})}}function je(r){if(r){if(it(r)){const e=je(r.form).formError,t=r.fields;return{formError:e,fieldErrors:t}}return{formError:r}}return{formError:void 0}}function ke(r){switch(r){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class Vt{constructor(e){this.options={},this.mount=()=>{const t=this.store.mount();this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});const s=this.getInfo();s.instance=this,this.update(this.options);const{onMount:i}=this.options.validators||{};if(i){const n=this.runValidator({validate:i,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});n&&this.setMeta(a=>({...a,errorMap:{...a?.errorMap,onMount:n},errorSourceMap:{...a?.errorSourceMap,onMount:"field"}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),t},this.update=t=>{if(this.options=t,this.name=t.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0){const s=this.form.getFieldValue(this.name);te(s,t.defaultValue)||this.form.setFieldValue(this.name,t.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})}this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(t,s)=>{this.form.setFieldValue(this.name,t,Z(s,{dontRunListeners:!0,dontValidate:!0})),s?.dontRunListeners||this.triggerOnChangeListener(),s?.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=t=>this.form.setFieldMeta(this.name,t),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(t,s)=>{this.form.pushFieldValue(this.name,t,Z(s,{dontRunListeners:!0})),s?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(t,s,i)=>{this.form.insertFieldValue(this.name,t,s,Z(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(t,s,i)=>{this.form.replaceFieldValue(this.name,t,s,Z(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(t,s)=>{this.form.removeFieldValue(this.name,t,Z(s,{dontRunListeners:!0})),s?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(t,s,i)=>{this.form.swapFieldValues(this.name,t,s,Z(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(t,s,i)=>{this.form.moveFieldValues(this.name,t,s,Z(i,{dontRunListeners:!0})),i?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=t=>{this.form.clearFieldValues(this.name,Z(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{const s=Object.values(this.form.fieldInfo),i=[];for(const n of s){if(!n.instance)continue;const{onChangeListenTo:a,onBlurListenTo:o}=n.instance.options.validators||{};t==="change"&&a?.includes(this.name)&&i.push(n.instance),t==="blur"&&o?.includes(this.name)&&i.push(n.instance)}return i},this.validateSync=(t,s)=>{const i=st(t,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||fe}),a=this.getLinkedFields(t).reduce((u,d)=>{const h=st(t,{...d.options,form:d.form,validationLogic:d.form.options.validationLogic||fe});return h.forEach(f=>{f.field=d}),u.concat(h)},[]);let o=!1;W(()=>{const u=(d,h)=>{const f=Re(h.cause),m=h.validate?Et(d.runValidator({validate:h.validate,value:{value:d.store.state.value,validationSource:"field",fieldApi:d},type:"validate"})):void 0,y=s[f],{newErrorValue:x,newSource:E}=Mt({formLevelError:y,fieldLevelError:m});d.state.meta.errorMap?.[f]!==x&&d.setMeta(_=>({..._,errorMap:{..._.errorMap,[f]:x},errorSourceMap:{..._.errorSourceMap,[f]:E}})),x&&(o=!0)};for(const d of i)u(this,d);for(const d of a)d.validate&&u(d.field,d)});const l=Re("submit");return this.state.meta.errorMap?.[l]&&t!=="submit"&&!o&&this.setMeta(u=>({...u,errorMap:{...u.errorMap,[l]:void 0},errorSourceMap:{...u.errorSourceMap,[l]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,s)=>{const i=rt(t,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||fe}),n=await s,a=this.getLinkedFields(t),o=a.reduce((f,m)=>{const y=rt(t,{...m.options,form:m.form,validationLogic:m.form.options.validationLogic||fe});return y.forEach(x=>{x.field=m}),f.concat(y)},[]);this.state.meta.isValidating||this.setMeta(f=>({...f,isValidating:!0}));for(const f of a)f.setMeta(m=>({...m,isValidating:!0}));const l=[],u=[],d=(f,m,y)=>{const x=Re(m.cause);f.getInfo().validationMetaMap[x]?.lastAbortController.abort();const _=new AbortController;this.getInfo().validationMetaMap[x]={lastAbortController:_},y.push(new Promise(async V=>{let I;try{I=await new Promise((B,Q)=>{this.timeoutIds.validations[m.cause]&&clearTimeout(this.timeoutIds.validations[m.cause]),this.timeoutIds.validations[m.cause]=setTimeout(async()=>{if(_.signal.aborted)return B(void 0);try{B(await this.runValidator({validate:m.validate,value:{value:f.store.state.value,fieldApi:f,signal:_.signal,validationSource:"field"},type:"validateAsync"}))}catch(ue){Q(ue)}},m.debounceMs)})}catch(B){I=B}if(_.signal.aborted)return V(void 0);const j=Et(I),L=n[this.name]?.[x],{newErrorValue:J,newSource:X}=Mt({formLevelError:L,fieldLevelError:j});f.setMeta(B=>({...B,errorMap:{...B?.errorMap,[x]:J},errorSourceMap:{...B.errorSourceMap,[x]:X}})),V(J)}))};for(const f of i)f.validate&&d(this,f,l);for(const f of o)f.validate&&d(f.field,f,u);let h=[];(l.length||u.length)&&(h=await Promise.all(l),await Promise.all(u)),this.setMeta(f=>({...f,isValidating:!1}));for(const f of a)f.setMeta(m=>({...m,isValidating:!1}));return h.filter(Boolean)},this.validate=(t,s)=>{if(!this.state.meta.isTouched)return[];const{fieldsErrorMap:i}=s?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(t),{hasErrored:n}=this.validateSync(t,i[this.name]??{});if(n&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[Re(t)]?.lastAbortController.abort(),this.state.meta.errors;const a=s?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(t);return this.validateAsync(t,a)},this.handleChange=t=>{this.setValue(t)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(s=>({...s,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(s=>({...s,isBlurred:!0})),this.validate("blur"),this.triggerOnBlurListener()},this.parseValueWithSchema=t=>pe.validate({value:this.state.value,validationSource:"field"},t),this.parseValueWithSchemaAsync=t=>pe.validateAsync({value:this.state.value,validationSource:"field"},t),this.form=e.form,this.name=e.name,this.options=e,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=new G({deps:[this.form.store],fn:()=>{const t=this.form.getFieldMeta(this.name)??{...Pe,...e.defaultMeta};let s=this.form.getFieldValue(this.name);return!t.isTouched&&s===void 0&&this.options.defaultValue!==void 0&&!te(s,this.options.defaultValue)&&(s=this.options.defaultValue),{value:s,meta:t}}})}get state(){return this.store.state}runValidator(e){return Jt(e.validate)?pe[e.type](e.value,e.validate):e.validate(e.value)}setErrorMap(e){this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))}triggerOnBlurListener(){const e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});const t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})}triggerOnChangeListener(){const e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});const t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})}}function Et(r){if(r)return r}function Re(r){switch(r){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class Be{constructor(e){if(this.getFormFieldName=t=>{if(typeof this.fieldsMap=="string")return xt(this.fieldsMap,t);const s=Ke(t)[0];if(typeof s!="string")return"";const i=t.slice(s.length),n=this.fieldsMap[s];return xt(n,i)},this.getFormFieldOptions=t=>{const s={...t},i=s.validators;if(s.name=this.getFormFieldName(t.name),i&&(i.onChangeListenTo||i.onBlurListenTo)){const n={...i},a=o=>{if(o)return o.map(l=>this.getFormFieldName(l))};n.onChangeListenTo=a(i.onChangeListenTo),n.onBlurListenTo=a(i.onBlurListenTo),s.validators=n}return s},this.mount=()=>this.store.mount(),this.validateArrayFieldsStartingFrom=async(t,s,i)=>this.form.validateArrayFieldsStartingFrom(this.getFormFieldName(t),s,i),this.validateField=(t,s)=>this.form.validateField(this.getFormFieldName(t),s),this.getFieldValue=t=>this.form.getFieldValue(this.getFormFieldName(t)),this.getFieldMeta=t=>this.form.getFieldMeta(this.getFormFieldName(t)),this.setFieldMeta=(t,s)=>this.form.setFieldMeta(this.getFormFieldName(t),s),this.setFieldValue=(t,s,i)=>this.form.setFieldValue(this.getFormFieldName(t),s,i),this.deleteField=t=>this.form.deleteField(this.getFormFieldName(t)),this.pushFieldValue=(t,s,i)=>this.form.pushFieldValue(this.getFormFieldName(t),s,i),this.insertFieldValue=async(t,s,i,n)=>this.form.insertFieldValue(this.getFormFieldName(t),s,i,n),this.replaceFieldValue=async(t,s,i,n)=>this.form.replaceFieldValue(this.getFormFieldName(t),s,i,n),this.removeFieldValue=async(t,s,i)=>this.form.removeFieldValue(this.getFormFieldName(t),s,i),this.swapFieldValues=(t,s,i,n)=>this.form.swapFieldValues(this.getFormFieldName(t),s,i,n),this.moveFieldValues=(t,s,i,n)=>this.form.moveFieldValues(this.getFormFieldName(t),s,i,n),this.clearFieldValues=(t,s)=>this.form.clearFieldValues(this.getFormFieldName(t),s),this.resetField=t=>this.form.resetField(this.getFormFieldName(t)),this.validateAllFields=t=>this.form.validateAllFields(t),e.form instanceof Be){const t=e.form;if(this.form=t.form,typeof e.fields=="string")this.fieldsMap=t.getFormFieldName(e.fields);else{const s={...e.fields};for(const i in s)s[i]=t.getFormFieldName(s[i]);this.fieldsMap=s}}else this.form=e.form,this.fieldsMap=e.fields;this.store=new G({deps:[this.form.store],fn:({currDepVals:t})=>{const s=t[0];let i;if(typeof this.fieldsMap=="string")i=he(s.values,this.fieldsMap);else{i={};const n=this.fieldsMap;for(const a in n)i[a]=he(s.values,n[a])}return{values:i}}})}get state(){return this.store.state}async handleSubmit(e){return this.form.handleSubmit(e)}}const Fe=typeof window<"u"?A.useLayoutEffect:A.useEffect;function Fs(r){const[e,t]=A.useState(()=>({form:r.form,name:r.name})),[s,i]=A.useState(()=>new Vt({...r}));(e.form!==r.form||e.name!==r.name)&&(i(new Vt({...r})),t({form:r.form,name:r.name}));const n=q(s.store,m=>m.value),a=q(s.store,m=>m.meta.isTouched),o=q(s.store,m=>m.meta.isBlurred),l=q(s.store,m=>m.meta.isDirty),u=q(s.store,m=>m.meta.errorMap),d=q(s.store,m=>m.meta.errorSourceMap),h=q(s.store,m=>m.meta.isValidating),f=A.useMemo(()=>{const y={...s,get state(){return{value:n,get meta(){return{...s.state.meta,isTouched:a,isBlurred:o,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:h}}}}};return y.Field=Xt,y},[s,n,a,o,l,u,d,h]);return Fe(s.mount,[s]),Fe(()=>{s.update(r)}),q(s.store,r.mode==="array"?m=>[m.meta,Object.keys(m.value??[]).length]:void 0),f}const Xt=(({children:r,...e})=>{const t=Fs(e),s=A.useMemo(()=>Ae(r,t),[r,t]);return N.jsx(N.Fragment,{children:s})});function Vs({form:r,selector:e,children:t}){const s=q(r.store,e);return N.jsx(N.Fragment,{children:Ae(t,s)})}function Es(r){const e=A.useState(()=>Yt())[0],[t,s]=A.useState(r?.formId),[i,n]=A.useState(()=>new Ft({...r,formId:r?.formId??e}));if(t!==r?.formId){const o=r?.formId??e;n(new Ft({...r,formId:o})),s(o)}const a=A.useMemo(()=>{const o={...i,get formId(){return i._formId},get state(){return i.store.state}};return o.Field=function(u){return N.jsx(Xt,{...u,form:i})},o.Subscribe=function(u){return N.jsx(Vs,{form:i,selector:u.selector,children:u.children})},o},[i]);return Fe(i.mount,[]),Fe(()=>{i.update(r)}),a}function As({lens:r,selector:e,children:t}){const s=q(r.store,e);return N.jsx(N.Fragment,{children:Ae(t,s)})}function Cs(r){const[e]=A.useState(()=>{const t=new Be(r),s=r.form instanceof Be?r.form.form:r.form,i=t;return i.AppForm=function(a){return N.jsx(s.AppForm,{...a})},i.AppField=function(a){return N.jsx(s.AppField,{...e.getFormFieldOptions(a)})},i.Field=function(a){return N.jsx(s.Field,{...e.getFormFieldOptions(a)})},i.Subscribe=function(a){return N.jsx(As,{lens:e,selector:a.selector,children:a.children})},Object.assign(i,{...r.formComponents})});return Fe(e.mount,[e]),e}const At=A.createContext(null),Ct=A.createContext(null);function Ts(){function r(){const t=A.useContext(At);if(!t)throw new Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");return t}function e(){const t=A.useContext(Ct);if(!t)throw new Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");return t}return{fieldContext:At,useFieldContext:r,useFormContext:e,formContext:Ct}}function Os({fieldComponents:r,fieldContext:e,formContext:t,formComponents:s}){function i(o){const l=Es(o),u=A.useMemo(()=>({children:f})=>N.jsx(t.Provider,{value:l,children:f}),[l]),d=A.useMemo(()=>(({children:m,...y})=>N.jsx(l.Field,{...y,children:x=>N.jsx(e.Provider,{value:x,children:m(Object.assign(x,r))})})),[l]);return A.useMemo(()=>Object.assign(l,{AppField:d,AppForm:u,...s}),[l,d,u])}function n({render:o,props:l}){return u=>o({...l,...u})}function a({render:o,props:l,defaultValues:u}){return function(h){const f=A.useMemo(()=>({form:h.form,fields:h.fields,defaultValues:u,formComponents:s}),[h.form,h.fields]),m=Cs(f);return o({...l,...h,group:m})}}return{useAppForm:i,withForm:n,withFieldGroup:a}}const vr={defaultValues:as},{fieldContext:Is,useFieldContext:yr,formContext:Ls,useFormContext:_r}=Ts(),{useAppForm:br}=Os({fieldContext:Is,formContext:Ls,fieldComponents:{TextField:A.lazy(()=>de(()=>import("./text-field-DruSbGhy.js"),__vite__mapDeps([0,1,2,3,4]))),SwitchField:A.lazy(()=>de(()=>import("./switch-field-IBd9ORNq.js"),__vite__mapDeps([5,1,2,6,7]))),SelectField:A.lazy(()=>de(()=>import("./select-field-BCqNLDrJ.js"),__vite__mapDeps([8,1,2,3,9,10,7,11,12,4]))),ArrayField:A.lazy(()=>de(()=>import("./array-field-DVSC6nHP.js"),__vite__mapDeps([13,1,2]))),DurationField:A.lazy(()=>de(()=>import("./duration-field-C6xoSlJg.js"),__vite__mapDeps([14,1,2,9,10,7,11,12,4,3])))},formComponents:{SubmitButton:A.lazy(()=>de(()=>import("./submit-button-BtcnyggQ.js"),__vite__mapDeps([15,1,2,16])))}});function kr(r){return r}var w;(function(r){r.assertEqual=i=>{};function e(i){}r.assertIs=e;function t(i){throw new Error}r.assertNever=t,r.arrayToEnum=i=>{const n={};for(const a of i)n[a]=a;return n},r.getValidEnumValues=i=>{const n=r.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of n)a[o]=i[o];return r.objectValues(a)},r.objectValues=i=>r.objectKeys(i).map(function(n){return i[n]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const n=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.push(a);return n},r.find=(i,n)=>{for(const a of i)if(n(a))return a},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,n=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}r.joinValues=s,r.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(w||(w={}));var Tt;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Tt||(Tt={}));const g=w.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ee=r=>{switch(typeof r){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(r)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(r)?g.array:r===null?g.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?g.promise:typeof Map<"u"&&r instanceof Map?g.map:typeof Set<"u"&&r instanceof Set?g.set:typeof Date<"u"&&r instanceof Date?g.date:g.object;default:return g.unknown}},c=w.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 H extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},s={_errors:[]},i=n=>{for(const a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)s._errors.push(t(a));else{let o=s,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),s}static assert(e){if(!(e instanceof H))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,w.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}H.create=r=>new H(r);const nt=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===g.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,w.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${w.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${w.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${w.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:w.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,w.assertNever(r)}return{message:t}};let Rs=nt;function Ns(){return Rs}const Ds=r=>{const{data:e,path:t,errorMaps:s,issueData:i}=r,n=[...t,...i.path||[]],a={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let o="";const l=s.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...i,path:n,message:o}};function p(r,e){const t=Ns(),s=Ds({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===nt?void 0:nt].filter(i=>!!i)});r.common.issues.push(s)}class P{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const i of t){if(i.status==="aborted")return b;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const i of t){const n=await i.key,a=await i.value;s.push({key:n,value:a})}return P.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const i of t){const{key:n,value:a}=i;if(n.status==="aborted"||a.status==="aborted")return b;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(s[n.value]=a.value)}return{status:e.value,value:s}}}const b=Object.freeze({status:"aborted"}),Se=r=>({status:"dirty",value:r}),U=r=>({status:"valid",value:r}),Ot=r=>r.status==="aborted",It=r=>r.status==="dirty",ge=r=>r.status==="valid",ze=r=>typeof Promise<"u"&&r instanceof Promise;var v;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(v||(v={}));class ie{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}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}}const Lt=(r,e)=>{if(ge(e))return{success:!0,data:e.value};if(!r.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 H(r.common.issues);return this._error=t,this._error}}};function S(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:i}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{const{message:l}=r;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??s??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??t??o.defaultError}},description:i}}class M{get description(){return this._def.description}_getType(e){return ee(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ee(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new P,ctx:{common:e.parent.common,data:e.data,parsedType:ee(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ze(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ee(e)},i=this._parseSync({data:e,path:s.path,parent:s});return Lt(s,i)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ee(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return ge(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>ge(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ee(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(ze(i)?i:Promise.resolve(i));return Lt(s,n)}refine(e,t){const s=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,n)=>{const a=e(i),o=()=>n.addIssue({code:c.custom,...s(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof t=="function"?t(s,i):t),!1))}_refinement(e){return new _e({schema:this,typeName:k.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:t=>this["~validate"](t)}}optional(){return re.create(this,this._def)}nullable(){return be.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this)}promise(){return Ge.create(this,this._def)}or(e){return We.create([this,e],this._def)}and(e){return qe.create(this,e,this._def)}transform(e){return new _e({...S(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ct({...S(this._def),innerType:this,defaultValue:t,typeName:k.ZodDefault})}brand(){return new ar({typeName:k.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ht({...S(this._def),innerType:this,catchValue:t,typeName:k.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return vt.create(this,e)}readonly(){return ft.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const js=/^c[^\s-]{8,}$/i,$s=/^[0-9a-z]+$/,Zs=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ps=/^[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,Bs=/^[a-z0-9_-]{21}$/i,zs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Us=/^[-+]?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)?)??$/,Ws=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qe;const Gs=/^(?:(?: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])$/,Ks=/^(?:(?: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])$/,Hs=/^(([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]))$/,Ys=/^(([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])$/,Js=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qt="((\\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])))",Qs=new RegExp(`^${Qt}$`);function es(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function er(r){return new RegExp(`^${es(r)}$`)}function tr(r){let e=`${Qt}T${es(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function sr(r,e){return!!((e==="v4"||!e)&&Gs.test(r)||(e==="v6"||!e)&&Hs.test(r))}function rr(r,e){if(!zs.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function ir(r,e){return!!((e==="v4"||!e)&&Ks.test(r)||(e==="v6"||!e)&&Ys.test(r))}class se extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:g.string,received:n.parsedType}),b}const s=new P;let i;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:c.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:c.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){const a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?p(i,{code:c.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&p(i,{code:c.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")Ws.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"email",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")Qe||(Qe=new RegExp(qs,"u")),Qe.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"emoji",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")Ps.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"uuid",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Bs.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"nanoid",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")js.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")$s.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid2",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Zs.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ulid",code:c.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),p(i,{validation:"url",code:c.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"regex",code:c.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),p(i,{code:c.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:c.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:c.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?tr(n).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:c.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?Qs.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:c.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?er(n).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:c.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?Us.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"duration",code:c.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?sr(e.data,n.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ip",code:c.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?rr(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"jwt",code:c.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?ir(e.data,n.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cidr",code:c.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?Js.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64",code:c.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?Xs.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64url",code:c.invalid_string,message:n.message}),s.dirty()):w.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(i=>e.test(i),{validation:t,code:c.invalid_string,...v.errToObj(s)})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.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:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...v.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:typeof e?.precision>"u"?null:e?.precision,...v.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...v.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new se({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new se({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new se({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}se.create=r=>new se({checks:[],typeName:k.ZodString,coerce:r?.coerce??!1,...S(r)});function nr(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=t>s?t:s,n=Number.parseInt(r.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return n%a/10**i}class ve extends M{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)!==g.number){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:g.number,received:n.parsedType}),b}let s;const i=new P;for(const n of this._def.checks)n.kind==="int"?w.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:c.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),p(s,{code:c.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),p(s,{code:c.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?nr(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),p(s,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:c.not_finite,message:n.message}),i.dirty()):w.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,s,i){return new ve({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:v.toString(i)}]})}_addCheck(e){return new ve({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const 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"&&w.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ve.create=r=>new ve({checks:[],typeName:k.ZodNumber,coerce:r?.coerce||!1,...S(r)});class Ve extends M{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)!==g.bigint)return this._getInvalidInput(e);let s;const i=new P;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),p(s,{code:c.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),p(s,{code:c.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),p(s,{code:c.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):w.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return p(t,{code:c.invalid_type,expected:g.bigint,received:t.parsedType}),b}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,s,i){return new Ve({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:v.toString(i)}]})}_addCheck(e){return new Ve({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ve.create=r=>new Ve({checks:[],typeName:k.ZodBigInt,coerce:r?.coerce??!1,...S(r)});class at extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:g.boolean,received:s.parsedType}),b}return U(e.data)}}at.create=r=>new at({typeName:k.ZodBoolean,coerce:r?.coerce||!1,...S(r)});class Ue extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_type,expected:g.date,received:n.parsedType}),b}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return p(n,{code:c.invalid_date}),b}const s=new P;let i;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:c.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:c.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):w.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ue({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Ue.create=r=>new Ue({checks:[],coerce:r?.coerce||!1,typeName:k.ZodDate,...S(r)});class Rt extends M{_parse(e){if(this._getType(e)!==g.symbol){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:g.symbol,received:s.parsedType}),b}return U(e.data)}}Rt.create=r=>new Rt({typeName:k.ZodSymbol,...S(r)});class Nt extends M{_parse(e){if(this._getType(e)!==g.undefined){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:g.undefined,received:s.parsedType}),b}return U(e.data)}}Nt.create=r=>new Nt({typeName:k.ZodUndefined,...S(r)});class ot extends M{_parse(e){if(this._getType(e)!==g.null){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:g.null,received:s.parsedType}),b}return U(e.data)}}ot.create=r=>new ot({typeName:k.ZodNull,...S(r)});class Dt extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return U(e.data)}}Dt.create=r=>new Dt({typeName:k.ZodAny,...S(r)});class jt extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return U(e.data)}}jt.create=r=>new jt({typeName:k.ZodUnknown,...S(r)});class ne extends M{_parse(e){const t=this._getOrReturnCtx(e);return p(t,{code:c.invalid_type,expected:g.never,received:t.parsedType}),b}}ne.create=r=>new ne({typeName:k.ZodNever,...S(r)});class $t extends M{_parse(e){if(this._getType(e)!==g.undefined){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:g.void,received:s.parsedType}),b}return U(e.data)}}$t.create=r=>new $t({typeName:k.ZodVoid,...S(r)});class K extends M{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==g.array)return p(t,{code:c.invalid_type,expected:g.array,received:t.parsedType}),b;if(i.exactLength!==null){const a=t.data.length>i.exactLength.value,o=t.data.length<i.exactLength.value;(a||o)&&(p(t,{code:a?c.too_big:c.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(p(t,{code:c.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(p(t,{code:c.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>i.type._parseAsync(new ie(t,a,t.path,o)))).then(a=>P.mergeArray(s,a));const n=[...t.data].map((a,o)=>i.type._parseSync(new ie(t,a,t.path,o)));return P.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new K({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new K({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new K({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}K.create=(r,e)=>new K({type:r,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...S(e)});function ce(r){if(r instanceof T){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=re.create(ce(s))}return new T({...r._def,shape:()=>e})}else return r instanceof K?new K({...r._def,type:ce(r.element)}):r instanceof re?re.create(ce(r.unwrap())):r instanceof be?be.create(ce(r.unwrap())):r instanceof le?le.create(r.items.map(e=>ce(e))):r}class T extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=w.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==g.object){const u=this._getOrReturnCtx(e);return p(u,{code:c.invalid_type,expected:g.object,received:u.parsedType}),b}const{status:s,ctx:i}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof ne&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const d=n[u],h=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new ie(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof ne){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(p(i,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const h=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new ie(i,h,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>P.mergeObjectSync(s,u)):P.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new T({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const i=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:v.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new T({...this._def,unknownKeys:"strip"})}passthrough(){return new T({...this._def,unknownKeys:"passthrough"})}extend(e){return new T({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new T({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:k.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new T({...this._def,catchall:e})}pick(e){const t={};for(const s of w.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new T({...this._def,shape:()=>t})}omit(e){const t={};for(const s of w.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new T({...this._def,shape:()=>t})}deepPartial(){return ce(this)}partial(e){const t={};for(const s of w.objectKeys(this.shape)){const i=this.shape[s];e&&!e[s]?t[s]=i:t[s]=i.optional()}return new T({...this._def,shape:()=>t})}required(e){const t={};for(const s of w.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof re;)n=n._def.innerType;t[s]=n}return new T({...this._def,shape:()=>t})}keyof(){return ts(w.objectKeys(this.shape))}}T.create=(r,e)=>new T({shape:()=>r,unknownKeys:"strip",catchall:ne.create(),typeName:k.ZodObject,...S(e)});T.strictCreate=(r,e)=>new T({shape:()=>r,unknownKeys:"strict",catchall:ne.create(),typeName:k.ZodObject,...S(e)});T.lazycreate=(r,e)=>new T({shape:r,unknownKeys:"strip",catchall:ne.create(),typeName:k.ZodObject,...S(e)});class We extends M{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function i(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=n.map(o=>new H(o.ctx.common.issues));return p(t,{code:c.invalid_union,unionErrors:a}),b}if(t.common.async)return Promise.all(s.map(async n=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(i);{let n;const a=[];for(const l of s){const u={...t,common:{...t.common,issues:[]},parent:null},d=l._parseSync({data:t.data,path:t.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!n&&(n={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=a.map(l=>new H(l));return p(t,{code:c.invalid_union,unionErrors:o}),b}}get options(){return this._def.options}}We.create=(r,e)=>new We({options:r,typeName:k.ZodUnion,...S(e)});function lt(r,e){const t=ee(r),s=ee(e);if(r===e)return{valid:!0,data:r};if(t===g.object&&s===g.object){const i=w.objectKeys(e),n=w.objectKeys(r).filter(o=>i.indexOf(o)!==-1),a={...r,...e};for(const o of n){const l=lt(r[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(t===g.array&&s===g.array){if(r.length!==e.length)return{valid:!1};const i=[];for(let n=0;n<r.length;n++){const a=r[n],o=e[n],l=lt(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return t===g.date&&s===g.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class qe extends M{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=(n,a)=>{if(Ot(n)||Ot(a))return b;const o=lt(n.value,a.value);return o.valid?((It(n)||It(a))&&t.dirty(),{status:t.value,value:o.data}):(p(s,{code:c.invalid_intersection_types}),b)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,a])=>i(n,a)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}qe.create=(r,e,t)=>new qe({left:r,right:e,typeName:k.ZodIntersection,...S(t)});class le extends M{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==g.array)return p(s,{code:c.invalid_type,expected:g.array,received:s.parsedType}),b;if(s.data.length<this._def.items.length)return p(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&s.data.length>this._def.items.length&&(p(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...s.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new ie(s,a,s.path,o)):null}).filter(a=>!!a);return s.common.async?Promise.all(n).then(a=>P.mergeArray(t,a)):P.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new le({...this._def,rest:e})}}le.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:r,typeName:k.ZodTuple,rest:null,...S(e)})};class Zt extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==g.map)return p(s,{code:c.invalid_type,expected:g.map,received:s.parsedType}),b;const i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map(([o,l],u)=>({key:i._parse(new ie(s,o,s.path,[u,"key"])),value:n._parse(new ie(s,l,s.path,[u,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return b;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return b;(u.status==="dirty"||d.status==="dirty")&&t.dirty(),o.set(u.value,d.value)}return{status:t.value,value:o}}}}Zt.create=(r,e,t)=>new Zt({valueType:e,keyType:r,typeName:k.ZodMap,...S(t)});class Ee extends M{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==g.set)return p(s,{code:c.invalid_type,expected:g.set,received:s.parsedType}),b;const i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(p(s,{code:c.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(p(s,{code:c.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const n=this._def.valueType;function a(l){const u=new Set;for(const d of l){if(d.status==="aborted")return b;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const o=[...s.data.values()].map((l,u)=>n._parse(new ie(s,l,s.path,u)));return s.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,t){return new Ee({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new Ee({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ee.create=(r,e)=>new Ee({valueType:r,minSize:null,maxSize:null,typeName:k.ZodSet,...S(e)});class Pt extends M{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})}}Pt.create=(r,e)=>new Pt({getter:r,typeName:k.ZodLazy,...S(e)});class ut extends M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}ut.create=(r,e)=>new ut({value:r,typeName:k.ZodLiteral,...S(e)});function ts(r,e){return new ye({values:r,typeName:k.ZodEnum,...S(e)})}class ye extends M{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return p(t,{expected:w.joinValues(s),received:t.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return p(t,{received:t.data,code:c.invalid_enum_value,options:s}),b}return U(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 ye.create(e,{...this._def,...t})}exclude(e,t=this._def){return ye.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}ye.create=ts;class dt extends M{_parse(e){const t=w.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==g.string&&s.parsedType!==g.number){const i=w.objectValues(t);return p(s,{expected:w.joinValues(i),received:s.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(w.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=w.objectValues(t);return p(s,{received:s.data,code:c.invalid_enum_value,options:i}),b}return U(e.data)}get enum(){return this._def.values}}dt.create=(r,e)=>new dt({values:r,typeName:k.ZodNativeEnum,...S(e)});class Ge extends M{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.promise&&t.common.async===!1)return p(t,{code:c.invalid_type,expected:g.promise,received:t.parsedType}),b;const s=t.parsedType===g.promise?t.data:Promise.resolve(t.data);return U(s.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ge.create=(r,e)=>new Ge({type:r,typeName:k.ZodPromise,...S(e)});class _e extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:a=>{p(s,a),a.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){const a=i.transform(s.data,n);if(s.common.async)return Promise.resolve(a).then(async o=>{if(t.value==="aborted")return b;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?b:l.status==="dirty"||t.value==="dirty"?Se(l.value):l});{if(t.value==="aborted")return b;const o=this._def.schema._parseSync({data:a,path:s.path,parent:s});return o.status==="aborted"?b:o.status==="dirty"||t.value==="dirty"?Se(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,n);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?b:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?b:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(i.type==="transform")if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ge(a))return b;const o=i.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>ge(a)?Promise.resolve(i.transform(a.value,n)).then(o=>({status:t.value,value:o})):b);w.assertNever(i)}}_e.create=(r,e,t)=>new _e({schema:r,typeName:k.ZodEffects,effect:e,...S(t)});_e.createWithPreprocess=(r,e,t)=>new _e({schema:e,effect:{type:"preprocess",transform:r},typeName:k.ZodEffects,...S(t)});class re extends M{_parse(e){return this._getType(e)===g.undefined?U(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(r,e)=>new re({innerType:r,typeName:k.ZodOptional,...S(e)});class be extends M{_parse(e){return this._getType(e)===g.null?U(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}be.create=(r,e)=>new be({innerType:r,typeName:k.ZodNullable,...S(e)});class ct extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===g.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ct.create=(r,e)=>new ct({innerType:r,typeName:k.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class ht extends M{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return ze(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new H(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new H(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ht.create=(r,e)=>new ht({innerType:r,typeName:k.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class Bt extends M{_parse(e){if(this._getType(e)!==g.nan){const s=this._getOrReturnCtx(e);return p(s,{code:c.invalid_type,expected:g.nan,received:s.parsedType}),b}return{status:"valid",value:e.data}}}Bt.create=r=>new Bt({typeName:k.ZodNaN,...S(r)});class ar extends M{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class vt extends M{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?b:n.status==="dirty"?(t.dirty(),Se(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?b:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,t){return new vt({in:e,out:t,typeName:k.ZodPipeline})}}class ft extends M{_parse(e){const t=this._def.innerType._parse(e),s=i=>(ge(i)&&(i.value=Object.freeze(i.value)),i);return ze(t)?t.then(i=>s(i)):s(t)}unwrap(){return this._def.innerType}}ft.create=(r,e)=>new ft({innerType:r,typeName:k.ZodReadonly,...S(e)});var k;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(k||(k={}));const F=se.create,$=ve.create,D=at.create,or=ot.create;ne.create;const R=K.create,Y=T.create;We.create;qe.create;le.create;const et=ut.create;ye.create;const we=dt.create;Ge.create;re.create;be.create;const ss=Y({delay:$().int().min(30).max(3600),torznab:R(F()),useClientTorrents:D(),dataDirs:R(F()),matchMode:we(pt),skipRecheck:D(),autoResumeMaxDownload:$().int().min(0).max(52428800),ignoreNonRelevantFilesToResume:D(),linkDirs:R(F()),linkType:we(gt),flatLinking:D(),maxDataDepth:$().int().min(1),linkCategory:F().optional(),torrentDir:F().optional(),outputDir:F(),injectDir:F().optional(),ignoreTitles:D().optional(),includeSingleEpisodes:D(),verbose:D(),includeNonVideos:D(),seasonFromEpisodes:$().min(0).max(1).optional(),fuzzySizeThreshold:$().gt(0).lte(1),excludeOlder:$().optional(),excludeRecentSearch:$().optional(),action:we(mt),torrentClients:R(F()),duplicateCategories:D(),notificationWebhookUrls:R(F()),torrents:R(F()),port:$().int().min(1).max(65535).optional(),host:F().optional(),basePath:F().optional(),searchCadence:$().optional(),rssCadence:$().optional(),snatchTimeout:$().optional(),searchTimeout:$().optional(),searchLimit:$().int().min(0).optional(),blockList:R(F()),apiKey:F().min(24).optional(),sonarr:R(F()),radarr:R(F())});ss.partial();const O=ss.shape,xr=Y({includeSingleEpisodes:O.includeSingleEpisodes,includeNonVideos:O.includeNonVideos,blockList:O.blockList.nullish(),snatchTimeout:O.snatchTimeout.nullish(),autoResumeMaxDownload:O.autoResumeMaxDownload,fuzzySizeThreshold:O.fuzzySizeThreshold,seasonFromEpisodes:O.seasonFromEpisodes.nullish()});Y({torznab:R(F().url())});const lr=Y({client:F().min(1,Wt.emptyString),url:F().url(),user:F().nullish(),password:F().nullish(),readOnly:D().optional().default(!1).or(or().transform(()=>!1)),plugin:D().nullish().default(!1)}),Sr=Y({torrentClients:R(lr).nullish(),action:we(mt),duplicateCategories:D(),useClientTorrents:D(),linkCategory:F().nullish(),skipRecheck:D(),torrentDir:F().nullable().transform(r=>r??null),outputDir:F().min(1,Wt.emptyString),injectDir:F().optional()}),Mr=Y({delay:O.delay,matchMode:O.matchMode,rssCadence:O.rssCadence.nullish(),searchCadence:O.searchCadence.nullish(),searchTimeout:O.searchTimeout.nullish(),searchLimit:O.searchLimit.nullish(),excludeOlder:O.excludeOlder.nullish(),excludeRecentSearch:O.excludeRecentSearch.nullish()}),wr=Y({host:O.host.nullish(),port:O.port.nullish(),apiKey:O.apiKey.nullish(),radarr:R(F().url().or(et(""))).transform(r=>r??[]).nullable(),sonarr:R(F().url().or(et(""))).transform(r=>r??[]).nullable(),notificationWebhookUrls:R(F().url().or(et(""))).optional()}),Fr=Y({dataDirs:R(F()).transform(r=>r??[]).nullable(),flatLinking:D().transform(r=>typeof r=="boolean"?r:!1),linkDir:F().nullish(),linkDirs:R(F()).nullable(),linkType:we(gt),maxDataDepth:$().gte(1).refine(r=>(r>3&&console.error("Your maxDataDepth is most likely incorrect, please read: https://www.cross-seed.org/docs/tutorials/data-based-matching#setting-up-data-based-matching"),!0))}),ur=Y({verbose:O.verbose,torrents:O.torrents.optional()}),Vr=r=>{const e=zt(),{data:t}=rs(e.settings.get.queryOptions(void 0,{select:i=>i.config}));return{config:t,validationSchema:ur,isFieldRequired:i=>{const n=r.shape[i];return n?!n.isOptional()&&!n.isNullable():(console.warn(`Field "${i}" not found in schema.`),!1)}}},dr=A.createContext(null),Er=({isFieldRequired:r,children:e})=>N.jsx(dr.Provider,{value:{isFieldRequired:r},children:e});function cr(r,e,t={}){const{includeUndefined:s=!1,preserveArrays:i=!0}=t,n=Object.keys(r.shape),a={};for(const o of n){const l=e[o];if(s||o in e)if(i&&Array.isArray(l))a[o]=l;else if(l&&typeof l=="object"&&!Array.isArray(l)){const u=r.shape[o];u instanceof T?a[o]=cr(u,l,t):a[o]=l}else a[o]=l}return a}const hr=()=>{const r=zt(),e=is(),t=r.settings.save.mutationOptions({onSuccess:async()=>{await e.invalidateQueries({queryKey:r.settings.get.queryKey(),exact:!1}),yt.success("Settings saved successfully!",{description:"Your changes will take effect on the next restart."})},onError:i=>{yt.error("Failed to save settings",{description:i.message||"An unknown error occurred"})}}),s=ns(t);return{saveConfig:s.mutate,saveConfigAsync:s.mutateAsync,isLoading:s.isPending,isError:s.isError,isSuccess:s.isSuccess,error:s.error,data:s.data,reset:s.reset}};function fr(r){return r.filter(e=>e!=="")}function mr(r){return Object.keys(r).forEach(e=>{const t=e;r[t]===null&&delete r[t]}),r}function Ar(){const{saveConfig:r}=hr();return A.useCallback(async({value:e})=>{try{return Object.keys(e).forEach(t=>{const s=t,i=e[s];i&&Array.isArray(i)&&(e[s]=fr(i))}),mr(e),await r(e),{value:e}}catch(t){return console.error("Exception:",t),{status:"error",error:{_form:"An unexpected error occurred"}}}},[r])}export{mt as A,Er as F,gt as L,pt as M,Ar as a,br as b,vr as c,F as d,Fr as e,kr as f,xr as g,wr as h,lr as i,hr as j,Sr as k,et as l,yr as m,dr as n,_r as o,cr as p,Mr as s,Vr as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as r,X as u}from"./index-Bi48hI2z.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Cross Seed</title>
|
|
7
|
+
<script type="module" crossorigin src="/__CROSS_SEED_BASE_PATH__/assets/index-Bi48hI2z.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/__CROSS_SEED_BASE_PATH__/assets/index-C-Ul7GNg.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Action, LinkType, MatchMode } from "./constants.js";
|
|
3
|
+
export declare const RUNTIME_CONFIG_SCHEMA: z.ZodObject<{
|
|
4
|
+
delay: z.ZodNumber;
|
|
5
|
+
torznab: z.ZodArray<z.ZodString, "many">;
|
|
6
|
+
useClientTorrents: z.ZodBoolean;
|
|
7
|
+
dataDirs: z.ZodArray<z.ZodString, "many">;
|
|
8
|
+
matchMode: z.ZodNativeEnum<typeof MatchMode>;
|
|
9
|
+
skipRecheck: z.ZodBoolean;
|
|
10
|
+
autoResumeMaxDownload: z.ZodNumber;
|
|
11
|
+
ignoreNonRelevantFilesToResume: z.ZodBoolean;
|
|
12
|
+
linkDirs: z.ZodArray<z.ZodString, "many">;
|
|
13
|
+
linkType: z.ZodNativeEnum<typeof LinkType>;
|
|
14
|
+
flatLinking: z.ZodBoolean;
|
|
15
|
+
maxDataDepth: z.ZodNumber;
|
|
16
|
+
linkCategory: z.ZodOptional<z.ZodString>;
|
|
17
|
+
torrentDir: z.ZodOptional<z.ZodString>;
|
|
18
|
+
outputDir: z.ZodString;
|
|
19
|
+
injectDir: z.ZodOptional<z.ZodString>;
|
|
20
|
+
ignoreTitles: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
includeSingleEpisodes: z.ZodBoolean;
|
|
22
|
+
verbose: z.ZodBoolean;
|
|
23
|
+
includeNonVideos: z.ZodBoolean;
|
|
24
|
+
seasonFromEpisodes: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
fuzzySizeThreshold: z.ZodNumber;
|
|
26
|
+
excludeOlder: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
excludeRecentSearch: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
action: z.ZodNativeEnum<typeof Action>;
|
|
29
|
+
torrentClients: z.ZodArray<z.ZodString, "many">;
|
|
30
|
+
duplicateCategories: z.ZodBoolean;
|
|
31
|
+
notificationWebhookUrls: z.ZodArray<z.ZodString, "many">;
|
|
32
|
+
torrents: z.ZodArray<z.ZodString, "many">;
|
|
33
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
host: z.ZodOptional<z.ZodString>;
|
|
35
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
36
|
+
searchCadence: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
rssCadence: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
snatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
searchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
searchLimit: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
blockList: z.ZodArray<z.ZodString, "many">;
|
|
42
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
43
|
+
sonarr: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
radarr: z.ZodArray<z.ZodString, "many">;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
delay: number;
|
|
47
|
+
torznab: string[];
|
|
48
|
+
useClientTorrents: boolean;
|
|
49
|
+
dataDirs: string[];
|
|
50
|
+
matchMode: MatchMode;
|
|
51
|
+
skipRecheck: boolean;
|
|
52
|
+
autoResumeMaxDownload: number;
|
|
53
|
+
ignoreNonRelevantFilesToResume: boolean;
|
|
54
|
+
linkDirs: string[];
|
|
55
|
+
linkType: LinkType;
|
|
56
|
+
flatLinking: boolean;
|
|
57
|
+
maxDataDepth: number;
|
|
58
|
+
outputDir: string;
|
|
59
|
+
includeSingleEpisodes: boolean;
|
|
60
|
+
verbose: boolean;
|
|
61
|
+
includeNonVideos: boolean;
|
|
62
|
+
fuzzySizeThreshold: number;
|
|
63
|
+
action: Action;
|
|
64
|
+
torrentClients: string[];
|
|
65
|
+
duplicateCategories: boolean;
|
|
66
|
+
notificationWebhookUrls: string[];
|
|
67
|
+
torrents: string[];
|
|
68
|
+
blockList: string[];
|
|
69
|
+
sonarr: string[];
|
|
70
|
+
radarr: string[];
|
|
71
|
+
linkCategory?: string | undefined;
|
|
72
|
+
torrentDir?: string | undefined;
|
|
73
|
+
injectDir?: string | undefined;
|
|
74
|
+
ignoreTitles?: boolean | undefined;
|
|
75
|
+
seasonFromEpisodes?: number | undefined;
|
|
76
|
+
excludeOlder?: number | undefined;
|
|
77
|
+
excludeRecentSearch?: number | undefined;
|
|
78
|
+
port?: number | undefined;
|
|
79
|
+
host?: string | undefined;
|
|
80
|
+
basePath?: string | undefined;
|
|
81
|
+
searchCadence?: number | undefined;
|
|
82
|
+
rssCadence?: number | undefined;
|
|
83
|
+
snatchTimeout?: number | undefined;
|
|
84
|
+
searchTimeout?: number | undefined;
|
|
85
|
+
searchLimit?: number | undefined;
|
|
86
|
+
apiKey?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
delay: number;
|
|
89
|
+
torznab: string[];
|
|
90
|
+
useClientTorrents: boolean;
|
|
91
|
+
dataDirs: string[];
|
|
92
|
+
matchMode: MatchMode;
|
|
93
|
+
skipRecheck: boolean;
|
|
94
|
+
autoResumeMaxDownload: number;
|
|
95
|
+
ignoreNonRelevantFilesToResume: boolean;
|
|
96
|
+
linkDirs: string[];
|
|
97
|
+
linkType: LinkType;
|
|
98
|
+
flatLinking: boolean;
|
|
99
|
+
maxDataDepth: number;
|
|
100
|
+
outputDir: string;
|
|
101
|
+
includeSingleEpisodes: boolean;
|
|
102
|
+
verbose: boolean;
|
|
103
|
+
includeNonVideos: boolean;
|
|
104
|
+
fuzzySizeThreshold: number;
|
|
105
|
+
action: Action;
|
|
106
|
+
torrentClients: string[];
|
|
107
|
+
duplicateCategories: boolean;
|
|
108
|
+
notificationWebhookUrls: string[];
|
|
109
|
+
torrents: string[];
|
|
110
|
+
blockList: string[];
|
|
111
|
+
sonarr: string[];
|
|
112
|
+
radarr: string[];
|
|
113
|
+
linkCategory?: string | undefined;
|
|
114
|
+
torrentDir?: string | undefined;
|
|
115
|
+
injectDir?: string | undefined;
|
|
116
|
+
ignoreTitles?: boolean | undefined;
|
|
117
|
+
seasonFromEpisodes?: number | undefined;
|
|
118
|
+
excludeOlder?: number | undefined;
|
|
119
|
+
excludeRecentSearch?: number | undefined;
|
|
120
|
+
port?: number | undefined;
|
|
121
|
+
host?: string | undefined;
|
|
122
|
+
basePath?: string | undefined;
|
|
123
|
+
searchCadence?: number | undefined;
|
|
124
|
+
rssCadence?: number | undefined;
|
|
125
|
+
snatchTimeout?: number | undefined;
|
|
126
|
+
searchTimeout?: number | undefined;
|
|
127
|
+
searchLimit?: number | undefined;
|
|
128
|
+
apiKey?: string | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
export type RuntimeConfig = z.infer<typeof RUNTIME_CONFIG_SCHEMA>;
|
|
131
|
+
export declare const RUNTIME_CONFIG_OVERRIDES_SCHEMA: z.ZodObject<{
|
|
132
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
torznab: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
134
|
+
useClientTorrents: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
dataDirs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
136
|
+
matchMode: z.ZodOptional<z.ZodNativeEnum<typeof MatchMode>>;
|
|
137
|
+
skipRecheck: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
autoResumeMaxDownload: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
ignoreNonRelevantFilesToResume: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
linkDirs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
141
|
+
linkType: z.ZodOptional<z.ZodNativeEnum<typeof LinkType>>;
|
|
142
|
+
flatLinking: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
maxDataDepth: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
linkCategory: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
145
|
+
torrentDir: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
146
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
147
|
+
injectDir: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
148
|
+
ignoreTitles: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
149
|
+
includeSingleEpisodes: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
includeNonVideos: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
seasonFromEpisodes: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
153
|
+
fuzzySizeThreshold: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
excludeOlder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
155
|
+
excludeRecentSearch: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
156
|
+
action: z.ZodOptional<z.ZodNativeEnum<typeof Action>>;
|
|
157
|
+
torrentClients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
158
|
+
duplicateCategories: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
notificationWebhookUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
160
|
+
torrents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
161
|
+
port: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
162
|
+
host: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
163
|
+
basePath: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
164
|
+
searchCadence: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
165
|
+
rssCadence: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
166
|
+
snatchTimeout: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
167
|
+
searchTimeout: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
168
|
+
searchLimit: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
169
|
+
blockList: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
170
|
+
apiKey: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
171
|
+
sonarr: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
172
|
+
radarr: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
delay?: number | undefined;
|
|
175
|
+
torznab?: string[] | undefined;
|
|
176
|
+
useClientTorrents?: boolean | undefined;
|
|
177
|
+
dataDirs?: string[] | undefined;
|
|
178
|
+
matchMode?: MatchMode | undefined;
|
|
179
|
+
skipRecheck?: boolean | undefined;
|
|
180
|
+
autoResumeMaxDownload?: number | undefined;
|
|
181
|
+
ignoreNonRelevantFilesToResume?: boolean | undefined;
|
|
182
|
+
linkDirs?: string[] | undefined;
|
|
183
|
+
linkType?: LinkType | undefined;
|
|
184
|
+
flatLinking?: boolean | undefined;
|
|
185
|
+
maxDataDepth?: number | undefined;
|
|
186
|
+
linkCategory?: string | undefined;
|
|
187
|
+
torrentDir?: string | undefined;
|
|
188
|
+
outputDir?: string | undefined;
|
|
189
|
+
injectDir?: string | undefined;
|
|
190
|
+
ignoreTitles?: boolean | undefined;
|
|
191
|
+
includeSingleEpisodes?: boolean | undefined;
|
|
192
|
+
verbose?: boolean | undefined;
|
|
193
|
+
includeNonVideos?: boolean | undefined;
|
|
194
|
+
seasonFromEpisodes?: number | undefined;
|
|
195
|
+
fuzzySizeThreshold?: number | undefined;
|
|
196
|
+
excludeOlder?: number | undefined;
|
|
197
|
+
excludeRecentSearch?: number | undefined;
|
|
198
|
+
action?: Action | undefined;
|
|
199
|
+
torrentClients?: string[] | undefined;
|
|
200
|
+
duplicateCategories?: boolean | undefined;
|
|
201
|
+
notificationWebhookUrls?: string[] | undefined;
|
|
202
|
+
torrents?: string[] | undefined;
|
|
203
|
+
port?: number | undefined;
|
|
204
|
+
host?: string | undefined;
|
|
205
|
+
basePath?: string | undefined;
|
|
206
|
+
searchCadence?: number | undefined;
|
|
207
|
+
rssCadence?: number | undefined;
|
|
208
|
+
snatchTimeout?: number | undefined;
|
|
209
|
+
searchTimeout?: number | undefined;
|
|
210
|
+
searchLimit?: number | undefined;
|
|
211
|
+
blockList?: string[] | undefined;
|
|
212
|
+
apiKey?: string | undefined;
|
|
213
|
+
sonarr?: string[] | undefined;
|
|
214
|
+
radarr?: string[] | undefined;
|
|
215
|
+
}, {
|
|
216
|
+
delay?: number | undefined;
|
|
217
|
+
torznab?: string[] | undefined;
|
|
218
|
+
useClientTorrents?: boolean | undefined;
|
|
219
|
+
dataDirs?: string[] | undefined;
|
|
220
|
+
matchMode?: MatchMode | undefined;
|
|
221
|
+
skipRecheck?: boolean | undefined;
|
|
222
|
+
autoResumeMaxDownload?: number | undefined;
|
|
223
|
+
ignoreNonRelevantFilesToResume?: boolean | undefined;
|
|
224
|
+
linkDirs?: string[] | undefined;
|
|
225
|
+
linkType?: LinkType | undefined;
|
|
226
|
+
flatLinking?: boolean | undefined;
|
|
227
|
+
maxDataDepth?: number | undefined;
|
|
228
|
+
linkCategory?: string | undefined;
|
|
229
|
+
torrentDir?: string | undefined;
|
|
230
|
+
outputDir?: string | undefined;
|
|
231
|
+
injectDir?: string | undefined;
|
|
232
|
+
ignoreTitles?: boolean | undefined;
|
|
233
|
+
includeSingleEpisodes?: boolean | undefined;
|
|
234
|
+
verbose?: boolean | undefined;
|
|
235
|
+
includeNonVideos?: boolean | undefined;
|
|
236
|
+
seasonFromEpisodes?: number | undefined;
|
|
237
|
+
fuzzySizeThreshold?: number | undefined;
|
|
238
|
+
excludeOlder?: number | undefined;
|
|
239
|
+
excludeRecentSearch?: number | undefined;
|
|
240
|
+
action?: Action | undefined;
|
|
241
|
+
torrentClients?: string[] | undefined;
|
|
242
|
+
duplicateCategories?: boolean | undefined;
|
|
243
|
+
notificationWebhookUrls?: string[] | undefined;
|
|
244
|
+
torrents?: string[] | undefined;
|
|
245
|
+
port?: number | undefined;
|
|
246
|
+
host?: string | undefined;
|
|
247
|
+
basePath?: string | undefined;
|
|
248
|
+
searchCadence?: number | undefined;
|
|
249
|
+
rssCadence?: number | undefined;
|
|
250
|
+
snatchTimeout?: number | undefined;
|
|
251
|
+
searchTimeout?: number | undefined;
|
|
252
|
+
searchLimit?: number | undefined;
|
|
253
|
+
blockList?: string[] | undefined;
|
|
254
|
+
apiKey?: string | undefined;
|
|
255
|
+
sonarr?: string[] | undefined;
|
|
256
|
+
radarr?: string[] | undefined;
|
|
257
|
+
}>;
|
|
258
|
+
export type RuntimeConfigOverrides = z.infer<typeof RUNTIME_CONFIG_OVERRIDES_SCHEMA>;
|
|
259
|
+
export declare function parseRuntimeConfig(config: unknown): RuntimeConfig;
|
|
260
|
+
export declare function parseRuntimeConfigOverrides(config: unknown): Partial<RuntimeConfig>;
|
|
261
|
+
//# sourceMappingURL=configSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.d.ts","sourceRoot":"","sources":["../configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0ChC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAElE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACZ,CAAC;AAEjC,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,+BAA+B,CACtC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,CAEjE;AAED,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,OAAO,GACb,OAAO,CAAC,aAAa,CAAC,CAExB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Action, LinkType, MatchMode } from "./constants.js";
|
|
3
|
+
export const RUNTIME_CONFIG_SCHEMA = z.object({
|
|
4
|
+
delay: z.number().int().min(30).max(3600),
|
|
5
|
+
torznab: z.array(z.string()),
|
|
6
|
+
useClientTorrents: z.boolean(),
|
|
7
|
+
dataDirs: z.array(z.string()),
|
|
8
|
+
matchMode: z.nativeEnum(MatchMode),
|
|
9
|
+
skipRecheck: z.boolean(),
|
|
10
|
+
autoResumeMaxDownload: z.number().int().min(0).max(52_428_800),
|
|
11
|
+
ignoreNonRelevantFilesToResume: z.boolean(),
|
|
12
|
+
linkDirs: z.array(z.string()),
|
|
13
|
+
linkType: z.nativeEnum(LinkType),
|
|
14
|
+
flatLinking: z.boolean(),
|
|
15
|
+
maxDataDepth: z.number().int().min(1),
|
|
16
|
+
linkCategory: z.string().optional(),
|
|
17
|
+
torrentDir: z.string().optional(),
|
|
18
|
+
outputDir: z.string(),
|
|
19
|
+
injectDir: z.string().optional(),
|
|
20
|
+
ignoreTitles: z.boolean().optional(),
|
|
21
|
+
includeSingleEpisodes: z.boolean(),
|
|
22
|
+
verbose: z.boolean(),
|
|
23
|
+
includeNonVideos: z.boolean(),
|
|
24
|
+
seasonFromEpisodes: z.number().min(0).max(1).optional(),
|
|
25
|
+
fuzzySizeThreshold: z.number().gt(0).lte(1),
|
|
26
|
+
excludeOlder: z.number().optional(),
|
|
27
|
+
excludeRecentSearch: z.number().optional(),
|
|
28
|
+
action: z.nativeEnum(Action),
|
|
29
|
+
torrentClients: z.array(z.string()),
|
|
30
|
+
duplicateCategories: z.boolean(),
|
|
31
|
+
notificationWebhookUrls: z.array(z.string()),
|
|
32
|
+
torrents: z.array(z.string()),
|
|
33
|
+
port: z.number().int().min(1).max(65535).optional(),
|
|
34
|
+
host: z.string().optional(),
|
|
35
|
+
basePath: z.string().optional(),
|
|
36
|
+
searchCadence: z.number().optional(),
|
|
37
|
+
rssCadence: z.number().optional(),
|
|
38
|
+
snatchTimeout: z.number().optional(),
|
|
39
|
+
searchTimeout: z.number().optional(),
|
|
40
|
+
searchLimit: z.number().int().min(0).optional(),
|
|
41
|
+
blockList: z.array(z.string()),
|
|
42
|
+
apiKey: z.string().min(24).optional(),
|
|
43
|
+
sonarr: z.array(z.string()),
|
|
44
|
+
radarr: z.array(z.string()),
|
|
45
|
+
});
|
|
46
|
+
export const RUNTIME_CONFIG_OVERRIDES_SCHEMA = RUNTIME_CONFIG_SCHEMA.partial();
|
|
47
|
+
export function parseRuntimeConfig(config) {
|
|
48
|
+
return RUNTIME_CONFIG_SCHEMA.parse(config);
|
|
49
|
+
}
|
|
50
|
+
export function parseRuntimeConfigOverrides(config) {
|
|
51
|
+
return RUNTIME_CONFIG_OVERRIDES_SCHEMA.parse(config);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC;IAClC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;IACxB,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;IAC9D,8BAA8B,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;IAChC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;IACxB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC7B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;IAC5B,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE;IAChC,uBAAuB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,+BAA+B,GAC3C,qBAAqB,CAAC,OAAO,EAAE,CAAC;AAMjC,MAAM,UAAU,kBAAkB,CAAC,MAAe;IACjD,OAAO,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,MAAe;IAEf,OAAO,+BAA+B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACtD,CAAC"}
|