@atyaio/ledgr-web 0.1.1 → 0.1.2

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 (47) hide show
  1. package/dist/assets/badge-DCLlsDNI.js +55 -0
  2. package/dist/assets/{breakdown-D9nBrbad.js → breakdown-B7xclB2-.js} +1 -1
  3. package/dist/assets/{categories-B7jajln6.js → categories-C9LvkWNc.js} +1 -1
  4. package/dist/assets/{color-picker-DLlr-Cq6.js → color-picker-DUPZPbk3.js} +1 -1
  5. package/dist/assets/{custom-cell-Wgh3D7lb.js → custom-cell-DOJAsRPW.js} +1 -1
  6. package/dist/assets/data-BX7xFZfR.js +1 -0
  7. package/dist/assets/{download-CIyMPSgr.js → download-gNHw92Vi.js} +1 -1
  8. package/dist/assets/expenses-Ct1Tk3pC.js +1 -0
  9. package/dist/assets/index-B9WjaP25.js +31 -0
  10. package/dist/assets/index-YWd9JGBA.css +2 -0
  11. package/dist/assets/insights-C0cl4vss.js +1 -0
  12. package/dist/assets/integrations-CueFg-5F.js +1 -0
  13. package/dist/assets/{ledger-toolbar-yj0u4-Rm.js → ledger-toolbar-B_Gbv5Ws.js} +1 -1
  14. package/dist/assets/{media-Cr7juL5w.js → media-D6XgVZ7M.js} +1 -1
  15. package/dist/assets/{menu-BDGd2JUq.js → menu-C-8r2BNA.js} +1 -1
  16. package/dist/assets/{money-Ch2MLu6J.js → money-OFUBQ3gl.js} +1 -1
  17. package/dist/assets/{money-input-C8ZuBxvX.js → money-input-DQaEauAw.js} +1 -1
  18. package/dist/assets/{overview-Ddn6RbvU.js → overview-CZMXeLeG.js} +1 -1
  19. package/dist/assets/payments-D9NCfpzJ.js +1 -0
  20. package/dist/assets/project-CYHaWZqH.js +1 -0
  21. package/dist/assets/{pull-shift-sheet-DTwTC0rg.js → pull-shift-sheet-BaOiY46Z.js} +1 -1
  22. package/dist/assets/queries-CxLQqNqz.js +1 -0
  23. package/dist/assets/recurring-e7X3okBc.js +1 -0
  24. package/dist/assets/revenue-TPYHnUaW.js +1 -0
  25. package/dist/assets/{search-jkqZqVJy.js → search-CnrmI1BH.js} +1 -1
  26. package/dist/assets/settings-mDly_aVZ.js +4 -0
  27. package/dist/assets/{shift-sales-B0yokKuf.js → shift-sales-BpOCNuGY.js} +1 -1
  28. package/dist/assets/stakeholders-DzTfUHX0.js +1 -0
  29. package/dist/assets/{star-cwF2fEe6.js → star-DZj1Tpai.js} +1 -1
  30. package/dist/assets/{table-DQsx5_iN.js → table-QAdUTXQz.js} +1 -1
  31. package/dist/assets/{tooltip-CKyX36D7.js → tooltip-CYNpGhCZ.js} +7 -7
  32. package/dist/index.html +8 -8
  33. package/package.json +2 -2
  34. package/dist/assets/badge-BTiDEJlh.js +0 -55
  35. package/dist/assets/data-DLjPdfYn.js +0 -1
  36. package/dist/assets/expenses-DglPf9Hj.js +0 -1
  37. package/dist/assets/index-B3RS60Xw.css +0 -2
  38. package/dist/assets/index-DOwVPfdT.js +0 -31
  39. package/dist/assets/insights-C_lA_1Ig.js +0 -1
  40. package/dist/assets/integrations-C4NPnoJ4.js +0 -1
  41. package/dist/assets/payments-q8beCPp-.js +0 -1
  42. package/dist/assets/project-Bgpq3nFR.js +0 -1
  43. package/dist/assets/queries-IGiwF8nF.js +0 -1
  44. package/dist/assets/recurring-xqowgQWt.js +0 -1
  45. package/dist/assets/revenue-CB8ggUDa.js +0 -1
  46. package/dist/assets/settings-DJ670Ax6.js +0 -4
  47. package/dist/assets/stakeholders-wioC2mrf.js +0 -1
