@kubitnodes/stellaris 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -2
  3. package/dist/cli/index.js +167 -12
  4. package/dist/server/index.js +543 -32
  5. package/package.json +2 -1
  6. package/web/dist/assets/ChannelView-O1FQ_Cbf.js +1 -0
  7. package/web/dist/assets/CitizenView-D0rSRBnj.js +2 -0
  8. package/web/dist/assets/CitizensView-BPx5ChvL.js +1 -0
  9. package/web/dist/assets/KnowledgeView-Cjf5Axu5.js +1 -0
  10. package/web/dist/assets/Markdown-Dkiv3bKi.js +29 -0
  11. package/web/dist/assets/MessageItem-sep2BGUh.js +1 -0
  12. package/web/dist/assets/MetricsView-BIH8FLob.js +1 -0
  13. package/web/dist/assets/NeedsYouView-CuB7daZ0.js +1 -0
  14. package/web/dist/assets/Overview-C6Ae0n9b.js +1 -0
  15. package/web/dist/assets/Pane-BXpuXst6.js +1 -0
  16. package/web/dist/assets/ProjectView-CpTcrvFa.js +1 -0
  17. package/web/dist/assets/ProposalView-BXisoFis.js +1 -0
  18. package/web/dist/assets/ProposalsView-BjPeXIxG.js +1 -0
  19. package/web/dist/assets/RunnersView-0ou0ekMc.js +1 -0
  20. package/web/dist/assets/SocietyView-C8lU_XY4.js +1 -0
  21. package/web/dist/assets/SubjectThread-BWbOV_wk.js +1 -0
  22. package/web/dist/assets/TaskView-CDLRRfS6.js +1 -0
  23. package/web/dist/assets/TasksView-p6PdvdWY.js +1 -0
  24. package/web/dist/assets/ThreadCard-BisvLnYg.js +1 -0
  25. package/web/dist/assets/ThreadForms-DZ1yLsjU.js +1 -0
  26. package/web/dist/assets/ThreadView-CQUPQ5oR.js +1 -0
  27. package/web/dist/assets/{citizen-BXVebeiP.js → citizen-BwK8Ciw3.js} +1 -1
  28. package/web/dist/assets/format-DZLzLk7S.js +55 -0
  29. package/web/dist/assets/index-CbJnPhSw.js +21 -0
  30. package/web/dist/assets/index-DJ30ENcc.css +2 -0
  31. package/web/dist/assets/{tasks-rltmWd5a.js → tasks-DZgkXWwu.js} +1 -1
  32. package/web/dist/assets/{useStickyScroll-DDS3s21P.js → useStickyScroll-CVTdIoKj.js} +1 -1
  33. package/web/dist/index.html +4 -4
  34. package/web/dist/assets/ChannelView-B8BZLsf1.js +0 -1
  35. package/web/dist/assets/CitizenView-GomLDcrr.js +0 -2
  36. package/web/dist/assets/CitizensView-yNv8WtND.js +0 -1
  37. package/web/dist/assets/KnowledgeView--jxofSSN.js +0 -1
  38. package/web/dist/assets/Markdown-BpYzeV5r.js +0 -28
  39. package/web/dist/assets/MessageItem-BGPpqgpq.js +0 -1
  40. package/web/dist/assets/MetricsView-CcqLr6S1.js +0 -1
  41. package/web/dist/assets/NeedsYouView-r7gJGgVG.js +0 -1
  42. package/web/dist/assets/Overview-Cmz4_gfI.js +0 -1
  43. package/web/dist/assets/Pane-DRpHmeJ9.js +0 -1
  44. package/web/dist/assets/ProjectView-CuACZj4L.js +0 -1
  45. package/web/dist/assets/ProposalView-BiVcNEDL.js +0 -1
  46. package/web/dist/assets/ProposalsView-BIdkOfZO.js +0 -1
  47. package/web/dist/assets/SocietyView-Dya97szC.js +0 -1
  48. package/web/dist/assets/SubjectThread-2j_msY38.js +0 -1
  49. package/web/dist/assets/TaskView-CcJr7xnH.js +0 -1
  50. package/web/dist/assets/TasksView-BUvHntvK.js +0 -1
  51. package/web/dist/assets/ThreadCard-tzMGvn9j.js +0 -1
  52. package/web/dist/assets/ThreadForms-DE2yJEhz.js +0 -1
  53. package/web/dist/assets/ThreadView-FsNOTyVC.js +0 -1
  54. package/web/dist/assets/format-Ca2VAvEx.js +0 -77
  55. package/web/dist/assets/index-CtuchAFa.css +0 -2
  56. package/web/dist/assets/index-D4GJkeKU.js +0 -237