@@ -0,0 +1,55 @@
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,t.exports),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=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function ee(){}ee.prototype=y.prototype;function te(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var b=te.prototype=new ee;b.constructor=te,_(b,y.prototype),b.isPureReactComponent=!0;var ne=Array.isArray;function re(){}var x={H:null,A:null,T:null,S:null},ie=Object.prototype.hasOwnProperty;function ae(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function oe(e,t){return ae(e.type,t,e.props)}function S(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function se(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ce=/\/+/g;function le(e,t){return typeof e==`object`&&e&&e.key!=null?se(``+e.key):t.toString(36)}function ue(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(re,re):(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 C(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,C(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+le(e,0):a,ne(o)?(i=``,c!=null&&(i=c.replace(ce,`$&/`)+`/`),C(o,r,i,``,function(e){return e})):o!=null&&(S(o)&&(o=oe(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ce,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ne(e))for(var u=0;u<e.length;u++)a=e[u],s=l+le(a,u),c+=C(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+le(a,u++),c+=C(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return C(ue(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function de(e,t,n){if(e==null)return e;var r=[],i=0;return C(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function fe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var pe=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)};function me(e){var t=x.T,n={};n.types=t===null?null:t.types,x.T=n;try{var r=e(),i=x.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(re,pe)}catch(e){pe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),x.T=t}}function he(e){var t=x.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else me(he.bind(null,e))}var ge={map:de,forEach:function(e,t,n){de(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return de(e,function(){t++}),t},toArray:function(e){return de(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ge,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=te,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return x.H.useMemoCache(e)}},e.addTransitionType=he,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ie.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ae(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ie.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ae(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=S,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:fe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=me,e.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},e.use=function(e){return x.H.use(e)},e.useActionState=function(e,t,n){return x.H.useActionState(e,t,n)},e.useCallback=function(e,t){return x.H.useCallback(e,t)},e.useContext=function(e){return x.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return x.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return x.H.useEffect(e,t)},e.useEffectEvent=function(e){return x.H.useEffectEvent(e)},e.useId=function(){return x.H.useId()},e.useImperativeHandle=function(e,t,n){return x.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return x.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return x.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return x.H.useMemo(e,t)},e.useOptimistic=function(e,t){return x.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return x.H.useReducer(e,t,n)},e.useRef=function(e){return x.H.useRef(e)},e.useState=function(e){return x.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return x.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return x.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),p=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=f()})),m=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),h=o(((e,t)=>{t.exports=m()})),g=l(d(),1),_=h(),v=g.createContext(void 0),y=e=>{let t=g.useContext(v);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ee=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,_.jsx)(v.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)},b=new class{#e=te;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return 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 x(){}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 S(e,t){return typeof e==`function`?e(t):e}function se(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==le(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 ce(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ue(t.options.mutationKey)!==ue(a))return!1}else if(!C(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function le(e,t){return(t?.queryKeyHashFn||ue)(e)}function ue(e){return JSON.stringify(e,(e,t)=>he(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 de=Object.prototype.hasOwnProperty;function fe(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=me(e)&&me(t);if(!r&&!(he(e)&&he(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:de.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=fe(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function pe(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 me(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function he(e){if(!ge(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!(!ge(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ge(e){return Object.prototype.toString.call(e)===`[object Object]`}function _e(e){return new Promise(t=>{b.setTimeout(t,e)})}function ve(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:fe(e,t)}function ye(e){return e}function be(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function xe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Se=Symbol();function Ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Se?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function we(e,t){return typeof e==`function`?e(...t):!!e}function Te(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Ee=()=>re,De=()=>Ee(),Oe=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(){}},ke=new class extends Oe{#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`}},Ae=ne;function je(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ae,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 Me=je(),Ne=new class extends Oe{#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 Pe(e){return Math.min(1e3*2**e,3e4)}function Fe(e){return(e??`online`)!==`online`||Ne.isOnline()}var Ie=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Le(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(x);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ie(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ke.isFocused()&&(e.networkMode===`always`||Ne.isOnline())&&e.canRun(),p=()=>Fe(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{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??(De()?0:3),a=e.retryDelay??Pe,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),_e(o).then(()=>f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Re=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ae(this.gcTime)&&(this.#e=b.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(De()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(b.clearTimeout(this.#e),this.#e=void 0)}};function ze(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=>{Te(e,()=>t.signal,()=>n=!0)},u=Ce(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?xe:be;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ve:Be,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:Be(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 Be(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 Ve(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var He=class extends Re{#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=Ge(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=Ge(this.options);e.data!==void 0&&(this.setState(We(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ve(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(x).catch(x):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=>S(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>S(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)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ce(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`?ze(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=Le({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ie&&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 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 Ie){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,...Ue(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...We(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),Me.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ue(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function We(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ge(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 Ke=class extends Oe{#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),Je(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ye(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ye(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 S(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&&!pe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Xe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||S(this.options.enabled,this.#t)!==S(t.enabled,this.#t)||S(this.options.staleTime,this.#t)!==S(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||S(this.options.enabled,this.#t)!==S(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 pe(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(x)),t}#h(e){return!De()&&S(this.options.enabled,this.#t)!==!1&&ae(e)}#g(){this.#b();let e=S(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=oe(this.#r.dataUpdatedAt,e)+1;this.#u=b.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return S(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=b.setInterval(()=>{(this.options.refetchIntervalInBackground||ke.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(b.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(b.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&&Je(e,t),o=i&&Xe(e,n,t,r);(a||o)&&(l={...l,...Ue(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=ve(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=ve(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 g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,ee=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,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:g,isRefetching:g&&!_,isLoadingError:v&&!ee,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&ee,isStale:Ze(e,t),refetch:this.refetch,isEnabled:S(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),pe(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)})})();Me.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 qe(e,t){return S(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||S(t.retryOnMount,e)!==!1)}function Je(e,t){return qe(e,t)||e.state.data!==void 0&&Ye(e,t,t.refetchOnMount)}function Ye(e,t,n){if(S(t.enabled,e)!==!1&&S(t.staleTime,e)!==`static`){let r=S(n,e);return r===`always`||r!==!1&&Ze(e,t)}return!1}function Xe(e,t,n,r){return(e!==t||S(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ze(e,n)}function Ze(e,t){return S(t.enabled,e)!==!1&&e.isStaleByTime(S(t.staleTime,e))}var Qe=g.createContext(!1),$e=()=>g.useContext(Qe);Qe.Provider;function et(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tt=g.createContext(et()),nt=()=>g.useContext(tt),rt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?we(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},it=e=>{g.useEffect(()=>{e.clearReset()},[e])},at=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||we(n,[e.error,r])),ot=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))}},st=(e,t)=>e?.suspense&&t.isPending,ct=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lt(e,t,n){let r=$e(),i=nt(),a=y(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ot(o),rt(o,i,s),it(i);let[l]=g.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(g.useSyncExternalStore(g.useCallback(e=>{let t=d?l.subscribe(Me.batchCalls(e)):x;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),g.useEffect(()=>{l.setOptions(o)},[o,l]),st(o,u))throw ct(o,l,i);if(at({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ut(e,t){return lt(e,Ke,t)}var dt=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.status=e,this.code=t,this.details=r}},ft=()=>null,pt=null;function mt(e){ft=e.getToken,pt=e.onUnauthorized??null}function ht(e){if(!e)return``;let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}async function gt(e,t,n,r){let i=await ft(),a={};i&&(a.Authorization=`Bearer ${i}`);let o;r?.form?o=r.form:n!==void 0&&(a[`Content-Type`]=`application/json`,o=JSON.stringify(n));let s=await fetch(`/api${t}`,{method:e,headers:a,body:o});if(s.status===401&&pt?.(),!s.ok){let e={};try{e=await s.json()}catch{}throw new dt(s.status,e.code??`ERROR`,e.message??s.statusText,e.details)}if(r?.raw)return await s.text();if(s.status!==204)return await s.json()}var _t={get:(e,t)=>gt(`GET`,`${e}${ht(t)}`),post:(e,t)=>gt(`POST`,e,t),patch:(e,t)=>gt(`PATCH`,e,t),put:(e,t)=>gt(`PUT`,e,t),delete:(e,t)=>gt(`DELETE`,`${e}${ht(t)}`),upload:(e,t)=>gt(`POST`,e,void 0,{form:t}),text:(e,t)=>gt(`GET`,`${e}${ht(t)}`,void 0,{raw:!0})};async function vt(e,t,n){let r=await ft(),i=await fetch(`/api${e}${ht(n)}`,{headers:r?{Authorization:`Bearer ${r}`}:{}});if(!i.ok)throw new dt(i.status,`DOWNLOAD`,`Download failed (${i.status})`);let a=await i.blob(),o=i.headers.get(`content-disposition`)?.match(/filename="?([^";]+)"?/),s=document.createElement(`a`);s.href=URL.createObjectURL(a),s.download=o?.[1]??t,document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(s.href),2e3)}function yt(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 bt(e,t=`|`){return e.map(e=>Ut(e)).join(t)}function xt(e,t){return typeof t==`bigint`?t.toString():t}var St=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 Ct(e){return new St(e)}function wt(e){return e==null}function Tt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Et(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 Dt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function w(e){return Ot(e._zod.def)??e._zod.def.shape}function kt(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Dt(this,t,e),e},enumerable:!0,configurable:!0})}function At(e,t,n){t in e?Dt(e,t,n):e[t]=n}function jt(e,t,n,r){let i=w(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?kt(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):At(e,a,r?r(n.value,a):n.value))}}function Mt(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?kt(e,n,()=>t[n]):At(e,n,r.value))}}function T(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Nt(e){return JSON.stringify(e)}function Pt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ft=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function It(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Lt=Ct(()=>{if(M.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Rt(e){if(It(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return It(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function zt(e){return Rt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Bt=new Set([`string`,`number`,`symbol`]);function Vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ht(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function E(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 Ut(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Wt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Gt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kt={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function qt(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 jt(i,e,Jt(e,t)),Ht(e,T(n,{shape:i,checks:[]}))}function Jt(e,t){let n=w(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 Yt(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(Jt(e,t)),a={};return jt(a,e,Reflect.ownKeys(w(e)).filter(e=>!i.has(e))),Ht(e,T(n,{shape:a,checks:[]}))}function Xt(e,t){if(!Rt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=w(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 Ht(e,T(e._zod.def,{shape:Zt(e,t)}))}function Zt(e,t){let n={};return jt(n,e,Reflect.ownKeys(w(e))),Mt(n,t),n}function Qt(e,t){if(!Rt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ht(e,T(e._zod.def,{shape:Zt(e,t)}))}function $t(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 jt(n,e,Reflect.ownKeys(w(e))),jt(n,t,Reflect.ownKeys(w(t))),Ht(e,T(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function en(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(Jt(t,n)):void 0,o={};return jt(o,t,Reflect.ownKeys(w(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ht(t,T(t._zod.def,{shape:o,checks:[]}))}function tn(e,t,n){let r=n?new Set(Jt(t,n)):void 0,i={};return jt(i,t,Reflect.ownKeys(w(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ht(t,T(t._zod.def,{shape:i}))}function D(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 nn(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 rn(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function an(e){return typeof e==`string`?e:e?.message}function on(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function sn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function O(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:an(e.inst?._zod.def?.error?.(e))??an(a?.(e))??an(t?.error?.(e))??an(n.customError?.(e))??an(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 cn=/[\uD800-\uDBFF]/;function ln(e){let t=e.length;if(!cn.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 un(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function dn(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 fn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function pn(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):gn(e,n,r.value)}}function k(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function mn(e,t,n){return k(e,t,n,!1)}function hn(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return k(this,n,r(this))},set(e){k(this,n,e)}})}return t}function gn(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:k(this,t,n.bind(this))},set(e){k(this,t,e)}})}function _n(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var vn,yn=!1,bn={configurable:!0,get(){yn=!0}};function A(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&vn!==e._zod?vn=void 0:(vn=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,bn);let e=yn;yn=!1;try{let r=n(this);return yn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),yn||=e,r}catch(n){throw delete this[t],yn||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function xn(e,t,n,r){let i=_n(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 Sn=`~constantCatch`;function Cn(e){let t=()=>e;return t[Sn]=!0,t}var wn,Tn={value:void 0,enumerable:!1},En=`captureStackTrace`in Error?Error:null;function Dn(e){let t=En;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return En=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function j(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){Tn.value=new a(r);try{Object.defineProperty(n,"_zod",Tn)}finally{Tn.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),pn(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?Dn(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 On=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},kn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(wn=globalThis).__zod_globalConfig??(wn.__zod_globalConfig={});var M=globalThis.__zod_globalConfig;function N(e){return e&&Object.assign(M,e),M}function An(){let e=this._zod;return e.message??=JSON.stringify(e.def,xt,2),e.message}function jn(e){this._zod.message=e}var Mn={get:An,set:jn,enumerable:!0,configurable:!0},Nn={value:void 0,enumerable:!1},Pn=new WeakSet([Object.prototype,Error.prototype]),Fn=j(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Nn.value=t,Object.defineProperty(e,"issues",Nn),Nn.value=void 0,Object.defineProperty(e,"message",Mn);let n=Object.getPrototypeOf(e);Pn.has(n)||(Pn.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})}}))});function In(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 Ln(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?In(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Rn(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 zn(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Bn=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 On;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>O(e,o,N())));throw Ft(n,a?.callee??t),n}return s.value};return t},Vn=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=>O(e,o,N())));throw Ft(n,a?.callee??t),n}return s.value};return t},Hn=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 On;return a.issues.length?Un(e,a.issues,i):{success:!0,data:a.value}};function Un(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>O(e,n,N()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Wn=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?Un(e,a.issues,i):{success:!0,data:a.value}},Gn=Symbol.for(`zod.compile.invalid`),Kn=Symbol.for(`zod.compile.fallback`),qn=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Gn)return!0;if(r.definite===!0&&n===void 0)return!1}return Jn(e,t,n)});function Jn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Kn]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new On;return a.issues.length===0}var Yn=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},Xn=e=>{let t=Bn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,zn(n,a))};return n},Zn=e=>{let t=Bn(e),n=(e,r,i,a)=>t(e,r,i,zn(n,a));return n},Qn=e=>{let t=Vn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,zn(n,a))};return n},$n=e=>{let t=Vn(e),n=async(e,r,i,a)=>await t(e,r,i,zn(n,a));return n},er=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hn(e)(t,n,i)},tr=e=>(t,n,r)=>Hn(e)(t,n,r),nr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wn(e)(t,n,i)},rr=e=>async(t,n,r)=>Wn(e)(t,n,r),ir=/^[cC][0-9a-z]{6,}$/,ar=/^[0-9a-z]+$/,or=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,sr=/^[0-9a-vA-V]{20}$/,cr=/^[A-Za-z0-9]{27}$/,lr=/^[a-zA-Z0-9_-]{21}$/;function ur(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var dr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fr=/^([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})$/,pr=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)$/,mr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hr=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function gr(){return new RegExp(hr,`u`)}var _r=/^(?:(?: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])$/,vr=/^(([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}|:))$/,yr=/^((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])$/,br=/^(([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])$/,xr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Cr=/^https?$/,wr=/^\+[1-9]\d{6,14}$/,Tr=`(?:(?:\\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 Er(e){return RegExp(`^${e}$`)}var Dr=Er(Tr);function Or(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 kr(e){return RegExp(`^${Or(e)}$`)}function Ar(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Or({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Or({precision:e.precision})}`:n;return RegExp(`^${Tr}T(?:${r})$`)}var jr=/^[\s\S]{0,}$/,Mr=/^-?\d+$/,Nr=/^-?\d+(?:\.\d+)?$/,Pr=/^(?:true|false)$/i,Fr=/^null$/i,Ir=/^[^A-Z]*$/,Lr=/^[^a-z]*$/,P=j(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Rr=e=>{let t=e.value;return!wt(t)&&t.length!==void 0},zr={number:`number`,bigint:`bigint`,object:`date`},Br=j(`$ZodCheckLessThan`,(e,t)=>{P.init(e,t);let n=zr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:zr[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})}}),Vr=j(`$ZodCheckGreaterThan`,(e,t)=>{P.init(e,t);let n=zr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:zr[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})}}),Hr=j(`$ZodCheckMultipleOf`,(e,t)=>{P.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):Et(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})}}),Ur=j(`$ZodCheckNumberFormat`,(e,t)=>{P.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Gt[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})}}),Wr=j(`$ZodCheckMaxLength`,(e,t)=>{var n;P.init(e,t),(n=e._zod.def).when??(n.when=Rr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ln(r):i)<=t.maximum)return;let a=un(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gr=j(`$ZodCheckMinLength`,(e,t)=>{var n;P.init(e,t),(n=e._zod.def).when??(n.when=Rr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ln(r):i)>=t.minimum)return;let a=un(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Kr=j(`$ZodCheckLengthEquals`,(e,t)=>{var n;P.init(e,t),(n=e._zod.def).when??(n.when=Rr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ln(r):i;if(a===t.length)return;let o=un(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})}}),qr=j(`$ZodCheckStringFormat`,(e,t)=>{var n,r;P.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=()=>{})}),Jr=j(`$ZodCheckRegex`,(e,t)=>{qr.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})}}),Yr=j(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ir,qr.init(e,t)}),Xr=j(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Lr,qr.init(e,t)}),Zr=j(`$ZodCheckIncludes`,(e,t)=>{P.init(e,t);let n=Vt(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})}}),Qr=j(`$ZodCheckStartsWith`,(e,t)=>{P.init(e,t);let n=RegExp(`^${Vt(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})}}),$r=j(`$ZodCheckEndsWith`,(e,t)=>{P.init(e,t);let n=RegExp(`.*${Vt(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})}}),ei=j(`$ZodCheckOverwrite`,(e,t)=>{P.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ti=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(`
2
+ `).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(`
3
+ `)}\n};`)(...Object.values(this.closed))}},ni={major:4,minor:6,patch:7},F=j(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ni;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=D(t),a;for(let o of n){if(o._zod.def.when){if(nn(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 On;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(sn(t.issues,n,e),i||=D(t,n))});else{if(t.issues.length===n)continue;sn(t.issues,n,e),i||=D(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(D(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new On;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 On;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return mn(this,`~standard`,ai(this))},set"~standard"(e){k(this,`~standard`,e)}}),ri=(e,t)=>e.issues.length?{issues:e.issues.map(e=>O(e,t,N()))}:{value:e.value};async function ii(e,t){let n={async:!0};return ri(await e._zod.run({value:t,issues:[]},n),n)}function ai(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ri(r,n)}catch{}return ii(e,t)},vendor:`zod`,version:1}}var oi=j(`$ZodString`,(e,t)=>{F.init(e,t),e._zod.pattern=t.pattern??jr,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}}),I=j(`$ZodStringFormat`,(e,t)=>{qr.init(e,t),oi.init(e,t)}),si=j(`$ZodGUID`,(e,t)=>{t.pattern??=fr,I.init(e,t)}),ci=j(`$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??=pr(e)}else t.pattern??=pr();I.init(e,t)}),li=j(`$ZodEmail`,(e,t)=>{t.pattern??=mr,I.init(e,t)});function ui(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function di(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?ui(e)||2:fi(e,t)}function fi(e,t){if(!t.normalize&&t.protocol?.source===Cr.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 pi=/[\t\n\r]/g;function mi(e){return e.replace(pi,``)}function hi(e,t){return t.lastIndex=0,t.test(e.hostname)}function gi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var _i=j(`$ZodURL`,(e,t)=>{I.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=di(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=mi(r);return}t.hostname&&!hi(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&&!gi(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:mi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),vi=j(`$ZodEmoji`,(e,t)=>{t.pattern??=gr(),I.init(e,t)}),yi=j(`$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?lr:ur(t.length),I.init(e,t)}),bi=j(`$ZodCUID`,(e,t)=>{t.pattern??=ir,I.init(e,t)}),xi=j(`$ZodCUID2`,(e,t)=>{t.pattern??=ar,I.init(e,t)}),Si=j(`$ZodULID`,(e,t)=>{t.pattern??=or,I.init(e,t)}),Ci=j(`$ZodXID`,(e,t)=>{t.pattern??=sr,I.init(e,t)}),wi=j(`$ZodKSUID`,(e,t)=>{t.pattern??=cr,I.init(e,t)}),Ti=j(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ar(t),I.init(e,t)}),Ei=j(`$ZodISODate`,(e,t)=>{t.pattern??=Dr,I.init(e,t)}),Di=j(`$ZodISOTime`,(e,t)=>{t.pattern??=kr(t),I.init(e,t)}),Oi=j(`$ZodISODuration`,(e,t)=>{t.pattern??=dr,I.init(e,t)}),ki=j(`$ZodIPv4`,(e,t)=>{t.pattern??=_r,I.init(e,t)}),Ai=/^[0-9a-fA-F:.]+$/;function ji(e){return Ai.test(e)?ui(`http://[${e}]`):!1}var Mi=j(`$ZodIPv6`,(e,t)=>{t.pattern??=vr,I.init(e,t),e._zod.check=n=>{ji(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Ni=j(`$ZodCIDRv4`,(e,t)=>{t.pattern??=yr,I.init(e,t)});function Pi(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:ji(n)}var Fi=j(`$ZodCIDRv6`,(e,t)=>{t.pattern??=br,I.init(e,t),e._zod.check=n=>{Pi(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ii(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Li=/^[0-9a-zA-Z+/]*={0,2}$/,Ri=j(`$ZodBase64`,(e,t)=>{t.pattern??=Li,I.init(e,t),e._zod.check=n=>{Ii(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),zi=/^[A-Za-z0-9_-]*$/;function Bi(e){if(!zi.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ii(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Vi=j(`$ZodBase64URL`,(e,t)=>{t.pattern??=zi,I.init(e,t),e._zod.check=n=>{Bi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Hi=j(`$ZodE164`,(e,t)=>{t.pattern??=wr,I.init(e,t)});function Ui(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 Wi=j(`$ZodJWT`,(e,t)=>{I.init(e,t),e._zod.check=n=>{Ui(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Gi=j(`$ZodNumber`,(e,t)=>{F.init(e,t),e._zod.pattern=Nr,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}}),Ki=j(`$ZodNumberFormat`,(e,t)=>{Ur.init(e,t),Gi.init(e,t)}),qi=j(`$ZodBoolean`,(e,t)=>{F.init(e,t),e._zod.pattern=Pr,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}}),Ji=j(`$ZodNull`,(e,t)=>{F.init(e,t),e._zod.pattern=Fr,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Yi=j(`$ZodUnknown`,(e,t)=>{F.init(e,t),e._zod.parse=e=>e}),Xi=j(`$ZodNever`,(e,t)=>{F.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Zi(e,t){let n=on(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of on(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,sn(n.issues,t,e),n}}return i(n,a)}}var Qi=e=>Array.isArray(e)?e.length:-1;function $i(e,t,n){e.issues.length&&t.issues.push(...rn(n,e.issues)),t.value[n]=e.value}var ea=j(`$ZodArray`,(e,t)=>{F.init(e,t);let n=M.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=>$i(t,r,e)));else if($i(c,r,e),s&&c.issues.length!==0&&D(c))break}return o.length?Promise.all(o).then(()=>r):r},Zi(e,Qi)});function ta(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(...rn(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var na=[];function ra(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:na,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=Wt(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ia(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(D(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=>ta(e,n,i,t,d,f))):ta(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 aa=j(`$ZodObject`,(e,t)=>{F.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=Ct(()=>ra(t));A(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)||Dt(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=It,o=t.catchall,s,c=M.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(D(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=>ta(n,t,e,r,a,o))):ta(s,t,e,r,a,o)}return o?ia(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),oa=j(`$ZodObjectJIT`,(e,t)=>{aa.init(e,t);let n=e._zod.parse,r=Ct(()=>ra(t)),i=M.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ti([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
4
+ let ${e}_ab = false;
5
+ for (let i = 0; i < ${e}.issues.length; i++) {
6
+ const iss = ${e}.issues[i];
7
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
8
+ payload.issues.push(iss);
9
+ if (iss.continue !== true) ${e}_ab = true;
10
+ }
11
+ if (${e}_ab && ctx && ctx.abortEarly) {
12
+ payload.value = newResult;
13
+ return payload;
14
+ }`;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)}]`:Nt(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(`
15
+ const ${n}_present = ${i};
16
+ if (!${n}.issues.length || ${n}_present) {
17
+ if (${n}.issues.length) {${c(n,r)}
18
+ }
19
+
20
+ if (${e}) {
21
+ newResult[${r}] = ${n}.value;
22
+ }
23
+ }
24
+
25
+ `)}else f?(o.write(`
26
+ if (${n}.issues.length) {${c(n,r)}
27
+ }
28
+ `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
29
+ if (${n}.value !== undefined || ${i}) {
30
+ newResult[${r}] = ${n}.value;
31
+ }
32
+ `)):o.write(`
33
+ const ${n}_present = ${i};
34
+ if (${n}.issues.length) {${c(n,r)}
35
+ }
36
+ if (!${n}_present && !${n}.issues.length) {
37
+ payload.issues.push({
38
+ code: "invalid_type",
39
+ expected: "nonoptional",
40
+ input: undefined,
41
+ path: [${r}]
42
+ });
43
+ if (ctx && ctx.abortEarly) {
44
+ payload.value = newResult;
45
+ return payload;
46
+ }
47
+ }
48
+
49
+ if (${n}_present) {
50
+ newResult[${r}] = ${n}.value;
51
+ }
52
+
53
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=It,c=!M.jitless,l=c&&Lt.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?ia([],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 sa(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=>!D(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=>O(e,r,N())))}),t)}var ca=j(`$ZodUnion`,(e,t)=>{F.init(e,t),A(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),A(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),A(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)))}),A(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=>Tt(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=>sa(t,r,e,i)):sa(o,r,e,i)}}),la=j(`$ZodIntersection`,(e,t)=>{F.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])=>da(e,t,n)):da(e,i,a)}});function ua(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Rt(e)&&Rt(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=ua(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=ua(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 da(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=ua(t.value,n.value);if(!c.valid){if(D(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var fa=j(`$ZodRecord`,(e,t)=>{F.init(e,t);let n=M.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Rt(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=>O(e,i,N())),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(...rn(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...rn(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`&&Nr.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=>O(e,i,N())),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(...rn(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...rn(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}}),pa=j(`$ZodEnum`,(e,t)=>{F.init(e,t);let n=yt(t.entries),r=new Set(n);e._zod.values=r,A(e,`pattern`,e=>{let t=yt(e.def.entries).filter(e=>Bt.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Vt(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}}),ma=j(`$ZodLiteral`,(e,t)=>{F.init(e,t);let n=new Set(t.values);e._zod.values=n,A(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Vt(e):e?Vt(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}}),ha=j(`$ZodTransform`,(e,t)=>{F.init(e,t),e._zod.optin=`optional`,M.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new kn(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 On;return n.value=i,n}});function ga(e,t){return e.value=t.issues.length?void 0:t.value,e}var _a=j(`$ZodOptional`,(e,t)=>{F.init(e,t),A(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,A(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),A(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Tt(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=>ga(e,t)):ga(e,r)}return t.innerType._zod.run(e,n)}}),va=j(`$ZodExactOptional`,(e,t)=>{_a.init(e,t),A(e,`values`,e=>e.def.innerType._zod.values),A(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ya=j(`$ZodNullable`,(e,t)=>{F.init(e,t),A(e,`optin`,e=>e.def.innerType._zod.optin),A(e,`optout`,e=>e.def.innerType._zod.optout),A(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Tt(t.source)}|null)$`):void 0}),A(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)}),ba=j(`$ZodDefault`,(e,t)=>{F.init(e,t),e._zod.optin=`defaulted`,A(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=>xa(e,t)):xa(r,t)}});function xa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Sa=j(`$ZodPrefault`,(e,t)=>{F.init(e,t),e._zod.optin=`defaulted`,A(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))}),Ca=j(`$ZodNonOptional`,(e,t)=>{F.init(e,t),A(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=>wa(t,e)):wa(i,e)}});function wa(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 Ta(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>O(e,r,N()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Ea=j(`$ZodCatch`,(e,t)=>{F.init(e,t),A(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),A(e,`optout`,e=>e.def.innerType._zod.optout),A(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=>Ta(e,r,t,n)):Ta(e,r,t,n)}}),Da=j(`$ZodPipe`,(e,t)=>{F.init(e,t),A(e,`values`,e=>e.def.in._zod.values),A(e,`optin`,e=>e.def.in._zod.optin),A(e,`optout`,e=>e.def.out._zod.optout),A(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=>Oa(e,t.in,n)):Oa(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Oa(e,t.out,n)):Oa(r,t.out,n)}});function Oa(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 ka=j(`$ZodReadonly`,(e,t)=>{F.init(e,t),A(e,`propValues`,e=>e.def.innerType._zod.propValues),A(e,`values`,e=>e.def.innerType._zod.values),A(e,`optin`,e=>e.def.innerType?._zod?.optin),A(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(Aa):Aa(r)}});function Aa(e){return e.memo||(e.value=Object.freeze(e.value)),e}var ja=j(`$ZodCustom`,(e,t)=>{P.init(e,t),F.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=>Ma(t,n,r,e));Ma(i,n,r,e)}});function Ma(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(fn(e))}}var Na=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Pa=`~memo`,Fa=[];function Ia(e){return typeof e==`object`&&!!e}function La(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Ra=new WeakMap,za=0,Ba=1,Va=2;function Ha(e,t,n){let r=Ra.get(e);if(r!==void 0)return r?Va:za;if(t.has(e))return Va;t.add(e);let i=za,a=e=>{if(i!==Va&&e?._zod){let r=Ha(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=za;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ba:o.value?._zod?Ha(o.value,t,n):za;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ot(c);s(e?o(e,!0):Ba),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?Ha(r,t,!1):Ba);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),Ua(e,i)}function Ua(e,t){return t!==Ba&&Ra.set(e,t===Va),t}function Wa(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ga,Ka=[],qa={alloc(e,t,n){let r=Ga;if(!r)return n;Ga=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ka.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`&&Ya(n,e.value))throw new Na;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=Ha(e,new Set,!1);if(i===za)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Va||r?n=!0:r=!0}let l=s.value;if(!Ia(l))return t(s,c);let u=c[Pa];u||(u={buckets:new WeakMap,backEdges:void 0},c[Pa]=u);let d;i===c?d=a:(d=Wa(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(...La(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Ga=d;let p=Ka.length,m=t(s,c);Ga=void 0;let h=Ka.length>p?Ka.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?La(e.issues):Fa),e)):(h&&(h.issues=m.issues.length?La(m.issues):Fa),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ja(){return qa}function Ya(e,t){let n=e[Pa]?.backEdges;return n!==void 0&&Ia(t)&&n.has(t)}var Xa=()=>{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(dn(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ut(e.values[0])}`:`Invalid option: expected one of ${bt(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`:``}: ${bt(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 Za(){return{localeError:Xa()}}var Qa,$a=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 eo(){return new $a}(Qa=globalThis).__zod_globalRegistry??(Qa.__zod_globalRegistry=eo());var to=globalThis.__zod_globalRegistry;function no(e){return e.checks&&=[...e.checks],e}function ro(e,t){return new e(no({type:`string`,...E(t)}))}function io(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...E(t)})}function ao(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...E(t)})}function oo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...E(t)})}function so(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...E(t)})}function co(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...E(t)})}function lo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...E(t)})}function uo(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...E(t)})}function fo(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...E(t)})}function po(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...E(t)})}function mo(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...E(t)})}function ho(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...E(t)})}function go(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...E(t)})}function _o(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...E(t)})}function vo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...E(t)})}function yo(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...E(t)})}function bo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...E(t)})}function xo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...E(t)})}function So(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...E(t)})}function Co(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...E(t)})}function wo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...E(t)})}function To(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...E(t)})}function Eo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...E(t)})}function Do(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...E(t)})}function Oo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...E(t)})}function ko(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...E(t)})}function Ao(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...E(t)})}function jo(e,t){return new e(no({type:`number`,checks:[],...E(t)}))}function Mo(e,t){return new e(no({type:`number`,coerce:!0,checks:[],...E(t)}))}function No(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...E(t)})}function Po(e,t){return new e({type:`boolean`,...E(t)})}function Fo(e,t){return new e({type:`null`,...E(t)})}function Io(e){return new e({type:`unknown`})}function Lo(e,t){return new e({type:`never`,...E(t)})}function Ro(e,t){return new Br({check:`less_than`,...E(t),value:e,inclusive:!1})}function zo(e,t){return new Br({check:`less_than`,...E(t),value:e,inclusive:!0})}function Bo(e,t){return new Vr({check:`greater_than`,...E(t),value:e,inclusive:!1})}function Vo(e,t){return new Vr({check:`greater_than`,...E(t),value:e,inclusive:!0})}function Ho(e,t){return new Hr({check:`multiple_of`,...E(t),value:e})}function Uo(e,t){return new Wr({check:`max_length`,...E(t),maximum:e})}function Wo(e,t){return new Gr({check:`min_length`,...E(t),minimum:e})}function Go(e,t){return new Kr({check:`length_equals`,...E(t),length:e})}function Ko(e,t){return new Jr({check:`string_format`,format:`regex`,...E(t),pattern:e})}function qo(e){return new Yr({check:`string_format`,format:`lowercase`,...E(e)})}function Jo(e){return new Xr({check:`string_format`,format:`uppercase`,...E(e)})}function Yo(e,t){return new Zr({check:`string_format`,format:`includes`,...E(t),includes:e})}function Xo(e,t){return new Qr({check:`string_format`,format:`starts_with`,...E(t),prefix:e})}function Zo(e,t){return new $r({check:`string_format`,format:`ends_with`,...E(t),suffix:e})}function Qo(e){return new ei({check:`overwrite`,tx:e})}function $o(e){return Qo(t=>t.normalize(e))}function es(){return Qo(e=>e.trim())}function ts(){return Qo(e=>e.toLowerCase())}function ns(){return Qo(e=>e.toUpperCase())}function rs(){return Qo(e=>Pt(e))}function is(e,t,n){return new e({type:`array`,element:t,...E(n)})}function as(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...E(n)})}function os(e,t){let n=ss(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(fn(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(fn(r))}},e(t.value,t)),t);return n}function ss(e,t){let n=new P({check:`custom`,...E(t)});return n._zod.check=e,n}function cs(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Dt(e,t,n[t]);return e}function ls(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??to,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 L(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&&cs(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 us(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ds(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}/${us(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+us(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>
54
+
55
+ 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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function fs(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;fs(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 ps=new Set([`type`,`properties`,`required`,`additionalProperties`]),ms=[`oneOf`,`anyOf`];function hs(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function gs(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ps.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]??hs(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Dt(n,r,e.length===1?e[0]:gs(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=hs(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 _s(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ps)if(t in e)return;let n=t.filter(e=>ms.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=gs(t);else{let e=n[0],i=ms.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=>gs([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,cs(e,r))}function vs(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)):cs(i,s),cs(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())fs(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)??[])_s(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)}cs(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,Dt(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:bs(t,`input`,e.processors),output:bs(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 ys=(e,t={})=>n=>{let r=ls({...n,processors:t});return R(e,r),ds(r,e),vs(r,e)},bs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ls({...i??{},target:a,io:t,processors:n});return R(e,o),ds(o,e),vs(o,e)},xs=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Ss=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Cs=(e,t)=>{xs(e,`minimum`,t),Ss(e,`maximum`,t)},ws=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ts=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Es=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ds=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Os=(e,t)=>xs(e,`minimum`,t.minimum),ks=(e,t)=>Ss(e,`maximum`,t.maximum),As=e=>(t,n)=>{Ds(t,n.format);let[r,i]=e[n.format];xs(t,`minimum`,r),Ss(t,`maximum`,i)},js={greater_than:(e,t)=>xs(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Ss(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ws(e,t.value),number_format:As(Gt),bigint_format:As(Kt),min_length:Os,max_length:ks,length_equals:(e,t)=>Cs(e,t.length),min_size:Os,max_size:ks,size_equals:(e,t)=>Cs(e,t.size),string_format:(e,t)=>{Ds(e,t.format),t.pattern&&Ts(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)=>Es(e,t.mime)};function B(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)js[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&xs(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&xs(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Ss(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Ss(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ws(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Es(t,i.mime);for(let e of i.patterns??[])Ts(t,e);return t}var Ms={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ns=new Map([[Li,xr],[zi,Sr]]),Ps=e=>Ns.get(e)??e,Fs=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=B(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ms[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(Ps);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}))])}},Is=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=B(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)):L(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}))])}},Ls=(e,t,n,r)=>{n.type=`boolean`},Rs=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},zs=(e,t,n,r)=>{n.not={}},Bs=(e,t,n,r)=>{let i=e._zod.def,a=yt(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Vs=(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(L(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(L(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}},Hs=(e,t,n,r)=>{L(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Us=(e,t,n,r)=>{L(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ws=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=B(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 Gs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Gs(t.out):t.type===`catch`?Gs(t.innerType):e._zod.optin}var Ks=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&L(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Dt(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`?Gs(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)},qs=(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},Js=(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 Ys(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=Ys(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=>Ys(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`)?Nr:Mr).source)),p}var Xs=new WeakMap;function Zs(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 Xs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ys(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 Qs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=B(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)Dt(i.patternProperties,Ps(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=Xs.get(t);n||(n=[],Xs.set(t,n),t.deferred.push(()=>Zs(t))),n.push(e)}i.additionalProperties=R(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Gs(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))}},$s=(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`}]},ec=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tc=Symbol();function nc(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(L(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),tc):JSON.parse(o)}var rc=(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=nc(i.defaultValue,e,t,n,r);o!==tc&&(n.default=o)},ic=(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=nc(i.defaultValue,e,t,n,r);o!==tc&&(n._prefault=o)},ac=(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{L(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},oc=(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},sc=(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},cc=(e,t,n,r)=>{let i=e._zod.def;R(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},lc=new WeakSet([Object.prototype,Error.prototype]);function uc(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 V=j(`ZodError`,(e,t)=>{Fn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);lc.has(n)||(lc.add(n),uc(n,`format`,e=>t=>Rn(e,t)),uc(n,`flatten`,e=>t=>Ln(e,t)),uc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,xt,2)}),uc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),dc=Bn(V),fc=Vn(V),pc=Hn(V),mc=Wn(V),hc=Xn(V),gc=Zn(V),_c=Qn(V),vc=$n(V),yc=er(V),bc=tr(V),xc=nr(V),Sc=rr(V);function Cc(){M.localeError||N(Za())}function wc(){M.memoizer||N({memoizer:Ja()})}var H=j(`ZodType`,(e,t)=>(Cc(),F.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T(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 Ht(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rl(e,t))},superRefine(e,t){return this.check(zl(e,t))},overwrite(e){return this.check(Qo(e))},optional(){return bl(this)},exactOptional(){return Sl(this)},nullable(){return wl(this)},nullish(){return bl(wl(this))},nonoptional(e){return Al(this,e)},array(){return q(this)},or(e){return ll([this,e])},and(e){return dl(this,e)},transform(e){return Pl(this,vl(e))},default(e){return El(this,e)},prefault(e){return Ol(this,e)},catch(e){return Ml(this,e)},pipe(e){return Pl(this,e)},readonly(){return Il(this)},describe(e){let t=this.clone();return to.add(t,{description:e}),t},meta(...e){if(e.length===0)return to.get(this);let t=this.clone();return to.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 mn(this,`~standard`,{...ai(this),jsonSchema:{input:bs(this,`input`),output:bs(this,`output`)}})},set"~standard"(e){k(this,`~standard`,e)},parse:function e(t,n){return dc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await fc(this,t,n,{callee:e})},safeParse(e,t){return pc(this,e,t)},async safeParseAsync(e,t){return mc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){k(this,`spa`,e)},validate(e,t){return qn(this,e,t)},validateAsync(e,t){return Yn(this,e,t)},encode:function e(t,n){return hc(this,t,n,{callee:e})},decode:function e(t,n){return gc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await _c(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await vc(this,t,n,{callee:e})},safeEncode(e,t){return yc(this,e,t)},safeDecode(e,t){return bc(this,e,t)},async safeEncodeAsync(e,t){return xc(this,e,t)},async safeDecodeAsync(e,t){return Sc(this,e,t)},toJSONSchema(e){return ys(this,{})(e)},get description(){return to.get(this)?.description},get _def(){return this._zod.def}}),Tc=j(`_ZodString`,(e,t)=>{oi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r)},hn({format:e=>B(e).format??null,minLength:e=>B(e).minimum??null,maxLength:e=>B(e).maximum??null},{regex(...e){return this.check(Ko(...e))},includes(...e){return this.check(Yo(...e))},startsWith(...e){return this.check(Xo(...e))},endsWith(...e){return this.check(Zo(...e))},min(...e){return this.check(Wo(...e))},max(...e){return this.check(Uo(...e))},length(...e){return this.check(Go(...e))},nonempty(...e){return this.check(Wo(1,...e))},lowercase(e){return this.check(qo(e))},uppercase(e){return this.check(Jo(e))},trim(){return this.check(es())},normalize(...e){return this.check($o(...e))},toLowerCase(){return this.check(ts())},toUpperCase(){return this.check(ns())},slugify(){return this.check(rs())}})),Ec=j(`ZodString`,(e,t)=>{oi.init(e,t),Tc.init(e,t)},{email(e){return this.check(io(jc,e))},url(e){return this.check(uo(Pc,e))},jwt(e){return this.check(Eo(Yc,e))},emoji(e){return this.check(fo(Fc,e))},guid(e){return this.check(ao(Mc,e))},uuid(e){return this.check(oo(Nc,e))},uuidv4(e){return this.check(so(Nc,e))},uuidv6(e){return this.check(co(Nc,e))},uuidv7(e){return this.check(lo(Nc,e))},nanoid(e){return this.check(po(Ic,e))},cuid(e){return this.check(mo(Lc,e))},cuid2(e){return this.check(ho(Rc,e))},ulid(e){return this.check(go(zc,e))},base64(e){return this.check(Co(Kc,e))},base64url(e){return this.check(wo(qc,e))},xid(e){return this.check(_o(Bc,e))},ksuid(e){return this.check(vo(Vc,e))},ipv4(e){return this.check(yo(Hc,e))},ipv6(e){return this.check(bo(Uc,e))},cidrv4(e){return this.check(xo(Wc,e))},cidrv6(e){return this.check(So(Gc,e))},e164(e){return this.check(To(Jc,e))},datetime(e){return this.check(Do(Dc,e))},date(e){return this.check(Oo(Oc,e))},time(e){return this.check(ko(kc,e))},duration(e){return this.check(Ao(Ac,e))}});function U(e){return ro(Ec,e)}var W=j(`ZodStringFormat`,(e,t)=>{I.init(e,t),Tc.init(e,t)}),Dc=j(`ZodISODateTime`,(e,t)=>{Ti.init(e,t),W.init(e,t)}),Oc=j(`ZodISODate`,(e,t)=>{Ei.init(e,t),W.init(e,t)}),kc=j(`ZodISOTime`,(e,t)=>{Di.init(e,t),W.init(e,t)}),Ac=j(`ZodISODuration`,(e,t)=>{Oi.init(e,t),W.init(e,t)}),jc=j(`ZodEmail`,(e,t)=>{li.init(e,t),W.init(e,t)}),Mc=j(`ZodGUID`,(e,t)=>{si.init(e,t),W.init(e,t)}),Nc=j(`ZodUUID`,(e,t)=>{ci.init(e,t),W.init(e,t)}),Pc=j(`ZodURL`,(e,t)=>{_i.init(e,t),W.init(e,t)}),Fc=j(`ZodEmoji`,(e,t)=>{vi.init(e,t),W.init(e,t)}),Ic=j(`ZodNanoID`,(e,t)=>{yi.init(e,t),W.init(e,t)}),Lc=j(`ZodCUID`,(e,t)=>{bi.init(e,t),W.init(e,t)}),Rc=j(`ZodCUID2`,(e,t)=>{xi.init(e,t),W.init(e,t)}),zc=j(`ZodULID`,(e,t)=>{Si.init(e,t),W.init(e,t)}),Bc=j(`ZodXID`,(e,t)=>{Ci.init(e,t),W.init(e,t)}),Vc=j(`ZodKSUID`,(e,t)=>{wi.init(e,t),W.init(e,t)}),Hc=j(`ZodIPv4`,(e,t)=>{ki.init(e,t),W.init(e,t)}),Uc=j(`ZodIPv6`,(e,t)=>{Mi.init(e,t),W.init(e,t)}),Wc=j(`ZodCIDRv4`,(e,t)=>{Ni.init(e,t),W.init(e,t)}),Gc=j(`ZodCIDRv6`,(e,t)=>{Fi.init(e,t),W.init(e,t)}),Kc=j(`ZodBase64`,(e,t)=>{Ri.init(e,t),W.init(e,t)}),qc=j(`ZodBase64URL`,(e,t)=>{Vi.init(e,t),W.init(e,t)}),Jc=j(`ZodE164`,(e,t)=>{Hi.init(e,t),W.init(e,t)}),Yc=j(`ZodJWT`,(e,t)=>{Wi.init(e,t),W.init(e,t)}),Xc=j(`ZodNumber`,(e,t)=>{Gi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.isFinite=!0},hn({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=B(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=B(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=B(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>B(e).format??null},{gt(e,t){return this.check(Bo(e,t))},gte(e,t){return this.check(Vo(e,t))},min(e,t){return this.check(Vo(e,t))},lt(e,t){return this.check(Ro(e,t))},lte(e,t){return this.check(zo(e,t))},max(e,t){return this.check(zo(e,t))},int(e){return this.check(Qc(e))},safe(e){return this.check(Qc(e))},positive(e){return this.check(Bo(0,e))},nonnegative(e){return this.check(Vo(0,e))},negative(e){return this.check(Ro(0,e))},nonpositive(e){return this.check(zo(0,e))},multipleOf(e,t){return this.check(Ho(e,t))},step(e,t){return this.check(Ho(e,t))},finite(){return this}}));function G(e){return jo(Xc,e)}var Zc=j(`ZodNumberFormat`,(e,t)=>{Ki.init(e,t),Xc.init(e,t)});function Qc(e){return No(Zc,e)}var $c=j(`ZodBoolean`,(e,t)=>{qi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r)});function K(e){return Po($c,e)}var el=j(`ZodNull`,(e,t)=>{Ji.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r)});function tl(e){return Fo(el,e)}var nl=j(`ZodUnknown`,(e,t)=>{Yi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rl(){return Io(nl)}var il=j(`ZodNever`,(e,t)=>{Xi.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r)});function al(e){return Lo(il,e)}var ol=j(`ZodArray`,(e,t)=>{wc(),ea.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Wo(e,t))},nonempty(e){return this.check(Wo(1,e))},max(e,t){return this.check(Uo(e,t))},length(e,t){return this.check(Go(e,t))},unwrap(){return this.element}});function q(e,t){return is(ol,e,t)}var sl=j(`ZodObject`,(e,t)=>{wc(),oa.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r),xn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Y(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:rl()}))},loose(){return this.clone(T(this._zod.def,{catchall:rl()}))},strict(){return this.clone(T(this._zod.def,{catchall:al()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return Xt(this,e)},safeExtend(e){return Qt(this,e)},merge(e){return $t(this,e)},pick(e){return qt(this,e)},omit(e){return Yt(this,e)},partial(...e){return en(yl,this,e[0])},exactPartial(...e){return en(xl,this,e[0],`exactPartial`)},required(...e){return tn(kl,this,e[0])}});function J(e,t){return new sl({type:`object`,shape:e??{},...E(t)})}var cl=j(`ZodUnion`,(e,t)=>{ca.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qs(e,t,n,r),e.options=t.options});function ll(e,t){return new cl({type:`union`,options:e,...E(t)})}var ul=j(`ZodIntersection`,(e,t)=>{la.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,n,r)});function dl(e,t){return new ul({type:`intersection`,left:e,right:t})}var fl=j(`ZodRecord`,(e,t)=>{wc(),fa.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function pl(e,t,n){return!t||!t._zod?new fl({type:`record`,keyType:U(),valueType:e,...E(t)}):new fl({type:`record`,keyType:e,valueType:t,...E(n)})}var ml=j(`ZodEnum`,(e,t)=>{pa.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(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 ml({...t,checks:[],...E(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 ml({...t,checks:[],...E(r),entries:i})}});function Y(e,t){return new ml({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...E(t)})}var hl=j(`ZodLiteral`,(e,t)=>{ma.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(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 gl(e,t){return new hl({type:`literal`,values:Array.isArray(e)?e:[e],...E(t)})}var _l=j(`ZodTransform`,(e,t)=>{wc(),ha.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Us(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new kn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(fn(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(fn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function vl(e){return new _l({type:`transform`,transform:e})}var yl=j(`ZodOptional`,(e,t)=>{_a.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bl(e){return new yl({type:`optional`,innerType:e})}var xl=j(`ZodExactOptional`,(e,t)=>{va.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sl(e){return new xl({type:`optional`,innerType:e})}var Cl=j(`ZodNullable`,(e,t)=>{ya.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wl(e){return new Cl({type:`nullable`,innerType:e})}var Tl=j(`ZodDefault`,(e,t)=>{ba.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function El(e,t){return new Tl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():zt(t)}})}var Dl=j(`ZodPrefault`,(e,t)=>{Sa.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ic(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ol(e,t){return new Dl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():zt(t)}})}var kl=j(`ZodNonOptional`,(e,t)=>{Ca.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Al(e,t){return new kl({type:`nonoptional`,innerType:e,...E(t)})}var jl=j(`ZodCatch`,(e,t)=>{Ea.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ac(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ml(e,t){return new jl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Cn(t)})}var Nl=j(`ZodPipe`,(e,t)=>{Da.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oc(e,t,n,r),e.in=t.in,e.out=t.out});function Pl(e,t){return new Nl({type:`pipe`,in:e,out:t})}var Fl=j(`ZodReadonly`,(e,t)=>{ka.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Il(e){return new Fl({type:`readonly`,innerType:e})}var Ll=j(`ZodCustom`,(e,t)=>{ja.init(e,t),H.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r)});function Rl(e,t={}){return as(Ll,e,t)}function zl(e,t){return os(e,t)}function Bl(e){return Mo(Xc,e)}var Vl=[`expense`,`revenue`],Hl=[`ownership`,`custom`],Ul=[`expense`,`revenue`,`stakeholder`],Wl=[`text`,`number`,`money`,`date`,`boolean`,`select`],Gl=[`daily`,`weekly`,`monthly`,`quarterly`,`yearly`],Kl=[`day`,`week`,`month`],ql=[`expenses`,`revenue`,`stakeholders`,`categories`,`settlements`],Jl=`pool`,X=U().regex(/^\d{4}-\d{2}-\d{2}$/,`Expected YYYY-MM-DD`).refine(e=>!Number.isNaN(Date.parse(`${e}T00:00:00Z`)),`Invalid date`),Yl=U().regex(/^#[0-9a-fA-F]{6}$/,`Expected #rrggbb`),Xl=G().int(`Amounts are integer minor units`),Zl=Xl.positive(`Amount must be greater than zero`),Ql=G().min(0).max(100),$l=U().min(1).max(40).regex(/^[a-z][a-z0-9_]*$/,`Lowercase letters, digits and underscores; start with a letter`),eu=ll([U(),G(),K(),tl()]),tu=ll([K(),U()]).transform(e=>typeof e==`boolean`?e:[`true`,`1`,`yes`].includes(e.toLowerCase())).optional(),nu=pl(U(),eu).default({});J({from:X.optional(),to:X.optional(),q:U().trim().max(200).optional(),categoryId:U().optional(),stakeholderId:U().optional(),paymentMethodId:U().optional(),sort:U().max(40).optional(),order:Y([`asc`,`desc`]).optional(),page:Bl().int().min(1).default(1),pageSize:Bl().int().min(1).max(500).default(50)}),J({from:X.optional(),to:X.optional()});var ru=U().trim().max(80).nullable().optional(),iu=J({logo:U().max(4e5,`Logo must be under 300 KB`).regex(/^data:image\/(png|jpeg|webp|gif|svg\+xml);base64,[A-Za-z0-9+/]+=*$/,`Expected a base64 image data URL`).optional(),primaryColor:Yl.optional(),showProjectName:K().optional()});J({name:U().trim().min(1).max(80),nameAr:U().trim().max(80).optional(),slug:U().trim().min(1).max(80).regex(/^[a-z0-9-]+$/),currency:U().trim().length(3).transform(e=>e.toUpperCase()),locale:U().trim().min(2).max(20),weekStartsOn:ll([gl(0),gl(1),gl(2),gl(3),gl(4),gl(5),gl(6)]),fiscalYearStartMonth:G().int().min(1).max(12),timezone:U().trim().min(1).max(64).optional(),port:G().int().min(1).max(65535),branding:iu.optional(),auth:J({mode:Y([`supabase`,`none`]),supabaseUrl:U().url().optional(),supabaseAnonKey:U().min(10).optional()})}).pick({name:!0,nameAr:!0,currency:!0,locale:!0,weekStartsOn:!0,fiscalYearStartMonth:!0,timezone:!0,branding:!0}).partial(),J({name:U().trim().min(1).max(80),nameAr:ru,email:U().trim().email().nullable().optional(),sharePercent:Ql,active:K().default(!0),joinedAt:X.nullable().optional(),notes:U().max(2e3).nullable().optional(),color:Yl.optional(),customFields:nu.optional()}).partial(),J({name:U().trim().min(1).max(60),nameAr:ru,kind:Y(Vl),color:Yl.optional(),monthlyBudgetMinor:Xl.min(0).nullable().optional(),isDefault:K().optional(),archived:K().optional(),sortOrder:G().int().optional()}).omit({kind:!0}).partial(),J({kind:Y(Vl).optional(),includeArchived:tu}),J({month:U().regex(/^\d{4}-\d{2}$/).optional()}),J({name:U().trim().min(1).max(60),nameAr:ru,color:Yl.optional(),isDefault:K().optional(),archived:K().optional(),sortOrder:G().int().optional()}).partial(),J({includeArchived:tu});var au=J({stakeholderId:U().min(1),sharePercent:Ql}),ou=J({paymentMethodId:U().min(1),amountMinor:Xl.min(0)}),su=e=>(e??[]).reduce((e,t)=>e+t.amountMinor,0),cu=J({date:X,amountMinor:Zl.optional(),description:U().trim().min(1).max(200),categoryId:U().min(1),paidByStakeholderId:U().nullable().optional(),payments:q(ou).max(50).optional(),vendor:U().trim().max(120).nullable().optional(),notes:U().max(2e3).nullable().optional(),splitMode:Y(Hl).default(`ownership`),customSplits:q(au).optional(),customFields:nu.optional()});cu.refine(e=>(e.amountMinor??0)>0||su(e.payments)>0,{message:`Enter an amount, or at least one payment method amount`,path:[`amountMinor`]}),cu.partial(),J({amountMinor:Xl.min(0)}),J({ids:q(U().min(1)).min(1).max(1e3)});var lu=ou,uu=J({date:X,amountMinor:Zl.optional(),description:U().trim().min(1).max(200),categoryId:U().nullable().optional(),source:U().trim().max(120).nullable().optional(),payments:q(lu).max(50).optional(),receivedByStakeholderId:U().nullable().optional(),notes:U().max(2e3).nullable().optional(),customFields:nu.optional()});uu.refine(e=>(e.amountMinor??0)>0||su(e.payments)>0,{message:`Enter an amount, or at least one payment method amount`,path:[`amountMinor`]}),uu.partial(),J({date:X,fromStakeholderId:U().min(1),toStakeholderId:U().nullable().optional(),amountMinor:Zl,note:U().max(500).nullable().optional()}).partial(),J({entity:Y(Ul),key:$l,label:U().trim().min(1).max(60),labelAr:U().trim().max(60).nullable().optional(),type:Y(Wl),options:q(U().trim().min(1).max(60)).max(100).default([]),required:K().default(!1),sortOrder:G().int().optional()}).omit({entity:!0,key:!0}).partial().extend({archived:K().optional()}),J({ids:q(U().min(1))}),J({entity:Y(Ul).optional(),includeArchived:tu});var du=J({description:U().trim().min(1).max(200),amountMinor:Zl,categoryId:U().nullable().default(null),partyStakeholderId:U().nullable().default(null),paymentMethodId:U().nullable().optional(),vendorOrSource:U().trim().max(120).nullable().default(null),notes:U().max(2e3).nullable().default(null),splitMode:Y(Hl).default(`ownership`),customSplits:q(au).default([]),customFields:nu});J({kind:Y(Vl),name:U().trim().min(1).max(80),frequency:Y(Gl),interval:G().int().min(1).max(365).default(1),startDate:X,endDate:X.nullable().optional(),active:K().default(!0),template:du}).omit({kind:!0}).partial(),J({from:X,to:X,granularity:Y(Kl).optional()});var fu=ll([U(),q(U())]).transform(e=>(Array.isArray(e)?e:e.split(`,`)).map(e=>e.trim()).filter(Boolean)).optional();J({from:X,to:X,granularity:Y(Kl).optional(),ledger:Y([`both`,`revenue`,`expenses`]).default(`both`),categoryIds:fu,paymentMethodIds:fu,stakeholderId:U().optional()}),Y(ql);var pu=J({dateFormat:Y([`auto`,`iso`,`dmy`,`mdy`]).default(`auto`),createMissingCategories:K().default(!0),createMissingStakeholders:K().default(!1),createMissingPaymentMethods:K().default(!0),skipDuplicates:K().default(!0)});J({mapping:pl(U(),U().nullable()),options:pu.default({dateFormat:`auto`,createMissingCategories:!0,createMissingStakeholders:!1,createMissingPaymentMethods:!0,skipDuplicates:!0})}),J({entity:U().optional(),entityId:U().optional(),action:U().optional(),page:Bl().int().min(1).default(1),pageSize:Bl().int().min(1).max(200).default(50)}),Y([`loyverse`]),J({accessToken:U().trim().min(10).max(400)}),J({storeIds:q(U().min(1)).max(100).optional(),paymentTypeIds:q(U().min(1)).max(100).optional(),methodMap:pl(U(),U().min(1)).optional(),categoryId:U().min(1).nullable().optional(),subtractPayouts:K().optional()}),J({shiftId:U().min(1).optional()}),J({q:U().trim().max(100).optional(),categoryId:U().optional(),includeDeleted:tu}),J({limit:Bl().int().min(1).max(50).default(10)});function mu(e){let t=new Set([`JPY`,`KRW`,`VND`,`CLP`,`ISK`,`HUF`,`UGX`,`XOF`,`XAF`,`PYG`,`RWF`]),n=new Set([`BHD`,`IQD`,`JOD`,`KWD`,`LYD`,`OMR`,`TND`]),r=e.toUpperCase();return t.has(r)?0:n.has(r)?3:2}function hu(e,t){return e/10**mu(t)}function gu(e,t){return Math.round(e*10**mu(t))}function _u(e,t,n={}){let r=mu(t),i=e/10**r,a=n.locale??`en-US`,o=n.display??`symbol`,s=Number.isInteger(i),c=n.trimZeros&&s?0:r,l={minimumFractionDigits:n.compact?0:c,maximumFractionDigits:n.compact?1:c,notation:n.compact?`compact`:`standard`,signDisplay:n.signed?`exceptZero`:`auto`};return new Intl.NumberFormat(a,o===`none`?l:{...l,style:`currency`,currency:t,currencyDisplay:o===`code`?`code`:`narrowSymbol`}).format(i)}function vu(e,t){if(e==null)return null;if(typeof e==`number`)return Number.isFinite(e)?gu(e,t):null;let n=e.trim();if(!n)return null;let r=!1;if(/^\(.*\)$/.test(n)&&(r=!0,n=n.slice(1,-1)),n=n.replace(/[^\d.,\-+]/g,``),!n)return null;n.startsWith(`-`)&&(r=!r),n=n.replace(/[+-]/g,``);let i=n.lastIndexOf(`,`),a=n.lastIndexOf(`.`),o;if(i>-1&&a>-1)o=i>a?n.replace(/\./g,``).replace(`,`,`.`):n.replace(/,/g,``);else if(i>-1){let e=n.length-i-1;o=(n.match(/,/g)??[]).length===1&&(e===1||e===2)?n.replace(`,`,`.`):n.replace(/,/g,``)}else o=(n.match(/\./g)??[]).length>1?n.replace(/\./g,``):n;let s=Number(o);return Number.isFinite(s)?gu(r?-s:s,t):null}function yu(e,t){let n=t.filter(e=>e.sharePercent>0),r=n.reduce((e,t)=>e+t.sharePercent,0);if(n.length===0||r<=0)return[];let i=e<0?-1:1,a=Math.abs(e),o=n.map(e=>a*e.sharePercent/r),s=o.map(e=>Math.floor(e)),c=a-s.reduce((e,t)=>e+t,0),l=o.map((e,t)=>({i:t,frac:e-s[t]})).sort((e,t)=>t.frac-e.frac||e.i-t.i);for(let{i:e}of l){if(c<=0)break;s[e]+=1,--c}return n.map((e,t)=>({stakeholderId:e.stakeholderId,sharePercent:bu(e.sharePercent/r*100),amountMinor:i*s[t]}))}function bu(e){return Math.round(e*1e4)/1e4}function xu(e){return Math.round(e*100)/100}var Su=[{id:`today`,label:`Today`,short:`D`},{id:`week`,label:`This week`,short:`W`},{id:`month`,label:`This month`,short:`M`},{id:`quarter`,label:`This quarter`,short:`Q`},{id:`year`,label:`This year`,short:`Y`},{id:`last30`,label:`Last 30 days`,short:`30d`},{id:`last12m`,label:`Last 12 months`,short:`12m`},{id:`custom`,label:`Custom`,short:`…`}];function Cu(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,`0`)}-${String(e.getUTCDate()).padStart(2,`0`)}`}function Z(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(Date.UTC(t,n-1,r))}function wu(e=new Date){return Cu(new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())))}function Q(e,t){let n=Z(e);return n.setUTCDate(n.getUTCDate()+t),Cu(n)}function Tu(e,t){let n=Z(e),r=n.getUTCDate();n.setUTCDate(1),n.setUTCMonth(n.getUTCMonth()+t);let i=Eu(n.getUTCFullYear(),n.getUTCMonth());return n.setUTCDate(Math.min(r,i)),Cu(n)}function Eu(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function Du(e,t){return Math.round((Z(t).getTime()-Z(e).getTime())/864e5)}function Ou(e,t){return Q(e,-((Z(e).getUTCDay()-t+7)%7))}function ku(e){return`${e.slice(0,7)}-01`}function Au(e){let t=Z(e);return Cu(new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,0)))}function ju(e){let t=Z(e),n=Math.floor(t.getUTCMonth()/3)*3;return Cu(new Date(Date.UTC(t.getUTCFullYear(),n,1)))}function Mu(e,t=1){let n=Z(e),r=t-1,i=n.getUTCMonth()>=r?n.getUTCFullYear():n.getUTCFullYear()-1;return Cu(new Date(Date.UTC(i,r,1)))}function Nu(e,t={}){let n=t.today??wu(),r=t.weekStartsOn??1;switch(e){case`today`:return{from:n,to:n};case`week`:{let e=Ou(n,r);return{from:e,to:Q(e,6)}}case`month`:return{from:ku(n),to:Au(n)};case`quarter`:{let e=ju(n);return{from:e,to:Q(Tu(e,3),-1)}}case`year`:{let e=Mu(n,t.fiscalYearStartMonth??1);return{from:e,to:Q(Tu(e,12),-1)}}case`last7`:return{from:Q(n,-6),to:n};case`last30`:return{from:Q(n,-29),to:n};case`last90`:return{from:Q(n,-89),to:n};case`last12m`:return{from:Q(Tu(n,-12),1),to:n};case`all`:return{from:`1970-01-01`,to:`2999-12-31`};default:return{from:ku(n),to:Au(n)}}}function Pu(e,t){if(e.from===ku(e.from)&&e.to===Au(e.to)){let n=Fu(e.from,e.to)+1,r=Tu(e.from,t*n);return{from:r,to:Au(Tu(r,n-1))}}let n=Du(e.from,e.to)+1;return{from:Q(e.from,t*n),to:Q(e.to,t*n)}}function Fu(e,t){let n=Z(e),r=Z(t);return(r.getUTCFullYear()-n.getUTCFullYear())*12+(r.getUTCMonth()-n.getUTCMonth())}function Iu(e,t={}){for(let n of[`today`,`week`,`month`,`quarter`,`year`,`last30`,`last12m`]){let r=Nu(n,t);if(r.from===e.from&&r.to===e.to)return n}return`custom`}function Lu(e){return(e.toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).replace(/^[^a-z]+/,``)||`field`).slice(0,40)}var Ru=[`#5B8DEF`,`#E0A458`,`#4FB286`,`#D96C8A`,`#8F7EE7`,`#44B3C2`,`#C98E3A`,`#9A9FAD`];function zu(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=parseInt(t[1],16);return[n>>16&255,n>>8&255,n&255]}function Bu([e,t,n]){return`#${[e,t,n].map(e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`)).join(``)}`}function Vu(e){let t=zu(e);if(!t)return 0;let[n,r,i]=t.map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*n+.7152*r+.0722*i}function Hu(e){return Vu(e)>.4?`#15181e`:`#ffffff`}function Uu(e,t){let n=zu(e);return n?Bu(n.map(e=>e+(255-e)*t)):e}function Wu(e,t){let n=zu(e);return n?`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t})`:e}function Gu(e){let t=Vu(e)<.18?Uu(e,.35):e;return{"--brand":e,"--brand-ink":Hu(e),"--brand-accent":e,"--brand-accent-dark":t,"--brand-soft":Wu(e,.12),"--brand-soft-dark":Wu(t,.18),"--brand-focus":Wu(e,.35),"--brand-focus-dark":Wu(t,.45)}}var Ku=/cash|كاش|نقد/i;function qu(e){return e.type===`CASH`||Ku.test(e.name)}function Ju(e,t){return e?t===`ar`&&e.nameAr?e.nameAr:e.name:``}function Yu(e,t){return t===`ar`&&e.labelAr?e.labelAr:e.label}var Xu={Overview:`نظرة عامة`,Insights:`تحليلات`,Expenses:`المصروفات`,Revenue:`الإيرادات`,Stakeholders:`الشركاء`,Categories:`التصنيفات`,"Payment methods":`طرق الدفع`,Recurring:`المتكررة`,"Import & export":`استيراد وتصدير`,Settings:`الإعدادات`,More:`المزيد`,Project:`المشروع`,"Add expense":`إضافة مصروف`,"Add revenue":`إضافة إيراد`,"Settle up":`تسوية`,Add:`إضافة`,Menu:`القائمة`,Close:`إغلاق`,"Sign out":`تسجيل الخروج`,Admin:`مسؤول`,"Local, no sign-in":`محلي، بدون تسجيل دخول`,Theme:`المظهر`,Auto:`تلقائي`,Light:`فاتح`,Dark:`داكن`,Language:`اللغة`,English:`English`,Arabic:`العربية`,"{n} partners":`{n} شركاء`,Day:`يوم`,Week:`أسبوع`,Month:`شهر`,Quarter:`ربع سنة`,Year:`سنة`,"30d":`٣٠ يوم`,"12m":`١٢ شهر`,"Previous period":`الفترة السابقة`,"Next period":`الفترة التالية`,"Custom range":`فترة مخصصة`,From:`من`,To:`إلى`,Apply:`تطبيق`,Cancel:`إلغاء`,"Last 7 days":`آخر ٧ أيام`,"Last 90 days":`آخر ٩٠ يوم`,"All time":`كل الفترات`,Today:`اليوم`,"This week":`هذا الأسبوع`,"This month":`هذا الشهر`,"This quarter":`هذا الربع`,"This year":`هذه السنة`,"Last 30 days":`آخر ٣٠ يوم`,"Last 12 months":`آخر ١٢ شهر`,Save:`حفظ`,"Save changes":`حفظ التغييرات`,Delete:`حذف`,Edit:`تعديل`,Remove:`إزالة`,Archive:`أرشفة`,Restore:`استعادة`,Loading:`جارٍ التحميل`,"Loading…":`جارٍ التحميل…`,Prev:`السابق`,Next:`التالي`,"{from}–{to} of {total}":`{from}–{to} من {total}`,Actions:`إجراءات`,Yes:`نعم`,No:`لا`,Optional:`اختياري`,Search:`بحث`,Filters:`فلاتر`,Clear:`مسح`,Export:`تصدير`,Excel:`إكسل`,CSV:`CSV`,"Export CSV":`تصدير CSV`,"Excel (.xlsx), with dropdowns":`إكسل (.xlsx) مع قوائم منسدلة`,"All categories":`كل التصنيفات`,"All payment methods":`كل طرق الدفع`,"Clear search":`مسح البحث`,"Company account":`حساب الشركة`,Company:`الشركة`,Uncategorised:`بدون تصنيف`,Unspecified:`غير محدد`,Other:`أخرى`,"Other ({n})":`أخرى ({n})`,"Nothing in this range":`لا شيء في هذه الفترة`,default:`افتراضي`,archived:`مؤرشف`,active:`نشط`,inactive:`غير نشط`,paused:`متوقف`,due:`مستحق`,required:`إلزامي`,recurring:`متكرر`,"custom split":`تقسيم مخصص`,Name:`الاسم`,"Arabic name":`الاسم بالعربية`,"Shown when the app is in Arabic; English is used if left blank.":`يظهر عندما يكون التطبيق بالعربية؛ يُستخدم الاسم الإنجليزي إذا تُرك فارغًا.`,Date:`التاريخ`,Amount:`المبلغ`,Total:`الإجمالي`,Description:`الوصف`,Category:`التصنيف`,Notes:`ملاحظات`,Vendor:`المورّد`,Source:`المصدر`,"Paid by":`دفعها`,"Received by":`استلمها`,Payment:`الدفع`,"Payment method":`طريقة الدفع`,Colour:`اللون`,Email:`البريد الإلكتروني`,Password:`كلمة المرور`,"Sign in":`تسجيل الدخول`,"Sign in to continue":`سجّل الدخول للمتابعة`,"Email me a magic link instead":`أرسل لي رابط دخول بالبريد بدلًا من ذلك`,"Only admins of this project can sign in.":`يمكن لمسؤولي هذا المشروع فقط تسجيل الدخول.`,"Magic link sent. Check your inbox.":`تم إرسال رابط الدخول. تحقق من بريدك.`},Zu={"Crunching the numbers":`جارٍ حساب الأرقام`,"Could not load analytics":`تعذّر تحميل التحليلات`,Cashflow:`التدفق النقدي`,"No entries in this range":`لا توجد قيود في هذه الفترة`,"Where the money went":`أين ذهبت الأموال`,All:`الكل`,Partners:`الشركاء`,"Balances for this period":`الأرصدة لهذه الفترة`,Budgets:`الميزانيات`,"Largest expenses":`أكبر المصروفات`,"Largest revenue":`أكبر الإيرادات`,"Revenue by category":`الإيرادات حسب التصنيف`,"Expenses by category":`المصروفات حسب التصنيف`,"No revenue in this range":`لا توجد إيرادات في هذه الفترة`,"No expenses in this range":`لا توجد مصروفات في هذه الفترة`,"Revenue by payment method":`الإيرادات حسب طريقة الدفع`,"How customers paid":`كيف دفع العملاء`,Manage:`إدارة`,"Expenses by payment method":`المصروفات حسب طريقة الدفع`,"How you paid":`كيف دفعتم`,"no previous period":`لا توجد فترة سابقة`,"vs previous":`مقابل الفترة السابقة`,"Net result":`صافي النتيجة`,Margin:`هامش الربح`,Net:`الصافي`,Profit:`الربح`,"{n} entries":`{n} قيد`,"No partners yet":`لا يوجد شركاء بعد`,"Add stakeholders and their ownership share to start splitting expenses.":`أضف الشركاء وحصص ملكيتهم لبدء تقسيم المصروفات.`,"Add partners":`إضافة شركاء`,"Paid {paid} · share {share}":`دفع {paid} · الحصة {share}`,profit:`الربح`,"is owed":`مستحق له`,owes:`عليه`,settled:`مُسوّى`,"No budgets":`لا توجد ميزانيات`,"Set a monthly budget on an expense category to track it here.":`حدّد ميزانية شهرية لتصنيف مصروفات لمتابعتها هنا.`,"{amount} left":`متبقٍ {amount}`,"{amount} over budget":`تجاوز الميزانية بـ {amount}`,Both:`كلاهما`,"Slice the ledger by category, payment method and partner, compared with the previous period.":`قسّم الدفتر حسب التصنيف وطريقة الدفع والشريك، مقارنةً بالفترة السابقة.`,"Partner: all":`الشريك: الكل`,expense:`مصروف`,revenue:`إيراد`,"Slicing the ledger":`جارٍ تحليل الدفتر`,"Could not load insights":`تعذّر تحميل التحليلات`,"Per day":`في اليوم`,"{n} entries · avg {avg}":`{n} قيد · المتوسط {avg}`,"no revenue":`لا توجد إيرادات`,"margin {pct}":`هامش الربح {pct}`,"{active} of {days} days active":`{active} من {days} يوم نشط`,"best {date} · {amount}":`الأفضل {date} · {amount}`,Trend:`الاتجاه`,"By {granularity} · dotted line is the previous period ({from} – {to})":`حسب {granularity} · الخط المنقّط هو الفترة السابقة ({from} – {to})`,day:`اليوم`,week:`الأسبوع`,month:`الشهر`,"No revenue":`لا توجد إيرادات`,"No expenses":`لا توجد مصروفات`,"By payment method":`حسب طريقة الدفع`,"Revenue and expenses combined":`الإيرادات والمصروفات معًا`,"By partner":`حسب الشريك`,"Received by / paid by":`استلمها / دفعها`,"Weekday pattern":`نمط أيام الأسبوع`,"Average per day of the week":`المتوسط لكل يوم من أيام الأسبوع`,"Month by month":`شهرًا بشهر`,Entries:`القيود`,"Nothing here":`لا شيء هنا`,"in {in} / out {out}":`وارد {in} / صادر {out}`,"Prev. revenue":`إيرادات الفترة السابقة`,"Prev. expenses":`مصروفات الفترة السابقة`,"Week of {date}":`أسبوع {date}`,"{day} · {n} days":`{day} · {n} يوم`,"Avg revenue":`متوسط الإيرادات`,"Avg expenses":`متوسط المصروفات`,Monday:`الاثنين`,Tuesday:`الثلاثاء`,Wednesday:`الأربعاء`,Thursday:`الخميس`,Friday:`الجمعة`,Saturday:`السبت`,Sunday:`الأحد`,"by {granularity}":`حسب {granularity}`,Cumulative:`التراكمي`,"Expense deleted":`تم حذف المصروف`,"Revenue deleted":`تم حذف الإيراد`,"Delete failed":`فشل الحذف`,"{n} expenses deleted":`تم حذف {n} مصروف`,"{n} entries deleted":`تم حذف {n} قيد`,"Split recomputed":`تمت إعادة حساب التقسيم`,"Recompute failed":`فشلت إعادة الحساب`,"Export failed":`فشل التصدير`,"Re-split {n} ownership-mode expenses":`تمت إعادة تقسيم {n} مصروف حسب الملكية`,"across {n} entries":`في {n} قيد`,"Done selecting":`إنهاء التحديد`,"Select entries":`تحديد قيود`,"Re-split range by current ownership":`إعادة تقسيم الفترة حسب الملكية الحالية`,"Delete {n} selected":`حذف {n} المحددة`,"New expense":`مصروف جديد`,"New revenue":`إيراد جديد`,"Deselect all on page":`إلغاء تحديد كل الصفحة`,"Select all on page":`تحديد كل الصفحة`,Done:`تم`,"Delete {n}":`حذف {n}`,"Nothing matches this period and filters.":`لا شيء يطابق هذه الفترة والفلاتر.`,"Select all":`تحديد الكل`,Select:`تحديد`,"No expenses match. Try a wider period or clear filters.":`لا توجد مصروفات مطابقة. جرّب فترة أوسع أو امسح الفلاتر.`,"No revenue in this period.":`لا توجد إيرادات في هذه الفترة.`,"Edit {method} amount":`تعديل مبلغ {method}`,"Add {method}":`إضافة {method}`,"Re-split by current ownership":`إعادة التقسيم حسب الملكية الحالية`,"Re-split":`إعادة التقسيم`,"Delete this expense?":`حذف هذا المصروف؟`,"Delete this revenue entry?":`حذف هذا الإيراد؟`,"{description} · {amount} on {date}.":`{description} · {amount} بتاريخ {date}.`,"{description} · {amount} on {date}":`{description} · {amount} بتاريخ {date}`,"Delete {n} expenses?":`حذف {n} مصروف؟`,"Delete {n} entries?":`حذف {n} قيد؟`,"This cannot be undone. Export first if you want a copy.":`لا يمكن التراجع عن هذا. صدّر البيانات أولًا إن أردت نسخة.`,"This cannot be undone.":`لا يمكن التراجع عن هذا.`,"Split (custom)":`التقسيم (مخصص)`,"Split (by ownership)":`التقسيم (حسب الملكية)`,"No stakeholders at the time of entry.":`لم يكن هناك شركاء وقت الإدخال.`,"{n} active partners":`{n} شريك نشط`,ownership:`الملكية`,"Record settlement":`تسجيل تسوية`,"New stakeholder":`شريك جديد`,"Ownership adds up to":`مجموع الملكية`,"Splits use the active total, but you probably want 100%.":`تستخدم التقسيمات المجموع النشط، لكن الأرجح أنك تريد 100%.`,"{pct}% is unassigned.":`{pct}% غير مخصصة.`,"It is {pct}% over.":`يتجاوز بنسبة {pct}%.`,Ownership:`الملكية`,Balances:`الأرصدة`,Settlements:`التسويات`,"Stakeholder removed":`تمت إزالة الشريك`,"Could not remove":`تعذّرت الإزالة`,"Cap table":`جدول الملكية`,"No stakeholders yet":`لا يوجد شركاء بعد`,"Add the partners and their ownership percentage.":`أضف الشركاء ونسبة ملكية كل منهم.`,"since {date}":`منذ {date}`,"No contact details":`لا توجد بيانات اتصال`,"{pct}% ownership":`ملكية {pct}%`,Joined:`تاريخ الانضمام`,"Remove anyway":`إزالة على أي حال`,"Remove {name}?":`إزالة {name}؟`,"This stakeholder has expense splits, payments or settlements. Removing them deletes their split rows and un-assigns what they paid. Prefer marking them inactive.":`لهذا الشريك تقسيمات مصروفات أو مدفوعات أو تسويات. إزالته تحذف صفوف تقسيمه وتُلغي ربط ما دفعه. يُفضّل تعيينه غير نشط.`,"If they have history you will be asked to confirm again. Consider marking them inactive instead.":`إذا كان له سجل سابق سيُطلب منك التأكيد مرة أخرى. فكّر في تعيينه غير نشط بدلًا من ذلك.`,"Could not load balances":`تعذّر تحميل الأرصدة`,"Who owes whom":`من يدين لمن`,"Expenses {total} in this period · company paid {pool}":`المصروفات {total} في هذه الفترة · دفعت الشركة {pool}`,Co:`شركة`,"Share {share} · paid {paid}":`الحصة {share} · دفع {paid}`,"settled {out} / {in}":`التسويات {out} / {in}`,"Net = paid − share of expenses + settlements paid − settlements received. The company row is the shared account. All rows sum to zero.":`الصافي = المدفوع − الحصة من المصروفات + التسويات المدفوعة − التسويات المستلمة. صف الشركة هو الحساب المشترك. مجموع كل الصفوف يساوي صفرًا.`,"Fewest transfers to clear everything":`أقل عدد من التحويلات لتسوية كل شيء`,"All square":`الحسابات مسوّاة`,"Nobody owes anyone for this period.":`لا أحد يدين لأحد في هذه الفترة.`,Record:`تسجيل`,"No settlements":`لا توجد تسويات`,"Record one from the Balances tab when a partner pays someone back.":`سجّل تسوية من تبويب الأرصدة عندما يسدّد شريك لأحد.`,"Settlement deleted":`تم حذف التسوية`,"Delete this settlement?":`حذف هذه التسوية؟`,"Could not load distribution":`تعذّر تحميل التوزيع`,"Each partner's share":`حصة كل شريك`,"By current ownership · shares total {pct}":`حسب الملكية الحالية · مجموع الحصص {pct}`,"Revenue {rev} · expenses {exp}":`الإيرادات {rev} · المصروفات {exp}`,"profit share":`حصة الربح`,"No active stakeholders":`لا يوجد شركاء نشطون`,"Uses current ownership shares for the selected period. Individual expense splits are snapshots and may differ if ownership changed.":`يستخدم حصص الملكية الحالية للفترة المحددة. تقسيمات المصروفات الفردية لقطات ثابتة وقد تختلف إذا تغيّرت الملكية.`,"Expense updated":`تم تحديث المصروف`,"Expense added":`تمت إضافة المصروف`,"Could not save expense":`تعذّر حفظ المصروف`,"Edit expense":`تعديل مصروف`,"{method} amount":`مبلغ {method}`,"default method":`الطريقة الافتراضية`,"Add {methods} amounts":`إضافة مبالغ {methods}`,"What for":`الغرض`,"e.g. Hosting, payroll, flight tickets":`مثال: استضافة، رواتب، تذاكر طيران`,"Select…":`اختر…`,"Hide vendor & notes":`إخفاء المورّد والملاحظات`,"Add vendor & notes":`إضافة المورّد والملاحظات`,"Revenue updated":`تم تحديث الإيراد`,"Revenue added":`تمت إضافة الإيراد`,"Could not save revenue":`تعذّر حفظ الإيراد`,"Edit revenue":`تعديل إيراد`,"Invoice, sale, day's takings…":`فاتورة، مبيعات، إيراد اليوم…`,"Hide source & notes":`إخفاء المصدر والملاحظات`,"Add source & notes":`إضافة المصدر والملاحظات`,"client, platform…":`عميل، منصة…`,"Settlement recorded":`تم تسجيل التسوية`,"Could not save settlement":`تعذّر حفظ التسوية`,"Edit settlement":`تعديل تسوية`,"A payment between partners (or into the company pool) that reduces what someone owes.":`دفعة بين الشركاء (أو إلى حساب الشركة) تقلّل ما يدين به أحدهم.`,"From (payer)":`من (الدافع)`,"To (receiver)":`إلى (المستلم)`,"Company pool":`حساب الشركة`,Note:`ملاحظة`,"Bank transfer ref, cash, …":`رقم التحويل البنكي، نقدًا، …`,"Stakeholder updated":`تم تحديث الشريك`,"Stakeholder added":`تمت إضافة الشريك`,"Could not save":`تعذّر الحفظ`,"Edit stakeholder":`تعديل شريك`,"Ownership share drives default expense splits and profit distribution.":`حصة الملكية تحدد التقسيم الافتراضي للمصروفات وتوزيع الأرباح.`,"Add stakeholder":`إضافة شريك`,optional:`اختياري`,"Ownership share":`حصة الملكية`,"Active partner":`شريك نشط`,"Included in ownership splits and distribution":`مشمول في تقسيمات الملكية والتوزيع`,"Kept for history, excluded from new splits":`محفوظ للسجل، مستثنى من التقسيمات الجديدة`,Split:`التقسيم`,"By ownership":`حسب الملكية`,Custom:`مخصص`,"No active stakeholders yet. Add partners first.":`لا يوجد شركاء نشطون بعد. أضف الشركاء أولًا.`,"— must equal 100%":`— يجب أن يساوي 100%`,"Split equally":`تقسيم بالتساوي`,"{method} amount saved":`تم حفظ مبلغ {method}`,"{method} amount removed":`تمت إزالة مبلغ {method}`,"Add {method} amount":`إضافة مبلغ {method}`,"New total":`الإجمالي الجديد`,"{label}: anyone":`{label}: أي شخص`},Qu={All:`الكل`,"{n} selected":`{n} محددة`,"Nothing to filter by yet.":`لا يوجد ما يمكن الفلترة به بعد.`,"Clear {label}":`مسح {label}`,"· {days}d":`· {days} يوم`,"Custom colour":`لون مخصص`,"Custom fields":`الحقول المخصصة`,optional:`اختياري`,Active:`نشط`,Failed:`فشل`,"Could not save":`تعذر الحفظ`,"Could not delete":`تعذر الحذف`,"Delete failed":`فشل الحذف`,"Add one":`أضف واحدًا`,Archived:`المؤرشفة`,Expense:`مصروف`,"Remove as default":`إزالة كافتراضي`,"Make default":`تعيين كافتراضي`,"Delete {name}?":`حذف {name}؟`,"Delete “{name}”?":`حذف «{name}»؟`,"Default for new entries":`الافتراضي للقيود الجديدة`,"Archived: hidden from forms, history kept":`مؤرشف: مخفي من النماذج مع الاحتفاظ بالسجل`,"Group entries and set monthly budgets on expenses.":`جمّع القيود وحدد ميزانيات شهرية للمصروفات.`,"New category":`تصنيف جديد`,"No expense categories":`لا توجد تصنيفات مصروفات`,"No revenue categories":`لا توجد تصنيفات إيرادات`,"Budget {amount} / month":`الميزانية {amount} / شهر`,"No budget":`بدون ميزانية`,"Budgets this month":`ميزانيات هذا الشهر`,"No budgets yet":`لا توجد ميزانيات بعد`,"Edit an expense category and set a monthly budget.":`عدّل تصنيف مصروفات وحدد له ميزانية شهرية.`,"{pct} used":`استُخدم {pct}`,"{amount} left":`متبقٍ {amount}`,"{amount} over":`تجاوز بمقدار {amount}`,"Category deleted":`تم حذف التصنيف`,"Only possible when no entries use it. Otherwise archive it instead.":`ممكن فقط إذا لم تستخدمه أي قيود. وإلا قم بأرشفته بدلًا من ذلك.`,"Category updated":`تم تحديث التصنيف`,"Category added":`تمت إضافة التصنيف`,"Could not save category":`تعذر حفظ التصنيف`,"Edit category":`تعديل التصنيف`,"New expense category":`تصنيف مصروفات جديد`,"New revenue category":`تصنيف إيرادات جديد`,"Add category":`إضافة تصنيف`,"Monthly budget":`الميزانية الشهرية`,"Preselected when adding an expense. Only one expense category can be the default.":`يُختار تلقائيًا عند إضافة مصروف. تصنيف مصروفات واحد فقط يمكن أن يكون الافتراضي.`,"Preselected when adding revenue. Only one revenue category can be the default.":`يُختار تلقائيًا عند إضافة إيراد. تصنيف إيرادات واحد فقط يمكن أن يكون الافتراضي.`,"Shown in forms and filters":`يظهر في النماذج والفلاتر`,"Cash, cards, online… Each expense and revenue row can hold an amount per method. Shown in tables, analytics and exports.":`كاش، بطاقات، دفع إلكتروني… يمكن لكل مصروف أو إيراد أن يحمل مبلغًا لكل طريقة. تظهر في الجداول والتحليلات والتصدير.`,"New method":`طريقة جديدة`,"No payment methods yet":`لا توجد طرق دفع بعد`,"Add the ways this project gets paid. Pick from the suggestions or create your own.":`أضف الطرق التي يتلقى بها هذا المشروع المدفوعات. اختر من المقترحات أو أنشئ طريقتك.`,"Quick add":`إضافة سريعة`,"Common ones, one tap each":`الأكثر شيوعًا، بضغطة واحدة`,"Could not add":`تعذرت الإضافة`,"All suggestions are already added.":`كل المقترحات مضافة بالفعل.`,"Payment method deleted":`تم حذف طريقة الدفع`,"Only possible when no revenue uses it. Otherwise archive it instead.":`ممكن فقط إذا لم تستخدمها أي إيرادات. وإلا قم بأرشفتها بدلًا من ذلك.`,"Payment method updated":`تم تحديث طريقة الدفع`,"Payment method added":`تمت إضافة طريقة الدفع`,"Edit payment method":`تعديل طريقة الدفع`,"New payment method":`طريقة دفع جديدة`,"Cash, Visa, Instapay, PayPal…":`كاش، فيزا، إنستاباي، PayPal…`,"The expense and revenue forms ask for this method's amount first. Only one method can be the default.":`تطلب نماذج المصروفات والإيرادات مبلغ هذه الطريقة أولًا. طريقة واحدة فقط يمكن أن تكون الافتراضية.`,"Shown in forms, filters and exports":`تظهر في النماذج والفلاتر والتصدير`,"Every day":`كل يوم`,"Every week":`كل أسبوع`,"Every month":`كل شهر`,"Every quarter":`كل ربع سنة`,"Every year":`كل سنة`,"Every {n} days":`كل {n} يوم`,"Every {n} weeks":`كل {n} أسبوع`,"Every {n} months":`كل {n} شهر`,"Every {n} quarters":`كل {n} ربع سنة`,"Every {n} years":`كل {n} سنة`,"Generated {n} entries":`تم إنشاء {n} قيود`,"Generated {n}":`تم إنشاء {n}`,"Nothing due right now":`لا شيء مستحق الآن`,"Nothing due":`لا شيء مستحق`,"Run failed":`فشل التشغيل`,"Rent, retainers, subscriptions: added automatically when due.":`الإيجار، العقود الشهرية، الاشتراكات: تُضاف تلقائيًا عند استحقاقها.`,"Run due now":`تشغيل المستحق الآن`,"New rule":`قاعدة جديدة`,"No recurring rules":`لا توجد قواعد متكررة`,"Create one for rent, salaries or retainers and ledgr adds the entries on schedule.":`أنشئ قاعدة للإيجار أو المرتبات أو العقود الشهرية وسيضيف ledgr القيود في موعدها.`,"next {date}":`التالي {date}`,"ends {date}":`ينتهي {date}`,"{n} generated":`تم إنشاء {n}`,"Run now":`تشغيل الآن`,Pause:`إيقاف مؤقت`,Resume:`استئناف`,"Rule deleted":`تم حذف القاعدة`,"Entries already generated stay in the ledger.":`القيود التي أُنشئت بالفعل تبقى في الدفتر.`,Daily:`يوميًا`,Weekly:`أسبوعيًا`,Monthly:`شهريًا`,Quarterly:`كل ربع سنة`,Yearly:`سنويًا`,"Rule updated":`تم تحديث القاعدة`,"Recurring rule created":`تم إنشاء القاعدة المتكررة`,"Could not save rule":`تعذر حفظ القاعدة`,"Edit recurring rule":`تعديل القاعدة المتكررة`,"New recurring rule":`قاعدة متكررة جديدة`,"Entries are generated automatically when they come due (checked hourly and on start).":`تُنشأ القيود تلقائيًا عند استحقاقها (يتم التحقق كل ساعة وعند بدء التشغيل).`,"Create rule":`إنشاء القاعدة`,"Rule name":`اسم القاعدة`,"Office rent":`إيجار المكتب`,Frequency:`التكرار`,Every:`كل`,n:`عدد`,"First occurrence":`أول مرة`,Ends:`ينتهي`,"Generates entries when due":`تُنشئ القيود عند الاستحقاق`,"Paused: nothing is generated":`متوقفة: لا يُنشأ شيء`,"Entry template":`نموذج القيد`,"Select…":`اختر…`,"Company pool":`رصيد الشركة`,"blank = default":`فارغ = الافتراضية`,"Default method":`الطريقة الافتراضية`,Text:`نص`,Number:`رقم`,Money:`مبلغ مالي`,"Yes / no":`نعم / لا`,"Select (options)":`اختيار (خيارات)`,text:`نص`,number:`رقم`,money:`مبلغ مالي`,date:`تاريخ`,boolean:`نعم / لا`,select:`اختيار`,"New expense field":`حقل مصروفات جديد`,"New revenue field":`حقل إيرادات جديد`,"New stakeholder field":`حقل شركاء جديد`,"Field updated":`تم تحديث الحقل`,"Field added":`تمت إضافة الحقل`,"Could not save field":`تعذر حفظ الحقل`,"Edit custom field":`تعديل الحقل المخصص`,"Add field":`إضافة حقل`,Label:`التسمية`,"Invoice no.":`رقم الفاتورة`,Key:`المفتاح`,"CSV column id":`معرّف عمود CSV`,"Arabic label":`التسمية بالعربية`,Type:`النوع`,Options:`الخيارات`,"one per line":`خيار في كل سطر`,Direct:`مباشر`,Referral:`إحالة`,Required:`إلزامي`,"Changing the type does not convert existing values; incompatible ones are shown as blank.":`تغيير النوع لا يحوّل القيم الحالية؛ القيم غير المتوافقة تظهر فارغة.`,Stakeholder:`شريك`,"No custom fields on expenses":`لا توجد حقول مخصصة للمصروفات`,"No custom fields on revenues":`لا توجد حقول مخصصة للإيرادات`,"No custom fields on stakeholders":`لا توجد حقول مخصصة للشركاء`,"Reorder failed":`فشل إعادة الترتيب`,"New field":`حقل جديد`,"Add columns like “Client”, “Invoice no.” or “Reimbursable”.":`أضف أعمدة مثل «العميل» أو «رقم الفاتورة» أو «قابل للاسترداد».`,"Add a field":`إضافة حقل`,"Move up":`تحريك لأعلى`,"Move down":`تحريك لأسفل`,"Field deleted":`تم حذف الحقل`,"Delete field “{name}”?":`حذف الحقل «{name}»؟`,"Existing values stay in the records but are no longer shown or exported.":`تبقى القيم الحالية في السجلات لكنها لن تُعرض أو تُصدَّر بعد الآن.`,Settlements:`التسويات`,"Could not read file":`تعذرت قراءة الملف`,"Imported {n} {entity}":`تم استيراد {n} من {entity}`,"{n} skipped":`تم تخطي {n}`,"Import failed":`فشل الاستيراد`,"Backup restored":`تمت استعادة النسخة الاحتياطية`,"Restore failed":`فشلت الاستعادة`,"Bulk-load from spreadsheets, export any ledger, back up the whole project.":`استورد من جداول البيانات، صدّر أي دفتر، واحتفظ بنسخة احتياطية من المشروع بالكامل.`,"Import a spreadsheet":`استيراد جدول بيانات`,"Choose an Excel or CSV file":`اختر ملف Excel أو CSV`,"Any column names: you map them next. Dates, money formats and category names are matched for you.":`أي أسماء أعمدة: ستطابقها في الخطوة التالية. التواريخ وصيغ المبالغ وأسماء التصنيفات تُطابَق تلقائيًا.`,"Excel template":`قالب Excel`,"CSV template":`قالب CSV`,"The Excel template has dropdowns for categories, partners and choice fields.":`قالب Excel يحتوي على قوائم منسدلة للتصنيفات والشركاء وحقول الاختيار.`,"Reading…":`جارٍ القراءة…`,"{n} rows":`{n} صف`,"Change file":`تغيير الملف`,Field:`الحقل`,"CSV column":`عمود CSV`,Sample:`عيّنة`,"— skip —":`— تخطي —`,"Date format":`صيغة التاريخ`,"Auto-detect":`اكتشاف تلقائي`,"ISO (YYYY-MM-DD)":`ISO (YYYY-MM-DD)`,"Day / Month / Year":`يوم / شهر / سنة`,"Month / Day / Year":`شهر / يوم / سنة`,"Create missing categories":`إنشاء التصنيفات غير الموجودة`,"Create missing stakeholders (0% share)":`إنشاء الشركاء غير الموجودين (حصة 0%)`,"Skip rows that already exist":`تخطي الصفوف الموجودة بالفعل`,"Map required fields: {fields}":`طابق الحقول الإلزامية: {fields}`,"Ready to import.":`جاهز للاستيراد.`,"Import {n} rows":`استيراد {n} صف`,"{n} inserted":`تم إدراج {n}`,"{n} errors":`{n} أخطاء`,"row {n}":`الصف {n}`,"Excel files keep the dropdowns, so they re-import without typos.":`ملفات Excel تحتفظ بالقوائم المنسدلة، فيُعاد استيرادها دون أخطاء إملائية.`,"{from} → {to}":`{from} → {to}`,"Export failed":`فشل التصدير`,"Backup & restore":`النسخ الاحتياطي والاستعادة`,"One JSON file with every table, custom field and rule. Keep one before big imports.":`ملف JSON واحد يضم كل الجداول والحقول المخصصة والقواعد. احتفظ بنسخة قبل عمليات الاستيراد الكبيرة.`,"Backup failed":`فشل النسخ الاحتياطي`,"Download backup":`تنزيل نسخة احتياطية`,"Restore…":`استعادة…`,"Restore from backup":`استعادة من نسخة احتياطية`,"Restores a ledgr-backup.json. Only allowed into an empty project unless you choose to replace everything.":`يستعيد ملف ledgr-backup.json. مسموح فقط في مشروع فارغ إلا إذا اخترت استبدال كل شيء.`,"Replace all data":`استبدال كل البيانات`,"Wipe current data first (irreversible)":`مسح البيانات الحالية أولًا (لا يمكن التراجع)`,"Share %":`الحصة %`,"Joined at":`تاريخ الانضمام`,Kind:`النوع`,Color:`اللون`,Note:`ملاحظة`,"Stakeholder name; blank = company account":`اسم الشريك؛ فارغ = حساب الشركة`,"Stakeholder name; blank = company pool":`اسم الشريك؛ فارغ = رصيد الشركة`,"expense or revenue":`مصروف أو إيراد`,Branding:`الهوية`,"Make the dashboard look like yours: logo, name and colour. Everyone who opens this project sees it.":`اجعل اللوحة تحمل هويتك: الشعار والاسم واللون. يراها كل من يفتح هذا المشروع.`,Logo:`الشعار`,"Upload logo":`رفع شعار`,"Replace logo":`تغيير الشعار`,"Square works best. PNG, JPEG, WebP, GIF or SVG; raster images are scaled down to 256 px.":`الشكل المربع هو الأفضل. PNG أو JPEG أو WebP أو GIF أو SVG؛ تُصغَّر الصور النقطية إلى 256 بكسل.`,"Could not use that image":`تعذر استخدام هذه الصورة`,"Primary colour":`اللون الأساسي`,Default:`الافتراضي`,"Used for buttons, links, focus rings and the default logo. Leave empty for ledgr's neutral look.":`يُستخدم للأزرار والروابط وحلقات التركيز والشعار الافتراضي. اتركه فارغًا للمظهر الحيادي لـ ledgr.`,"Enter a 6-digit hex colour like #2f5bea.":`أدخل لونًا سداسيًا من 6 خانات مثل #2f5bea.`,"Show the project name instead of “ledgr”":`إظهار اسم المشروع بدلًا من "ledgr"`,"In the sidebar, the browser tab and on the sign-in screen.":`في الشريط الجانبي وعنوان المتصفح وشاشة تسجيل الدخول.`,"Branding updated":`تم تحديث الهوية`,Preview:`معاينة`,"The whole app switches to these colours once you save. Branding is stored in":`يتحول التطبيق كله إلى هذه الألوان بعد الحفظ. تُحفظ الهوية في`,"and included in backups.":`وتُضمَّن في النسخ الاحتياطية.`,Phone:`الهاتف`,"Audit log":`سجل التدقيق`,"Project updated":`تم تحديث المشروع`,Currency:`العملة`,Locale:`الإعدادات المحلية`,formatting:`التنسيق`,"Week starts on":`بداية الأسبوع`,"Fiscal year starts":`بداية السنة المالية`,Sunday:`الأحد`,Monday:`الإثنين`,Tuesday:`الثلاثاء`,Wednesday:`الأربعاء`,Thursday:`الخميس`,Friday:`الجمعة`,Saturday:`السبت`,January:`يناير`,February:`فبراير`,March:`مارس`,April:`أبريل`,May:`مايو`,June:`يونيو`,July:`يوليو`,August:`أغسطس`,September:`سبتمبر`,October:`أكتوبر`,November:`نوفمبر`,December:`ديسمبر`,"Changing currency relabels amounts; it does not convert them.":`تغيير العملة يغيّر تسمية المبالغ فقط ولا يحوّلها.`,Appearance:`الشكل`,"About this project":`عن هذا المشروع`,Auth:`المصادقة`,"Supabase · admins only":`Supabase · للمسؤولين فقط`,"None · local only":`بدون · محلي فقط`,Entries:`القيود`,"{expenses} expenses · {revenue} revenue":`{expenses} مصروفات · {revenue} إيرادات`,Period:`الفترة`,Version:`الإصدار`,"Data lives in":`تُحفظ البيانات في`,"next to this project. Auth settings are in":`بجوار هذا المشروع. إعدادات المصادقة في`,"; restart after changing them.":`؛ أعد التشغيل بعد تغييرها.`,"Add ledgr to your home screen":`أضف ledgr إلى الشاشة الرئيسية`,"Works like an app: full screen, its own icon, quick-add shortcuts.":`يعمل كتطبيق: شاشة كاملة، أيقونة خاصة، واختصارات إضافة سريعة.`,"You are already running ledgr as an installed app.":`أنت تستخدم ledgr بالفعل كتطبيق مثبّت.`,"Install ledgr":`تثبيت ledgr`,"Installed. Open it from your home screen.":`تم التثبيت. افتحه من الشاشة الرئيسية.`,"One tap, no app store.":`ضغطة واحدة، بدون متجر تطبيقات.`,"Open this page in":`افتح هذه الصفحة في`,", tap":`، ثم اضغط`,Share:`مشاركة`,Choose:`اختر`,"Add to Home Screen":`إضافة إلى الشاشة الرئيسية`,"Add to Home screen":`إضافة إلى الشاشة الرئيسية`,", then":`، ثم`,"Open this page in Chrome, tap the":`افتح هذه الصفحة في Chrome، ثم اضغط على`,"⋮ menu":`قائمة ⋮`,or:`أو`,"Install app":`تثبيت التطبيق`,"Quick-add shortcuts":`اختصارات الإضافة السريعة`,"On Android, long-press the installed icon to get the":`على Android، اضغط مطولًا على أيقونة التطبيق لتظهر اختصارات`,and:`و`,"shortcuts.":`مباشرة.`,"On iPhone, add these two links to your home screen the same way (Safari → Share → Add to Home Screen); each opens straight into the form, like a widget:":`على iPhone، أضف هذين الرابطين إلى الشاشة الرئيسية بالطريقة نفسها (Safari ← مشاركة ← إضافة إلى الشاشة الرئيسية)؛ يفتح كل منهما النموذج مباشرة، مثل الودجت:`,Open:`فتح`,"iPhone Shortcuts app users can also create a shortcut that opens one of these URLs and place it as a real home-screen widget.":`يمكن لمستخدمي تطبيق الاختصارات على iPhone أيضًا إنشاء اختصار يفتح أحد هذه الروابط ووضعه كودجت حقيقي على الشاشة الرئيسية.`,"Why not a native widget?":`لماذا لا يوجد ودجت أصلي؟`,"True home-screen widgets need a native iOS/Android app. ledgr is a web app that runs anywhere you host it, so it offers the next best thing: an installable app icon, OS-level shortcuts on Android, and single-purpose links that behave like widgets on iPhone.":`تحتاج ودجتات الشاشة الرئيسية الحقيقية إلى تطبيق iOS/Android أصلي. ledgr تطبيق ويب يعمل أينما استضفته، لذا يقدّم أفضل بديل: أيقونة تطبيق قابلة للتثبيت، واختصارات على مستوى النظام في Android، وروابط أحادية الغرض تعمل كالودجتات على iPhone.`,"All entities":`كل الكيانات`,"All actions":`كل الإجراءات`,"Nothing recorded yet":`لم يُسجَّل شيء بعد`,"no visible change":`لا تغيير ظاهر`,expense:`مصروف`,revenue:`إيراد`,stakeholder:`شريك`,category:`تصنيف`,settlement:`تسوية`,customField:`حقل مخصص`,recurringRule:`قاعدة متكررة`,project:`مشروع`,import:`استيراد`,backup:`نسخة احتياطية`,create:`إنشاء`,update:`تحديث`,delete:`حذف`,settle:`تسوية`,recompute:`إعادة حساب`,generate:`إنشاء تلقائي`,restore:`استعادة`,"Signed in, but not an admin.":`تم تسجيل الدخول، لكنك لست مسؤولًا.`,"Ask the project owner to set":`اطلب من مالك المشروع تعيين`,"on your user (SQL on":`على مستخدمك (عبر SQL على`,"in Supabase), then":`في Supabase)، ثم`,"reload this page":`أعد تحميل هذه الصفحة`,"Wrong account?":`حساب خاطئ؟`,Dashboard:`لوحة التحكم`,"Expense added":`تمت إضافة المصروف`,"Revenue added":`تمت إضافة الإيراد`,"{n} saved this session.":`تم حفظ {n} في هذه الجلسة.`,"Nothing added":`لم تتم الإضافة`,"You closed the form without saving.":`أغلقت النموذج دون حفظ.`,"Add another expense":`إضافة مصروف آخر`,"Add another revenue":`إضافة إيراد آخر`,"Open the expenses list":`فتح قائمة المصروفات`,"Open the revenue list":`فتح قائمة الإيرادات`},$u={Integrations:`التكاملات`,"Pull data from the systems your business already runs on.":`اسحب البيانات من الأنظمة التي يعمل بها نشاطك بالفعل.`,"Could not load integrations":`تعذر تحميل التكاملات`,"Point of sale":`نقطة بيع`,"Keep the item catalogue in sync and turn each closed shift into a revenue row with one tap, cash only by default.":`حافظ على مزامنة قائمة الأصناف وحوّل كل وردية مغلقة إلى قيد إيراد بضغطة واحدة، الكاش فقط افتراضيًا.`,"Connect Loyverse":`ربط Loyverse`,"How it works":`كيف يعمل`,"Create an access token in the Loyverse Back Office and paste it here.":`أنشئ رمز وصول من لوحة تحكم Loyverse والصقه هنا.`,"Sync items to see the catalogue with its categories.":`زامن الأصناف لعرض القائمة بتصنيفاتها.`,"On the Revenue page, tap “Pull last shift” after closing the till.":`في صفحة الإيرادات، اضغط «سحب آخر وردية» بعد إغلاق الكاشير.`,"A personal access token gives ledgr read access to this Loyverse account.":`رمز الوصول الشخصي يمنح ledgr صلاحية قراءة حساب Loyverse هذا.`,"Access token":`رمز الوصول`,"Back Office → Integrations → Access tokens":`لوحة التحكم ← التكاملات ← رموز الوصول`,"The token is stored in this project’s database only. Its currency must match the project currency.":`يُحفظ الرمز في قاعدة بيانات هذا المشروع فقط. ويجب أن تطابق عملته عملة المشروع.`,Connect:`ربط`,Connected:`متصل`,"Connected to {name}":`تم الربط مع {name}`,"{stores} stores · {types} payment types":`{stores} فروع · {types} أنواع دفع`,"Could not connect":`تعذر الربط`,"Replace token":`استبدال الرمز`,Disconnect:`فصل`,"Disconnect Loyverse?":`فصل Loyverse؟`,"The token and the cached catalogue are removed. Revenue rows already pulled stay in the ledger.":`سيُحذف الرمز وقائمة الأصناف المخزنة. قيود الإيراد المسحوبة سابقًا تبقى في الدفتر.`,"Loyverse disconnected":`تم فصل Loyverse`,"Last Loyverse call failed":`فشل آخر اتصال بـ Loyverse`,Stores:`الفروع`,Items:`الأصناف`,"Shifts pulled":`الورديات المسحوبة`,"synced {when}":`زُومن {when}`,"not synced yet":`لم يُزامن بعد`,"last {when}":`آخرها {when}`,"Sync items":`مزامنة الأصناف`,"Items synced":`تمت مزامنة الأصناف`,"{items} items · {categories} categories{removed}":`{items} صنف · {categories} تصنيف{removed}`,"{n} removed":`{n} محذوف`,"Sync failed":`فشلت المزامنة`,"Shift pulls":`سحب الورديات`,"What goes on the revenue row":`ما يُسجّل في قيد الإيراد`,"Payment types to pull":`أنواع الدفع المسحوبة`,cash:`كاش`,card:`بطاقة`,"ledgr payment method":`طريقة الدفع في ledgr`,"→ “{name}” (auto)":`← «{name}» (تلقائي)`,"No payment types found in Loyverse.":`لا توجد أنواع دفع في Loyverse.`,"Cash-like types are summed into one Cash amount. Unticked types stay in Loyverse (shown on the shift, not added to the ledger).":`الأنواع النقدية تُجمع في مبلغ كاش واحد. الأنواع غير المحددة تبقى في Loyverse (تظهر على الوردية ولا تُضاف للدفتر).`,"Revenue category":`تصنيف الإيراد`,"for the shift rows":`لقيود الورديات`,"Default category":`التصنيف الافتراضي`,"Integration settings saved":`تم حفظ إعدادات التكامل`,"Integration settings":`إعدادات التكامل`,"No items yet":`لا توجد أصناف بعد`,"Sync items to see the Loyverse catalogue here with its categories, prices and costs.":`زامن الأصناف لعرض قائمة Loyverse هنا بتصنيفاتها وأسعارها وتكاليفها.`,"{n} items in {c} categories":`{n} صنف في {c} تصنيف`,"All categories":`كل التصنيفات`,"Search items":`ابحث في الأصناف`,"No items match.":`لا توجد أصناف مطابقة.`,Item:`الصنف`,SKU:`الكود`,Price:`السعر`,Cost:`التكلفة`,"{n} variants":`{n} متغيرات`,"Pull last shift":`سحب آخر وردية`,"Re-pull last shift":`إعادة سحب آخر وردية`,"Pull a shift from Loyverse":`سحب وردية من Loyverse`,"Closed shifts, newest first. Only the payment types chosen in the integration settings go on the row.":`الورديات المغلقة، الأحدث أولًا. تُسجَّل فقط أنواع الدفع المختارة في إعدادات التكامل.`,"Asking Loyverse for the latest shifts":`جارٍ طلب آخر الورديات من Loyverse`,"Could not reach Loyverse":`تعذر الوصول إلى Loyverse`,"No closed shifts yet":`لا توجد ورديات مغلقة بعد`,"Close the shift in the Loyverse POS app, then pull it here.":`أغلق الوردية في تطبيق Loyverse ثم اسحبها هنا.`,Refresh:`تحديث`,Pull:`سحب`,"Re-pull":`إعادة سحب`,"Pull another":`سحب وردية أخرى`,"in ledger":`في الدفتر`,"row deleted":`القيد محذوف`,"nothing through the selected payment types":`لا شيء عبر أنواع الدفع المختارة`,"net sales {amount}":`صافي المبيعات {amount}`,"Shift pulled":`تم سحب الوردية`,"Shift added to revenue":`أُضيفت الوردية إلى الإيرادات`,"Shift revenue updated":`تم تحديث إيراد الوردية`,"Could not pull the shift":`تعذر سحب الوردية`,"New revenue row":`قيد إيراد جديد`,"Existing row updated":`تم تحديث القيد الموجود`,"Subtract cash pay-outs":`خصم المصروفات النقدية من الدرج`,"Money taken out of the drawer during the shift (supplies, petty cash) comes off the cash amount.":`المبالغ المسحوبة من الدرج أثناء الوردية (مشتريات، نثريات) تُخصم من مبلغ الكاش.`,"pay-outs −{amount}":`مسحوبات −{amount}`,"Cash pay-outs":`مسحوبات نقدية`,"taken off the cash amount":`مخصومة من الكاش`,"not subtracted":`غير مخصومة`,"Pay-out":`مسحوب`,Receipts:`الفواتير`,"{n} refunds":`{n} مرتجعات`,"Items sold":`الأصناف المباعة`,"Net sales":`صافي المبيعات`,"cost {amount}":`التكلفة {amount}`,"Not pulled into the ledger":`لم يُسحب إلى الدفتر`,"By category":`حسب التصنيف`,"No item lines on these receipts.":`لا توجد بنود أصناف في هذه الفواتير.`,"Could not load the shift sales.":`تعذر تحميل مبيعات الوردية.`,"What sold this shift":`ما بيع في هذه الوردية`,"Loyverse shift · {n} receipts":`وردية Loyverse · {n} فواتير`,"Best sellers":`الأكثر مبيعًا`,"From {n} Loyverse shifts in this range · {qty} items · {amount} net":`من {n} ورديات Loyverse في هذه الفترة · {qty} قطعة · صافي {amount}`,Qty:`الكمية`,Share:`الحصة`,"Sales by category":`المبيعات حسب التصنيف`,"gross margin {pct} after item costs":`هامش إجمالي {pct} بعد تكلفة الأصناف`,"No sales":`لا توجد مبيعات`,"Only expenses a partner paid out of pocket count here":`تُحتسب هنا فقط المصروفات التي دفعها شريك من جيبه`},ed={...Xu,...Zu,...Qu,...$u},td=`ledgr:lang`;function nd(){try{let e=localStorage.getItem(td);if(e===`ar`||e===`en`)return e}catch{}return`en`}function rd(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}var id=(0,g.createContext)(null);function ad({children:e}){let[t,n]=(0,g.useState)(nd);(0,g.useEffect)(()=>{let e=document.documentElement;e.lang=t,e.dir=t===`ar`?`rtl`:`ltr`;try{localStorage.setItem(td,t)}catch{}},[t]);let r=(0,g.useCallback)(e=>n(e),[]),i=(0,g.useMemo)(()=>({lang:t,dir:t===`ar`?`rtl`:`ltr`,setLang:r,t:(e,n)=>rd(t===`ar`?ed[e]??e:e,n),name:e=>Ju(e,t),label:e=>Yu(e,t),intlLocale:e=>t===`ar`?`ar-EG-u-nu-latn`:e}),[t,r]);return(0,_.jsx)(id.Provider,{value:i,children:e})}function od(){let e=(0,g.useContext)(id);if(!e)throw Error(`useI18n outside LangProvider`);return e}var sd=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function cd(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:sd(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ld=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},ud=e=>{let t=ld(e);return t.charAt(0).toUpperCase()+t.slice(1)},dd=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),fd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function pd(e){return e!=null}function md(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??fd.width,a=e.size??e.height??fd.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?dd(...c):dd(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??fd[`stroke-width`])*Number(e.size??e.width??fd.width)/Number(t.size??t.width??fd.width):t.strokeWidth??fd[`stroke-width`];return[`svg`,{...Object.entries(fd).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&pd(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&pd(t.width)&&{[r(`width`)]:t.width},...`height`in t&&pd(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function hd(e,t={}){return md(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var gd=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},_d=(0,g.createContext)({}),vd=()=>(0,g.useContext)(_d),yd=(0,g.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=vd()??{},ee=!!c||gd(d),[te,b,ne=[]]=hd(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??_,className:dd(y,s),hasA11yProp:ee,attributes:d});return(0,g.createElement)(te,{ref:f,...b},[...ne.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function bd(e,t=[],n=[]){let r=typeof e==`string`?cd(e,t,n):e,i=(0,g.forwardRef)(({className:e,...t},n)=>(0,g.createElement)(yd,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ud(r.name)),i}function xd(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function $(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xd(e))&&(r&&(r+=` `),r+=t);return r}function Sd({className:e}){return(0,_.jsxs)(`svg`,{className:$(`animate-spin`,e??`size-4`),viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,children:[(0,_.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.25`,strokeWidth:`3`}),(0,_.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function Cd({title:e,subtitle:t,actions:n}){return(0,_.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-end md:justify-between gap-3 md:gap-4 mb-4 md:mb-5`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`h1`,{className:`text-[24px] md:text-[26px] font-semibold tracking-[-0.02em] leading-tight`,children:e}),t&&(0,_.jsx)(`p`,{className:`text-[13.5px] text-ink-3 mt-1`,children:t})]}),n&&(0,_.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 flex-wrap`,children:n})]})}function wd({title:e,actions:t,children:n,className:r,bodyClassName:i,subtitle:a,flush:o}){return(0,_.jsxs)(`section`,{className:$(`card overflow-hidden flex flex-col`,r),children:[(e||t)&&(0,_.jsxs)(`header`,{className:`flex items-center justify-between gap-3 px-4 md:px-5 pt-4 pb-2 shrink-0`,children:[(0,_.jsxs)(`div`,{className:`min-w-0`,children:[e&&(0,_.jsx)(`h3`,{className:`text-[15px] font-semibold tracking-tight truncate`,children:e}),a&&(0,_.jsx)(`p`,{className:`text-[12.5px] text-ink-3`,children:a})]}),t&&(0,_.jsx)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:t})]}),(0,_.jsx)(`div`,{className:$(`flex-1 min-h-0`,!o&&`px-4 md:px-5 pb-4`,i),children:n})]})}function Td({value:e,onChange:t,items:n,className:r}){return(0,_.jsx)(`div`,{role:`tablist`,className:$(`flex items-center gap-1 p-1 rounded-[14px] bg-sunken w-full md:w-auto overflow-x-auto no-scrollbar`,r),children:n.map(n=>(0,_.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e===n.id,onClick:()=>t(n.id),className:$(`flex-1 md:flex-none h-9 px-3.5 rounded-[11px] text-[13.5px] font-medium transition-colors inline-flex items-center justify-center gap-1.5 whitespace-nowrap`,e===n.id?`bg-card text-ink shadow-sm`:`text-ink-2 hover:text-ink`),children:[n.label,n.count!==void 0&&(0,_.jsx)(`span`,{className:`num text-[12px] text-ink-3`,children:n.count})]},n.id))})}function Ed({value:e,onChange:t,items:n,className:r,size:i=`sm`}){return(0,_.jsx)(`div`,{className:$(`inline-flex items-center gap-0.5 p-0.5 rounded-[11px] bg-sunken`,r),children:n.map(n=>(0,_.jsx)(`button`,{type:`button`,title:n.title,onClick:()=>t(n.id),className:$(`px-3 font-medium transition-colors rounded-[9px] whitespace-nowrap`,i===`xs`?`h-7 text-[12.5px]`:`h-8 text-[13px]`,e===n.id?`bg-card text-ink shadow-sm`:`text-ink-2 hover:text-ink`),children:n.label},n.id))})}function Dd({title:e,description:t,action:n,icon:r}){return(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center text-center py-12 px-6`,children:[r&&(0,_.jsx)(`div`,{className:`text-ink-4 mb-3 [&>svg]:size-8`,children:r}),(0,_.jsx)(`h3`,{className:`text-[15px] font-semibold`,children:e}),t&&(0,_.jsx)(`p`,{className:`text-[13.5px] text-ink-3 mt-1 max-w-sm leading-relaxed`,children:t}),n&&(0,_.jsx)(`div`,{className:`mt-4`,children:n})]})}function Od({label:e}){let{t}=od();return(0,_.jsxs)(`div`,{className:`flex items-center justify-center gap-2 h-40 text-ink-3 text-[14px]`,children:[(0,_.jsx)(Sd,{className:`size-4`}),` `,e??t(`Loading`),`…`]})}function kd({value:e,max:t=100,className:n,color:r}){let i=Math.max(0,Math.min(100,e/t*100)),a=r??(i>=100?`var(--critical)`:i>=85?`var(--warning)`:`var(--s-net)`);return(0,_.jsx)(`div`,{className:$(`h-2 w-full rounded-full overflow-hidden bg-sunken`,n),children:(0,_.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${i}%`,background:a}})})}function Ad({leading:e,title:t,subtitle:n,trailing:r,onClick:i,className:a,selected:o}){return(0,_.jsxs)(i?`button`:`div`,{type:i?`button`:void 0,onClick:i,className:$(`w-full flex items-center gap-3 px-4 py-3 text-start min-h-[60px] transition-colors`,i&&`row-hover pressable`,o&&`bg-accent-soft/50`,a),children:[e,(0,_.jsxs)(`span`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`span`,{className:`block text-[14.5px] font-medium truncate`,children:t}),n&&(0,_.jsx)(`span`,{className:`block text-[12.5px] text-ink-3 truncate`,children:n})]}),r&&(0,_.jsx)(`span`,{className:`shrink-0 text-end`,children:r})]})}function jd({children:e,tone:t=`neutral`,className:n}){return(0,_.jsx)(`span`,{className:$(`inline-flex items-center gap-1 h-6 px-2 rounded-full text-[12px] font-medium whitespace-nowrap`,{neutral:`bg-sunken text-ink-2`,accent:`bg-accent-soft text-accent`,good:`bg-good/10 text-good`,warning:`bg-warning/12 text-warning`,critical:`bg-critical/10 text-critical`,info:`bg-net/10 text-net`,expense:`bg-expense-soft text-expense`,revenue:`bg-revenue-soft text-revenue`}[t],n),children:e})}function Md({color:e,size:t=8,className:n,style:r}){return(0,_.jsx)(`span`,{"aria-hidden":!0,className:$(`inline-block rounded-full shrink-0`,n),style:{width:t,height:t,background:e,...r}})}function Nd({color:e,children:t,className:n}){return(0,_.jsxs)(`span`,{className:$(`inline-flex items-center gap-1.5 text-[13px] text-ink-2 whitespace-nowrap`,n),children:[e&&(0,_.jsx)(Md,{color:e}),t]})}function Pd({name:e,color:t,size:n=28}){let r=e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join(``);return(0,_.jsx)(`span`,{"aria-hidden":!0,className:`inline-flex items-center justify-center rounded-full font-semibold shrink-0`,style:{width:n,height:n,fontSize:Math.round(n*.38),background:`${t}22`,color:t},children:r})}function Fd({color:e,children:t,size:n=36}){return(0,_.jsx)(`span`,{"aria-hidden":!0,className:`inline-flex items-center justify-center rounded-[12px] shrink-0`,style:{width:n,height:n,background:`${e}1f`,color:e},children:t})}export{ue as $,gu as A,dt as B,Jl as C,Iu as D,Du as E,xu as F,He as G,mt as H,Pu as I,Ne as J,Re as K,Lu as L,mu as M,vu as N,_u as O,Nu as P,ie as Q,yu as R,ql as S,Gu as T,vt as U,_t as V,ut as W,ke as X,Me as Y,Oe as Z,ad as _,l as _t,Fd as a,C as at,Ul as b,Ad as c,we as ct,Cd as d,y as dt,le as et,Ed as f,h as ft,bd as g,s as gt,$ as h,o as ht,Md as i,x as it,hu as j,qu as k,Od as l,Se as lt,Sd as m,d as mt,jd as n,ce as nt,wd as o,S as ot,Td as p,p as pt,Le as q,Nd as r,se as rt,Dd as s,pe as st,Pd as t,ye as tt,kd as u,ee as ut,od as v,Su as w,Wl as x,Ru as y,wu as z};
@@ -1 +1 @@
1
- import{dt as e,h as t,i as n,v as r}from"./badge-BTiDEJlh.js";import{n as i}from"./project-Bgpq3nFR.js";import{t as a}from"./format-GDcQVAp4.js";var o=e();function s({items:e,emptyLabel:s=`Nothing in this range`,max:c=7,onSelect:l,selectedId:u}){let{t:d,lang:f}=r(),{money:p}=i();if(!e.length)return(0,o.jsx)(`div`,{className:`flex items-center justify-center text-ink-3 text-[13.5px] py-10`,children:d(s)});let m=e.slice(0,c),h=e.slice(c),g=h.length?[...m,{id:`__other`,name:d(`Other ({n})`,{n:h.length}),color:`var(--s-other)`,amountMinor:h.reduce((e,t)=>e+t.amountMinor,0),pct:h.reduce((e,t)=>e+t.pct,0)}]:m,_=Math.max(...g.map(e=>e.amountMinor),1);return(0,o.jsx)(`ul`,{className:`space-y-3`,children:g.map(e=>(0,o.jsx)(`li`,{children:(0,o.jsxs)(`button`,{type:`button`,className:t(`w-full text-start group`,l&&e.id!==`__other`&&`cursor-pointer`),onClick:()=>l&&e.id!==`__other`&&l(e.id),disabled:!l||e.id===`__other`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[13.5px] mb-1.5`,children:[(0,o.jsxs)(`span`,{className:t(`inline-flex items-center gap-2 truncate`,u===e.id?`text-accent`:`text-ink`),children:[(0,o.jsx)(n,{color:e.color,size:9}),(0,o.jsx)(`span`,{className:`truncate`,children:e.nameAr&&f===`ar`?e.nameAr:d(e.name)}),e.count!==void 0&&(0,o.jsx)(`span`,{className:`num text-[12px] text-ink-3`,children:e.count})]}),(0,o.jsxs)(`span`,{className:`num whitespace-nowrap font-medium`,children:[p(e.amountMinor),` `,(0,o.jsx)(`span`,{className:`text-ink-3 font-normal text-[12px]`,children:a(e.pct,0)})]})]}),(0,o.jsx)(`div`,{className:`h-2 rounded-full bg-sunken overflow-hidden`,children:(0,o.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${e.amountMinor/_*100}%`,background:e.color}})})]})},e.id??e.name))})}export{s as t};
1
+ import{ft as e,h as t,i as n,v as r}from"./badge-DCLlsDNI.js";import{n as i}from"./project-CYHaWZqH.js";import{t as a}from"./format-GDcQVAp4.js";var o=e();function s({items:e,emptyLabel:s=`Nothing in this range`,max:c=7,onSelect:l,selectedId:u}){let{t:d,lang:f}=r(),{money:p}=i();if(!e.length)return(0,o.jsx)(`div`,{className:`flex items-center justify-center text-ink-3 text-[13.5px] py-10`,children:d(s)});let m=e.slice(0,c),h=e.slice(c),g=h.length?[...m,{id:`__other`,name:d(`Other ({n})`,{n:h.length}),color:`var(--s-other)`,amountMinor:h.reduce((e,t)=>e+t.amountMinor,0),pct:h.reduce((e,t)=>e+t.pct,0)}]:m,_=Math.max(...g.map(e=>e.amountMinor),1);return(0,o.jsx)(`ul`,{className:`space-y-3`,children:g.map(e=>(0,o.jsx)(`li`,{children:(0,o.jsxs)(`button`,{type:`button`,className:t(`w-full text-start group`,l&&e.id!==`__other`&&`cursor-pointer`),onClick:()=>l&&e.id!==`__other`&&l(e.id),disabled:!l||e.id===`__other`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[13.5px] mb-1.5`,children:[(0,o.jsxs)(`span`,{className:t(`inline-flex items-center gap-2 truncate`,u===e.id?`text-accent`:`text-ink`),children:[(0,o.jsx)(n,{color:e.color,size:9}),(0,o.jsx)(`span`,{className:`truncate`,children:e.nameAr&&f===`ar`?e.nameAr:d(e.name)}),e.count!==void 0&&(0,o.jsx)(`span`,{className:`num text-[12px] text-ink-3`,children:e.count})]}),(0,o.jsxs)(`span`,{className:`num whitespace-nowrap font-medium`,children:[p(e.amountMinor),` `,(0,o.jsx)(`span`,{className:`text-ink-3 font-normal text-[12px]`,children:a(e.pct,0)})]})]}),(0,o.jsx)(`div`,{className:`h-2 rounded-full bg-sunken overflow-hidden`,children:(0,o.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${e.amountMinor/_*100}%`,background:e.color}})})]})},e.id??e.name))})}export{s as t};
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,dt as r,gt as i,h as a,i as o,l as s,n as c,o as l,p as u,pt as d,s as f,u as p,v as m,y as h}from"./badge-BTiDEJlh.js";import{a as g,i as _,r as v}from"./queries-IGiwF8nF.js";import{n as y}from"./project-Bgpq3nFR.js";import{n as b,r as x,t as S}from"./star-cwF2fEe6.js";import{a as C,i as w,n as T,o as E,r as D,t as ee}from"./menu-BDGd2JUq.js";import{i as O,n as k,r as A,s as j}from"./media-Cr7juL5w.js";import{t as M}from"./money-input-C8ZuBxvX.js";import{c as N,d as P,f as F,l as I,m as L,p as R,y as z}from"./index-DOwVPfdT.js";import{t as B}from"./format-GDcQVAp4.js";import{t as V}from"./color-picker-DLlr-Cq6.js";var H=i(d(),1),U=r();function W({open:e,onClose:t,category:n,kind:r}){let i=L(),{t:a}=m(),{create:o,update:s}=g(),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(h[0]),[_,v]=(0,H.useState)(null),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1);(0,H.useEffect)(()=>{e&&(l(n?.name??``),d(n?.nameAr??``),p(n?.color??h[Math.floor(Math.random()*7)]),v(n?.monthlyBudgetMinor??null),b(n?.archived??!1),S(n?.isDefault??!1))},[e,n]);let C=c.trim().length>0,w=o.isPending||s.isPending,T=async()=>{let e={name:c.trim(),nameAr:u.trim()||null,kind:r,color:f,monthlyBudgetMinor:r===`expense`?_:null,archived:y,isDefault:x};try{n?await s.mutateAsync({id:n.id,...e}):await o.mutateAsync(e),i.success(a(n?`Category updated`:`Category added`)),t()}catch(e){i.error(a(`Could not save category`),R(e))}};return(0,U.jsx)(I,{open:e,onClose:t,title:a(n?`Edit category`:r===`expense`?`New expense category`:`New revenue category`),footer:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(P,{variant:`ghost`,size:`md`,onClick:t,children:a(`Cancel`)}),(0,U.jsx)(P,{variant:`primary`,size:`md`,onClick:T,loading:w,disabled:!C,children:a(n?`Save`:`Add category`)})]}),children:(0,U.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),C&&T()},children:[(0,U.jsx)(A,{label:a(`Name`),required:!0,children:(0,U.jsx)(O,{value:c,onChange:e=>l(e.target.value),autoFocus:!0})}),(0,U.jsx)(A,{label:a(`Arabic name`),hint:a(`optional`),children:(0,U.jsx)(O,{lang:`ar`,dir:`rtl`,value:u,onChange:e=>d(e.target.value),placeholder:`يُستخدم الاسم الإنجليزي إذا تُرك فارغًا`})}),(0,U.jsx)(V,{value:f,onChange:p}),r===`expense`&&(0,U.jsx)(A,{label:a(`Monthly budget`),hint:a(`optional`),children:(0,U.jsx)(M,{value:_,onChange:v})}),(0,U.jsx)(j,{checked:x,onChange:S,label:a(`Default for new entries`),description:a(r===`expense`?`Preselected when adding an expense. Only one expense category can be the default.`:`Preselected when adding revenue. Only one revenue category can be the default.`)}),n&&(0,U.jsx)(j,{checked:!y,onChange:e=>b(!e),label:a(`Active`),description:a(y?`Archived: hidden from forms, history kept`:`Shown in forms and filters`)})]})})}function G(){let[r,i]=(0,H.useState)(`expense`),[d,h]=(0,H.useState)(!1),O=_(r,!0),{update:A,remove:j}=g(),M=L(),{t:I,name:V}=m(),[G,K]=(0,H.useState)(void 0),[q,J]=(0,H.useState)(null),Y=(O.data?.items??[]).filter(e=>d||!e.archived),{range:X}=F(),Z=new Date().toISOString().slice(0,10),Q=v((X.to<Z?X.to:Z).slice(0,7)),{money:$}=y();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n,{title:I(`Categories`),subtitle:I(`Group entries and set monthly budgets on expenses.`),actions:(0,U.jsx)(P,{variant:`primary`,size:`sm`,className:`rounded-full`,icon:(0,U.jsx)(z,{className:`size-4`}),onClick:()=>K(null),children:I(`New category`)})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-4`,children:[(0,U.jsx)(u,{value:r,onChange:i,items:[{id:`expense`,label:I(`Expense`)},{id:`revenue`,label:I(`Revenue`)}],className:`md:w-auto`}),(0,U.jsx)(k,{label:I(`Archived`),checked:d,onChange:e=>h(e.target.checked),className:`shrink-0`})]}),(0,U.jsxs)(`div`,{className:a(`grid grid-cols-1 gap-4`,r===`expense`&&`xl:grid-cols-3`),children:[(0,U.jsx)(l,{className:a(r===`expense`&&`xl:col-span-2`),flush:!0,children:O.isPending?(0,U.jsx)(s,{}):Y.length?(0,U.jsx)(`ul`,{className:`divide-y divide-line`,children:Y.map(n=>(0,U.jsxs)(`li`,{className:a(`flex items-center`,n.archived&&`opacity-60`),children:[(0,U.jsx)(t,{className:`flex-1`,leading:(0,U.jsx)(e,{color:n.color,children:(0,U.jsx)(o,{color:n.color,size:12})}),title:(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[V(n),n.isDefault&&(0,U.jsx)(c,{tone:`accent`,children:I(`default`)}),n.archived&&(0,U.jsx)(c,{children:I(`archived`)})]}),subtitle:r===`expense`?n.monthlyBudgetMinor?I(`Budget {amount} / month`,{amount:$(n.monthlyBudgetMinor)}):I(`No budget`):void 0,onClick:()=>K(n)}),(0,U.jsx)(`div`,{className:`pe-3`,children:(0,U.jsx)(ee,{trigger:()=>(0,U.jsx)(`button`,{type:`button`,className:`size-9 inline-flex items-center justify-center rounded-full text-ink-3 hover:text-ink hover:bg-card-hover`,"aria-label":I(`Actions`),children:(0,U.jsx)(E,{className:`size-4`})}),children:e=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{icon:(0,U.jsx)(C,{}),onClick:()=>{e(),K(n)},children:I(`Edit`)}),!n.archived&&(0,U.jsx)(T,{icon:(0,U.jsx)(S,{}),onClick:async()=>{e();try{await A.mutateAsync({id:n.id,isDefault:!n.isDefault})}catch(e){M.error(I(`Failed`),R(e))}},children:I(n.isDefault?`Remove as default`:`Make default`)}),(0,U.jsx)(T,{icon:n.archived?(0,U.jsx)(x,{}):(0,U.jsx)(b,{}),onClick:async()=>{e();try{await A.mutateAsync({id:n.id,archived:!n.archived})}catch(e){M.error(I(`Failed`),R(e))}},children:I(n.archived?`Restore`:`Archive`)}),(0,U.jsx)(D,{}),(0,U.jsx)(T,{icon:(0,U.jsx)(w,{}),danger:!0,onClick:()=>{e(),J(n)},children:I(`Delete`)})]})})})]},n.id))}):(0,U.jsx)(f,{title:I(r===`expense`?`No expense categories`:`No revenue categories`),action:(0,U.jsx)(P,{variant:`soft`,onClick:()=>K(null),children:I(`Add one`)})})}),r===`expense`&&(0,U.jsx)(l,{title:I(`Budgets this month`),subtitle:Q.data?.month,children:Q.isPending?(0,U.jsx)(s,{}):Q.data?.items.length?(0,U.jsx)(`ul`,{className:`space-y-4`,children:Q.data.items.map(e=>(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-[13.5px] mb-1.5`,children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,U.jsx)(o,{color:e.color,size:9}),V(O.data?.items.find(t=>t.id===e.categoryId)??e)]}),(0,U.jsxs)(`span`,{className:`num`,children:[(0,U.jsx)(`span`,{className:a(`font-medium`,e.pct>=100&&`text-critical`),children:$(e.spentMinor,{compact:!0})}),(0,U.jsxs)(`span`,{className:`text-ink-3`,children:[` / `,$(e.budgetMinor,{compact:!0})]})]})]}),(0,U.jsx)(p,{value:e.pct}),(0,U.jsxs)(`div`,{className:a(`text-[12px] mt-1`,e.pct>=100?`text-critical`:e.pct>=85?`text-warning`:`text-ink-3`),children:[I(`{pct} used`,{pct:B(e.pct,0)}),` · `,e.remainingMinor>=0?I(`{amount} left`,{amount:$(e.remainingMinor)}):I(`{amount} over`,{amount:$(-e.remainingMinor)})]})]},e.categoryId))}):(0,U.jsx)(f,{title:I(`No budgets yet`),description:I(`Edit an expense category and set a monthly budget.`)})})]}),(0,U.jsx)(W,{open:G!==void 0,onClose:()=>K(void 0),category:G??null,kind:r}),(0,U.jsx)(N,{open:!!q,onClose:()=>J(null),onConfirm:async()=>{try{await j.mutateAsync(q.id),M.success(I(`Category deleted`)),J(null)}catch(e){M.error(I(`Could not delete`),R(e))}},loading:j.isPending,title:I(`Delete {name}?`,{name:V(q)}),description:I(`Only possible when no entries use it. Otherwise archive it instead.`)})]})}export{G as CategoriesPage};
1
+ import{_t as e,a as t,c as n,d as r,ft as i,h as a,i as o,l as s,mt as c,n as l,o as u,p as d,s as f,u as p,v as m,y as h}from"./badge-DCLlsDNI.js";import{a as g,i as _,r as v}from"./queries-CxLQqNqz.js";import{n as y}from"./project-CYHaWZqH.js";import{n as b,r as x,t as S}from"./star-DZj1Tpai.js";import{a as C,i as w,n as T,o as E,r as D,t as ee}from"./menu-C-8r2BNA.js";import{i as O,n as k,r as A,s as j}from"./media-D6XgVZ7M.js";import{t as M}from"./money-input-DQaEauAw.js";import{b as N,f as P,h as F,l as I,m as L,p as R,u as z}from"./index-B9WjaP25.js";import{t as B}from"./format-GDcQVAp4.js";import{t as V}from"./color-picker-DUPZPbk3.js";var H=e(c(),1),U=i();function W({open:e,onClose:t,category:n,kind:r}){let i=F(),{t:a}=m(),{create:o,update:s}=g(),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(h[0]),[_,v]=(0,H.useState)(null),[y,b]=(0,H.useState)(!1),[x,S]=(0,H.useState)(!1);(0,H.useEffect)(()=>{e&&(l(n?.name??``),d(n?.nameAr??``),p(n?.color??h[Math.floor(Math.random()*7)]),v(n?.monthlyBudgetMinor??null),b(n?.archived??!1),S(n?.isDefault??!1))},[e,n]);let C=c.trim().length>0,w=o.isPending||s.isPending,T=async()=>{let e={name:c.trim(),nameAr:u.trim()||null,kind:r,color:f,monthlyBudgetMinor:r===`expense`?_:null,archived:y,isDefault:x};try{n?await s.mutateAsync({id:n.id,...e}):await o.mutateAsync(e),i.success(a(n?`Category updated`:`Category added`)),t()}catch(e){i.error(a(`Could not save category`),L(e))}};return(0,U.jsx)(z,{open:e,onClose:t,title:a(n?`Edit category`:r===`expense`?`New expense category`:`New revenue category`),footer:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(P,{variant:`ghost`,size:`md`,onClick:t,children:a(`Cancel`)}),(0,U.jsx)(P,{variant:`primary`,size:`md`,onClick:T,loading:w,disabled:!C,children:a(n?`Save`:`Add category`)})]}),children:(0,U.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),C&&T()},children:[(0,U.jsx)(A,{label:a(`Name`),required:!0,children:(0,U.jsx)(O,{value:c,onChange:e=>l(e.target.value),autoFocus:!0})}),(0,U.jsx)(A,{label:a(`Arabic name`),hint:a(`optional`),children:(0,U.jsx)(O,{lang:`ar`,dir:`rtl`,value:u,onChange:e=>d(e.target.value),placeholder:`يُستخدم الاسم الإنجليزي إذا تُرك فارغًا`})}),(0,U.jsx)(V,{value:f,onChange:p}),r===`expense`&&(0,U.jsx)(A,{label:a(`Monthly budget`),hint:a(`optional`),children:(0,U.jsx)(M,{value:_,onChange:v})}),(0,U.jsx)(j,{checked:x,onChange:S,label:a(`Default for new entries`),description:a(r===`expense`?`Preselected when adding an expense. Only one expense category can be the default.`:`Preselected when adding revenue. Only one revenue category can be the default.`)}),n&&(0,U.jsx)(j,{checked:!y,onChange:e=>b(!e),label:a(`Active`),description:a(y?`Archived: hidden from forms, history kept`:`Shown in forms and filters`)})]})})}function G(){let[e,i]=(0,H.useState)(`expense`),[c,h]=(0,H.useState)(!1),O=_(e,!0),{update:A,remove:j}=g(),M=F(),{t:z,name:V}=m(),[G,K]=(0,H.useState)(void 0),[q,J]=(0,H.useState)(null),Y=(O.data?.items??[]).filter(e=>c||!e.archived),{range:X}=R(),Z=new Date().toISOString().slice(0,10),Q=v((X.to<Z?X.to:Z).slice(0,7)),{money:$}=y();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(r,{title:z(`Categories`),subtitle:z(`Group entries and set monthly budgets on expenses.`),actions:(0,U.jsx)(P,{variant:`primary`,size:`sm`,className:`rounded-full`,icon:(0,U.jsx)(N,{className:`size-4`}),onClick:()=>K(null),children:z(`New category`)})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-4`,children:[(0,U.jsx)(d,{value:e,onChange:i,items:[{id:`expense`,label:z(`Expense`)},{id:`revenue`,label:z(`Revenue`)}],className:`md:w-auto`}),(0,U.jsx)(k,{label:z(`Archived`),checked:c,onChange:e=>h(e.target.checked),className:`shrink-0`})]}),(0,U.jsxs)(`div`,{className:a(`grid grid-cols-1 gap-4`,e===`expense`&&`xl:grid-cols-3`),children:[(0,U.jsx)(u,{className:a(e===`expense`&&`xl:col-span-2`),flush:!0,children:O.isPending?(0,U.jsx)(s,{}):Y.length?(0,U.jsx)(`ul`,{className:`divide-y divide-line`,children:Y.map(r=>(0,U.jsxs)(`li`,{className:a(`flex items-center`,r.archived&&`opacity-60`),children:[(0,U.jsx)(n,{className:`flex-1`,leading:(0,U.jsx)(t,{color:r.color,children:(0,U.jsx)(o,{color:r.color,size:12})}),title:(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[V(r),r.isDefault&&(0,U.jsx)(l,{tone:`accent`,children:z(`default`)}),r.archived&&(0,U.jsx)(l,{children:z(`archived`)})]}),subtitle:e===`expense`?r.monthlyBudgetMinor?z(`Budget {amount} / month`,{amount:$(r.monthlyBudgetMinor)}):z(`No budget`):void 0,onClick:()=>K(r)}),(0,U.jsx)(`div`,{className:`pe-3`,children:(0,U.jsx)(ee,{trigger:()=>(0,U.jsx)(`button`,{type:`button`,className:`size-9 inline-flex items-center justify-center rounded-full text-ink-3 hover:text-ink hover:bg-card-hover`,"aria-label":z(`Actions`),children:(0,U.jsx)(E,{className:`size-4`})}),children:e=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{icon:(0,U.jsx)(C,{}),onClick:()=>{e(),K(r)},children:z(`Edit`)}),!r.archived&&(0,U.jsx)(T,{icon:(0,U.jsx)(S,{}),onClick:async()=>{e();try{await A.mutateAsync({id:r.id,isDefault:!r.isDefault})}catch(e){M.error(z(`Failed`),L(e))}},children:z(r.isDefault?`Remove as default`:`Make default`)}),(0,U.jsx)(T,{icon:r.archived?(0,U.jsx)(x,{}):(0,U.jsx)(b,{}),onClick:async()=>{e();try{await A.mutateAsync({id:r.id,archived:!r.archived})}catch(e){M.error(z(`Failed`),L(e))}},children:z(r.archived?`Restore`:`Archive`)}),(0,U.jsx)(D,{}),(0,U.jsx)(T,{icon:(0,U.jsx)(w,{}),danger:!0,onClick:()=>{e(),J(r)},children:z(`Delete`)})]})})})]},r.id))}):(0,U.jsx)(f,{title:z(e===`expense`?`No expense categories`:`No revenue categories`),action:(0,U.jsx)(P,{variant:`soft`,onClick:()=>K(null),children:z(`Add one`)})})}),e===`expense`&&(0,U.jsx)(u,{title:z(`Budgets this month`),subtitle:Q.data?.month,children:Q.isPending?(0,U.jsx)(s,{}):Q.data?.items.length?(0,U.jsx)(`ul`,{className:`space-y-4`,children:Q.data.items.map(e=>(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-[13.5px] mb-1.5`,children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,U.jsx)(o,{color:e.color,size:9}),V(O.data?.items.find(t=>t.id===e.categoryId)??e)]}),(0,U.jsxs)(`span`,{className:`num`,children:[(0,U.jsx)(`span`,{className:a(`font-medium`,e.pct>=100&&`text-critical`),children:$(e.spentMinor,{compact:!0})}),(0,U.jsxs)(`span`,{className:`text-ink-3`,children:[` / `,$(e.budgetMinor,{compact:!0})]})]})]}),(0,U.jsx)(p,{value:e.pct}),(0,U.jsxs)(`div`,{className:a(`text-[12px] mt-1`,e.pct>=100?`text-critical`:e.pct>=85?`text-warning`:`text-ink-3`),children:[z(`{pct} used`,{pct:B(e.pct,0)}),` · `,e.remainingMinor>=0?z(`{amount} left`,{amount:$(e.remainingMinor)}):z(`{amount} over`,{amount:$(-e.remainingMinor)})]})]},e.categoryId))}):(0,U.jsx)(f,{title:z(`No budgets yet`),description:z(`Edit an expense category and set a monthly budget.`)})})]}),(0,U.jsx)(W,{open:G!==void 0,onClose:()=>K(void 0),category:G??null,kind:e}),(0,U.jsx)(I,{open:!!q,onClose:()=>J(null),onConfirm:async()=>{try{await j.mutateAsync(q.id),M.success(z(`Category deleted`)),J(null)}catch(e){M.error(z(`Could not delete`),L(e))}},loading:j.isPending,title:z(`Delete {name}?`,{name:V(q)}),description:z(`Only possible when no entries use it. Otherwise archive it instead.`)})]})}export{G as CategoriesPage};
@@ -1 +1 @@
1
- import{dt as e,h as t,v as n,y as r}from"./badge-BTiDEJlh.js";var i=e();function a({value:e,onChange:a,label:o}){let{t:s}=n();return(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`span`,{className:`block mb-1.5 text-[13px] font-medium text-ink-2`,children:o??s(`Colour`)}),(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5 h-11 md:h-10`,children:[r.map(n=>(0,i.jsx)(`button`,{type:`button`,"aria-label":n,onClick:()=>a(n),className:t(`size-7 rounded-full border-2 transition-transform hover:scale-110`,e===n?`border-ink scale-110`:`border-transparent`),style:{background:n}},n)),(0,i.jsxs)(`label`,{className:`relative size-7 rounded-full border border-line-strong overflow-hidden cursor-pointer`,title:s(`Custom colour`),children:[(0,i.jsx)(`input`,{type:`color`,value:e,onChange:e=>a(e.target.value),className:`absolute inset-0 opacity-0 cursor-pointer`}),(0,i.jsx)(`span`,{className:`absolute inset-0`,style:{background:`conic-gradient(red, yellow, lime, cyan, blue, magenta, red)`}})]})]})]})}export{a as t};
1
+ import{ft as e,h as t,v as n,y as r}from"./badge-DCLlsDNI.js";var i=e();function a({value:e,onChange:a,label:o}){let{t:s}=n();return(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`span`,{className:`block mb-1.5 text-[13px] font-medium text-ink-2`,children:o??s(`Colour`)}),(0,i.jsxs)(`div`,{className:`flex items-center gap-1.5 h-11 md:h-10`,children:[r.map(n=>(0,i.jsx)(`button`,{type:`button`,"aria-label":n,onClick:()=>a(n),className:t(`size-7 rounded-full border-2 transition-transform hover:scale-110`,e===n?`border-ink scale-110`:`border-transparent`),style:{background:n}},n)),(0,i.jsxs)(`label`,{className:`relative size-7 rounded-full border border-line-strong overflow-hidden cursor-pointer`,title:s(`Custom colour`),children:[(0,i.jsx)(`input`,{type:`color`,value:e,onChange:e=>a(e.target.value),className:`absolute inset-0 opacity-0 cursor-pointer`}),(0,i.jsx)(`span`,{className:`absolute inset-0`,style:{background:`conic-gradient(red, yellow, lime, cyan, blue, magenta, red)`}})]})]})]})}export{a as t};