@@ -1,77 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o(((e,t)=>{(function(){function n(e,t){Object.defineProperty(a.prototype,e,{get:function(){console.warn(`%s(...) is deprecated in plain JavaScript React classes. %s`,t[0],t[1])}})}function r(e){return typeof e!=`object`||!e?null:(e=Ce&&e[Ce]||e[`@@iterator`],typeof e==`function`?e:null)}function i(e,t){e=(e=e.constructor)&&(e.displayName||e.name)||`ReactClass`;var n=e+`.`+t;we[n]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),we[n]=!0)}function a(e,t,n){this.props=e,this.context=t,this.refs=De,this.updater=n||Te}function o(){}function s(e,t,n){this.props=e,this.context=t,this.refs=De,this.updater=n||Te}function c(){}function l(e){return``+e}function u(e){try{l(e);var t=!1}catch{t=!0}if(t){t=console;var n=t.error,r=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return n.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,r),l(e)}}function d(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ke?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case fe:return`Fragment`;case pe:return`Profiler`;case D:return`StrictMode`;case _e:return`Suspense`;case ve:return`SuspenseList`;case xe:return`Activity`;case Se:return`ViewTransition`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case de:return`Portal`;case he:return e.displayName||`Context`;case me:return(e._context.displayName||`Context`)+`.Consumer`;case ge:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ye:return t=e.displayName||null,t===null?d(e.type)||`Memo`:t;case be:t=e._payload,e=e._init;try{return d(e(t))}catch{}}return null}function f(e){if(e===fe)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===be)return`<...>`;try{var t=d(e);return t?`<`+t+`>`:`<...>`}catch{return`<...>`}}function p(){var e=k.A;return e===null?null:e.getOwner()}function m(){return Error(`react-stack-top-frame`)}function h(e){if(Ae.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function ee(e,t){function n(){Me||(Me=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function g(){var e=d(this.type);return Pe[e]||(Pe[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function _(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:E,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,"ref",{enumerable:!1,value:null}):Object.defineProperty(e,"ref",{enumerable:!1,get:g}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function te(e,t){return t=_(e.type,t,e.props,e._owner,e._debugStack,e._debugTask),e._store&&(t._store.validated=e._store.validated),t}function v(e){ne(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===be&&(e._payload.status===`fulfilled`?ne(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===E}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}function y(e,t){return typeof e==`object`&&e&&e.key!=null?(u(e.key),re(``+e.key)):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(c,c):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,t,n,i,a){var o=typeof e;(o===`undefined`||o===`boolean`)&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case`bigint`:case`string`:case`number`:s=!0;break;case`object`:switch(e.$$typeof){case E:case de:s=!0;break;case be:return s=e._init,ae(s(e._payload),t,n,i,a)}}if(s){s=e,a=a(s);var c=i===``?`.`+y(s,0):i;return Oe(a)?(n=``,c!=null&&(n=c.replace(Re,`$&/`)+`/`),ae(a,t,n,``,function(e){return e})):a!=null&&(ne(a)&&(a.key!=null&&(s&&s.key===a.key||u(a.key)),n=te(a,n+(a.key==null||s&&s.key===a.key?``:(``+a.key).replace(Re,`$&/`)+`/`)+c),i!==``&&s!=null&&ne(s)&&s.key==null&&s._store&&!s._store.validated&&(n._store.validated=2),a=n),t.push(a)),1}if(s=0,c=i===``?`.`:i+`:`,Oe(e))for(var l=0;l<e.length;l++)i=e[l],o=c+y(i,l),s+=ae(i,t,n,o,a);else if(l=r(e),typeof l==`function`)for(l===e.entries&&(Le||console.warn(`Using Maps as children is not supported. Use an array of keyed ReactElements instead.`),Le=!0),e=l.call(e),l=0;!(i=e.next()).done;)i=i.value,o=c+y(i,l++),s+=ae(i,t,n,o,a);else if(o===`object`){if(typeof e.then==`function`)return ae(ie(e),t,n,i,a);throw t=String(e),Error(`Objects are not valid as a React child (found: `+(t===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:t)+`). If you meant to render a collection of children, use an array instead.`)}return s}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function b(e){if(e._status===-1){var t=null,n=null,r=e._ioInfo;r!=null&&(r.start=r.end=performance.now(),r.value=new Promise(function(e,r){t=e,n=r})),r=e._result;var i=r();if(i.then(function(n){if(e._status===0||e._status===-1){e._status=1,e._result=n;var r=e._ioInfo;if(r!=null){r.end=performance.now();var a=n?.default;t(a),r.value.status=`fulfilled`,r.value.value=a}i.status===void 0&&(i.status=`fulfilled`,i.value=n)}},function(t){if(e._status===0||e._status===-1){e._status=2,e._result=t;var r=e._ioInfo;r!=null&&(r.end=performance.now(),r.value.then(c,c),n(t),r.value.status=`rejected`,r.value.reason=t),i.status===void 0&&(i.status=`rejected`,i.reason=t)}}),r=e._ioInfo,r!=null){var a=i.displayName;typeof a==`string`&&(r.name=a)}e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return r=e._result,r===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
-
3
- Your code should look like:
4
- const MyComponent = lazy(() => import('./MyComponent'))
5
-
6
- Did you accidentally put curly braces around the import?`,r),`default`in r||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
-
8
- Your code should look like:
9
- const MyComponent = lazy(() => import('./MyComponent'))`,r),r.default;throw e._result}function x(){var e=k.H;return e===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
10
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
11
- 2. You might be breaking the Rules of Hooks
12
- 3. You might have more than one copy of React in the same app
13
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function S(){k.asyncTransitions--}function se(e){var t=k.T,n={};n.types=t===null?null:t.types,n._updatedFibers=new Set,k.T=n;try{var r=e(),i=k.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&(k.asyncTransitions++,r.then(S,S),r.then(c,ze))}catch(e){ze(e)}finally{t===null&&n._updatedFibers&&(e=n._updatedFibers.size,n._updatedFibers.clear(),10<e&&console.warn(`Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.`)),t!==null&&n.types!==null&&(t.types!==null&&t.types!==n.types&&console.error(`We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React.`),t.types=n.types),k.T=t}}function ce(e){var t=k.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else k.asyncTransitions===0&&console.error("addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."),se(ce.bind(null,e))}function C(e){if(Ve===null)try{var n=(`require`+Math.random()).slice(0,7);Ve=(t&&t[n]).call(t,`timers`).setImmediate}catch{Ve=function(e){!1===Be&&(Be=!0,typeof MessageChannel>`u`&&console.error(`This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.`));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}return Ve(e)}function le(e){return 1<e.length&&typeof AggregateError==`function`?AggregateError(e):e[0]}function w(e,t){t!==He-1&&console.error(`You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. `),He=t}function T(e,t,n){var r=k.actQueue;if(r!==null){if(r.length!==0)try{ue(r),C(function(){return T(e,t,n)});return}catch(e){k.thrownErrors.push(e)}else k.actQueue=null}0<k.thrownErrors.length?(r=le(k.thrownErrors),k.thrownErrors.length=0,n(r)):t(e)}function ue(e){if(!We){We=!0;var t=0;try{for(;t<e.length;t++){var n=e[t];do{k.didUsePromise=!1;var r=n(!1);if(r!==null){if(k.didUsePromise){e[t]=n,e.splice(0,t);return}n=r}else break}while(1)}e.length=0}catch(n){e.splice(0,t+1),k.thrownErrors.push(n)}finally{We=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var E=Symbol.for(`react.transitional.element`),de=Symbol.for(`react.portal`),fe=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),pe=Symbol.for(`react.profiler`),me=Symbol.for(`react.consumer`),he=Symbol.for(`react.context`),ge=Symbol.for(`react.forward_ref`),_e=Symbol.for(`react.suspense`),ve=Symbol.for(`react.suspense_list`),ye=Symbol.for(`react.memo`),be=Symbol.for(`react.lazy`),xe=Symbol.for(`react.activity`),Se=Symbol.for(`react.view_transition`),Ce=Symbol.iterator,we={},Te={isMounted:function(){return!1},enqueueForceUpdate:function(e){i(e,`forceUpdate`)},enqueueReplaceState:function(e){i(e,`replaceState`)},enqueueSetState:function(e){i(e,`setState`)}},Ee=Object.assign,De={};Object.freeze(De),a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};var O={isMounted:[`isMounted`,`Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.`],replaceState:[`replaceState`,`Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236).`]};for(Ke in O)O.hasOwnProperty(Ke)&&n(Ke,O[Ke]);o.prototype=a.prototype,O=s.prototype=new o,O.constructor=s,Ee(O,a.prototype),O.isPureReactComponent=!0;var Oe=Array.isArray,ke=Symbol.for(`react.client.reference`),k={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Ae=Object.prototype.hasOwnProperty,je=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(e){return e()}};var Me,Ne,Pe={},Fe=O.react_stack_bottom_frame.bind(O,m)(),Ie=je(f(m)),Le=!1,Re=/\/+/g,ze=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Be=!1,Ve=null,He=0,Ue=!1,We=!1,Ge=typeof queueMicrotask==`function`?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:C;O=Object.freeze({__proto__:null,c:function(e){return x().useMemoCache(e)}});var Ke={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=xe,e.Children=Ke,e.Component=a,e.Fragment=fe,e.Profiler=pe,e.PureComponent=s,e.StrictMode=D,e.Suspense=_e,e.ViewTransition=Se,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,e.__COMPILER_RUNTIME=O,e.act=function(e){var t=k.actQueue,n=He;He++;var r=k.actQueue=t===null?[]:t,i=!1;try{var a=e()}catch(e){k.thrownErrors.push(e)}if(0<k.thrownErrors.length)throw w(t,n),e=le(k.thrownErrors),k.thrownErrors.length=0,e;if(typeof a==`object`&&a&&typeof a.then==`function`){var o=a;return Ge(function(){i||Ue||(Ue=!0,console.error(`You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);`))}),{then:function(e,a){i=!0,o.then(function(i){if(w(t,n),n===0){try{ue(r),C(function(){return T(i,e,a)})}catch(e){k.thrownErrors.push(e)}if(0<k.thrownErrors.length){var o=le(k.thrownErrors);k.thrownErrors.length=0,a(o)}}else e(i)},function(e){w(t,n),0<k.thrownErrors.length?(e=le(k.thrownErrors),k.thrownErrors.length=0,a(e)):a(e)})}}}var s=a;if(w(t,n),n===0&&(ue(r),r.length!==0&&Ge(function(){i||Ue||(Ue=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),k.actQueue=null),0<k.thrownErrors.length)throw e=le(k.thrownErrors),k.thrownErrors.length=0,e;return{then:function(e,t){i=!0,n===0?(k.actQueue=r,C(function(){return T(s,e,t)})):e(s)}}},e.addTransitionType=ce,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.captureOwnerStack=function(){var e=k.getCurrentStack;return e===null?null:e()},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=Ee({},e.props),i=e.key,a=e._owner;if(t!=null){var o;a:{if(Ae.call(t,`ref`)&&(o=Object.getOwnPropertyDescriptor(t,`ref`).get)&&o.isReactWarning){o=!1;break a}o=t.ref!==void 0}for(s in o&&(a=p()),h(t)&&(u(t.key),i=``+t.key),t)!Ae.call(t,s)||s===`key`||s===`__self`||s===`__source`||s===`ref`&&t.ref===void 0||(r[s]=t[s])}var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){o=Array(s);for(var c=0;c<s;c++)o[c]=arguments[c+2];r.children=o}for(r=_(e.type,i,r,a,e._debugStack,e._debugTask),i=2;i<arguments.length;i++)v(arguments[i]);return r},e.createContext=function(e){return e={$$typeof:he,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:me,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},e.createElement=function(e,t,n){for(var r=2;r<arguments.length;r++)v(arguments[r]);var i;r={};var a=null;if(t!=null)for(i in Ne||!(`__self`in t)||`key`in t||(Ne=!0,console.warn(`Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform`)),h(t)&&(u(t.key),a=``+t.key),t)Ae.call(t,i)&&i!==`key`&&i!==`__self`&&i!==`__source`&&(r[i]=t[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];Object.freeze&&Object.freeze(s),r.children=s}if(e&&e.defaultProps)for(i in o=e.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return a&&ee(r,typeof e==`function`?e.displayName||e.name||`Unknown`:e),(i=1e4>k.recentlyCreatedOwnerStacks++)?(s=Error.stackTraceLimit,Error.stackTraceLimit=10,o=Error(`react-stack-top-frame`),Error.stackTraceLimit=s):o=Fe,_(e,a,r,p(),o,i?je(f(e)):Ie)},e.createRef=function(){var e={current:null};return Object.seal(e),e},e.forwardRef=function(e){e!=null&&e.$$typeof===ye?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e==`function`?e.length!==0&&e.length!==2&&console.error(`forwardRef render functions accept exactly two parameters: props and ref. %s`,e.length===1?`Did you forget to use the ref parameter?`:`Any additional parameter will be undefined.`):console.error(`forwardRef requires a render function but was given %s.`,e===null?`null`:typeof e),e!=null&&e.defaultProps!=null&&console.error(`forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?`);var t={$$typeof:ge,render:e},n;return Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(Object.defineProperty(e,"name",{value:t}),e.displayName=t)}}),t},e.isValidElement=ne,e.lazy=function(e){e={_status:-1,_result:e};var t={$$typeof:be,_payload:e,_init:b},n={name:`lazy`,start:-1,end:-1,value:null,owner:null,debugStack:Error(`react-stack-top-frame`),debugTask:console.createTask?console.createTask(`lazy()`):null};return e._ioInfo=n,t._debugInfo=[{awaited:n}],t},e.memo=function(e,t){e??console.error(`memo: The first argument must be a component. Instead received: %s`,e===null?`null`:typeof e),t={$$typeof:ye,type:e,compare:t===void 0?null:t};var n;return Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(Object.defineProperty(e,"name",{value:t}),e.displayName=t)}}),t},e.startTransition=se,e.unstable_useCacheRefresh=function(){return x().useCacheRefresh()},e.use=function(e){return x().use(e)},e.useActionState=function(e,t,n){return x().useActionState(e,t,n)},e.useCallback=function(e,t){return x().useCallback(e,t)},e.useContext=function(e){var t=x();return e.$$typeof===me&&console.error(`Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?`),t.useContext(e)},e.useDebugValue=function(e,t){return x().useDebugValue(e,t)},e.useDeferredValue=function(e,t){return x().useDeferredValue(e,t)},e.useEffect=function(e,t){return e??console.warn(`React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?`),x().useEffect(e,t)},e.useEffectEvent=function(e){return x().useEffectEvent(e)},e.useId=function(){return x().useId()},e.useImperativeHandle=function(e,t,n){return x().useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return e??console.warn(`React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?`),x().useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return e??console.warn(`React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?`),x().useLayoutEffect(e,t)},e.useMemo=function(e,t){return x().useMemo(e,t)},e.useOptimistic=function(e,t){return x().useOptimistic(e,t)},e.useReducer=function(e,t,n){return x().useReducer(e,t,n)},e.useRef=function(e){return x().useRef(e)},e.useState=function(e){return x().useState(e)},e.useSyncExternalStore=function(e,t,n){return x().useSyncExternalStore(e,t,n)},e.useTransition=function(){return x().useTransition()},e.version=`19.3.0`,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case v:return`Profiler`;case te:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`;case x:return`Activity`;case S:return`ViewTransition`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case re:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case y:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case b:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===b)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=ce.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(C.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){T||(T=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function l(){var e=t(this.type);return ue[e]||(ue[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:ee,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,"ref",{enumerable:!1,value:null}):Object.defineProperty(e,"ref",{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function f(e,n,i,o,l,d){var f=n.children;if(f!==void 0){if(o){if(le(f)){for(o=0;o<f.length;o++)p(f[o]);Object.freeze&&Object.freeze(f)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`)}else p(f)}if(C.call(n,`key`)){f=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,fe[f+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
14
- let props = %s;
15
- <%s {...props} />
16
- React keys must be passed directly to JSX without using spread:
17
- let props = %s;
18
- <%s key={someKey} {...props} />`,o,f,m,f),fe[f+o]=!0)}if(f=null,i!==void 0&&(r(i),f=``+i),s(n)&&(r(n.key),f=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return f&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,f,i,a(),l,d)}function p(e){m(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===b&&(e._payload.status===`fulfilled`?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e==`object`&&!!e&&e.$$typeof===ee}var h=d(),ee=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),y=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),b=Symbol.for(`react.lazy`),x=Symbol.for(`react.activity`),S=Symbol.for(`react.view_transition`),se=Symbol.for(`react.client.reference`),ce=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Object.prototype.hasOwnProperty,le=Array.isArray,w=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var T,ue={},E=h.react_stack_bottom_frame.bind(h,o)(),de=w(i(o)),fe={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>ce.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=E;return f(e,t,n,!1,o,r?w(i(e)):de)},e.jsxs=function(e,t,n){var r=1e4>ce.recentlyCreatedOwnerStacks++;if(r){var a=Error.stackTraceLimit;Error.stackTraceLimit=10;var o=Error(`react-stack-top-frame`);Error.stackTraceLimit=a}else o=E;return f(e,t,n,!0,o,r?w(i(e)):de)}})()})),p=o(((e,t)=>{t.exports=f()})),m=l(d(),1),h=p(),ee=m.createContext(void 0),g=e=>{let t=m.useContext(ee);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},_=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,h.jsx)(ee.Provider,{value:e,children:t})),te={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},v=new class{#e=te;#t=!1;setTimeoutProvider(e){this.#t&&e!==this.#e&&console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,{previous:this.#e,provider:e}),this.#e=e,this.#t=!1}setTimeout(e,t){return this.#t=!0,this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#t=!0,this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ne(e){setTimeout(e,0)}var re=typeof window>`u`||`Deno`in globalThis;function y(){}function ie(e,t){return typeof e==`function`?e(t):e}function ae(e){return typeof e==`number`&&e>=0&&e!==1/0}function oe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==se(o,t.options))return!1}else if(!C(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ce(t.options.mutationKey)!==ce(a))return!1}else if(!C(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function se(e,t){return(t?.queryKeyHashFn||ce)(e)}function ce(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function C(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!C(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!C(e[r],t[r]))return!1;return!0}return!1}var le=Object.prototype.hasOwnProperty;function w(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ue(e)&&ue(t);if(!r&&!(E(e)&&E(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:le.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=w(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function T(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ue(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!de(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!de(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function de(e){return Object.prototype.toString.call(e)===`[object Object]`}function fe(e){return new Promise(t=>{v.setTimeout(t,e)})}function D(e,t,n){if(typeof n.structuralSharing==`function`)return n.structuralSharing(e,t);if(n.structuralSharing!==!1)try{return w(e,t)}catch(e){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`),e}return t}function pe(e){return e}function me(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function he(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ge=Symbol();function _e(e,t){return e.queryFn===ge&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ge?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ve(e,t){return typeof e==`function`?e(...t):!!e}function ye(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var be=()=>re,xe=()=>be(),Se=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ce=new class extends Se{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},we=ne;function Te(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=we,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ee=Te(),De=new class extends Se{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function O(e){return Math.min(1e3*2**e,3e4)}function Oe(e){return(e??`online`)!==`online`||De.isOnline()}var ke=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function k(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(y);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new ke(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ce.isFocused()&&(e.networkMode===`always`||De.isOnline())&&e.canRun(),p=()=>Oe(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},ee=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),g=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(xe()?0:3),a=e.retryDelay??O,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),fe(o).then(()=>f()?void 0:ee()).then(()=>{t?h(r):g()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?g():ee().then(g),s)}}var Ae=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ae(this.gcTime)&&(this.#e=v.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xe()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(v.clearTimeout(this.#e),this.#e=void 0)}};function je(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ye(e,()=>t.signal,()=>n=!0)},u=_e(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?he:me;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ne:Me,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Me(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Me(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ne(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Pe=class extends Ae{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Le(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Le(this.options);e.data!==void 0&&(this.setState(Ie(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=D(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(y).catch(y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ge||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>b(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!oe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}Array.isArray(this.options.queryKey)||console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=_e(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?je(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=k({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ke&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ke){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Fe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ie(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ee.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Fe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ie(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Le(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Re=class extends Se{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Be(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ve(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ve(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!T(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&He(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||b(this.options.staleTime,this.#t)!==b(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(y)),t}#h(e){return!xe()&&b(this.options.enabled,this.#t)!==!1&&ae(e)}#g(){this.#b();let e=b(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=oe(this.#r.dataUpdatedAt,e)+1;this.#u=v.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return b(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=v.setInterval(()=>{(this.options.refetchIntervalInBackground||Ce.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(v.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(v.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Be(e,t),o=i&&He(e,n,t,r);(a||o)&&(l={...l,...Fe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=D(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=D(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let ee=l.fetchStatus===`fetching`,g=m===`pending`,_=m===`error`,te=g&&ee,v=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:g,isSuccess:m===`success`,isError:_,isInitialLoading:te,isLoading:te,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:ee,isRefetching:ee&&!g,isLoadingError:_&&!v,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:_&&v,isStale:Ue(e,t),refetch:this.refetch,isEnabled:b(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),T(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Ee.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function ze(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||b(t.retryOnMount,e)!==!1)}function Be(e,t){return ze(e,t)||e.state.data!==void 0&&Ve(e,t,t.refetchOnMount)}function Ve(e,t,n){if(b(t.enabled,e)!==!1&&b(t.staleTime,e)!==`static`){let r=b(n,e);return r===`always`||r!==!1&&Ue(e,t)}return!1}function He(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ue(e,n)}function Ue(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(b(t.staleTime,e))}function We(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Ge=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t;{let t=e.map(e=>this.#e.defaultQueryOptions(e).queryHash);new Set(t).size!==t.length&&console.warn(`[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.`)}Ee.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!T(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(We(e,n).forEach(e=>{e.destroy()}),We(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=w(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Re(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Ee.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Ke=m.createContext(!1),qe=()=>m.useContext(Ke);Ke.Provider;function Je(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ye=m.createContext(Je()),Xe=()=>m.useContext(Ye),Ze=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ve(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Qe=e=>{m.useEffect(()=>{e.clearReset()},[e])},$e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ve(n,[e.error,r])),et=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},tt=(e,t)=>e?.suspense&&t.isPending,nt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rt({queries:e,...t},n){let r=g(n),i=qe(),a=Xe(),o=t.subscribed!==!1,s=m.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{et(e);let t=r.getQueryCache().get(e.queryHash);Ze(e,a,t)}),Qe(a);let[c]=m.useState(()=>new Ge(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;m.useSyncExternalStore(m.useCallback(e=>f?c.subscribe(Ee.batchCalls(e)):y,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>tt(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&tt(n,e)?nt(n,new Re(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let h=l.find((e,t)=>{let n=s[t];return n&&$e({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.error;return u(d())}function it(e,t,n){if(typeof e!=`object`||Array.isArray(e))throw Error(`Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object`);let r=qe(),i=Xe(),a=g(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash);o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);let c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,et(o),Ze(o,i,s),Qe(i);let[l]=m.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(m.useSyncExternalStore(m.useCallback(e=>{let t=d?l.subscribe(Ee.batchCalls(e)):y;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o)},[o,l]),tt(o,u))throw nt(o,l,i);if($e({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function A(e,t){return it(e,Re,t)}function at(e){return e[e.length-1]}function ot(e,t){return typeof e==`function`?e(t):e}var st=Object.prototype.hasOwnProperty;function ct(e){for(let t in e)if(st.call(e,t))return!0;return!1}var lt=()=>Object.create(null),ut=(e,t)=>dt(e,t,!0);function dt(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(ft(e)&&ft(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&at(a)!==`${o-1}`||c&&at(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?dt(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?dt(d,o,n,r):o,i&&=u===d&&(a[l]===f||st.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?lt():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?dt(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function ft(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function pt(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!pt(a,o,n,r))return!1}return!0}if(ft(e)&&ft(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!pt(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!pt(e[a],t[a],n,r)))return!1;return i===0}return!1}function mt(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function ht(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r))return r}}var gt=/[\x00-\x1f\x7f"<>`{}]/g;function _t(e){return e.replace(gt,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function vt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return _t(t)}var yt=[`http:`,`https:`,`mailto:`,`tel:`];function bt(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var xt=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function St(e,t){if(!e)return!1;if(xt.test(e))return!0;let n=bt(e);return n?!t.has(n):!1}function Ct(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=vt(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=vt(r?e.slice(r):e)}return t}function wt(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Tt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Et(e){return e.replace(/\/{2,}/g,`/`)}function Dt(e){return e===`/`?e:e.replace(/^\/+/,``)}function Ot(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function kt(e){return Ot(Dt(e))}function At(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function jt(e,t,n=`never`,r){if(t.includes(`//`)&&(t=Et(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Et(e)),o=e.split(`/`);o.length>1&&at(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(at(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Et(s):s)||`/`;return a&&r&&r.set(a,c),c}function Mt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function Nt(e){return e==null||e===``}function Pt(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function Ft(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&Nt(f)){if(c===`/`&&!d)continue;f=``}o+=c+Pt(s,f,r)+(d||``)}}return o+a||`/`}var It=`Error preloading route! ☝️`,Lt=()=>!0,Rt=()=>!1;function zt({children:e,fallback:t=null}){return(0,h.jsx)(m.Fragment,{children:Bt()?e:t})}function Bt(e=!0){return m.useSyncExternalStore(Vt,Lt,e?Rt:Lt)}function Vt(){return()=>{}}var Ht=m.createContext(null);function Ut(e){let t=m.useContext(Ht);return t||Wt(e),t}function Wt(e){(e?.warn??!0)&&console.warn(`Warning: useRouter must be used inside a <RouterProvider> component!`)}var Gt=o((e=>{(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){f||a.startTransition===void 0||(f=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!p){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),p=!0)}i=s({inst:{value:n,getSnapshot:t}});var d=i[0].inst,m=i[1];return l(function(){d.value=n,d.getSnapshot=t,r(d)&&m({inst:d})},[e,n,t]),c(function(){return r(d)&&m({inst:d}),e(function(){r(d)&&m({inst:d})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=d(),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,f=!1,p=!1,m=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?m:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Kt=o(((e,t)=>{t.exports=Gt()})),qt=o((e=>{(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=d(),r=Kt(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Jt=o(((e,t)=>{t.exports=qt()}))();function Yt(e,t){return e===t}function Xt(e,t=e=>e,n){let r=n?.compare??Yt,i=(0,m.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,m.useCallback)(()=>e.get(),[e]);return(0,Jt.useSyncExternalStoreWithSelector)(i,a,a,t,r)}function Zt(...e){let t=m.useRef(e),n=t.current;return e.forEach((e,t)=>{pt(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Qt(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(It)})}var $t={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function en(e,t){let n=typeof e==`string`&&bt(e);if(n)return t.has(n)?e:(console.warn(`Blocked Link with dangerous protocol: ${e}`),null)}function tn(e,t,n,r,i){let a=At(e.pathname,r),o=At(t.pathname,r);return(n?.exact?a!==o:!a.startsWith(o)||a.length!==o.length&&a[o.length]!==`/`)||(n?.includeSearch??!0)&&!pt(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||i&&e.hash===t.hash}function nn(e,t,n){let r=Ut();if(r.isServer)return ln(r,e,t,n);let i=m.useRef(null),a=m.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:h,ignoreBlocker:ee,disabled:g,target:_,onClick:te,onBlur:v,onFocus:ne,onMouseEnter:re,onMouseLeave:y,onTouchStart:ie}=e,ae=Bt(!!o?.includeHash),[oe,b,x]=Zt(e.search,e.params,o),[S,se]=m.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,oe,b,e.state,e.mask,e.unsafeRelative]),ce=m.useCallback(e=>{let t=en(s,r.protocolAllowlist);if(t!==void 0)return[t??void 0];S._fromLocation||(se._fromLocation=e);let n=r.buildLocation(se),i=pn(n,r,g);return[i,!g&&(!i||bt(i))?void 0:tn(e,n,x,r.basepath,ae)]},[x,g,ae,S,se,r,s]),[C,le]=Xt(r.stores.location,ce,$t),w=le===void 0?C:void 0,T=g||C===void 0,ue=m.useRef(!1),E=e.reloadDocument||w||T?!1:c??r.options.defaultPreload,de=l??r.options.defaultPreloadDelay??0,fe=m.useCallback(e=>{let t=e?.isIntersecting;if(!(t??E===`intent`)){t===!1&&dn(i);return}if(!de){Qt(r,S);return}un.has(i)||un.set(i,setTimeout(()=>{un.delete(i),Qt(r,S)},de))},[r,S,i,E,de]);m.useEffect(()=>{if(!E)return;E===`render`&&!ue.current&&(ue.current=!0,Qt(r,S));let e=!0,t;return E===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&fe(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),dn(i)}},[r,S,E,fe,i]);let D=sn(e,n);if(D.ref=t?a:i,w)return D.href=w,D;let pe=e=>{let t=_??e.currentTarget.getAttribute(`target`);!T&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!t||t===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...S,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:h,ignoreBlocker:ee}))},me=()=>{E===`intent`&&Qt(r,S)},he=()=>{E===`intent`&&dn(i)};return D.onClick=fn(te,pe),D.onBlur=fn(v,he),D.onFocus=fn(ne,fe),D.onMouseEnter=fn(re,fe),D.onMouseLeave=fn(y,he),D.onTouchStart=fn(ie,me),cn(D,e,le,C,T,n)}var rn={},an={className:`active`},on=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`_fromLocation`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function sn(e,t){let n={};for(let r in e)on.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function cn(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=ot(n?o:s,{})??(n?an:rn);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}function ln(e,t,n,r){let{to:i,disabled:a,activeOptions:o}=t,s=en(i,e.protocolAllowlist),c=s===void 0?e.buildLocation(t):void 0,l=c?pn(c,e,a):s??void 0,u=a||!l,d=s??(l&&bt(l)?l:void 0),f=sn(t,r);return f.ref=n,d?(f.href=d,f):cn(f,t,!!c&&!(!a&&!l)&&tn(e.stores.location.get(),c,o,e.basepath,!1),l,u,r)}var un=new WeakMap,dn=e=>{clearTimeout(un.get(e)),un.delete(e)},fn=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function pn(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if((r.external||i!==r.publicHref)&&St(i,t.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${i}`);return}return i}var mn=m.memo(m.forwardRef((e,t)=>{let n=e._asChild||`a`,r=nn(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return m.createElement(n,r,i)}),hn);function hn(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!on.has(r)||!pt(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}function gn(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function _n(e,t=`|`){return e.map(e=>Vn(e)).join(t)}function vn(e,t){return typeof t==`bigint`?t.toString():t}var yn=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function bn(e){return new yn(e)}function xn(e){return e==null}function Sn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Cn(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function wn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Tn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function En(e){return Tn(e._zod.def)??e._zod.def.shape}function Dn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return wn(this,t,e),e},enumerable:!0,configurable:!0})}function On(e,t,n){t in e?wn(e,t,n):e[t]=n}function kn(e,t,n,r){let i=En(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Dn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):On(e,a,r?r(n.value,a):n.value))}}function An(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Dn(e,n,()=>t[n]):On(e,n,r.value))}}function j(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function jn(e){return JSON.stringify(e)}function Mn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Nn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Pn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Fn=bn(()=>{if(kr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function In(e){if(Pn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Pn(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ln(e){return In(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Rn=new Set([`string`,`number`,`symbol`]);function zn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Bn(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function M(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Vn(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Hn(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Un={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Wn={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Gn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return kn(i,e,Kn(e,t)),Bn(e,j(n,{shape:i,checks:[]}))}function Kn(e,t){let n=En(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function qn(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Kn(e,t)),a={};return kn(a,e,Reflect.ownKeys(En(e)).filter(e=>!i.has(e))),Bn(e,j(n,{shape:a,checks:[]}))}function Jn(e,t){if(!In(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=En(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Bn(e,j(e._zod.def,{shape:Yn(e,t)}))}function Yn(e,t){let n={};return kn(n,e,Reflect.ownKeys(En(e))),An(n,t),n}function Xn(e,t){if(!In(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Bn(e,j(e._zod.def,{shape:Yn(e,t)}))}function Zn(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return kn(n,e,Reflect.ownKeys(En(e))),kn(n,t,Reflect.ownKeys(En(t))),Bn(e,j(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Qn(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Kn(t,n)):void 0,o={};return kn(o,t,Reflect.ownKeys(En(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Bn(t,j(t._zod.def,{shape:o,checks:[]}))}function $n(e,t,n){let r=n?new Set(Kn(t,n)):void 0,i={};return kn(i,t,Reflect.ownKeys(En(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Bn(t,j(t._zod.def,{shape:i}))}function er(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function nr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function rr(e){return typeof e==`string`?e:e?.message}function ir(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ar(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:rr(e.inst?._zod.def?.error?.(e))??rr(a?.(e))??rr(t?.error?.(e))??rr(n.customError?.(e))??rr(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var or=/[\uD800-\uDBFF]/;function sr(e){let t=e.length;if(!or.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function cr(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function lr(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function ur(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function dr(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):hr(e,n,r.value)}}function fr(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function pr(e,t,n){return fr(e,t,n,!1)}function mr(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return fr(this,n,r(this))},set(e){fr(this,n,e)}})}return t}function hr(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:fr(this,t,n.bind(this))},set(e){fr(this,t,e)}})}function gr(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var _r,vr=!1,yr={configurable:!0,get(){vr=!0}};function N(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&_r!==e._zod){_r=void 0;return}_r=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,yr);let e=vr;vr=!1;try{let r=n(this);return vr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),vr||=e,r}catch(n){throw delete this[t],vr||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function br(e,t,n,r){let i=gr(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var xr=`~constantCatch`;function Sr(e){let t=()=>e;return t[xr]=!0,t}var Cr,wr={value:void 0,enumerable:!1},Tr=`captureStackTrace`in Error?Error:null;function Er(e){let t=Tr;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Tr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function P(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){wr.value=new a(r);try{Object.defineProperty(n,"_zod",wr)}finally{wr.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),dr(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Er(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Dr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Or=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Cr=globalThis).__zod_globalConfig??(Cr.__zod_globalConfig={});var kr=globalThis.__zod_globalConfig;function Ar(e){return e&&Object.assign(kr,e),kr}function jr(){let e=this._zod;return e.message??=JSON.stringify(e.def,vn,2),e.message}function Mr(e){this._zod.message=e}var Nr={get:jr,set:Mr,enumerable:!0,configurable:!0},Pr={value:void 0,enumerable:!1},Fr=new WeakSet([Object.prototype,Error.prototype]),Ir=(e,t)=>{e.name=`$ZodError`,Pr.value=t,Object.defineProperty(e,"issues",Pr),Pr.value=void 0,Object.defineProperty(e,"message",Nr);let n=Object.getPrototypeOf(e);Fr.has(n)||(Fr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Lr=P(`$ZodError`,Ir);P(`$ZodError`,Ir,void 0,{Parent:Error});function Rr(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function zr(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Rr(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Br(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Vr(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Hr=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Dr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ar(e,o,Ar())));throw Nn(n,a?.callee??t),n}return s.value};return t},Ur=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ar(e,o,Ar())));throw Nn(n,a?.callee??t),n}return s.value};return t},Wr=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Dr;return a.issues.length?Gr(e,a.issues,i):{success:!0,data:a.value}};function Gr(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ar(e,n,Ar()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Kr=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Gr(e,a.issues,i):{success:!0,data:a.value}},qr=Symbol.for(`zod.compile.invalid`),Jr=Symbol.for(`zod.compile.fallback`),Yr=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==qr)return!0;if(r.definite===!0&&n===void 0)return!1}return Xr(e,t,n)});function Xr(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Jr]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Dr;return a.issues.length===0}var Zr=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Qr=e=>{let t=Hr(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Vr(n,a))};return n},$r=e=>{let t=Hr(e),n=(e,r,i,a)=>t(e,r,i,Vr(n,a));return n},ei=e=>{let t=Ur(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Vr(n,a))};return n},ti=e=>{let t=Ur(e),n=async(e,r,i,a)=>await t(e,r,i,Vr(n,a));return n},ni=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wr(e)(t,n,i)},ri=e=>(t,n,r)=>Wr(e)(t,n,r),ii=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Kr(e)(t,n,i)},ai=e=>async(t,n,r)=>Kr(e)(t,n,r),oi=/^[cC][0-9a-z]{6,}$/,si=/^[0-9a-z]+$/,ci=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,li=/^[0-9a-vA-V]{20}$/,ui=/^[A-Za-z0-9]{27}$/,di=/^[a-zA-Z0-9_-]{21}$/;function fi(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var pi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,mi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,hi=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gi=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_i=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function vi(){return new RegExp(_i,`u`)}var yi=/^(?:(?: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])$/,bi=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,xi=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Si=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ci=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,wi=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ti=/^https?$/,Ei=/^\+[1-9]\d{6,14}$/,Di=`(?:(?:\\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])))`;function Oi(e){return RegExp(`^${e}$`)}var ki=Oi(Di);function Ai(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ji(e){return RegExp(`^${Ai(e)}$`)}function Mi(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ai({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ai({precision:e.precision})}`:n;return RegExp(`^${Di}T(?:${r})$`)}var Ni=/^[\s\S]{0,}$/,Pi=/^-?\d+$/,Fi=/^-?\d+(?:\.\d+)?$/,Ii=/^(?:true|false)$/i,Li=/^[^A-Z]*$/,Ri=/^[^a-z]*$/,F=P(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),zi=e=>{let t=e.value;return!xn(t)&&t.length!==void 0},Bi={number:`number`,bigint:`bigint`,object:`date`},Vi=P(`$ZodCheckLessThan`,(e,t)=>{F.init(e,t);let n=Bi[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Bi[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hi=P(`$ZodCheckGreaterThan`,(e,t)=>{F.init(e,t);let n=Bi[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Bi[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ui=P(`$ZodCheckMultipleOf`,(e,t)=>{F.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Cn(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wi=P(`$ZodCheckNumberFormat`,(e,t)=>{F.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Un[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Gi=P(`$ZodCheckMaxLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=zi),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?sr(r):i)<=t.maximum)return;let a=cr(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ki=P(`$ZodCheckMinLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=zi),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?sr(r):i)>=t.minimum)return;let a=cr(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qi=P(`$ZodCheckLengthEquals`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=zi),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?sr(r):i;if(a===t.length)return;let o=cr(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ji=P(`$ZodCheckStringFormat`,(e,t)=>{var n,r;F.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Yi=P(`$ZodCheckRegex`,(e,t)=>{Ji.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xi=P(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Li,Ji.init(e,t)}),Zi=P(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ri,Ji.init(e,t)}),Qi=P(`$ZodCheckIncludes`,(e,t)=>{F.init(e,t);let n=zn(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),$i=P(`$ZodCheckStartsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`^${zn(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ea=P(`$ZodCheckEndsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`.*${zn(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ta=P(`$ZodCheckOverwrite`,(e,t)=>{F.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),na=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
19
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
20
- `)}\n};`)(...Object.values(this.closed))}},ra={major:4,minor:6,patch:5},I=P(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ra;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=er(t),a;for(let o of n){if(o._zod.def.when){if(tr(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Dr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(ir(t.issues,n,e),i||=er(t,n))});else{if(t.issues.length===n)continue;ir(t.issues,n,e),i||=er(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(er(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Dr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Dr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return pr(this,`~standard`,oa(this))},set"~standard"(e){fr(this,`~standard`,e)}}),ia=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ar(e,t,Ar()))}:{value:e.value};async function aa(e,t){let n={async:!0};return ia(await e._zod.run({value:t,issues:[]},n),n)}function oa(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ia(r,n)}catch{}return aa(e,t)},vendor:`zod`,version:1}}var sa=P(`$ZodString`,(e,t)=>{I.init(e,t),e._zod.pattern=t.pattern??Ni,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),L=P(`$ZodStringFormat`,(e,t)=>{Ji.init(e,t),sa.init(e,t)}),ca=P(`$ZodGUID`,(e,t)=>{t.pattern??=mi,L.init(e,t)}),la=P(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=hi(e)}else t.pattern??=hi();L.init(e,t)}),ua=P(`$ZodEmail`,(e,t)=>{t.pattern??=gi,L.init(e,t)});function da(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function fa(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?da(e)||2:pa(e,t)}function pa(e,t){if(!t.normalize&&t.protocol?.source===Ti.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var ma=/[\t\n\r]/g;function ha(e){return e.replace(ma,``)}function ga(e,t){return t.lastIndex=0,t.test(e.hostname)}function _a(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var va=P(`$ZodURL`,(e,t)=>{L.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=fa(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=ha(r);return}t.hostname&&!ga(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!_a(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:ha(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ya=P(`$ZodEmoji`,(e,t)=>{t.pattern??=vi(),L.init(e,t)}),ba=P(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?di:fi(t.length),L.init(e,t)}),xa=P(`$ZodCUID`,(e,t)=>{t.pattern??=oi,L.init(e,t)}),Sa=P(`$ZodCUID2`,(e,t)=>{t.pattern??=si,L.init(e,t)}),Ca=P(`$ZodULID`,(e,t)=>{t.pattern??=ci,L.init(e,t)}),wa=P(`$ZodXID`,(e,t)=>{t.pattern??=li,L.init(e,t)}),Ta=P(`$ZodKSUID`,(e,t)=>{t.pattern??=ui,L.init(e,t)}),Ea=P(`$ZodISODateTime`,(e,t)=>{t.pattern??=Mi(t),L.init(e,t)}),Da=P(`$ZodISODate`,(e,t)=>{t.pattern??=ki,L.init(e,t)}),Oa=P(`$ZodISOTime`,(e,t)=>{t.pattern??=ji(t),L.init(e,t)}),ka=P(`$ZodISODuration`,(e,t)=>{t.pattern??=pi,L.init(e,t)}),Aa=P(`$ZodIPv4`,(e,t)=>{t.pattern??=yi,L.init(e,t)}),ja=/^[0-9a-fA-F:.]+$/;function Ma(e){return ja.test(e)?da(`http://[${e}]`):!1}var Na=P(`$ZodIPv6`,(e,t)=>{t.pattern??=bi,L.init(e,t),e._zod.check=n=>{Ma(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Pa=P(`$ZodCIDRv4`,(e,t)=>{t.pattern??=xi,L.init(e,t)});function Fa(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ma(n)}var Ia=P(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Si,L.init(e,t),e._zod.check=n=>{Fa(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function La(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Ra=/^[0-9a-zA-Z+/]*={0,2}$/,za=P(`$ZodBase64`,(e,t)=>{t.pattern??=Ra,L.init(e,t),e._zod.check=n=>{La(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ba=/^[A-Za-z0-9_-]*$/;function Va(e){if(!Ba.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return La(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ha=P(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ba,L.init(e,t),e._zod.check=n=>{Va(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ua=P(`$ZodE164`,(e,t)=>{t.pattern??=Ei,L.init(e,t)});function Wa(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Ga=P(`$ZodJWT`,(e,t)=>{L.init(e,t),e._zod.check=n=>{Wa(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ka=P(`$ZodNumber`,(e,t)=>{I.init(e,t),e._zod.pattern=Fi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),qa=P(`$ZodNumberFormat`,(e,t)=>{Wi.init(e,t),Ka.init(e,t)}),Ja=P(`$ZodBoolean`,(e,t)=>{I.init(e,t),e._zod.pattern=Ii,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ya=P(`$ZodUnknown`,(e,t)=>{I.init(e,t),e._zod.parse=e=>e}),Xa=P(`$ZodNever`,(e,t)=>{I.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Za(e,t,n){e.issues.length&&t.issues.push(...nr(n,e.issues)),t.value[n]=e.value}var Qa=P(`$ZodArray`,(e,t)=>{I.init(e,t);let n=kr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Za(t,r,e)));else if(Za(c,r,e),s&&c.issues.length!==0&&er(c))break}return o.length?Promise.all(o).then(()=>r):r}});function $a(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...nr(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var eo=[];function to(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:eo,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Hn(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function no(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(er(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>$a(e,n,i,t,d,f))):$a(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var ro=P(`$ZodObject`,(e,t)=>{I.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=bn(()=>to(t));N(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||wn(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Pn,o=t.catchall,s,c=kr.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(er(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>$a(n,t,e,r,a,o))):$a(s,t,e,r,a,o)}return o?no(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),io=P(`$ZodObjectJIT`,(e,t)=>{ro.init(e,t);let n=e._zod.parse,r=bn(()=>to(t)),i=kr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new na([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
21
- let ${e}_ab = false;
22
- for (let i = 0; i < ${e}.issues.length; i++) {
23
- const iss = ${e}.issues[i];
24
- iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
25
- payload.issues.push(iss);
26
- if (iss.continue !== true) ${e}_ab = true;
27
- }
28
- if (${e}_ab && ctx && ctx.abortEarly) {
29
- payload.value = newResult;
30
- return payload;
31
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:jn(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
32
- const ${n}_present = ${i};
33
- if (!${n}.issues.length || ${n}_present) {
34
- if (${n}.issues.length) {${c(n,r)}
35
- }
36
-
37
- if (${e}) {
38
- newResult[${r}] = ${n}.value;
39
- }
40
- }
41
-
42
- `)}else f?(o.write(`
43
- if (${n}.issues.length) {${c(n,r)}
44
- }
45
- `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
46
- if (${n}.value !== undefined || ${i}) {
47
- newResult[${r}] = ${n}.value;
48
- }
49
- `)):o.write(`
50
- const ${n}_present = ${i};
51
- if (${n}.issues.length) {${c(n,r)}
52
- }
53
- if (!${n}_present && !${n}.issues.length) {
54
- payload.issues.push({
55
- code: "invalid_type",
56
- expected: "nonoptional",
57
- input: undefined,
58
- path: [${r}]
59
- });
60
- if (ctx && ctx.abortEarly) {
61
- payload.value = newResult;
62
- return payload;
63
- }
64
- }
65
-
66
- if (${n}_present) {
67
- newResult[${r}] = ${n}.value;
68
- }
69
-
70
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Pn,c=!kr.jitless,l=c&&Fn.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?no([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ao(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!er(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ar(e,r,Ar())))}),t)}var oo=P(`$ZodUnion`,(e,t)=>{I.init(e,t),N(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),N(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),N(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),N(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Sn(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ao(t,r,e,i)):ao(o,r,e,i)}});function so(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var co=P(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,oo.init(e,t);let n=e._zod.parse;N(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||wn(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Tn(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=bn(()=>so(t));e._zod.parse=(i,a)=>{let o=i.value;if(!Pn(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),lo=P(`$ZodIntersection`,(e,t)=>{I.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>fo(e,t,n)):fo(e,i,a)}});function uo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(In(e)&&In(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=uo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=uo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fo(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=uo(t.value,n.value);if(!c.valid){if(er(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var po=P(`$ZodRecord`,(e,t)=>{I.init(e,t);let n=kr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!In(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ar(e,i,Ar())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...nr(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...nr(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Fi.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>ar(e,i,Ar())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...nr(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...nr(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),mo=P(`$ZodEnum`,(e,t)=>{I.init(e,t);let n=gn(t.entries),r=new Set(n);e._zod.values=r,N(e,`pattern`,e=>{let t=gn(e.def.entries).filter(e=>Rn.has(typeof e));return RegExp(t.length?`^(${t.map(e=>zn(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ho=P(`$ZodLiteral`,(e,t)=>{I.init(e,t);let n=new Set(t.values);e._zod.values=n,N(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?zn(e):e?zn(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),go=P(`$ZodTransform`,(e,t)=>{I.init(e,t),e._zod.optin=`optional`,kr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Or(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Dr;return n.value=i,n}});function _o(e,t){return e.value=t.issues.length?void 0:t.value,e}var vo=P(`$ZodOptional`,(e,t)=>{I.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,N(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),N(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Sn(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>_o(e,t)):_o(e,r)}return t.innerType._zod.run(e,n)}}),yo=P(`$ZodExactOptional`,(e,t)=>{vo.init(e,t),N(e,`values`,e=>e.def.innerType._zod.values),N(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),bo=P(`$ZodNullable`,(e,t)=>{I.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin),N(e,`optout`,e=>e.def.innerType._zod.optout),N(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Sn(t.source)}|null)$`):void 0}),N(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),xo=P(`$ZodDefault`,(e,t)=>{I.init(e,t),e._zod.optin=`defaulted`,N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>So(e,t)):So(r,t)}});function So(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Co=P(`$ZodPrefault`,(e,t)=>{I.init(e,t),e._zod.optin=`defaulted`,N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),wo=P(`$ZodNonOptional`,(e,t)=>{I.init(e,t),N(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>To(t,e)):To(i,e)}});function To(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Eo(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ar(e,r,Ar()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Do=P(`$ZodCatch`,(e,t)=>{I.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),N(e,`optout`,e=>e.def.innerType._zod.optout),N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Eo(e,r,t,n)):Eo(e,r,t,n)}}),Oo=P(`$ZodPipe`,(e,t)=>{I.init(e,t),N(e,`values`,e=>e.def.in._zod.values),N(e,`optin`,e=>e.def.in._zod.optin),N(e,`optout`,e=>e.def.out._zod.optout),N(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ko(e,t.in,n)):ko(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ko(e,t.out,n)):ko(r,t.out,n)}});function ko(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ao=P(`$ZodPreprocess`,(e,t)=>{Oo.init(e,t)}),jo=P(`$ZodReadonly`,(e,t)=>{I.init(e,t),N(e,`propValues`,e=>e.def.innerType._zod.propValues),N(e,`values`,e=>e.def.innerType._zod.values),N(e,`optin`,e=>e.def.innerType?._zod?.optin),N(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Mo):Mo(r)}});function Mo(e){return e.memo||(e.value=Object.freeze(e.value)),e}var No=P(`$ZodCustom`,(e,t)=>{F.init(e,t),I.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Po(t,n,r,e));Po(i,n,r,e)}});function Po(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ur(e))}}var Fo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Io=`~memo`,Lo=[];function Ro(e){return typeof e==`object`&&!!e}function zo(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Bo=new WeakMap,Vo=0,Ho=1,Uo=2;function Wo(e,t,n){let r=Bo.get(e);if(r!==void 0)return r?Uo:Vo;if(t.has(e))return Uo;t.add(e);let i=Vo,a=e=>{if(i!==Uo&&e?._zod){let r=Wo(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Vo;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ho:o.value?._zod?Wo(o.value,t,n):Vo;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Tn(c);s(e?o(e,!0):Ho),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Wo(r,t,!1):Ho);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Go(e,i)}function Go(e,t){return t!==Ho&&Bo.set(e,t===Uo),t}function Ko(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var qo,Jo=[],Yo={alloc(e,t,n){let r=qo;if(!r)return n;qo=void 0;let i={value:n,issues:null};return r.set(t.value,i),Jo.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Zo(n,e.value))throw new Fo;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Wo(e,new Set,!1);if(i===Vo)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Uo||r?n=!0:r=!0}let l=s.value;if(!Ro(l))return t(s,c);let u=c[Io];u||(u={buckets:new WeakMap,backEdges:void 0},c[Io]=u);let d;i===c?d=a:(d=Ko(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...zo(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;qo=d;let p=Jo.length,m=t(s,c);qo=void 0;let h=Jo.length>p?Jo.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?zo(e.issues):Lo),e)):(h&&(h.issues=m.issues.length?zo(m.issues):Lo),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Xo(){return Yo}function Zo(e,t){let n=e[Io]?.backEdges;return n!==void 0&&Ro(t)&&n.has(t)}var Qo=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(lr(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Vn(e.values[0])}`:`Invalid option: expected one of ${_n(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${_n(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function $o(){return{localeError:Qo()}}var es,ts=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ns(){return new ts}(es=globalThis).__zod_globalRegistry??(es.__zod_globalRegistry=ns());var rs=globalThis.__zod_globalRegistry;function is(e){return e.checks&&=[...e.checks],e}function as(e,t){return new e(is({type:`string`,...M(t)}))}function os(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...M(t)})}function ss(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...M(t)})}function cs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...M(t)})}function ls(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...M(t)})}function us(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...M(t)})}function ds(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...M(t)})}function fs(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...M(t)})}function ps(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...M(t)})}function ms(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...M(t)})}function hs(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...M(t)})}function gs(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...M(t)})}function _s(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...M(t)})}function vs(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...M(t)})}function ys(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...M(t)})}function bs(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...M(t)})}function xs(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...M(t)})}function Ss(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...M(t)})}function Cs(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...M(t)})}function ws(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...M(t)})}function Ts(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...M(t)})}function Es(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...M(t)})}function Ds(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...M(t)})}function Os(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...M(t)})}function ks(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...M(t)})}function As(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...M(t)})}function js(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...M(t)})}function Ms(e,t){return new e(is({type:`number`,checks:[],...M(t)}))}function Ns(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...M(t)})}function Ps(e,t){return new e({type:`boolean`,...M(t)})}function Fs(e){return new e({type:`unknown`})}function Is(e,t){return new e({type:`never`,...M(t)})}function Ls(e,t){return new Vi({check:`less_than`,...M(t),value:e,inclusive:!1})}function Rs(e,t){return new Vi({check:`less_than`,...M(t),value:e,inclusive:!0})}function zs(e,t){return new Hi({check:`greater_than`,...M(t),value:e,inclusive:!1})}function Bs(e,t){return new Hi({check:`greater_than`,...M(t),value:e,inclusive:!0})}function Vs(e,t){return new Ui({check:`multiple_of`,...M(t),value:e})}function Hs(e,t){return new Gi({check:`max_length`,...M(t),maximum:e})}function Us(e,t){return new Ki({check:`min_length`,...M(t),minimum:e})}function Ws(e,t){return new qi({check:`length_equals`,...M(t),length:e})}function Gs(e,t){return new Yi({check:`string_format`,format:`regex`,...M(t),pattern:e})}function Ks(e){return new Xi({check:`string_format`,format:`lowercase`,...M(e)})}function qs(e){return new Zi({check:`string_format`,format:`uppercase`,...M(e)})}function Js(e,t){return new Qi({check:`string_format`,format:`includes`,...M(t),includes:e})}function Ys(e,t){return new $i({check:`string_format`,format:`starts_with`,...M(t),prefix:e})}function Xs(e,t){return new ea({check:`string_format`,format:`ends_with`,...M(t),suffix:e})}function Zs(e){return new ta({check:`overwrite`,tx:e})}function Qs(e){return Zs(t=>t.normalize(e))}function $s(){return Zs(e=>e.trim())}function ec(){return Zs(e=>e.toLowerCase())}function tc(){return Zs(e=>e.toUpperCase())}function nc(){return Zs(e=>Mn(e))}function rc(e,t,n){return new e({type:`array`,element:t,...M(n)})}function ic(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...M(n)})}function ac(e,t){let n=oc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ur(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ur(r))}},e(t.value,t)),t);return n}function oc(e,t){let n=new F({check:`custom`,...M(t)});return n._zod.check=e,n}function sc(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&wn(e,t,n[t]);return e}function cc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??rs,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function lc(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function R(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,R(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&sc(o.schema,c),t.io===`input`&&z(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function uc(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function dc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${uc(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+uc(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
71
-
72
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function fc(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;fc(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var pc=new Set([`type`,`properties`,`required`,`additionalProperties`]),mc=[`oneOf`,`anyOf`];function hc(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function gc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!pc.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??hc(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}wn(n,r,e.length===1?e[0]:gc(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=hc(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function _c(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of pc)if(t in e)return;let n=t.filter(e=>mc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=gc(t);else{let e=n[0],i=mc.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>gc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,sc(e,r))}function vc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):sc(i,s),sc(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())fc(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])_c(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}sc(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,wn(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:bc(t,`input`,e.processors),output:bc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function z(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return z(r.element,n);if(r.type===`set`)return z(r.valueType,n);if(r.type===`lazy`)return z(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return z(r.innerType,n);if(r.type===`intersection`)return z(r.left,n)||z(r.right,n);if(r.type===`record`||r.type===`map`)return z(r.keyType,n)||z(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:z(r.in,n)||z(r.out,n);if(r.type===`object`){for(let e in r.shape)if(z(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(z(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(z(e,n))return!0;return!!(r.rest&&z(r.rest,n))}return!1}var yc=(e,t={})=>n=>{let r=cc({...n,processors:t});return R(e,r),dc(r,e),vc(r,e)},bc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=cc({...i??{},target:a,io:t,processors:n});return R(e,o),dc(o,e),vc(o,e)},xc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Sc=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Cc=(e,t)=>{xc(e,`minimum`,t),Sc(e,`maximum`,t)},wc=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Tc=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Ec=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Dc=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Oc=(e,t)=>xc(e,`minimum`,t.minimum),kc=(e,t)=>Sc(e,`maximum`,t.maximum),Ac=e=>(t,n)=>{Dc(t,n.format);let[r,i]=e[n.format];xc(t,`minimum`,r),Sc(t,`maximum`,i)},jc={greater_than:(e,t)=>xc(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Sc(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>wc(e,t.value),number_format:Ac(Un),bigint_format:Ac(Wn),min_length:Oc,max_length:kc,length_equals:(e,t)=>Cc(e,t.length),min_size:Oc,max_size:kc,size_equals:(e,t)=>Cc(e,t.size),string_format:(e,t)=>{Dc(e,t.format),t.pattern&&Tc(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Ec(e,t.mime)};function Mc(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)jc[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&xc(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&xc(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Sc(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Sc(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&wc(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Ec(t,i.mime);for(let e of i.patterns??[])Tc(t,e);return t}var Nc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Pc=new Map([[Ra,Ci],[Ba,wi]]),Fc=e=>Pc.get(e)??e,Ic=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Mc(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Nc[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Fc);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Lc=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Mc(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):lc(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Rc=(e,t,n,r)=>{n.type=`boolean`},zc=(e,t,n,r)=>{n.not={}},Bc=(e,t,n,r)=>{let i=e._zod.def,a=gn(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Vc=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(lc(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(lc(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Hc=(e,t,n,r)=>{lc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Uc=(e,t,n,r)=>{lc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Wc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Mc(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=R(a.element,t,{...r,path:[...r.path,`items`]})};function Gc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Gc(t.out):t.type===`catch`?Gc(t.innerType):e._zod.optin}var Kc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&lc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)wn(i.properties,e,R(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Gc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=R(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},qc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>R(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Jc=(e,t,n,r)=>{let i=e._zod.def,a=R(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=R(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Yc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Yc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Yc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Fi:Pi).source),p):p}var Xc=new WeakMap;function Zc(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Xc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Yc(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Qc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Mc(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=R(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)wn(i.patternProperties,Fc(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=R(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Xc.get(t);n||(n=[],Xc.set(t,n),t.deferred.push(()=>Zc(t))),n.push(e)}i.additionalProperties=R(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Gc(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},$c=(e,t,n,r)=>{let i=e._zod.def,a=R(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},el=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tl=Symbol();function nl(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(lc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),tl):JSON.parse(o)}var rl=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=nl(i.defaultValue,e,t,n,r);o!==tl&&(n.default=o)},il=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=nl(i.defaultValue,e,t,n,r);o!==tl&&(n._prefault=o)},al=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{lc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ol=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;R(o,t,r);let s=t.seen.get(e);s.ref=o},sl=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},cl=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ll=new WeakSet([Object.prototype,Error.prototype]);function ul(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var dl=P(`ZodError`,(e,t)=>{Lr.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ll.has(n)||(ll.add(n),ul(n,`format`,e=>t=>Br(e,t)),ul(n,`flatten`,e=>t=>zr(e,t)),ul(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,vn,2)}),ul(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),fl=Hr(dl),pl=Ur(dl),ml=Wr(dl),hl=Kr(dl),gl=Qr(dl),_l=$r(dl),vl=ei(dl),yl=ti(dl),bl=ni(dl),xl=ri(dl),Sl=ii(dl),Cl=ai(dl);function wl(){kr.localeError||Ar($o())}function Tl(){kr.memoizer||Ar({memoizer:Xo()})}var B=P(`ZodType`,(e,t)=>(wl(),I.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(j(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Bn(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(zu(e,t))},superRefine(e,t){return this.check(Bu(e,t))},overwrite(e){return this.check(Zs(e))},optional(){return bu(this)},exactOptional(){return Su(this)},nullable(){return wu(this)},nullish(){return bu(wu(this))},nonoptional(e){return Au(this,e)},array(){return G(this)},or(e){return cu([this,e])},and(e){return fu(this,e)},transform(e){return Pu(this,vu(e))},default(e){return Eu(this,e)},prefault(e){return Ou(this,e)},catch(e){return Mu(this,e)},pipe(e){return Pu(this,e)},readonly(){return Lu(this)},describe(e){let t=this.clone();return rs.add(t,{description:e}),t},meta(...e){if(e.length===0)return rs.get(this);let t=this.clone();return rs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return pr(this,`~standard`,{...oa(this),jsonSchema:{input:bc(this,`input`),output:bc(this,`output`)}})},set"~standard"(e){fr(this,`~standard`,e)},parse:function e(t,n){return fl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await pl(this,t,n,{callee:e})},safeParse(e,t){return ml(this,e,t)},async safeParseAsync(e,t){return hl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){fr(this,`spa`,e)},validate(e,t){return Yr(this,e,t)},validateAsync(e,t){return Zr(this,e,t)},encode:function e(t,n){return gl(this,t,n,{callee:e})},decode:function e(t,n){return _l(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await vl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await yl(this,t,n,{callee:e})},safeEncode(e,t){return bl(this,e,t)},safeDecode(e,t){return xl(this,e,t)},async safeEncodeAsync(e,t){return Sl(this,e,t)},async safeDecodeAsync(e,t){return Cl(this,e,t)},toJSONSchema(e){return yc(this,{})(e)},get description(){return rs.get(this)?.description},get _def(){return this._zod.def}}),El=P(`_ZodString`,(e,t)=>{sa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ic(e,t,n,r)},mr({format:e=>Mc(e).format??null,minLength:e=>Mc(e).minimum??null,maxLength:e=>Mc(e).maximum??null},{regex(...e){return this.check(Gs(...e))},includes(...e){return this.check(Js(...e))},startsWith(...e){return this.check(Ys(...e))},endsWith(...e){return this.check(Xs(...e))},min(...e){return this.check(Us(...e))},max(...e){return this.check(Hs(...e))},length(...e){return this.check(Ws(...e))},nonempty(...e){return this.check(Us(1,...e))},lowercase(e){return this.check(Ks(e))},uppercase(e){return this.check(qs(e))},trim(){return this.check($s())},normalize(...e){return this.check(Qs(...e))},toLowerCase(){return this.check(ec())},toUpperCase(){return this.check(tc())},slugify(){return this.check(nc())}})),Dl=P(`ZodString`,(e,t)=>{sa.init(e,t),El.init(e,t)},{email(e){return this.check(os(Ml,e))},url(e){return this.check(fs(Fl,e))},jwt(e){return this.check(Ds(Xl,e))},emoji(e){return this.check(ps(Il,e))},guid(e){return this.check(ss(Nl,e))},uuid(e){return this.check(cs(Pl,e))},uuidv4(e){return this.check(ls(Pl,e))},uuidv6(e){return this.check(us(Pl,e))},uuidv7(e){return this.check(ds(Pl,e))},nanoid(e){return this.check(ms(Ll,e))},cuid(e){return this.check(hs(Rl,e))},cuid2(e){return this.check(gs(zl,e))},ulid(e){return this.check(_s(Bl,e))},base64(e){return this.check(ws(ql,e))},base64url(e){return this.check(Ts(Jl,e))},xid(e){return this.check(vs(Vl,e))},ksuid(e){return this.check(ys(Hl,e))},ipv4(e){return this.check(bs(Ul,e))},ipv6(e){return this.check(xs(Wl,e))},cidrv4(e){return this.check(Ss(Gl,e))},cidrv6(e){return this.check(Cs(Kl,e))},e164(e){return this.check(Es(Yl,e))},datetime(e){return this.check(Os(Ol,e))},date(e){return this.check(ks(kl,e))},time(e){return this.check(As(Al,e))},duration(e){return this.check(js(jl,e))}});function V(e){return as(Dl,e)}var H=P(`ZodStringFormat`,(e,t)=>{L.init(e,t),El.init(e,t)}),Ol=P(`ZodISODateTime`,(e,t)=>{Ea.init(e,t),H.init(e,t)}),kl=P(`ZodISODate`,(e,t)=>{Da.init(e,t),H.init(e,t)}),Al=P(`ZodISOTime`,(e,t)=>{Oa.init(e,t),H.init(e,t)}),jl=P(`ZodISODuration`,(e,t)=>{ka.init(e,t),H.init(e,t)}),Ml=P(`ZodEmail`,(e,t)=>{ua.init(e,t),H.init(e,t)}),Nl=P(`ZodGUID`,(e,t)=>{ca.init(e,t),H.init(e,t)}),Pl=P(`ZodUUID`,(e,t)=>{la.init(e,t),H.init(e,t)}),Fl=P(`ZodURL`,(e,t)=>{va.init(e,t),H.init(e,t)}),Il=P(`ZodEmoji`,(e,t)=>{ya.init(e,t),H.init(e,t)}),Ll=P(`ZodNanoID`,(e,t)=>{ba.init(e,t),H.init(e,t)}),Rl=P(`ZodCUID`,(e,t)=>{xa.init(e,t),H.init(e,t)}),zl=P(`ZodCUID2`,(e,t)=>{Sa.init(e,t),H.init(e,t)}),Bl=P(`ZodULID`,(e,t)=>{Ca.init(e,t),H.init(e,t)}),Vl=P(`ZodXID`,(e,t)=>{wa.init(e,t),H.init(e,t)}),Hl=P(`ZodKSUID`,(e,t)=>{Ta.init(e,t),H.init(e,t)}),Ul=P(`ZodIPv4`,(e,t)=>{Aa.init(e,t),H.init(e,t)}),Wl=P(`ZodIPv6`,(e,t)=>{Na.init(e,t),H.init(e,t)}),Gl=P(`ZodCIDRv4`,(e,t)=>{Pa.init(e,t),H.init(e,t)}),Kl=P(`ZodCIDRv6`,(e,t)=>{Ia.init(e,t),H.init(e,t)}),ql=P(`ZodBase64`,(e,t)=>{za.init(e,t),H.init(e,t)}),Jl=P(`ZodBase64URL`,(e,t)=>{Ha.init(e,t),H.init(e,t)}),Yl=P(`ZodE164`,(e,t)=>{Ua.init(e,t),H.init(e,t)}),Xl=P(`ZodJWT`,(e,t)=>{Ga.init(e,t),H.init(e,t)}),Zl=P(`ZodNumber`,(e,t)=>{Ka.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),e.isFinite=!0},mr({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Mc(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Mc(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Mc(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Mc(e).format??null},{gt(e,t){return this.check(zs(e,t))},gte(e,t){return this.check(Bs(e,t))},min(e,t){return this.check(Bs(e,t))},lt(e,t){return this.check(Ls(e,t))},lte(e,t){return this.check(Rs(e,t))},max(e,t){return this.check(Rs(e,t))},int(e){return this.check($l(e))},safe(e){return this.check($l(e))},positive(e){return this.check(zs(0,e))},nonnegative(e){return this.check(Bs(0,e))},negative(e){return this.check(Ls(0,e))},nonpositive(e){return this.check(Rs(0,e))},multipleOf(e,t){return this.check(Vs(e,t))},step(e,t){return this.check(Vs(e,t))},finite(){return this}}));function U(e){return Ms(Zl,e)}var Ql=P(`ZodNumberFormat`,(e,t)=>{qa.init(e,t),Zl.init(e,t)});function $l(e){return Ns(Ql,e)}var eu=P(`ZodBoolean`,(e,t)=>{Ja.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r)});function W(e){return Ps(eu,e)}var tu=P(`ZodUnknown`,(e,t)=>{Ya.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nu(){return Fs(tu)}var ru=P(`ZodNever`,(e,t)=>{Xa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zc(e,t,n,r)});function iu(e){return Is(ru,e)}var au=P(`ZodArray`,(e,t)=>{Tl(),Qa.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Us(e,t))},nonempty(e){return this.check(Us(1,e))},max(e,t){return this.check(Hs(e,t))},length(e,t){return this.check(Ws(e,t))},unwrap(){return this.element}});function G(e,t){return rc(au,e,t)}var ou=P(`ZodObject`,(e,t)=>{Tl(),io.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kc(e,t,n,r),br(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(j(this._zod.def,{catchall:e}))},passthrough(){return this.clone(j(this._zod.def,{catchall:nu()}))},loose(){return this.clone(j(this._zod.def,{catchall:nu()}))},strict(){return this.clone(j(this._zod.def,{catchall:iu()}))},strip(){return this.clone(j(this._zod.def,{catchall:void 0}))},extend(e){return Jn(this,e)},safeExtend(e){return Xn(this,e)},merge(e){return Zn(this,e)},pick(e){return Gn(this,e)},omit(e){return qn(this,e)},partial(...e){return Qn(yu,this,e[0])},exactPartial(...e){return Qn(xu,this,e[0],`exactPartial`)},required(...e){return $n(ku,this,e[0])}});function K(e,t){return new ou({type:`object`,shape:e??{},...M(t)})}var su=P(`ZodUnion`,(e,t)=>{oo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),e.options=t.options});function cu(e,t){return new su({type:`union`,options:e,...M(t)})}var lu=P(`ZodDiscriminatedUnion`,(e,t)=>{su.init(e,t),co.init(e,t)});function uu(e,t,n){return new lu({type:`union`,options:t,discriminator:e,...M(n)})}var du=P(`ZodIntersection`,(e,t)=>{lo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jc(e,t,n,r)});function fu(e,t){return new du({type:`intersection`,left:e,right:t})}var pu=P(`ZodRecord`,(e,t)=>{Tl(),po.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function mu(e,t,n){return!t||!t._zod?new pu({type:`record`,keyType:V(),valueType:e,...M(t)}):new pu({type:`record`,keyType:e,valueType:t,...M(n)})}var hu=P(`ZodEnum`,(e,t)=>{mo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bc(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new hu({...t,checks:[],...M(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new hu({...t,checks:[],...M(r),entries:i})}});function q(e,t){return new hu({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...M(t)})}var gu=P(`ZodLiteral`,(e,t)=>{ho.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new gu({type:`literal`,values:Array.isArray(e)?e:[e],...M(t)})}var _u=P(`ZodTransform`,(e,t)=>{Tl(),go.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Or(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ur(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ur(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function vu(e){return new _u({type:`transform`,transform:e})}var yu=P(`ZodOptional`,(e,t)=>{vo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bu(e){return new yu({type:`optional`,innerType:e})}var xu=P(`ZodExactOptional`,(e,t)=>{yo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Su(e){return new xu({type:`optional`,innerType:e})}var Cu=P(`ZodNullable`,(e,t)=>{bo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wu(e){return new Cu({type:`nullable`,innerType:e})}var Tu=P(`ZodDefault`,(e,t)=>{xo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Eu(e,t){return new Tu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ln(t)}})}var Du=P(`ZodPrefault`,(e,t)=>{Co.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>il(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ou(e,t){return new Du({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ln(t)}})}var ku=P(`ZodNonOptional`,(e,t)=>{wo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Au(e,t){return new ku({type:`nonoptional`,innerType:e,...M(t)})}var ju=P(`ZodCatch`,(e,t)=>{Do.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>al(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mu(e,t){return new ju({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Sr(t)})}var Nu=P(`ZodPipe`,(e,t)=>{Oo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ol(e,t,n,r),e.in=t.in,e.out=t.out});function Pu(e,t){return new Nu({type:`pipe`,in:e,out:t})}var Fu=P(`ZodPreprocess`,(e,t)=>{Nu.init(e,t),Ao.init(e,t)}),Iu=P(`ZodReadonly`,(e,t)=>{jo.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lu(e){return new Iu({type:`readonly`,innerType:e})}var Ru=P(`ZodCustom`,(e,t)=>{No.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(e,t,n,r)});function zu(e,t={}){return ic(Ru,e,t)}function Bu(e,t){return ac(e,t)}function Vu(e,t){return new Fu({type:`pipe`,in:vu(e),out:t})}function Hu(e){return Os(Ol,e)}var Y=V().regex(/^[a-z0-9][a-z0-9-]{0,31}$/,`expected 1-32 lowercase letters, digits, or hyphens, starting with a letter or digit`),X=V().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/,`expected a ULID`),Uu=V().regex(/^(?:[a-z0-9][a-z0-9-]{0,31}\/)?[a-z0-9][a-z0-9-]{0,31}$/,`expected <channel> or <project>/<channel>`);function Wu(e,t){return e===null?t:`${e}/${t}`}var Z=Vu(e=>e instanceof Date?e.toISOString():e,Hu()),Gu=q([`post_message`,`read_inbox`,`search`,`open_thread`,`close_thread`,`create_task`,`claim_task`,`release_task`,`update_task`,`get_task`,`subscribe`,`unsubscribe`,`propose`,`approve`,`reject`,`create_project`,`join_project`,`leave_project`,`write_knowledge`,`plan_task`,`advance_task`,`configure_project`,`archive_project`]),Ku=q([`user_post`,`ops_event`,`heartbeat`]),qu=K({name:Y,purpose:V().min(1),verbs:G(Gu),wakeTriggers:G(Ku).default([`heartbeat`]),reviewDate:V().optional(),maxReplicas:U().int().min(1).default(1),backlogThreshold:U().positive().default(3),resident:W().default(!1),societyScope:W().default(!1),reflects:W().default(!0)}),Ju=`user`,Yu=`user`,Xu=[`post_message`,`read_inbox`,`search`,`open_thread`,`close_thread`,`create_task`,`claim_task`,`release_task`,`update_task`,`get_task`,`subscribe`,`unsubscribe`,`propose`,`join_project`,`leave_project`,`write_knowledge`,`plan_task`,`advance_task`],Zu=[`approve`,`reject`],Qu=[`create_project`],$u=[`configure_project`],ed=[`archive_project`];[...Xu,...Zu,...Qu,...$u,...ed],[...Xu,...Zu,...$u],[...Xu,...Qu,...$u];var td=`asks`,nd=`society`,rd=q([`claude`,`codex`]),id=K({name:V().min(1),version:J(1),createdAt:Z,channels:G(Y)}),ad=q([`none`,`merge`]),od=V().regex(/^s[1-9][0-9]*$/,`expected a stage id such as s1`),sd={name:V().trim().min(1).max(120),role:Y.optional(),agent:Y.optional(),gate:W().default(!1)};function cd(e){return e.role===void 0||e.agent===void 0}var ld={message:`a stage names a role or an agent, not both`},ud=K(sd).refine(cd,ld),dd=K({id:od.optional(),...sd}).refine(cd,ld),fd=K({slug:Y,name:V().min(1),repo:V().nullable(),defaultBranch:V().min(1),channels:G(Y),members:G(Y),approvers:G(Y),requiredCapabilities:G(V()),createdAt:Z,onDone:ad.default(`none`),runner:Y.optional(),archived:K({at:Z,by:Y,reason:V().min(1)}).optional()}),pd=cu([K({action:q([`advanced`,`returned`,`abandoned`,`landed`,`reopened`]),stage:od,to:od.nullable()}),K({action:q([`approved`,`rejected`])})]);function md(e){return`stage`in e}var hd=K({id:X,author:Y,channel:Uu,thread:X.optional(),task:X.optional(),closes:X.optional(),step:pd.optional(),ts:Z,mentions:G(Y)}),gd=q([`open`,`claimed`,`done`,`abandoned`]),_d=q([`open`,`closed`]),vd=K({kind:q([`task`,`proposal`]),id:X}),yd=K({id:X,channel:Uu,title:V().min(1).max(200),subject:vd.optional(),state:_d,openedBy:Y,openedAt:Z,closedBy:Y.optional(),closedAt:Z.optional()}),bd=K({id:od,name:V().min(1),role:Y.optional(),agent:Y.optional(),gate:W().default(!1),holders:G(Y).default([]),completedBy:Y.optional(),completedAt:Z.optional()}),xd=K({from:od,by:Y,at:Z}),Sd=K({id:X,project:Y,title:V().min(1),status:gd,createdBy:Y,createdAt:Z,updatedAt:Z,claimedBy:Y.optional(),leaseExpiresAt:Z.optional(),parentId:X.optional(),blockedBy:G(X),requiredCapabilities:G(V()),stages:G(bd).min(1),stage:od,stageSince:Z,stageSeq:U().int().positive(),onDone:ad.default(`none`),completing:W().default(!1),returned:xd.optional()});function Cd(e,t){return e.stages.findIndex(e=>e.id===t)}function wd(e){return e.stages.find(t=>t.id===e.stage)}var Td=K({id:V().trim().min(1).max(120).regex(/^[\w.:/[\]-]+$/,`a model name is one word of letters, digits, and . _ : / - [ ]`),name:V(),description:V().default(``),isDefault:W().default(!1)}),Ed=q([`active`,`retired`]),Dd=K({name:Y,role:Y,cli:rd.nullable(),model:V().optional(),homeRunner:Y.optional(),memberships:G(Y),subscriptions:G(Uu),status:Ed,createdAt:Z,tokenHash:V().min(1),retiredAt:Z.optional(),retiredReason:V().optional()}),Od=K({name:Y,role:Y,cli:rd.nullable(),homeRunner:Y.optional(),status:Ed,resident:W().default(!1),model:V().optional(),lastModel:V().optional(),skills:G(Y).default([]),memberships:G(Y),subscriptions:G(Uu),claimsHeld:U().int().nonnegative().default(0),tasksDone:U().int().nonnegative().default(0),lastTurnAt:Z.optional(),lastTurnOutcome:V().optional(),createdAt:Z,retiredAt:Z.optional()}),kd=q([`linux`,`windows`,`darwin`]),Ad=K({name:Y,os:kd,clis:G(rd),capabilities:G(V()),status:q([`connected`,`disconnected`]),lastSeen:Z.optional()}),jd=q([`role`,`member`,`channel`,`reallocation`,`retirement`,`skill`,`archive`]),Md=q([`proposed`,`approved`,`rejected`,`provisioned`,`retired`]),Nd=K({name:Y,role:Y,cli:rd,model:V().optional(),homeRunner:Y.optional(),memberships:G(Y).default([]),subscriptions:G(Uu).default([]),seedInstructions:V().optional()}),Pd=K({project:Y.nullable().default(null),name:Y,purpose:V().min(1)}),Fd=K({description:V().min(1)}),Id=K({agent:Y,reason:V().min(1)}),Ld=K({project:Y,reason:V().min(1)}),Rd=K({name:Y,summary:V().min(1).max(200),body:V().min(1)}),zd={role:[Ju],member:[Ju],retirement:[Ju],archive:[Ju],channel:[Ju,`steward`],reallocation:[Ju,`steward`],skill:[Ju,`steward`]};function Bd(e,t){switch(e){case`member`:{let e=Nd.safeParse(t);if(!e.success)break;let{name:n,role:r,cli:i,memberships:a}=e.data;return`member ${n} as ${r} on ${i}${a.length===0?``:` for ${a.join(`, `)}`}`}case`role`:{let e=qu.safeParse(t);if(!e.success)break;let{name:n,verbs:r,maxReplicas:i}=e.data;return`role ${n} (${r.length} verbs, up to ${i} per project)`}case`channel`:{let e=Pd.safeParse(t);if(!e.success)break;return`channel ${Wu(e.data.project,e.data.name)}: ${e.data.purpose}`}case`retirement`:{let e=Id.safeParse(t);if(!e.success)break;return`retirement of ${e.data.agent}: ${e.data.reason}`}case`reallocation`:{let e=Fd.safeParse(t);if(!e.success)break;return`reallocation: ${e.data.description}`}case`skill`:{let e=Rd.safeParse(t);if(!e.success)break;return`skill ${e.data.name}: ${e.data.summary.trim().replace(/\.+$/,``)}`}case`archive`:{let e=Ld.safeParse(t);if(!e.success)break;return`archive of project ${e.data.project}: ${e.data.reason}`}}return`${e} ${JSON.stringify(t)}`}var Vd=K({name:Y,summary:V().default(``),scope:q([`own`,`society`]),path:V().min(1)}),Hd=K({path:V().min(1),file:V().min(1),since:Z}),Ud=V().regex(/^[0-9a-f]{40}([0-9a-f]{24})?$/),Wd=K({path:V().min(1),status:q([`added`,`modified`,`deleted`]),added:U().int().nonnegative().nullable(),removed:U().int().nonnegative().nullable()}),Gd=K({changes:G(K({commit:Ud,at:Z,kind:q([`turn`,`board`,`merge`]),author:V(),turnId:X.optional(),subject:V(),files:G(Wd)})),more:W()}),Kd=Wd.pick({path:!0,status:!0}).extend({patch:V().nullable(),truncated:W()}),qd=K({topic:Y,project:Y.nullable(),updatedBy:Y,updatedAt:Z}),Jd=K({id:X,kind:jd,proposedBy:Y,status:Md,createdAt:Z,decidedBy:Y.optional(),decidedAt:Z.optional(),reason:V().optional(),charter:mu(V(),nu()),provisionedAt:Z.optional(),provision:mu(V(),nu()).optional()}),Yd=K({id:X,proposalId:X,decidedBy:Y,outcome:q([`approved`,`rejected`]),reason:V().optional(),ts:Z});K({channel:Uu.optional(),body:V().min(1),thread_id:X.optional()}),K({since_cursor:X.nullable().optional(),limit:U().int().positive().max(200).default(50),advance:W().default(!0)}),K({query:V().min(1),project:Y.optional(),channel:Uu.optional(),limit:U().int().positive().max(100).default(20)}),K({task_id:X.optional(),proposal_id:X.optional(),channel:Uu.optional(),title:V().min(1).max(200).optional()}),K({thread_id:X,summary:V().min(1)}),K({project:Y,title:V().min(1).max(200),body:V().default(``),parent_id:X.optional(),required_capabilities:G(V()).default([]),stages:G(ud).min(1).optional()}),K({task_id:X}),K({task_id:X}),K({task_id:X,stage:od.optional(),status:q([`abandoned`]).optional(),note:V().min(1).optional(),blocked_by:G(X).optional()}),K({task_id:X}),K({channel:Uu}),K({channel:Uu}),K({kind:jd,charter:mu(V(),nu()),rationale:V().default(``)}),K({proposal_id:X,reason:V().optional()}),K({proposal_id:X,reason:V().min(1)}),K({slug:Y,name:V().min(1).optional(),repo:V().min(1).nullable().default(null),default_branch:V().min(1).default(`main`),on_done:ad.optional()}),K({project:Y,agent:Y.optional()}),K({project:Y,agent:Y.optional()}),K({project:Y.nullable().default(null),topic:Y,body:V().min(1)}),K({task_id:X,stages:G(dd),on_done:ad.optional()}),K({task_id:X,note:V().min(1).optional()}),K({project:Y,on_done:ad}),K({project:Y,reason:V().min(1)});var Xd=K({id:X,ts:Z,type:q(`society.initialized,project.added,project.configured,project.archived,project.placed,agent.added,agent.configured,agent.placed,message.posted,thread.opened,thread.closed,task.created,task.claimed,task.released,task.updated,task.planned,task.advanced,task.moved,task.completing,task.completed,task.reopened,lease.expired,subscription.changed,proposal.created,proposal.decided,proposal.provisioned,channel.added,role.added,agent.retired,agent.joined,agent.left,knowledge.written,skill.promoted,runner.added,runner.changed,ops.signal,paused.changed,wake.requested,turn.started,turn.completed,turn.failed,merge.completed,merge.failed`.split(`,`)),actor:Y,payload:mu(V(),nu())}),Zd=K({inputTokens:U().int().nonnegative(),outputTokens:U().int().nonnegative(),cacheReadTokens:U().int().nonnegative().default(0),cacheWriteTokens:U().int().nonnegative().default(0)}),Qd=K({summary:V().min(1),claimsHeld:G(X).default([]),blockedOn:G(V()).default([]),needsUserDecision:W().default(!1),memoryUpdated:W().default(!1)}),$d=q([`completed`,`timeout`,`error`,`interrupted`,`blocked`]),ef=uu(`type`,[K({type:J(`turn_started`),agent:Y,session:V(),runner:Y,model:V().optional()}),K({type:J(`text`),delta:V()}),K({type:J(`tool_call`),name:V(),input:nu()}),K({type:J(`tool_result`),name:V(),ok:W(),output:V().optional()}),K({type:J(`approval_requested`),kind:V(),detail:nu()}),K({type:J(`turn_completed`),usage:Zd,costUsd:U().nonnegative(),status:Qd.nullable(),exitReason:$d}),K({type:J(`error`),message:V()})]),tf=K({ts:Z,event:ef}),nf=K({seq:U().int().positive(),ts:Z,agent:Y,project:Y,thread:X.optional(),event:ef});K({protocol:U().int().positive(),version:V().min(1),os:kd,clis:G(rd),residentClis:G(rd).default([]),capabilities:G(V()).default([]),slots:U().int().positive().nullable(),turns:G(X).default([])}),K({name:Y,version:V()});var rf=K({slug:Y,origin:V().nullable(),defaultBranch:V().min(1)}),af=uu(`kind`,[K({kind:J(`home`)}),K({kind:J(`project`),repo:rf,branches:G(V().min(1))}),K({kind:J(`task`),repo:rf,taskId:X})]),of=K({turnId:X,agent:Y,role:Y,cli:rd,model:V().optional(),scope:Y,thread:X.optional(),session:V().min(1).nullable(),costSoFarUsd:U().nonnegative(),instructions:V(),prompt:V(),mcp:K({url:V().min(1),token:V().min(1)}),limits:K({timeoutMs:U().int().positive().nullable(),maxTurns:U().int().positive().nullable()}),resident:K({key:V().min(1),idleMs:U().int().positive()}).optional(),workspace:af}),sf=K({branch:V().min(1),head:V().min(1)});K({entries:G(tf)}),K({exitReason:$d,status:Qd.nullable(),error:V().nullable(),usage:Zd,costUsd:U().nonnegative(),sessionCostUsd:U().nonnegative().optional(),session:V().min(1),model:V().nullable(),work:sf.nullable()}),K({dropWorktree:W()});var cf=K({repo:rf,branch:V().min(1)});K({ok:W(),detail:V()}),uu(`type`,[K({type:J(`turn`),job:of}),K({type:J(`land`),request:V().min(1),land:cf}),K({type:J(`models`),request:V().min(1),cli:rd})]),uu(`ok`,[K({ok:J(!0),value:nu()}),K({ok:J(!1),error:V()})]),K({warm:G(V())}),K({files:mu(V(),V())}),K({paths:G(V())}),K({files:mu(V(),V())});var lf=K({kind:q([`mention`,`stage`,`task_done`,`proposal_decided`,`heartbeat`,`reflection`,`onboarding`,`manual`,`ops_event`,`user_post`]),from:Y.optional(),fromUser:W().default(!1),reason:V().default(``),taskId:X.optional(),messageId:X.optional(),channel:Uu.optional()});K({agent:Y,project:Y,thread:K({id:X,task:W()}).optional(),trigger:lf,priority:U().int().min(0).max(2),onboarding:W().default(!1)});function uf(e,t,n){return n===void 0?`${e}/${t}`:`${e}/${t}/${n}`}function df(e){let[t,n,r,i]=e.split(`/`);return t===void 0||n===void 0||i!==void 0?null:r===void 0?{agent:t,scope:n}:{agent:t,scope:n,thread:r}}K({id:X.optional(),agent:Y,project:Y,thread:X.optional(),runner:Y,cli:rd.nullable(),session:V().nullable(),trigger:lf,startedAt:Z,endedAt:Z.nullable(),exitReason:$d.nullable(),status:Qd.nullable(),error:V().nullable(),usage:Zd.nullable(),costUsd:U().nonnegative().default(0),sessionCostUsd:U().nonnegative().optional(),toolCalls:U().int().nonnegative().default(0),model:V().nullable().default(null),work:sf.optional()}),K({claude:V().optional(),codex:V().optional(),runner:Y.optional()}),K({agent:Y,project:Y,reason:V().default(`manual wake`),kind:q([`manual`,`reflection`]).default(`manual`)});var ff=K({id:X,turnId:X.optional(),ts:Z,outcome:q([`completed`,`failed`]),project:Y,thread:X.optional(),trigger:V(),exitReason:V().nullable(),costUsd:U(),model:V().nullable(),summary:V().nullable(),error:V().nullable(),startedAt:Z.optional(),toolCalls:U().int().nonnegative().optional()}),pf=q([`waiting_stage`,`backlog`,`role_gap`,`churn`,`stale_thread`,`idle_member`,`blocked_capability`,`turn_cost`,`scaled`,`runner`,`home_conflict`]),mf=[`backlog`,`role_gap`,`churn`,`stale_thread`,`idle_member`,`blocked_capability`,`scaled`],hf=K({kind:pf,key:V().min(1),summary:V().min(1),value:U(),threshold:U().optional(),project:Y.optional(),agent:Y.optional(),role:Y.optional(),taskId:X.optional()}),gf=q([`24h`,`7d`,`all`]),Q=U().int().nonnegative(),_f=U().nonnegative(),vf=K({window:gf,since:Z.nullable(),until:Z,idle:K({turns:Q,idle:Q,unknown:Q,byTrigger:G(K({trigger:V(),turns:Q,idle:Q})),byAgent:G(K({agent:Y,role:Y.nullable(),turns:Q,idle:Q}))}),sentBack:K({finished:Q,sendBacks:Q,tasksSentBack:Q,byStage:G(K({project:Y,stage:V(),count:Q})),bySender:G(K({agent:Y,count:Q}))}),messages:K({finished:Q,messages:Q,byProject:G(K({project:Y,finished:Q,messages:Q})),busiest:G(K({taskId:X,title:V(),project:Y,messages:Q}))}),latency:K({mentions:Q,unanswered:Q,medianMs:_f.nullable(),slowestMs:_f.nullable(),byAgent:G(K({agent:Y,mentions:Q,medianMs:_f,slowestMs:_f}))}),decisions:K({total:Q,byDay:G(K({day:V(),proposals:Q,answers:Q,stages:Q}))}),blocked:G(K({taskId:X,title:V().nullable(),project:Y.nullable(),summary:V(),firstAt:Z,lastAt:Z,holds:W()}))}),yf=q([`trace`,`debug`,`info`,`warn`,`error`,`fatal`]);K({dataDir:V().min(1),host:V().min(1),port:U().int().positive().max(65535),publicUrl:V().min(1).nullable(),logLevel:yf,concurrency:U().int().positive().nullable(),turnTimeoutMs:U().int().positive().nullable(),toolRounds:U().int().positive().nullable(),residentIdleMs:U().int().positive()}),K({serverUrl:V().url(),token:V().min(1),dataDir:V().min(1),logLevel:yf,slots:U().int().positive().nullable(),clis:G(rd).min(1),capabilities:G(V())});var bf=o((e=>{(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case v:return`Profiler`;case te:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`;case x:return`Activity`;case S:return`ViewTransition`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case re:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case y:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case b:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===b)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=ce.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(C.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){T||(T=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function l(){var e=t(this.type);return ue[e]||(ue[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:ee,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,"ref",{enumerable:!1,value:null}):Object.defineProperty(e,"ref",{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function f(e,n,i,o,l,d){var f=n.children;if(f!==void 0){if(o){if(le(f)){for(o=0;o<f.length;o++)p(f[o]);Object.freeze&&Object.freeze(f)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`)}else p(f)}if(C.call(n,`key`)){f=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,fe[f+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
73
- let props = %s;
74
- <%s {...props} />
75
- React keys must be passed directly to JSX without using spread:
76
- let props = %s;
77
- <%s key={someKey} {...props} />`,o,f,m,f),fe[f+o]=!0)}if(f=null,i!==void 0&&(r(i),f=``+i),s(n)&&(r(n.key),f=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return f&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,f,i,a(),l,d)}function p(e){m(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===b&&(e._payload.status===`fulfilled`?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e==`object`&&!!e&&e.$$typeof===ee}var h=d(),ee=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),re=Symbol.for(`react.context`),y=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),b=Symbol.for(`react.lazy`),x=Symbol.for(`react.activity`),S=Symbol.for(`react.view_transition`),se=Symbol.for(`react.client.reference`),ce=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=Object.prototype.hasOwnProperty,le=Array.isArray,w=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var T,ue={},E=h.react_stack_bottom_frame.bind(h,o)(),de=w(i(o)),fe={};e.Fragment=_,e.jsxDEV=function(e,t,n,r){var a=1e4>ce.recentlyCreatedOwnerStacks++;if(a){var o=Error.stackTraceLimit;Error.stackTraceLimit=10;var s=Error(`react-stack-top-frame`);Error.stackTraceLimit=o}else s=E;return f(e,t,n,r,s,a?w(i(e)):de)}})()})),xf=o(((e,t)=>{t.exports=bf()})),Sf=(0,m.createContext)(null);function $(){let e=(0,m.useContext)(Sf);if(e===null)throw Error(`useSession needs a signed-in SessionContext`);return e}function Cf(){let{api:e}=$();return A({queryKey:[`society`],queryFn:e.society,staleTime:6e4})}function wf(){let{api:e}=$();return A({queryKey:[`members`],queryFn:e.members,refetchInterval:3e4})}function Tf(){let{api:e}=$();return A({queryKey:[`projects`],queryFn:e.projects,refetchInterval:6e4})}function Ef(){let{api:e}=$();return A({queryKey:[`roles`],queryFn:e.roles,refetchInterval:6e4})}function Df(){let{api:e}=$();return A({queryKey:[`scheduler`],queryFn:e.scheduler,refetchInterval:3e3})}function Of(){let{api:e}=$();return A({queryKey:[`requests`],queryFn:e.requests,refetchInterval:6e4})}function kf(e){let{api:t}=$();return A({queryKey:[`signals`],queryFn:()=>t.signals(200),enabled:e,refetchInterval:6e4})}function Af(e){let{api:t}=$();return A({queryKey:[`metrics`,e],queryFn:()=>t.metrics(e),refetchInterval:6e4})}function jf(){let{api:e}=$();return A({queryKey:[`channels`],queryFn:e.channels,refetchInterval:6e4})}function Mf(){let{api:e}=$();return A({queryKey:[`threads`],queryFn:e.threads,refetchInterval:6e4})}function Nf(e){let{api:t}=$();return A({queryKey:[`tasks`,e],queryFn:()=>t.tasks(e),refetchInterval:6e4})}function Pf(e){return e.flatMap(e=>e.data??[])}function Ff(){let{api:e}=$();return rt({queries:(Tf().data??[]).map(t=>({queryKey:[`tasks`,t.slug],queryFn:()=>e.tasks(t.slug),refetchInterval:6e4})),combine:Pf})}function If(e){let{api:t}=$();return A({queryKey:[`task`,e],queryFn:()=>t.task(e??``),enabled:e!==null})}function Lf(){let{api:e}=$();return A({queryKey:[`proposals`],queryFn:e.proposals,refetchInterval:6e4})}function Rf(e){let{api:t}=$();return A({queryKey:[`proposal`,e],queryFn:()=>t.proposal(e)})}function zf(){let{api:e}=$();return A({queryKey:[`skills`],queryFn:e.skills,staleTime:6e4})}function Bf(e,t){let{api:n}=$();return A({queryKey:[`turns`,e,t],queryFn:()=>n.turns(e,t),refetchInterval:6e4})}function Vf(e,t){let{api:n}=$();return A({queryKey:[`transcript`,e,t],queryFn:()=>n.transcript(e,t??``),enabled:t!==null,staleTime:1/0})}function Hf(e){let{api:t}=$();return A({queryKey:[`memory`,e],queryFn:()=>t.memory(e)})}function Uf(e){let{api:t}=$();return A({queryKey:[`agent-skills`,e],queryFn:()=>t.agentSkills(e)})}function Wf(e,t){let{api:n}=$();return A({queryKey:[`history`,e,t],queryFn:()=>n.history(e,t),placeholderData:pe})}function Gf(e,t,n){let{api:r}=$();return A({queryKey:[`home-change`,e,t],queryFn:()=>r.change(e,t),enabled:n,staleTime:1/0})}function Kf(e){let{api:t}=$();return A({queryKey:[`conflicts`,e],queryFn:()=>t.conflicts(e)})}function qf(e){let{api:t}=$();return A({queryKey:[`dashboard`,e],queryFn:()=>t.dashboard(e),refetchInterval:6e4})}function Jf(e){let{api:t}=$();return A({queryKey:[`knowledge`,e],queryFn:()=>t.knowledge(e),refetchInterval:12e4})}function Yf(){let{api:e}=$();return A({queryKey:[`runners`],queryFn:()=>e.runners(),refetchInterval:6e4})}function Xf(e){let{api:t}=$();return A({queryKey:[`models`,e],queryFn:()=>t.models(e??`claude`),enabled:e!==null,staleTime:6e5,retry:!1})}function Zf(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Qf=[[`day`,86400],[`hour`,3600],[`minute`,60]],$f=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});function ep(e,t){let n=Math.round((Date.parse(e)-t)/1e3);for(let[e,t]of Qf)if(Math.abs(n)>=t)return $f.format(Math.round(n/t),e);return`just now`}function tp(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function np(e,t=220){let n=(e.split(/\n\s*\n/).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith(`#`))??``).replaceAll(/[*_`>]/g,``).replaceAll(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1).trimEnd()}…`}export{qd as $,ot as $t,Nf as A,p as An,K as At,df as B,Mt as Bt,Yf as C,C as Cn,Uu as Ct,zf as D,ge as Dn,G as Dt,kf as E,ve as En,Wu as Et,vf as F,Xt as Ft,td as G,Ot as Gt,Xd as H,jt as Ht,gf as I,Ut as It,Pd as J,lt as Jt,Dd as K,yt as Kt,hf as L,Ht as Lt,Vf as M,o as Mn,V as Mt,Bf as N,s as Nn,nu as Nt,Cf as O,_ as On,W as Ot,xf as P,l as Pn,mn as Pt,Gd as Q,ht as Qt,mf as R,zt as Rt,Ef as S,y as Sn,Ju as St,$ as T,T as Tn,X as Tt,nf as U,kt as Ut,uf as V,Ft as Vt,tf as W,Dt as Wt,Hd as X,pt as Xt,Yd as Y,Ct as Yt,Kd as Z,wt as Zt,Zf as _,ie as _n,Bd as _t,Uf as a,at as an,Jd as at,Lf as b,S as bn,qu as bt,qf as c,dt as cn,Id as ct,Wf as d,Ae as dn,Rd as dt,bt as en,Nd as et,Jf as f,k as fn,Vd as ft,Xf as g,Se as gn,wd as gt,Af as h,Ce as hn,yd as ht,Sf as i,mt as in,fd as it,Mf as j,d as jn,mu as jt,If as k,g as kn,U as kt,Gf as l,A as ln,Ad as lt,Hf as m,Ee as mn,Sd as mt,np as n,st as nn,hd as nt,Ff as o,ut as on,zd as ot,wf as p,De as pn,id as pt,Ld as q,Tt as qt,tp as r,St as rn,Td as rt,jf as s,xt as sn,Fd as st,ep as t,ct as tn,Od as tt,Kf as u,Pe as un,nd as ut,Tf as v,ce as vn,md as vt,Df as w,b as wn,Y as wt,Of as x,x as xn,Yu as xt,Rf as y,se as yn,Cd as yt,ff as z,Et as zt};