@objectstack/account 8.0.1 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,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},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var 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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var k=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)},se={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,k)}catch(e){k(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),h=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=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function A(e){return{current:e}}function de(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function fe(e,t){ue++,le[ue]=e.current,e.current=t}var pe=A(null),me=A(null),he=A(null),ge=A(null);function _e(e,t){switch(fe(he,t),fe(me,e),fe(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(pe),fe(pe,e)}function ve(){de(pe),de(me),de(he)}function ye(e){e.memoizedState!==null&&fe(ge,e);var t=pe.current,n=rf(t,e.type);t!==n&&(fe(me,e),fe(pe,n))}function be(e){me.current===e&&(de(pe),de(me)),ge.current===e&&(de(ge),op._currentValue=ce)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,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},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var 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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=ie(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 ae(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var k=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)},se={map:ae,forEach:function(e,t,n){ae(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,k)}catch(e){k(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),h=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=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function A(e){return{current:e}}function de(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function fe(e,t){ue++,le[ue]=e.current,e.current=t}var pe=A(null),me=A(null),he=A(null),ge=A(null);function _e(e,t){switch(fe(he,t),fe(me,e),fe(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(pe),fe(pe,e)}function ve(){de(pe),de(me),de(he)}function ye(e){e.memoizedState!==null&&fe(ge,e);var t=pe.current,n=rf(t,e.type);t!==n&&(fe(me,e),fe(pe,n))}function be(e){me.current===e&&(de(pe),de(me)),ge.current===e&&(de(ge),op._currentValue=ce)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
|
|
2
2
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
3
|
`+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
4
|
`),l=s.split(`
|
|
@@ -6,7 +6,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
6
6
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ce(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce(`Lazy`);case 13:return e.child!==t&&t!==null?Ce(`Suspense Fallback`):Ce(`Suspense`);case 19:return Ce(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Ce(`Activity`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
8
|
`+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,He=null,Ue=null;function We(e){if(typeof Be==`function`&&Ve(e),Ue&&typeof Ue.setStrictMode==`function`)try{Ue.setStrictMode(He,e)}catch{}}var Ge=Math.clz32?Math.clz32:Je,Ke=Math.log,qe=Math.LN2;function Je(e){return e>>>=0,e===0?32:31-(Ke(e)/qe|0)|0}var Ye=256,Xe=262144,Ze=4194304;function Qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $e(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Qe(n))):i=Qe(o):i=Qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Qe(n))):i=Qe(o)):i=Qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function j(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ge(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ge(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ge(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=se.p;return e===0?(e=window.event,e===void 0?32:Sp(e.type)):e}function dt(e,t){var n=se.p;try{return se.p=e,t()}finally{se.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bf(e);e!==null;){if(n=e[pt])return n;e=bf(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Mt={},Nt={};function Pt(e){return Oe.call(Nt,e)?!0:Oe.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}function Ft(e,t,n){if(Pt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function It(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Lt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Rt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vt(e){if(!e._valueTracker){var t=zt(e)?`checked`:`value`;e._valueTracker=Bt(e,t,``+e[t])}}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=zt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ut(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Wt=/[\n"\\]/g;function Gt(e){return e.replace(Wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Kt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Rt(t)):e.value!==``+Rt(t)&&(e.value=``+Rt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Jt(e,o,Rt(n)):Jt(e,o,Rt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Rt(s):e.removeAttribute(`name`)}function qt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Vt(e);return}n=n==null?``:``+Rt(n),t=t==null?n:``+Rt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Vt(e)}function Jt(e,t,n){t===`number`&&Ut(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Rt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Xt(e,t,n){if(t!=null&&(t=``+Rt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Rt(n)}function Zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Rt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Vt(e)}function Qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $t=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function en(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||$t.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function tn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&en(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&en(e,o,t[o])}function nn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var rn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),an=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function on(e){return an.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function sn(){}var cn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var un=null,dn=null;function fn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Kt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Gt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Kt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ht(r)}break a;case`textarea`:Xt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Yt(e,!!n.multiple,t,!1)}}}var pn=!1;function mn(e,t,n){if(pn)return e(t,n);pn=!0;try{return e(t)}finally{if(pn=!1,(un!==null||dn!==null)&&(Iu(),un&&(t=un,e=dn,dn=un=null,fn(t),e)))for(t=0;t<e.length;t++)fn(e[t])}}function hn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var gn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return xn=i.slice(e,1<r?1-r:void 0)}function Cn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function Tn(){return!1}function En(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?wn:Tn,this.isPropagationStopped=Tn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=m({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=m({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(m({},Pn,{dataTransfer:0})),Ln=En(m({},kn,{relatedTarget:0})),Rn=En(m({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(m({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(m({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(m({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(m({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(m({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Yn=En(m({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Xn=En(m({},Pn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Zn=En(m({},Dn,{newState:0,oldState:0})),Qn=[9,13,27,32],$n=gn&&`CompositionEvent`in window,er=null;gn&&`documentMode`in document&&(er=document.documentMode);var tr=gn&&`TextEvent`in window&&!er,nr=gn&&(!$n||er&&8<er&&11>=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Sn(),xn=bn=yn=null,sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return nr&&t.locale!==`ko`?null:t.data;default:return null}}var ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ur[e.type]:t===`textarea`}function fr(e,t,n,r){un?dn?dn.push(r):dn=[r]:un=r,t=Ud(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var pr=null,mr=null;function hr(e){Fd(e,0)}function gr(e){if(Ht(wt(e)))return e}function _r(e,t){if(e===`change`)return t}var vr=!1;if(gn){var yr;if(gn){var br=`oninput`in document;if(!br){var xr=document.createElement(`div`);xr.setAttribute(`oninput`,`return;`),br=typeof xr.oninput==`function`}yr=br}else yr=!1;vr=yr&&(!document.documentMode||9<document.documentMode)}function Sr(){pr&&(pr.detachEvent(`onpropertychange`,Cr),mr=pr=null)}function Cr(e){if(e.propertyName===`value`&&gr(mr)){var t=[];fr(t,mr,e,ln(e)),mn(hr,t)}}function wr(e,t,n){e===`focusin`?(Sr(),pr=t,mr=n,pr.attachEvent(`onpropertychange`,Cr)):e===`focusout`&&Sr()}function Tr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return gr(mr)}function Er(e,t){if(e===`click`)return gr(t)}function Dr(e,t){if(e===`input`||e===`change`)return gr(t)}function Or(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var kr=typeof Object.is==`function`?Object.is:Or;function Ar(e,t){if(kr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Oe.call(t,i)||!kr(e[i],t[i]))return!1}return!0}function jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mr(e,t){var n=jr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ut(e.document)}return t}function Fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ir=gn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Ut(r)||(r=Lr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Ar(zr,r)||(zr=r,r=Ud(Rr,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionrun:Hr(`Transition`,`TransitionRun`),transitionstart:Hr(`Transition`,`TransitionStart`),transitioncancel:Hr(`Transition`,`TransitionCancel`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};gn&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionrun`),Zr=Kr(`transitionstart`),Qr=Kr(`transitioncancel`),$r=Kr(`transitionend`),ei=new Map,ti=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ti.push(`scrollEnd`);function ni(e,t){ei.set(e,t),kt(t,[e])}var M=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)},ri=[],ii=0,ai=0;function oi(){for(var e=ii,t=ai=ii=0;t<e;){var n=ri[t];ri[t++]=null;var r=ri[t];ri[t++]=null;var i=ri[t];ri[t++]=null;var a=ri[t];if(ri[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ui(n,i,a)}}function si(e,t,n,r){ri[ii++]=e,ri[ii++]=t,ri[ii++]=n,ri[ii++]=r,ai|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ci(e,t,n,r){return si(e,t,n,r),di(e)}function li(e,t){return si(e,null,null,t),di(e)}function ui(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ge(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function di(e){if(50<Du)throw Du=0,Ou=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var fi={};function pi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mi(e,t,n,r){return new pi(e,t,n,r)}function hi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gi(e,t){var n=e.alternate;return n===null?(n=mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function _i(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)hi(e)&&(s=1);else if(typeof e==`string`)s=Zf(e,n,pe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=mi(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return yi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=mi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=mi(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=mi(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function yi(e,t,n,r){return e=mi(7,e,r,t),e.lanes=n,e}function bi(e,t,n){return e=mi(6,e,null,t),e.lanes=n,e}function xi(e){var t=mi(18,null,null,0);return t.stateNode=e,t}function Si(e,t,n){return t=mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ci=new WeakMap;function wi(e,t){if(typeof e==`object`&&e){var n=Ci.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Ci.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Ti=[],Ei=0,Di=null,Oi=0,ki=[],Ai=0,ji=null,Mi=1,Ni=``;function Pi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=Di,Di=e,Oi=t}function Fi(e,t,n){ki[Ai++]=Mi,ki[Ai++]=Ni,ki[Ai++]=ji,ji=e;var r=Mi;e=Ni;var i=32-Ge(r)-1;r&=~(1<<i),n+=1;var a=32-Ge(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Mi=1<<32-Ge(t)+i|n<<i|r,Ni=a+e}else Mi=1<<a|n<<i|r,Ni=e}function Ii(e){e.return!==null&&(Pi(e,1),Fi(e,1,0))}function Li(e){for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null;for(;e===ji;)ji=ki[--Ai],ki[Ai]=null,Ni=ki[--Ai],ki[Ai]=null,Mi=ki[--Ai],ki[Ai]=null}function Ri(e,t){ki[Ai++]=Mi,ki[Ai++]=Ni,ki[Ai++]=ji,Mi=t.id,Ni=t.overflow,ji=e}var zi=null,Bi=null,Vi=!1,Hi=null,Ui=!1,Wi=Error(i(519));function Gi(e){throw Zi(wi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Wi}function Ki(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Id(`cancel`,t),Id(`close`,t);break;case`iframe`:case`object`:case`embed`:Id(`load`,t);break;case`video`:case`audio`:for(n=0;n<Nd.length;n++)Id(Nd[n],t);break;case`source`:Id(`error`,t);break;case`img`:case`image`:case`link`:Id(`error`,t),Id(`load`,t);break;case`details`:Id(`toggle`,t);break;case`input`:Id(`invalid`,t),qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Id(`invalid`,t);break;case`textarea`:Id(`invalid`,t),Zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||L(t.textContent,n)?(r.popover!=null&&(Id(`beforetoggle`,t),Id(`toggle`,t)),r.onScroll!=null&&Id(`scroll`,t),r.onScrollEnd!=null&&Id(`scrollend`,t),r.onClick!=null&&(t.onclick=sn),t=!0):t=!1,t||Gi(e,!0)}function qi(e){for(zi=e.return;zi;)switch(zi.tag){case 5:case 31:case 13:Ui=!1;return;case 27:case 3:Ui=!0;return;default:zi=zi.return}}function Ji(e){if(e!==zi)return!1;if(!Vi)return qi(e),Vi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||af(e.type,e.memoizedProps)),n=!n),n&&Bi&&Gi(e),qi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Bi=yf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Bi=yf(e)}else t===27?(t=Bi,uf(e.type)?(e=vf,vf=null,Bi=e):Bi=t):Bi=zi?W(e.stateNode.nextSibling):null;return!0}function Yi(){Bi=zi=null,Vi=!1}function Xi(){var e=Hi;return e!==null&&(pu===null?pu=e:pu.push.apply(pu,e),Hi=null),e}function Zi(e){Hi===null?Hi=[e]:Hi.push(e)}var Qi=A(null),$i=null,ea=null;function ta(e,t,n){fe(Qi,t._currentValue),t._currentValue=n}function na(e){e._currentValue=Qi.current,de(Qi)}function ra(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ia(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ra(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ra(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function aa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;kr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ge.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[op]:e.push(op))}a=a.return}e!==null&&ia(t,e,n,r),t.flags|=262144}function oa(e){for(e=e.firstContext;e!==null;){if(!kr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){$i=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ca(e){return ua($i,e)}function la(e,t){return $i===null&&sa(e),ua(e,t)}function ua(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ea===null){if(e===null)throw Error(i(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return n}var da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},fa=t.unstable_scheduleCallback,pa=t.unstable_NormalPriority,ma={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ha(){return{controller:new da,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&fa(pa,function(){e.controller.abort()})}var _a=null,va=0,ya=0,ba=null;function xa(e,t){if(_a===null){var n=_a=[];va=0,ya=Dd(),ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return va++,t.then(Sa,Sa),t}function Sa(){if(--va===0&&_a!==null){ba!==null&&(ba.status=`fulfilled`);var e=_a;_a=null,ya=0,ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var wa=k.S;k.S=function(e,t){gu=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&xa(e,t),wa!==null&&wa(e,t)};var Ta=A(null);function Ea(){var e=Ta.current;return e===null?Zl.pooledCache:e}function Da(e,t){t===null?fe(Ta,Ta.current):fe(Ta,t.pool)}function Oa(){var e=Ea();return e===null?null:{parent:ma._currentValue,pool:e}}var ka=Error(i(460)),N=Error(i(474)),Aa=Error(i(542)),ja={then:function(){}};function Ma(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Na(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(sn,sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,La(e),e;default:if(typeof t.status==`string`)t.then(sn,sn);else{if(e=Zl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,La(e),e}throw Fa=t,ka}}function Pa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Fa=e,ka):e}}var Fa=null;function Ia(){if(Fa===null)throw Error(i(459));var e=Fa;return Fa=null,e}function La(e){if(e===ka||e===Aa)throw Error(i(483))}var Ra=null,za=0;function Ba(e){var t=za;return za+=1,Ra===null&&(Ra=[]),Na(Ra,e,t)}function Va(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ha(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ua(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=gi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=bi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Pa(i)===t.type)?(t=a(t,n.props),Va(t,n),t.return=e,t):(t=vi(n.type,n.key,n.props,null,e.mode,r),Va(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Si(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=yi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=vi(t.type,t.key,t.props,null,e.mode,n),Va(n,t),n.return=e,n;case v:return t=Si(t,e.mode,n),t.return=e,t;case O:return t=Pa(t),f(e,t,n)}if(oe(t)||re(t))return t=yi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ba(t),n);if(t.$$typeof===C)return f(e,la(e,t),n);Ha(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Pa(n),p(e,t,n,r)}if(oe(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ba(n),r);if(n.$$typeof===C)return p(e,t,la(e,n),r);Ha(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Pa(r),m(e,t,n,r,i)}if(oe(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ba(r),i);if(r.$$typeof===C)return m(e,t,n,la(t,r),i);Ha(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Vi&&Pi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Vi&&Pi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Vi&&Pi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Vi&&Pi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Vi&&Pi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Vi&&Pi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Pa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Va(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=yi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=vi(o.type,o.key,o.props,null,e.mode,c),Va(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=Si(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Pa(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ba(o),c);if(o.$$typeof===C)return b(e,r,la(e,o),c);Ha(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{za=0;var i=b(e,t,n,r);return Ra=null,i}catch(t){if(t===ka||t===Aa)throw t;var a=mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Wa=Ua(!0),Ga=Ua(!1),Ka=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=di(e),ui(e,null,n),t}return si(e,r,t,n),di(e)}function Za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var $a=!1;function P(){if($a){var e=ba;if(e!==null)throw e}}function eo(e,t,n,r){$a=!1;var i=e.updateQueue;Ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?($l&f)===f:(r&f)===f){f!==0&&f===ya&&($a=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ka=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),su|=o,e.lanes=o,e.memoizedState=d}}function to(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function no(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)to(n[e],t)}var ro=A(null),io=A(0);function ao(e,t){e=au,fe(io,e),fe(ro,t),au=e|t.baseLanes}function oo(){fe(io,au),fe(ro,ro.current)}function so(){au=io.current,de(ro),de(io)}var co=A(null),lo=null;function uo(e){var t=e.alternate;fe(go,go.current&1),fe(co,e),lo===null&&(t===null||ro.current!==null||t.memoizedState!==null)&&(lo=e)}function fo(e){fe(go,go.current),fe(co,e),lo===null&&(lo=e)}function po(e){e.tag===22?(fe(go,go.current),fe(co,e),lo===null&&(lo=e)):mo(e)}function mo(){fe(go,go.current),fe(co,co.current)}function ho(e){de(co),lo===e&&(lo=null),de(go)}var go=A(0);function _o(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||U(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vo=0,yo=null,bo=null,xo=null,So=!1,Co=!1,wo=!1,To=0,Eo=0,Do=null,Oo=0;function ko(){throw Error(i(321))}function Ao(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kr(e[n],t[n]))return!1;return!0}function jo(e,t,n,r,i,a){return vo=a,yo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Js:Ys,wo=!1,a=n(r,i),wo=!1,Co&&(a=No(t,n,r,i)),Mo(e),a}function Mo(e){k.H=qs;var t=bo!==null&&bo.next!==null;if(vo=0,xo=bo=yo=null,So=!1,Eo=0,Do=null,t)throw Error(i(300));e===null||fc||(e=e.dependencies,e!==null&&oa(e)&&(fc=!0))}function No(e,t,n,r){yo=e;var a=0;do{if(Co&&(Do=null),Eo=0,Co=!1,25<=a)throw Error(i(301));if(a+=1,xo=bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Xs,o=t(n,r)}while(Co);return o}function Po(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Vo(t):t,e=e.useState()[0],(bo===null?null:bo.memoizedState)!==e&&(yo.flags|=1024),t}function Fo(){var e=To!==0;return To=0,e}function Io(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Lo(e){if(So){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}So=!1}vo=0,xo=bo=yo=null,Co=!1,Eo=To=0,Do=null}function Ro(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xo===null?yo.memoizedState=xo=e:xo=xo.next=e,xo}function zo(){if(bo===null){var e=yo.alternate;e=e===null?null:e.memoizedState}else e=bo.next;var t=xo===null?yo.memoizedState:xo.next;if(t!==null)xo=t,bo=e;else{if(e===null)throw yo.alternate===null?Error(i(467)):Error(i(310));bo=e,e={memoizedState:bo.memoizedState,baseState:bo.baseState,baseQueue:bo.baseQueue,queue:bo.queue,next:null},xo===null?yo.memoizedState=xo=e:xo=xo.next=e}return xo}function Bo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vo(e){var t=Eo;return Eo+=1,Do===null&&(Do=[]),e=Na(Do,e,t),t=yo,(xo===null?t.memoizedState:xo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Js:Ys),e}function Ho(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Vo(e);if(e.$$typeof===C)return ca(e)}throw Error(i(438,String(e)))}function Uo(e){var t=null,n=yo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=yo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Bo(),yo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function Wo(e,t){return typeof t==`function`?t(e):t}function Go(e){return Ko(zo(),bo,e)}function Ko(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(vo&f)===f:($l&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ya&&(d=!0);else if((vo&p)===p){u=u.next,p===ya&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,yo.lanes|=p,su|=p;f=u.action,wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,yo.lanes|=f,su|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!kr(o,e.memoizedState)&&(fc=!0,d&&(n=ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function qo(e){var t=zo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);kr(o,t.memoizedState)||(fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Jo(e,t,n){var r=yo,a=zo(),o=Vi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!kr((bo||a).memoizedState,n);if(s&&(a.memoizedState=n,fc=!0),a=a.queue,ys(Zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||xo!==null&&xo.memoizedState.tag&1){if(r.flags|=2048,ms(9,{destroy:void 0},Xo.bind(null,r,a,n,t),null),Zl===null)throw Error(i(349));o||vo&127||Yo(r,t,n)}return n}function Yo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=yo.updateQueue,t===null?(t=Bo(),yo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xo(e,t,n,r){t.value=n,t.getSnapshot=r,Qo(t)&&$o(e)}function Zo(e,t,n){return n(function(){Qo(t)&&$o(e)})}function Qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kr(e,n)}catch{return!0}}function $o(e){var t=li(e,2);t!==null&&ju(t,e,2)}function es(e){var t=Ro();if(typeof e==`function`){var n=e;if(e=n(),wo){We(!0);try{n()}finally{We(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},t}function ts(e,t,n,r){return e.baseState=n,Ko(e,bo,typeof r==`function`?r:Wo)}function ns(e,t,n,r,a){if(Ws(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,rs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function rs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),is(e,t,s)}catch(n){os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),is(e,t,a)}catch(n){os(e,t,n)}}function is(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){as(e,t,n)},function(n){return os(e,t,n)}):as(e,t,n)}function as(e,t,n){t.status=`fulfilled`,t.value=n,ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,rs(e,n)))}function os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ss(t),t=t.next;while(t!==r)}e.action=null}function ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cs(e,t){return t}function ls(e,t){if(Vi){var n=Zl.formState;if(n!==null){a:{var r=yo;if(Vi){if(Bi){b:{for(var i=Bi,a=Ui;i.nodeType!==8;){if(!a){i=null;break b}if(i=W(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Bi=W(i.nextSibling),r=i.data===`F!`;break a}}Gi(r)}r=!1}r&&(t=n[0])}}return n=Ro(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:t},n.queue=r,n=Vs.bind(null,yo,r),r.dispatch=n,r=es(!1),a=Us.bind(null,yo,!1,r.queue),r=Ro(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ns.bind(null,yo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function us(e){return ds(zo(),bo,e)}function ds(e,t,n){if(t=Ko(e,t,cs)[0],e=Go(Wo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Vo(t)}catch(e){throw e===ka?Aa:e}else r=t;t=zo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(yo.flags|=2048,ms(9,{destroy:void 0},fs.bind(null,i,n),null)),[r,a,e]}function fs(e,t){e.action=t}function ps(e){var t=zo(),n=bo;if(n!==null)return ds(t,n,e);zo(),t=t.memoizedState,n=zo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=yo.updateQueue,t===null&&(t=Bo(),yo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function hs(){return zo().memoizedState}function gs(e,t,n,r){var i=Ro();yo.flags|=e,i.memoizedState=ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function _s(e,t,n,r){var i=zo();r=r===void 0?null:r;var a=i.memoizedState.inst;bo!==null&&r!==null&&Ao(r,bo.memoizedState.deps)?i.memoizedState=ms(t,a,n,r):(yo.flags|=e,i.memoizedState=ms(1|t,a,n,r))}function vs(e,t){gs(8390656,8,e,t)}function ys(e,t){_s(2048,8,e,t)}function bs(e){yo.flags|=4;var t=yo.updateQueue;if(t===null)t=Bo(),yo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function xs(e){var t=zo().memoizedState;return bs({ref:t,nextImpl:e}),function(){if(Xl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ss(e,t){return _s(4,2,e,t)}function Cs(e,t){return _s(4,4,e,t)}function ws(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ts(e,t,n){n=n==null?null:n.concat([e]),_s(4,4,ws.bind(null,t,e),n)}function Es(){}function Ds(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ao(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Os(e,t){var n=zo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ao(t,r[1]))return r[0];if(r=e(),wo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r}function ks(e,t,n){return n===void 0||vo&1073741824&&!($l&261930)?e.memoizedState=t:(e.memoizedState=n,e=Au(),yo.lanes|=e,su|=e,n)}function As(e,t,n,r){return kr(n,t)?n:ro.current===null?!(vo&42)||vo&1073741824&&!($l&261930)?(fc=!0,e.memoizedState=n):(e=Au(),yo.lanes|=e,su|=e,t):(e=ks(e,n,r),kr(e,t)||(fc=!0),e)}function js(e,t,n,r,i){var a=se.p;se.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Us(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Hs(e,t,Ca(c,r),ku(e)):Hs(e,t,r,ku(e))}catch(n){Hs(e,t,{then:function(){},status:`rejected`,reason:n},ku())}finally{se.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Ms(){}function Ns(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ps(e).queue;js(e,a,t,ce,n===null?Ms:function(){return Fs(e),n(r)})}function Ps(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fs(e){var t=Ps(e);t.next===null&&(t=e.alternate.memoizedState),Hs(e,t.next.queue,{},ku())}function Is(){return ca(op)}function Ls(){return zo().memoizedState}function Rs(){return zo().memoizedState}function zs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ku();e=Ya(n);var r=Xa(t,e,n);r!==null&&(ju(r,t,n),Za(r,t,n)),t={cache:ha()},e.payload=t;return}t=t.return}}function Bs(e,t,n){var r=ku();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ws(e)?Gs(t,n):(n=ci(e,t,n,r),n!==null&&(ju(n,e,r),Ks(n,t,r)))}function Vs(e,t,n){Hs(e,t,n,ku())}function Hs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ws(e))Gs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o))return si(e,t,i,0),Zl===null&&oi(),!1}catch{}if(n=ci(e,t,i,r),n!==null)return ju(n,e,r),Ks(n,t,r),!0}return!1}function Us(e,t,n,r){if(r={lane:2,revertLane:Dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ws(e)){if(t)throw Error(i(479))}else t=ci(e,n,r,2),t!==null&&ju(t,e,2)}function Ws(e){var t=e.alternate;return e===yo||t!==null&&t===yo}function Gs(e,t){Co=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ks(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var qs={readContext:ca,use:Ho,useCallback:ko,useContext:ko,useEffect:ko,useImperativeHandle:ko,useLayoutEffect:ko,useInsertionEffect:ko,useMemo:ko,useReducer:ko,useRef:ko,useState:ko,useDebugValue:ko,useDeferredValue:ko,useTransition:ko,useSyncExternalStore:ko,useId:ko,useHostTransitionStatus:ko,useFormState:ko,useActionState:ko,useOptimistic:ko,useMemoCache:ko,useCacheRefresh:ko};qs.useEffectEvent=ko;var Js={readContext:ca,use:Ho,useCallback:function(e,t){return Ro().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),gs(4194308,4,ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){gs(4,2,e,t)},useMemo:function(e,t){var n=Ro();t=t===void 0?null:t;var r=e();if(wo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ro();if(n!==void 0){var i=n(t);if(wo){We(!0);try{n(t)}finally{We(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Bs.bind(null,yo,e),[r.memoizedState,e]},useRef:function(e){var t=Ro();return e={current:e},t.memoizedState=e},useState:function(e){e=es(e);var t=e.queue,n=Vs.bind(null,yo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Es,useDeferredValue:function(e,t){return ks(Ro(),e,t)},useTransition:function(){var e=es(!1);return e=js.bind(null,yo,e.queue,!0,!1),Ro().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=yo,a=Ro();if(Vi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Zl===null)throw Error(i(349));$l&127||Yo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,vs(Zo.bind(null,r,o,e),[e]),r.flags|=2048,ms(9,{destroy:void 0},Xo.bind(null,r,o,n,t),null),n},useId:function(){var e=Ro(),t=Zl.identifierPrefix;if(Vi){var n=Ni,r=Mi;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=To++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Oo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Is,useFormState:ls,useActionState:ls,useOptimistic:function(e){var t=Ro();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Us.bind(null,yo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Uo,useCacheRefresh:function(){return Ro().memoizedState=zs.bind(null,yo)},useEffectEvent:function(e){var t=Ro(),n={impl:e};return t.memoizedState=n,function(){if(Xl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ys={readContext:ca,use:Ho,useCallback:Ds,useContext:ca,useEffect:ys,useImperativeHandle:Ts,useInsertionEffect:Ss,useLayoutEffect:Cs,useMemo:Os,useReducer:Go,useRef:hs,useState:function(){return Go(Wo)},useDebugValue:Es,useDeferredValue:function(e,t){return As(zo(),bo.memoizedState,e,t)},useTransition:function(){var e=Go(Wo)[0],t=zo().memoizedState;return[typeof e==`boolean`?e:Vo(e),t]},useSyncExternalStore:Jo,useId:Ls,useHostTransitionStatus:Is,useFormState:us,useActionState:us,useOptimistic:function(e,t){return ts(zo(),bo,e,t)},useMemoCache:Uo,useCacheRefresh:Rs};Ys.useEffectEvent=xs;var Xs={readContext:ca,use:Ho,useCallback:Ds,useContext:ca,useEffect:ys,useImperativeHandle:Ts,useInsertionEffect:Ss,useLayoutEffect:Cs,useMemo:Os,useReducer:qo,useRef:hs,useState:function(){return qo(Wo)},useDebugValue:Es,useDeferredValue:function(e,t){var n=zo();return bo===null?ks(n,e,t):As(n,bo.memoizedState,e,t)},useTransition:function(){var e=qo(Wo)[0],t=zo().memoizedState;return[typeof e==`boolean`?e:Vo(e),t]},useSyncExternalStore:Jo,useId:Ls,useHostTransitionStatus:Is,useFormState:ps,useActionState:ps,useOptimistic:function(e,t){var n=zo();return bo===null?(n.baseState=e,[e,n.queue.dispatch]):ts(n,bo,e,t)},useMemoCache:Uo,useCacheRefresh:Rs};Xs.useEffectEvent=xs;function Zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ku(),i=Ya(r);i.payload=t,n!=null&&(i.callback=n),t=Xa(e,i,r),t!==null&&(ju(t,e,r),Za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ku(),i=Ya(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Xa(e,i,r),t!==null&&(ju(t,e,r),Za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ku(),r=Ya(n);r.tag=2,t!=null&&(r.callback=t),t=Xa(e,r,n),t!==null&&(ju(t,e,n),Za(t,e,n))}};function $s(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ar(n,r)||!Ar(i,a):!0}function ec(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Qs.enqueueReplaceState(t,t.state,null)}function tc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function nc(e){M(e)}function rc(e){console.error(e)}function ic(e){M(e)}function ac(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function oc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function sc(e,t,n){return n=Ya(n),n.tag=3,n.payload={element:null},n.callback=function(){ac(e,t)},n}function cc(e){return e=Ya(e),e.tag=3,e}function lc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){oc(t,n,r),typeof i!=`function`&&(yu===null?yu=new Set([this]):yu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function uc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&aa(t,n,a,!0),n=co.current,n!==null){switch(n.tag){case 31:case 13:return lo===null?Uu():n.alternate===null&&ou===0&&(ou=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),cd(e,r,a)),!1;case 22:return n.flags|=65536,r===ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),cd(e,r,a)),!1}throw Error(i(435,n.tag))}return cd(e,r,a),Uu(),!1}if(Vi)return t=co.current,t===null?(r!==Wi&&(t=Error(i(423),{cause:r}),Zi(wi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=wi(r,n),a=sc(e.stateNode,r,a),Qa(e,a),ou!==4&&(ou=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Wi&&(e=Error(i(422),{cause:r}),Zi(wi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=wi(o,n),fu===null?fu=[o]:fu.push(o),ou!==4&&(ou=2),t===null)return!0;r=wi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=sc(n.stateNode,r,e),Qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(yu===null||!yu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=cc(a),lc(a,e,n,r),Qa(n,a),!1}n=n.return}while(n!==null);return!1}var dc=Error(i(461)),fc=!1;function pc(e,t,n,r){t.child=e===null?Ga(t,null,n,r):Wa(t,e.child,n,r)}function mc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return sa(t),r=jo(e,t,n,o,a,i),s=Fo(),e!==null&&!fc?(Io(e,t,i),Rc(e,t,i)):(Vi&&s&&Ii(t),t.flags|=1,pc(e,t,r,i),t.child)}function hc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!hi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,gc(e,t,a,r,i)):(e=vi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!zc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ar:n,n(o,r)&&e.ref===t.ref)return Rc(e,t,i)}return t.flags|=1,e=gi(a,r),e.ref=t.ref,e.return=t,t.child=e}function gc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ar(a,r)&&e.ref===t.ref)if(fc=!1,t.pendingProps=r=a,zc(e,i))e.flags&131072&&(fc=!0);else return t.lanes=e.lanes,Rc(e,t,i)}return wc(e,t,n,r,i)}function _c(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return yc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Da(t,a===null?null:a.cachePool),a===null?oo():ao(t,a),po(t);else return r=t.lanes=536870912,yc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Da(t,null),oo(),mo(t)):(Da(t,a.cachePool),ao(t,a),mo(t),t.memoizedState=null);return pc(e,t,i,n),t.child}function vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function yc(e,t,n,r,i){var a=Ea();return a=a===null?null:{parent:ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Da(t,null),oo(),po(t),e!==null&&aa(e,t,r,!0),t.childLanes=i,null}function bc(e,t){return t=Nc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xc(e,t,n){return Wa(t,e.child,null,n),e=bc(t,t.pendingProps),e.flags|=2,ho(t),t.memoizedState=null,e}function Sc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Vi){if(r.mode===`hidden`)return e=bc(t,r),t.lanes=536870912,vc(null,e);if(fo(t),(e=Bi)?(e=H(e,Ui),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ji===null?null:{id:Mi,overflow:Ni},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,zi=t,Bi=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return bc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(fo(t),a)if(t.flags&256)t.flags&=-257,t=xc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(fc||aa(e,t,n,!1),a=(n&e.childLanes)!==0,fc||a){if(r=Zl,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,li(e,s),ju(r,e,s),dc;Uu(),t=xc(e,t,n)}else e=o.treeContext,Bi=W(s.nextSibling),zi=t,Vi=!0,Hi=null,Ui=!1,e!==null&&Ri(t,e),t=bc(t,r),t.flags|=4096;return t}return e=gi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Cc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function wc(e,t,n,r,i){return sa(t),n=jo(e,t,n,r,void 0,i),r=Fo(),e!==null&&!fc?(Io(e,t,i),Rc(e,t,i)):(Vi&&r&&Ii(t),t.flags|=1,pc(e,t,n,i),t.child)}function Tc(e,t,n,r,i,a){return sa(t),t.updateQueue=null,n=No(t,r,n,i),Mo(e),r=Fo(),e!==null&&!fc?(Io(e,t,a),Rc(e,t,a)):(Vi&&r&&Ii(t),t.flags|=1,pc(e,t,n,a),t.child)}function Ec(e,t,n,r,i){if(sa(t),t.stateNode===null){var a=fi,o=n.contextType;typeof o==`object`&&o&&(a=ca(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},qa(t),o=n.contextType,a.context=typeof o==`object`&&o?ca(o):fi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Qs.enqueueReplaceState(a,a.state,null),eo(t,r,a,i),P(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=tc(n,s);a.props=c;var l=a.context,u=n.contextType;o=fi,typeof u==`object`&&u&&(o=ca(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&ec(t,a,r,o),Ka=!1;var f=t.memoizedState;a.state=f,eo(t,r,a,i),P(),l=t.memoizedState,s||f!==l||Ka?(typeof d==`function`&&(Zs(t,n,d,r),l=t.memoizedState),(c=Ka||$s(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ja(e,t),o=t.memoizedProps,u=tc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=fi,typeof l==`object`&&l&&(c=ca(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&ec(t,a,r,c),Ka=!1,f=t.memoizedState,a.state=f,eo(t,r,a,i),P();var p=t.memoizedState;o!==d||f!==p||Ka||e!==null&&e.dependencies!==null&&oa(e.dependencies)?(typeof s==`function`&&(Zs(t,n,s,r),p=t.memoizedState),(u=Ka||$s(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&oa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Cc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Wa(t,e.child,null,i),t.child=Wa(t,null,n,i)):pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Rc(e,t,i),e}function Dc(e,t,n,r){return Yi(),t.flags|=256,pc(e,t,n,r),t.child}var Oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kc(e){return{baseLanes:e,cachePool:Oa()}}function Ac(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=uu),e}function jc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(go.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Vi){if(a?uo(t):mo(t),(e=Bi)?(e=H(e,Ui),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ji===null?null:{id:Mi,overflow:Ni},retryLane:536870912,hydrationErrors:null},n=xi(e),n.return=t,t.child=n,zi=t,Bi=null)):e=null,e===null)throw Gi(t);return U(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(mo(t),a=t.mode,c=Nc({mode:`hidden`,children:c},a),r=yi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=kc(n),r.childLanes=Ac(e,s,n),t.memoizedState=Oc,vc(null,r)):(uo(t),Mc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(uo(t),t.flags&=-257,t=Pc(e,t,n)):t.memoizedState===null?(mo(t),c=r.fallback,a=t.mode,r=Nc({mode:`visible`,children:r.children},a),c=yi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Wa(t,e.child,null,n),r=t.child,r.memoizedState=kc(n),r.childLanes=Ac(e,s,n),t.memoizedState=Oc,t=vc(null,r)):(mo(t),t.child=e.child,t.flags|=128,t=null);else if(uo(t),U(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Zi({value:r,source:null,stack:null}),t=Pc(e,t,n)}else if(fc||aa(e,t,n,!1),s=(n&e.childLanes)!==0,fc||s){if(s=Zl,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,li(e,r),ju(s,e,r),dc;gf(c)||Uu(),t=Pc(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Bi=W(c.nextSibling),zi=t,Vi=!0,Hi=null,Ui=!1,e!==null&&Ri(t,e),t=Mc(t,r.children),t.flags|=4096);return t}return a?(mo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=gi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=yi(c,a,n,null),c.flags|=2):c=gi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,vc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=kc(n):(a=c.cachePool,a===null?a=Oa():(l=ma._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Ac(e,s,n),t.memoizedState=Oc,vc(e.child,r)):(uo(t),n=e.child,e=n.sibling,n=gi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Mc(e,t){return t=Nc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Nc(e,t){return e=mi(22,e,null,t),e.lanes=0,e}function Pc(e,t,n){return Wa(t,e.child,null,n),e=Mc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ra(e.return,t,n)}function Ic(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Lc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=go.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,fe(go,o),pc(e,t,r,n),r=Vi?Oi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fc(e,n,t);else if(e.tag===19)Fc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ic(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ic(t,!0,n,null,a,r);break;case`together`:Ic(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Rc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),su|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(aa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=gi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&oa(e))):!0}function Bc(e,t,n){switch(t.tag){case 3:_e(t,t.stateNode.containerInfo),ta(t,ma,e.memoizedState.cache),Yi();break;case 27:case 5:ye(t);break;case 4:_e(t,t.stateNode.containerInfo);break;case 10:ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(uo(t),e=Rc(e,t,n),e===null?null:e.sibling):jc(e,t,n):(uo(t),t.flags|=128,null);uo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(aa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Lc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),fe(go,go.current),r)break;return null;case 22:return t.lanes=0,_c(e,t,n,t.pendingProps);case 24:ta(t,ma,e.memoizedState.cache)}return Rc(e,t,n)}function Vc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)fc=!0;else{if(!zc(e,n)&&!(t.flags&128))return fc=!1,Bc(e,t,n);fc=!!(e.flags&131072)}else fc=!1,Vi&&t.flags&1048576&&Fi(t,Oi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Pa(t.elementType),t.type=e,typeof e==`function`)hi(e)?(r=tc(e,r),t.tag=1,t=Ec(null,t,e,r,n)):(t.tag=0,t=wc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=mc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=hc(null,t,e,r,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return wc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=tc(r,t.pendingProps),Ec(e,t,r,a,n);case 3:a:{if(_e(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ja(e,t),eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ta(t,ma,r),r!==o.cache&&ia(t,[ma],n,!0),P(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Dc(e,t,r,n);break a}else if(r!==a){a=wi(Error(i(424)),t),Zi(a),t=Dc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Bi=W(e.firstChild),zi=t,Vi=!0,Hi=null,Ui=!0,n=Ga(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Yi(),r===a){t=Rc(e,t,n);break a}pc(e,t,r,n)}t=t.child}return t;case 26:return Cc(e,t),e===null?(n=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Vi||(n=t.type,e=t.pendingProps,r=tf(he.current).createElement(n),r[pt]=t,r[mt]=e,Xd(r,n,e),Et(r),t.stateNode=r):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&Vi&&(r=t.stateNode=xf(t.type,t.pendingProps,he.current),zi=t,Ui=!0,a=Bi,uf(t.type)?(vf=a,Bi=W(r.firstChild)):Bi=a),pc(e,t,t.pendingProps.children,n),Cc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Vi&&((a=r=Bi)&&(r=mf(r,t.type,t.pendingProps,Ui),r===null?a=!1:(t.stateNode=r,zi=t,Bi=W(r.firstChild),Ui=!1,a=!0)),a||Gi(t)),ye(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,af(a,o)?r=null:s!==null&&af(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=jo(e,t,Po,null,null,n),op._currentValue=a),Cc(e,t),pc(e,t,r,n),t.child;case 6:return e===null&&Vi&&((e=n=Bi)&&(n=hf(n,t.pendingProps,Ui),n===null?e=!1:(t.stateNode=n,zi=t,Bi=null,e=!0)),e||Gi(t)),null;case 13:return jc(e,t,n);case 4:return _e(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wa(t,null,r,n):pc(e,t,r,n),t.child;case 11:return mc(e,t,t.type,t.pendingProps,n);case 7:return pc(e,t,t.pendingProps,n),t.child;case 8:return pc(e,t,t.pendingProps.children,n),t.child;case 12:return pc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ta(t,t.type,r.value),pc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,sa(t),a=ca(a),r=r(a),t.flags|=1,pc(e,t,r,n),t.child;case 14:return hc(e,t,t.type,t.pendingProps,n);case 15:return gc(e,t,t.type,t.pendingProps,n);case 19:return Lc(e,t,n);case 31:return Sc(e,t,n);case 22:return _c(e,t,n,t.pendingProps);case 24:return sa(t),r=ca(ma),e===null?(a=Ea(),a===null&&(a=Zl,o=ha(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},qa(t),ta(t,ma,a)):((e.lanes&n)!==0&&(Ja(e,t),eo(t,null,null,n),P()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ta(t,ma,r),r!==a.cache&&ia(t,[ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ta(t,ma,r))),pc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Hc(e){e.flags|=4}function Uc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Bu())e.flags|=8192;else throw Fa=ja,N}else e.flags&=-16777217}function Wc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Qf(t))if(Bu())e.flags|=8192;else throw Fa=ja,N}function Gc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:j(),e.lanes|=t,du|=t)}function Kc(e,t){if(!Vi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Jc(e,t,n){var r=t.pendingProps;switch(Li(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qc(t),null;case 1:return qc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),na(ma),ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?Hc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xi())),qc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Hc(t),o===null?(qc(t),Uc(t,a,null,r,n)):(qc(t),Wc(t,o))):o?o===e.memoizedState?(qc(t),t.flags&=-16777217):(Hc(t),qc(t),Wc(t,o)):(e=e.memoizedProps,e!==r&&Hc(t),qc(t),Uc(t,a,e,r,n)),null;case 27:if(be(t),n=he.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return qc(t),null}e=pe.current,Ji(t)?Ki(t,e):(e=xf(a,r,n),t.stateNode=e,Hc(t))}return qc(t),null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return qc(t),null}if(o=pe.current,Ji(t))Ki(t,o);else{var s=tf(he.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Xd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Hc(t)}}return qc(t),Uc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Hc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=he.current,Ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||L(e.nodeValue,n)),e||Gi(t,!0)}else e=tf(e).createTextNode(r),e[pt]=t,t.stateNode=e}return qc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ji(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qc(t),e=!1}else n=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ho(t),t):(ho(t),null);if(t.flags&128)throw Error(i(558))}return qc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Yi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qc(t),a=!1}else a=Xi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ho(t),t):(ho(t),null)}return ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Gc(t,t.updateQueue),qc(t),null);case 4:return ve(),e===null&&zd(t.stateNode.containerInfo),qc(t),null;case 10:return na(t.type),qc(t),null;case 19:if(de(go),r=t.memoizedState,r===null)return qc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Kc(r,!1);else{if(ou!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=_o(e),o!==null){for(t.flags|=128,Kc(r,!1),e=o.updateQueue,t.updateQueue=e,Gc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)_i(n,e),n=n.sibling;return fe(go,go.current&1|2),Vi&&Pi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>_u&&(t.flags|=128,a=!0,Kc(r,!1),t.lanes=4194304)}else{if(!a)if(e=_o(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Gc(t,e),Kc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Vi)return qc(t),null}else 2*Ne()-r.renderingStartTime>_u&&n!==536870912&&(t.flags|=128,a=!0,Kc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(qc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ne(),e.sibling=null,n=go.current,fe(go,a?n&1|2:n&1),Vi&&Pi(t,r.treeForkCount),e);case 22:case 23:return ho(t),so(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(qc(t),t.subtreeFlags&6&&(t.flags|=8192)):qc(t),n=t.updateQueue,n!==null&&Gc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(Ta),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),na(ma),qc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Yc(e,t){switch(Li(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return na(ma),ve(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(ho(t),t.alternate===null)throw Error(i(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Yi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(go),null;case 4:return ve(),null;case 10:return na(t.type),null;case 22:case 23:return ho(t),so(),e!==null&&de(Ta),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return na(ma),null;case 25:return null;default:return null}}function Xc(e,t){switch(Li(t),t.tag){case 3:na(ma),ve();break;case 26:case 27:case 5:be(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&ho(t);break;case 13:ho(t);break;case 19:de(go);break;case 10:na(t.type);break;case 22:case 23:ho(t),so(),e!==null&&de(Ta);break;case 24:na(ma)}}function Zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){sd(t,t.return,e)}}function Qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){sd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){sd(t,t.return,e)}}function $c(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{no(t,n)}catch(t){sd(e,e.return,t)}}}function el(e,t,n){n.props=tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){sd(e,t,n)}}function tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){sd(e,t,n)}}function nl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){sd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){sd(e,t,n)}else n.current=null}function rl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){sd(e,e.return,t)}}function il(e,t,n){try{var r=e.stateNode;Zd(r,e.type,n,t),r[mt]=t}catch(t){sd(e,e.return,t)}}function al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function ol(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&uf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(sl(e,t,n),e=e.sibling;e!==null;)sl(e,t,n),e=e.sibling}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Xd(t,r,n),t[pt]=e,t[mt]=n}catch(t){sd(e,e.return,t)}}var ul=!1,dl=!1,fl=!1,pl=typeof WeakSet==`function`?WeakSet:Set,ml=null;function hl(e,t){if(e=e.containerInfo,$d=hp,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(ef={focusedElem:e,selectionRange:n},hp=!1,ml=t;ml!==null;)if(t=ml,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ml=e;else for(;ml!==null;){switch(t=ml,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=tc(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){sd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ml=e;break}ml=t.return}}function gl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:jl(e,n),r&4&&Zc(5,n);break;case 1:if(jl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){sd(n,n.return,e)}else{var i=tc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){sd(n,n.return,e)}}r&64&&$c(n),r&512&&tl(n,n.return);break;case 3:if(jl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{no(e,t)}catch(e){sd(n,n.return,e)}}break;case 27:t===null&&r&4&&ll(n);case 26:case 5:jl(e,n),t===null&&r&4&&rl(n),r&512&&tl(n,n.return);break;case 12:jl(e,n);break;case 31:jl(e,n),r&4&&Sl(e,n);break;case 13:jl(e,n),r&4&&Cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=dd.bind(null,n),_f(e,n))));break;case 22:if(r=n.memoizedState!==null||ul,!r){t=t!==null&&t.memoizedState!==null||dl,i=ul;var a=dl;ul=r,(dl=t)&&!a?Nl(e,n,(n.subtreeFlags&8772)!=0):jl(e,n),ul=i,dl=a}break;case 30:break;default:jl(e,n)}}function _l(e){var t=e.alternate;t!==null&&(e.alternate=null,_l(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var vl=null,yl=!1;function bl(e,t,n){for(n=n.child;n!==null;)xl(e,t,n),n=n.sibling}function xl(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount==`function`)try{Ue.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:dl||nl(n,t),bl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:dl||nl(n,t);var r=vl,i=yl;uf(n.type)&&(vl=n.stateNode,yl=!1),bl(e,t,n),Sf(n.stateNode),vl=r,yl=i;break;case 5:dl||nl(n,t);case 6:if(r=vl,i=yl,vl=null,bl(e,t,n),vl=r,yl=i,vl!==null)if(yl)try{(vl.nodeType===9?vl.body:vl.nodeName===`HTML`?vl.ownerDocument.body:vl).removeChild(n.stateNode)}catch(e){sd(n,t,e)}else try{vl.removeChild(n.stateNode)}catch(e){sd(n,t,e)}break;case 18:vl!==null&&(yl?(e=vl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):df(vl,n.stateNode));break;case 4:r=vl,i=yl,vl=n.stateNode.containerInfo,yl=!0,bl(e,t,n),vl=r,yl=i;break;case 0:case 11:case 14:case 15:Qc(2,n,t),dl||Qc(4,n,t),bl(e,t,n);break;case 1:dl||(nl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&el(n,t,r)),bl(e,t,n);break;case 21:bl(e,t,n);break;case 22:dl=(r=dl)||n.memoizedState!==null,bl(e,t,n),dl=r;break;default:bl(e,t,n)}}function Sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){sd(t,t.return,e)}}}function Cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){sd(t,t.return,e)}}function wl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pl),t;default:throw Error(i(435,e.tag))}}function Tl(e,t){var n=wl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=fd.bind(null,e,t);t.then(r,r)}})}function El(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){vl=c.stateNode,yl=!1;break a}break;case 5:vl=c.stateNode,yl=!1;break a;case 3:case 4:vl=c.stateNode.containerInfo,yl=!0;break a}c=c.return}if(vl===null)throw Error(i(160));xl(o,s,a),vl=null,yl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ol(t,e),t=t.sibling}var Dl=null;function Ol(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:El(t,e),kl(e),r&4&&(Qc(3,e,e.return),Zc(3,e),Qc(5,e,e.return));break;case 1:El(t,e),kl(e),r&512&&(dl||n===null||nl(n,n.return)),r&64&&ul&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Dl;if(El(t,e),kl(e),r&512&&(dl||n===null||nl(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Xd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=Yf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Xd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Yf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Xd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else Xf(a,e.type,e.stateNode);else e.stateNode=Gf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&il(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Xf(a,e.type,e.stateNode):Gf(a,r,e.memoizedProps))}break;case 27:El(t,e),kl(e),r&512&&(dl||n===null||nl(n,n.return)),n!==null&&r&4&&il(e,e.memoizedProps,n.memoizedProps);break;case 5:if(El(t,e),kl(e),r&512&&(dl||n===null||nl(n,n.return)),e.flags&32){a=e.stateNode;try{Qt(a,``)}catch(t){sd(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,il(e,a,n===null?a:n.memoizedProps)),r&1024&&(fl=!0);break;case 6:if(El(t,e),kl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){sd(e,e.return,t)}}break;case 3:if(G=null,a=Dl,Dl=Tf(t.containerInfo),El(t,e),Dl=a,kl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){sd(e,e.return,t)}fl&&(fl=!1,Al(e));break;case 4:r=Dl,Dl=Tf(e.stateNode.containerInfo),El(t,e),kl(e),Dl=r;break;case 12:El(t,e),kl(e);break;case 31:El(t,e),kl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Tl(e,r)));break;case 13:El(t,e),kl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(hu=Ne()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Tl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ul,d=dl;if(ul=u||a,dl=d||l,El(t,e),dl=d,ul=u,kl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||ul||dl||Ml(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){sd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){sd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){sd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Tl(e,n))));break;case 19:El(t,e),kl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Tl(e,r)));break;case 30:break;case 21:break;default:El(t,e),kl(e)}}function kl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(al(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;cl(e,ol(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Qt(o,``),n.flags&=-33),cl(e,ol(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;sl(e,ol(e),s);break;default:throw Error(i(161))}}catch(t){sd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Al(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Al(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function jl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gl(e,t.alternate,t),t=t.sibling}function Ml(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qc(4,t,t.return),Ml(t);break;case 1:nl(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&el(t,t.return,n),Ml(t);break;case 27:Sf(t.stateNode);case 26:case 5:nl(t,t.return),Ml(t);break;case 22:t.memoizedState===null&&Ml(t);break;case 30:Ml(t);break;default:Ml(t)}e=e.sibling}}function Nl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Nl(i,a,n),Zc(4,a);break;case 1:if(Nl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){sd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)to(c[i],s)}catch(e){sd(r,r.return,e)}}n&&o&64&&$c(a),tl(a,a.return);break;case 27:ll(a);case 26:case 5:Nl(i,a,n),n&&r===null&&o&4&&rl(a),tl(a,a.return);break;case 12:Nl(i,a,n);break;case 31:Nl(i,a,n),n&&o&4&&Sl(i,a);break;case 13:Nl(i,a,n),n&&o&4&&Cl(i,a);break;case 22:a.memoizedState===null&&Nl(i,a,n),tl(a,a.return);break;case 30:break;default:Nl(i,a,n)}t=t.sibling}}function Pl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ga(n))}function Fl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function Il(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ll(e,t,n,r),t=t.sibling}function Ll(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Il(e,t,n,r),i&2048&&Zc(9,t);break;case 1:Il(e,t,n,r);break;case 3:Il(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(i&2048){Il(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){sd(t,t.return,e)}}else Il(e,t,n,r);break;case 31:Il(e,t,n,r);break;case 13:Il(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Il(e,t,n,r):(a._visibility|=2,Rl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Il(e,t,n,r):zl(e,t),i&2048&&Pl(o,t);break;case 24:Il(e,t,n,r),i&2048&&Fl(t.alternate,t);break;default:Il(e,t,n,r)}}function Rl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Rl(a,o,s,c,i),Zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Rl(a,o,s,c,i)):u._visibility&2?Rl(a,o,s,c,i):zl(a,o),i&&l&2048&&Pl(o.alternate,o);break;case 24:Rl(a,o,s,c,i),i&&l&2048&&Fl(o.alternate,o);break;default:Rl(a,o,s,c,i)}t=t.sibling}}function zl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zl(n,r),i&2048&&Pl(r.alternate,r);break;case 24:zl(n,r),i&2048&&Fl(r.alternate,r);break;default:zl(n,r)}t=t.sibling}}var Bl=8192;function Vl(e,t,n){if(e.subtreeFlags&Bl)for(e=e.child;e!==null;)Hl(e,t,n),e=e.sibling}function Hl(e,t,n){switch(e.tag){case 26:Vl(e,t,n),e.flags&Bl&&e.memoizedState!==null&&$f(n,Dl,e.memoizedState,e.memoizedProps);break;case 5:Vl(e,t,n);break;case 3:case 4:var r=Dl;Dl=Tf(e.stateNode.containerInfo),Vl(e,t,n),Dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bl,Bl=16777216,Vl(e,t,n),Bl=r):Vl(e,t,n));break;default:Vl(e,t,n)}}function Ul(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ml=r,ql(r,e)}Ul(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gl(e),e=e.sibling}function Gl(e){switch(e.tag){case 0:case 11:case 15:Wl(e),e.flags&2048&&Qc(9,e,e.return);break;case 3:Wl(e);break;case 12:Wl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Kl(e)):Wl(e);break;default:Wl(e)}}function Kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ml=r,ql(r,e)}Ul(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qc(8,t,t.return),Kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Kl(t));break;default:Kl(t)}e=e.sibling}}function ql(e,t){for(;ml!==null;){var n=ml;switch(n.tag){case 0:case 11:case 15:Qc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ga(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ml=r;else a:for(n=e;ml!==null;){r=ml;var i=r.sibling,a=r.return;if(_l(r),r===n){ml=null;break a}if(i!==null){i.return=a,ml=i;break a}ml=a}}}var Jl={getCacheForType:function(e){var t=ca(ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ca(ma).controller.signal}},Yl=typeof WeakMap==`function`?WeakMap:Map,Xl=0,Zl=null,Ql=null,$l=0,eu=0,tu=null,nu=!1,ru=!1,iu=!1,au=0,ou=0,su=0,cu=0,lu=0,uu=0,du=0,fu=null,pu=null,mu=!1,hu=0,gu=0,_u=1/0,vu=null,yu=null,bu=0,xu=null,Su=null,Cu=0,wu=0,Tu=null,Eu=null,Du=0,Ou=null;function ku(){return Xl&2&&$l!==0?$l&-$l:k.T===null?ut():Dd()}function Au(){if(uu===0)if(!($l&536870912)||Vi){var e=Xe;Xe<<=1,!(Xe&3932160)&&(Xe=262144),uu=e}else uu=536870912;return e=co.current,e!==null&&(e.flags|=32),uu}function ju(e,t,n){(e===Zl&&(eu===2||eu===9)||e.cancelPendingCommit!==null)&&(Ru(e,0),Fu(e,$l,uu,!1)),rt(e,n),(!(Xl&2)||e!==Zl)&&(e===Zl&&(!(Xl&2)&&(cu|=n),ou===4&&Fu(e,$l,uu,!1)),bd(e))}function Mu(e,t,n){if(Xl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||et(e,t),a=r?Ku(e,t):Wu(e,t,!0),o=r;do{if(a===0){ru&&!r&&Fu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Pu(n)){a=Wu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=fu;var l=c.current.memoizedState.isDehydrated;if(l&&(Ru(c,s).flags|=256),s=Wu(c,s,!1),s!==2){if(iu&&!l){c.errorRecoveryDisabledLanes|=o,cu|=o,a=4;break a}o=pu,pu=a,o!==null&&(pu===null?pu=o:pu.push.apply(pu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ru(e,0),Fu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Fu(r,t,uu,!nu);break a;case 2:pu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=hu+300-Ne(),10<a)){if(Fu(r,t,uu,!nu),$e(r,0,!0)!==0)break a;Cu=t,r.timeoutHandle=sf(Nu.bind(null,r,n,pu,vu,mu,t,uu,cu,du,nu,o,`Throttled`,-0,0),a);break a}Nu(r,n,pu,vu,mu,t,uu,cu,du,nu,o,null,-0,0)}}break}while(1);bd(e)}function Nu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sn},Hl(t,a,d);var m=(a&62914560)===a?hu-Ne():(a&4194048)===a?gu-Ne():0;if(m=tp(d,m),m!==null){Cu=a,e.cancelPendingCommit=m($u.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Fu(e,a,o,!l);return}}$u(e,t,a,n,r,i,o,s,c)}function Pu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!kr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fu(e,t,n,r){t&=~lu,t&=~cu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ge(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function Iu(){return Xl&6?!0:(xd(0,!1),!1)}function Lu(){if(Ql!==null){if(eu===0)var e=Ql.return;else e=Ql,ea=$i=null,Lo(e),Ra=null,za=0,e=Ql;for(;e!==null;)Xc(e.alternate,e),e=e.return;Ql=null}}function Ru(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,B(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Cu=0,Lu(),Zl=e,Ql=n=gi(e.current,null),$l=t,eu=0,tu=null,nu=!1,ru=et(e,t),iu=!1,du=uu=lu=cu=su=ou=0,pu=fu=null,mu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ge(r),a=1<<i;t|=e[i],r&=~a}return au=t,oi(),n}function zu(e,t){yo=null,k.H=qs,t===ka||t===Aa?(t=Ia(),eu=3):t===N?(t=Ia(),eu=4):eu=t===dc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,tu=t,Ql===null&&(ou=1,ac(e,wi(t,e.current)))}function Bu(){var e=co.current;return e===null?!0:($l&4194048)===$l?lo===null:($l&62914560)===$l||$l&536870912?e===lo:!1}function Vu(){var e=k.H;return k.H=qs,e===null?qs:e}function Hu(){var e=k.A;return k.A=Jl,e}function Uu(){ou=4,nu||($l&4194048)!==$l&&co.current!==null||(ru=!0),!(su&134217727)&&!(cu&134217727)||Zl===null||Fu(Zl,$l,uu,!1)}function Wu(e,t,n){var r=Xl;Xl|=2;var i=Vu(),a=Hu();(Zl!==e||$l!==t)&&(vu=null,Ru(e,t)),t=!1;var o=ou;a:do try{if(eu!==0&&Ql!==null){var s=Ql,c=tu;switch(eu){case 8:Lu(),o=6;break a;case 3:case 2:case 9:case 6:co.current===null&&(t=!0);var l=eu;if(eu=0,tu=null,Xu(e,s,c,l),n&&ru){o=0;break a}break;default:l=eu,eu=0,tu=null,Xu(e,s,c,l)}}Gu(),o=ou;break}catch(t){zu(e,t)}while(1);return t&&e.shellSuspendCounter++,ea=$i=null,Xl=r,k.H=i,k.A=a,Ql===null&&(Zl=null,$l=0,oi()),o}function Gu(){for(;Ql!==null;)Ju(Ql)}function Ku(e,t){var n=Xl;Xl|=2;var r=Vu(),a=Hu();Zl!==e||$l!==t?(vu=null,_u=Ne()+500,Ru(e,t)):ru=et(e,t);a:do try{if(eu!==0&&Ql!==null){t=Ql;var o=tu;b:switch(eu){case 1:eu=0,tu=null,Xu(e,t,o,1);break;case 2:case 9:if(Ma(o)){eu=0,tu=null,Yu(t);break}t=function(){eu!==2&&eu!==9||Zl!==e||(eu=7),bd(e)},o.then(t,t);break a;case 3:eu=7;break a;case 4:eu=5;break a;case 7:Ma(o)?(eu=0,tu=null,Yu(t)):(eu=0,tu=null,Xu(e,t,o,7));break;case 5:var s=null;switch(Ql.tag){case 26:s=Ql.memoizedState;case 5:case 27:var c=Ql;if(s?Qf(s):c.stateNode.complete){eu=0,tu=null;var l=c.sibling;if(l!==null)Ql=l;else{var u=c.return;u===null?Ql=null:(Ql=u,Zu(u))}break b}}eu=0,tu=null,Xu(e,t,o,5);break;case 6:eu=0,tu=null,Xu(e,t,o,6);break;case 8:Lu(),ou=6;break a;default:throw Error(i(462))}}qu();break}catch(t){zu(e,t)}while(1);return ea=$i=null,k.H=r,k.A=a,Xl=n,Ql===null?(Zl=null,$l=0,oi(),ou):0}function qu(){for(;Ql!==null&&!je();)Ju(Ql)}function Ju(e){var t=Vc(e.alternate,e,au);e.memoizedProps=e.pendingProps,t===null?Zu(e):Ql=t}function Yu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Tc(n,t,t.pendingProps,t.type,void 0,$l);break;case 11:t=Tc(n,t,t.pendingProps,t.type.render,t.ref,$l);break;case 5:Lo(t);default:Xc(n,t),t=Ql=_i(t,au),t=Vc(n,t,au)}e.memoizedProps=e.pendingProps,t===null?Zu(e):Ql=t}function Xu(e,t,n,r){ea=$i=null,Lo(t),Ra=null,za=0;var i=t.return;try{if(uc(e,i,t,n,$l)){ou=1,ac(e,wi(n,e.current)),Ql=null;return}}catch(t){if(i!==null)throw Ql=i,t;ou=1,ac(e,wi(n,e.current)),Ql=null;return}t.flags&32768?(Vi||r===1?e=!0:ru||$l&536870912?e=!1:(nu=e=!0,(r===2||r===9||r===3||r===6)&&(r=co.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qu(t,e)):Zu(t)}function Zu(e){var t=e;do{if(t.flags&32768){Qu(t,nu);return}e=t.return;var n=Jc(t.alternate,t,au);if(n!==null){Ql=n;return}if(t=t.sibling,t!==null){Ql=t;return}Ql=t=e}while(t!==null);ou===0&&(ou=5)}function Qu(e,t){do{var n=Yc(e.alternate,e);if(n!==null){n.flags&=32767,Ql=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ql=e;return}Ql=e=n}while(e!==null);ou=6,Ql=null}function $u(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do id();while(bu!==0);if(Xl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ai,it(e,n,o,s,c,l),e===Zl&&(Ql=Zl=null,$l=0),Su=t,xu=e,Cu=n,wu=o,Tu=a,Eu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,pd(Le,function(){return ad(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,a=se.p,se.p=2,s=Xl,Xl|=4;try{hl(e,t,n)}finally{Xl=s,se.p=a,k.T=r}}bu=1,ed(),td(),nd()}}function ed(){if(bu===1){bu=0;var e=xu,t=Su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=se.p;se.p=2;var i=Xl;Xl|=4;try{Ol(t,e);var a=ef,o=Pr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Nr(s.ownerDocument.documentElement,s)){if(c!==null&&Fr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}hp=!!$d,ef=$d=null}finally{Xl=i,se.p=r,k.T=n}}e.current=t,bu=2}}function td(){if(bu===2){bu=0;var e=xu,t=Su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=se.p;se.p=2;var i=Xl;Xl|=4;try{gl(e,t.alternate,t)}finally{Xl=i,se.p=r,k.T=n}}bu=3}}function nd(){if(bu===4||bu===3){bu=0,Me();var e=xu,t=Su,n=Cu,r=Eu;t.subtreeFlags&10256||t.flags&10256?bu=5:(bu=0,Su=xu=null,rd(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(yu=null),lt(n),t=t.stateNode,Ue&&typeof Ue.onCommitFiberRoot==`function`)try{Ue.onCommitFiberRoot(He,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=se.p,se.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,se.p=i}}Cu&3&&id(),bd(e),i=e.pendingLanes,n&261930&&i&42?e===Ou?Du++:(Du=0,Ou=e):Du=0,xd(0,!1)}}function rd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function id(){return ed(),td(),nd(),ad()}function ad(){if(bu!==5)return!1;var e=xu,t=wu;wu=0;var n=lt(Cu),r=k.T,a=se.p;try{se.p=32>n?32:n,k.T=null,n=Tu,Tu=null;var o=xu,s=Cu;if(bu=0,Su=xu=null,Cu=0,Xl&6)throw Error(i(331));var c=Xl;if(Xl|=4,Gl(o.current),Ll(o,o.current,s,n),Xl=c,xd(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot==`function`)try{Ue.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{se.p=a,k.T=r,rd(e,t)}}function od(e,t,n){t=wi(n,t),t=sc(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(rt(e,2),bd(e))}function sd(e,t,n){if(e.tag===3)od(e,e,n);else for(;t!==null;){if(t.tag===3){od(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yu===null||!yu.has(r))){e=wi(n,e),n=cc(2),r=Xa(t,n,2),r!==null&&(lc(n,r,t,e),rt(r,2),bd(r));break}}t=t.return}}function cd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(iu=!0,i.add(n),e=ld.bind(null,e,t,n),t.then(e,e))}function ld(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zl===e&&($l&n)===n&&(ou===4||ou===3&&($l&62914560)===$l&&300>Ne()-hu?!(Xl&2)&&Ru(e,0):lu|=n,du===$l&&(du=0)),bd(e)}function ud(e,t){t===0&&(t=j()),e=li(e,t),e!==null&&(rt(e,t),bd(e))}function dd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ud(e,n)}function fd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ud(e,n)}function pd(e,t){return ke(e,t)}var md=null,hd=null,gd=!1,_d=!1,vd=!1,yd=0;function bd(e){e!==hd&&e.next===null&&(hd===null?md=hd=e:hd=hd.next=e),_d=!0,gd||(gd=!0,Ed())}function xd(e,t){if(!vd&&_d){vd=!0;do for(var n=!1,r=md;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ge(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Td(r,a))}else a=$l,a=$e(r,r===Zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,Td(r,a));r=r.next}while(n);vd=!1}}function Sd(){Cd()}function Cd(){_d=gd=!1;var e=0;yd!==0&&z()&&(e=yd);for(var t=Ne(),n=null,r=md;r!==null;){var i=r.next,a=F(r,t);a===0?(r.next=null,n===null?md=i:n.next=i,i===null&&(hd=n)):(n=r,(e!==0||a&3)&&(_d=!0)),r=i}bu!==0&&bu!==5||xd(e,!1),yd!==0&&(yd=0)}function F(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ge(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=tt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zl,n=$l,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(eu===2||eu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||et(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ae(r),lt(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=wd.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function wd(e,t){if(bu!==0&&bu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(id()&&e.callbackNode!==n)return null;var r=$l;return r=$e(e,e===Zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Mu(e,r,t),F(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?wd.bind(null,e):null)}function Td(e,t){if(id())return null;Mu(e,t,!0)}function Ed(){V(function(){Xl&6?ke(Fe,Sd):Cd()})}function Dd(){if(yd===0){var e=ya;e===0&&(e=Ye,Ye<<=1,!(Ye&261888)&&(Ye=256)),yd=e}return yd}function Od(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:on(``+e)}function kd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ad(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Od((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Od(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new On(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(yd!==0){var e=o?kd(i,o):new FormData(i);Ns(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?kd(i,o):new FormData(i),Ns(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var jd=0;jd<ti.length;jd++){var Md=ti[jd];ni(Md.toLowerCase(),`on`+(Md[0].toUpperCase()+Md.slice(1)))}ni(qr,`onAnimationEnd`),ni(Jr,`onAnimationIteration`),ni(Yr,`onAnimationStart`),ni(`dblclick`,`onDoubleClick`),ni(`focusin`,`onFocus`),ni(`focusout`,`onBlur`),ni(Xr,`onTransitionRun`),ni(Zr,`onTransitionStart`),ni(Qr,`onTransitionCancel`),ni($r,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Nd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Pd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Nd));function Fd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){M(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){M(e)}i.currentTarget=null,a=c}}}}function Id(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Bd(t,e,2,!1),n.add(r))}function Ld(e,t,n){var r=0;t&&(r|=4),Bd(n,e,r,t)}var Rd=`_reactListening`+Math.random().toString(36).slice(2);function zd(e){if(!e[Rd]){e[Rd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(Pd.has(t)||Ld(t,!1,e),Ld(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rd]||(t[Rd]=!0,Ld(`selectionchange`,!1,t))}}function Bd(e,t,n,r){switch(Sp(t)){case 2:var i=gp;break;case 8:i=_p;break;default:i=vp}n=i.bind(null,t,n,e),i=void 0,!_n||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Vd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=St(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}mn(function(){var r=a,i=ln(n),s=[];a:{var c=ei.get(e);if(c!==void 0){var l=On,u=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:l=Kn;break;case`focusin`:u=`focus`,l=Ln;break;case`focusout`:u=`blur`,l=Ln;break;case`beforeblur`:case`afterblur`:l=Ln;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Jn;break;case qr:case Jr:case Yr:l=Rn;break;case $r:l=Yn;break;case`scroll`:case`scrollend`:l=An;break;case`wheel`:l=Xn;break;case`copy`:case`cut`:case`paste`:l=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=qn;break;case`toggle`:case`beforetoggle`:l=Zn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=hn(m,p),g!=null&&d.push(Hd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==cn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Fn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Wd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&I(s,c,l,d,!1),u!==null&&f!==null&&I(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=_r;else if(dr(c))if(vr)v=Dr;else{v=Tr;var y=wr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&nn(r.elementType)&&(v=_r):v=Er;if(v&&=v(e,r)){fr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Jt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(dr(y)||y.contentEditable===`true`)&&(Lr=y,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(s,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(s,n,i)}var b;if($n)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else sr?ar(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(nr&&n.locale!==`ko`&&(sr||x!==`onCompositionStart`?x===`onCompositionEnd`&&sr&&(b=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,sr=!0)),y=Ud(r,x),0<y.length&&(x=new Bn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=or(n),b!==null&&(x.data=b)))),(b=tr?cr(e,n):lr(e,n))&&(x=Ud(r,`onBeforeInput`),0<x.length&&(y=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Ad(s,e,r,n,i)}Fd(s,t)})}function Hd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ud(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=hn(e,n),i!=null&&r.unshift(Hd(e,i,a)),i=hn(e,t),i!=null&&r.push(Hd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Wd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function I(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=hn(n,a),l!=null&&o.unshift(Hd(n,l,c))):i||(l=hn(n,a),l!=null&&o.push(Hd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Gd=/\r\n?/g,Kd=/\u0000|\uFFFD/g;function qd(e){return(typeof e==`string`?e:``+e).replace(Gd,`
|
|
9
|
-
`).replace(Kd,``)}function L(e,t){return t=qd(t),qd(e)===t}function Jd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Jd(e,t,`name`,a.name,a,null),Jd(e,t,`formEncType`,a.formEncType,a,null),Jd(e,t,`formMethod`,a.formMethod,a,null),Jd(e,t,`formTarget`,a.formTarget,a,null)):(Jd(e,t,`encType`,a.encType,a,null),Jd(e,t,`method`,a.method,a,null),Jd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Id(`scroll`,e);break;case`onScrollEnd`:r!=null&&Id(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Id(`beforetoggle`,e),Id(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Ft(e,n,r))}}function Yd(e,t,n,r,a,o){switch(n){case`style`:tn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Id(`scroll`,e);break;case`onScrollEnd`:r!=null&&Id(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function Xd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Id(`error`,e),Id(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Jd(e,t,o,s,n,null)}}a&&Jd(e,t,`srcSet`,n.srcSet,n,null),r&&Jd(e,t,`src`,n.src,n,null);return;case`input`:Id(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Jd(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Id(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Jd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Id(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Jd(e,t,s,c,n,null)}Zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Jd(e,t,l,r,n,null)}return;case`dialog`:Id(`beforetoggle`,e),Id(`toggle`,e),Id(`cancel`,e),Id(`close`,e);break;case`iframe`:case`object`:Id(`load`,e);break;case`video`:case`audio`:for(r=0;r<Nd.length;r++)Id(Nd[r],e);break;case`image`:Id(`error`,e),Id(`load`,e);break;case`details`:Id(`toggle`,e);break;case`embed`:case`source`:case`link`:Id(`error`,e),Id(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Jd(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Yd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Jd(e,t,c,r,n,null))}function Zd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Jd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Jd(e,t,p,m,r,f)}}Kt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Jd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Jd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Jd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Jd(e,t,s,a,r,o)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Jd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Jd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Jd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Jd(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Yd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Yd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Jd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Jd(e,t,f,p,r,m)}function Qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function R(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Qd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Qd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var $d=null,ef=null;function tf(e){return e.nodeType===9?e:e.ownerDocument}function nf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function rf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function af(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var of=null;function z(){var e=window.event;return e&&e.type===`popstate`?e===of?!1:(of=e,!0):(of=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,B=typeof clearTimeout==`function`?clearTimeout:void 0,cf=typeof Promise==`function`?Promise:void 0,V=typeof queueMicrotask==`function`?queueMicrotask:cf===void 0?sf:function(e){return cf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sf(e.ownerDocument.body);n=i}while(n);Vp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=W(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=W(e.nextSibling),e===null))return null;return e}function H(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=W(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function U(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _f(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function W(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vf=null;function yf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return W(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xf(e,t,n){switch(t=tf(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var Cf=new Map,wf=new Set;function Tf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ef=se.d;se.d={f:Df,r:Of,D:jf,C:Mf,L:Nf,m:Pf,X:If,S:Ff,M:Lf};function Df(){var e=Ef.f(),t=Iu();return e||t}function Of(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Fs(t):Ef.r(e)}var kf=typeof document>`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Xd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Xd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Xd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=Tt(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);Et(c),Xd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=Tt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),Et(a),Xd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=Tt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),Et(a),Xd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=he.current)?Tf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Gt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Xd(t,`link`,n),Et(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Gt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Xd(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Xd(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,Et(a),a):(r=n,(a=Cf.get(o))&&(r=m({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Xd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var G=null;function Yf(e,t,n){if(G===null){var r=new Map,i=G=new Map;i.set(n,r)}else i=G,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function $f(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=np.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Xd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=np.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ep=0;function tp(e,t){return e.stylesheets&&e.count===0&&ip(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ep===0&&(ep=62500*R());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ep?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rp=null;function ip(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rp=new Map,t.forEach(ap,e),rp=null,np.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=rp.get(e);if(n)var r=n.get(null);else{n=new Map,rp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=np.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=mi(3,null,null,t),e.current=a,a.stateNode=e,t=ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},qa(a),e}function lp(e){return e?(e=fi,e):fi}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ya(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Xa(e,r,t),n!==null&&(ju(n,e,t),Za(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=li(e,67108864);t!==null&&ju(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=ku();t=ct(t);var n=li(e,t);n!==null&&ju(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=2,vp(e,t,n,r)}finally{se.p=a,k.T=i}}function _p(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=8,vp(e,t,n,r)}finally{se.p=a,k.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)Vd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ge(o);s.entanglements[1]|=c,o&=~c}bd(a),!(Xl&6)&&(_u=Ne()+500,xd(0,!1))}}break;case 31:case 13:s=li(a,2),s!==null&&ju(s,a,2),Iu(),fp(a,2)}if(a=yp(r),a===null&&Vd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Vd(e,t,r,null,n)}}function yp(e){return e=ln(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=St(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=St(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,dt(e.priority,function(){mp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Ct(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Ns(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;up(n,ku(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Iu(),t[ht]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.6`)throw Error(i(527,Gp,`19.2.6`));se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{He=qp.inject(Kp),Ue=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=nc,s=rc,c=ic;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=cp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[ht]=t.current,zd(e),new Up(t)}})),_=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=g()})),v=e=>typeof e==`string`,y=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},b=e=>e==null?``:String(e),x=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},S=/###/g,C=e=>e&&e.includes(`###`)?e.replace(S,`.`):e,w=e=>!e||v(e),T=(e,t,n)=>{let r=v(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(w(e))return{};let t=C(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return w(e)?{}:{obj:e,k:C(r[i])}},E=(e,t,n)=>{let{obj:r,k:i}=T(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=T(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=T(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},D=(e,t,n,r)=>{let{obj:i,k:a}=T(e,t,Object);i[a]=i[a]||[],i[a].push(n)},O=(e,t)=>{let{obj:n,k:r}=T(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ee=(e,t,n)=>{let r=O(e,n);return r===void 0?O(t,n):r},te=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?v(e[r])||e[r]instanceof String||v(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):te(e[r],t[r],n):e[r]=t[r]);return e},ne=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),re={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},ie=e=>v(e)?e.replace(/[&<>"'\/]/g,e=>re[e]):e,ae=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},oe=[` `,`,`,`?`,`!`,`;`],k=new ae(20),se=(e,t,n)=>{t||=``,n||=``;let r=oe.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=k.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},ce=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},le=e=>e?.replace(/_/g,`-`),ue={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},A=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||ue,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>v(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),v(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},de=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},fe=class extends de{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):v(n)&&i?o.push(...n.split(i)):o.push(n)));let s=O(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!v(n)?s:ce(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),E(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(v(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=O(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?te(s,n,i):s={...s,...n},E(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},pe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},me=Symbol(`i18next/PATH_KEY`);function he(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===me?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function ge(e,t){let{[me]:n}=e(he()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var _e=e=>!v(e)&&typeof e!=`boolean`&&typeof e!=`number`,ve=class e extends de{constructor(e,t={}){super(),x([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=A.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=_e(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!se(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:v(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:v(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=ge(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?ge(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=i.count!==void 0&&!v(i.count),S=e.hasDefaultValue(i),C=x?this.pluralResolver.getSuffix(d,i.count,i):``,w=i.ordinal&&x?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,T=x&&!i.ordinal&&i.count===0,E=T&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${C}`]||i[`defaultValue${w}`]||i.defaultValue,D=m;b&&!m&&S&&(D=E);let O=_e(D),ee=Object.prototype.toString.apply(D);if(b&&D&&O&&!_.includes(ee)&&!(v(y)&&Array.isArray(D))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,D,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(D),t=e?[]:{},n=e?g:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${o}${e}`;S&&!m?t[e]=this.translate(r,{...i,defaultValue:_e(E)?E[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=D[e])}m=t}}else if(b&&v(y)&&Array.isArray(m))m=m.join(y),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&S&&(e=!0,m=E),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=S&&E!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,x&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?E:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=S&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);T&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||E)})}):n(e,s,E))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=v(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!v(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=v(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=pe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return v(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?ge(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!v(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(v(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!v(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},ye=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=A.create(`languageUtils`)}getScriptPartFromCode(e){if(e=le(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=le(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(v(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),v(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return v(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):v(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},be={zero:0,one:1,two:2,few:3,many:4,other:5},xe={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Se=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=A.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=le(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),xe;if(!e.match(/-|_/))return xe;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>be[e]-be[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Ce=(e,t,n,r=`.`,i=!0)=>{let a=ee(e,t,n);return!a&&i&&v(n)&&(a=ce(e,n,r),a===void 0&&(a=ce(t,n,r))),a},we=e=>e.replace(/\$/g,`$$$$`),Te=class{constructor(e={}){this.logger=A.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?ie:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?ne(i):a||`{{`,this.suffix=o?ne(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?ne(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?ne(l):``,this.nestingPrefix=d?ne(d):f||ne(`$t(`),this.nestingSuffix=p?ne(p):m||ne(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Ce(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ce(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>we(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?we(this.escape(e)):we(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=v(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !v(a)&&!this.useRawValueToEscape&&(a=b(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${ne(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!v(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!v(i))return i;v(i)||(i=b(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ee=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},De=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(le(r),i),t[o]=s),s(n)}},Oe=e=>(t,n,r)=>e(le(n),r)(t),ke=class{constructor(e={}){this.logger=A.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?De:Oe;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=De(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ee(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Ae=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},je=class extends de{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=A.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{D(n.loaded,[i],a),Ae(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();v(e)&&(e=this.languageUtils.toResolveHierarchy(e)),v(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Me=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),v(e[1])&&(t.defaultValue=e[1]),v(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ne=e=>(v(e.ns)&&(e.ns=[e.ns]),v(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),v(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Pe=()=>{},Fe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Ie=class e extends de{constructor(e={},t){if(super(),this.options=Ne(e),this.services={},this.logger=A,this.modules={external:[]},Fe(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(v(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Me();this.options={...n,...this.options,...Ne(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?A.init(r(this.modules.logger),this.options):A.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:ke;let t=new ye(this.options);this.store=new fe(this.options.resources,this.options);let n=this.services;n.logger=A,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Se(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Te(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new je(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new ve(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Pe,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=y(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Pe){let n=t,r=v(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=y();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Pe,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&pe.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=y();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=v(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(v(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=ge(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=ge(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=ge(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return v(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=y();return this.options.ns?(v(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=y();v(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new ye(Me());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Pe){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new fe(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Me().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Te(n)}return a.translator=new ve(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Ie.createInstance,Ie.dir,Ie.init,Ie.loadResources,Ie.reloadResources,Ie.use,Ie.changeLanguage,Ie.getFixedT,Ie.t,Ie.exists,Ie.setDefaultNamespace,Ie.hasLoadedNamespace,Ie.loadNamespaces,Ie.loadLanguages;var Le=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);We(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Re={},ze=(e,t,n,r)=>{We(n)&&Re[n]||(We(n)&&(Re[n]=new Date),Le(e,t,n,r))},Be=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Ve=(e,t,n)=>{e.loadNamespaces(t,Be(e,n))},He=(e,t,n,r)=>{if(We(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ve(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Be(e,r))},Ue=(e,t,n={})=>!t.languages||!t.languages.length?(ze(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),We=e=>typeof e==`string`,Ge=e=>typeof e==`object`&&!!e,Ke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qe={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},Je=e=>qe[e],Ye={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Ke,Je),transDefaultProps:void 0},Xe=(e={})=>{Ye={...Ye,...e}},Ze=()=>Ye,Qe,$e=e=>{Qe=e},et=()=>Qe,tt={type:`3rdParty`,init(e){Xe(e.options.react),$e(e)}},j=c(d()),nt=(0,j.createContext)(),rt=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},it=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),at=o(((e,t)=>{t.exports=it()})),ot=at(),st={t:(e,t)=>{if(We(t))return t;if(Ge(t)&&We(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},ct=()=>()=>{},lt=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,j.useContext)(nt)||{},a=n||r||et();a&&!a.reportNamespaces&&(a.reportNamespaces=new rt),a||ze(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,j.useMemo)(()=>({...Ze(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=We(l)?[l]:l||[`translation`],d=(0,j.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,j.useRef)(0),p=(0,j.useCallback)(e=>{if(!a)return ct;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,j.useRef)(),h=(0,j.useCallback)(()=>{if(!a)return st;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>Ue(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c,{scopeNs:d}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,j.useState)(0),{t:v,ready:y}=(0,ot.useSyncExternalStore)(p,h,h);(0,j.useEffect)(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?He(a,t.lng,d,e):Ve(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=(0,j.useRef)(null),S=(0,j.useRef)(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=(0,j.useMemo)(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(ze(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y)throw new Promise(e=>{let n=()=>e();t.lng?He(a,t.lng,d,n):Ve(a,d,n)});return w};function ut({i18n:e,defaultNS:t,children:n}){let r=(0,j.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,j.createElement)(nt.Provider,{value:r},n)}var dt={en:{common:{loading:`Loading...`,save:`Save`,cancel:`Cancel`,delete:`Delete`,edit:`Edit`,create:`Create`,search:`Search`,filter:`Filter`,reset:`Reset`,confirm:`Confirm`,close:`Close`,back:`Back`,next:`Next`,previous:`Previous`,submit:`Submit`,refresh:`Refresh`,export:`Export`,import:`Import`,yes:`Yes`,no:`No`,ok:`OK`,actions:`Actions`,more:`More`,selectAll:`Select All`,clearAll:`Clear All`,addToFavorites:`Add to favorites`,removeFromFavorites:`Remove from favorites`,noData:`No data`,noResults:`No results found`,required:`Required`,optional:`Optional`,selectOption:`Select an option`,select:`Select...`,openChat:`Open chat`,closeChat:`Close chat`,toggleSidebar:`Toggle sidebar`},validation:{required:`{{field}} is required`,minLength:`{{field}} must be at least {{min}} characters`,maxLength:`{{field}} must be at most {{max}} characters`,min:`{{field}} must be at least {{min}}`,max:`{{field}} must be at most {{max}}`,email:`Please enter a valid email address`,url:`Please enter a valid URL`,pattern:`{{field}} format is invalid`,unique:`{{field}} must be unique`,type:`{{field}} must be a valid {{type}}`},form:{addItem:`Add item`,removeItem:`Remove item`,fieldRequired:`This field is required`,invalidFormat:`Invalid format`,saveSuccess:`Saved successfully`,saveError:`Failed to save`,unsavedChanges:`You have unsaved changes. Are you sure you want to leave?`,stepOf:`Step {{current}} of {{total}}`,createTitle:`Create {{object}}`,editTitle:`Edit {{object}}`,createDescription:`Add a new {{object}} to your database.`,editDescription:`Update details for {{object}}`,saveRecord:`Save`,create:`Create`,update:`Update`,createSuccess:`{{object}} created successfully`,updateSuccess:`{{object}} updated successfully`,deleteSuccess:`{{object}} deleted successfully`},fields:{richText:{format:`Format: {{format}}`,basicEditorHint:`Rich text editor (basic)`,placeholder:`Enter text...`}},table:{rowsPerPage:`Rows per page`,showing:`Showing {{from}} to {{to}} of {{total}}`,noRows:`No rows to display`,sortAsc:`Sort ascending`,sortDesc:`Sort descending`,filterColumn:`Filter {{column}}`,columns:`Columns`,exportCSV:`Export CSV`,exportExcel:`Export Excel`,selectRow:`Select row`,selectAllRows:`Select all rows`,expandRow:`Expand row`,collapseRow:`Collapse row`,hideColumn:`Hide column`,freezeColumn:`Freeze column`,unfreezeColumn:`Unfreeze column`,pageInfo:`Page {{current}} of {{total}}`,totalRecords:`{{count}} total`,noResults:`No results found`,noResultsHint:`Try adjusting your filters or search query.`,cancelAll:`Cancel All`,saveAll:`Save All ({{count}})`,addRecord:`Add record`,open:`Open`,search:`Search...`,modified:`{{count}} row modified`,selected:`{{count}} selected`,edit:`Edit`,delete:`Delete`},grid:{actions:`Actions`,edit:`Edit`,delete:`Delete`,export:`Export`,exportAs:`Export as {{format}}`,loading:`Loading grid...`,errorLoading:`Error loading grid`,pullToRefresh:`Pull to refresh`,refreshing:`Refreshing…`,openRecord:`Open record`,openMenu:`Open menu`,rowHeight:`Row height: {{mode}}`,empty:`Empty`,yes:`Yes`,no:`No`,systemFields:`System`,toolbar:{densityMode:`Density`,densityCompact:`Compact`,densityComfortable:`Comfortable`,densitySpacious:`Spacious`,densityCycleHint:`{{label}} (click to cycle)`,densityCycleShortHint:`Click to cycle`},import:{title:`Import {{object}}`,stepUpload:`Upload`,stepMapping:`Mapping`,stepPreview:`Preview`,uploadDescription:`Upload a CSV file to get started.`,mappingDescription:`Map CSV columns to object fields.`,previewDescription:`Review data before importing.`,dragDrop:`Drag & drop a CSV file here, or click to browse`,browseFiles:`Browse Files`,onlyCsv:`Only CSV files are supported.`,fileNeedsHeader:`File must contain a header row and at least one data row.`,mappingTemplate:`Mapping template:`,chooseTemplate:`Choose template…`,noSavedTemplates:`No saved templates`,noneOption:`— None —`,saveCurrent:`Save current`,templateName:`Template name`,save:`Save`,deleteTemplate:`Delete template`,csvColumn:`CSV Column`,mapsTo:`Maps To`,status:`Status`,skipColumn:`Skip column`,skip:`— Skip —`,mapped:`Mapped`,skipped:`Skipped`,rowsWithErrors:`{{count}} row(s) with errors`,rowsCorrected:`{{count}} row(s) corrected`,clickToFix:`— click a highlighted cell to fix it inline.`,showingRows:`Showing {{shown}} of {{total}} rows`,importing:`Importing… {{progress}}%`,importComplete:`Import Complete`,imported:`{{count}} imported`,skippedCount:`{{count}} skipped`,moreErrors:`…and {{count}} more errors`,cancel:`Cancel`,back:`Back`,next:`Next`,close:`Close`,importNRows:`Import {{count}} Rows`,importingProgress:`Importing…`,requiredMark:`*`,required:`Required`,invalidType:`Invalid {{type}}`}},calendar:{today:`Today`,month:`Month`,week:`Week`,day:`Day`,agenda:`Agenda`,allDay:`All Day`,noEvents:`No events`,newEvent:`New event`,moreEvents:`+{{count}} more`},list:{recordCount:`{{count}} records`,recordCountOne:`{{count}} record`,addRecord:`Add record`,tabs:`Tabs`,allRecords:`All Records`,search:`Search`,filter:`Filter`,filterRecords:`Filter Records`,sort:`Sort`,sortRecords:`Sort Records`,group:`Group`,groupBy:`Group By`,export:`Export`,exportAs:`Export as {{format}}`,color:`Color`,rowColor:`Row Color`,colorByField:`Color by field`,clear:`Clear`,none:`None`,hideFields:`Hide fields`,noItems:`No items found`,noItemsMessage:`There are no records to display. Try adjusting your filters or adding new data.`,showAll:`Show all`,pullToRefresh:`Pull to refresh`,refreshing:`Refreshing…`,share:`Share`,print:`Print`,hideFieldsTitle:`Hide Fields`,dataLimitReached:`Showing first {{limit}} records. More data may be available.`,viewSettings:`View settings`,viewSettingsHint:`Grouping, color, density, and visible fields.`,addGroup:`Add group field`,collapsedByDefault:`Collapsed by default`,removeGroup:`Remove`},kanban:{addCard:`Add card`,addColumn:`Add column`,moveCard:`Move card`,deleteCard:`Delete card`,deleteColumn:`Delete column`,noCards:`No cards`,cardTitlePlaceholder:`Enter card title...`},timeline:{bucket:{overdue:`Overdue`,today:`Today`,tomorrow:`Tomorrow`,thisWeek:`This week`,nextWeek:`Next week`,later:`Later`,noDate:`No date`,unassigned:`Unassigned`}},gantt:{column:{taskName:`Task Name`,start:`Start`,end:`End`},toolbar:{prevPeriod:`Previous period`,nextPeriod:`Next period`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,jumpToToday:`Jump to today`,today:`Today`,showTaskList:`Show task list`,hideTaskList:`Hide task list`}},view:{rename:`Rename`,duplicateView:`Duplicate View`,shareView:`Share View`,setAsDefault:`Set as Default`,pinView:`Pin View`,unpinView:`Unpin View`,changeViewType:`Change View Type`,deleteView:`Delete View`,addView:`Add View`,unsavedChanges:`Unsaved changes`,saveAsView:`Save as View`,moreViews:`{{count}} more`,activeFilters:`Active filters`,activeSort:`Active sort`,manageViews:`Manage views`,manageAllViews:`Manage all views…`,searchViews:`Search views`,addNewView:`Add new view`,done:`Done`,noViewsFound:`No views match your search.`,dragToReorder:`Drag to reorder`,defaultView:`Default view`,tabActionsFor:`View actions for {{name}}`,readonlyAriaLabel:`Read-only view`,readonlyTooltip:`System view — duplicate to customize.`},detail:{back:`Back`,edit:`Edit`,editInline:`Edit`,save:`Save`,saveChanges:`Save changes`,saving:`Saving…`,editFieldsInline:`Edit fields`,lockedByApproval:`Locked for approval`,lockedTooltip:`This record has a pending approval request; editing is locked`,cancelApproval:`Recall approval`,cancelApprovalInFlight:`Recalling…`,cancelApprovalTooltip:`Recall the pending approval request to unlock this record`,cancelApprovalFailed:`Failed to recall approval`,cancelApprovalUnavailable:`Recalling approvals is not supported on this data source`,linkCopied:`Link copied to clipboard`,linkCopyFailed:`Failed to copy link`,cancel:`Cancel`,cancelEdit:`Discard changes`,sectionMoreDetails:`More details`,concurrentUpdateTitle:`This record was modified by someone else`,concurrentUpdateDescription:`Another user saved a newer version of {{field}} while you were editing. To prevent silently overwriting their change, please choose how to resolve the conflict.`,concurrentUpdateYourEdit:`Your edit`,concurrentUpdateCurrentValue:`Current value`,concurrentUpdateUpdatedBy:`Updated by {{name}}`,concurrentUpdateUpdatedAt:`Updated at {{when}}`,concurrentUpdateReload:`Reload latest`,concurrentUpdateOverwrite:`Overwrite anyway`,concurrentUpdateCancel:`Cancel`,openInNewTab:`Open in new tab`,share:`Share`,duplicate:`Duplicate`,export:`Export`,viewHistory:`View history`,delete:`Delete`,moreActions:`More actions`,addToFavorites:`Add to favorites`,removeFromFavorites:`Remove from favorites`,previousRecord:`Previous record`,nextRecord:`Next record`,recordOf:`{{current}} of {{total}}`,recordNotFound:`Record not found`,recordNotFoundDescription:`The record you are looking for does not exist or may have been deleted.`,goBack:`Go back`,details:`Details`,related:`Related`,relatedRecords:`{{count}} records`,relatedRecordOne:`{{count}} record`,noRelatedRecords:`No related records found`,loading:`Loading...`,copyToClipboard:`Copy to clipboard`,copied:`Copied!`,deleteConfirmation:`Are you sure you want to delete this record?`,editRecord:`Edit record`,viewAll:`View All`,new:`New`,emptyValue:`—`,activity:`Activity`,history:`History`,editRow:`Edit`,deleteRow:`Delete`,deleteRowConfirmation:`Are you sure you want to delete this record?`,deleteRowTitle:`Delete record`,actions:`Actions`,previousPage:`Previous`,nextPage:`Next`,pageOf:`Page {{current}} of {{total}}`,sortBy:`Sort by`,filterPlaceholder:`Filter...`,highlightFields:`Key Fields`,comments:`Comments`,searchComments:`Search comments…`,addCommentPlaceholder:`Add a comment… (Ctrl+Enter to submit)`,noMatchingComments:`No matching comments`,noCommentsYet:`No comments yet`,pinned:`Pinned`,pin:`Pin`,unpin:`Unpin`,justNow:`just now`,minutesAgo:`{{count}}m ago`,hoursAgo:`{{count}}h ago`,daysAgo:`{{count}}d ago`,createdBy:`Created by`,updatedBy:`Updated by`,dropFilesToUpload:`Drop files here or click to upload`,attachmentCount:`{{count}} attachment`,attachmentCountPlural:`{{count}} attachments`,removeAttachment:`Remove attachment`,unifiedDiff:`Unified diff`,sideBySideDiff:`Side-by-side diff`,noChanges:`No changes`,previousVersion:`Previous`,currentVersion:`Current`,discussion:`Discussion`,showDiscussion:`Show Discussion ({{count}})`,hideDiscussion:`Hide discussion`,bold:`Bold (Ctrl+B)`,italic:`Italic (Ctrl+I)`,listFormat:`List`,inlineCode:`Inline code`,mentionSomeone:`Mention someone`,preview:`Preview`,submitComment:`Submit (Ctrl+Enter)`,sendComment:`Send`,writeComment:`Write a comment…`,subscribedTooltip:`Subscribed — click to unsubscribe`,unsubscribedTooltip:`Subscribe to notifications`,firstRecord:`First record (Home)`,previousRecordKey:`Previous record (←)`,nextRecordKey:`Next record (→)`,lastRecord:`Last record (End)`,noRecords:`No records`,showEmptyRelated_one:`+ {{count}} empty`,showEmptyRelated_other:`+ {{count}} empty`,searchWhileNavigating:`Search while navigating`,searchRecords:`Search records…`,allActivity:`All Activity`,commentsOnly:`Comments Only`,fieldChangesFilter:`Field Changes`,tasksOnly:`Tasks Only`,leaveCommentPlaceholder:`Leave a comment… (Ctrl+Enter to submit)`,noActivity:`No activity recorded`,loadMore:`Load more`,edited:`(edited)`,via:`via {{source}}`,replyCount:`{{count}} reply`,replyCountPlural:`{{count}} replies`,replyPlaceholder:`Reply…`,filterActivity:`Filter activity`,openDiscussion:`Open discussion panel`,closeDiscussion:`Close discussion panel`,subscribeAriaLabel:`Subscribe to notifications`,unsubscribeAriaLabel:`Unsubscribe from notifications`,clearSearch:`Clear search`,copyEmail:`Copy email`,copyPhone:`Copy phone number`,copyRecordId:`Copy record ID`,showEmptyFields:`Show {{count}} empty fields`,hideEmptyFields:`Hide empty fields`,noValue:`No value`},chart:{noData:`No chart data available`,loading:`Loading chart...`},report:{rowTotal:`Row Total`,columnTotal:`Column Total`,grandTotal:`Grand Total`,totals:`Totals`,rowsLabel:`Row`,columnsLabel:`Column`,allLabel:`(All)`,emptyLabel:`(Empty)`,loading:`Loading…`,failedToLoad:`Failed to load matrix: {{message}}`,needsAcross:"Matrix report requires at least one `groupingsAcross` field.",aggregate:{count:`Count`,countDistinct:`Distinct Count`,sum:`Sum`,avg:`Average`,min:`Min`,max:`Max`,first:`First`},editor:{breadcrumb:`Configuration`,basic:`Basic`,title:`Title`,titlePlaceholder:`e.g. Pipeline by Quarter`,description:`Description`,descriptionPlaceholder:`What does this report show?`,type:`Report type`,typeTabular:`Tabular — flat list`,typeSummary:`Summary — grouped with totals`,typeMatrix:`Matrix — pivot rows × columns`,typeJoined:`Joined — multiple blocks`,typeHelp:`Pick the layout that matches what you want to see.`,data:`Data`,objectName:`Data source`,objectNamePlaceholder:`e.g. opportunity`,objectNameHelp:`Which object should this report query?`,limit:`Row limit`,limitPlaceholder:`e.g. 100`,columns:`Columns`,columnsHint:`Pick which fields appear as columns. Add an aggregate (Sum, Count…) on Summary or Matrix reports.`,filters:`Filters`,filtersHint:`Limit the rows that go into this report.`,filtersComplex:`This report uses an advanced filter that cannot be edited here. Save will keep it unchanged.`,groupBy:`Group by`,groupByHint:`Group the data and compute subtotals.`,rows:`Rows`,rowsHint:`Group rows by these fields.`,columnsAxis:`Columns`,columnsAxisHint:`Pivot these fields across the top.`,values:`Values`,valuesHint:`Numbers shown in each cell. Pick one or more fields and add an aggregate (Sum, Count…).`,grouping:`Grouping`,addGrouping:`Add grouping`,dateGranularity:`Date bucket`,dateGranularityNone:`(use raw value)`,day:`Day`,week:`Week`,month:`Month`,quarter:`Quarter`,year:`Year`,sortAsc:`Ascending`,sortDesc:`Descending`,chart:`Chart`,chartHint:`Optional visualization rendered alongside the table.`,chartType:`Chart type`,chartTitle:`Chart title`,chartTitlePlaceholder:`Defaults to the report title`,chartXAxis:`X-axis (category)`,chartYAxis:`Y-axis (value)`,chartShowLegend:`Show legend`,chartShowDataLabels:`Show data labels`,chartNone:`(no chart)`,chartBar:`Bar`,chartLine:`Line`,chartArea:`Area`,chartPie:`Pie`,chartDonut:`Donut`,chartFunnel:`Funnel`,validationNeedsObject:`Pick a data source before adding columns.`,validationMatrixNeedsRowsCols:`Matrix reports need at least one Row and one Column.`,validationSummaryNeedsRows:`Summary reports need at least one grouping field.`,blocks:`Blocks`,blocksHint:`Each block is its own table or chart. Block-level filters are ANDed with the report filter.`,addBlock:`Add block`,removeBlock:`Remove block`,blockName:`Block name`,blockNamePlaceholder:`unique_block_name`,blockLabel:`Display label`,blockLabelPlaceholder:`Shown above the block`,blockDescription:`Description`,blockDescriptionPlaceholder:`Optional context for this block`,validationJoinedNeedsBlocks:`Joined reports need at least one block.`,validationBlockNameRequired:`Every block needs a non-empty name.`,validationBlockNameDuplicate:`Block names must be unique within the report.`,validationBlockNeedsColumns:`Every block needs at least one column.`,noneOption:`(none)`,addCondition:`Add condition`,combineLogic:`Combine with`,opContains:`contains`,opIsEmpty:`is empty`,opIsNotEmpty:`is not empty`,formatAuto:`Auto`,formatCurrency:`Currency`,formatPercent:`Percent`,formatInteger:`Integer`,formatDate:`Date`,formatDatetime:`Date & time`,columnLabelPlaceholder:`Label override`,aggregateColumn:`Aggregate`,formatColumn:`Format`,addColumns:`Add fields`,searchFields:`Search fields…`,noMatchingFields:`No fields match your search.`,noFieldsAvailable:`No fields available.`,columnsCount:`{n} column(s) selected`,columnsEmpty:`No columns selected yet.`,fieldPickerTitle:`Select fields`,fieldPickerDescription:`Pick one or more fields to add. Use the search box to narrow the list.`,fieldPickerChangeTitle:`Change field`,fieldPickerAddGroupingTitle:`Add grouping`,fieldPickerEmpty:`(pick field)`,fieldPickerSelected:`{n} selected`,fieldPickerClear:`Clear selection`,fieldPickerAdd:`Add`,fieldPickerAddN:`Add {n}`}},map:{searchLocations:`Search locations…`,locationDetails:`Location Details`,markersCount:`{{count}} markers`,invalidCoordinates:`{{count}} record with missing or invalid coordinates excluded from the map.`,invalidCoordinatesPlural:`{{count}} records with missing or invalid coordinates excluded from the map.`},workflow:{draft:`Draft`,active:`Active`,paused:`Paused`,completed:`Completed`,cancelled:`Cancelled`,save:`Save`,publish:`Publish`,addNode:`Add Node`,workflowFlow:`Workflow Flow`,properties:`Properties`,connections:`Connections`,quickConnect:`Quick Connect`,fromPlaceholder:`From...`,toPlaceholder:`To...`,connect:`Connect`,label:`Label`,type:`Type`,description:`Description`,assignee:`Assignee`,assigneeType:`Assignee Type`,user:`User`,role:`Role`,group:`Group`,expression:`Expression`,timeoutMinutes:`Timeout (minutes)`,selectNodeToEdit:`Select a node to edit its properties`,workflowTitle:`Workflow Title`,newWorkflow:`New Workflow`,outConnections:`{{count}} out`,start:`Start`,end:`End`,task:`Task`,userTask:`User Task`,serviceTask:`Service Task`,scriptTask:`Script Task`,approval:`Approval`,condition:`Condition`,parallelGateway:`Parallel Gateway`,joinGateway:`Join Gateway`,boundaryEvent:`Boundary Event`,delay:`Delay`,notification:`Notification`,webhook:`Webhook`,allowConcurrency:`Allow (run concurrently)`,forbidConcurrency:`Forbid (skip new)`,replaceConcurrency:`Replace (cancel existing)`,queueConcurrency:`Queue (run after current)`,conditionEvent:`Condition`,manualEvent:`Manual`,webhookEvent:`Webhook`,timerEvent:`Timer`,signalEvent:`Signal`,versionHistory:`Version History`,importBpmn:`Import BPMN`,exportBpmn:`Export BPMN`,undo:`Undo`,redo:`Redo`,resetZoom:`Reset zoom`},dashboard:{addWidget:`Add widget`,removeWidget:`Remove widget`,editLayout:`Edit layout`,saveLayout:`Save layout`,resetLayout:`Reset layout`,total:`Total`,noDataAvailable:`No data available`,noDataSourceFor:`No data source available for`,trend:{vsLastQuarter:`vs last quarter`,vsLastMonth:`vs last month`,vsLastWeek:`vs last week`,vsLastYear:`vs last year`,vsYesterday:`vs yesterday`,vsPreviousPeriod:`vs previous period`}},configPanel:{save:`Save`,discard:`Discard`,close:`Close`,layout:`Layout`,columns:`Columns`,gap:`Gap`,rowHeight:`Row height`,data:`Data`,refreshInterval:`Refresh interval`,appearance:`Appearance`,title:`Title`,showDescription:`Show description`,theme:`Theme`,configuration:`Configuration`,general:`General`,advanced:`Advanced`},appDesigner:{createApp:`Create Application`,editApp:`Edit Application`,basicInfo:`Basic Info`,objects:`Objects`,navigation:`Navigation`,branding:`Branding`,appName:`App Name`,appTitle:`Title`,appDescription:`Description`,appIcon:`Icon`,template:`Template`,layout:`Layout`,layoutSidebar:`Sidebar`,layoutHeader:`Header`,layoutEmpty:`Empty`,selectObjects:`Select Objects`,searchObjects:`Search objects…`,selectAll:`Select All`,deselectAll:`Deselect All`,navBuilder:`Navigation Builder`,addGroup:`Add Group`,addUrl:`Add URL`,addSeparator:`Add Separator`,noNavItems:`No navigation items yet.`,logoUrl:`Logo URL`,primaryColor:`Primary Color`,faviconUrl:`Favicon URL`,preview:`Preview`,complete:`Complete`,snakeCaseHint:`Must be snake_case (e.g. my_app)`,modeEdit:`Edit`,modePreview:`Preview`,modeCode:`Code`,addWidget:`Add Widget`,widgetProperties:`Widget Properties`,dataSource:`Data Source`,valueField:`Value Field`,aggregate:`Aggregate`,colorVariant:`Color Variant`,addComponent:`Add Component`,componentProperties:`Component Properties`,viewType:`View Type`,fields:`Fields`,toolbar:`Toolbar`,showSearch:`Show Search`,showFilters:`Show Filters`,showSort:`Show Sort`,appearance:`Appearance`,rowHeight:`Row Height`,stripedRows:`Striped Rows`,bordered:`Bordered`,livePreview:`Live Preview`,stepBasicDesc:`Name, title, and layout`,stepObjectsDesc:`Select business objects`,stepNavigationDesc:`Build navigation tree`,stepBrandingDesc:`Logo, colors, and favicon`,noObjectsFound:`No objects found.`,noNavItemsHint:`No navigation items yet. Select objects in the previous step or add items manually.`,separator:`Separator`,separatorLabel:`— Separator —`,newGroup:`New Group`,newLink:`New Link`,saveDraft:`Save Draft`,cancelConfirmTitle:`Discard changes?`,cancelConfirmMessage:`You have unsaved changes. Are you sure you want to cancel?`,confirmDiscard:`Discard`,keepEditing:`Keep Editing`,navNoItems:`No navigation items. Click buttons above to add items.`,navNoPreviewItems:`No items`,navLivePreview:`Live Preview`,navCollapseGroup:`Collapse group`,navExpandGroup:`Expand group`,navAddChild:`Add child`,navMoveUp:`Move up`,navMoveDown:`Move down`,navRemove:`Remove`,navObjectPage:`Object Page`,navDashboard:`Dashboard`,navPage:`Page`,navReport:`Report`,navGroup:`Group`,navUrl:`URL`,navSeparator:`Separator`,navTypeObject:`Object`,navTypeDashboard:`Dashboard`,navTypePage:`Page`,navTypeReport:`Report`,navTypeUrl:`URL`,navTypeGroup:`Group`,navTypeSeparator:`Separator`,navTypeAction:`Action`,navEditIcon:`Edit icon`,navToggleVisible:`Toggle visibility`,navHidden:`Hidden`,navExportSchema:`Export JSON`,navImportSchema:`Import JSON`,navExportSuccess:`Navigation schema exported`,navImportSuccess:`Navigation schema imported`,navImportError:`Invalid navigation JSON`,navIconPlaceholder:`Icon name (e.g. Users)`,dashboardEditor:`Dashboard Editor`,noWidgets:`No widgets. Click a button above to add one.`,widgetLayoutSize:`Layout Size`,widgetWidth:`Width`,widgetHeight:`Height`,dashboardPreview:`Dashboard Preview`,noWidgetsPreview:`No widgets to preview`,pageCanvasEditor:`Page Canvas Editor`,emptyPage:`Empty page. Click a button above to add a component.`,pagePreview:`Page Preview`,noComponentsPreview:`No components to preview`,modePage:`Page`,modeDashboard:`Dashboard`,undo:`Undo`,redo:`Redo`,brandingEditor:`Branding Editor`,brandingExport:`Export JSON`,brandingImport:`Import JSON`,brandingPreview:`Preview`,brandingSampleButton:`Sample Button`,brandingSampleText:`This is how your brand theme will look.`,colorPalette:`Color Palette`,fontFamily:`Font Family`,fontDefault:`Default (System)`,modeLight:`Light`,modeDark:`Dark`,mobilePreview:`Mobile Preview`,objectManager:{title:`Object Manager`,addObject:`New Object`,searchPlaceholder:`Search objects…`,noObjects:`No objects found.`,objectName:`API Name`,objectLabel:`Label`,pluralLabel:`Plural Label`,icon:`Icon`,selectIcon:`Select icon…`,group:`Group`,noGroup:`No Group`,sortOrder:`Sort Order`,enabled:`Enabled`,relationships:`Relationships`,systemBadge:`System`,fieldCount:`{{count}} fields`,ungrouped:`Ungrouped`,deleteConfirmTitle:`Delete Object?`,deleteConfirmMessage:`This will permanently delete the object and all its fields. This action cannot be undone.`},fieldDesigner:{title:`Field Designer`,addField:`New Field`,searchPlaceholder:`Search fields…`,allTypes:`All Types`,noFields:`No fields found.`,fieldName:`API Name`,fieldLabel:`Label`,fieldType:`Type`,fieldGroup:`Group`,description:`Description`,required:`Required`,unique:`Unique`,readOnly:`Read Only`,hidden:`Hidden`,indexed:`Indexed`,externalId:`External ID`,trackHistory:`Track History`,defaultValue:`Default Value`,placeholder:`Placeholder`,referenceTo:`Reference To`,formula:`Formula`,options:`Options`,addOption:`Add Option`,validationRules:`Validation Rules`,addRule:`Add Rule`,systemBadge:`System`,ungrouped:`General`,deleteConfirmTitle:`Delete Field?`,deleteConfirmMessage:`This will permanently delete the field. Existing data in this field will be lost.`,basicSection:`Basic`,typeSpecificSection:`Type Settings`,advancedSection:`Advanced`,typeCategory:{text:`Text`,number:`Number`,date:`Date & Time`,choice:`Choice`,relation:`Relation`,advanced:`Advanced`}}},console:{title:`ObjectStack Console`,initializing:`Initializing application...`,search:`Search…`,breadcrumb:{dashboards:`Dashboards`,pages:`Pages`,reports:`Reports`,system:`System`},nav:{pinItem:`Pin {{name}}`,unpinItem:`Unpin {{name}}`,dragToReorder:`Drag to reorder`,favorites:`Favorites`},loadingSteps:{connecting:`Connecting to data source`,loadingConfig:`Loading configuration`,preparingWorkspace:`Preparing workspace`},error:{connectionFailed:`Cannot connect to server`,serverUnreachable:`The server at {{url}} is unreachable.`,checkServer:`Please check your network connection or that the backend is running.`,timeout:`Connection timed out after 10 seconds.`},actions:{retry:`Retry`,retrying:`Retrying…`},shortcuts:{title:`Keyboard Shortcuts`,description:`Quick reference for all available keyboard shortcuts.`,groups:{general:`General`,navigation:`Navigation`,dataViews:`Data Views`,preferences:`Preferences`},openCommandPalette:`Open command palette`,showShortcuts:`Show keyboard shortcuts`,closeDialog:`Close dialog / panel`,toggleSidebar:`Toggle sidebar`,focusSearch:`Focus search`,createRecord:`Create new record`,refreshData:`Refresh data`,editRecord:`Edit selected record`,toggleDarkMode:`Toggle dark mode`},commandPalette:{placeholder:`Type a command or search...`,noResults:`No results found.`,searching:`Searching…`,records:`Records`,recentRecords:`Recently viewed`,objects:`Objects`,dashboards:`Dashboards`,pages:`Pages`,reports:`Reports`,switchApp:`Switch App`,current:`Current`,preferences:`Preferences`,lightTheme:`Light Theme`,darkTheme:`Dark Theme`,systemTheme:`System Theme`,actions:`Actions`,openFullSearch:`Open Full Search Page`,createApp:`Create New App`},errors:{somethingWentWrong:`Something went wrong`,unexpectedError:`An unexpected error occurred while rendering this view.`,tryAgain:`Try Again`,goHome:`Go Home`,errorDetails:`Error Details (dev only)`},theme:{toggle:`Toggle theme`,light:`Light`,dark:`Dark`,system:`System`},objectView:{objectNotFound:`Object Not Found`,objectNotFoundDescription:`The object "{{objectName}}" does not exist in the current configuration.`,objectNotFoundHint:`Check your app navigation settings or select a different object from the sidebar.`,allRecords:`All Records`,exitDesignMode:`Exit Design Mode`,enterDesignMode:`Enter Design Mode`,metadataInspector:`Metadata Inspector`,editView:`Edit View`,addView:`Add View`,designTools:`Design tools`,new:`New`,import:`Import`,importTitle:`Import from CSV`,importedToast:`Imported {{count}} row(s).`,importedWithSkipped:`Imported {{ok}} row(s); skipped {{skipped}}.`,configureView:`Configure View`,closePanel:`Close panel`,showAdvancedSettings:`Show advanced settings`,showFewerSettings:`Show fewer settings`,page:`Page`,pageConfigHint:`Toolbar, navigation & view shell settings`,listConfigHint:`Data rendering, columns & appearance for this list type`,general:`General`,generalHint:`View title, description, and type`,toolbar:`Toolbar`,toolbarHint:`Search, filter, sort, group, and density toggles`,toolbarEnabledCount:`{{count}} of {{total}} enabled`,navigationSection:`Navigation`,navigationHint:`Row click behavior and detail view settings`,records:`Records`,recordsHint:`Selection mode, add record, and inline editing`,exportPrint:`Export & Print`,exportPrintHint:`Export formats, printing, and record count display`,showAllFields:`Show All`,hideAllFields:`Hide All`,searchFields:`Search fields...`,title:`Title`,description:`Description`,data:`Data`,source:`Source`,columns:`Columns`,filterBy:`Filter by`,sortBy:`Sort by`,appearance:`Appearance`,showDescription:`Show description`,viewType:`View type`,userFilters:`User filters`,enableSearch:`Enable search`,enableFilter:`Enable filter`,enableSort:`Enable sort`,enableHideFields:`Enable hide fields`,enableGroup:`Enable group`,enableColor:`Enable color`,enableDensity:`Enable density`,userActions:`User actions`,addRecordViaForm:`Add records through a form`,advanced:`Advanced`,allowExport:`Allow export`,recordCount:`{{count}} records`,noDescription:`No description`,none:`None`,columnsConfigured:`{{count}} columns`,save:`Save`,discard:`Discard`,createView:`Create View`,createViewDesc:`Pick a view type, then give it a name. You can change every setting afterwards.`,cancel:`Cancel`,create:`Create`,delete:`Delete`,deleteViewTitle:`Delete view`,deleteViewConfirm:`Are you sure you want to delete the view "{{name}}"? This cannot be undone.`,bulkDeleteConfirm:`Delete {{count}} selected records? This cannot be undone.`,duplicateViewName:`A view with this name already exists.`,viewTypeGrid:`Grid`,viewTypeGridDesc:`A spreadsheet-style table of records.`,viewTypeKanban:`Kanban`,viewTypeKanbanDesc:`Cards grouped into columns by a single-select field.`,viewTypeCalendar:`Calendar`,viewTypeCalendarDesc:`Records placed on a monthly calendar by date.`,viewTypeGallery:`Gallery`,viewTypeGalleryDesc:`Large image cards driven by an attachment field.`,viewTypeTimeline:`Timeline`,viewTypeTimelineDesc:`Records along a horizontal time axis.`,viewTypeGantt:`Gantt`,viewTypeGanttDesc:`Project bars with start / end and dependencies.`,viewTypeMap:`Map`,viewTypeMapDesc:`Geographic markers from latitude / longitude fields.`,viewTypeChart:`Chart`,viewTypeChartDesc:`Aggregated bar / line / pie visualisations.`,newView:`New View`,typeOptions:`Type Options`,groupByField:`Group by field`,groupByFieldHelp:`The kanban groups records into columns by this field's values.`,startDateField:`Start date field`,startDateFieldHelp:`The calendar places records on the cell matching this date.`,ganttStartDateFieldHelp:`The left edge of each Gantt bar uses this date.`,ganttEndDateFieldHelp:`The right edge of each Gantt bar uses this date.`,timelineDateFieldHelp:`Records are placed on the timeline by this date.`,titleField:`Title field`,latitudeField:`Latitude field`,latitudeFieldHelp:`Field providing the latitude coordinate (geo fields only).`,longitudeField:`Longitude field`,longitudeFieldHelp:`Field providing the longitude coordinate (geo fields only).`,imageField:`Image field`,imageFieldHelp:`The gallery cover comes from this image or attachment field.`,dateField:`Date field`,selectField:`Select field...`,selectOption:`Select...`,noEligibleFieldForType:`No eligible field of this type. Add one to the object first.`,viewTypeUnavailable:`This object has no field that can serve as "{{field}}".`,viewTypeUnavailableShort:`Not supported by this object.`,chartType:`Chart type`,chartTypeHelp:`Determines how the data is rendered.`,chartTypeBar:`Bar chart`,chartTypeLine:`Line chart`,chartTypePie:`Pie chart`,chartTypeArea:`Area chart`,chartTypeScatter:`Scatter chart`,xAxisField:`X-axis field`,xAxisFieldHelp:`The categorical or time dimension.`,yAxisField:`Y-axis field`,yAxisFieldHelp:`The numeric field to aggregate.`,gridOptionsHint:`Grid view uses the columns configured above.`,groupBy:`Group by`,prefixField:`Prefix field`,fields:`Fields`,fieldsVisible:`{{count}} visible`,sortsCount:`{{count}} sorts`,filtersCount:`{{count}} filters`,endDateField:`End date field`,color:`Color`,fieldTextColor:`Field text color`,rowHeight:`Row height`,wrapHeaders:`Wrap headers`,showFieldDescriptions:`Show field descriptions`,collapseAllByDefault:`Collapse all by default`,striped:`Striped rows`,bordered:`Bordered cells`,inlineEdit:`Edit records inline`,addDeleteRecordsInline:`Add/delete records inline`,clickIntoRecordDetails:`Click into record details`,navigationMode:`Navigation mode`,navigationWidth:`Navigation width`,navigationWidthHint:`Available for drawer, modal, and split navigation modes`,openNewTab:`Open in new tab`,openNewTabHint:`Available for page and new window navigation modes`,selectionMode:`Selection mode`,selectionNone:`None`,selectionSingle:`Single`,selectionMultiple:`Multiple`,pageSize:`Page size`,pageSizeOptions:`Page size options`,exportFormats:`Export formats`,exportMaxRecords:`Max records`,exportIncludeHeaders:`Include headers`,exportFileNamePrefix:`File name prefix`,searchableFields:`Searchable fields`,filterableFields:`Filterable fields`,resizableColumns:`Resizable columns`,densityCompact:`Compact`,densityComfortable:`Comfortable`,densitySpacious:`Spacious`,densityMode:`Density mode`,hiddenFields:`Hidden fields`,rowActions:`Row actions`,bulkActions:`Bulk actions`,sharing:`Sharing`,sharingEnabled:`Enable sharing`,sharingVisibility:`Visibility`,addRecordEnabled:`Enable add record`,addRecordPosition:`Position`,addRecordMode:`Mode`,addRecordFormView:`Form view`,conditionalFormatting:`Conditional formatting`,addRule:`Add rule`,quickFilters:`Quick filters`,addQuickFilter:`Add quick filter`,ufElements:`Elements`,ufDropdown:`Dropdown`,ufTabs:`Tabs`,ufToggle:`Toggle`,ufAddField:`+ Add filter field...`,ufNoFields:`No fields available`,ufAddTab:`+ Add tab`,ufTabLabel:`Label`,ufShowAllRecords:`Show "All records" tab`,ufAllowAddTab:`Allow adding tabs`,showRecordCount:`Show record count`,allowPrinting:`Allow printing`,virtualScroll:`Virtual scroll`,emptyStateTitle:`Empty state title`,emptyStateMessage:`Empty state message`,emptyStateIcon:`Empty state icon`,ariaLabel:`ARIA label`,ariaDescribedBy:`ARIA described by`,ariaLive:`ARIA live`,accessibility:`Accessibility`,viewTabs:`View Tabs`},localeSwitcher:{label:`Language`}},auth:{login:{title:`Sign in to your account`,description:`Enter your email and password to continue`,emailLabel:`Email`,emailPlaceholder:`name@example.com`,passwordLabel:`Password`,passwordPlaceholder:`Enter your password`,forgotPasswordText:`Forgot password?`,submitButton:`Sign In`,submittingButton:`Signing in...`,noAccountText:`Don't have an account?`,signUpText:`Sign up`},register:{title:`Create an account`,description:`Enter your information to get started`,nameLabel:`Name`,namePlaceholder:`John Doe`,emailLabel:`Email`,emailPlaceholder:`name@example.com`,passwordLabel:`Password`,passwordPlaceholder:`Create a password (min. 8 characters)`,confirmPasswordLabel:`Confirm Password`,confirmPasswordPlaceholder:`Confirm your password`,passwordMismatchError:`Passwords do not match`,passwordTooShortError:`Password must be at least 8 characters`,submitButton:`Create Account`,submittingButton:`Creating account...`,hasAccountText:`Already have an account?`,signInText:`Sign in`},forgotPassword:{title:`Reset your password`,description:`Enter your email address and we'll send you a link to reset your password`,emailLabel:`Email`,emailPlaceholder:`name@example.com`,submitButton:`Send Reset Link`,submittingButton:`Sending...`,successTitle:`Check your email`,successDescription:`We've sent a password reset link to {{email}}. Please check your inbox.`,backToSignInText:`Back to sign in`,rememberPasswordText:`Remember your password?`,signInText:`Sign in`}},errors:{networkError:`Network error. Please check your connection.`,serverError:`Server error. Please try again later.`,notFound:`Resource not found.`,unauthorized:`You are not authorized to perform this action.`,forbidden:`Access denied.`,timeout:`Request timed out. Please try again.`,unknown:`An unexpected error occurred.`},workspace:{label:`Workspaces`,default:`My Workspace`,switch:`Switch workspace`,create:`Create workspace`,createTitle:`Create a workspace`,createDescription:`A workspace is a shared space for your team to collaborate.`,createButton:`Create workspace`,nameLabel:`Workspace name`,namePlaceholder:`e.g., Acme Inc`,slugLabel:`URL slug`,slugHint:`Used in URLs. Only lowercase letters, numbers, and hyphens.`,invite:`Invite member`,members:`Members`,settings:`Workspace settings`},sidebar:{settings:`Settings`,help:`Help`,helpTooltip:`Help & Documentation`,activityFeed:`Activity feed`,notifications:`Notifications`,approvals:`Approvals`,inbox:`Inbox`,inboxAriaLabel:`Open inbox`,area:`Area`,recent:`Recent`,favorites:`Favorites`,starred:`Starred`,removeFromFavorites:`Remove {{name}} from favorites`},home:{title:`Home`,subtitle:`Your workspace dashboard`,nav:`Home`,allApps:`All Applications`,greetingMorning:`Good morning`,greetingAfternoon:`Good afternoon`,greetingEvening:`Good evening`,greetingNight:`Working late`,heroTagline:`Pick up where you left off, or explore something new.`,open:`Open`,stats:{apps:`Applications`,starred:`Starred`,recent:`Recent items`},loading:`Loading workspace...`,recent:`Recent`,starred:`Starred`,welcome:`Welcome to ObjectUI`,welcomeDescription:`Get started by creating your first application or configure your system settings.`,createFirstApp:`Create Your First App`,systemSettings:`System Settings`,browseMarketplace:`Browse App Marketplace`,quickActions:{title:`Quick Actions`,createApp:`Create App`,createAppDesc:`Start with a new application`,manageObjects:`Manage Objects`,manageObjectsDesc:`Configure data models`,systemSettings:`System Settings`,systemSettingsDesc:`Configure your workspace`},recentApps:{title:`Recently Accessed`,itemType:{object:`Object`,dashboard:`Dashboard`,page:`Page`,record:`Record`}},starredApps:{title:`Starred`},gettingStarted:{title:`Make this home yours`,description:`Star an app to pin it here for one-click access. Anything you open will show up under Recently Accessed automatically.`,cta:`Browse all applications`},appCard:{noDescription:`No description`,default:`Default`}},layout:{appSwitcher:{home:`Home`,addApp:`Add App`,editApp:`Edit App`,manageAllApps:`Manage All Apps`,systemConsole:`System Console`,noAppsConfigured:`No apps configured`},activityFeed:{title:`Recent Activity`,filter:`Filter`,empty:`No recent activity`,viewAll:`View all activity`,ariaLabel:`Activity feed`,typeCreate:`Create`,typeUpdate:`Update`,typeDelete:`Delete`,typeComment:`Comment`,relativeJustNow:`just now`,relativeSecondsAgo:`{{count}}s ago`,relativeMinutesAgo:`{{count}}m ago`,relativeHoursAgo:`{{count}}h ago`,relativeDaysAgo:`{{count}}d ago`},metadata:{label:`Metadata`,toggleTitle:`Toggle Metadata Inspector`,panelTitle:`Metadata Inspector`,jsonBadge:`JSON`,copyJson:`Copy JSON`}},search:{title:`Search`,back:`Back`,placeholder:`Search objects, dashboards, pages, reports...`,inputAriaLabel:`Search objects, dashboards, pages, reports`,resultsCount:`{{count}} result for "{{query}}"`,resultsCountPlural:`{{count}} results for "{{query}}"`,itemsAvailable:`{{count}} items available`,noResults:`No results found`,noResultsHint:`Try adjusting your search terms`,typeObjects:`Objects`,typeDashboards:`Dashboards`,typePages:`Pages`,typeReports:`Reports`,badgeObject:`object`,badgeDashboard:`dashboard`,badgePage:`page`,badgeReport:`report`},empty:{objectNotFound:`Object Not Found`,objectNotFoundDescription:`Object "{{name}}" definition missing. Check your configuration or navigate back to select a valid object.`,recordNotFound:`Record not found`,recordNotFoundDescription:`The record you are looking for does not exist or may have been deleted.`,pageNotFound:`Page Not Found`,pageNotFoundDescription:`The page "{{name}}" could not be found. It may have been removed or renamed.`,dashboardNotFound:`Dashboard Not Found`,dashboardNotFoundDescription:`The dashboard "{{name}}" could not be found. It may have been removed or renamed.`,reportNotFound:`Report Not Found`,reportNotFoundDescription:`The report "{{name}}" could not be found. It may have been removed or renamed.`,noAppsConfigured:`No Apps Configured`,noAppsConfiguredDescription:`No applications have been registered. Create your first app or visit System Settings to configure your environment.`,createFirstApp:`Create Your First App`,systemSettings:`System Settings`,back:`Back`},renderer:{noPageSchema:`No page schema provided`,noFormSchema:`No form schema provided`,noDashboardSchema:`No dashboard schema provided`,pageRendering:`Page rendering: {{name}}`,dashboardRendering:`Dashboard rendering: {{name}}`,formRenderingMode:`Form rendering in {{mode}} mode`,formRenderingFor:`for record {{id}}`,createRecord:`Create Record`,editRecord:`Edit Record`,page:`Page`,dashboard:`Dashboard`,save:`Save`,cancel:`Cancel`},actionDialog:{title:`Action Parameters`,description:`Please provide the required information to continue.`,selectPlaceholder:`Select {{label}}`,requiredError:`{{label}} is required`,lookupPlaceholder:`Paste the {{label}} record id (UUID)`,lookupHelpText:`Enter the record id of the referenced object. A picker is coming soon.`,cancel:`Cancel`,confirm:`Confirm`,defaultActionTitle:`Action`,ok:`OK`},rowAction:{openMenu:`Open menu`,edit:`Edit`,delete:`Delete`},navigationSync:{addedPage:`Navigation updated: added page "{{name}}"`,addedDashboard:`Navigation updated: added dashboard "{{name}}"`,removedPage:`Navigation updated: removed page "{{name}}"`,removedDashboard:`Navigation updated: removed dashboard "{{name}}"`,renamedPage:`Navigation updated: renamed page "{{oldName}}" → "{{newName}}"`,renamedDashboard:`Navigation updated: renamed dashboard "{{oldName}}" → "{{newName}}"`,undoLabel:`Undo`,undone:`Navigation change undone`,undoFailed:`Failed to undo navigation change`,updateFailed:`Failed to update navigation`},objectActions:{deleteSuccess:`{{label}} deleted successfully`,deleteFailed:`Failed to delete {{label}}`,noRecordId:`No record ID provided`,deleteConfirm:`Are you sure you want to delete this record?`,bulkDeleteSuccess:`Deleted {{count}} {{label}} records`,bulkDeletePartial:`{{succeeded}} deleted, {{failed}} failed`},objectViewActions:{renameFailed:`Failed to rename view`,deleteFailed:`Failed to delete view`},dashboardActions:{pdfPreparing:`Preparing PDF export…`,exportFailed:`Export failed: {{message}}`,forecastSoon:`Forecast view coming soon`},recordDetail:{viewersTooltip:`Users viewing this record`},cellRender:{empty:`Empty`,yes:`Yes`,no:`No`,systemFields:`System`},user:{profile:`Profile`,settings:`Settings`,logout:`Log out`,preferences:`Preferences`,theme:`Theme`,language:`Language`},organizations:{mine:`My Organizations`,title:`Organizations`,heading:`Your Organizations`,subtitle:`Select an organization to continue, or create a new one.`,searchPlaceholder:`Search for an organization`,new:`New organization`,current:`Current organization`,manage:`Manage`,emptyTitle:`No organizations yet`,emptyDescription:`Create your first organization to get started.`,noMatches:`No organizations match your search.`},notifications:{empty:`No notifications`,emptyUnread:`You're all caught up`,filterUnread:`Unread`,filterAll:`All`,markAllRead:`Mark all read`,viewAll:`View all notifications`,approvalsPending:`{{count}} pending approvals`,viewApprovals:`View approvals`,noPendingApprovals:`No pending approvals`,openApprovalsInbox:`Open Approvals Inbox`},publicForm:{submit:`Submit`,submitting:`Submitting…`,submitAnother:`Submit another response`,poweredBy:`Powered by ObjectStack`,secureNotice:`Your information is transmitted securely and only used to respond to your request.`,thankYouTitle:`Thank you!`,thankYouMessage:`Your submission has been received successfully.`,redirecting:`Redirecting in {{seconds}} seconds…`,unavailableTitle:`Form unavailable`,unavailableDescription:`No public form is available at this URL. Make sure the underlying view has anonymous sharing enabled and matches this slug.`,tryDemo:`Try the demo`,retry:`Retry`,loading:`Loading form…`,requiredHint:`* Required field`,consentLabelDefault:`I agree to the privacy policy and consent to my data being processed for this request.`,consentLink:`Privacy policy`,consentRequired:`Please accept the privacy policy to continue.`,rateLimited:`Please take a moment to review your answers before submitting.`,redirectBlocked:`Submission accepted, but the redirect URL was blocked for security.`,demo:{contactTitle:`Contact us`,contactDescription:`Tell us about your project and a sales representative will get back to you within one business day.`,supportTitle:`Submit a support request`,supportDescription:`Tell us what is going wrong — our team responds within one business day.`,thankYouSalesTitle:`Thanks — we received your message!`,thankYouSalesMessage:`A sales representative will be in touch within one business day.`,thankYouSupportTitle:`Got it — your request is in the queue.`,thankYouSupportMessage:`A support engineer will follow up shortly. Save this page if you have more screenshots to add.`,field:{firstName:`First name`,lastName:`Last name`,email:`Work email`,phone:`Phone`,jobTitle:`Job title`,company:`Company`,website:`Website`,industry:`Industry`,companySize:`Company size`,howCanWeHelp:`How can we help?`,subject:`Subject`,description:`Description`,issueType:`Issue type`,priority:`Priority`},industry:{technology:`Technology`,software:`Software / SaaS`,finance:`Finance`,healthcare:`Healthcare`,retail:`Retail`,other:`Other`},issueType:{question:`Question`,problem:`Problem`,bug:`Bug`,feature_request:`Feature request`},priority:{low:`Low`,medium:`Medium`,high:`High`,critical:`Critical`}}},marketplace:{title:`App Marketplace`,subtitle:`Browse approved apps published to the ObjectStack catalog. Click an app to view details and install it into one of your environments.`,searchPlaceholder:`Search apps by name or manifest ID…`,searchAria:`Search marketplace apps`,installed:`Installed`,installedCount:`Installed ({{count}})`,refresh:`Refresh`,all:`All`,noApprovedYet:`No apps have been approved for the marketplace yet.`,noMatchFilters:`No apps match your filters.`,noDescription:`No description provided.`,back:`Back to marketplace`,installedTitle:`Installed Apps`,installedSubtitle:`Marketplace packages currently installed into this runtime's kernel. Cached manifests live in <code>.objectstack/installed-packages/</code> and survive restarts.`,installedEmpty:`No marketplace apps installed in this runtime yet.`,browseLink:`Browse the marketplace →`,installedAdditiveNote:`<strong>Note:</strong> The kernel API is additive only — uninstall removes the on-disk manifest so the package won't load on next boot, but the running kernel keeps the app registered until you restart the runtime.`,installedAt:`Installed {{when}}`,installedBy:`by {{user}}`,installedPackageId:`package`,cachedAs:`Cached as <code>{{path}}</code>`,versionBadge:`v{{version}}`,installedBadge:`Installed v{{version}}`,load:{failed:`Failed to load marketplace`,failedHint:`By default this runtime points at the public ObjectStack cloud. Check the runtime is online, or override <code>OS_CLOUD_URL</code> to point at a self-hosted control plane.`,packageFailed:`Failed to load package`,notFound:`Not found.`},detail:{homepage:`Homepage`,installedV:`Installed · v{{version}}`,about:`About`,noReadme:`No readme provided.`,versions:`Versions`,noApprovedVersions:`No approved versions.`,prerelease:`pre`,moreOptions:`More install options`,uninstallFromRuntime:`Uninstall from this runtime`},action:{install:`Install`,reinstall:`Reinstall`,working:`Working…`,installToCloud:`Install to cloud…`,installing:`Installing…`,uninstall:`Uninstall`,uninstalling:`Uninstalling…`,details:`Details`,close:`Close`,dismiss:`Dismiss`,openOnCloud:`Open on cloud`,backHome:`Back to home`},install:{dialogTitle:`Install {{name}}`,dialogDescCurrent:`Install into this environment ({{host}}).`,dialogDescPicker:`Choose an environment to install this app into. You need to be signed into ObjectStack Cloud.`,environment:`Environment`,environmentPlaceholder:`Pick an environment`,includeSampleData:`Include sample data`,noEnvs:`No environments found in your active organization.`,noPermission:`You do not have permission to install apps in any environment. Only organization owners and admins can install — ask your workspace admin.`,signInFirst:`You need to sign into ObjectStack Cloud first. Click "Open on cloud" below.`,success:`Installed successfully. Open the environment to see the new app.`,localSuccess:`Installed v{{version}} to this runtime. "{{name}}" should now appear in the app switcher.`,localManifestConflict:`{{message}}
|
|
9
|
+
`).replace(Kd,``)}function L(e,t){return t=qd(t),qd(e)===t}function Jd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Jd(e,t,`name`,a.name,a,null),Jd(e,t,`formEncType`,a.formEncType,a,null),Jd(e,t,`formMethod`,a.formMethod,a,null),Jd(e,t,`formTarget`,a.formTarget,a,null)):(Jd(e,t,`encType`,a.encType,a,null),Jd(e,t,`method`,a.method,a,null),Jd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Id(`scroll`,e);break;case`onScrollEnd`:r!=null&&Id(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Id(`beforetoggle`,e),Id(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Ft(e,n,r))}}function Yd(e,t,n,r,a,o){switch(n){case`style`:tn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Id(`scroll`,e);break;case`onScrollEnd`:r!=null&&Id(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function Xd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Id(`error`,e),Id(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Jd(e,t,o,s,n,null)}}a&&Jd(e,t,`srcSet`,n.srcSet,n,null),r&&Jd(e,t,`src`,n.src,n,null);return;case`input`:Id(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Jd(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Id(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Jd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Id(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Jd(e,t,s,c,n,null)}Zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Jd(e,t,l,r,n,null)}return;case`dialog`:Id(`beforetoggle`,e),Id(`toggle`,e),Id(`cancel`,e),Id(`close`,e);break;case`iframe`:case`object`:Id(`load`,e);break;case`video`:case`audio`:for(r=0;r<Nd.length;r++)Id(Nd[r],e);break;case`image`:Id(`error`,e),Id(`load`,e);break;case`details`:Id(`toggle`,e);break;case`embed`:case`source`:case`link`:Id(`error`,e),Id(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Jd(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Yd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Jd(e,t,c,r,n,null))}function Zd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Jd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Jd(e,t,p,m,r,f)}}Kt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Jd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Jd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Jd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Jd(e,t,s,a,r,o)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Jd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Jd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Jd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Jd(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Yd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Yd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Jd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Jd(e,t,f,p,r,m)}function Qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function R(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Qd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Qd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var $d=null,ef=null;function tf(e){return e.nodeType===9?e:e.ownerDocument}function nf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function rf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function af(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var of=null;function z(){var e=window.event;return e&&e.type===`popstate`?e===of?!1:(of=e,!0):(of=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,B=typeof clearTimeout==`function`?clearTimeout:void 0,cf=typeof Promise==`function`?Promise:void 0,V=typeof queueMicrotask==`function`?queueMicrotask:cf===void 0?sf:function(e){return cf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Sf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Sf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Sf(e.ownerDocument.body);n=i}while(n);Vp(t)}function ff(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function pf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=W(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=W(e.nextSibling),e===null))return null;return e}function H(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=W(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function U(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _f(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function W(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var vf=null;function yf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return W(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function xf(e,t,n){switch(t=tf(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var Cf=new Map,wf=new Set;function Tf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ef=se.d;se.d={f:Df,r:Of,D:jf,C:Mf,L:Nf,m:Pf,X:If,S:Ff,M:Lf};function Df(){var e=Ef.f(),t=Iu();return e||t}function Of(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Fs(t):Ef.r(e)}var kf=typeof document>`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Xd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Xd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Xd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=Tt(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);Et(c),Xd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=Tt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),Et(a),Xd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=Tt(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),Et(a),Xd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=he.current)?Tf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Gt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Xd(t,`link`,n),Et(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Gt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Xd(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Xd(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,Et(a),a):(r=n,(a=Cf.get(o))&&(r=m({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Xd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var G=null;function Yf(e,t,n){if(G===null){var r=new Map,i=G=new Map;i.set(n,r)}else i=G,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function $f(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=np.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Xd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=np.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ep=0;function tp(e,t){return e.stylesheets&&e.count===0&&ip(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ep===0&&(ep=62500*R());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ep?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rp=null;function ip(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rp=new Map,t.forEach(ap,e),rp=null,np.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=rp.get(e);if(n)var r=n.get(null);else{n=new Map,rp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=np.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=mi(3,null,null,t),e.current=a,a.stateNode=e,t=ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},qa(a),e}function lp(e){return e?(e=fi,e):fi}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ya(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Xa(e,r,t),n!==null&&(ju(n,e,t),Za(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=li(e,67108864);t!==null&&ju(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=ku();t=ct(t);var n=li(e,t);n!==null&&ju(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=2,vp(e,t,n,r)}finally{se.p=a,k.T=i}}function _p(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=8,vp(e,t,n,r)}finally{se.p=a,k.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)Vd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ge(o);s.entanglements[1]|=c,o&=~c}bd(a),!(Xl&6)&&(_u=Ne()+500,xd(0,!1))}}break;case 31:case 13:s=li(a,2),s!==null&&ju(s,a,2),Iu(),fp(a,2)}if(a=yp(r),a===null&&Vd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Vd(e,t,r,null,n)}}function yp(e){return e=ln(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=St(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=St(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,dt(e.priority,function(){mp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=Ct(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Ns(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;up(n,ku(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Iu(),t[ht]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.7`)throw Error(i(527,Gp,`19.2.7`));se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{He=qp.inject(Kp),Ue=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=nc,s=rc,c=ic;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=cp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[ht]=t.current,zd(e),new Up(t)}})),_=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=g()})),v=e=>typeof e==`string`,y=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},b=e=>e==null?``:String(e),x=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},S=/###/g,C=e=>e&&e.includes(`###`)?e.replace(S,`.`):e,w=e=>!e||v(e),T=(e,t,n)=>{let r=v(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(w(e))return{};let t=C(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return w(e)?{}:{obj:e,k:C(r[i])}},E=(e,t,n)=>{let{obj:r,k:i}=T(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=T(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=T(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},D=(e,t,n,r)=>{let{obj:i,k:a}=T(e,t,Object);i[a]=i[a]||[],i[a].push(n)},O=(e,t)=>{let{obj:n,k:r}=T(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ee=(e,t,n)=>{let r=O(e,n);return r===void 0?O(t,n):r},te=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?v(e[r])||e[r]instanceof String||v(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):te(e[r],t[r],n):e[r]=t[r]);return e},ne=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),re={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},ie=e=>v(e)?e.replace(/[&<>"'\/]/g,e=>re[e]):e,ae=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},oe=[` `,`,`,`?`,`!`,`;`],k=new ae(20),se=(e,t,n)=>{t||=``,n||=``;let r=oe.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=k.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},ce=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},le=e=>e?.replace(/_/g,`-`),ue={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},A=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||ue,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>v(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),v(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},de=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},fe=class extends de{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):v(n)&&i?o.push(...n.split(i)):o.push(n)));let s=O(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!v(n)?s:ce(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),E(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(v(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=O(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?te(s,n,i):s={...s,...n},E(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},pe={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},me=Symbol(`i18next/PATH_KEY`);function he(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===me?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function ge(e,t){let{[me]:n}=e(he()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var _e=e=>!v(e)&&typeof e!=`boolean`&&typeof e!=`number`,ve=class e extends de{constructor(e,t={}){super(),x([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=A.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=_e(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!se(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:v(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:v(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=ge(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?ge(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],y=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=i.count!==void 0&&!v(i.count),S=e.hasDefaultValue(i),C=x?this.pluralResolver.getSuffix(d,i.count,i):``,w=i.ordinal&&x?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,T=x&&!i.ordinal&&i.count===0,E=T&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${C}`]||i[`defaultValue${w}`]||i.defaultValue,D=m;b&&!m&&S&&(D=E);let O=_e(D),ee=Object.prototype.toString.apply(D);if(b&&D&&O&&!_.includes(ee)&&!(v(y)&&Array.isArray(D))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,D,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(D),t=e?[]:{},n=e?g:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let r=`${n}${o}${e}`;S&&!m?t[e]=this.translate(r,{...i,defaultValue:_e(E)?E[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=D[e])}m=t}}else if(b&&v(y)&&Array.isArray(m))m=m.join(y),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&S&&(e=!0,m=E),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=S&&E!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,x&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?E:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=S&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);T&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||E)})}):n(e,s,E))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=v(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!v(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=v(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=pe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return v(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?ge(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!v(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(v(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!v(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},ye=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=A.create(`languageUtils`)}getScriptPartFromCode(e){if(e=le(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=le(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(v(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),v(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return v(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):v(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},be={zero:0,one:1,two:2,few:3,many:4,other:5},xe={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Se=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=A.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=le(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),xe;if(!e.match(/-|_/))return xe;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>be[e]-be[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Ce=(e,t,n,r=`.`,i=!0)=>{let a=ee(e,t,n);return!a&&i&&v(n)&&(a=ce(e,n,r),a===void 0&&(a=ce(t,n,r))),a},we=e=>e.replace(/\$/g,`$$$$`),Te=class{constructor(e={}){this.logger=A.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?ie:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?ne(i):a||`{{`,this.suffix=o?ne(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?ne(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?ne(l):``,this.nestingPrefix=d?ne(d):f||ne(`$t(`),this.nestingSuffix=p?ne(p):m||ne(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Ce(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Ce(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>we(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?we(this.escape(e)):we(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=v(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !v(a)&&!this.useRawValueToEscape&&(a=b(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${ne(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!v(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!v(i))return i;v(i)||(i=b(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ee=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},De=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(le(r),i),t[o]=s),s(n)}},Oe=e=>(t,n,r)=>e(le(n),r)(t),ke=class{constructor(e={}){this.logger=A.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?De:Oe;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=De(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ee(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Ae=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},je=class extends de{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=A.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{D(n.loaded,[i],a),Ae(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();v(e)&&(e=this.languageUtils.toResolveHierarchy(e)),v(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Me=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),v(e[1])&&(t.defaultValue=e[1]),v(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ne=e=>(v(e.ns)&&(e.ns=[e.ns]),v(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),v(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Pe=()=>{},Fe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Ie=class e extends de{constructor(e={},t){if(super(),this.options=Ne(e),this.services={},this.logger=A,this.modules={external:[]},Fe(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(v(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Me();this.options={...n,...this.options,...Ne(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?A.init(r(this.modules.logger),this.options):A.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:ke;let t=new ye(this.options);this.store=new fe(this.options.resources,this.options);let n=this.services;n.logger=A,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Se(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Te(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new je(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new ve(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Pe,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=y(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Pe){let n=t,r=v(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=y();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Pe,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&pe.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=y();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=v(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(v(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=ge(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=ge(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=ge(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return v(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=y();return this.options.ns?(v(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=y();v(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new ye(Me());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Pe){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new fe(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Me().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Te(n)}return a.translator=new ve(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Ie.createInstance,Ie.dir,Ie.init,Ie.loadResources,Ie.reloadResources,Ie.use,Ie.changeLanguage,Ie.getFixedT,Ie.t,Ie.exists,Ie.setDefaultNamespace,Ie.hasLoadedNamespace,Ie.loadNamespaces,Ie.loadLanguages;var Le=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);We(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Re={},ze=(e,t,n,r)=>{We(n)&&Re[n]||(We(n)&&(Re[n]=new Date),Le(e,t,n,r))},Be=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Ve=(e,t,n)=>{e.loadNamespaces(t,Be(e,n))},He=(e,t,n,r)=>{if(We(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ve(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Be(e,r))},Ue=(e,t,n={})=>!t.languages||!t.languages.length?(ze(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),We=e=>typeof e==`string`,Ge=e=>typeof e==`object`&&!!e,Ke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qe={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},Je=e=>qe[e],Ye={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Ke,Je),transDefaultProps:void 0},Xe=(e={})=>{Ye={...Ye,...e}},Ze=()=>Ye,Qe,$e=e=>{Qe=e},et=()=>Qe,tt={type:`3rdParty`,init(e){Xe(e.options.react),$e(e)}},j=c(d()),nt=(0,j.createContext)(),rt=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},it=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),at=o(((e,t)=>{t.exports=it()})),ot=at(),st={t:(e,t)=>{if(We(t))return t;if(Ge(t)&&We(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},ct=()=>()=>{},lt=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,j.useContext)(nt)||{},a=n||r||et();a&&!a.reportNamespaces&&(a.reportNamespaces=new rt),a||ze(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,j.useMemo)(()=>({...Ze(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=We(l)?[l]:l||[`translation`],d=(0,j.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,j.useRef)(0),p=(0,j.useCallback)(e=>{if(!a)return ct;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,j.useRef)(),h=(0,j.useCallback)(()=>{if(!a)return st;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>Ue(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c,{scopeNs:d}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,j.useState)(0),{t:v,ready:y}=(0,ot.useSyncExternalStore)(p,h,h);(0,j.useEffect)(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?He(a,t.lng,d,e):Ve(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=(0,j.useRef)(null),S=(0,j.useRef)(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=(0,j.useMemo)(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(ze(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y)throw new Promise(e=>{let n=()=>e();t.lng?He(a,t.lng,d,n):Ve(a,d,n)});return w};function ut({i18n:e,defaultNS:t,children:n}){let r=(0,j.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,j.createElement)(nt.Provider,{value:r},n)}var dt={en:{common:{loading:`Loading...`,save:`Save`,cancel:`Cancel`,delete:`Delete`,edit:`Edit`,create:`Create`,search:`Search`,filter:`Filter`,reset:`Reset`,confirm:`Confirm`,close:`Close`,back:`Back`,next:`Next`,previous:`Previous`,submit:`Submit`,refresh:`Refresh`,export:`Export`,import:`Import`,yes:`Yes`,no:`No`,ok:`OK`,actions:`Actions`,more:`More`,selectAll:`Select All`,clearAll:`Clear All`,addToFavorites:`Add to favorites`,removeFromFavorites:`Remove from favorites`,noData:`No data`,noResults:`No results found`,required:`Required`,optional:`Optional`,selectOption:`Select an option`,select:`Select...`,openChat:`Open chat`,closeChat:`Close chat`,toggleSidebar:`Toggle sidebar`},validation:{required:`{{field}} is required`,minLength:`{{field}} must be at least {{min}} characters`,maxLength:`{{field}} must be at most {{max}} characters`,min:`{{field}} must be at least {{min}}`,max:`{{field}} must be at most {{max}}`,email:`Please enter a valid email address`,url:`Please enter a valid URL`,pattern:`{{field}} format is invalid`,unique:`{{field}} must be unique`,type:`{{field}} must be a valid {{type}}`},form:{addItem:`Add item`,removeItem:`Remove item`,fieldRequired:`This field is required`,invalidFormat:`Invalid format`,saveSuccess:`Saved successfully`,saveError:`Failed to save`,unsavedChanges:`You have unsaved changes. Are you sure you want to leave?`,stepOf:`Step {{current}} of {{total}}`,createTitle:`Create {{object}}`,editTitle:`Edit {{object}}`,createDescription:`Add a new {{object}} to your database.`,editDescription:`Update details for {{object}}`,saveRecord:`Save`,create:`Create`,update:`Update`,createSuccess:`{{object}} created successfully`,updateSuccess:`{{object}} updated successfully`,deleteSuccess:`{{object}} deleted successfully`},fields:{richText:{format:`Format: {{format}}`,basicEditorHint:`Rich text editor (basic)`,placeholder:`Enter text...`}},table:{rowsPerPage:`Rows per page`,showing:`Showing {{from}} to {{to}} of {{total}}`,noRows:`No rows to display`,sortAsc:`Sort ascending`,sortDesc:`Sort descending`,filterColumn:`Filter {{column}}`,columns:`Columns`,exportCSV:`Export CSV`,exportExcel:`Export Excel`,selectRow:`Select row`,selectAllRows:`Select all rows`,expandRow:`Expand row`,collapseRow:`Collapse row`,hideColumn:`Hide column`,freezeColumn:`Freeze column`,unfreezeColumn:`Unfreeze column`,pageInfo:`Page {{current}} of {{total}}`,totalRecords:`{{count}} total`,noResults:`No results found`,noResultsHint:`Try adjusting your filters or search query.`,cancelAll:`Cancel All`,saveAll:`Save All ({{count}})`,addRecord:`Add record`,open:`Open`,search:`Search...`,modified:`{{count}} row modified`,selected:`{{count}} selected`,edit:`Edit`,delete:`Delete`},grid:{actions:`Actions`,edit:`Edit`,delete:`Delete`,export:`Export`,exportAs:`Export as {{format}}`,loading:`Loading grid...`,errorLoading:`Error loading grid`,pullToRefresh:`Pull to refresh`,refreshing:`Refreshing…`,openRecord:`Open record`,openMenu:`Open menu`,rowHeight:`Row height: {{mode}}`,empty:`Empty`,yes:`Yes`,no:`No`,systemFields:`System`,toolbar:{densityMode:`Density`,densityCompact:`Compact`,densityComfortable:`Comfortable`,densitySpacious:`Spacious`,densityCycleHint:`{{label}} (click to cycle)`,densityCycleShortHint:`Click to cycle`},import:{title:`Import {{object}}`,stepUpload:`Upload`,stepMapping:`Mapping`,stepPreview:`Preview`,uploadDescription:`Upload a CSV file to get started.`,mappingDescription:`Map CSV columns to object fields.`,previewDescription:`Review data before importing.`,dragDrop:`Drag & drop a CSV file here, or click to browse`,browseFiles:`Browse Files`,onlyCsv:`Only CSV files are supported.`,fileNeedsHeader:`File must contain a header row and at least one data row.`,mappingTemplate:`Mapping template:`,chooseTemplate:`Choose template…`,noSavedTemplates:`No saved templates`,noneOption:`— None —`,saveCurrent:`Save current`,templateName:`Template name`,save:`Save`,deleteTemplate:`Delete template`,csvColumn:`CSV Column`,mapsTo:`Maps To`,status:`Status`,skipColumn:`Skip column`,skip:`— Skip —`,mapped:`Mapped`,skipped:`Skipped`,rowsWithErrors:`{{count}} row(s) with errors`,rowsCorrected:`{{count}} row(s) corrected`,clickToFix:`— click a highlighted cell to fix it inline.`,showingRows:`Showing {{shown}} of {{total}} rows`,importing:`Importing… {{progress}}%`,importComplete:`Import Complete`,imported:`{{count}} imported`,skippedCount:`{{count}} skipped`,moreErrors:`…and {{count}} more errors`,cancel:`Cancel`,back:`Back`,next:`Next`,close:`Close`,importNRows:`Import {{count}} Rows`,importingProgress:`Importing…`,requiredMark:`*`,required:`Required`,invalidType:`Invalid {{type}}`}},calendar:{today:`Today`,month:`Month`,week:`Week`,day:`Day`,agenda:`Agenda`,allDay:`All Day`,noEvents:`No events`,newEvent:`New event`,moreEvents:`+{{count}} more`},list:{recordCount:`{{count}} records`,recordCountOne:`{{count}} record`,addRecord:`Add record`,tabs:`Tabs`,allRecords:`All Records`,search:`Search`,filter:`Filter`,filterRecords:`Filter Records`,sort:`Sort`,sortRecords:`Sort Records`,group:`Group`,groupBy:`Group By`,export:`Export`,exportAs:`Export as {{format}}`,color:`Color`,rowColor:`Row Color`,colorByField:`Color by field`,clear:`Clear`,none:`None`,hideFields:`Hide fields`,noItems:`No items found`,noItemsMessage:`There are no records to display. Try adjusting your filters or adding new data.`,showAll:`Show all`,pullToRefresh:`Pull to refresh`,refreshing:`Refreshing…`,share:`Share`,print:`Print`,hideFieldsTitle:`Hide Fields`,dataLimitReached:`Showing first {{limit}} records. More data may be available.`,viewSettings:`View settings`,viewSettingsHint:`Grouping, color, density, and visible fields.`,addGroup:`Add group field`,collapsedByDefault:`Collapsed by default`,removeGroup:`Remove`},kanban:{addCard:`Add card`,addColumn:`Add column`,moveCard:`Move card`,deleteCard:`Delete card`,deleteColumn:`Delete column`,noCards:`No cards`,cardTitlePlaceholder:`Enter card title...`},timeline:{bucket:{overdue:`Overdue`,today:`Today`,tomorrow:`Tomorrow`,thisWeek:`This week`,nextWeek:`Next week`,later:`Later`,noDate:`No date`,unassigned:`Unassigned`}},gantt:{column:{taskName:`Task Name`,start:`Start`,end:`End`},toolbar:{prevPeriod:`Previous period`,nextPeriod:`Next period`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,jumpToToday:`Jump to today`,today:`Today`,showTaskList:`Show task list`,hideTaskList:`Hide task list`}},view:{rename:`Rename`,duplicateView:`Duplicate View`,shareView:`Share View`,setAsDefault:`Set as Default`,pinView:`Pin View`,unpinView:`Unpin View`,changeViewType:`Change View Type`,deleteView:`Delete View`,addView:`Add View`,unsavedChanges:`Unsaved changes`,saveAsView:`Save as View`,moreViews:`{{count}} more`,activeFilters:`Active filters`,activeSort:`Active sort`,manageViews:`Manage views`,manageAllViews:`Manage all views…`,searchViews:`Search views`,addNewView:`Add new view`,done:`Done`,noViewsFound:`No views match your search.`,dragToReorder:`Drag to reorder`,defaultView:`Default view`,tabActionsFor:`View actions for {{name}}`,readonlyAriaLabel:`Read-only view`,readonlyTooltip:`System view — duplicate to customize.`},detail:{back:`Back`,edit:`Edit`,editInline:`Edit`,save:`Save`,saveChanges:`Save changes`,saving:`Saving…`,editFieldsInline:`Edit fields`,lockedByApproval:`Locked for approval`,lockedTooltip:`This record has a pending approval request; editing is locked`,cancelApproval:`Recall approval`,cancelApprovalInFlight:`Recalling…`,cancelApprovalTooltip:`Recall the pending approval request to unlock this record`,cancelApprovalFailed:`Failed to recall approval`,cancelApprovalUnavailable:`Recalling approvals is not supported on this data source`,linkCopied:`Link copied to clipboard`,linkCopyFailed:`Failed to copy link`,cancel:`Cancel`,cancelEdit:`Discard changes`,sectionMoreDetails:`More details`,concurrentUpdateTitle:`This record was modified by someone else`,concurrentUpdateDescription:`Another user saved a newer version of {{field}} while you were editing. To prevent silently overwriting their change, please choose how to resolve the conflict.`,concurrentUpdateYourEdit:`Your edit`,concurrentUpdateCurrentValue:`Current value`,concurrentUpdateUpdatedBy:`Updated by {{name}}`,concurrentUpdateUpdatedAt:`Updated at {{when}}`,concurrentUpdateReload:`Reload latest`,concurrentUpdateOverwrite:`Overwrite anyway`,concurrentUpdateCancel:`Cancel`,openInNewTab:`Open in new tab`,share:`Share`,duplicate:`Duplicate`,export:`Export`,viewHistory:`View history`,delete:`Delete`,moreActions:`More actions`,addToFavorites:`Add to favorites`,removeFromFavorites:`Remove from favorites`,previousRecord:`Previous record`,nextRecord:`Next record`,recordOf:`{{current}} of {{total}}`,recordNotFound:`Record not found`,recordNotFoundDescription:`The record you are looking for does not exist or may have been deleted.`,goBack:`Go back`,details:`Details`,related:`Related`,relatedRecords:`{{count}} records`,relatedRecordOne:`{{count}} record`,noRelatedRecords:`No related records found`,loading:`Loading...`,copyToClipboard:`Copy to clipboard`,copied:`Copied!`,deleteConfirmation:`Are you sure you want to delete this record?`,editRecord:`Edit record`,viewAll:`View All`,new:`New`,emptyValue:`—`,activity:`Activity`,history:`History`,editRow:`Edit`,deleteRow:`Delete`,deleteRowConfirmation:`Are you sure you want to delete this record?`,deleteRowTitle:`Delete record`,actions:`Actions`,previousPage:`Previous`,nextPage:`Next`,pageOf:`Page {{current}} of {{total}}`,sortBy:`Sort by`,filterPlaceholder:`Filter...`,highlightFields:`Key Fields`,comments:`Comments`,searchComments:`Search comments…`,addCommentPlaceholder:`Add a comment… (Ctrl+Enter to submit)`,noMatchingComments:`No matching comments`,noCommentsYet:`No comments yet`,pinned:`Pinned`,pin:`Pin`,unpin:`Unpin`,justNow:`just now`,minutesAgo:`{{count}}m ago`,hoursAgo:`{{count}}h ago`,daysAgo:`{{count}}d ago`,createdBy:`Created by`,updatedBy:`Updated by`,dropFilesToUpload:`Drop files here or click to upload`,attachmentCount:`{{count}} attachment`,attachmentCountPlural:`{{count}} attachments`,removeAttachment:`Remove attachment`,unifiedDiff:`Unified diff`,sideBySideDiff:`Side-by-side diff`,noChanges:`No changes`,previousVersion:`Previous`,currentVersion:`Current`,discussion:`Discussion`,showDiscussion:`Show Discussion ({{count}})`,hideDiscussion:`Hide discussion`,bold:`Bold (Ctrl+B)`,italic:`Italic (Ctrl+I)`,listFormat:`List`,inlineCode:`Inline code`,mentionSomeone:`Mention someone`,preview:`Preview`,submitComment:`Submit (Ctrl+Enter)`,sendComment:`Send`,writeComment:`Write a comment…`,subscribedTooltip:`Subscribed — click to unsubscribe`,unsubscribedTooltip:`Subscribe to notifications`,firstRecord:`First record (Home)`,previousRecordKey:`Previous record (←)`,nextRecordKey:`Next record (→)`,lastRecord:`Last record (End)`,noRecords:`No records`,showEmptyRelated_one:`+ {{count}} empty`,showEmptyRelated_other:`+ {{count}} empty`,searchWhileNavigating:`Search while navigating`,searchRecords:`Search records…`,allActivity:`All Activity`,commentsOnly:`Comments Only`,fieldChangesFilter:`Field Changes`,tasksOnly:`Tasks Only`,leaveCommentPlaceholder:`Leave a comment… (Ctrl+Enter to submit)`,noActivity:`No activity recorded`,loadMore:`Load more`,edited:`(edited)`,via:`via {{source}}`,replyCount:`{{count}} reply`,replyCountPlural:`{{count}} replies`,replyPlaceholder:`Reply…`,filterActivity:`Filter activity`,openDiscussion:`Open discussion panel`,closeDiscussion:`Close discussion panel`,subscribeAriaLabel:`Subscribe to notifications`,unsubscribeAriaLabel:`Unsubscribe from notifications`,clearSearch:`Clear search`,copyEmail:`Copy email`,copyPhone:`Copy phone number`,copyRecordId:`Copy record ID`,showEmptyFields:`Show {{count}} empty fields`,hideEmptyFields:`Hide empty fields`,noValue:`No value`},chart:{noData:`No chart data available`,loading:`Loading chart...`},report:{rowTotal:`Row Total`,columnTotal:`Column Total`,grandTotal:`Grand Total`,totals:`Totals`,rowsLabel:`Row`,columnsLabel:`Column`,allLabel:`(All)`,emptyLabel:`(Empty)`,loading:`Loading…`,failedToLoad:`Failed to load matrix: {{message}}`,needsAcross:"Matrix report requires at least one `groupingsAcross` field.",aggregate:{count:`Count`,countDistinct:`Distinct Count`,sum:`Sum`,avg:`Average`,min:`Min`,max:`Max`,first:`First`},editor:{breadcrumb:`Configuration`,basic:`Basic`,title:`Title`,titlePlaceholder:`e.g. Pipeline by Quarter`,description:`Description`,descriptionPlaceholder:`What does this report show?`,type:`Report type`,typeTabular:`Tabular — flat list`,typeSummary:`Summary — grouped with totals`,typeMatrix:`Matrix — pivot rows × columns`,typeJoined:`Joined — multiple blocks`,typeHelp:`Pick the layout that matches what you want to see.`,data:`Data`,objectName:`Data source`,objectNamePlaceholder:`e.g. opportunity`,objectNameHelp:`Which object should this report query?`,limit:`Row limit`,limitPlaceholder:`e.g. 100`,columns:`Columns`,columnsHint:`Pick which fields appear as columns. Add an aggregate (Sum, Count…) on Summary or Matrix reports.`,filters:`Filters`,filtersHint:`Limit the rows that go into this report.`,filtersComplex:`This report uses an advanced filter that cannot be edited here. Save will keep it unchanged.`,groupBy:`Group by`,groupByHint:`Group the data and compute subtotals.`,rows:`Rows`,rowsHint:`Group rows by these fields.`,columnsAxis:`Columns`,columnsAxisHint:`Pivot these fields across the top.`,values:`Values`,valuesHint:`Numbers shown in each cell. Pick one or more fields and add an aggregate (Sum, Count…).`,grouping:`Grouping`,addGrouping:`Add grouping`,dateGranularity:`Date bucket`,dateGranularityNone:`(use raw value)`,day:`Day`,week:`Week`,month:`Month`,quarter:`Quarter`,year:`Year`,sortAsc:`Ascending`,sortDesc:`Descending`,chart:`Chart`,chartHint:`Optional visualization rendered alongside the table.`,chartType:`Chart type`,chartTitle:`Chart title`,chartTitlePlaceholder:`Defaults to the report title`,chartXAxis:`X-axis (category)`,chartYAxis:`Y-axis (value)`,chartShowLegend:`Show legend`,chartShowDataLabels:`Show data labels`,chartNone:`(no chart)`,chartBar:`Bar`,chartLine:`Line`,chartArea:`Area`,chartPie:`Pie`,chartDonut:`Donut`,chartFunnel:`Funnel`,validationNeedsObject:`Pick a data source before adding columns.`,validationMatrixNeedsRowsCols:`Matrix reports need at least one Row and one Column.`,validationSummaryNeedsRows:`Summary reports need at least one grouping field.`,blocks:`Blocks`,blocksHint:`Each block is its own table or chart. Block-level filters are ANDed with the report filter.`,addBlock:`Add block`,removeBlock:`Remove block`,blockName:`Block name`,blockNamePlaceholder:`unique_block_name`,blockLabel:`Display label`,blockLabelPlaceholder:`Shown above the block`,blockDescription:`Description`,blockDescriptionPlaceholder:`Optional context for this block`,validationJoinedNeedsBlocks:`Joined reports need at least one block.`,validationBlockNameRequired:`Every block needs a non-empty name.`,validationBlockNameDuplicate:`Block names must be unique within the report.`,validationBlockNeedsColumns:`Every block needs at least one column.`,noneOption:`(none)`,addCondition:`Add condition`,combineLogic:`Combine with`,opContains:`contains`,opIsEmpty:`is empty`,opIsNotEmpty:`is not empty`,formatAuto:`Auto`,formatCurrency:`Currency`,formatPercent:`Percent`,formatInteger:`Integer`,formatDate:`Date`,formatDatetime:`Date & time`,columnLabelPlaceholder:`Label override`,aggregateColumn:`Aggregate`,formatColumn:`Format`,addColumns:`Add fields`,searchFields:`Search fields…`,noMatchingFields:`No fields match your search.`,noFieldsAvailable:`No fields available.`,columnsCount:`{n} column(s) selected`,columnsEmpty:`No columns selected yet.`,fieldPickerTitle:`Select fields`,fieldPickerDescription:`Pick one or more fields to add. Use the search box to narrow the list.`,fieldPickerChangeTitle:`Change field`,fieldPickerAddGroupingTitle:`Add grouping`,fieldPickerEmpty:`(pick field)`,fieldPickerSelected:`{n} selected`,fieldPickerClear:`Clear selection`,fieldPickerAdd:`Add`,fieldPickerAddN:`Add {n}`}},map:{searchLocations:`Search locations…`,locationDetails:`Location Details`,markersCount:`{{count}} markers`,invalidCoordinates:`{{count}} record with missing or invalid coordinates excluded from the map.`,invalidCoordinatesPlural:`{{count}} records with missing or invalid coordinates excluded from the map.`},workflow:{draft:`Draft`,active:`Active`,paused:`Paused`,completed:`Completed`,cancelled:`Cancelled`,save:`Save`,publish:`Publish`,addNode:`Add Node`,workflowFlow:`Workflow Flow`,properties:`Properties`,connections:`Connections`,quickConnect:`Quick Connect`,fromPlaceholder:`From...`,toPlaceholder:`To...`,connect:`Connect`,label:`Label`,type:`Type`,description:`Description`,assignee:`Assignee`,assigneeType:`Assignee Type`,user:`User`,role:`Role`,group:`Group`,expression:`Expression`,timeoutMinutes:`Timeout (minutes)`,selectNodeToEdit:`Select a node to edit its properties`,workflowTitle:`Workflow Title`,newWorkflow:`New Workflow`,outConnections:`{{count}} out`,start:`Start`,end:`End`,task:`Task`,userTask:`User Task`,serviceTask:`Service Task`,scriptTask:`Script Task`,approval:`Approval`,condition:`Condition`,parallelGateway:`Parallel Gateway`,joinGateway:`Join Gateway`,boundaryEvent:`Boundary Event`,delay:`Delay`,notification:`Notification`,webhook:`Webhook`,allowConcurrency:`Allow (run concurrently)`,forbidConcurrency:`Forbid (skip new)`,replaceConcurrency:`Replace (cancel existing)`,queueConcurrency:`Queue (run after current)`,conditionEvent:`Condition`,manualEvent:`Manual`,webhookEvent:`Webhook`,timerEvent:`Timer`,signalEvent:`Signal`,versionHistory:`Version History`,importBpmn:`Import BPMN`,exportBpmn:`Export BPMN`,undo:`Undo`,redo:`Redo`,resetZoom:`Reset zoom`},dashboard:{addWidget:`Add widget`,removeWidget:`Remove widget`,editLayout:`Edit layout`,saveLayout:`Save layout`,resetLayout:`Reset layout`,total:`Total`,noDataAvailable:`No data available`,noDataSourceFor:`No data source available for`,trend:{vsLastQuarter:`vs last quarter`,vsLastMonth:`vs last month`,vsLastWeek:`vs last week`,vsLastYear:`vs last year`,vsYesterday:`vs yesterday`,vsPreviousPeriod:`vs previous period`}},configPanel:{save:`Save`,discard:`Discard`,close:`Close`,layout:`Layout`,columns:`Columns`,gap:`Gap`,rowHeight:`Row height`,data:`Data`,refreshInterval:`Refresh interval`,appearance:`Appearance`,title:`Title`,showDescription:`Show description`,theme:`Theme`,configuration:`Configuration`,general:`General`,advanced:`Advanced`},appDesigner:{createApp:`Create Application`,editApp:`Edit Application`,basicInfo:`Basic Info`,objects:`Objects`,navigation:`Navigation`,branding:`Branding`,appName:`App Name`,appTitle:`Title`,appDescription:`Description`,appIcon:`Icon`,template:`Template`,layout:`Layout`,layoutSidebar:`Sidebar`,layoutHeader:`Header`,layoutEmpty:`Empty`,selectObjects:`Select Objects`,searchObjects:`Search objects…`,selectAll:`Select All`,deselectAll:`Deselect All`,navBuilder:`Navigation Builder`,addGroup:`Add Group`,addUrl:`Add URL`,addSeparator:`Add Separator`,noNavItems:`No navigation items yet.`,logoUrl:`Logo URL`,primaryColor:`Primary Color`,faviconUrl:`Favicon URL`,preview:`Preview`,complete:`Complete`,snakeCaseHint:`Must be snake_case (e.g. my_app)`,modeEdit:`Edit`,modePreview:`Preview`,modeCode:`Code`,addWidget:`Add Widget`,widgetProperties:`Widget Properties`,dataSource:`Data Source`,valueField:`Value Field`,aggregate:`Aggregate`,colorVariant:`Color Variant`,addComponent:`Add Component`,componentProperties:`Component Properties`,viewType:`View Type`,fields:`Fields`,toolbar:`Toolbar`,showSearch:`Show Search`,showFilters:`Show Filters`,showSort:`Show Sort`,appearance:`Appearance`,rowHeight:`Row Height`,stripedRows:`Striped Rows`,bordered:`Bordered`,livePreview:`Live Preview`,stepBasicDesc:`Name, title, and layout`,stepObjectsDesc:`Select business objects`,stepNavigationDesc:`Build navigation tree`,stepBrandingDesc:`Logo, colors, and favicon`,noObjectsFound:`No objects found.`,noNavItemsHint:`No navigation items yet. Select objects in the previous step or add items manually.`,separator:`Separator`,separatorLabel:`— Separator —`,newGroup:`New Group`,newLink:`New Link`,saveDraft:`Save Draft`,cancelConfirmTitle:`Discard changes?`,cancelConfirmMessage:`You have unsaved changes. Are you sure you want to cancel?`,confirmDiscard:`Discard`,keepEditing:`Keep Editing`,navNoItems:`No navigation items. Click buttons above to add items.`,navNoPreviewItems:`No items`,navLivePreview:`Live Preview`,navCollapseGroup:`Collapse group`,navExpandGroup:`Expand group`,navAddChild:`Add child`,navMoveUp:`Move up`,navMoveDown:`Move down`,navRemove:`Remove`,navObjectPage:`Object Page`,navDashboard:`Dashboard`,navPage:`Page`,navReport:`Report`,navGroup:`Group`,navUrl:`URL`,navSeparator:`Separator`,navTypeObject:`Object`,navTypeDashboard:`Dashboard`,navTypePage:`Page`,navTypeReport:`Report`,navTypeUrl:`URL`,navTypeGroup:`Group`,navTypeSeparator:`Separator`,navTypeAction:`Action`,navEditIcon:`Edit icon`,navToggleVisible:`Toggle visibility`,navHidden:`Hidden`,navExportSchema:`Export JSON`,navImportSchema:`Import JSON`,navExportSuccess:`Navigation schema exported`,navImportSuccess:`Navigation schema imported`,navImportError:`Invalid navigation JSON`,navIconPlaceholder:`Icon name (e.g. Users)`,dashboardEditor:`Dashboard Editor`,noWidgets:`No widgets. Click a button above to add one.`,widgetLayoutSize:`Layout Size`,widgetWidth:`Width`,widgetHeight:`Height`,dashboardPreview:`Dashboard Preview`,noWidgetsPreview:`No widgets to preview`,pageCanvasEditor:`Page Canvas Editor`,emptyPage:`Empty page. Click a button above to add a component.`,pagePreview:`Page Preview`,noComponentsPreview:`No components to preview`,modePage:`Page`,modeDashboard:`Dashboard`,undo:`Undo`,redo:`Redo`,brandingEditor:`Branding Editor`,brandingExport:`Export JSON`,brandingImport:`Import JSON`,brandingPreview:`Preview`,brandingSampleButton:`Sample Button`,brandingSampleText:`This is how your brand theme will look.`,colorPalette:`Color Palette`,fontFamily:`Font Family`,fontDefault:`Default (System)`,modeLight:`Light`,modeDark:`Dark`,mobilePreview:`Mobile Preview`,objectManager:{title:`Object Manager`,addObject:`New Object`,searchPlaceholder:`Search objects…`,noObjects:`No objects found.`,objectName:`API Name`,objectLabel:`Label`,pluralLabel:`Plural Label`,icon:`Icon`,selectIcon:`Select icon…`,group:`Group`,noGroup:`No Group`,sortOrder:`Sort Order`,enabled:`Enabled`,relationships:`Relationships`,systemBadge:`System`,fieldCount:`{{count}} fields`,ungrouped:`Ungrouped`,deleteConfirmTitle:`Delete Object?`,deleteConfirmMessage:`This will permanently delete the object and all its fields. This action cannot be undone.`},fieldDesigner:{title:`Field Designer`,addField:`New Field`,searchPlaceholder:`Search fields…`,allTypes:`All Types`,noFields:`No fields found.`,fieldName:`API Name`,fieldLabel:`Label`,fieldType:`Type`,fieldGroup:`Group`,description:`Description`,required:`Required`,unique:`Unique`,readOnly:`Read Only`,hidden:`Hidden`,indexed:`Indexed`,externalId:`External ID`,trackHistory:`Track History`,defaultValue:`Default Value`,placeholder:`Placeholder`,referenceTo:`Reference To`,formula:`Formula`,options:`Options`,addOption:`Add Option`,validationRules:`Validation Rules`,addRule:`Add Rule`,systemBadge:`System`,ungrouped:`General`,deleteConfirmTitle:`Delete Field?`,deleteConfirmMessage:`This will permanently delete the field. Existing data in this field will be lost.`,basicSection:`Basic`,typeSpecificSection:`Type Settings`,advancedSection:`Advanced`,typeCategory:{text:`Text`,number:`Number`,date:`Date & Time`,choice:`Choice`,relation:`Relation`,advanced:`Advanced`}}},console:{title:`ObjectStack Console`,initializing:`Initializing application...`,search:`Search…`,breadcrumb:{dashboards:`Dashboards`,pages:`Pages`,reports:`Reports`,system:`System`},nav:{pinItem:`Pin {{name}}`,unpinItem:`Unpin {{name}}`,dragToReorder:`Drag to reorder`,favorites:`Favorites`},loadingSteps:{connecting:`Connecting to data source`,loadingConfig:`Loading configuration`,preparingWorkspace:`Preparing workspace`},error:{connectionFailed:`Cannot connect to server`,serverUnreachable:`The server at {{url}} is unreachable.`,checkServer:`Please check your network connection or that the backend is running.`,timeout:`Connection timed out after 10 seconds.`},actions:{retry:`Retry`,retrying:`Retrying…`},shortcuts:{title:`Keyboard Shortcuts`,description:`Quick reference for all available keyboard shortcuts.`,groups:{general:`General`,navigation:`Navigation`,dataViews:`Data Views`,preferences:`Preferences`},openCommandPalette:`Open command palette`,showShortcuts:`Show keyboard shortcuts`,closeDialog:`Close dialog / panel`,toggleSidebar:`Toggle sidebar`,focusSearch:`Focus search`,createRecord:`Create new record`,refreshData:`Refresh data`,editRecord:`Edit selected record`,toggleDarkMode:`Toggle dark mode`},commandPalette:{placeholder:`Type a command or search...`,noResults:`No results found.`,searching:`Searching…`,records:`Records`,recentRecords:`Recently viewed`,objects:`Objects`,dashboards:`Dashboards`,pages:`Pages`,reports:`Reports`,switchApp:`Switch App`,current:`Current`,preferences:`Preferences`,lightTheme:`Light Theme`,darkTheme:`Dark Theme`,systemTheme:`System Theme`,actions:`Actions`,openFullSearch:`Open Full Search Page`,createApp:`Create New App`},errors:{somethingWentWrong:`Something went wrong`,unexpectedError:`An unexpected error occurred while rendering this view.`,tryAgain:`Try Again`,goHome:`Go Home`,errorDetails:`Error Details (dev only)`},theme:{toggle:`Toggle theme`,light:`Light`,dark:`Dark`,system:`System`},objectView:{objectNotFound:`Object Not Found`,objectNotFoundDescription:`The object "{{objectName}}" does not exist in the current configuration.`,objectNotFoundHint:`Check your app navigation settings or select a different object from the sidebar.`,allRecords:`All Records`,exitDesignMode:`Exit Design Mode`,enterDesignMode:`Enter Design Mode`,metadataInspector:`Metadata Inspector`,editView:`Edit View`,addView:`Add View`,designTools:`Design tools`,new:`New`,import:`Import`,importTitle:`Import from CSV`,importedToast:`Imported {{count}} row(s).`,importedWithSkipped:`Imported {{ok}} row(s); skipped {{skipped}}.`,configureView:`Configure View`,closePanel:`Close panel`,showAdvancedSettings:`Show advanced settings`,showFewerSettings:`Show fewer settings`,page:`Page`,pageConfigHint:`Toolbar, navigation & view shell settings`,listConfigHint:`Data rendering, columns & appearance for this list type`,general:`General`,generalHint:`View title, description, and type`,toolbar:`Toolbar`,toolbarHint:`Search, filter, sort, group, and density toggles`,toolbarEnabledCount:`{{count}} of {{total}} enabled`,navigationSection:`Navigation`,navigationHint:`Row click behavior and detail view settings`,records:`Records`,recordsHint:`Selection mode, add record, and inline editing`,exportPrint:`Export & Print`,exportPrintHint:`Export formats, printing, and record count display`,showAllFields:`Show All`,hideAllFields:`Hide All`,searchFields:`Search fields...`,title:`Title`,description:`Description`,data:`Data`,source:`Source`,columns:`Columns`,filterBy:`Filter by`,sortBy:`Sort by`,appearance:`Appearance`,showDescription:`Show description`,viewType:`View type`,userFilters:`User filters`,enableSearch:`Enable search`,enableFilter:`Enable filter`,enableSort:`Enable sort`,enableHideFields:`Enable hide fields`,enableGroup:`Enable group`,enableColor:`Enable color`,enableDensity:`Enable density`,userActions:`User actions`,addRecordViaForm:`Add records through a form`,advanced:`Advanced`,allowExport:`Allow export`,recordCount:`{{count}} records`,noDescription:`No description`,none:`None`,columnsConfigured:`{{count}} columns`,save:`Save`,discard:`Discard`,createView:`Create View`,createViewDesc:`Pick a view type, then give it a name. You can change every setting afterwards.`,cancel:`Cancel`,create:`Create`,delete:`Delete`,deleteViewTitle:`Delete view`,deleteViewConfirm:`Are you sure you want to delete the view "{{name}}"? This cannot be undone.`,bulkDeleteConfirm:`Delete {{count}} selected records? This cannot be undone.`,duplicateViewName:`A view with this name already exists.`,viewTypeGrid:`Grid`,viewTypeGridDesc:`A spreadsheet-style table of records.`,viewTypeKanban:`Kanban`,viewTypeKanbanDesc:`Cards grouped into columns by a single-select field.`,viewTypeCalendar:`Calendar`,viewTypeCalendarDesc:`Records placed on a monthly calendar by date.`,viewTypeGallery:`Gallery`,viewTypeGalleryDesc:`Large image cards driven by an attachment field.`,viewTypeTimeline:`Timeline`,viewTypeTimelineDesc:`Records along a horizontal time axis.`,viewTypeGantt:`Gantt`,viewTypeGanttDesc:`Project bars with start / end and dependencies.`,viewTypeMap:`Map`,viewTypeMapDesc:`Geographic markers from latitude / longitude fields.`,viewTypeChart:`Chart`,viewTypeChartDesc:`Aggregated bar / line / pie visualisations.`,newView:`New View`,typeOptions:`Type Options`,groupByField:`Group by field`,groupByFieldHelp:`The kanban groups records into columns by this field's values.`,startDateField:`Start date field`,startDateFieldHelp:`The calendar places records on the cell matching this date.`,ganttStartDateFieldHelp:`The left edge of each Gantt bar uses this date.`,ganttEndDateFieldHelp:`The right edge of each Gantt bar uses this date.`,timelineDateFieldHelp:`Records are placed on the timeline by this date.`,titleField:`Title field`,latitudeField:`Latitude field`,latitudeFieldHelp:`Field providing the latitude coordinate (geo fields only).`,longitudeField:`Longitude field`,longitudeFieldHelp:`Field providing the longitude coordinate (geo fields only).`,imageField:`Image field`,imageFieldHelp:`The gallery cover comes from this image or attachment field.`,dateField:`Date field`,selectField:`Select field...`,selectOption:`Select...`,noEligibleFieldForType:`No eligible field of this type. Add one to the object first.`,viewTypeUnavailable:`This object has no field that can serve as "{{field}}".`,viewTypeUnavailableShort:`Not supported by this object.`,chartType:`Chart type`,chartTypeHelp:`Determines how the data is rendered.`,chartTypeBar:`Bar chart`,chartTypeLine:`Line chart`,chartTypePie:`Pie chart`,chartTypeArea:`Area chart`,chartTypeScatter:`Scatter chart`,xAxisField:`X-axis field`,xAxisFieldHelp:`The categorical or time dimension.`,yAxisField:`Y-axis field`,yAxisFieldHelp:`The numeric field to aggregate.`,gridOptionsHint:`Grid view uses the columns configured above.`,groupBy:`Group by`,prefixField:`Prefix field`,fields:`Fields`,fieldsVisible:`{{count}} visible`,sortsCount:`{{count}} sorts`,filtersCount:`{{count}} filters`,endDateField:`End date field`,color:`Color`,fieldTextColor:`Field text color`,rowHeight:`Row height`,wrapHeaders:`Wrap headers`,showFieldDescriptions:`Show field descriptions`,collapseAllByDefault:`Collapse all by default`,striped:`Striped rows`,bordered:`Bordered cells`,inlineEdit:`Edit records inline`,addDeleteRecordsInline:`Add/delete records inline`,clickIntoRecordDetails:`Click into record details`,navigationMode:`Navigation mode`,navigationWidth:`Navigation width`,navigationWidthHint:`Available for drawer, modal, and split navigation modes`,openNewTab:`Open in new tab`,openNewTabHint:`Available for page and new window navigation modes`,selectionMode:`Selection mode`,selectionNone:`None`,selectionSingle:`Single`,selectionMultiple:`Multiple`,pageSize:`Page size`,pageSizeOptions:`Page size options`,exportFormats:`Export formats`,exportMaxRecords:`Max records`,exportIncludeHeaders:`Include headers`,exportFileNamePrefix:`File name prefix`,searchableFields:`Searchable fields`,filterableFields:`Filterable fields`,resizableColumns:`Resizable columns`,densityCompact:`Compact`,densityComfortable:`Comfortable`,densitySpacious:`Spacious`,densityMode:`Density mode`,hiddenFields:`Hidden fields`,rowActions:`Row actions`,bulkActions:`Bulk actions`,sharing:`Sharing`,sharingEnabled:`Enable sharing`,sharingVisibility:`Visibility`,addRecordEnabled:`Enable add record`,addRecordPosition:`Position`,addRecordMode:`Mode`,addRecordFormView:`Form view`,conditionalFormatting:`Conditional formatting`,addRule:`Add rule`,quickFilters:`Quick filters`,addQuickFilter:`Add quick filter`,ufElements:`Elements`,ufDropdown:`Dropdown`,ufTabs:`Tabs`,ufToggle:`Toggle`,ufAddField:`+ Add filter field...`,ufNoFields:`No fields available`,ufAddTab:`+ Add tab`,ufTabLabel:`Label`,ufShowAllRecords:`Show "All records" tab`,ufAllowAddTab:`Allow adding tabs`,showRecordCount:`Show record count`,allowPrinting:`Allow printing`,virtualScroll:`Virtual scroll`,emptyStateTitle:`Empty state title`,emptyStateMessage:`Empty state message`,emptyStateIcon:`Empty state icon`,ariaLabel:`ARIA label`,ariaDescribedBy:`ARIA described by`,ariaLive:`ARIA live`,accessibility:`Accessibility`,viewTabs:`View Tabs`},localeSwitcher:{label:`Language`}},auth:{login:{title:`Sign in to your account`,description:`Enter your email and password to continue`,emailLabel:`Email`,emailPlaceholder:`name@example.com`,passwordLabel:`Password`,passwordPlaceholder:`Enter your password`,forgotPasswordText:`Forgot password?`,submitButton:`Sign In`,submittingButton:`Signing in...`,noAccountText:`Don't have an account?`,signUpText:`Sign up`},register:{title:`Create an account`,description:`Enter your information to get started`,nameLabel:`Name`,namePlaceholder:`John Doe`,emailLabel:`Email`,emailPlaceholder:`name@example.com`,passwordLabel:`Password`,passwordPlaceholder:`Create a password (min. 8 characters)`,confirmPasswordLabel:`Confirm Password`,confirmPasswordPlaceholder:`Confirm your password`,passwordMismatchError:`Passwords do not match`,passwordTooShortError:`Password must be at least 8 characters`,submitButton:`Create Account`,submittingButton:`Creating account...`,hasAccountText:`Already have an account?`,signInText:`Sign in`},forgotPassword:{title:`Reset your password`,description:`Enter your email address and we'll send you a link to reset your password`,emailLabel:`Email`,emailPlaceholder:`name@example.com`,submitButton:`Send Reset Link`,submittingButton:`Sending...`,successTitle:`Check your email`,successDescription:`We've sent a password reset link to {{email}}. Please check your inbox.`,backToSignInText:`Back to sign in`,rememberPasswordText:`Remember your password?`,signInText:`Sign in`}},errors:{networkError:`Network error. Please check your connection.`,serverError:`Server error. Please try again later.`,notFound:`Resource not found.`,unauthorized:`You are not authorized to perform this action.`,forbidden:`Access denied.`,timeout:`Request timed out. Please try again.`,unknown:`An unexpected error occurred.`},workspace:{label:`Workspaces`,default:`My Workspace`,switch:`Switch workspace`,create:`Create workspace`,createTitle:`Create a workspace`,createDescription:`A workspace is a shared space for your team to collaborate.`,createButton:`Create workspace`,nameLabel:`Workspace name`,namePlaceholder:`e.g., Acme Inc`,slugLabel:`URL slug`,slugHint:`Used in URLs. Only lowercase letters, numbers, and hyphens.`,invite:`Invite member`,members:`Members`,settings:`Workspace settings`},sidebar:{settings:`Settings`,help:`Help`,helpTooltip:`Help & Documentation`,activityFeed:`Activity feed`,notifications:`Notifications`,approvals:`Approvals`,inbox:`Inbox`,inboxAriaLabel:`Open inbox`,area:`Area`,recent:`Recent`,favorites:`Favorites`,starred:`Starred`,removeFromFavorites:`Remove {{name}} from favorites`},home:{title:`Home`,subtitle:`Your workspace dashboard`,nav:`Home`,allApps:`All Applications`,greetingMorning:`Good morning`,greetingAfternoon:`Good afternoon`,greetingEvening:`Good evening`,greetingNight:`Working late`,heroTagline:`Pick up where you left off, or explore something new.`,open:`Open`,stats:{apps:`Applications`,starred:`Starred`,recent:`Recent items`},loading:`Loading workspace...`,recent:`Recent`,starred:`Starred`,welcome:`Welcome to ObjectUI`,welcomeDescription:`Get started by creating your first application or configure your system settings.`,createFirstApp:`Create Your First App`,systemSettings:`System Settings`,browseMarketplace:`Browse App Marketplace`,quickActions:{title:`Quick Actions`,createApp:`Create App`,createAppDesc:`Start with a new application`,manageObjects:`Manage Objects`,manageObjectsDesc:`Configure data models`,systemSettings:`System Settings`,systemSettingsDesc:`Configure your workspace`},recentApps:{title:`Recently Accessed`,itemType:{object:`Object`,dashboard:`Dashboard`,page:`Page`,record:`Record`}},starredApps:{title:`Starred`},gettingStarted:{title:`Make this home yours`,description:`Star an app to pin it here for one-click access. Anything you open will show up under Recently Accessed automatically.`,cta:`Browse all applications`},appCard:{noDescription:`No description`,default:`Default`}},layout:{appSwitcher:{home:`Home`,addApp:`Add App`,editApp:`Edit App`,manageAllApps:`Manage All Apps`,systemConsole:`System Console`,noAppsConfigured:`No apps configured`},activityFeed:{title:`Recent Activity`,filter:`Filter`,empty:`No recent activity`,viewAll:`View all activity`,ariaLabel:`Activity feed`,typeCreate:`Create`,typeUpdate:`Update`,typeDelete:`Delete`,typeComment:`Comment`,relativeJustNow:`just now`,relativeSecondsAgo:`{{count}}s ago`,relativeMinutesAgo:`{{count}}m ago`,relativeHoursAgo:`{{count}}h ago`,relativeDaysAgo:`{{count}}d ago`},metadata:{label:`Metadata`,toggleTitle:`Toggle Metadata Inspector`,panelTitle:`Metadata Inspector`,jsonBadge:`JSON`,copyJson:`Copy JSON`}},search:{title:`Search`,back:`Back`,placeholder:`Search objects, dashboards, pages, reports...`,inputAriaLabel:`Search objects, dashboards, pages, reports`,resultsCount:`{{count}} result for "{{query}}"`,resultsCountPlural:`{{count}} results for "{{query}}"`,itemsAvailable:`{{count}} items available`,noResults:`No results found`,noResultsHint:`Try adjusting your search terms`,typeObjects:`Objects`,typeDashboards:`Dashboards`,typePages:`Pages`,typeReports:`Reports`,badgeObject:`object`,badgeDashboard:`dashboard`,badgePage:`page`,badgeReport:`report`},empty:{objectNotFound:`Object Not Found`,objectNotFoundDescription:`Object "{{name}}" definition missing. Check your configuration or navigate back to select a valid object.`,recordNotFound:`Record not found`,recordNotFoundDescription:`The record you are looking for does not exist or may have been deleted.`,pageNotFound:`Page Not Found`,pageNotFoundDescription:`The page "{{name}}" could not be found. It may have been removed or renamed.`,dashboardNotFound:`Dashboard Not Found`,dashboardNotFoundDescription:`The dashboard "{{name}}" could not be found. It may have been removed or renamed.`,reportNotFound:`Report Not Found`,reportNotFoundDescription:`The report "{{name}}" could not be found. It may have been removed or renamed.`,noAppsConfigured:`No Apps Configured`,noAppsConfiguredDescription:`No applications have been registered. Create your first app or visit System Settings to configure your environment.`,createFirstApp:`Create Your First App`,systemSettings:`System Settings`,back:`Back`},renderer:{noPageSchema:`No page schema provided`,noFormSchema:`No form schema provided`,noDashboardSchema:`No dashboard schema provided`,pageRendering:`Page rendering: {{name}}`,dashboardRendering:`Dashboard rendering: {{name}}`,formRenderingMode:`Form rendering in {{mode}} mode`,formRenderingFor:`for record {{id}}`,createRecord:`Create Record`,editRecord:`Edit Record`,page:`Page`,dashboard:`Dashboard`,save:`Save`,cancel:`Cancel`},actionDialog:{title:`Action Parameters`,description:`Please provide the required information to continue.`,selectPlaceholder:`Select {{label}}`,requiredError:`{{label}} is required`,lookupPlaceholder:`Paste the {{label}} record id (UUID)`,lookupHelpText:`Enter the record id of the referenced object. A picker is coming soon.`,cancel:`Cancel`,confirm:`Confirm`,defaultActionTitle:`Action`,ok:`OK`},rowAction:{openMenu:`Open menu`,edit:`Edit`,delete:`Delete`},navigationSync:{addedPage:`Navigation updated: added page "{{name}}"`,addedDashboard:`Navigation updated: added dashboard "{{name}}"`,removedPage:`Navigation updated: removed page "{{name}}"`,removedDashboard:`Navigation updated: removed dashboard "{{name}}"`,renamedPage:`Navigation updated: renamed page "{{oldName}}" → "{{newName}}"`,renamedDashboard:`Navigation updated: renamed dashboard "{{oldName}}" → "{{newName}}"`,undoLabel:`Undo`,undone:`Navigation change undone`,undoFailed:`Failed to undo navigation change`,updateFailed:`Failed to update navigation`},objectActions:{deleteSuccess:`{{label}} deleted successfully`,deleteFailed:`Failed to delete {{label}}`,noRecordId:`No record ID provided`,deleteConfirm:`Are you sure you want to delete this record?`,bulkDeleteSuccess:`Deleted {{count}} {{label}} records`,bulkDeletePartial:`{{succeeded}} deleted, {{failed}} failed`},objectViewActions:{renameFailed:`Failed to rename view`,deleteFailed:`Failed to delete view`},dashboardActions:{pdfPreparing:`Preparing PDF export…`,exportFailed:`Export failed: {{message}}`,forecastSoon:`Forecast view coming soon`},recordDetail:{viewersTooltip:`Users viewing this record`},cellRender:{empty:`Empty`,yes:`Yes`,no:`No`,systemFields:`System`},user:{profile:`Profile`,settings:`Settings`,logout:`Log out`,preferences:`Preferences`,theme:`Theme`,language:`Language`},organizations:{mine:`My Organizations`,title:`Organizations`,heading:`Your Organizations`,subtitle:`Select an organization to continue, or create a new one.`,searchPlaceholder:`Search for an organization`,new:`New organization`,current:`Current organization`,manage:`Manage`,emptyTitle:`No organizations yet`,emptyDescription:`Create your first organization to get started.`,noMatches:`No organizations match your search.`},notifications:{empty:`No notifications`,emptyUnread:`You're all caught up`,filterUnread:`Unread`,filterAll:`All`,markAllRead:`Mark all read`,viewAll:`View all notifications`,approvalsPending:`{{count}} pending approvals`,viewApprovals:`View approvals`,noPendingApprovals:`No pending approvals`,openApprovalsInbox:`Open Approvals Inbox`},publicForm:{submit:`Submit`,submitting:`Submitting…`,submitAnother:`Submit another response`,poweredBy:`Powered by ObjectStack`,secureNotice:`Your information is transmitted securely and only used to respond to your request.`,thankYouTitle:`Thank you!`,thankYouMessage:`Your submission has been received successfully.`,redirecting:`Redirecting in {{seconds}} seconds…`,unavailableTitle:`Form unavailable`,unavailableDescription:`No public form is available at this URL. Make sure the underlying view has anonymous sharing enabled and matches this slug.`,tryDemo:`Try the demo`,retry:`Retry`,loading:`Loading form…`,requiredHint:`* Required field`,consentLabelDefault:`I agree to the privacy policy and consent to my data being processed for this request.`,consentLink:`Privacy policy`,consentRequired:`Please accept the privacy policy to continue.`,rateLimited:`Please take a moment to review your answers before submitting.`,redirectBlocked:`Submission accepted, but the redirect URL was blocked for security.`,demo:{contactTitle:`Contact us`,contactDescription:`Tell us about your project and a sales representative will get back to you within one business day.`,supportTitle:`Submit a support request`,supportDescription:`Tell us what is going wrong — our team responds within one business day.`,thankYouSalesTitle:`Thanks — we received your message!`,thankYouSalesMessage:`A sales representative will be in touch within one business day.`,thankYouSupportTitle:`Got it — your request is in the queue.`,thankYouSupportMessage:`A support engineer will follow up shortly. Save this page if you have more screenshots to add.`,field:{firstName:`First name`,lastName:`Last name`,email:`Work email`,phone:`Phone`,jobTitle:`Job title`,company:`Company`,website:`Website`,industry:`Industry`,companySize:`Company size`,howCanWeHelp:`How can we help?`,subject:`Subject`,description:`Description`,issueType:`Issue type`,priority:`Priority`},industry:{technology:`Technology`,software:`Software / SaaS`,finance:`Finance`,healthcare:`Healthcare`,retail:`Retail`,other:`Other`},issueType:{question:`Question`,problem:`Problem`,bug:`Bug`,feature_request:`Feature request`},priority:{low:`Low`,medium:`Medium`,high:`High`,critical:`Critical`}}},marketplace:{title:`App Marketplace`,subtitle:`Browse approved apps published to the ObjectStack catalog. Click an app to view details and install it into one of your environments.`,searchPlaceholder:`Search apps by name or manifest ID…`,searchAria:`Search marketplace apps`,installed:`Installed`,installedCount:`Installed ({{count}})`,refresh:`Refresh`,all:`All`,noApprovedYet:`No apps have been approved for the marketplace yet.`,noMatchFilters:`No apps match your filters.`,noDescription:`No description provided.`,back:`Back to marketplace`,installedTitle:`Installed Apps`,installedSubtitle:`Marketplace packages currently installed into this runtime's kernel. Cached manifests live in <code>.objectstack/installed-packages/</code> and survive restarts.`,installedEmpty:`No marketplace apps installed in this runtime yet.`,browseLink:`Browse the marketplace →`,installedAdditiveNote:`<strong>Note:</strong> The kernel API is additive only — uninstall removes the on-disk manifest so the package won't load on next boot, but the running kernel keeps the app registered until you restart the runtime.`,installedAt:`Installed {{when}}`,installedBy:`by {{user}}`,installedPackageId:`package`,cachedAs:`Cached as <code>{{path}}</code>`,versionBadge:`v{{version}}`,installedBadge:`Installed v{{version}}`,load:{failed:`Failed to load marketplace`,failedHint:`By default this runtime points at the public ObjectStack cloud. Check the runtime is online, or override <code>OS_CLOUD_URL</code> to point at a self-hosted control plane.`,packageFailed:`Failed to load package`,notFound:`Not found.`},detail:{homepage:`Homepage`,installedV:`Installed · v{{version}}`,about:`About`,noReadme:`No readme provided.`,versions:`Versions`,noApprovedVersions:`No approved versions.`,prerelease:`pre`,moreOptions:`More install options`,uninstallFromRuntime:`Uninstall from this runtime`},action:{install:`Install`,reinstall:`Reinstall`,working:`Working…`,installToCloud:`Install to cloud…`,installing:`Installing…`,uninstall:`Uninstall`,uninstalling:`Uninstalling…`,details:`Details`,close:`Close`,dismiss:`Dismiss`,openOnCloud:`Open on cloud`,backHome:`Back to home`},install:{dialogTitle:`Install {{name}}`,dialogDescCurrent:`Install into this environment ({{host}}).`,dialogDescPicker:`Choose an environment to install this app into. You need to be signed into ObjectStack Cloud.`,environment:`Environment`,environmentPlaceholder:`Pick an environment`,includeSampleData:`Include sample data`,noEnvs:`No environments found in your active organization.`,noPermission:`You do not have permission to install apps in any environment. Only organization owners and admins can install — ask your workspace admin.`,signInFirst:`You need to sign into ObjectStack Cloud first. Click "Open on cloud" below.`,success:`Installed successfully. Open the environment to see the new app.`,localSuccess:`Installed v{{version}} to this runtime. "{{name}}" should now appear in the app switcher.`,localManifestConflict:`{{message}}
|
|
10
10
|
Tip: a local app already owns this manifest_id. Remove it from objectstack.config.ts first.`,localUnauthorized:`Sign in to this runtime first, then try again.`,localMarketplaceUnavailable:`This runtime has no OS_CLOUD_URL configured, so the marketplace catalog is unreachable.`},uninstall:{confirm:`Uninstall {{manifestId}} v{{version}} from this runtime?
|
|
11
11
|
|
|
12
12
|
The cached manifest will be removed. The app will remain loaded in the running kernel until the next restart.`,successInList:`Removed {{manifestId}}. Restart the runtime to fully unload it from the running kernel.`,successInDetail:`Removed cached manifest for {{manifestId}}. Restart the runtime to fully unload the app from the running kernel.`},accessDenied:{title:`App Marketplace is admin-only`,description:`You don't have permission to install apps in this environment. Ask an owner or admin of this organization for access.`},category:{crm:`CRM`,erp:`ERP`,hr:`Human Resources`,finance:`Finance`,project:`Project Management`,collaboration:`Collaboration`,analytics:`Analytics`,integration:`Integration`,automation:`Automation`,ai:`AI`,security:`Security`,"developer-tools":`Developer Tools`,"ui-theme":`UI Theme`,storage:`Storage`,other:`Other`},pricing:{free:`Free`,freemium:`Freemium`,paid:`Paid`,subscription:`Subscription`,"usage-based":`Usage-based`,"contact-sales":`Contact Sales`},relativeTime:{today:`today`,daysAgo:`{{count}}d ago`,monthsAgo:`{{count}}mo ago`,yearsAgo:`{{count}}y ago`}}},zh:{common:{loading:`加载中...`,save:`保存`,cancel:`取消`,delete:`删除`,edit:`编辑`,create:`新建`,search:`搜索`,filter:`筛选`,reset:`重置`,confirm:`确认`,close:`关闭`,back:`返回`,next:`下一步`,previous:`上一步`,submit:`提交`,refresh:`刷新`,export:`导出`,import:`导入`,yes:`是`,no:`否`,ok:`确定`,actions:`操作`,more:`更多`,selectAll:`全选`,clearAll:`清除全部`,addToFavorites:`添加到收藏`,removeFromFavorites:`从收藏中移除`,noData:`暂无数据`,noResults:`未找到结果`,required:`必填`,optional:`选填`,selectOption:`请选择`,select:`选择...`,openChat:`打开聊天`,closeChat:`关闭聊天`,toggleSidebar:`切换侧边栏`},validation:{required:`{{field}}不能为空`,minLength:`{{field}}至少需要{{min}}个字符`,maxLength:`{{field}}最多{{max}}个字符`,min:`{{field}}不能小于{{min}}`,max:`{{field}}不能大于{{max}}`,email:`请输入有效的邮箱地址`,url:`请输入有效的URL`,pattern:`{{field}}格式不正确`,unique:`{{field}}必须唯一`,type:`{{field}}必须是有效的{{type}}`},form:{addItem:`添加项目`,removeItem:`移除项目`,fieldRequired:`此字段为必填项`,invalidFormat:`格式不正确`,saveSuccess:`保存成功`,saveError:`保存失败`,unsavedChanges:`您有未保存的更改,确定要离开吗?`,stepOf:`第{{current}}步,共{{total}}步`,createTitle:`新建{{object}}`,editTitle:`编辑{{object}}`,createDescription:`向数据库添加新的{{object}}。`,editDescription:`更新{{object}}的详情`,saveRecord:`保存`,create:`创建`,update:`更新`,createSuccess:`{{object}}创建成功`,updateSuccess:`{{object}}更新成功`,deleteSuccess:`{{object}}删除成功`},fields:{richText:{format:`格式: {{format}}`,basicEditorHint:`富文本编辑器(基础)`,placeholder:`请输入文字...`}},table:{rowsPerPage:`每页行数`,showing:`显示第{{from}}到{{to}}条,共{{total}}条`,noRows:`暂无数据`,sortAsc:`升序排列`,sortDesc:`降序排列`,filterColumn:`筛选{{column}}`,columns:`列`,exportCSV:`导出CSV`,exportExcel:`导出Excel`,selectRow:`选择行`,selectAllRows:`选择所有行`,expandRow:`展开行`,collapseRow:`折叠行`,hideColumn:`隐藏列`,freezeColumn:`冻结列`,unfreezeColumn:`取消冻结列`,pageInfo:`第 {{current}} 页,共 {{total}} 页`,totalRecords:`共 {{count}} 条`,noResults:`未找到结果`,noResultsHint:`请尝试调整筛选条件或搜索关键词。`,cancelAll:`全部取消`,saveAll:`全部保存 ({{count}})`,addRecord:`添加记录`,open:`打开`,search:`搜索...`,modified:`{{count}} 行已修改`,selected:`已选择 {{count}} 项`,edit:`编辑`,delete:`删除`},grid:{actions:`操作`,edit:`编辑`,delete:`删除`,export:`导出`,exportAs:`导出为 {{format}}`,loading:`加载数据中...`,errorLoading:`数据加载失败`,pullToRefresh:`下拉刷新`,refreshing:`刷新中…`,openRecord:`打开记录`,openMenu:`更多操作`,rowHeight:`行高: {{mode}}`,empty:`空`,yes:`是`,no:`否`,systemFields:`系统字段`,toolbar:{densityMode:`密度`,densityCompact:`紧凑`,densityComfortable:`舒适`,densitySpacious:`宽松`,densityCycleHint:`{{label}}(点击切换)`,densityCycleShortHint:`点击切换`},import:{title:`导入{{object}}`,stepUpload:`上传`,stepMapping:`字段映射`,stepPreview:`预览`,uploadDescription:`上传 CSV 文件以开始导入。`,mappingDescription:`将 CSV 列映射到对象字段。`,previewDescription:`导入前预览数据。`,dragDrop:`拖拽 CSV 文件到此处,或点击选择文件`,browseFiles:`选择文件`,onlyCsv:`仅支持 CSV 文件。`,fileNeedsHeader:`文件必须包含表头行和至少一行数据。`,mappingTemplate:`映射模板:`,chooseTemplate:`选择模板…`,noSavedTemplates:`暂无保存的模板`,noneOption:`— 无 —`,saveCurrent:`保存当前映射`,templateName:`模板名称`,save:`保存`,deleteTemplate:`删除模板`,csvColumn:`CSV 列`,mapsTo:`映射到`,status:`状态`,skipColumn:`跳过此列`,skip:`— 跳过 —`,mapped:`已映射`,skipped:`已跳过`,rowsWithErrors:`{{count}} 行有错误`,rowsCorrected:`已修正 {{count}} 行`,clickToFix:`— 点击高亮单元格可直接修改。`,showingRows:`显示第 {{shown}} 行,共 {{total}} 行`,importing:`导入中… {{progress}}%`,importComplete:`导入完成`,imported:`已导入 {{count}} 条`,skippedCount:`已跳过 {{count}} 条`,moreErrors:`…还有 {{count}} 个错误`,cancel:`取消`,back:`上一步`,next:`下一步`,close:`关闭`,importNRows:`导入 {{count}} 行`,importingProgress:`导入中…`,requiredMark:`*`,required:`必填`,invalidType:`{{type}} 格式无效`}},calendar:{today:`今天`,month:`月`,week:`周`,day:`日`,agenda:`日程`,allDay:`全天`,noEvents:`暂无事件`,newEvent:`新建事件`,moreEvents:`+{{count}} 更多`},list:{recordCount:`{{count}} 条记录`,recordCountOne:`{{count}} 条记录`,addRecord:`添加记录`,tabs:`标签页`,allRecords:`全部记录`,search:`搜索`,filter:`筛选`,filterRecords:`筛选记录`,sort:`排序`,sortRecords:`排序记录`,group:`分组`,groupBy:`分组依据`,export:`导出`,exportAs:`导出为 {{format}}`,color:`颜色`,rowColor:`行颜色`,colorByField:`按字段着色`,clear:`清除`,none:`无`,hideFields:`隐藏字段`,noItems:`暂无数据`,noItemsMessage:`当前没有可显示的记录。请尝试调整筛选条件或新建一条数据。`,showAll:`显示全部`,pullToRefresh:`下拉刷新`,refreshing:`刷新中…`,share:`分享`,print:`打印`,hideFieldsTitle:`隐藏字段`,dataLimitReached:`显示前 {{limit}} 条记录。可能有更多数据。`,viewSettings:`视图设置`,viewSettingsHint:`分组、行颜色、密度与可见字段。`,addGroup:`添加分组字段`,collapsedByDefault:`默认折叠`,removeGroup:`删除`},kanban:{addCard:`添加卡片`,addColumn:`添加列`,moveCard:`移动卡片`,deleteCard:`删除卡片`,deleteColumn:`删除列`,noCards:`暂无卡片`,cardTitlePlaceholder:`输入卡片标题...`},timeline:{bucket:{overdue:`已逾期`,today:`今天`,tomorrow:`明天`,thisWeek:`本周`,nextWeek:`下周`,later:`更晚`,noDate:`无日期`,unassigned:`未分配`}},gantt:{column:{taskName:`任务名称`,start:`开始`,end:`结束`},toolbar:{prevPeriod:`上一周期`,nextPeriod:`下一周期`,zoomIn:`放大`,zoomOut:`缩小`,jumpToToday:`跳到今天`,today:`今天`,showTaskList:`展开任务列表`,hideTaskList:`收起任务列表`}},view:{rename:`重命名`,duplicateView:`复制视图`,shareView:`共享视图`,setAsDefault:`设为默认`,pinView:`固定视图`,unpinView:`取消固定`,changeViewType:`更改视图类型`,deleteView:`删除视图`,addView:`添加视图`,unsavedChanges:`未保存的更改`,saveAsView:`另存为视图`,moreViews:`还有 {{count}} 个`,activeFilters:`筛选条件生效中`,activeSort:`排序生效中`,manageViews:`管理视图`,manageAllViews:`管理所有视图…`,searchViews:`搜索视图`,addNewView:`新建视图`,done:`完成`,noViewsFound:`没有匹配的视图。`,dragToReorder:`拖动排序`,defaultView:`默认视图`,tabActionsFor:`{{name}} 的视图操作`,readonlyAriaLabel:`只读视图`,readonlyTooltip:`系统视图 — 复制后可自定义。`},detail:{back:`返回`,edit:`编辑`,editInline:`编辑`,save:`保存`,saveChanges:`保存更改`,saving:`保存中…`,editFieldsInline:`编辑字段`,lockedByApproval:`审批中已锁定`,lockedTooltip:`该记录有待审批的请求,编辑已被锁定`,cancelApproval:`撤回审批`,cancelApprovalInFlight:`撤回中…`,cancelApprovalTooltip:`撤回当前的待审批请求以解除记录锁定`,cancelApprovalFailed:`撤回审批失败`,cancelApprovalUnavailable:`当前数据源不支持撤回审批`,linkCopied:`链接已复制到剪贴板`,linkCopyFailed:`复制链接失败`,cancel:`取消`,cancelEdit:`放弃更改`,sectionMoreDetails:`更多详情`,concurrentUpdateTitle:`该记录已被他人修改`,concurrentUpdateDescription:`在你编辑期间,另一位用户保存了 {{field}} 的新版本。为避免无声覆盖对方的改动,请选择如何处理该冲突。`,concurrentUpdateYourEdit:`你的修改`,concurrentUpdateCurrentValue:`当前值`,concurrentUpdateUpdatedBy:`由 {{name}} 更新`,concurrentUpdateUpdatedAt:`更新于 {{when}}`,concurrentUpdateReload:`加载最新`,concurrentUpdateOverwrite:`仍然覆盖`,concurrentUpdateCancel:`取消`,openInNewTab:`在新标签页打开`,share:`分享`,duplicate:`复制`,export:`导出`,viewHistory:`查看历史`,delete:`删除`,moreActions:`更多操作`,addToFavorites:`添加到收藏`,removeFromFavorites:`从收藏中移除`,previousRecord:`上一条记录`,nextRecord:`下一条记录`,recordOf:`第 {{current}} 条,共 {{total}} 条`,recordNotFound:`未找到记录`,recordNotFoundDescription:`您查找的记录不存在或已被删除。`,goBack:`返回`,details:`详情`,related:`相关`,relatedRecords:`{{count}} 条记录`,relatedRecordOne:`{{count}} 条记录`,noRelatedRecords:`暂无相关记录`,loading:`加载中...`,copyToClipboard:`复制到剪贴板`,copied:`已复制!`,deleteConfirmation:`确定要删除此记录吗?`,editRecord:`编辑记录`,viewAll:`查看全部`,new:`新建`,emptyValue:`—`,activity:`活动`,history:`历史`,editRow:`编辑`,deleteRow:`删除`,deleteRowConfirmation:`确定要删除此记录吗?`,deleteRowTitle:`删除记录`,actions:`操作`,previousPage:`上一页`,nextPage:`下一页`,pageOf:`第 {{current}} 页,共 {{total}} 页`,sortBy:`排序`,filterPlaceholder:`筛选...`,highlightFields:`关键字段`,comments:`评论`,searchComments:`搜索评论…`,addCommentPlaceholder:`添加评论… (Ctrl+Enter 提交)`,noMatchingComments:`没有匹配的评论`,noCommentsYet:`暂无评论`,pinned:`已置顶`,pin:`置顶`,unpin:`取消置顶`,justNow:`刚刚`,minutesAgo:`{{count}}分钟前`,hoursAgo:`{{count}}小时前`,daysAgo:`{{count}}天前`,createdBy:`创建于`,updatedBy:`更新于`,dropFilesToUpload:`拖拽文件到此处或点击上传`,attachmentCount:`{{count}} 个附件`,attachmentCountPlural:`{{count}} 个附件`,removeAttachment:`移除附件`,unifiedDiff:`统一视图`,sideBySideDiff:`并排视图`,noChanges:`无变更`,previousVersion:`旧版本`,currentVersion:`新版本`,discussion:`讨论`,showDiscussion:`显示讨论 ({{count}})`,hideDiscussion:`隐藏讨论`,bold:`粗体 (Ctrl+B)`,italic:`斜体 (Ctrl+I)`,listFormat:`列表`,inlineCode:`行内代码`,mentionSomeone:`提及某人`,preview:`预览`,submitComment:`提交 (Ctrl+Enter)`,sendComment:`发送`,writeComment:`写评论…`,subscribedTooltip:`已订阅 — 点击取消订阅`,unsubscribedTooltip:`订阅通知`,firstRecord:`第一条记录 (Home)`,previousRecordKey:`上一条记录 (←)`,nextRecordKey:`下一条记录 (→)`,lastRecord:`最后一条记录 (End)`,noRecords:`无记录`,showEmptyRelated_one:`+ {{count}} 个为空`,showEmptyRelated_other:`+ {{count}} 个为空`,searchWhileNavigating:`导航时搜索`,searchRecords:`搜索记录…`,allActivity:`全部动态`,commentsOnly:`仅评论`,fieldChangesFilter:`字段变更`,tasksOnly:`仅任务`,leaveCommentPlaceholder:`留下评论… (Ctrl+Enter 提交)`,noActivity:`暂无活动记录`,loadMore:`加载更多`,edited:`(已编辑)`,via:`通过 {{source}}`,replyCount:`{{count}} 条回复`,replyCountPlural:`{{count}} 条回复`,replyPlaceholder:`回复…`,filterActivity:`筛选活动`,openDiscussion:`打开讨论面板`,closeDiscussion:`关闭讨论面板`,subscribeAriaLabel:`订阅通知`,unsubscribeAriaLabel:`取消订阅通知`,clearSearch:`清除搜索`,copyEmail:`复制邮箱`,copyPhone:`复制电话号码`,copyRecordId:`复制记录 ID`,showEmptyFields:`显示 {{count}} 个空字段`,hideEmptyFields:`隐藏空字段`,noValue:`无`},chart:{noData:`暂无图表数据`,loading:`图表加载中...`},report:{rowTotal:`行合计`,columnTotal:`列合计`,grandTotal:`总计`,totals:`汇总`,rowsLabel:`行`,columnsLabel:`列`,allLabel:`(全部)`,emptyLabel:`(空)`,loading:`加载中…`,failedToLoad:`矩阵报表加载失败:{{message}}`,needsAcross:"矩阵报表至少需要一个 `groupingsAcross` 字段。",aggregate:{count:`计数`,countDistinct:`去重计数`,sum:`求和`,avg:`平均`,min:`最小值`,max:`最大值`,first:`首个`},editor:{breadcrumb:`配置`,basic:`基础`,title:`标题`,titlePlaceholder:`例如:按季度的销售管道`,description:`描述`,descriptionPlaceholder:`此报表展示什么?`,type:`报表类型`,typeTabular:`表格 — 平铺列表`,typeSummary:`汇总 — 分组带合计`,typeMatrix:`矩阵 — 行列透视`,typeJoined:`拼接 — 多块组合`,typeHelp:`选择最贴合需求的布局方式。`,data:`数据`,objectName:`数据源`,objectNamePlaceholder:`例如:opportunity`,objectNameHelp:`此报表应查询哪个对象?`,limit:`行数上限`,limitPlaceholder:`例如:100`,columns:`列`,columnsHint:`选择要展示的字段。汇总或矩阵报表可添加聚合(求和、计数…)。`,filters:`筛选`,filtersHint:`限定参与报表的数据行。`,filtersComplex:`此报表使用了高级筛选条件,此处无法编辑。保存时将原样保留。`,groupBy:`分组`,groupByHint:`按字段分组并计算小计。`,rows:`行`,rowsHint:`按这些字段对行分组。`,columnsAxis:`列`,columnsAxisHint:`将这些字段透视到顶部。`,values:`度量`,valuesHint:`每个单元格里展示的数字。选择一个或多个字段并设置聚合方式(求和、计数…)。`,grouping:`分组`,addGrouping:`添加分组`,dateGranularity:`日期粒度`,dateGranularityNone:`(使用原始值)`,day:`日`,week:`周`,month:`月`,quarter:`季度`,year:`年`,sortAsc:`升序`,sortDesc:`降序`,chart:`图表`,chartHint:`在表格旁可选展示的可视化。`,chartType:`图表类型`,chartTitle:`图表标题`,chartTitlePlaceholder:`默认使用报表标题`,chartXAxis:`X 轴(类别)`,chartYAxis:`Y 轴(数值)`,chartShowLegend:`显示图例`,chartShowDataLabels:`显示数据标签`,chartNone:`(无图表)`,chartBar:`柱状图`,chartLine:`折线图`,chartArea:`面积图`,chartPie:`饼图`,chartDonut:`环形图`,chartFunnel:`漏斗图`,validationNeedsObject:`请先选择数据源,再添加列。`,validationMatrixNeedsRowsCols:`矩阵报表至少需要一个行字段和一个列字段。`,validationSummaryNeedsRows:`汇总报表至少需要一个分组字段。`,blocks:`区块`,blocksHint:`每个区块都是独立的表格或图表。区块筛选会与报表筛选合并(AND)。`,addBlock:`添加区块`,removeBlock:`删除区块`,blockName:`区块名称`,blockNamePlaceholder:`唯一的区块名`,blockLabel:`显示标题`,blockLabelPlaceholder:`显示在区块上方`,blockDescription:`说明`,blockDescriptionPlaceholder:`该区块的可选说明`,validationJoinedNeedsBlocks:`组合报表至少需要一个区块。`,validationBlockNameRequired:`每个区块都必须有非空的名称。`,validationBlockNameDuplicate:`区块名称在报表内必须唯一。`,validationBlockNeedsColumns:`每个区块至少需要一列。`,noneOption:`(无)`,addCondition:`添加条件`,combineLogic:`组合方式`,opContains:`包含`,opIsEmpty:`为空`,opIsNotEmpty:`不为空`,formatAuto:`自动`,formatCurrency:`货币`,formatPercent:`百分比`,formatInteger:`整数`,formatDate:`日期`,formatDatetime:`日期 + 时间`,columnLabelPlaceholder:`自定义标签`,aggregateColumn:`聚合`,formatColumn:`格式`,addColumns:`添加字段`,searchFields:`搜索字段…`,noMatchingFields:`没有匹配的字段。`,noFieldsAvailable:`暂无可用字段。`,columnsCount:`已选择 {n} 个列`,columnsEmpty:`尚未选择任何列。`,fieldPickerTitle:`选择字段`,fieldPickerDescription:`可选择一个或多个字段添加到报表,输入关键字可快速筛选。`,fieldPickerChangeTitle:`更换字段`,fieldPickerAddGroupingTitle:`添加分组`,fieldPickerEmpty:`(请选择字段)`,fieldPickerSelected:`已选 {n} 个`,fieldPickerClear:`清空选择`,fieldPickerAdd:`添加`,fieldPickerAddN:`添加 {n} 个`}},map:{searchLocations:`搜索位置…`,locationDetails:`位置详情`,markersCount:`{{count}} 个标记`,invalidCoordinates:`{{count}} 条记录因坐标缺失或无效已从地图中排除。`,invalidCoordinatesPlural:`{{count}} 条记录因坐标缺失或无效已从地图中排除。`},workflow:{draft:`草稿`,active:`活跃`,paused:`已暂停`,completed:`已完成`,cancelled:`已取消`,save:`保存`,publish:`发布`,addNode:`添加节点`,workflowFlow:`工作流程`,properties:`属性`,connections:`连接`,quickConnect:`快速连接`,fromPlaceholder:`从...`,toPlaceholder:`到...`,connect:`连接`,label:`标签`,type:`类型`,description:`描述`,assignee:`负责人`,assigneeType:`负责人类型`,user:`用户`,role:`角色`,group:`组`,expression:`表达式`,timeoutMinutes:`超时时间(分钟)`,selectNodeToEdit:`选择节点以编辑其属性`,workflowTitle:`工作流标题`,newWorkflow:`新工作流`,outConnections:`{{count}} 个输出`,start:`开始`,end:`结束`,task:`任务`,userTask:`用户任务`,serviceTask:`服务任务`,scriptTask:`脚本任务`,approval:`审批`,condition:`条件`,parallelGateway:`并行网关`,joinGateway:`合并网关`,boundaryEvent:`边界事件`,delay:`延迟`,notification:`通知`,webhook:`Webhook`,allowConcurrency:`允许(并发执行)`,forbidConcurrency:`禁止(跳过新任务)`,replaceConcurrency:`替换(取消现有任务)`,queueConcurrency:`排队(等待当前完成)`,conditionEvent:`条件`,manualEvent:`手动`,webhookEvent:`Webhook`,timerEvent:`定时器`,signalEvent:`信号`,versionHistory:`版本历史`,importBpmn:`导入 BPMN`,exportBpmn:`导出 BPMN`,undo:`撤销`,redo:`重做`,resetZoom:`重置缩放`},dashboard:{addWidget:`添加组件`,removeWidget:`移除组件`,editLayout:`编辑布局`,saveLayout:`保存布局`,resetLayout:`重置布局`,total:`总计`,noDataAvailable:`暂无数据`,noDataSourceFor:`没有可用的数据源:`,trend:{vsLastQuarter:`较上季度`,vsLastMonth:`较上月`,vsLastWeek:`较上周`,vsLastYear:`较去年`,vsYesterday:`较昨日`,vsPreviousPeriod:`较上期`}},configPanel:{save:`保存`,discard:`丢弃`,close:`关闭`,layout:`布局`,columns:`列数`,gap:`间距`,rowHeight:`行高`,data:`数据`,refreshInterval:`刷新间隔`,appearance:`外观`,title:`标题`,showDescription:`显示描述`,theme:`主题`,configuration:`配置`,general:`基本`,advanced:`高级`},appDesigner:{createApp:`创建应用`,editApp:`编辑应用`,basicInfo:`基本信息`,objects:`业务对象`,navigation:`导航`,branding:`品牌`,appName:`应用名称`,appTitle:`标题`,appDescription:`描述`,appIcon:`图标`,template:`模板`,layout:`布局`,layoutSidebar:`侧边栏`,layoutHeader:`顶部导航`,layoutEmpty:`空白`,selectObjects:`选择对象`,searchObjects:`搜索对象…`,selectAll:`全选`,deselectAll:`取消全选`,navBuilder:`导航构建器`,addGroup:`添加分组`,addUrl:`添加链接`,addSeparator:`添加分隔线`,noNavItems:`暂无导航项。`,logoUrl:`Logo 链接`,primaryColor:`主色调`,faviconUrl:`网站图标链接`,preview:`预览`,complete:`完成`,snakeCaseHint:`必须使用 snake_case 格式(如 my_app)`,modeEdit:`编辑`,modePreview:`预览`,modeCode:`代码`,addWidget:`添加组件`,widgetProperties:`组件属性`,dataSource:`数据源`,valueField:`数值字段`,aggregate:`聚合`,colorVariant:`颜色`,addComponent:`添加组件`,componentProperties:`组件属性`,viewType:`视图类型`,fields:`字段`,toolbar:`工具栏`,showSearch:`显示搜索`,showFilters:`显示筛选`,showSort:`显示排序`,appearance:`外观`,rowHeight:`行高`,stripedRows:`斑马纹`,bordered:`边框`,livePreview:`实时预览`,stepBasicDesc:`名称、标题和布局`,stepObjectsDesc:`选择业务对象`,stepNavigationDesc:`构建导航树`,stepBrandingDesc:`Logo、颜色和图标`,noObjectsFound:`未找到对象。`,noNavItemsHint:`暂无导航项。请在上一步选择对象或手动添加项目。`,separator:`分隔线`,separatorLabel:`— 分隔线 —`,newGroup:`新建分组`,newLink:`新建链接`,saveDraft:`保存草稿`,cancelConfirmTitle:`放弃更改?`,cancelConfirmMessage:`您有未保存的更改。确定要取消吗?`,confirmDiscard:`放弃`,keepEditing:`继续编辑`,navNoItems:`暂无导航项。点击上方按钮添加项目。`,navNoPreviewItems:`无项目`,navLivePreview:`实时预览`,navCollapseGroup:`折叠分组`,navExpandGroup:`展开分组`,navAddChild:`添加子项`,navMoveUp:`上移`,navMoveDown:`下移`,navRemove:`移除`,navObjectPage:`对象页面`,navDashboard:`仪表盘`,navPage:`页面`,navReport:`报表`,navGroup:`分组`,navUrl:`链接`,navSeparator:`分隔线`,navTypeObject:`对象`,navTypeDashboard:`仪表盘`,navTypePage:`页面`,navTypeReport:`报表`,navTypeUrl:`链接`,navTypeGroup:`分组`,navTypeSeparator:`分隔线`,navTypeAction:`操作`,navEditIcon:`编辑图标`,navToggleVisible:`切换可见性`,navHidden:`已隐藏`,navExportSchema:`导出 JSON`,navImportSchema:`导入 JSON`,navExportSuccess:`导航结构已导出`,navImportSuccess:`导航结构已导入`,navImportError:`无效的导航 JSON`,navIconPlaceholder:`图标名称(如 Users)`,dashboardEditor:`仪表盘编辑器`,noWidgets:`暂无小组件。点击上方按钮添加。`,widgetLayoutSize:`布局尺寸`,widgetWidth:`宽度`,widgetHeight:`高度`,dashboardPreview:`仪表盘预览`,noWidgetsPreview:`暂无可预览的小组件`,pageCanvasEditor:`页面画布编辑器`,emptyPage:`空白页面。点击上方按钮添加组件。`,pagePreview:`页面预览`,noComponentsPreview:`暂无可预览的组件`,modePage:`页面`,modeDashboard:`仪表盘`,undo:`撤销`,redo:`重做`,brandingEditor:`品牌编辑器`,brandingExport:`导出 JSON`,brandingImport:`导入 JSON`,brandingPreview:`预览`,brandingSampleButton:`示例按钮`,brandingSampleText:`这是您的品牌主题效果预览。`,colorPalette:`颜色面板`,fontFamily:`字体`,fontDefault:`默认(系统)`,modeLight:`浅色`,modeDark:`深色`,mobilePreview:`移动端预览`,objectManager:{title:`对象管理器`,addObject:`新建对象`,searchPlaceholder:`搜索对象…`,noObjects:`未找到对象。`,objectName:`API 名称`,objectLabel:`标签`,pluralLabel:`复数标签`,icon:`图标`,selectIcon:`选择图标…`,group:`分组`,noGroup:`无分组`,sortOrder:`排序`,enabled:`启用`,relationships:`关系`,systemBadge:`系统`,fieldCount:`{{count}} 个字段`,ungrouped:`未分组`,deleteConfirmTitle:`删除对象?`,deleteConfirmMessage:`这将永久删除该对象及其所有字段。此操作无法撤销。`},fieldDesigner:{title:`字段设计器`,addField:`新建字段`,searchPlaceholder:`搜索字段…`,allTypes:`所有类型`,noFields:`未找到字段。`,fieldName:`API 名称`,fieldLabel:`标签`,fieldType:`类型`,fieldGroup:`分组`,description:`描述`,required:`必填`,unique:`唯一`,readOnly:`只读`,hidden:`隐藏`,indexed:`索引`,externalId:`外部 ID`,trackHistory:`追踪历史`,defaultValue:`默认值`,placeholder:`占位文本`,referenceTo:`引用对象`,formula:`公式`,options:`选项`,addOption:`添加选项`,validationRules:`验证规则`,addRule:`添加规则`,systemBadge:`系统`,ungrouped:`通用`,deleteConfirmTitle:`删除字段?`,deleteConfirmMessage:`这将永久删除该字段。此字段中的现有数据将丢失。`,basicSection:`基础`,typeSpecificSection:`类型设置`,advancedSection:`高级`,typeCategory:{text:`文本`,number:`数字`,date:`日期时间`,choice:`选择`,relation:`关联`,advanced:`高级`}}},console:{title:`ObjectStack 控制台`,initializing:`正在初始化应用程序...`,search:`搜索…`,breadcrumb:{dashboards:`仪表盘`,pages:`页面`,reports:`报告`,system:`系统`},nav:{pinItem:`固定 {{name}}`,unpinItem:`取消固定 {{name}}`,dragToReorder:`拖动以重新排序`,favorites:`收藏`},loadingSteps:{connecting:`正在连接数据源`,loadingConfig:`正在加载配置`,preparingWorkspace:`正在准备工作区`},error:{connectionFailed:`无法连接到服务器`,serverUnreachable:`无法访问服务器 {{url}}。`,checkServer:`请检查网络连接,或确认后端服务正在运行。`,timeout:`连接超时(10 秒)。`},actions:{retry:`重试`,retrying:`正在重试…`},shortcuts:{title:`键盘快捷键`,description:`所有可用键盘快捷键的快速参考。`,groups:{general:`通用`,navigation:`导航`,dataViews:`数据视图`,preferences:`偏好设置`},openCommandPalette:`打开命令面板`,showShortcuts:`显示键盘快捷键`,closeDialog:`关闭对话框/面板`,toggleSidebar:`切换侧边栏`,focusSearch:`聚焦搜索`,createRecord:`新建记录`,refreshData:`刷新数据`,editRecord:`编辑选中记录`,toggleDarkMode:`切换深色模式`},commandPalette:{placeholder:`输入命令或搜索...`,noResults:`未找到结果。`,searching:`搜索中…`,records:`记录`,recentRecords:`最近访问`,objects:`对象`,dashboards:`仪表盘`,pages:`页面`,reports:`报表`,switchApp:`切换应用`,current:`当前`,preferences:`偏好设置`,lightTheme:`浅色主题`,darkTheme:`深色主题`,systemTheme:`系统主题`,actions:`操作`,openFullSearch:`打开完整搜索页面`,createApp:`创建新应用`},errors:{somethingWentWrong:`出错了`,unexpectedError:`渲染此视图时发生意外错误。`,tryAgain:`重试`,goHome:`返回首页`,errorDetails:`错误详情(仅开发模式)`},theme:{toggle:`切换主题`,light:`浅色`,dark:`深色`,system:`系统`},objectView:{objectNotFound:`未找到对象`,objectNotFoundDescription:`对象"{{objectName}}"在当前配置中不存在。`,objectNotFoundHint:`请检查您的应用导航设置或从侧边栏选择其他对象。`,allRecords:`所有记录`,exitDesignMode:`退出设计模式`,enterDesignMode:`进入设计模式`,metadataInspector:`元数据检查器`,editView:`编辑视图`,addView:`添加视图`,designTools:`设计工具`,new:`新建`,import:`导入`,importTitle:`从 CSV 文件导入`,importedToast:`成功导入 {{count}} 行。`,importedWithSkipped:`已导入 {{ok}} 行;跳过 {{skipped}} 行。`,configureView:`配置视图`,closePanel:`关闭面板`,showAdvancedSettings:`显示高级设置`,showFewerSettings:`显示精简设置`,page:`页面`,pageConfigHint:`工具栏、导航与视图外壳设置`,listConfigHint:`此列表类型的数据渲染、列与外观`,general:`常规`,generalHint:`视图标题、描述和类型`,toolbar:`工具栏`,toolbarHint:`搜索、筛选、排序、分组和密度切换`,toolbarEnabledCount:`已启用 {{count}}/{{total}} 项`,navigationSection:`导航`,navigationHint:`行点击行为和详情视图设置`,records:`记录`,recordsHint:`选择模式、添加记录和内联编辑`,exportPrint:`导出与打印`,exportPrintHint:`导出格式、打印和记录数显示`,showAllFields:`全部显示`,hideAllFields:`全部隐藏`,searchFields:`搜索字段...`,title:`标题`,description:`描述`,data:`数据`,source:`数据源`,columns:`列`,filterBy:`筛选条件`,sortBy:`排序条件`,appearance:`外观`,showDescription:`显示描述`,viewType:`视图类型`,userFilters:`用户筛选器`,enableSearch:`启用搜索`,enableFilter:`启用筛选`,enableSort:`启用排序`,enableHideFields:`启用隐藏字段`,enableGroup:`启用分组`,enableColor:`启用颜色`,enableDensity:`启用密度`,userActions:`用户操作`,addRecordViaForm:`通过表单添加记录`,advanced:`高级`,allowExport:`允许导出`,recordCount:`{{count}} 条记录`,noDescription:`无描述`,none:`无`,columnsConfigured:`{{count}} 列`,save:`保存`,discard:`丢弃`,createView:`创建视图`,createViewDesc:`先选择视图类型,再为它命名。所有设置之后都可以修改。`,cancel:`取消`,create:`创建`,delete:`删除`,deleteViewTitle:`删除视图`,deleteViewConfirm:`确定要删除视图 "{{name}}" 吗?此操作无法撤销。`,bulkDeleteConfirm:`确定要删除选中的 {{count}} 条记录吗?此操作无法撤销。`,duplicateViewName:`已存在同名视图。`,viewTypeGrid:`表格`,viewTypeGridDesc:`电子表格风格的记录表格。`,viewTypeKanban:`看板`,viewTypeKanbanDesc:`按单选字段分列的卡片视图。`,viewTypeCalendar:`日历`,viewTypeCalendarDesc:`按日期把记录放到月历上。`,viewTypeGallery:`画廊`,viewTypeGalleryDesc:`由附件字段驱动的大图卡片。`,viewTypeTimeline:`时间线`,viewTypeTimelineDesc:`记录按横向时间轴展开。`,viewTypeGantt:`甘特图`,viewTypeGanttDesc:`展示项目起止时间和依赖。`,viewTypeMap:`地图`,viewTypeMapDesc:`根据经纬度字段显示地理标记。`,viewTypeChart:`图表`,viewTypeChartDesc:`聚合的柱状/折线/饼状图。`,newView:`新视图`,typeOptions:`类型选项`,groupByField:`分组字段`,groupByFieldHelp:`看板会按该字段的不同取值分列。`,startDateField:`开始日期字段`,startDateFieldHelp:`日历将按该日期把记录放到对应日期格。`,ganttStartDateFieldHelp:`甘特条形图的左端使用该日期。`,ganttEndDateFieldHelp:`甘特条形图的右端使用该日期。`,timelineDateFieldHelp:`记录在时间轴上按该日期定位。`,titleField:`标题字段`,latitudeField:`纬度字段`,latitudeFieldHelp:`提供纬度坐标的字段(仅地理坐标字段可选)。`,longitudeField:`经度字段`,longitudeFieldHelp:`提供经度坐标的字段(仅地理坐标字段可选)。`,imageField:`图片字段`,imageFieldHelp:`画廊封面来自该图片或附件字段。`,dateField:`日期字段`,selectField:`选择字段...`,selectOption:`选择...`,noEligibleFieldForType:`没有符合条件的字段。请先在对象上添加该类型字段。`,viewTypeUnavailable:`该对象缺少所需的“{{field}}”字段。`,viewTypeUnavailableShort:`当前对象不支持。`,chartType:`图表类型`,chartTypeHelp:`决定数据如何呈现。`,chartTypeBar:`柱状图`,chartTypeLine:`折线图`,chartTypePie:`饼图`,chartTypeArea:`面积图`,chartTypeScatter:`散点图`,xAxisField:`X 轴字段`,xAxisFieldHelp:`用于分类或时间维度的字段。`,yAxisField:`Y 轴字段`,yAxisFieldHelp:`用于数值聚合的字段。`,gridOptionsHint:`网格视图使用上方配置的列。`,groupBy:`分组依据`,prefixField:`前缀字段`,fields:`字段`,fieldsVisible:`{{count}} 个可见`,sortsCount:`{{count}} 个排序`,filtersCount:`{{count}} 个筛选`,endDateField:`结束日期字段`,color:`颜色`,fieldTextColor:`字段文字颜色`,rowHeight:`行高`,wrapHeaders:`自动换行标题`,showFieldDescriptions:`显示字段描述`,collapseAllByDefault:`默认全部折叠`,striped:`斑马纹行`,bordered:`边框单元格`,inlineEdit:`内联编辑记录`,addDeleteRecordsInline:`内联添加/删除记录`,clickIntoRecordDetails:`点击进入记录详情`,navigationMode:`导航模式`,navigationWidth:`导航宽度`,navigationWidthHint:`适用于抽屉、弹窗和分屏导航模式`,openNewTab:`在新标签页打开`,openNewTabHint:`适用于页面和新窗口导航模式`,selectionMode:`选择模式`,selectionNone:`无`,selectionSingle:`单选`,selectionMultiple:`多选`,pageSize:`每页记录数`,pageSizeOptions:`每页选项`,exportFormats:`导出格式`,exportMaxRecords:`最大记录数`,exportIncludeHeaders:`包含表头`,exportFileNamePrefix:`文件名前缀`,searchableFields:`可搜索字段`,filterableFields:`可筛选字段`,resizableColumns:`可调整列宽`,densityCompact:`紧凑`,densityComfortable:`舒适`,densitySpacious:`宽松`,densityMode:`密度模式`,hiddenFields:`隐藏字段`,rowActions:`行操作`,bulkActions:`批量操作`,sharing:`共享`,sharingEnabled:`启用共享`,sharingVisibility:`可见性`,addRecordEnabled:`启用添加记录`,addRecordPosition:`位置`,addRecordMode:`模式`,addRecordFormView:`表单视图`,conditionalFormatting:`条件格式`,addRule:`添加规则`,quickFilters:`快速筛选`,addQuickFilter:`添加快速筛选`,ufElements:`元素类型`,ufDropdown:`下拉菜单`,ufTabs:`标签页`,ufToggle:`开关`,ufAddField:`+ 添加筛选字段...`,ufNoFields:`无可用字段`,ufAddTab:`+ 添加标签页`,ufTabLabel:`标签`,ufShowAllRecords:`显示"全部记录"标签页`,ufAllowAddTab:`允许添加标签页`,showRecordCount:`显示记录计数`,allowPrinting:`允许打印`,virtualScroll:`虚拟滚动`,emptyStateTitle:`空状态标题`,emptyStateMessage:`空状态消息`,emptyStateIcon:`空状态图标`,ariaLabel:`ARIA 标签`,ariaDescribedBy:`ARIA 描述`,ariaLive:`ARIA 实时区域`,accessibility:`无障碍`,viewTabs:`视图标签`},localeSwitcher:{label:`语言`}},auth:{login:{title:`登录您的账户`,description:`输入您的邮箱和密码以继续`,emailLabel:`邮箱`,emailPlaceholder:`name@example.com`,passwordLabel:`密码`,passwordPlaceholder:`输入您的密码`,forgotPasswordText:`忘记密码?`,submitButton:`登录`,submittingButton:`登录中...`,noAccountText:`还没有账户?`,signUpText:`注册`},register:{title:`创建账户`,description:`输入您的信息以开始使用`,nameLabel:`姓名`,namePlaceholder:`张三`,emailLabel:`邮箱`,emailPlaceholder:`name@example.com`,passwordLabel:`密码`,passwordPlaceholder:`创建密码(至少8个字符)`,confirmPasswordLabel:`确认密码`,confirmPasswordPlaceholder:`确认您的密码`,passwordMismatchError:`两次输入的密码不一致`,passwordTooShortError:`密码至少需要8个字符`,submitButton:`创建账户`,submittingButton:`创建中...`,hasAccountText:`已有账户?`,signInText:`登录`},forgotPassword:{title:`重置密码`,description:`输入您的邮箱地址,我们将发送重置密码链接`,emailLabel:`邮箱`,emailPlaceholder:`name@example.com`,submitButton:`发送重置链接`,submittingButton:`发送中...`,successTitle:`请查看您的邮箱`,successDescription:`我们已将密码重置链接发送至 {{email}},请检查您的收件箱。`,backToSignInText:`返回登录`,rememberPasswordText:`记住密码了?`,signInText:`登录`}},errors:{networkError:`网络错误,请检查网络连接。`,serverError:`服务器错误,请稍后重试。`,notFound:`资源未找到。`,unauthorized:`您没有权限执行此操作。`,forbidden:`访问被拒绝。`,timeout:`请求超时,请重试。`,unknown:`发生未知错误。`},workspace:{label:`工作区`,default:`我的工作区`,switch:`切换工作区`,create:`创建工作区`,createTitle:`创建工作区`,createDescription:`工作区是团队协作的共享空间。`,createButton:`创建工作区`,nameLabel:`工作区名称`,namePlaceholder:`例如:极客科技`,slugLabel:`URL 标识`,slugHint:`用于 URL 中,仅支持小写字母、数字和连字符。`,invite:`邀请成员`,members:`成员`,settings:`工作区设置`},sidebar:{settings:`设置`,help:`帮助`,helpTooltip:`帮助与文档`,activityFeed:`活动动态`,notifications:`通知`,approvals:`审批`,inbox:`消息中心`,inboxAriaLabel:`打开消息中心`,area:`区域`,recent:`最近使用`,favorites:`收藏`,starred:`已收藏`,removeFromFavorites:`从收藏中移除 {{name}}`},home:{title:`首页`,subtitle:`您的工作区仪表盘`,nav:`首页`,allApps:`全部应用`,greetingMorning:`早上好`,greetingAfternoon:`下午好`,greetingEvening:`晚上好`,greetingNight:`夜深了`,heroTagline:`从上次离开的地方继续,或者探索新的内容。`,open:`打开`,stats:{apps:`应用`,starred:`收藏`,recent:`最近访问`},loading:`正在加载工作区...`,recent:`最近使用`,starred:`收藏`,welcome:`欢迎使用 ObjectUI`,welcomeDescription:`从创建您的第一个应用开始,或者先完成系统设置。`,createFirstApp:`创建您的第一个应用`,systemSettings:`系统设置`,browseMarketplace:`浏览应用市场`,quickActions:{title:`快捷操作`,createApp:`创建应用`,createAppDesc:`从新应用开始`,manageObjects:`管理对象`,manageObjectsDesc:`配置数据模型`,systemSettings:`系统设置`,systemSettingsDesc:`配置您的工作区`},recentApps:{title:`最近访问`,itemType:{object:`对象`,dashboard:`仪表盘`,page:`页面`,record:`记录`}},starredApps:{title:`收藏`},gettingStarted:{title:`把首页布置成你喜欢的样子`,description:`收藏一个应用即可固定到此处,一键直达。打开过的内容会自动出现在「最近访问」中。`,cta:`浏览全部应用`},appCard:{noDescription:`暂无描述`,default:`默认`}},layout:{appSwitcher:{home:`首页`,addApp:`新增应用`,editApp:`编辑应用`,manageAllApps:`管理所有应用`,systemConsole:`系统控制台`,noAppsConfigured:`尚未配置任何应用`},activityFeed:{title:`最近动态`,filter:`筛选`,empty:`暂无最近动态`,viewAll:`查看全部动态`,ariaLabel:`动态消息`,typeCreate:`创建`,typeUpdate:`更新`,typeDelete:`删除`,typeComment:`评论`,relativeJustNow:`刚刚`,relativeSecondsAgo:`{{count}} 秒前`,relativeMinutesAgo:`{{count}} 分钟前`,relativeHoursAgo:`{{count}} 小时前`,relativeDaysAgo:`{{count}} 天前`},metadata:{label:`元数据`,toggleTitle:`切换元数据检视器`,panelTitle:`元数据检视器`,jsonBadge:`JSON`,copyJson:`复制 JSON`}},search:{title:`搜索`,back:`返回`,placeholder:`搜索对象、仪表板、页面、报表…`,inputAriaLabel:`搜索对象、仪表板、页面、报表`,resultsCount:`找到 {{count}} 条与“{{query}}”相关的结果`,resultsCountPlural:`找到 {{count}} 条与“{{query}}”相关的结果`,itemsAvailable:`共 {{count}} 项可搜索`,noResults:`未找到结果`,noResultsHint:`请尝试调整搜索关键字`,typeObjects:`对象`,typeDashboards:`仪表板`,typePages:`页面`,typeReports:`报表`,badgeObject:`对象`,badgeDashboard:`仪表板`,badgePage:`页面`,badgeReport:`报表`},empty:{objectNotFound:`未找到对象`,objectNotFoundDescription:`对象 “{{name}}” 的定义不存在。请检查配置或返回选择有效的对象。`,recordNotFound:`未找到记录`,recordNotFoundDescription:`您查找的记录不存在或已被删除。`,pageNotFound:`未找到页面`,pageNotFoundDescription:`未找到页面 “{{name}}”,可能已被删除或重命名。`,dashboardNotFound:`未找到仪表板`,dashboardNotFoundDescription:`未找到仪表板 “{{name}}”,可能已被删除或重命名。`,reportNotFound:`未找到报表`,reportNotFoundDescription:`未找到报表 “{{name}}”,可能已被删除或重命名。`,noAppsConfigured:`尚未配置应用`,noAppsConfiguredDescription:`当前没有任何已注册的应用。请创建您的第一个应用,或前往系统设置进行配置。`,createFirstApp:`创建您的第一个应用`,systemSettings:`系统设置`,back:`返回`},renderer:{noPageSchema:`未提供页面 schema`,noFormSchema:`未提供表单 schema`,noDashboardSchema:`未提供仪表板 schema`,pageRendering:`页面渲染中:{{name}}`,dashboardRendering:`仪表板渲染中:{{name}}`,formRenderingMode:`正在以 {{mode}} 模式渲染表单`,formRenderingFor:`记录 {{id}}`,createRecord:`新建记录`,editRecord:`编辑记录`,page:`页面`,dashboard:`仪表板`,save:`保存`,cancel:`取消`},actionDialog:{title:`操作参数`,description:`请填写以下信息以继续操作。`,selectPlaceholder:`请选择 {{label}}`,requiredError:`{{label}} 为必填项`,lookupPlaceholder:`粘贴 {{label}} 的记录 ID(UUID)`,lookupHelpText:`请输入引用记录的 ID。可视化选择器即将上线。`,cancel:`取消`,confirm:`确认`,defaultActionTitle:`操作`,ok:`确定`},rowAction:{openMenu:`更多操作`,edit:`编辑`,delete:`删除`},navigationSync:{addedPage:`导航已更新:已添加页面 “{{name}}”`,addedDashboard:`导航已更新:已添加仪表板 “{{name}}”`,removedPage:`导航已更新:已移除页面 “{{name}}”`,removedDashboard:`导航已更新:已移除仪表板 “{{name}}”`,renamedPage:`导航已更新:页面 “{{oldName}}” 已重命名为 “{{newName}}”`,renamedDashboard:`导航已更新:仪表板 “{{oldName}}” 已重命名为 “{{newName}}”`,undoLabel:`撤销`,undone:`已撤销导航变更`,undoFailed:`撤销导航变更失败`,updateFailed:`更新导航失败`},objectActions:{deleteSuccess:`{{label}} 删除成功`,deleteFailed:`删除 {{label}} 失败`,noRecordId:`未提供记录 ID`,deleteConfirm:`确定要删除此记录吗?`,bulkDeleteSuccess:`已删除 {{count}} 条 {{label}} 记录`,bulkDeletePartial:`成功 {{succeeded}} 条,失败 {{failed}} 条`},objectViewActions:{renameFailed:`重命名视图失败`,deleteFailed:`删除视图失败`},dashboardActions:{pdfPreparing:`正在准备 PDF 导出…`,exportFailed:`导出失败:{{message}}`,forecastSoon:`预测视图即将上线`},recordDetail:{viewersTooltip:`正在查看此记录的用户`},cellRender:{empty:`空`,yes:`是`,no:`否`,systemFields:`系统字段`},user:{profile:`个人资料`,settings:`设置`,logout:`注销`,preferences:`偏好设置`,theme:`主题`,language:`语言`},organizations:{mine:`我的组织`,title:`组织`,heading:`您的组织`,subtitle:`选择一个组织以继续,或新建一个组织。`,searchPlaceholder:`搜索组织`,new:`新建组织`,current:`当前组织`,manage:`管理`,emptyTitle:`尚无组织`,emptyDescription:`创建您的第一个组织以开始使用。`,noMatches:`没有匹配的组织。`},notifications:{empty:`暂无通知`,emptyUnread:`已读完所有通知`,filterUnread:`未读`,filterAll:`全部`,markAllRead:`全部标记为已读`,viewAll:`查看全部通知`,approvalsPending:`{{count}} 条待审批`,viewApprovals:`查看审批`,noPendingApprovals:`暂无待审批事项`,openApprovalsInbox:`打开审批中心`},publicForm:{submit:`提交`,submitting:`提交中…`,submitAnother:`再填一份`,poweredBy:`由 ObjectStack 提供技术支持`,secureNotice:`您的信息将通过安全通道传输,仅用于回复您本次请求。`,thankYouTitle:`感谢您的提交!`,thankYouMessage:`我们已成功收到您的信息。`,redirecting:`将在 {{seconds}} 秒后跳转…`,unavailableTitle:`表单不可用`,unavailableDescription:`该链接当前没有可用的公开表单。请确认对应视图已启用匿名分享并匹配此 slug。`,tryDemo:`试用演示`,retry:`重试`,loading:`正在加载表单…`,requiredHint:`* 为必填项`,consentLabelDefault:`我已阅读并同意隐私政策,授权对本次请求所提供的信息进行处理。`,consentLink:`隐私政策`,consentRequired:`请先勾选同意隐私政策。`,rateLimited:`请再花点时间核对一下您的填写内容,再点击提交。`,redirectBlocked:`提交成功,但出于安全考虑,跳转链接已被阻止。`,demo:{contactTitle:`联系我们`,contactDescription:`告诉我们您的项目需求,销售代表将在一个工作日内与您联系。`,supportTitle:`提交支持请求`,supportDescription:`描述您遇到的问题,我们的团队会在一个工作日内回复。`,thankYouSalesTitle:`已收到您的信息,感谢联系!`,thankYouSalesMessage:`我们的销售代表将在一个工作日内与您取得联系。`,thankYouSupportTitle:`您的请求已进入处理队列。`,thankYouSupportMessage:`支持工程师将尽快跟进。如需补充截图,请保留此页面。`,field:{firstName:`名字`,lastName:`姓氏`,email:`工作邮箱`,phone:`电话`,jobTitle:`职位`,company:`公司`,website:`官网`,industry:`行业`,companySize:`公司规模`,howCanWeHelp:`我们可以为您做些什么?`,subject:`主题`,description:`问题描述`,issueType:`问题类型`,priority:`优先级`},industry:{technology:`科技`,software:`软件 / SaaS`,finance:`金融`,healthcare:`医疗健康`,retail:`零售`,other:`其他`},issueType:{question:`咨询`,problem:`问题`,bug:`缺陷`,feature_request:`功能建议`},priority:{low:`低`,medium:`中`,high:`高`,critical:`紧急`}}},marketplace:{title:`应用市场`,subtitle:`浏览已通过审核、发布到 ObjectStack 目录中的应用。点击应用查看详情并安装到你的某个环境中。`,searchPlaceholder:`按名称或 manifest ID 搜索应用…`,searchAria:`搜索市场应用`,installed:`已安装`,installedCount:`已安装({{count}})`,refresh:`刷新`,all:`全部`,noApprovedYet:`应用市场暂无已通过审核的应用。`,noMatchFilters:`没有应用匹配当前筛选条件。`,noDescription:`未提供描述。`,back:`返回应用市场`,installedTitle:`已安装的应用`,installedSubtitle:`当前已安装到本运行时内核的应用市场软件包。缓存的清单文件位于 <code>.objectstack/installed-packages/</code>,重启后仍然保留。`,installedEmpty:`本运行时尚未安装任何应用市场应用。`,browseLink:`去应用市场看看 →`,installedAdditiveNote:`<strong>说明:</strong>内核 API 仅支持新增 — 卸载会移除磁盘上的清单,下次启动时不再加载;但运行中的内核仍会保留该应用,直到下次重启运行时才会真正卸载。`,installedAt:`安装于 {{when}}`,installedBy:`由 {{user}}`,installedPackageId:`包`,cachedAs:`缓存为 <code>{{path}}</code>`,versionBadge:`v{{version}}`,installedBadge:`已安装 v{{version}}`,load:{failed:`应用市场加载失败`,failedHint:`本运行时默认指向公共 ObjectStack 云端。请检查运行时是否在线,或通过 <code>OS_CLOUD_URL</code> 指向自托管控制面。`,packageFailed:`应用加载失败`,notFound:`未找到。`},detail:{homepage:`主页`,installedV:`已安装 · v{{version}}`,about:`简介`,noReadme:`未提供 README。`,versions:`版本`,noApprovedVersions:`暂无已审核版本。`,prerelease:`预发布`,moreOptions:`更多安装选项`,uninstallFromRuntime:`从本运行时卸载`},action:{install:`安装`,reinstall:`重新安装`,working:`处理中…`,installToCloud:`安装到云端…`,installing:`安装中…`,uninstall:`卸载`,uninstalling:`卸载中…`,details:`详情`,close:`关闭`,dismiss:`关闭`,openOnCloud:`在云端打开`,backHome:`返回首页`},install:{dialogTitle:`安装 {{name}}`,dialogDescCurrent:`安装到当前环境({{host}})。`,dialogDescPicker:`选择要将此应用安装到的环境。需要先登录 ObjectStack Cloud。`,environment:`环境`,environmentPlaceholder:`选择一个环境`,includeSampleData:`包含示例数据`,noEnvs:`当前组织没有可用的环境。`,noPermission:`你没有权限在任何环境中安装应用。仅组织所有者和管理员可以安装 — 请联系你的工作区管理员。`,signInFirst:`请先登录 ObjectStack Cloud,然后点击下方"在云端打开"。`,success:`安装成功。打开环境即可看到新应用。`,localSuccess:`已将 v{{version}} 安装到本运行时。"{{name}}" 应该已经出现在应用切换器中。`,localManifestConflict:`{{message}}
|
|
@@ -36,7 +36,7 @@ Tip: a local app already owns this manifest_id. Remove it from objectstack.confi
|
|
|
36
36
|
The cached manifest will be removed. The app will remain loaded in the running kernel until the next restart.`,successInList:`Removed {{manifestId}}. Restart the runtime to fully unload it from the running kernel.`,successInDetail:`Removed cached manifest for {{manifestId}}. Restart the runtime to fully unload the app from the running kernel.`},accessDenied:{title:`App Marketplace is admin-only`,description:`You don't have permission to install apps in this environment. Ask an owner or admin of this organization for access.`},category:{crm:`CRM`,erp:`ERP`,hr:`Human Resources`,finance:`Finance`,project:`Project Management`,collaboration:`Collaboration`,analytics:`Analytics`,integration:`Integration`,automation:`Automation`,ai:`AI`,security:`Security`,"developer-tools":`Developer Tools`,"ui-theme":`UI Theme`,storage:`Storage`,other:`Other`},pricing:{free:`Free`,freemium:`Freemium`,paid:`Paid`,subscription:`Subscription`,"usage-based":`Usage-based`,"contact-sales":`Contact Sales`},relativeTime:{today:`today`,daysAgo:`{{count}}d ago`,monthsAgo:`{{count}}mo ago`,yearsAgo:`{{count}}y ago`}}},ar:{common:{addToFavorites:`إضافة إلى المفضلة`,removeFromFavorites:`إزالة من المفضلة`,loading:`جاري التحميل...`,save:`حفظ`,cancel:`إلغاء`,delete:`حذف`,edit:`تعديل`,create:`إنشاء`,search:`بحث`,filter:`تصفية`,reset:`إعادة تعيين`,confirm:`تأكيد`,close:`إغلاق`,back:`رجوع`,next:`التالي`,previous:`السابق`,submit:`إرسال`,refresh:`تحديث`,export:`تصدير`,import:`استيراد`,yes:`نعم`,no:`لا`,ok:`موافق`,actions:`إجراءات`,more:`المزيد`,selectAll:`تحديد الكل`,clearAll:`مسح الكل`,noData:`لا توجد بيانات`,noResults:`لم يتم العثور على نتائج`,required:`مطلوب`,optional:`اختياري`,selectOption:`اختر خياراً`,select:`اختر...`,openChat:`فتح المحادثة`,closeChat:`إغلاق المحادثة`,toggleSidebar:`تبديل الشريط الجانبي`},validation:{required:`{{field}} مطلوب`,minLength:`{{field}} يجب أن يكون {{min}} حرفاً على الأقل`,maxLength:`{{field}} يجب ألا يتجاوز {{max}} حرفاً`,min:`{{field}} يجب أن يكون {{min}} على الأقل`,max:`{{field}} يجب ألا يتجاوز {{max}}`,email:`يرجى إدخال بريد إلكتروني صالح`,url:`يرجى إدخال رابط صالح`,pattern:`صيغة {{field}} غير صالحة`,unique:`{{field}} يجب أن يكون فريداً`,type:`{{field}} يجب أن يكون {{type}} صالحاً`},form:{addItem:`إضافة عنصر`,removeItem:`إزالة عنصر`,fieldRequired:`هذا الحقل مطلوب`,invalidFormat:`صيغة غير صالحة`,saveSuccess:`تم الحفظ بنجاح`,saveError:`فشل في الحفظ`,unsavedChanges:`لديك تغييرات غير محفوظة. هل أنت متأكد أنك تريد المغادرة؟`,stepOf:`الخطوة {{current}} من {{total}}`,createTitle:`إنشاء {{object}}`,editTitle:`تعديل {{object}}`,createDescription:`إضافة {{object}} جديد إلى قاعدة البيانات.`,editDescription:`تحديث تفاصيل {{object}}`,saveRecord:`حفظ السجل`},fields:{richText:{format:`Format: {{format}}`,basicEditorHint:`Rich text editor (basic)`,placeholder:`Enter text...`}},table:{rowsPerPage:`صفوف في الصفحة`,showing:`عرض {{from}} إلى {{to}} من {{total}}`,noRows:`لا توجد صفوف للعرض`,sortAsc:`ترتيب تصاعدي`,sortDesc:`ترتيب تنازلي`,filterColumn:`تصفية {{column}}`,columns:`الأعمدة`,exportCSV:`تصدير CSV`,exportExcel:`تصدير Excel`,selectRow:`تحديد صف`,selectAllRows:`تحديد جميع الصفوف`,expandRow:`توسيع الصف`,collapseRow:`طي الصف`,hideColumn:`إخفاء العمود`,freezeColumn:`تجميد العمود`,unfreezeColumn:`إلغاء تجميد العمود`,pageInfo:`صفحة {{current}} من {{total}}`,totalRecords:`{{count}} إجمالي`},grid:{actions:`إجراءات`,edit:`تعديل`,delete:`حذف`,export:`تصدير`,exportAs:`تصدير كـ {{format}}`,loading:`جاري تحميل الشبكة...`,errorLoading:`خطأ في تحميل الشبكة`,pullToRefresh:`اسحب للتحديث`,refreshing:`جاري التحديث…`,openRecord:`فتح السجل`,rowHeight:`ارتفاع الصف: {{mode}}`},calendar:{today:`اليوم`,month:`شهر`,week:`أسبوع`,day:`يوم`,agenda:`جدول أعمال`,allDay:`طوال اليوم`,noEvents:`لا توجد أحداث`,newEvent:`حدث جديد`,moreEvents:`+{{count}} المزيد`},list:{recordCount:`{{count}} سجلات`,recordCountOne:`{{count}} سجل`,addRecord:`إضافة سجل`,tabs:`علامات التبويب`,allRecords:`جميع السجلات`,search:`بحث`,filter:`تصفية`,filterRecords:`تصفية السجلات`,sort:`ترتيب`,sortRecords:`ترتيب السجلات`,group:`تجميع`,groupBy:`تجميع حسب`,export:`تصدير`,exportAs:`تصدير كـ {{format}}`,color:`لون`,rowColor:`لون الصف`,colorByField:`تلوين حسب الحقل`,clear:`مسح`,none:`لا شيء`,hideFields:`إخفاء الحقول`,noItems:`لم يتم العثور على عناصر`,noItemsMessage:`لا توجد سجلات للعرض. حاول تعديل الفلاتر أو إضافة بيانات جديدة.`},kanban:{addCard:`إضافة بطاقة`,addColumn:`إضافة عمود`,moveCard:`نقل بطاقة`,deleteCard:`حذف بطاقة`,deleteColumn:`حذف عمود`},timeline:{bucket:{overdue:`متأخر`,today:`اليوم`,tomorrow:`غداً`,thisWeek:`هذا الأسبوع`,nextWeek:`الأسبوع القادم`,later:`لاحقاً`,noDate:`بدون تاريخ`,unassigned:`غير معين`}},gantt:{column:{taskName:`Task Name`,start:`Start`,end:`End`},toolbar:{prevPeriod:`Previous period`,nextPeriod:`Next period`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,jumpToToday:`Jump to today`,today:`Today`,showTaskList:`Show task list`,hideTaskList:`Hide task list`}},view:{rename:`إعادة تسمية`,duplicateView:`تكرار العرض`,shareView:`مشاركة العرض`,setAsDefault:`تعيين كافتراضي`,pinView:`تثبيت العرض`,unpinView:`إلغاء تثبيت العرض`,changeViewType:`تغيير نوع العرض`,deleteView:`حذف العرض`,addView:`إضافة عرض`,unsavedChanges:`تغييرات غير محفوظة`,saveAsView:`حفظ كعرض`,moreViews:`{{count}} المزيد`,activeFilters:`الفلاتر نشطة`,activeSort:`الترتيب نشط`},detail:{back:`رجوع`,edit:`تحرير`,editInline:`تحرير`,save:`حفظ`,saveChanges:`حفظ التغييرات`,editFieldsInline:`تحرير الحقول`,share:`مشاركة`,duplicate:`نسخ`,export:`تصدير`,viewHistory:`عرض السجل`,delete:`حذف`,moreActions:`المزيد من الإجراءات`,addToFavorites:`إضافة إلى المفضلة`,removeFromFavorites:`إزالة من المفضلة`,previousRecord:`السجل السابق`,nextRecord:`السجل التالي`,recordOf:`{{current}} من {{total}}`,recordNotFound:`لم يتم العثور على السجل`,recordNotFoundDescription:`السجل الذي تبحث عنه غير موجود أو ربما تم حذفه.`,goBack:`رجوع`,details:`التفاصيل`,related:`ذات صلة`,relatedRecords:`{{count}} سجلات`,relatedRecordOne:`{{count}} سجل`,noRelatedRecords:`لا توجد سجلات ذات صلة`,loading:`جاري التحميل...`,copyToClipboard:`نسخ إلى الحافظة`,copied:`تم النسخ!`,deleteConfirmation:`هل أنت متأكد أنك تريد حذف هذا السجل؟`,editRecord:`تحرير السجل`,viewAll:`عرض الكل`,new:`جديد`,emptyValue:`—`,comments:`التعليقات`,searchComments:`البحث في التعليقات…`,addCommentPlaceholder:`أضف تعليقاً… (Ctrl+Enter للإرسال)`,noMatchingComments:`لا توجد تعليقات مطابقة`,noCommentsYet:`لا توجد تعليقات بعد`,pinned:`مثبت`,pin:`تثبيت`,unpin:`إلغاء التثبيت`,justNow:`الآن`,minutesAgo:`منذ {{count}} دقيقة`,hoursAgo:`منذ {{count}} ساعة`,daysAgo:`منذ {{count}} يوم`,dropFilesToUpload:`اسحب الملفات هنا أو انقر للرفع`,attachmentCount:`{{count}} مرفق`,attachmentCountPlural:`{{count}} مرفقات`,removeAttachment:`إزالة المرفق`,unifiedDiff:`عرض موحد`,sideBySideDiff:`عرض جنباً إلى جنب`,noChanges:`لا توجد تغييرات`,previousVersion:`السابق`,currentVersion:`الحالي`,discussion:`المناقشة`,showDiscussion:`إظهار المناقشة ({{count}})`,hideDiscussion:`إخفاء المناقشة`,bold:`غامق (Ctrl+B)`,italic:`مائل (Ctrl+I)`,listFormat:`قائمة`,inlineCode:`كود مضمن`,mentionSomeone:`إشارة إلى شخص`,preview:`معاينة`,submitComment:`إرسال (Ctrl+Enter)`,sendComment:`إرسال`,writeComment:`اكتب تعليقاً…`,subscribedTooltip:`مشترك — انقر لإلغاء الاشتراك`,unsubscribedTooltip:`الاشتراك في الإشعارات`,firstRecord:`السجل الأول (Home)`,previousRecordKey:`السجل السابق (←)`,nextRecordKey:`السجل التالي (→)`,lastRecord:`السجل الأخير (End)`,noRecords:`لا توجد سجلات`,searchWhileNavigating:`البحث أثناء التصفح`,searchRecords:`البحث في السجلات…`,allActivity:`كل النشاط`,commentsOnly:`التعليقات فقط`,fieldChangesFilter:`تغييرات الحقول`,tasksOnly:`المهام فقط`,leaveCommentPlaceholder:`اترك تعليقاً… (Ctrl+Enter للإرسال)`,noActivity:`لا يوجد نشاط مسجل`,loadMore:`تحميل المزيد`,edited:`(معدل)`,via:`عبر {{source}}`,replyCount:`{{count}} رد`,replyCountPlural:`{{count}} ردود`,replyPlaceholder:`رد…`,filterActivity:`تصفية النشاط`,openDiscussion:`فتح لوحة المناقشة`,closeDiscussion:`إغلاق لوحة المناقشة`,subscribeAriaLabel:`الاشتراك في الإشعارات`,unsubscribeAriaLabel:`إلغاء الاشتراك من الإشعارات`,clearSearch:`مسح البحث`},chart:{noData:`لا تتوفر بيانات للرسم البياني`,loading:`جاري تحميل الرسم البياني...`},map:{searchLocations:`البحث عن المواقع…`,locationDetails:`تفاصيل الموقع`,markersCount:`{{count}} علامة`,invalidCoordinates:`{{count}} سجل بإحداثيات مفقودة أو غير صالحة مستبعد من الخريطة.`,invalidCoordinatesPlural:`{{count}} سجلات بإحداثيات مفقودة أو غير صالحة مستبعدة من الخريطة.`},workflow:{draft:`مسودة`,active:`نشط`,paused:`متوقف مؤقتاً`,completed:`مكتمل`,cancelled:`ملغي`,save:`حفظ`,publish:`نشر`,addNode:`إضافة عقدة`,workflowFlow:`سير العمل`,properties:`الخصائص`,connections:`الاتصالات`,quickConnect:`اتصال سريع`,fromPlaceholder:`من...`,toPlaceholder:`إلى...`,connect:`ربط`,label:`التسمية`,type:`النوع`,description:`الوصف`,assignee:`المسؤول`,assigneeType:`نوع المسؤول`,user:`مستخدم`,role:`دور`,group:`مجموعة`,expression:`تعبير`,timeoutMinutes:`المهلة (دقائق)`,selectNodeToEdit:`حدد عقدة لتعديل خصائصها`,workflowTitle:`عنوان سير العمل`,newWorkflow:`سير عمل جديد`,outConnections:`{{count}} مخرج`,start:`بداية`,end:`نهاية`,task:`مهمة`,userTask:`مهمة مستخدم`,serviceTask:`مهمة خدمة`,scriptTask:`مهمة نصية`,approval:`موافقة`,condition:`شرط`,parallelGateway:`بوابة متوازية`,joinGateway:`بوابة دمج`,boundaryEvent:`حدث حدودي`,delay:`تأخير`,notification:`إشعار`,webhook:`Webhook`,allowConcurrency:`السماح (تنفيذ متزامن)`,forbidConcurrency:`منع (تخطي الجديد)`,replaceConcurrency:`استبدال (إلغاء الحالي)`,queueConcurrency:`طابور (تنفيذ بعد الحالي)`,conditionEvent:`شرط`,manualEvent:`يدوي`,webhookEvent:`Webhook`,timerEvent:`مؤقت`,signalEvent:`إشارة`,versionHistory:`تاريخ الإصدارات`,importBpmn:`استيراد BPMN`,exportBpmn:`تصدير BPMN`,undo:`تراجع`,redo:`إعادة`,resetZoom:`إعادة تعيين التكبير`},dashboard:{addWidget:`إضافة أداة`,removeWidget:`إزالة أداة`,editLayout:`تعديل التخطيط`,saveLayout:`حفظ التخطيط`,resetLayout:`إعادة تعيين التخطيط`},configPanel:{save:`حفظ`,discard:`تجاهل`,close:`إغلاق`,layout:`التخطيط`,columns:`الأعمدة`,gap:`المسافة`,rowHeight:`ارتفاع الصف`,data:`البيانات`,refreshInterval:`فترة التحديث`,appearance:`المظهر`,title:`العنوان`,showDescription:`إظهار الوصف`,theme:`السمة`,configuration:`الإعداد`,general:`عام`,advanced:`متقدم`},appDesigner:{createApp:`Create Application`,editApp:`Edit Application`,basicInfo:`Basic Info`,objects:`Objects`,navigation:`Navigation`,branding:`Branding`,appName:`App Name`,appTitle:`Title`,appDescription:`Description`,appIcon:`Icon`,template:`Template`,layout:`Layout`,layoutSidebar:`Sidebar`,layoutHeader:`Header`,layoutEmpty:`Empty`,selectObjects:`Select Objects`,searchObjects:`Search objects…`,selectAll:`Select All`,deselectAll:`Deselect All`,navBuilder:`Navigation Builder`,addGroup:`Add Group`,addUrl:`Add URL`,addSeparator:`Add Separator`,noNavItems:`No navigation items yet.`,logoUrl:`Logo URL`,primaryColor:`Primary Color`,faviconUrl:`Favicon URL`,preview:`Preview`,complete:`Complete`,snakeCaseHint:`Must be snake_case (e.g. my_app)`,modeEdit:`Edit`,modePreview:`Preview`,modeCode:`Code`,addWidget:`Add Widget`,widgetProperties:`Widget Properties`,dataSource:`Data Source`,valueField:`Value Field`,aggregate:`Aggregate`,colorVariant:`Color Variant`,addComponent:`Add Component`,componentProperties:`Component Properties`,viewType:`View Type`,fields:`Fields`,toolbar:`Toolbar`,showSearch:`Show Search`,showFilters:`Show Filters`,showSort:`Show Sort`,appearance:`Appearance`,rowHeight:`Row Height`,stripedRows:`Striped Rows`,bordered:`Bordered`,livePreview:`Live Preview`,stepBasicDesc:`الاسم والعنوان والتخطيط`,stepObjectsDesc:`اختيار كائنات الأعمال`,stepNavigationDesc:`بناء شجرة التنقل`,stepBrandingDesc:`الشعار والألوان والأيقونة`,noObjectsFound:`لم يتم العثور على كائنات.`,noNavItemsHint:`لا توجد عناصر تنقل بعد. حدد كائنات في الخطوة السابقة أو أضف عناصر يدويًا.`,separator:`فاصل`,separatorLabel:`— فاصل —`,newGroup:`مجموعة جديدة`,newLink:`رابط جديد`,saveDraft:`حفظ المسودة`,cancelConfirmTitle:`تجاهل التغييرات؟`,cancelConfirmMessage:`لديك تغييرات غير محفوظة. هل أنت متأكد من الإلغاء؟`,confirmDiscard:`تجاهل`,keepEditing:`متابعة التحرير`,navNoItems:`لا توجد عناصر تنقل. انقر على الأزرار أعلاه لإضافة عناصر.`,navNoPreviewItems:`لا توجد عناصر`,navLivePreview:`معاينة مباشرة`,navCollapseGroup:`طي المجموعة`,navExpandGroup:`توسيع المجموعة`,navAddChild:`إضافة عنصر فرعي`,navMoveUp:`نقل لأعلى`,navMoveDown:`نقل لأسفل`,navRemove:`إزالة`,navObjectPage:`صفحة الكائن`,navDashboard:`لوحة القيادة`,navPage:`صفحة`,navReport:`تقرير`,navGroup:`مجموعة`,navUrl:`رابط`,navSeparator:`فاصل`,navTypeObject:`كائن`,navTypeDashboard:`لوحة القيادة`,navTypePage:`صفحة`,navTypeReport:`تقرير`,navTypeUrl:`رابط`,navTypeGroup:`مجموعة`,navTypeSeparator:`فاصل`,navTypeAction:`إجراء`,navEditIcon:`تعديل الأيقونة`,navToggleVisible:`تبديل الظهور`,navHidden:`مخفي`,navExportSchema:`تصدير JSON`,navImportSchema:`استيراد JSON`,navExportSuccess:`تم تصدير هيكل التنقل`,navImportSuccess:`تم استيراد هيكل التنقل`,navImportError:`ملف JSON تنقل غير صالح`,navIconPlaceholder:`اسم الأيقونة (مثل Users)`,dashboardEditor:`محرر لوحة المعلومات`,noWidgets:`لا توجد عناصر. انقر على زر أعلاه لإضافة واحد.`,widgetLayoutSize:`حجم التخطيط`,widgetWidth:`العرض`,widgetHeight:`الارتفاع`,dashboardPreview:`معاينة لوحة المعلومات`,noWidgetsPreview:`لا توجد عناصر للمعاينة`,pageCanvasEditor:`محرر لوحة الصفحة`,emptyPage:`صفحة فارغة. انقر على زر أعلاه لإضافة مكون.`,pagePreview:`معاينة الصفحة`,noComponentsPreview:`لا توجد مكونات للمعاينة`,modePage:`صفحة`,modeDashboard:`لوحة المعلومات`,undo:`تراجع`,redo:`إعادة`,brandingEditor:`محرر العلامة التجارية`,brandingExport:`تصدير JSON`,brandingImport:`استيراد JSON`,brandingPreview:`معاينة`,brandingSampleButton:`زر نموذجي`,brandingSampleText:`هكذا سيبدو موضوع علامتك التجارية.`,colorPalette:`لوحة الألوان`,fontFamily:`الخط`,fontDefault:`افتراضي (النظام)`,modeLight:`فاتح`,modeDark:`داكن`,mobilePreview:`معاينة الجوال`,objectManager:{title:`مدير الكائنات`,addObject:`كائن جديد`,searchPlaceholder:`بحث عن كائنات…`,noObjects:`لم يتم العثور على كائنات.`,objectName:`اسم API`,objectLabel:`التسمية`,pluralLabel:`التسمية الجمعية`,icon:`الأيقونة`,selectIcon:`اختيار أيقونة…`,group:`المجموعة`,noGroup:`بدون مجموعة`,sortOrder:`ترتيب الفرز`,enabled:`مفعّل`,relationships:`العلاقات`,systemBadge:`نظام`,fieldCount:`{{count}} حقول`,ungrouped:`غير مصنف`,deleteConfirmTitle:`حذف الكائن؟`,deleteConfirmMessage:`سيتم حذف الكائن وجميع حقوله نهائيًا. لا يمكن التراجع عن هذا الإجراء.`},fieldDesigner:{title:`مصمم الحقول`,addField:`حقل جديد`,searchPlaceholder:`بحث عن حقول…`,allTypes:`كل الأنواع`,noFields:`لم يتم العثور على حقول.`,fieldName:`اسم API`,fieldLabel:`التسمية`,fieldType:`النوع`,fieldGroup:`المجموعة`,description:`الوصف`,required:`مطلوب`,unique:`فريد`,readOnly:`للقراءة فقط`,hidden:`مخفي`,indexed:`مفهرس`,externalId:`معرف خارجي`,trackHistory:`تتبع السجل`,defaultValue:`القيمة الافتراضية`,placeholder:`نص توضيحي`,referenceTo:`مرجع إلى`,formula:`صيغة`,options:`خيارات`,addOption:`إضافة خيار`,validationRules:`قواعد التحقق`,addRule:`إضافة قاعدة`,systemBadge:`نظام`,ungrouped:`عام`,deleteConfirmTitle:`حذف الحقل؟`,deleteConfirmMessage:`سيتم حذف الحقل نهائيًا. ستفقد البيانات الموجودة في هذا الحقل.`}},console:{title:`وحدة تحكم ObjectStack`,initializing:`جاري تهيئة التطبيق...`,breadcrumb:{dashboards:`لوحات المعلومات`,pages:`الصفحات`,reports:`التقارير`,system:`النظام`},loadingSteps:{connecting:`جاري الاتصال بمصدر البيانات`,loadingConfig:`جاري تحميل الإعدادات`,preparingWorkspace:`جاري تجهيز مساحة العمل`},error:{connectionFailed:`تعذّر الاتصال بالخادم`,serverUnreachable:`الخادم {{url}} غير قابل للوصول.`,checkServer:`يرجى التحقق من اتصال الشبكة أو من تشغيل الواجهة الخلفية.`,timeout:`انتهت مهلة الاتصال بعد 10 ثوانٍ.`},actions:{retry:`إعادة المحاولة`,retrying:`جاري إعادة المحاولة…`},shortcuts:{title:`اختصارات لوحة المفاتيح`,description:`مرجع سريع لجميع اختصارات لوحة المفاتيح المتاحة.`,groups:{general:`عام`,navigation:`التنقل`,dataViews:`عروض البيانات`,preferences:`التفضيلات`},openCommandPalette:`فتح لوحة الأوامر`,showShortcuts:`عرض اختصارات لوحة المفاتيح`,closeDialog:`إغلاق النافذة / اللوحة`,toggleSidebar:`تبديل الشريط الجانبي`,focusSearch:`التركيز على البحث`,createRecord:`إنشاء سجل جديد`,refreshData:`تحديث البيانات`,editRecord:`تعديل السجل المحدد`,toggleDarkMode:`تبديل الوضع الداكن`},commandPalette:{placeholder:`اكتب أمراً أو ابحث...`,noResults:`لم يتم العثور على نتائج.`,objects:`الكائنات`,dashboards:`لوحات المعلومات`,pages:`الصفحات`,reports:`التقارير`,switchApp:`تبديل التطبيق`,current:`الحالي`,preferences:`التفضيلات`,lightTheme:`المظهر الفاتح`,darkTheme:`المظهر الداكن`,systemTheme:`مظهر النظام`,actions:`الإجراءات`,openFullSearch:`فتح صفحة البحث الكاملة`,createApp:`إنشاء تطبيق جديد`},errors:{somethingWentWrong:`حدث خطأ ما`,unexpectedError:`حدث خطأ غير متوقع أثناء عرض هذا المحتوى.`,tryAgain:`إعادة المحاولة`,goHome:`العودة للرئيسية`,errorDetails:`تفاصيل الخطأ (وضع التطوير فقط)`},theme:{toggle:`تبديل المظهر`,light:`فاتح`,dark:`داكن`,system:`النظام`},objectView:{objectNotFound:`الكائن غير موجود`,objectNotFoundDescription:`الكائن "{{objectName}}" غير موجود في الإعدادات الحالية.`,objectNotFoundHint:`تحقق من إعدادات التنقل في تطبيقك أو اختر كائنًا آخر من الشريط الجانبي.`,allRecords:`جميع السجلات`,exitDesignMode:`الخروج من وضع التصميم`,enterDesignMode:`الدخول إلى وضع التصميم`,metadataInspector:`مفتش البيانات الوصفية`,editView:`تعديل العرض`,addView:`إضافة عرض`,designTools:`أدوات التصميم`,new:`جديد`,configureView:`تكوين العرض`,closePanel:`إغلاق اللوحة`,page:`الصفحة`,pageConfigHint:`شريط الأدوات والتنقل وإعدادات غلاف العرض`,listConfigHint:`عرض البيانات والأعمدة والمظهر لهذا النوع من القائمة`,general:`عام`,generalHint:`عنوان العرض والوصف والنوع`,toolbar:`شريط الأدوات`,toolbarHint:`البحث والتصفية والفرز والتجميع ومفاتيح الكثافة`,toolbarEnabledCount:`{{count}} من {{total}} مفعّل`,navigationSection:`التنقل`,navigationHint:`سلوك النقر على الصف وإعدادات العرض التفصيلي`,records:`السجلات`,recordsHint:`وضع التحديد وإضافة سجل والتحرير المباشر`,exportPrint:`التصدير والطباعة`,exportPrintHint:`صيغ التصدير والطباعة وعرض عدد السجلات`,showAllFields:`إظهار الكل`,hideAllFields:`إخفاء الكل`,searchFields:`البحث في الحقول...`,title:`العنوان`,description:`الوصف`,data:`البيانات`,source:`المصدر`,columns:`الأعمدة`,filterBy:`تصفية حسب`,sortBy:`ترتيب حسب`,appearance:`المظهر`,showDescription:`عرض الوصف`,viewType:`نوع العرض`,userFilters:`مرشحات المستخدم`,enableSearch:`تفعيل البحث`,enableFilter:`تفعيل التصفية`,enableSort:`تفعيل الترتيب`,enableHideFields:`تفعيل إخفاء الحقول`,enableGroup:`تفعيل التجميع`,enableColor:`تفعيل اللون`,enableDensity:`تفعيل الكثافة`,userActions:`إجراءات المستخدم`,addRecordViaForm:`إضافة سجلات عبر النموذج`,advanced:`متقدم`,allowExport:`السماح بالتصدير`,recordCount:`{{count}} سجل`,noDescription:`لا يوجد وصف`,none:`لا شيء`,columnsConfigured:`{{count}} أعمدة`,save:`حفظ`,discard:`تجاهل`,createView:`إنشاء عرض`,newView:`عرض جديد`,typeOptions:`خيارات النوع`,groupByField:`حقل التجميع`,startDateField:`حقل تاريخ البدء`,titleField:`حقل العنوان`,latitudeField:`حقل خط العرض`,longitudeField:`حقل خط الطول`,imageField:`حقل الصورة`,dateField:`حقل التاريخ`,selectField:`اختر حقلاً...`,gridOptionsHint:`يستخدم عرض الشبكة الأعمدة المكونة أعلاه.`,groupBy:`تجميع حسب`,prefixField:`حقل البادئة`,fields:`الحقول`,fieldsVisible:`{{count}} مرئي`,sortsCount:`{{count}} ترتيبات`,filtersCount:`{{count}} مرشحات`,endDateField:`حقل تاريخ الانتهاء`,color:`اللون`,fieldTextColor:`لون نص الحقل`,rowHeight:`ارتفاع الصف`,wrapHeaders:`التفاف العناوين`,showFieldDescriptions:`إظهار أوصاف الحقول`,collapseAllByDefault:`طي الكل افتراضياً`,striped:`صفوف مخططة`,bordered:`خلايا محاطة بحدود`,inlineEdit:`تحرير السجلات مباشرة`,addDeleteRecordsInline:`إضافة/حذف السجلات مباشرة`,clickIntoRecordDetails:`انقر لعرض تفاصيل السجل`,navigationMode:`وضع التنقل`,navigationWidth:`عرض التنقل`,navigationWidthHint:`متاح لأوضاع التنقل: الدرج والنافذة المنبثقة والعرض المقسم`,openNewTab:`فتح في علامة تبويب جديدة`,openNewTabHint:`متاح لأوضاع التنقل: الصفحة والنافذة الجديدة`},localeSwitcher:{label:`اللغة`}},auth:{login:{title:`تسجيل الدخول إلى حسابك`,description:`أدخل بريدك الإلكتروني وكلمة المرور للمتابعة`,emailLabel:`البريد الإلكتروني`,emailPlaceholder:`name@example.com`,passwordLabel:`كلمة المرور`,passwordPlaceholder:`أدخل كلمة المرور`,forgotPasswordText:`نسيت كلمة المرور؟`,submitButton:`تسجيل الدخول`,submittingButton:`جارٍ تسجيل الدخول...`,noAccountText:`ليس لديك حساب؟`,signUpText:`إنشاء حساب`},register:{title:`إنشاء حساب`,description:`أدخل معلوماتك للبدء`,nameLabel:`الاسم`,namePlaceholder:`محمد أحمد`,emailLabel:`البريد الإلكتروني`,emailPlaceholder:`name@example.com`,passwordLabel:`كلمة المرور`,passwordPlaceholder:`إنشاء كلمة مرور (8 أحرف على الأقل)`,confirmPasswordLabel:`تأكيد كلمة المرور`,confirmPasswordPlaceholder:`أكّد كلمة المرور`,passwordMismatchError:`كلمتا المرور غير متطابقتين`,passwordTooShortError:`يجب أن تتكون كلمة المرور من 8 أحرف على الأقل`,submitButton:`إنشاء حساب`,submittingButton:`جارٍ إنشاء الحساب...`,hasAccountText:`لديك حساب بالفعل؟`,signInText:`تسجيل الدخول`},forgotPassword:{title:`إعادة تعيين كلمة المرور`,description:`أدخل عنوان بريدك الإلكتروني وسنرسل لك رابطًا لإعادة تعيين كلمة المرور`,emailLabel:`البريد الإلكتروني`,emailPlaceholder:`name@example.com`,submitButton:`إرسال رابط إعادة التعيين`,submittingButton:`جارٍ الإرسال...`,successTitle:`تحقق من بريدك الإلكتروني`,successDescription:`لقد أرسلنا رابط إعادة تعيين كلمة المرور إلى {{email}}. يرجى التحقق من بريدك الوارد.`,backToSignInText:`العودة إلى تسجيل الدخول`,rememberPasswordText:`تتذكر كلمة المرور؟`,signInText:`تسجيل الدخول`}},errors:{networkError:`خطأ في الشبكة. يرجى التحقق من اتصالك.`,serverError:`خطأ في الخادم. يرجى المحاولة مرة أخرى لاحقاً.`,notFound:`المورد غير موجود.`,unauthorized:`ليس لديك صلاحية لتنفيذ هذا الإجراء.`,forbidden:`تم رفض الوصول.`,timeout:`انتهت مهلة الطلب. يرجى المحاولة مرة أخرى.`,unknown:`حدث خطأ غير متوقع.`},workspace:{label:`مساحات العمل`,default:`مساحة العمل الخاصة بي`,switch:`تبديل مساحة العمل`,create:`إنشاء مساحة عمل`,createTitle:`إنشاء مساحة عمل`,createDescription:`مساحة العمل هي مساحة مشتركة لفريقك للتعاون.`,createButton:`إنشاء مساحة عمل`,nameLabel:`اسم مساحة العمل`,namePlaceholder:`مثلاً، Acme Inc`,slugLabel:`معرف URL`,slugHint:`يستخدم في عناوين URL. أحرف صغيرة وأرقام وشرطات فقط.`,invite:`دعوة عضو`,members:`الأعضاء`,settings:`إعدادات مساحة العمل`},sidebar:{settings:`الإعدادات`,help:`المساعدة`,helpTooltip:`المساعدة والوثائق`,activityFeed:`موجز النشاط`},home:{title:`الرئيسية`,subtitle:`لوحة تحكم مساحة العمل`,nav:`الرئيسية`,allApps:`جميع التطبيقات`,loading:`جارٍ تحميل مساحة العمل...`,recent:`الأخيرة`,starred:`المميزة بنجمة`,welcome:`مرحباً بك في ObjectUI`,welcomeDescription:`ابدأ بإنشاء تطبيقك الأول أو تكوين إعدادات النظام.`,createFirstApp:`أنشئ أول تطبيق لك`,systemSettings:`إعدادات النظام`,browseMarketplace:`تصفح متجر التطبيقات`,quickActions:{title:`إجراءات سريعة`,createApp:`إنشاء تطبيق`,createAppDesc:`ابدأ بتطبيق جديد`,manageObjects:`إدارة الكائنات`,manageObjectsDesc:`تكوين نماذج البيانات`,systemSettings:`إعدادات النظام`,systemSettingsDesc:`تكوين مساحة العمل الخاصة بك`},appCard:{noDescription:`لا يوجد وصف`,default:`افتراضي`}},layout:{appSwitcher:{home:`Home`,addApp:`Add App`,editApp:`Edit App`,manageAllApps:`Manage All Apps`,systemConsole:`System Console`,noAppsConfigured:`No apps configured`},activityFeed:{title:`Recent Activity`,filter:`Filter`,empty:`No recent activity`,ariaLabel:`Activity feed`,typeCreate:`Create`,typeUpdate:`Update`,typeDelete:`Delete`,typeComment:`Comment`,relativeJustNow:`just now`,relativeSecondsAgo:`{{count}}s ago`,relativeMinutesAgo:`{{count}}m ago`,relativeHoursAgo:`{{count}}h ago`,relativeDaysAgo:`{{count}}d ago`},metadata:{label:`Metadata`,toggleTitle:`Toggle Metadata Inspector`,panelTitle:`Metadata Inspector`,jsonBadge:`JSON`,copyJson:`Copy JSON`}},search:{title:`Search`,back:`Back`,placeholder:`Search objects, dashboards, pages, reports...`,inputAriaLabel:`Search objects, dashboards, pages, reports`,resultsCount:`{{count}} result for "{{query}}"`,resultsCountPlural:`{{count}} results for "{{query}}"`,itemsAvailable:`{{count}} items available`,noResults:`No results found`,noResultsHint:`Try adjusting your search terms`,typeObjects:`Objects`,typeDashboards:`Dashboards`,typePages:`Pages`,typeReports:`Reports`,badgeObject:`object`,badgeDashboard:`dashboard`,badgePage:`page`,badgeReport:`report`},empty:{objectNotFound:`Object Not Found`,objectNotFoundDescription:`Object "{{name}}" definition missing. Check your configuration or navigate back to select a valid object.`,pageNotFound:`Page Not Found`,pageNotFoundDescription:`The page "{{name}}" could not be found. It may have been removed or renamed.`,dashboardNotFound:`Dashboard Not Found`,dashboardNotFoundDescription:`The dashboard "{{name}}" could not be found. It may have been removed or renamed.`,reportNotFound:`Report Not Found`,reportNotFoundDescription:`The report "{{name}}" could not be found. It may have been removed or renamed.`,noAppsConfigured:`No Apps Configured`,noAppsConfiguredDescription:`No applications have been registered. Create your first app or visit System Settings to configure your environment.`,createFirstApp:`Create Your First App`,systemSettings:`System Settings`,back:`Back`},renderer:{noPageSchema:`No page schema provided`,noFormSchema:`No form schema provided`,noDashboardSchema:`No dashboard schema provided`,pageRendering:`Page rendering: {{name}}`,dashboardRendering:`Dashboard rendering: {{name}}`,formRenderingMode:`Form rendering in {{mode}} mode`,formRenderingFor:`for record {{id}}`,createRecord:`Create Record`,editRecord:`Edit Record`,page:`Page`,dashboard:`Dashboard`,save:`Save`,cancel:`Cancel`},actionDialog:{title:`Action Parameters`,description:`Please provide the required information to continue.`,selectPlaceholder:`Select {{label}}`,requiredError:`{{label}} is required`,cancel:`Cancel`,confirm:`Confirm`,defaultActionTitle:`Action`,ok:`OK`},rowAction:{openMenu:`Open menu`,edit:`Edit`,delete:`Delete`},navigationSync:{addedPage:`Navigation updated: added page "{{name}}"`,addedDashboard:`Navigation updated: added dashboard "{{name}}"`,removedPage:`Navigation updated: removed page "{{name}}"`,removedDashboard:`Navigation updated: removed dashboard "{{name}}"`,renamedPage:`Navigation updated: renamed page "{{oldName}}" → "{{newName}}"`,renamedDashboard:`Navigation updated: renamed dashboard "{{oldName}}" → "{{newName}}"`,undoLabel:`Undo`,undone:`Navigation change undone`,undoFailed:`Failed to undo navigation change`,updateFailed:`Failed to update navigation`},objectActions:{deleteSuccess:`{{label}} deleted successfully`,deleteFailed:`Failed to delete {{label}}`,noRecordId:`No record ID provided`,deleteConfirm:`Are you sure you want to delete this record?`},objectViewActions:{renameFailed:`Failed to rename view`,deleteFailed:`Failed to delete view`},dashboardActions:{pdfPreparing:`Preparing PDF export…`,exportFailed:`Export failed: {{message}}`,forecastSoon:`Forecast view coming soon`},recordDetail:{viewersTooltip:`Users viewing this record`},cellRender:{empty:`Empty`,yes:`Yes`,no:`No`,systemFields:`System`},user:{profile:`Profile`,settings:`Settings`,logout:`Log out`},report:{rowTotal:`Row Total`,columnTotal:`Column Total`,grandTotal:`Grand Total`,totals:`Totals`,rowsLabel:`Row`,columnsLabel:`Column`,allLabel:`(All)`,emptyLabel:`(Empty)`,loading:`Loading…`,failedToLoad:`Failed to load matrix: {{message}}`,needsAcross:"Matrix report requires at least one `groupingsAcross` field.",aggregate:{count:`Count`,countDistinct:`Distinct Count`,sum:`Sum`,avg:`Average`,min:`Min`,max:`Max`,first:`First`},editor:{breadcrumb:`الإعدادات`,basic:`أساسي`,title:`العنوان`,titlePlaceholder:`مثال: المسار حسب الربع`,description:`الوصف`,descriptionPlaceholder:`ماذا يعرض هذا التقرير؟`,type:`نوع التقرير`,typeTabular:`جدولي — قائمة مسطّحة`,typeSummary:`ملخص — مجمّع مع المجاميع`,typeMatrix:`مصفوفة — محور صفوف × أعمدة`,typeJoined:`مدمج — كتل متعددة`,typeHelp:`اختر التخطيط الذي يطابق ما تريد رؤيته.`,data:`البيانات`,objectName:`مصدر البيانات`,objectNamePlaceholder:`مثال: opportunity`,objectNameHelp:`أي كائن يجب أن يستعلم عنه هذا التقرير؟`,limit:`حد عدد الصفوف`,limitPlaceholder:`مثال: 100`,columns:`الأعمدة`,columnsHint:`اختر الحقول التي ستظهر كأعمدة. أضف تجميعًا (مجموع، عدد…) في تقارير الملخص أو المصفوفة.`,filters:`عوامل التصفية`,filtersHint:`قيّد الصفوف التي تدخل في هذا التقرير.`,filtersComplex:`يستخدم هذا التقرير عامل تصفية متقدّمًا لا يمكن تحريره هنا. سيُحتفظ به كما هو عند الحفظ.`,groupBy:`التجميع حسب`,groupByHint:`جمّع البيانات واحسب المجاميع الفرعية.`,rows:`الصفوف`,rowsHint:`جمّع الصفوف حسب هذه الحقول.`,columnsAxis:`الأعمدة`,columnsAxisHint:`اعرض هذه الحقول كمحور في الأعلى.`,values:`القيم`,valuesHint:`الأرقام التي تظهر في كل خلية. اختر حقلاً واحدًا أو أكثر وأضف تجميعًا (مجموع، عدد…).`,grouping:`تجميع`,addGrouping:`إضافة تجميع`,dateGranularity:`دقة التاريخ`,dateGranularityNone:`(استخدام القيمة الأصلية)`,day:`يوم`,week:`أسبوع`,month:`شهر`,quarter:`ربع`,year:`سنة`,sortAsc:`تصاعدي`,sortDesc:`تنازلي`,chart:`الرسم البياني`,chartHint:`عرض مرئي اختياري بجانب الجدول.`,chartType:`نوع الرسم`,chartTitle:`عنوان الرسم`,chartTitlePlaceholder:`افتراضيًا يستخدم عنوان التقرير`,chartXAxis:`المحور السيني (الفئة)`,chartYAxis:`المحور الصادي (القيمة)`,chartShowLegend:`إظهار وسيلة الإيضاح`,chartShowDataLabels:`إظهار تسميات البيانات`,chartNone:`(بدون رسم)`,chartBar:`أعمدة`,chartLine:`خطي`,chartArea:`منطقة`,chartPie:`دائري`,chartDonut:`حلقي`,chartFunnel:`قمعي`,validationNeedsObject:`اختر مصدر بيانات قبل إضافة الأعمدة.`,validationMatrixNeedsRowsCols:`تتطلب تقارير المصفوفة صفًا وعمودًا واحدًا على الأقل.`,validationSummaryNeedsRows:`تتطلب تقارير الملخص حقل تجميع واحدًا على الأقل.`,blocks:`الكتل`,blocksHint:`كل كتلة هي جدولها أو رسمها البياني الخاص. عوامل تصفية الكتلة تُدمج مع عامل تصفية التقرير بمنطق AND.`,addBlock:`إضافة كتلة`,removeBlock:`إزالة الكتلة`,blockName:`اسم الكتلة`,blockNamePlaceholder:`اسم_فريد_للكتلة`,blockLabel:`التسمية المعروضة`,blockLabelPlaceholder:`تُعرض فوق الكتلة`,blockDescription:`الوصف`,blockDescriptionPlaceholder:`سياق اختياري لهذه الكتلة`,validationJoinedNeedsBlocks:`تتطلب التقارير المدمجة كتلة واحدة على الأقل.`,validationBlockNameRequired:`يجب أن يكون لكل كتلة اسم غير فارغ.`,validationBlockNameDuplicate:`يجب أن تكون أسماء الكتل فريدة داخل التقرير.`,validationBlockNeedsColumns:`تحتاج كل كتلة إلى عمود واحد على الأقل.`,noneOption:`(بلا)`,addCondition:`إضافة شرط`,combineLogic:`الدمج مع`,opContains:`يحتوي على`,opIsEmpty:`فارغ`,opIsNotEmpty:`ليس فارغًا`,formatAuto:`تلقائي`,formatCurrency:`عملة`,formatPercent:`نسبة مئوية`,formatInteger:`عدد صحيح`,formatDate:`تاريخ`,formatDatetime:`تاريخ ووقت`,columnLabelPlaceholder:`تجاوز التسمية`,aggregateColumn:`تجميع`,formatColumn:`تنسيق`,addColumns:`إضافة أعمدة`,searchFields:`البحث في الحقول…`,noMatchingFields:`لا توجد حقول تطابق بحثك.`,noFieldsAvailable:`لا توجد حقول متاحة.`}},organizations:{mine:`مؤسساتي`,title:`المؤسسات`,heading:`مؤسساتك`,subtitle:`اختر مؤسسة للمتابعة، أو أنشئ مؤسسة جديدة.`,searchPlaceholder:`ابحث عن مؤسسة`,new:`مؤسسة جديدة`,current:`المؤسسة الحالية`,manage:`إدارة`,emptyTitle:`لا توجد مؤسسات بعد`,emptyDescription:`أنشئ مؤسستك الأولى للبدء.`,noMatches:`لا توجد مؤسسات تطابق بحثك.`},notifications:{empty:`لا توجد إشعارات`,markAllRead:`تعليم الكل كمقروء`,viewAll:`عرض جميع الإشعارات`,approvalsPending:`{{count}} موافقات معلقة`,viewApprovals:`عرض الموافقات`,noPendingApprovals:`لا توجد موافقات معلقة`,openApprovalsInbox:`فتح صندوق الموافقات`},publicForm:{submit:`Submit`,submitting:`Submitting…`,submitAnother:`Submit another response`,poweredBy:`Powered by ObjectStack`,secureNotice:`Your information is transmitted securely and only used to respond to your request.`,thankYouTitle:`Thank you!`,thankYouMessage:`Your submission has been received successfully.`,redirecting:`Redirecting in {{seconds}} seconds…`,unavailableTitle:`Form unavailable`,unavailableDescription:`No public form is available at this URL. Make sure the underlying view has anonymous sharing enabled and matches this slug.`,tryDemo:`Try the demo`,retry:`Retry`,loading:`Loading form…`,requiredHint:`* Required field`,consentLabelDefault:`I agree to the privacy policy and consent to my data being processed for this request.`,consentLink:`Privacy policy`,consentRequired:`Please accept the privacy policy to continue.`,rateLimited:`Please take a moment to review your answers before submitting.`,redirectBlocked:`Submission accepted, but the redirect URL was blocked for security.`,demo:{contactTitle:`Contact us`,contactDescription:`Tell us about your project and a sales representative will get back to you within one business day.`,supportTitle:`Submit a support request`,supportDescription:`Tell us what is going wrong — our team responds within one business day.`,thankYouSalesTitle:`Thanks — we received your message!`,thankYouSalesMessage:`A sales representative will be in touch within one business day.`,thankYouSupportTitle:`Got it — your request is in the queue.`,thankYouSupportMessage:`A support engineer will follow up shortly. Save this page if you have more screenshots to add.`,field:{firstName:`First name`,lastName:`Last name`,email:`Work email`,phone:`Phone`,jobTitle:`Job title`,company:`Company`,website:`Website`,industry:`Industry`,companySize:`Company size`,howCanWeHelp:`How can we help?`,subject:`Subject`,description:`Description`,issueType:`Issue type`,priority:`Priority`},industry:{technology:`Technology`,software:`Software / SaaS`,finance:`Finance`,healthcare:`Healthcare`,retail:`Retail`,other:`Other`},issueType:{question:`Question`,problem:`Problem`,bug:`Bug`,feature_request:`Feature request`},priority:{low:`Low`,medium:`Medium`,high:`High`,critical:`Critical`}}},marketplace:{title:`App Marketplace`,subtitle:`Browse approved apps published to the ObjectStack catalog. Click an app to view details and install it into one of your environments.`,searchPlaceholder:`Search apps by name or manifest ID…`,searchAria:`Search marketplace apps`,installed:`Installed`,installedCount:`Installed ({{count}})`,refresh:`Refresh`,all:`All`,noApprovedYet:`No apps have been approved for the marketplace yet.`,noMatchFilters:`No apps match your filters.`,noDescription:`No description provided.`,back:`Back to marketplace`,installedTitle:`Installed Apps`,installedSubtitle:`Marketplace packages currently installed into this runtime's kernel. Cached manifests live in <code>.objectstack/installed-packages/</code> and survive restarts.`,installedEmpty:`No marketplace apps installed in this runtime yet.`,browseLink:`Browse the marketplace →`,installedAdditiveNote:`<strong>Note:</strong> The kernel API is additive only — uninstall removes the on-disk manifest so the package won't load on next boot, but the running kernel keeps the app registered until you restart the runtime.`,installedAt:`Installed {{when}}`,installedBy:`by {{user}}`,installedPackageId:`package`,cachedAs:`Cached as <code>{{path}}</code>`,versionBadge:`v{{version}}`,installedBadge:`Installed v{{version}}`,load:{failed:`Failed to load marketplace`,failedHint:`By default this runtime points at the public ObjectStack cloud. Check the runtime is online, or override <code>OS_CLOUD_URL</code> to point at a self-hosted control plane.`,packageFailed:`Failed to load package`,notFound:`Not found.`},detail:{homepage:`Homepage`,installedV:`Installed · v{{version}}`,about:`About`,noReadme:`No readme provided.`,versions:`Versions`,noApprovedVersions:`No approved versions.`,prerelease:`pre`,moreOptions:`More install options`,uninstallFromRuntime:`Uninstall from this runtime`},action:{install:`Install`,reinstall:`Reinstall`,working:`Working…`,installToCloud:`Install to cloud…`,installing:`Installing…`,uninstall:`Uninstall`,uninstalling:`Uninstalling…`,details:`Details`,close:`Close`,dismiss:`Dismiss`,openOnCloud:`Open on cloud`,backHome:`Back to home`},install:{dialogTitle:`Install {{name}}`,dialogDescCurrent:`Install into this environment ({{host}}).`,dialogDescPicker:`Choose an environment to install this app into. You need to be signed into ObjectStack Cloud.`,environment:`Environment`,environmentPlaceholder:`Pick an environment`,includeSampleData:`Include sample data`,noEnvs:`No environments found in your active organization.`,noPermission:`You do not have permission to install apps in any environment. Only organization owners and admins can install — ask your workspace admin.`,signInFirst:`You need to sign into ObjectStack Cloud first. Click "Open on cloud" below.`,success:`Installed successfully. Open the environment to see the new app.`,localSuccess:`Installed v{{version}} to this runtime. "{{name}}" should now appear in the app switcher.`,localManifestConflict:`{{message}}
|
|
37
37
|
Tip: a local app already owns this manifest_id. Remove it from objectstack.config.ts first.`,localUnauthorized:`Sign in to this runtime first, then try again.`,localMarketplaceUnavailable:`This runtime has no OS_CLOUD_URL configured, so the marketplace catalog is unreachable.`},uninstall:{confirm:`Uninstall {{manifestId}} v{{version}} from this runtime?
|
|
38
38
|
|
|
39
|
-
The cached manifest will be removed. The app will remain loaded in the running kernel until the next restart.`,successInList:`Removed {{manifestId}}. Restart the runtime to fully unload it from the running kernel.`,successInDetail:`Removed cached manifest for {{manifestId}}. Restart the runtime to fully unload the app from the running kernel.`},accessDenied:{title:`App Marketplace is admin-only`,description:`You don't have permission to install apps in this environment. Ask an owner or admin of this organization for access.`},category:{crm:`CRM`,erp:`ERP`,hr:`Human Resources`,finance:`Finance`,project:`Project Management`,collaboration:`Collaboration`,analytics:`Analytics`,integration:`Integration`,automation:`Automation`,ai:`AI`,security:`Security`,"developer-tools":`Developer Tools`,"ui-theme":`UI Theme`,storage:`Storage`,other:`Other`},pricing:{free:`Free`,freemium:`Freemium`,paid:`Paid`,subscription:`Subscription`,"usage-based":`Usage-based`,"contact-sales":`Contact Sales`},relativeTime:{today:`today`,daysAgo:`{{count}}d ago`,monthsAgo:`{{count}}mo ago`,yearsAgo:`{{count}}y ago`}}}},ft=[`ar`,`he`,`fa`,`ur`];function pt(e){return ft.includes(e)}function mt(e={}){let{defaultLanguage:t=`en`,fallbackLanguage:n=`en`,resources:r={},detectBrowserLanguage:i=!0,interpolation:a}=e,o={};for(let[e,t]of Object.entries(dt))o[e]={translation:{...t,...r[e]||{}}};for(let[e,t]of Object.entries(r))o[e]||(o[e]={translation:t});let s=t;if(i&&typeof navigator<`u`){let e=navigator.language?.split(`-`)[0];e&&o[e]&&(s=e)}let c=Ie.createInstance();return c.use(tt).init({lng:s,fallbackLng:n,resources:o,interpolation:{escapeValue:!1,...a},returnNull:!1,react:{useSuspense:!1}}),c}function ht(e){return pt(e)?`rtl`:`ltr`}var gt=(0,j.createContext)(null);function _t({config:e,instance:t,loadLanguage:n,children:r}){let i=(0,j.useMemo)(()=>t||mt(e),[t,e]),[a,o]=(0,j.useState)(i.language||`en`),s=ht(a),c=(0,j.useRef)(new Set);(0,j.useEffect)(()=>{let e=e=>{o(e),typeof document<`u`&&(document.documentElement.dir=ht(e),document.documentElement.lang=e)},t=i.language||a;return typeof document<`u`&&t&&(document.documentElement.dir=ht(t),document.documentElement.lang=t),i.on(`languageChanged`,e),()=>{i.off(`languageChanged`,e)}},[i]),(0,j.useEffect)(()=>{if(!n)return;let e=i.language||`en`;c.current.has(e)||(c.current.add(e),n(e).then(t=>{t&&Object.keys(t).length>0&&(i.addResourceBundle(e,`translation`,t,!0,!0),o(e))}).catch(t=>{c.current.delete(e),console.warn(`[i18n] Failed to load app translations for '${e}':`,t)}))},[i,n]);let l=(0,j.useMemo)(()=>({language:a,changeLanguage:async e=>{if(n&&!c.current.has(e)){c.current.add(e);try{let t=await n(e);i.addResourceBundle(e,`translation`,t,!0,!0)}catch(t){c.current.delete(e),console.warn(`[i18n] Failed to load app translations for '${e}':`,t)}}await i.changeLanguage(e)},direction:s,i18n:i}),[a,s,i,n]);return j.createElement(gt.Provider,{value:l},j.createElement(ut,{i18n:i},r))}function vt(e){let t=(0,j.useContext)(gt),{t:n,i18n:r}=lt(e);return{t:n,language:t?.language||r.language||`en`,changeLanguage:t?.changeLanguage||(async e=>{await r.changeLanguage(e)}),direction:t?.direction||`ltr`,i18n:r}}function yt(){let e=(0,j.useContext)(gt);if(!e)throw Error(`useI18nContext must be used within an I18nProvider`);return e}var bt=typeof window<`u`?j.useLayoutEffect:j.useEffect;function xt(e){let t=j.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function St(e,t,n={},r={}){j.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Ct(e){let t=j.useRef(null);return j.useImperativeHandle(e,()=>t.current,[]),t}function wt(e){return e[e.length-1]}function Tt(e){return typeof e==`function`}function Et(e,t){return Tt(e)?e(t):e}var Dt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;function kt(e){for(let t in e)if(Dt.call(e,t))return!0;return!1}var At=()=>Object.create(null),jt=(e,t)=>Mt(e,t,At);function Mt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=It(e)&&It(i);if(!a&&!(Pt(e)&&Pt(i)))return i;let o=a?e:Nt(e);if(!o)return i;let s=a?i:Nt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Dt.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Mt(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Nt(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Ot.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Ot.call(e,t))return!1;r.push(t)}return r}function Pt(e){if(!Ft(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ft(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Ft(e){return Object.prototype.toString.call(e)===`[object Object]`}function It(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lt(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Lt(e[r],t[r],n))return!1;return!0}if(Pt(e)&&Pt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Lt(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Lt(e[o],t[o],n)))return!1;return i===a}return!1}function Rt(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function zt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Bt(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Vt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Bt(t)}var Ht=[`http:`,`https:`,`mailto:`,`tel:`];function Ut(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Wt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Vt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Vt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Gt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Kt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function qt(){throw Error(`Invariant failed`)}function Jt(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Yt=4,Xt=5;function Zt(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Qt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Zt(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function $t(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=Qt(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=nn(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=nn(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=rn(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=rn(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=rn(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=nn(n.fullPath??n.from);e.kind=Xt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=nn(n.fullPath??n.from);e.kind=Yt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)$t(e,t,r,s,i,a,o)}function en(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function tn(e){if(e.pathless)for(let t of e.pathless)tn(t);if(e.static)for(let t of e.static.values())tn(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())tn(t);if(e.dynamic?.length){e.dynamic.sort(en);for(let t of e.dynamic)tn(t)}if(e.optional?.length){e.optional.sort(en);for(let t of e.optional)tn(t)}if(e.wildcard?.length){e.wildcard.sort(en);for(let t of e.wildcard)tn(t)}}function nn(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function rn(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function an(e,t){let n=nn(`/`),r=new Uint16Array(6);for(let t of e)$t(!1,r,t,1,n,0);tn(n),t.masksTree=n,t.flatCache=Jt(1e3)}function on(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=dn(e,t.masksTree);return t.flatCache.set(e,r),r}function sn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=nn(`/`),$t(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),dn(r,o,n)}function cn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=dn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=pn(a.route)),t.matchCache.set(r,a),a}function ln(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function un(e,t=!1,n){let r=nn(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return $t(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&qt(),a[e.id]=e,s!==0&&e.path){let t=ln(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),tn(r),{processedTree:{segmentTree:r,singleCache:Jt(1e3),matchCache:Jt(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function dn(e,t,n=!1){let r=e.split(`/`),i=hn(e,r,t,n);if(!i)return null;let[a]=fn(e,r,i);return{route:i.node.route,rawParams:a}}function fn(e,t,n){let r=mn(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Yt)break;if(u.kind===Xt){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function pn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function mn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function hn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!wt(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!yn(l,n))continue;if(i.parse){if(!vn(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==Yt&&yn(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===Yt||i.kind===2)&&yn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(vn(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&_n(p,o))return n;yn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+gn(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+gn(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+gn(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+gn(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function gn(e,t){return 2**(e-t-1)}function _n(e,t){return e===2**(t-1)-1}function vn(e,t,n){let r,i;try{[r,i]=fn(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function yn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Yt)>(e.node.kind===Yt)||t.node.kind===Yt==(e.node.kind===Yt)&&t.depth>e.depth))):!0}function bn(e){return xn(e.filter(e=>e!==void 0).join(`/`))}function xn(e){return e.replace(/\/{2,}/g,`/`)}function Sn(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Cn(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function wn(e){return Cn(Sn(e))}function Tn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function En(e,t,n){return Tn(e,n)===Tn(t,n)}function Dn({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&wt(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(wt(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=xn(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function On(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function kn(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>jn(e,n)).join(`/`):jn(r,n):r}function An({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Qt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=kn(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=kn(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=kn(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function jn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Mn(e){return e?.isNotFound===!0}function Nn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Pn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Fn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Pn(r):Array.isArray(t)?t.push(Pn(r)):n[e]=[t,Pn(r)]}return n}var In=Rn(JSON.parse),Ln=zn(JSON.stringify,JSON.parse);function Rn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Fn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function zn(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Nn(e,r);return t?`?${t}`:``}}var Bn=`__root__`;function Vn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Hn(e){return e instanceof Response&&!!e.options}var Un=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Wn=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Gn=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Kn=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},qn=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Jn=(e,t,n)=>{if(!(!Hn(n)&&!Mn(n)))throw Hn(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Hn(n)?`redirected`:Mn(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Kn(e,t.index),isFetching:!1,error:n})),Mn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Hn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Yn=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Xn=(e,t,n)=>{let r=Kn(e,n);e.updateMatch(t,e=>({...e,context:r}))},Zn=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Jn(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,Jn(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Hn(n)&&!Mn(n)&&(e.serialError??=n)},Qn=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Gn(e,t)&&(n.options.loader||n.options.beforeLoad||lr(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Un(e)},i);r._nonReactive.pendingTimeout=t}},$n=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Qn(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Jn(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},er=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Rt(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Zn(e,n,o),s&&Zn(e,n,s),Qn(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Rt();let f={...Kn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Gn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Hn(r)||Mn(r))&&(u(),Zn(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),zt(y))return u(),y.catch(t=>{Zn(e,n,t)}).then(v)}catch(t){u(),Zn(e,n,t)}v(y)},tr=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>er(e,n,t,i),s=()=>{if(Yn(e,n))return;let t=$n(e,n,i);return zt(t)?t.then(o):o()};return a()},nr=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},rr=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Kn(e,r),d=Gn(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},ir=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{cr(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(rr(e,t,n,r,i)),l=!!s&&zt(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Jn(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Kn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Kn(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Mn(t)&&await i.options.notFoundComponent?.preload?.(),Jn(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Jn(e,e.router.getMatch(n),t)}!Hn(o)&&!Mn(o)&&await cr(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Kn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Jn(e,r,t)}},ar=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(rr(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await ir(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Hn(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await ir(e,t,i,n,d):Xn(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Yn(e,i)){if(!e.router.getMatch(i))return e.matches[n];Xn(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=Gn(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Jn(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=Rt(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function or(e){let t=e,n=[];Wn(t.router)&&Un(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=tr(t,e);zt(n)&&await n}catch(e){if(Hn(e))throw e;if(Mn(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?qn(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(ar(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Hn(e))throw e;Mn(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=qn(t,l);e===void 0&&qt();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await cr(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await cr(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=nr(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Un(t);if(zt(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function sr(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function cr(e,t=ur){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===ur?(()=>{if(e._componentsPromise===void 0){let t=sr(e,ur);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():sr(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function lr(e){for(let t of ur)if(e.options[t]?.preload)return!0;return!1}var ur=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function dr(e){return{input:({url:t})=>{for(let n of e)t=pr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=mr(e[n],t);return t}}}function fr(e){let t=wn(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=bn([`/`,t,e.pathname]),e)}}function pr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function mr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function hr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>gr(o,_.get())),x=r(()=>gr(s,v.get())),S=r(()=>gr(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Jt(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let ee={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:te,setPending:ne,setCached:re};te(e.matches),a?.(ee);function te(e){_r(e,o,_,n,i)}function ne(e){_r(e,s,v,n,i)}function re(e){_r(e,c,y,n,i)}return ee}function gr(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function _r(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Kt(n.get(),a)||n.set(a)})}var vr=`__TSR_index`,yr=`popstate`,br=`beforeunload`;function xr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Tr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[vr];i=Sr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[vr];i=Sr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[vr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Sr(e,t){t||={};let n=Er();return{...t,key:n,__TSR_key:n,[vr]:e}}function Cr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Tr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Er();t.history.replaceState({[vr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Tr(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[vr]-l.state[vr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=xr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(br,S,{capture:!0}),t.removeEventListener(yr,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(br,S,{capture:!0}),t.addEventListener(yr,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function wr(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Tr(e,t){let n=wr(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Er();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[vr]:0,key:a,__TSR_key:a}}}function Er(){return(Math.random()+1).toString(36).substring(7)}function Dr(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Or=new WeakMap,kr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=On(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Cr()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Jt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=hr(Mr(this.latestLocation),e),Qr(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=wn(o);t&&t!==`/`&&e.push(fr({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:dr(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=un(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&an(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Wt(e).path,external:!1,searchStr:o,search:jt(t?.search,i),hash:Wt(r.slice(1)).path,state:Mt(t?.state,a)}}let o=new URL(i,this.origin),s=pr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Wt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:jt(t?.search,c),hash:Wt(s.hash.slice(1)).path,state:Mt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Dn({base:e,to:t.includes(`//`)?xn(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Pr({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,Et(t.params,s)),d=this.routesByPath[Cn(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&kt(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:Wt(An({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Nr(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Fr({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=jt(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?Et(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?Et(t.state,n.state):{};v=Mt(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=mr(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Gt(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=on(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,Et(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Lt(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Cn(this.latestLocation.href)===Cn(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=Rt(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Tr(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=pr(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(Ut(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Or.set(this.latestLocation,t):Or.delete(this.latestLocation);let n=this.latestLocation,r=Dr(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await or({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Hn(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Mn(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Dr(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&Ut(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=cr,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await or({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Hn(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Mn(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=sn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Lt(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Lt(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ln,parseSearch:e.parseSearch??In,protocolAllowlist:e.protocolAllowlist??Ht}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=pn(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Cn(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Lr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Nr(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Ar||(r=new Ar(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=An({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{Rr(r,b)}catch(e){if(x=Mn(e)||Hn(e)?e:new jr(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:jt(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||lr(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?jt(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:Rt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?Mt(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?jt(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=wt(t),i={...e.search};for(let e of t)try{Object.assign(i,Nr(e.options.validateSearch,i))}catch{}let a=wt(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Rr(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Ar=class extends Error{},jr=class extends Error{};function Mr(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Nr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ar(`Async validation not supported`);if(n.issues)throw new Ar(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Pr({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Cn(e),a,o=cn(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Fr({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Ir(n)(e,t,r??!1)}function Ir(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Nr(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:Et(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Lr(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Bn}function Rr(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function zr(){try{return sessionStorage}catch{return}}var Br=`tsr-scroll-restoration-v1_3`,Vr=zr();function Hr(){try{return JSON.parse(Vr?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ur(){try{Vr?.setItem(Br,JSON.stringify(Wr))}catch{}}var Wr=Hr(),Gr=`data-scroll-restoration-id`,Kr=e=>e.state.__TSR_key||e.href;function qr(e){let t=e.getAttribute(Gr);if(t)return`[${Gr}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Jr=!1,Yr=`window`;function Xr(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Zr(e){let t=[];for(let n of e){if(n===Yr)continue;let e=Xr(n);e&&t.push(e)}return t}function Qr(e,t){if((t??e.options.scrollRestoration)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup)return;e.isScrollRestorationSetup=!0,Jr=!1;let n=e.options.getScrollRestorationKey||Kr,r=new Map,i=(e,t,n)=>{let i=r.get(e)||{};i.scrollX=t,i.scrollY=n,r.set(e,i)};history.scrollRestoration=`manual`;let a=t=>{if(!(Jr||!e.isScrollRestoring))if(t.target===document)i(Yr,scrollX,scrollY);else{let e=t.target;i(e,e.scrollLeft,e.scrollTop)}},o=t=>{if(!e.isScrollRestoring)return;let n=Wr[t]||={};for(let[e,t]of r)e===Yr?n[Yr]=t:e.isConnected&&(n[qr(e)]=t)};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(n(e.fromLocation)),r.clear()}),addEventListener(`pagehide`,()=>{o(n(e.stores.resolvedLocation.get()??e.stores.location.get())),Ur()}),e.subscribe(`onRendered`,t=>{let i=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=e.resetNextScroll,s;if(r.clear(),o||(e.resetNextScroll=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let c=n(t.toLocation),l=t.fromLocation&&n(t.fromLocation);if(e.isScrollRestoring&&l&&l!==c){let e=Wr[l];if(e){let t=Wr[c];for(let n in e){if(n===Yr){if(o)continue}else{let e=Xr(n);if(!e||o&&a&&(s??=Zr(a),s.includes(e)))continue}t||=Wr[c]={},t[n]??=e[n]}}}Jr=!0;try{let n=t.toLocation.hash,r=t.toLocation.state.__hashScrollIntoViewOptions??!0,l=!1;if(o){let o=Or.get(t.toLocation),u=n&&r&&(o===`PUSH`||o===`REPLACE`),d=e.isScrollRestoring?Wr[c]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:n}=d[e];if(e===Yr){if(u)continue;scrollTo({top:n,left:t,behavior:i}),l=!0}else{let r=Xr(e);r&&(r.scrollLeft=t,r.scrollTop=n)}}if(!l&&!n){let e={top:0,left:0,behavior:i};if(scrollTo(e),a){s??=Zr(a);for(let t of s)t.scrollTo(e)}}}!l&&n&&r&&document.getElementById(n)?.scrollIntoView(r)}finally{Jr=!1}})}var $r=`Error preloading route! ☝️`,ei=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Bn:this.parentRoute||qt();let r=n?Bn:t?.path;r&&r!==`/`&&(r=Sn(r));let i=t?.id||r,a=n?Bn:bn([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=bn([`/`,a]));let o=a===`__root__`?`/`:bn([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Cn(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Vn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ti=class extends ei{constructor(e){super(e)}},ni=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})),M=o(((e,t)=>{t.exports=ni()}))();function ri(e){let t=e.errorComponent??ai;return(0,M.jsx)(ii,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?j.createElement(t,{error:n,reset:r}):e.children})}var ii=class extends j.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ai({error:e}){let[t,n]=j.useState(!1);return(0,M.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,M.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,M.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,M.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,M.jsx)(`div`,{children:(0,M.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,M.jsx)(`code`,{children:e.message}):null})}):null]})}function oi({children:e,fallback:t=null}){return si()?(0,M.jsx)(j.Fragment,{children:e}):(0,M.jsx)(j.Fragment,{children:t})}function si(){return j.useSyncExternalStore(ci,()=>!0,()=>!1)}function ci(){return()=>{}}var li=j.createContext(null);function ui(e){return j.useContext(li)}var di=j.createContext(void 0),fi=j.createContext(void 0),pi=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(pi||{});function mi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function hi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var gi=[],_i=0,{link:vi,unlink:yi,propagate:bi,checkDirty:xi,shallowPropagate:Si}=mi({update(e){return e._update()},notify(e){gi[wi++]=e,e.flags&=~pi.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pi.Mutable|pi.Dirty,Oi(e))}}),Ci=0,wi=0,Ti,Ei=0;function Di(e){try{++Ei,e()}finally{--Ei||ki()}}function Oi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=yi(n,e)}function ki(){if(!(Ei>0)){for(;Ci<wi;){let e=gi[Ci];gi[Ci++]=void 0,e.notify()}Ci=0,wi=0}}function Ai(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?pi.None:pi.Mutable,get(){return Ti!==void 0&&vi(i,Ti,_i),i._snapshot},subscribe(e){let t=hi(e),n={current:!1},r=ji(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Ti,o=t?.compare??Object.is;if(n)Ti=i,++_i,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=pi.Mutable|pi.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Ti=a,n&&(i.flags&=~pi.RecursedCheck),Oi(i)}}};return n?(i.flags=pi.Mutable|pi.Dirty,i.get=function(){let e=i.flags;if(e&pi.Dirty||e&pi.Pending&&xi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Si(e)}}else e&pi.Pending&&(i.flags=e&~pi.Pending);return Ti!==void 0&&vi(i,Ti,_i),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(bi(e),Si(e),ki())}},i}function ji(e){let t=()=>{let t=Ti;Ti=n,++_i,n.depsTail=void 0,n.flags=pi.Watching|pi.RecursedCheck;try{return e()}finally{Ti=t,n.flags&=~pi.RecursedCheck,Oi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pi.Watching|pi.RecursedCheck,notify(){let e=this.flags;e&pi.Dirty||e&pi.Pending&&xi(this.deps,this)?t():this.flags=pi.Watching},stop(){this.flags=pi.None,this.depsTail=void 0,Oi(this)}};return t(),n}var Mi=o((e=>{var t=d(),n=at();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ni=o(((e,t)=>{t.exports=Mi()}))();function Pi(e,t){return e===t}function Fi(e,t,n=Pi){let r=(0,j.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,j.useCallback)(()=>e?.get(),[e]);return(0,Ni.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ii={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Li(e){let t=ui(),n=j.useContext(e.from?fi:di),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=j.useRef(void 0);return Fi(i??Ii,n=>{if((e.shouldThrow??!0)&&!n&&qt(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=Mt(a.current,r);return a.current=e,e}return r})}function Ri(e){return Li({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function zi(e){let{select:t,...n}=e;return Li({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Bi(e){return Li({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vi(e){return Li({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Hi(e){let t=ui();return j.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ui(e){let t=ui(),n=Hi(),r=j.useRef(null);return bt(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Wi(e){return Li({...e,select:t=>e.select?e.select(t.context):t.context})}var Gi=c(h(),1);function Ki(e,t){let n=ui(),r=Ct(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:ee,hash:te,state:ne,mask:re,reloadDocument:ie,unsafeRelative:ae,from:oe,_fromLocation:k,...se}=e,ce=si(),le=j.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=Fi(n.stores.location,e=>e,(e,t)=>e.href===t.href),A=j.useMemo(()=>{let e={_fromLocation:ue,...le};return n.buildLocation(e)},[n,ue,le]),de=A.maskedLocation?A.maskedLocation.publicHref:A.publicHref,fe=A.maskedLocation?A.maskedLocation.external:A.external,pe=j.useMemo(()=>ta(de,fe,n.history,v),[v,fe,de,n.history]),me=j.useMemo(()=>{if(pe?.external)return Ut(pe.href,n.protocolAllowlist)?void 0:pe.href;if(!na(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Ut(s,n.protocolAllowlist)?void 0:s}catch{}},[s,pe,n.protocolAllowlist]),he=j.useMemo(()=>{if(me)return!1;if(o?.exact){if(!En(ue.pathname,A.pathname,n.basepath))return!1}else{let e=Tn(ue.pathname,n.basepath),t=Tn(A.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!Lt(ue.search,A.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ce&&ue.hash===A.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ue,me,ce,A.hash,A.pathname,A.search,n.basepath]),ge=he?Et(i,{})??Ji:qi,_e=he?qi:Et(a,{})??qi,ve=[b,ge.className,_e.className].filter(Boolean).join(` `),ye=(y||ge.style||_e.style)&&{...y,...ge.style,..._e.style},[be,xe]=j.useState(!1),Se=j.useRef(!1),Ce=e.reloadDocument||me?!1:c??n.options.defaultPreload,we=l??n.options.defaultPreloadDelay??0,Te=j.useCallback(()=>{n.preloadRoute({...le,_builtLocation:A}).catch(e=>{console.warn(e),console.warn($r)})},[n,le,A]);St(r,j.useCallback(e=>{e?.isIntersecting&&Te()},[Te]),$i,{disabled:!!v||Ce!==`viewport`}),j.useEffect(()=>{Se.current||!v&&Ce===`render`&&(Te(),Se.current=!0)},[v,Te,Ce]);let Ee=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!ia(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Gi.flushSync)(()=>{xe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),xe(!1)});n.navigate({...le,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(me)return{...se,ref:r,href:me,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let De=e=>{if(v||Ce!==`intent`)return;if(!we){Te();return}let t=e.currentTarget;if(Qi.has(t))return;let n=setTimeout(()=>{Qi.delete(t),Te()},we);Qi.set(t,n)},Oe=e=>{v||Ce!==`intent`||Te()},ke=e=>{if(v||!Ce||!we)return;let t=e.currentTarget,n=Qi.get(t);n&&(clearTimeout(n),Qi.delete(t))};return{...se,...ge,..._e,href:pe?.href,ref:r,onClick:ea([x,Ee]),onBlur:ea([S,ke]),onFocus:ea([C,De]),onMouseEnter:ea([w,De]),onMouseLeave:ea([T,ke]),onTouchStart:ea([E,Oe]),disabled:!!v,target:_,...ye&&{style:ye},...ve&&{className:ve},...v&&Yi,...he&&Xi,...ce&&be&&Zi}}var qi={},Ji={className:`active`},Yi={role:`link`,"aria-disabled":!0},Xi={"data-status":`active`,"aria-current":`page`},Zi={"data-transitioning":`transitioning`},Qi=new WeakMap,$i={rootMargin:`100px`},ea=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ta(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function na(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ra=j.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ki(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return j.createElement(`a`,t,o)}return j.createElement(n,a,o)});function ia(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var aa=class extends ei{constructor(e){super(e),this.useMatch=e=>Li({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Wi({...e,from:this.id}),this.useSearch=e=>Vi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>zi({...e,from:this.id}),this.useLoaderData=e=>Ri({...e,from:this.id}),this.useNavigate=()=>Hi({from:this.fullPath}),this.Link=j.forwardRef((e,t)=>(0,M.jsx)(ra,{ref:t,from:this.fullPath,...e}))}};function oa(e){return new aa(e)}var sa=class extends ti{constructor(e){super(e),this.useMatch=e=>Li({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Wi({...e,from:this.id}),this.useSearch=e=>Vi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>zi({...e,from:this.id}),this.useLoaderData=e=>Ri({...e,from:this.id}),this.useNavigate=()=>Hi({from:this.fullPath}),this.Link=j.forwardRef((e,t)=>(0,M.jsx)(ra,{ref:t,from:this.fullPath,...e}))}};function ca(e){return new sa(e)}function la(e){return new ua(e,{silent:!0}).createRoute}var ua=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=oa(e);return t.isRoot=!1,t},this.silent=t?.silent}};function da(e){let t=ui(),n=`not-found-${Fi(t.stores.location,e=>e.pathname)}-${Fi(t.stores.status,e=>e)}`;return(0,M.jsx)(ri,{getResetKey:()=>n,onCatch:(t,n)=>{if(Mn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Mn(t))return e.fallback?.(t);throw t},children:e.children})}function fa(){return(0,M.jsx)(`p`,{children:`Not Found`})}function pa(e){return(0,M.jsx)(M.Fragment,{children:e.children})}function ma(e,t,n){return t.options.notFoundComponent?(0,M.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,M.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,M.jsx)(fa,{})}var ha=j.memo(function({matchId:e}){let t=ui(),n=t.stores.matchStores.get(e);n||qt();let r=Fi(t.stores.loadedAt,e=>e),i=Fi(n,e=>e);return(0,M.jsx)(ga,{router:t,matchId:e,resetKey:r,matchState:j.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function ga({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,M.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?j.Suspense:pa,f=s?ri:pa,p=l?da:pa;return(0,M.jsxs)(i.isRoot?i.options.shellComponent??pa:pa,{children:[(0,M.jsx)(di.Provider,{value:t,children:(0,M.jsx)(d,{fallback:o,children:(0,M.jsx)(f,{getResetKey:()=>n,errorComponent:s||ai,onCatch:(e,t)=>{if(Mn(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,M.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return j.createElement(l,e)},children:u||r._displayPending?(0,M.jsx)(oi,{fallback:o,children:(0,M.jsx)(va,{matchId:t})}):(0,M.jsx)(va,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(_a,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function _a({resetKey:e}){let t=ui(),n=j.useRef(void 0);return bt(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Dr(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var va=j.memo(function({matchId:e}){let t=ui(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||qt();let i=Fi(r,e=>e),a=i.routeId,o=t.routesById[a],s=j.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=j.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,M.jsx)(e,{},s):(0,M.jsx)(ya,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=Rt();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Mn(i.error)||qt(),ma(t,o,i.error);if(i.status===`redirected`)throw Hn(i.error)||qt(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),ya=j.memo(function(){let e=ui(),t=j.useContext(di),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Fi(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=Fi(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,M.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||qt(),ma(e,a,void 0);if(!i)return null;let s=(0,M.jsx)(ha,{matchId:i});return n===`__root__`?(0,M.jsx)(j.Suspense,{fallback:o,children:s}):s});function ba(){let e=ui(),t=j.useRef({router:e,mounted:!1}),[n,r]=j.useState(!1),i=Fi(e.stores.isLoading,e=>e),a=Fi(e.stores.hasPending,e=>e),o=xt(i),s=i||n||a,c=xt(s),l=i||a,u=xt(l);return e.startTransition=e=>{r(!0),j.startTransition(()=>{e(),r(!1)})},j.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Cn(e.latestLocation.publicHref)!==Cn(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),bt(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),bt(()=>{o&&!i&&e.emit({type:`onLoad`,...Dr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),bt(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Dr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),bt(()=>{if(c&&!s){let t=Dr(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Di(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function xa(){let e=ui(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,M.jsx)(t,{}):null,r=(0,M.jsxs)(typeof document<`u`&&e.ssr?pa:j.Suspense,{fallback:n,children:[(0,M.jsx)(ba,{}),(0,M.jsx)(Sa,{})]});return e.options.InnerWrap?(0,M.jsx)(e.options.InnerWrap,{children:r}):r}function Sa(){let e=ui(),t=Fi(e.stores.firstId,e=>e),n=Fi(e.stores.loadedAt,e=>e),r=t?(0,M.jsx)(ha,{matchId:t}):null;return(0,M.jsx)(di.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,M.jsx)(ri,{getResetKey:()=>n,errorComponent:ai,onCatch:void 0,children:r})})}var Ca=e=>({createMutableStore:Ai,createReadonlyStore:Ai,batch:Di}),wa=e=>new Ta(e),Ta=class extends kr{constructor(e){super(e,Ca)}};function Ea({router:e,children:t,...n}){kt(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,M.jsx)(li.Provider,{value:e,children:t});return e.options.Wrap?(0,M.jsx)(e.options.Wrap,{children:r}):r}function Da({router:e,...t}){return(0,M.jsx)(Ea,{router:e,...t,children:(0,M.jsx)(xa,{})})}function Oa(e){let t=ui(),n=(0,j.useRef)(void 0);return Fi(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=Mt(n.current,i);return n.current=e,e}return i})}var ka;function N(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Aa=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ja=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ka=globalThis).__zod_globalConfig??(ka.__zod_globalConfig={});var Ma=globalThis.__zod_globalConfig;function Na(e){return e&&Object.assign(Ma,e),Ma}function Pa(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 Fa(e,t){return typeof t==`bigint`?t.toString():t}function Ia(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function La(e){return e==null}function Ra(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function za(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ba=Symbol(`evaluating`);function Va(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ba)return r===void 0&&(r=Ba,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ha(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ua(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Wa(e){return JSON.stringify(e)}function Ga(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ka=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function qa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ja=Ia(()=>{if(Ma.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ya(e){if(qa(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(qa(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Xa(e){return Ya(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Za=new Set([`string`,`number`,`symbol`]);function Qa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function $a(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(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 eo(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var to={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function no(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`);return $a(e,Ua(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ha(this,`shape`,e),e},checks:[]}))}function ro(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`);return $a(e,Ua(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ha(this,`shape`,r),r},checks:[]}))}function io(e,t){if(!Ya(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return $a(e,Ua(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ha(this,`shape`,n),n}}))}function ao(e,t){if(!Ya(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return $a(e,Ua(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ha(this,`shape`,n),n}}))}function oo(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return $a(e,Ua(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ha(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function so(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return $a(t,Ua(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ha(this,`shape`,i),i},checks:[]}))}function co(e,t,n){return $a(t,Ua(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ha(this,`shape`,i),i}}))}function lo(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 uo(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 fo(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function po(e){return typeof e==`string`?e:e?.message}function mo(e,t,n){let r=e.message?e.message:po(e.inst?._zod.def?.error?.(e))??po(t?.error?.(e))??po(n.customError?.(e))??po(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ho(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function go(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var _o=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Fa,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vo=N(`$ZodError`,_o),yo=N(`$ZodError`,_o,{Parent:Error});function bo(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function xo(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];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var So=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Aa;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>mo(e,a,Na())));throw Ka(t,i?.callee),t}return o.value},Co=So(yo),wo=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>mo(e,a,Na())));throw Ka(t,i?.callee),t}return o.value},To=wo(yo),Eo=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 Aa;return a.issues.length?{success:!1,error:new(e??vo)(a.issues.map(e=>mo(e,i,Na())))}:{success:!0,data:a.value}},Do=Eo(yo),Oo=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?{success:!1,error:new e(a.issues.map(e=>mo(e,i,Na())))}:{success:!0,data:a.value}},ko=Oo(yo),Ao=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return So(e)(t,n,i)},jo=e=>(t,n,r)=>So(e)(t,n,r),Mo=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wo(e)(t,n,i)},No=e=>async(t,n,r)=>wo(e)(t,n,r),Po=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Eo(e)(t,n,i)},Fo=e=>(t,n,r)=>Eo(e)(t,n,r),Io=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oo(e)(t,n,i)},Lo=e=>async(t,n,r)=>Oo(e)(t,n,r),Ro=/^[cC][0-9a-z]{6,}$/,zo=/^[0-9a-z]+$/,Bo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vo=/^[0-9a-vA-V]{20}$/,Ho=/^[A-Za-z0-9]{27}$/,Uo=/^[a-zA-Z0-9_-]{21}$/,Wo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Go=/^([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})$/,Ko=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)$/,qo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jo=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Yo(){return new RegExp(Jo,`u`)}var Xo=/^(?:(?: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])$/,Zo=/^(([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}|:))$/,Qo=/^((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])$/,$o=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,es=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ts=/^[A-Za-z0-9_-]*$/,ns=/^https?$/,rs=/^\+[1-9]\d{6,14}$/,is=`(?:(?:\\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])))`,as=RegExp(`^${is}$`);function os(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ss(e){return RegExp(`^${os(e)}$`)}function cs(e){let t=os({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${is}T(?:${r})$`)}var ls=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},us=/^-?\d+$/,ds=/^-?\d+(?:\.\d+)?$/,fs=/^(?:true|false)$/i,ps=/^null$/i,ms=/^[^A-Z]*$/,hs=/^[^a-z]*$/,gs=N(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_s={number:`number`,bigint:`bigint`,object:`date`},vs=N(`$ZodCheckLessThan`,(e,t)=>{gs.init(e,t);let n=_s[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin: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})}}),ys=N(`$ZodCheckGreaterThan`,(e,t)=>{gs.init(e,t);let n=_s[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin: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})}}),bs=N(`$ZodCheckMultipleOf`,(e,t)=>{gs.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),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`?n.value%t.value===BigInt(0):za(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})}}),xs=N(`$ZodCheckNumberFormat`,(e,t)=>{gs.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=to[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=us)}),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})}}),Ss=N(`$ZodCheckMaxLength`,(e,t)=>{var n;gs.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!La(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=ho(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cs=N(`$ZodCheckMinLength`,(e,t)=>{var n;gs.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!La(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ho(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ws=N(`$ZodCheckLengthEquals`,(e,t)=>{var n;gs.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!La(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=ho(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ts=N(`$ZodCheckStringFormat`,(e,t)=>{var n,r;gs.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),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=()=>{})}),Es=N(`$ZodCheckRegex`,(e,t)=>{Ts.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})}}),Ds=N(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ms,Ts.init(e,t)}),Os=N(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=hs,Ts.init(e,t)}),ks=N(`$ZodCheckIncludes`,(e,t)=>{gs.init(e,t);let n=Qa(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),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})}}),As=N(`$ZodCheckStartsWith`,(e,t)=>{gs.init(e,t);let n=RegExp(`^${Qa(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),js=N(`$ZodCheckEndsWith`,(e,t)=>{gs.init(e,t);let n=RegExp(`.*${Qa(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),Ms=N(`$ZodCheckOverwrite`,(e,t)=>{gs.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ns=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
39
|
+
The cached manifest will be removed. The app will remain loaded in the running kernel until the next restart.`,successInList:`Removed {{manifestId}}. Restart the runtime to fully unload it from the running kernel.`,successInDetail:`Removed cached manifest for {{manifestId}}. Restart the runtime to fully unload the app from the running kernel.`},accessDenied:{title:`App Marketplace is admin-only`,description:`You don't have permission to install apps in this environment. Ask an owner or admin of this organization for access.`},category:{crm:`CRM`,erp:`ERP`,hr:`Human Resources`,finance:`Finance`,project:`Project Management`,collaboration:`Collaboration`,analytics:`Analytics`,integration:`Integration`,automation:`Automation`,ai:`AI`,security:`Security`,"developer-tools":`Developer Tools`,"ui-theme":`UI Theme`,storage:`Storage`,other:`Other`},pricing:{free:`Free`,freemium:`Freemium`,paid:`Paid`,subscription:`Subscription`,"usage-based":`Usage-based`,"contact-sales":`Contact Sales`},relativeTime:{today:`today`,daysAgo:`{{count}}d ago`,monthsAgo:`{{count}}mo ago`,yearsAgo:`{{count}}y ago`}}}},ft=[`ar`,`he`,`fa`,`ur`];function pt(e){return ft.includes(e)}function mt(e={}){let{defaultLanguage:t=`en`,fallbackLanguage:n=`en`,resources:r={},detectBrowserLanguage:i=!0,interpolation:a}=e,o={};for(let[e,t]of Object.entries(dt))o[e]={translation:{...t,...r[e]||{}}};for(let[e,t]of Object.entries(r))o[e]||(o[e]={translation:t});let s=t;if(i&&typeof navigator<`u`){let e=navigator.language?.split(`-`)[0];e&&o[e]&&(s=e)}let c=Ie.createInstance();return c.use(tt).init({lng:s,fallbackLng:n,resources:o,interpolation:{escapeValue:!1,...a},returnNull:!1,react:{useSuspense:!1}}),c}function ht(e){return pt(e)?`rtl`:`ltr`}var gt=(0,j.createContext)(null);function _t({config:e,instance:t,loadLanguage:n,children:r}){let i=(0,j.useMemo)(()=>t||mt(e),[t,e]),[a,o]=(0,j.useState)(i.language||`en`),s=ht(a),c=(0,j.useRef)(new Set);(0,j.useEffect)(()=>{let e=e=>{o(e),typeof document<`u`&&(document.documentElement.dir=ht(e),document.documentElement.lang=e)},t=i.language||a;return typeof document<`u`&&t&&(document.documentElement.dir=ht(t),document.documentElement.lang=t),i.on(`languageChanged`,e),()=>{i.off(`languageChanged`,e)}},[i]),(0,j.useEffect)(()=>{if(!n)return;let e=i.language||`en`;c.current.has(e)||(c.current.add(e),n(e).then(t=>{t&&Object.keys(t).length>0&&(i.addResourceBundle(e,`translation`,t,!0,!0),o(e))}).catch(t=>{c.current.delete(e),console.warn(`[i18n] Failed to load app translations for '${e}':`,t)}))},[i,n]);let l=(0,j.useMemo)(()=>({language:a,changeLanguage:async e=>{if(n&&!c.current.has(e)){c.current.add(e);try{let t=await n(e);i.addResourceBundle(e,`translation`,t,!0,!0)}catch(t){c.current.delete(e),console.warn(`[i18n] Failed to load app translations for '${e}':`,t)}}await i.changeLanguage(e)},direction:s,i18n:i}),[a,s,i,n]);return j.createElement(gt.Provider,{value:l},j.createElement(ut,{i18n:i},r))}function vt(e){let t=(0,j.useContext)(gt),{t:n,i18n:r}=lt(e);return{t:n,language:t?.language||r.language||`en`,changeLanguage:t?.changeLanguage||(async e=>{await r.changeLanguage(e)}),direction:t?.direction||`ltr`,i18n:r}}function yt(){let e=(0,j.useContext)(gt);if(!e)throw Error(`useI18nContext must be used within an I18nProvider`);return e}var bt=typeof window<`u`?j.useLayoutEffect:j.useEffect;function xt(e){let t=j.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function St(e,t,n={},r={}){j.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Ct(e){let t=j.useRef(null);return j.useImperativeHandle(e,()=>t.current,[]),t}function wt(e){return e[e.length-1]}function Tt(e){return typeof e==`function`}function Et(e,t){return Tt(e)?e(t):e}var Dt=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;function kt(e){for(let t in e)if(Dt.call(e,t))return!0;return!1}var At=()=>Object.create(null),jt=(e,t)=>Mt(e,t,At);function Mt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=It(e)&&It(i);if(!a&&!(Pt(e)&&Pt(i)))return i;let o=a?e:Nt(e);if(!o)return i;let s=a?i:Nt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Dt.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Mt(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Nt(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Ot.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Ot.call(e,t))return!1;r.push(t)}return r}function Pt(e){if(!Ft(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ft(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Ft(e){return Object.prototype.toString.call(e)===`[object Object]`}function It(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lt(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Lt(e[r],t[r],n))return!1;return!0}if(Pt(e)&&Pt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Lt(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Lt(e[o],t[o],n)))return!1;return i===a}return!1}function Rt(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function zt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Bt(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Vt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Bt(t)}var Ht=[`http:`,`https:`,`mailto:`,`tel:`];function Ut(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Wt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Vt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Vt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Gt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Kt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function qt(){throw Error(`Invariant failed`)}function Jt(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Yt=4,Xt=5;function Zt(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Qt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Zt(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function $t(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=Qt(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=nn(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=nn(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=rn(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=rn(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=rn(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=nn(n.fullPath??n.from);e.kind=Xt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=nn(n.fullPath??n.from);e.kind=Yt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)$t(e,t,r,s,i,a,o)}function en(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function tn(e){if(e.pathless)for(let t of e.pathless)tn(t);if(e.static)for(let t of e.static.values())tn(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())tn(t);if(e.dynamic?.length){e.dynamic.sort(en);for(let t of e.dynamic)tn(t)}if(e.optional?.length){e.optional.sort(en);for(let t of e.optional)tn(t)}if(e.wildcard?.length){e.wildcard.sort(en);for(let t of e.wildcard)tn(t)}}function nn(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function rn(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function an(e,t){let n=nn(`/`),r=new Uint16Array(6);for(let t of e)$t(!1,r,t,1,n,0);tn(n),t.masksTree=n,t.flatCache=Jt(1e3)}function on(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=dn(e,t.masksTree);return t.flatCache.set(e,r),r}function sn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=nn(`/`),$t(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),dn(r,o,n)}function cn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=dn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=pn(a.route)),t.matchCache.set(r,a),a}function ln(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function un(e,t=!1,n){let r=nn(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return $t(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&qt(),a[e.id]=e,s!==0&&e.path){let t=ln(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),tn(r),{processedTree:{segmentTree:r,singleCache:Jt(1e3),matchCache:Jt(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function dn(e,t,n=!1){let r=e.split(`/`),i=hn(e,r,t,n);if(!i)return null;let[a]=fn(e,r,i);return{route:i.node.route,rawParams:a}}function fn(e,t,n){let r=mn(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Yt)break;if(u.kind===Xt){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function pn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function mn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function hn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!wt(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!yn(l,n))continue;if(i.parse){if(!vn(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==Yt&&yn(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===Yt||i.kind===2)&&yn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(vn(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&_n(p,o))return n;yn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+gn(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+gn(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+gn(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+gn(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function gn(e,t){return 2**(e-t-1)}function _n(e,t){return e===2**(t-1)-1}function vn(e,t,n){let r,i;try{[r,i]=fn(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function yn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Yt)>(e.node.kind===Yt)||t.node.kind===Yt==(e.node.kind===Yt)&&t.depth>e.depth))):!0}function bn(e){return xn(e.filter(e=>e!==void 0).join(`/`))}function xn(e){return e.replace(/\/{2,}/g,`/`)}function Sn(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Cn(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function wn(e){return Cn(Sn(e))}function Tn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function En(e,t,n){return Tn(e,n)===Tn(t,n)}function Dn({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&wt(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(wt(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=xn(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function On(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function kn(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>jn(e,n)).join(`/`):jn(r,n):r}function An({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Qt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=kn(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=kn(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=kn(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function jn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Mn(e){return e?.isNotFound===!0}function Nn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Pn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Fn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Pn(r):Array.isArray(t)?t.push(Pn(r)):n[e]=[t,Pn(r)]}return n}var In=Rn(JSON.parse),Ln=zn(JSON.stringify,JSON.parse);function Rn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Fn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function zn(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Nn(e,r);return t?`?${t}`:``}}var Bn=`__root__`;function Vn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Hn(e){return e instanceof Response&&!!e.options}var Un=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Wn=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Gn=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Kn=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},qn=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Jn=(e,t,n)=>{if(!(!Hn(n)&&!Mn(n)))throw Hn(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Hn(n)?`redirected`:Mn(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Kn(e,t.index),isFetching:!1,error:n})),Mn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Hn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Yn=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Xn=(e,t,n)=>{let r=Kn(e,n);e.updateMatch(t,e=>({...e,context:r}))},Zn=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,Jn(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,Jn(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Hn(n)&&!Mn(n)&&(e.serialError??=n)},Qn=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Gn(e,t)&&(n.options.loader||n.options.beforeLoad||lr(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Un(e)},i);r._nonReactive.pendingTimeout=t}},$n=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Qn(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Jn(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},er=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Rt(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Zn(e,n,o),s&&Zn(e,n,s),Qn(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Rt();let f={...Kn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Gn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Hn(r)||Mn(r))&&(u(),Zn(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),zt(y))return u(),y.catch(t=>{Zn(e,n,t)}).then(v)}catch(t){u(),Zn(e,n,t)}v(y)},tr=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>er(e,n,t,i),s=()=>{if(Yn(e,n))return;let t=$n(e,n,i);return zt(t)?t.then(o):o()};return a()},nr=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},rr=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Kn(e,r),d=Gn(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},ir=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{cr(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(rr(e,t,n,r,i)),l=!!s&&zt(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Jn(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Kn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Kn(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Mn(t)&&await i.options.notFoundComponent?.preload?.(),Jn(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Jn(e,e.router.getMatch(n),t)}!Hn(o)&&!Mn(o)&&await cr(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Kn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Jn(e,r,t)}},ar=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(rr(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await ir(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Hn(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await ir(e,t,i,n,d):Xn(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Yn(e,i)){if(!e.router.getMatch(i))return e.matches[n];Xn(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=Gn(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Jn(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=Rt(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function or(e){let t=e,n=[];Wn(t.router)&&Un(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=tr(t,e);zt(n)&&await n}catch(e){if(Hn(e))throw e;if(Mn(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?qn(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(ar(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Hn(e))throw e;Mn(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=qn(t,l);e===void 0&&qt();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await cr(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await cr(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=nr(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Un(t);if(zt(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function sr(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function cr(e,t=ur){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===ur?(()=>{if(e._componentsPromise===void 0){let t=sr(e,ur);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():sr(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function lr(e){for(let t of ur)if(e.options[t]?.preload)return!0;return!1}var ur=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function dr(e){return{input:({url:t})=>{for(let n of e)t=pr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=mr(e[n],t);return t}}}function fr(e){let t=wn(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=bn([`/`,t,e.pathname]),e)}}function pr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function mr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function hr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>gr(o,_.get())),x=r(()=>gr(s,v.get())),S=r(()=>gr(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Jt(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let ee={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:te,setPending:ne,setCached:re};te(e.matches),a?.(ee);function te(e){_r(e,o,_,n,i)}function ne(e){_r(e,s,v,n,i)}function re(e){_r(e,c,y,n,i)}return ee}function gr(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function _r(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}Kt(n.get(),a)||n.set(a)})}var vr=`__TSR_index`,yr=`popstate`,br=`beforeunload`;function xr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Tr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[vr];i=Sr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[vr];i=Sr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[vr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Sr(e,t){t||={};let n=Er();return{...t,key:n,__TSR_key:n,[vr]:e}}function Cr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Tr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Er();t.history.replaceState({[vr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Tr(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[vr]-l.state[vr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=xr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(br,S,{capture:!0}),t.removeEventListener(yr,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(br,S,{capture:!0}),t.addEventListener(yr,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function wr(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Tr(e,t){let n=wr(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Er();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[vr]:0,key:a,__TSR_key:a}}}function Er(){return(Math.random()+1).toString(36).substring(7)}function Dr(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Or=new WeakMap,kr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=On(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Cr()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Jt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=hr(Mr(this.latestLocation),e),Qr(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=wn(o);t&&t!==`/`&&e.push(fr({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:dr(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=un(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&an(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Wt(e).path,external:!1,searchStr:o,search:jt(t?.search,i),hash:Wt(r.slice(1)).path,state:Mt(t?.state,a)}}let o=new URL(i,this.origin),s=pr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Wt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:jt(t?.search,c),hash:Wt(s.hash.slice(1)).path,state:Mt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Dn({base:e,to:t.includes(`//`)?xn(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Pr({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,Et(t.params,s)),d=this.routesByPath[Cn(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&kt(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:Wt(An({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Nr(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Fr({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=jt(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?Et(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?Et(t.state,n.state):{};v=Mt(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=mr(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Gt(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=on(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,Et(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Lt(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Cn(this.latestLocation.href)===Cn(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=Rt(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Tr(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=pr(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(Ut(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Or.set(this.latestLocation,t):Or.delete(this.latestLocation);let n=this.latestLocation,r=Dr(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await or({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Hn(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Mn(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Dr(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&Ut(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=cr,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await or({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Hn(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Mn(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=sn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Lt(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Lt(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ln,parseSearch:e.parseSearch??In,protocolAllowlist:e.protocolAllowlist??Ht}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=pn(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Cn(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Lr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Nr(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Ar||(r=new Ar(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=An({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{Rr(r,b)}catch(e){if(x=Mn(e)||Hn(e)?e:new jr(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:jt(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||lr(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?jt(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:Rt()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?Mt(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?jt(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=wt(t),i={...e.search};for(let e of t)try{Object.assign(i,Nr(e.options.validateSearch,i))}catch{}let a=wt(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Rr(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Ar=class extends Error{},jr=class extends Error{};function Mr(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Nr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ar(`Async validation not supported`);if(n.issues)throw new Ar(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Pr({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Cn(e),a,o=cn(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Fr({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Ir(n)(e,t,r??!1)}function Ir(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Nr(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=Et(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function Lr(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Bn}function Rr(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function zr(){try{return sessionStorage}catch{return}}var Br=`tsr-scroll-restoration-v1_3`,Vr=zr();function Hr(){try{return JSON.parse(Vr?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ur(){try{Vr?.setItem(Br,JSON.stringify(Wr))}catch{}}var Wr=Hr(),Gr=`data-scroll-restoration-id`,Kr=e=>e.state.__TSR_key||e.href;function qr(e){let t=e.getAttribute(Gr);if(t)return`[${Gr}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Jr=!1,Yr=`window`;function Xr(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Zr(e){let t=[];for(let n of e){if(n===Yr)continue;let e=Xr(n);e&&t.push(e)}return t}function Qr(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Kr,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(Jr||!r.restoring))if(e.target===document)o(Yr,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=Wr[e]||={};for(let[e,n]of a)e===Yr?t[Yr]=n:e.isConnected&&(t[qr(e)]=n)};n&&!r.restoration&&(r.restoration=!0,Jr=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ur()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=Wr[u];if(e){let t=Wr[l];for(let n in e){if(n===Yr){if(s)continue}else{let e=Xr(n);if(!e||s&&o&&(c??=Zr(o),c.includes(e)))continue}t||=Wr[l]={},t[n]??=e[n]}}}Jr=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Or.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?Wr[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===Yr){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=Xr(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=Zr(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Jr=!1}}))}var $r=`Error preloading route! ☝️`,ei=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Bn:this.parentRoute||qt();let r=n?Bn:t?.path;r&&r!==`/`&&(r=Sn(r));let i=t?.id||r,a=n?Bn:bn([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=bn([`/`,a]));let o=a===`__root__`?`/`:bn([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Cn(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Vn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ti=class extends ei{constructor(e){super(e)}},ni=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})),M=o(((e,t)=>{t.exports=ni()}))();function ri(e){let t=e.errorComponent??ai;return(0,M.jsx)(ii,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?j.createElement(t,{error:n,reset:r}):e.children})}var ii=class extends j.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ai({error:e}){let[t,n]=j.useState(!1);return(0,M.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,M.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,M.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,M.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,M.jsx)(`div`,{children:(0,M.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,M.jsx)(`code`,{children:e.message}):null})}):null]})}function oi({children:e,fallback:t=null}){return si()?(0,M.jsx)(j.Fragment,{children:e}):(0,M.jsx)(j.Fragment,{children:t})}function si(){return j.useSyncExternalStore(ci,()=>!0,()=>!1)}function ci(){return()=>{}}var li=j.createContext(null);function ui(e){return j.useContext(li)}var di=j.createContext(void 0),fi=j.createContext(void 0),pi=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(pi||{});function mi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function hi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var gi=[],_i=0,{link:vi,unlink:yi,propagate:bi,checkDirty:xi,shallowPropagate:Si}=mi({update(e){return e._update()},notify(e){gi[wi++]=e,e.flags&=~pi.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pi.Mutable|pi.Dirty,Oi(e))}}),Ci=0,wi=0,Ti,Ei=0;function Di(e){try{++Ei,e()}finally{--Ei||ki()}}function Oi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=yi(n,e)}function ki(){if(!(Ei>0)){for(;Ci<wi;){let e=gi[Ci];gi[Ci++]=void 0,e.notify()}Ci=0,wi=0}}function Ai(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?pi.None:pi.Mutable,get(){return Ti!==void 0&&vi(i,Ti,_i),i._snapshot},subscribe(e){let t=hi(e),n={current:!1},r=ji(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Ti,o=t?.compare??Object.is;if(n)Ti=i,++_i,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=pi.Mutable|pi.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Ti=a,n&&(i.flags&=~pi.RecursedCheck),Oi(i)}}};return n?(i.flags=pi.Mutable|pi.Dirty,i.get=function(){let e=i.flags;if(e&pi.Dirty||e&pi.Pending&&xi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Si(e)}}else e&pi.Pending&&(i.flags=e&~pi.Pending);return Ti!==void 0&&vi(i,Ti,_i),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(bi(e),Si(e),ki())}},i}function ji(e){let t=()=>{let t=Ti;Ti=n,++_i,n.depsTail=void 0,n.flags=pi.Watching|pi.RecursedCheck;try{return e()}finally{Ti=t,n.flags&=~pi.RecursedCheck,Oi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pi.Watching|pi.RecursedCheck,notify(){let e=this.flags;e&pi.Dirty||e&pi.Pending&&xi(this.deps,this)?t():this.flags=pi.Watching},stop(){this.flags=pi.None,this.depsTail=void 0,Oi(this)}};return t(),n}var Mi=o((e=>{var t=d(),n=at();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ni=o(((e,t)=>{t.exports=Mi()}))();function Pi(e,t){return e===t}function Fi(e,t,n=Pi){let r=(0,j.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,j.useCallback)(()=>e?.get(),[e]);return(0,Ni.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ii={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Li(e){let t=ui(),n=j.useContext(e.from?fi:di),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=j.useRef(void 0);return Fi(i??Ii,n=>{if((e.shouldThrow??!0)&&!n&&qt(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=Mt(a.current,r);return a.current=e,e}return r})}function Ri(e){return Li({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function zi(e){let{select:t,...n}=e;return Li({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Bi(e){return Li({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vi(e){return Li({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Hi(e){let t=ui();return j.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ui(e){let t=ui(),n=Hi(),r=j.useRef(null);return bt(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Wi(e){return Li({...e,select:t=>e.select?e.select(t.context):t.context})}var Gi=c(h(),1);function Ki(e,t){let n=ui(),r=Ct(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:ee,hash:te,state:ne,mask:re,reloadDocument:ie,unsafeRelative:ae,from:oe,_fromLocation:k,...se}=e,ce=si(),le=j.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=Fi(n.stores.location,e=>e,(e,t)=>e.href===t.href),A=j.useMemo(()=>{let e={_fromLocation:ue,...le};return n.buildLocation(e)},[n,ue,le]),de=A.maskedLocation?A.maskedLocation.publicHref:A.publicHref,fe=A.maskedLocation?A.maskedLocation.external:A.external,pe=j.useMemo(()=>ta(de,fe,n.history,v),[v,fe,de,n.history]),me=j.useMemo(()=>{if(pe?.external)return Ut(pe.href,n.protocolAllowlist)?void 0:pe.href;if(!na(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Ut(s,n.protocolAllowlist)?void 0:s}catch{}},[s,pe,n.protocolAllowlist]),he=j.useMemo(()=>{if(me)return!1;if(o?.exact){if(!En(ue.pathname,A.pathname,n.basepath))return!1}else{let e=Tn(ue.pathname,n.basepath),t=Tn(A.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!Lt(ue.search,A.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ce&&ue.hash===A.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ue,me,ce,A.hash,A.pathname,A.search,n.basepath]),ge=he?Et(i,{})??Ji:qi,_e=he?qi:Et(a,{})??qi,ve=[b,ge.className,_e.className].filter(Boolean).join(` `),ye=(y||ge.style||_e.style)&&{...y,...ge.style,..._e.style},[be,xe]=j.useState(!1),Se=j.useRef(!1),Ce=e.reloadDocument||me?!1:c??n.options.defaultPreload,we=l??n.options.defaultPreloadDelay??0,Te=j.useCallback(()=>{n.preloadRoute({...le,_builtLocation:A}).catch(e=>{console.warn(e),console.warn($r)})},[n,le,A]);St(r,j.useCallback(e=>{e?.isIntersecting&&Te()},[Te]),$i,{disabled:!!v||Ce!==`viewport`}),j.useEffect(()=>{Se.current||!v&&Ce===`render`&&(Te(),Se.current=!0)},[v,Te,Ce]);let Ee=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!ia(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Gi.flushSync)(()=>{xe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),xe(!1)});n.navigate({...le,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(me)return{...se,ref:r,href:me,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let De=e=>{if(v||Ce!==`intent`)return;if(!we){Te();return}let t=e.currentTarget;if(Qi.has(t))return;let n=setTimeout(()=>{Qi.delete(t),Te()},we);Qi.set(t,n)},Oe=e=>{v||Ce!==`intent`||Te()},ke=e=>{if(v||!Ce||!we)return;let t=e.currentTarget,n=Qi.get(t);n&&(clearTimeout(n),Qi.delete(t))};return{...se,...ge,..._e,href:pe?.href,ref:r,onClick:ea([x,Ee]),onBlur:ea([S,ke]),onFocus:ea([C,De]),onMouseEnter:ea([w,De]),onMouseLeave:ea([T,ke]),onTouchStart:ea([E,Oe]),disabled:!!v,target:_,...ye&&{style:ye},...ve&&{className:ve},...v&&Yi,...he&&Xi,...ce&&be&&Zi}}var qi={},Ji={className:`active`},Yi={role:`link`,"aria-disabled":!0},Xi={"data-status":`active`,"aria-current":`page`},Zi={"data-transitioning":`transitioning`},Qi=new WeakMap,$i={rootMargin:`100px`},ea=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ta(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function na(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ra=j.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ki(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return j.createElement(`a`,t,o)}return j.createElement(n,a,o)});function ia(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var aa=class extends ei{constructor(e){super(e),this.useMatch=e=>Li({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Wi({...e,from:this.id}),this.useSearch=e=>Vi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>zi({...e,from:this.id}),this.useLoaderData=e=>Ri({...e,from:this.id}),this.useNavigate=()=>Hi({from:this.fullPath}),this.Link=j.forwardRef((e,t)=>(0,M.jsx)(ra,{ref:t,from:this.fullPath,...e}))}};function oa(e){return new aa(e)}var sa=class extends ti{constructor(e){super(e),this.useMatch=e=>Li({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Wi({...e,from:this.id}),this.useSearch=e=>Vi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>zi({...e,from:this.id}),this.useLoaderData=e=>Ri({...e,from:this.id}),this.useNavigate=()=>Hi({from:this.fullPath}),this.Link=j.forwardRef((e,t)=>(0,M.jsx)(ra,{ref:t,from:this.fullPath,...e}))}};function ca(e){return new sa(e)}function la(e){return new ua(e,{silent:!0}).createRoute}var ua=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=oa(e);return t.isRoot=!1,t},this.silent=t?.silent}};function da(e){let t=ui(),n=`not-found-${Fi(t.stores.location,e=>e.pathname)}-${Fi(t.stores.status,e=>e)}`;return(0,M.jsx)(ri,{getResetKey:()=>n,onCatch:(t,n)=>{if(Mn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Mn(t))return e.fallback?.(t);throw t},children:e.children})}function fa(){return(0,M.jsx)(`p`,{children:`Not Found`})}function pa(e){return(0,M.jsx)(M.Fragment,{children:e.children})}function ma(e,t,n){return t.options.notFoundComponent?(0,M.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,M.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,M.jsx)(fa,{})}var ha=j.memo(function({matchId:e}){let t=ui(),n=t.stores.matchStores.get(e);n||qt();let r=Fi(t.stores.loadedAt,e=>e),i=Fi(n,e=>e);return(0,M.jsx)(ga,{router:t,matchId:e,resetKey:r,matchState:j.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function ga({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,M.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?j.Suspense:pa,f=s?ri:pa,p=l?da:pa;return(0,M.jsxs)(i.isRoot?i.options.shellComponent??pa:pa,{children:[(0,M.jsx)(di.Provider,{value:t,children:(0,M.jsx)(d,{fallback:o,children:(0,M.jsx)(f,{getResetKey:()=>n,errorComponent:s||ai,onCatch:(e,t)=>{if(Mn(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,M.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return j.createElement(l,e)},children:u||r._displayPending?(0,M.jsx)(oi,{fallback:o,children:(0,M.jsx)(va,{matchId:t})}):(0,M.jsx)(va,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(_a,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function _a({resetKey:e}){let t=ui(),n=j.useRef(void 0);return bt(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Dr(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var va=j.memo(function({matchId:e}){let t=ui(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||qt();let i=Fi(r,e=>e),a=i.routeId,o=t.routesById[a],s=j.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=j.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,M.jsx)(e,{},s):(0,M.jsx)(ya,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=Rt();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Mn(i.error)||qt(),ma(t,o,i.error);if(i.status===`redirected`)throw Hn(i.error)||qt(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),ya=j.memo(function(){let e=ui(),t=j.useContext(di),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Fi(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=Fi(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,M.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||qt(),ma(e,a,void 0);if(!i)return null;let s=(0,M.jsx)(ha,{matchId:i});return n===`__root__`?(0,M.jsx)(j.Suspense,{fallback:o,children:s}):s});function ba(){let e=ui(),t=j.useRef({router:e,mounted:!1}),[n,r]=j.useState(!1),i=Fi(e.stores.isLoading,e=>e),a=Fi(e.stores.hasPending,e=>e),o=xt(i),s=i||n||a,c=xt(s),l=i||a,u=xt(l);return e.startTransition=e=>{r(!0),j.startTransition(()=>{e(),r(!1)})},j.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Cn(e.latestLocation.publicHref)!==Cn(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),bt(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),bt(()=>{o&&!i&&e.emit({type:`onLoad`,...Dr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),bt(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Dr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),bt(()=>{if(c&&!s){let t=Dr(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Di(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function xa(){let e=ui(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,M.jsx)(t,{}):null,r=(0,M.jsxs)(typeof document<`u`&&e.ssr?pa:j.Suspense,{fallback:n,children:[(0,M.jsx)(ba,{}),(0,M.jsx)(Sa,{})]});return e.options.InnerWrap?(0,M.jsx)(e.options.InnerWrap,{children:r}):r}function Sa(){let e=ui(),t=Fi(e.stores.firstId,e=>e),n=Fi(e.stores.loadedAt,e=>e),r=t?(0,M.jsx)(ha,{matchId:t}):null;return(0,M.jsx)(di.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,M.jsx)(ri,{getResetKey:()=>n,errorComponent:ai,onCatch:void 0,children:r})})}var Ca=e=>({createMutableStore:Ai,createReadonlyStore:Ai,batch:Di}),wa=e=>new Ta(e),Ta=class extends kr{constructor(e){super(e,Ca)}};function Ea({router:e,children:t,...n}){kt(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,M.jsx)(li.Provider,{value:e,children:t});return e.options.Wrap?(0,M.jsx)(e.options.Wrap,{children:r}):r}function Da({router:e,...t}){return(0,M.jsx)(Ea,{router:e,...t,children:(0,M.jsx)(xa,{})})}function Oa(e){let t=ui(),n=(0,j.useRef)(void 0);return Fi(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=Mt(n.current,i);return n.current=e,e}return i})}var ka;function N(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Aa=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ja=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ka=globalThis).__zod_globalConfig??(ka.__zod_globalConfig={});var Ma=globalThis.__zod_globalConfig;function Na(e){return e&&Object.assign(Ma,e),Ma}function Pa(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 Fa(e,t){return typeof t==`bigint`?t.toString():t}function Ia(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function La(e){return e==null}function Ra(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function za(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ba=Symbol(`evaluating`);function Va(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ba)return r===void 0&&(r=Ba,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ha(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ua(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Wa(e){return JSON.stringify(e)}function Ga(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ka=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function qa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ja=Ia(()=>{if(Ma.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ya(e){if(qa(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(qa(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Xa(e){return Ya(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Za=new Set([`string`,`number`,`symbol`]);function Qa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function $a(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(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 eo(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var to={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function no(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`);return $a(e,Ua(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ha(this,`shape`,e),e},checks:[]}))}function ro(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`);return $a(e,Ua(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ha(this,`shape`,r),r},checks:[]}))}function io(e,t){if(!Ya(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return $a(e,Ua(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ha(this,`shape`,n),n}}))}function ao(e,t){if(!Ya(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return $a(e,Ua(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ha(this,`shape`,n),n}}))}function oo(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return $a(e,Ua(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ha(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function so(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return $a(t,Ua(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ha(this,`shape`,i),i},checks:[]}))}function co(e,t,n){return $a(t,Ua(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ha(this,`shape`,i),i}}))}function lo(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 uo(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 fo(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function po(e){return typeof e==`string`?e:e?.message}function mo(e,t,n){let r=e.message?e.message:po(e.inst?._zod.def?.error?.(e))??po(t?.error?.(e))??po(n.customError?.(e))??po(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ho(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function go(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var _o=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Fa,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vo=N(`$ZodError`,_o),yo=N(`$ZodError`,_o,{Parent:Error});function bo(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function xo(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];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var So=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Aa;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>mo(e,a,Na())));throw Ka(t,i?.callee),t}return o.value},Co=So(yo),wo=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>mo(e,a,Na())));throw Ka(t,i?.callee),t}return o.value},To=wo(yo),Eo=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 Aa;return a.issues.length?{success:!1,error:new(e??vo)(a.issues.map(e=>mo(e,i,Na())))}:{success:!0,data:a.value}},Do=Eo(yo),Oo=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?{success:!1,error:new e(a.issues.map(e=>mo(e,i,Na())))}:{success:!0,data:a.value}},ko=Oo(yo),Ao=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return So(e)(t,n,i)},jo=e=>(t,n,r)=>So(e)(t,n,r),Mo=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wo(e)(t,n,i)},No=e=>async(t,n,r)=>wo(e)(t,n,r),Po=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Eo(e)(t,n,i)},Fo=e=>(t,n,r)=>Eo(e)(t,n,r),Io=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oo(e)(t,n,i)},Lo=e=>async(t,n,r)=>Oo(e)(t,n,r),Ro=/^[cC][0-9a-z]{6,}$/,zo=/^[0-9a-z]+$/,Bo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vo=/^[0-9a-vA-V]{20}$/,Ho=/^[A-Za-z0-9]{27}$/,Uo=/^[a-zA-Z0-9_-]{21}$/,Wo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Go=/^([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})$/,Ko=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)$/,qo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jo=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Yo(){return new RegExp(Jo,`u`)}var Xo=/^(?:(?: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])$/,Zo=/^(([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}|:))$/,Qo=/^((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])$/,$o=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,es=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ts=/^[A-Za-z0-9_-]*$/,ns=/^https?$/,rs=/^\+[1-9]\d{6,14}$/,is=`(?:(?:\\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])))`,as=RegExp(`^${is}$`);function os(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ss(e){return RegExp(`^${os(e)}$`)}function cs(e){let t=os({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${is}T(?:${r})$`)}var ls=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},us=/^-?\d+$/,ds=/^-?\d+(?:\.\d+)?$/,fs=/^(?:true|false)$/i,ps=/^null$/i,ms=/^[^A-Z]*$/,hs=/^[^a-z]*$/,gs=N(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_s={number:`number`,bigint:`bigint`,object:`date`},vs=N(`$ZodCheckLessThan`,(e,t)=>{gs.init(e,t);let n=_s[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin: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})}}),ys=N(`$ZodCheckGreaterThan`,(e,t)=>{gs.init(e,t);let n=_s[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin: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})}}),bs=N(`$ZodCheckMultipleOf`,(e,t)=>{gs.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),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`?n.value%t.value===BigInt(0):za(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})}}),xs=N(`$ZodCheckNumberFormat`,(e,t)=>{gs.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=to[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=us)}),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})}}),Ss=N(`$ZodCheckMaxLength`,(e,t)=>{var n;gs.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!La(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=ho(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cs=N(`$ZodCheckMinLength`,(e,t)=>{var n;gs.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!La(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ho(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ws=N(`$ZodCheckLengthEquals`,(e,t)=>{var n;gs.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!La(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=ho(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ts=N(`$ZodCheckStringFormat`,(e,t)=>{var n,r;gs.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),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=()=>{})}),Es=N(`$ZodCheckRegex`,(e,t)=>{Ts.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})}}),Ds=N(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ms,Ts.init(e,t)}),Os=N(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=hs,Ts.init(e,t)}),ks=N(`$ZodCheckIncludes`,(e,t)=>{gs.init(e,t);let n=Qa(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),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})}}),As=N(`$ZodCheckStartsWith`,(e,t)=>{gs.init(e,t);let n=RegExp(`^${Qa(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),js=N(`$ZodCheckEndsWith`,(e,t)=>{gs.init(e,t);let n=RegExp(`.*${Qa(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),Ms=N(`$ZodCheckOverwrite`,(e,t)=>{gs.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ns=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
40
40
|
`).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?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
41
41
|
`))}},Ps={major:4,minor:4,patch:3},Fs=N(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ps;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=lo(e),i;for(let a of t){if(a._zod.def.when){if(uo(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Aa;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=lo(e,t))});else{if(e.issues.length===t)continue;r||=lo(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(lo(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Aa;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Aa;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Va(e,`~standard`,()=>({validate:t=>{try{let n=Do(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ko(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Is=N(`$ZodString`,(e,t)=>{Fs.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ls(e._zod.bag),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}}),Ls=N(`$ZodStringFormat`,(e,t)=>{Ts.init(e,t),Is.init(e,t)}),Rs=N(`$ZodGUID`,(e,t)=>{t.pattern??=Go,Ls.init(e,t)}),zs=N(`$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??=Ko(e)}else t.pattern??=Ko();Ls.init(e,t)}),Bs=N(`$ZodEmail`,(e,t)=>{t.pattern??=qo,Ls.init(e,t)}),Vs=N(`$ZodURL`,(e,t)=>{Ls.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ns.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Hs=N(`$ZodEmoji`,(e,t)=>{t.pattern??=Yo(),Ls.init(e,t)}),Us=N(`$ZodNanoID`,(e,t)=>{t.pattern??=Uo,Ls.init(e,t)}),Ws=N(`$ZodCUID`,(e,t)=>{t.pattern??=Ro,Ls.init(e,t)}),Gs=N(`$ZodCUID2`,(e,t)=>{t.pattern??=zo,Ls.init(e,t)}),Ks=N(`$ZodULID`,(e,t)=>{t.pattern??=Bo,Ls.init(e,t)}),qs=N(`$ZodXID`,(e,t)=>{t.pattern??=Vo,Ls.init(e,t)}),Js=N(`$ZodKSUID`,(e,t)=>{t.pattern??=Ho,Ls.init(e,t)}),Ys=N(`$ZodISODateTime`,(e,t)=>{t.pattern??=cs(t),Ls.init(e,t)}),Xs=N(`$ZodISODate`,(e,t)=>{t.pattern??=as,Ls.init(e,t)}),Zs=N(`$ZodISOTime`,(e,t)=>{t.pattern??=ss(t),Ls.init(e,t)}),Qs=N(`$ZodISODuration`,(e,t)=>{t.pattern??=Wo,Ls.init(e,t)}),$s=N(`$ZodIPv4`,(e,t)=>{t.pattern??=Xo,Ls.init(e,t),e._zod.bag.format=`ipv4`}),ec=N(`$ZodIPv6`,(e,t)=>{t.pattern??=Zo,Ls.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),tc=N(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Qo,Ls.init(e,t)}),nc=N(`$ZodCIDRv6`,(e,t)=>{t.pattern??=$o,Ls.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function rc(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ic=N(`$ZodBase64`,(e,t)=>{t.pattern??=es,Ls.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{rc(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ac(e){if(!ts.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return rc(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var oc=N(`$ZodBase64URL`,(e,t)=>{t.pattern??=ts,Ls.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ac(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),sc=N(`$ZodE164`,(e,t)=>{t.pattern??=rs,Ls.init(e,t)});function cc(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 lc=N(`$ZodJWT`,(e,t)=>{Ls.init(e,t),e._zod.check=n=>{cc(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),uc=N(`$ZodNumber`,(e,t)=>{Fs.init(e,t),e._zod.pattern=e._zod.bag.pattern??ds,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:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),dc=N(`$ZodNumberFormat`,(e,t)=>{xs.init(e,t),uc.init(e,t)}),fc=N(`$ZodBoolean`,(e,t)=>{Fs.init(e,t),e._zod.pattern=fs,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}}),pc=N(`$ZodNull`,(e,t)=>{Fs.init(e,t),e._zod.pattern=ps,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}}),mc=N(`$ZodAny`,(e,t)=>{Fs.init(e,t),e._zod.parse=e=>e}),hc=N(`$ZodUnknown`,(e,t)=>{Fs.init(e,t),e._zod.parse=e=>e}),gc=N(`$ZodNever`,(e,t)=>{Fs.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),_c=N(`$ZodVoid`,(e,t)=>{Fs.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),vc=N(`$ZodDate`,(e,t)=>{Fs.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function yc(e,t,n){e.issues.length&&t.issues.push(...fo(n,e.issues)),t.value[n]=e.value}var bc=N(`$ZodArray`,(e,t)=>{Fs.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>yc(t,n,e))):yc(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function xc(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...fo(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Sc(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=eo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Cc(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>xc(e,n,i,t,u,d))):xc(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var wc=N(`$ZodObject`,(e,t)=>{if(Fs.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Ia(()=>Sc(t));Va(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=qa,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>xc(n,t,e,s,r,i))):xc(a,t,e,s,r,i)}return i?Cc(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Tc=N(`$ZodObjectJIT`,(e,t)=>{wc.init(e,t);let n=e._zod.parse,r=Ia(()=>Sc(t)),i=e=>{let t=new Ns([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Wa(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Wa(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
42
42
|
if (${n}.issues.length) {
|
|
@@ -99,19 +99,19 @@ The cached manifest will be removed. The app will remain loaded in the running k
|
|
|
99
99
|
|
|
100
100
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=qa,s=!Ma.jitless,c=s&&Ja.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Cc([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Ec(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=>!lo(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=>mo(e,r,Na())))}),t)}var Dc=N(`$ZodUnion`,(e,t)=>{Fs.init(e,t),Va(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Va(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Va(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Va(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ra(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=>Ec(t,r,e,i)):Ec(o,r,e,i)}}),Oc=N(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Dc.init(e,t);let n=e._zod.parse;Va(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Ia(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!qa(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),kc=N(`$ZodIntersection`,(e,t)=>{Fs.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])=>jc(e,t,n)):jc(e,i,a)}});function Ac(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ya(e)&&Ya(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ac(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=Ac(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 jc(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),lo(e))return e;let o=Ac(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Mc=N(`$ZodTuple`,(e,t)=>{Fs.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Nc(n,`optin`),c=Nc(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Pc(t,r,e))):Pc(a,r,e)}}return o.length?Promise.all(o).then(()=>Fc(l,r,n,a,c)):Fc(l,r,n,a,c)}});function Nc(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Pc(e,t,n){e.issues.length&&t.issues.push(...fo(n,e.issues)),t.value[n]=e.value}function Fc(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...fo(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Ic=N(`$ZodRecord`,(e,t)=>{Fs.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Ya(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>mo(e,r,Na())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...fo(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...fo(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ds.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>mo(e,r,Na())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...fo(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...fo(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Lc=N(`$ZodEnum`,(e,t)=>{Fs.init(e,t);let n=Pa(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Za.has(typeof e)).map(e=>typeof e==`string`?Qa(e):e.toString()).join(`|`)})$`),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}}),Rc=N(`$ZodLiteral`,(e,t)=>{if(Fs.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Qa(e):e?Qa(e.toString()):String(e)).join(`|`)})$`),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}}),zc=N(`$ZodTransform`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ja(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.fallback=!0,n));if(i instanceof Promise)throw new Aa;return n.value=i,n.fallback=!0,n}});function Bc(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Vc=N(`$ZodOptional`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Va(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Va(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ra(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Bc(e,r)):Bc(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hc=N(`$ZodExactOptional`,(e,t)=>{Vc.init(e,t),Va(e._zod,`values`,()=>t.innerType._zod.values),Va(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Uc=N(`$ZodNullable`,(e,t)=>{Fs.init(e,t),Va(e._zod,`optin`,()=>t.innerType._zod.optin),Va(e._zod,`optout`,()=>t.innerType._zod.optout),Va(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ra(e.source)}|null)$`):void 0}),Va(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Wc=N(`$ZodDefault`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,Va(e._zod,`values`,()=>t.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=>Gc(e,t)):Gc(r,t)}});function Gc(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Kc=N(`$ZodPrefault`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,Va(e._zod,`values`,()=>t.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))}),qc=N(`$ZodNonOptional`,(e,t)=>{Fs.init(e,t),Va(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>Jc(t,e)):Jc(i,e)}});function Jc(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Yc=N(`$ZodCatch`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,Va(e._zod,`optout`,()=>t.innerType._zod.optout),Va(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mo(e,n,Na()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mo(e,n,Na()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xc=N(`$ZodPipe`,(e,t)=>{Fs.init(e,t),Va(e._zod,`values`,()=>t.in._zod.values),Va(e._zod,`optin`,()=>t.in._zod.optin),Va(e._zod,`optout`,()=>t.out._zod.optout),Va(e._zod,`propValues`,()=>t.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=>Zc(e,t.in,n)):Zc(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zc(e,t.out,n)):Zc(r,t.out,n)}});function Zc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Qc=N(`$ZodReadonly`,(e,t)=>{Fs.init(e,t),Va(e._zod,`propValues`,()=>t.innerType._zod.propValues),Va(e._zod,`values`,()=>t.innerType._zod.values),Va(e._zod,`optin`,()=>t.innerType?._zod?.optin),Va(e._zod,`optout`,()=>t.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($c):$c(r)}});function $c(e){return e.value=Object.freeze(e.value),e}var el=N(`$ZodFunction`,(e,t)=>(Fs.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Co(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Co(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await To(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await To(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Mc({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),tl=N(`$ZodPromise`,(e,t)=>{Fs.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),nl=N(`$ZodLazy`,(e,t)=>{Fs.init(e,t),Va(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Va(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),Va(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),Va(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),Va(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),rl=N(`$ZodCustom`,(e,t)=>{gs.init(e,t),Fs.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=>il(t,n,r,e));il(i,n,r,e)}});function il(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(go(e))}}var al,ol=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 sl(){return new ol}(al=globalThis).__zod_globalRegistry??(al.__zod_globalRegistry=sl());var cl=globalThis.__zod_globalRegistry;function ll(e,t){return new e({type:`string`,...P(t)})}function ul(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function dl(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function fl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function pl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function ml(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function hl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function gl(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function _l(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function vl(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function yl(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function bl(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function xl(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function Sl(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function Cl(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function wl(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function Tl(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function El(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function Dl(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function Ol(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function kl(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function Al(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function jl(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function Ml(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function Nl(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function Pl(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function Fl(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function Il(e,t){return new e({type:`number`,checks:[],...P(t)})}function Ll(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...P(t)})}function Rl(e,t){return new e({type:`boolean`,...P(t)})}function zl(e,t){return new e({type:`null`,...P(t)})}function Bl(e){return new e({type:`any`})}function Vl(e){return new e({type:`unknown`})}function Hl(e,t){return new e({type:`never`,...P(t)})}function Ul(e,t){return new e({type:`void`,...P(t)})}function Wl(e,t){return new e({type:`date`,...P(t)})}function Gl(e,t){return new vs({check:`less_than`,...P(t),value:e,inclusive:!1})}function Kl(e,t){return new vs({check:`less_than`,...P(t),value:e,inclusive:!0})}function ql(e,t){return new ys({check:`greater_than`,...P(t),value:e,inclusive:!1})}function Jl(e,t){return new ys({check:`greater_than`,...P(t),value:e,inclusive:!0})}function Yl(e,t){return new bs({check:`multiple_of`,...P(t),value:e})}function Xl(e,t){return new Ss({check:`max_length`,...P(t),maximum:e})}function Zl(e,t){return new Cs({check:`min_length`,...P(t),minimum:e})}function Ql(e,t){return new ws({check:`length_equals`,...P(t),length:e})}function $l(e,t){return new Es({check:`string_format`,format:`regex`,...P(t),pattern:e})}function eu(e){return new Ds({check:`string_format`,format:`lowercase`,...P(e)})}function tu(e){return new Os({check:`string_format`,format:`uppercase`,...P(e)})}function nu(e,t){return new ks({check:`string_format`,format:`includes`,...P(t),includes:e})}function ru(e,t){return new As({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function iu(e,t){return new js({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function au(e){return new Ms({check:`overwrite`,tx:e})}function ou(e){return au(t=>t.normalize(e))}function su(){return au(e=>e.trim())}function cu(){return au(e=>e.toLowerCase())}function lu(){return au(e=>e.toUpperCase())}function uu(){return au(e=>Ga(e))}function du(e,t,n){return new e({type:`array`,element:t,...P(n)})}function fu(e,t,n){let r=P(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pu(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function mu(e,t){let n=hu(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(go(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(go(r))}},e(t.value,t)),t);return n}function hu(e,t){let n=new gs({check:`custom`,...P(t)});return n._zod.check=e,n}function gu(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??cl,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function _u(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);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,_u(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&bu(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 vu(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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>
|
|
101
101
|
|
|
102
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function yu(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:Su(t,`input`,e.processors),output:Su(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bu(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 bu(r.element,n);if(r.type===`set`)return bu(r.valueType,n);if(r.type===`lazy`)return bu(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`)return bu(r.innerType,n);if(r.type===`intersection`)return bu(r.left,n)||bu(r.right,n);if(r.type===`record`||r.type===`map`)return bu(r.keyType,n)||bu(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bu(r.in,n)||bu(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bu(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bu(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bu(e,n))return!0;return!!(r.rest&&bu(r.rest,n))}return!1}var xu=(e,t={})=>n=>{let r=gu({...n,processors:t});return _u(e,r),vu(r,e),yu(r,e)},Su=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gu({...i??{},target:a,io:t,processors:n});return _u(e,o),vu(o,e),yu(o,e)},Cu={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wu=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Cu[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},Tu=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Eu=(e,t,n,r)=>{n.type=`boolean`},Du=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ou=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ku=(e,t,n,r)=>{n.not={}},Au=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ju=(e,t,n,r)=>{let i=e._zod.def,a=Pa(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Mu=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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},Nu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Pu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Fu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Iu=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_u(a.element,t,{...r,path:[...r.path,`items`]})},Lu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=_u(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_u(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ru=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_u(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zu=(e,t,n,r)=>{let i=e._zod.def,a=_u(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_u(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Bu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>_u(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?_u(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Vu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=_u(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=_u(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=_u(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Hu=(e,t,n,r)=>{let i=e._zod.def,a=_u(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`}]},Uu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Gu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ku=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},qu=(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;_u(o,t,r);let s=t.seen.get(e);s.ref=o},Ju=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zu=(e,t,n,r)=>{let i=e._zod.innerType;_u(i,t,r);let a=t.seen.get(e);a.ref=i},Qu=N(`ZodISODateTime`,(e,t)=>{Ys.init(e,t),wd.init(e,t)});function $u(e){return Ml(Qu,e)}var ed=N(`ZodISODate`,(e,t)=>{Xs.init(e,t),wd.init(e,t)});function td(e){return Nl(ed,e)}var nd=N(`ZodISOTime`,(e,t)=>{Zs.init(e,t),wd.init(e,t)});function rd(e){return Pl(nd,e)}var id=N(`ZodISODuration`,(e,t)=>{Qs.init(e,t),wd.init(e,t)});function ad(e){return Fl(id,e)}var od=N(`ZodError`,(e,t)=>{vo.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xo(e,t)},flatten:{value:t=>bo(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fa,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fa,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),sd=So(od),cd=wo(od),ld=Eo(od),ud=Oo(od),dd=Ao(od),fd=jo(od),pd=Mo(od),md=No(od),hd=Po(od),gd=Fo(od),_d=Io(od),vd=Lo(od),yd=new WeakMap;function bd(e,t,n){let r=Object.getPrototypeOf(e),i=yd.get(r);if(i||(i=new Set,yd.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var xd=N(`ZodType`,(e,t)=>(Fs.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Su(e,`input`),output:Su(e,`output`)}}),e.toJSONSchema=xu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>sd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ld(e,t,n),e.parseAsync=async(t,n)=>cd(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ud(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dd(e,t,n),e.decode=(t,n)=>fd(e,t,n),e.encodeAsync=async(t,n)=>pd(e,t,n),e.decodeAsync=async(t,n)=>md(e,t,n),e.safeEncode=(t,n)=>hd(e,t,n),e.safeDecode=(t,n)=>gd(e,t,n),e.safeEncodeAsync=async(t,n)=>_d(e,t,n),e.safeDecodeAsync=async(t,n)=>vd(e,t,n),bd(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ua(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 $a(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kf(e,t))},superRefine(e,t){return this.check(qf(e,t))},overwrite(e){return this.check(au(e))},optional(){return xf(this)},exactOptional(){return Cf(this)},nullable(){return Tf(this)},nullish(){return xf(Tf(this))},nonoptional(e){return jf(this,e)},array(){return z(this)},or(e){return V([this,e])},and(e){return ff(this,e)},transform(e){return Ff(this,yf(e))},default(e){return Df(this,e)},prefault(e){return kf(this,e)},catch(e){return Nf(this,e)},pipe(e){return Ff(this,e)},readonly(){return Lf(this)},describe(e){let t=this.clone();return cl.add(t,{description:e}),t},meta(...e){if(e.length===0)return cl.get(this);let t=this.clone();return cl.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return cl.get(e)?.description},configurable:!0}),e)),Sd=N(`_ZodString`,(e,t)=>{Is.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wu(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,bd(e,`_ZodString`,{regex(...e){return this.check($l(...e))},includes(...e){return this.check(nu(...e))},startsWith(...e){return this.check(ru(...e))},endsWith(...e){return this.check(iu(...e))},min(...e){return this.check(Zl(...e))},max(...e){return this.check(Xl(...e))},length(...e){return this.check(Ql(...e))},nonempty(...e){return this.check(Zl(1,...e))},lowercase(e){return this.check(eu(e))},uppercase(e){return this.check(tu(e))},trim(){return this.check(su())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(cu())},toUpperCase(){return this.check(lu())},slugify(){return this.check(uu())}})}),Cd=N(`ZodString`,(e,t)=>{Is.init(e,t),Sd.init(e,t),e.email=t=>e.check(ul(Td,t)),e.url=t=>e.check(gl(Od,t)),e.jwt=t=>e.check(jl(Ud,t)),e.emoji=t=>e.check(_l(kd,t)),e.guid=t=>e.check(dl(Ed,t)),e.uuid=t=>e.check(fl(Dd,t)),e.uuidv4=t=>e.check(pl(Dd,t)),e.uuidv6=t=>e.check(ml(Dd,t)),e.uuidv7=t=>e.check(hl(Dd,t)),e.nanoid=t=>e.check(vl(Ad,t)),e.guid=t=>e.check(dl(Ed,t)),e.cuid=t=>e.check(yl(jd,t)),e.cuid2=t=>e.check(bl(Md,t)),e.ulid=t=>e.check(xl(Nd,t)),e.base64=t=>e.check(Ol(Bd,t)),e.base64url=t=>e.check(kl(Vd,t)),e.xid=t=>e.check(Sl(Pd,t)),e.ksuid=t=>e.check(Cl(Fd,t)),e.ipv4=t=>e.check(wl(Id,t)),e.ipv6=t=>e.check(Tl(Ld,t)),e.cidrv4=t=>e.check(El(Rd,t)),e.cidrv6=t=>e.check(Dl(zd,t)),e.e164=t=>e.check(Al(Hd,t)),e.datetime=t=>e.check($u(t)),e.date=t=>e.check(td(t)),e.time=t=>e.check(rd(t)),e.duration=t=>e.check(ad(t))});function F(e){return ll(Cd,e)}var wd=N(`ZodStringFormat`,(e,t)=>{Ls.init(e,t),Sd.init(e,t)}),Td=N(`ZodEmail`,(e,t)=>{Bs.init(e,t),wd.init(e,t)}),Ed=N(`ZodGUID`,(e,t)=>{Rs.init(e,t),wd.init(e,t)}),Dd=N(`ZodUUID`,(e,t)=>{zs.init(e,t),wd.init(e,t)}),Od=N(`ZodURL`,(e,t)=>{Vs.init(e,t),wd.init(e,t)}),kd=N(`ZodEmoji`,(e,t)=>{Hs.init(e,t),wd.init(e,t)}),Ad=N(`ZodNanoID`,(e,t)=>{Us.init(e,t),wd.init(e,t)}),jd=N(`ZodCUID`,(e,t)=>{Ws.init(e,t),wd.init(e,t)}),Md=N(`ZodCUID2`,(e,t)=>{Gs.init(e,t),wd.init(e,t)}),Nd=N(`ZodULID`,(e,t)=>{Ks.init(e,t),wd.init(e,t)}),Pd=N(`ZodXID`,(e,t)=>{qs.init(e,t),wd.init(e,t)}),Fd=N(`ZodKSUID`,(e,t)=>{Js.init(e,t),wd.init(e,t)}),Id=N(`ZodIPv4`,(e,t)=>{$s.init(e,t),wd.init(e,t)}),Ld=N(`ZodIPv6`,(e,t)=>{ec.init(e,t),wd.init(e,t)}),Rd=N(`ZodCIDRv4`,(e,t)=>{tc.init(e,t),wd.init(e,t)}),zd=N(`ZodCIDRv6`,(e,t)=>{nc.init(e,t),wd.init(e,t)}),Bd=N(`ZodBase64`,(e,t)=>{ic.init(e,t),wd.init(e,t)}),Vd=N(`ZodBase64URL`,(e,t)=>{oc.init(e,t),wd.init(e,t)}),Hd=N(`ZodE164`,(e,t)=>{sc.init(e,t),wd.init(e,t)}),Ud=N(`ZodJWT`,(e,t)=>{lc.init(e,t),wd.init(e,t)}),Wd=N(`ZodNumber`,(e,t)=>{uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tu(e,t,n,r),bd(e,`ZodNumber`,{gt(e,t){return this.check(ql(e,t))},gte(e,t){return this.check(Jl(e,t))},min(e,t){return this.check(Jl(e,t))},lt(e,t){return this.check(Gl(e,t))},lte(e,t){return this.check(Kl(e,t))},max(e,t){return this.check(Kl(e,t))},int(e){return this.check(Kd(e))},safe(e){return this.check(Kd(e))},positive(e){return this.check(ql(0,e))},nonnegative(e){return this.check(Jl(0,e))},negative(e){return this.check(Gl(0,e))},nonpositive(e){return this.check(Kl(0,e))},multipleOf(e,t){return this.check(Yl(e,t))},step(e,t){return this.check(Yl(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Il(Wd,e)}var Gd=N(`ZodNumberFormat`,(e,t)=>{dc.init(e,t),Wd.init(e,t)});function Kd(e){return Ll(Gd,e)}var qd=N(`ZodBoolean`,(e,t)=>{fc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eu(e,t,n,r)});function L(e){return Rl(qd,e)}var Jd=N(`ZodNull`,(e,t)=>{pc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Du(e,t,n,r)});function Yd(e){return zl(Jd,e)}var Xd=N(`ZodAny`,(e,t)=>{mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Zd(){return Bl(Xd)}var Qd=N(`ZodUnknown`,(e,t)=>{hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Vl(Qd)}var $d=N(`ZodNever`,(e,t)=>{gc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ku(e,t,n,r)});function ef(e){return Hl($d,e)}var tf=N(`ZodVoid`,(e,t)=>{_c.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ou(e,t,n,r)});function nf(e){return Ul(tf,e)}var rf=N(`ZodDate`,(e,t)=>{vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Au(e,t,n,r),e.min=(t,n)=>e.check(Jl(t,n)),e.max=(t,n)=>e.check(Kl(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function af(e){return Wl(rf,e)}var of=N(`ZodArray`,(e,t)=>{bc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iu(e,t,n,r),e.element=t.element,bd(e,`ZodArray`,{min(e,t){return this.check(Zl(e,t))},nonempty(e){return this.check(Zl(1,e))},max(e,t){return this.check(Xl(e,t))},length(e,t){return this.check(Ql(e,t))},unwrap(){return this.element}})});function z(e,t){return du(of,e,t)}var sf=N(`ZodObject`,(e,t)=>{Tc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lu(e,t,n,r),Va(e,`shape`,()=>t.shape),bd(e,`ZodObject`,{keyof(){return U(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:ef()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return io(this,e)},safeExtend(e){return ao(this,e)},merge(e){return oo(this,e)},pick(e){return no(this,e)},omit(e){return ro(this,e)},partial(...e){return so(bf,this,e[0])},required(...e){return co(Af,this,e[0])}})});function B(e,t){return new sf({type:`object`,shape:e??{},...P(t)})}var cf=N(`ZodUnion`,(e,t)=>{Dc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ru(e,t,n,r),e.options=t.options});function V(e,t){return new cf({type:`union`,options:e,...P(t)})}var lf=N(`ZodDiscriminatedUnion`,(e,t)=>{cf.init(e,t),Oc.init(e,t)});function uf(e,t,n){return new lf({type:`union`,options:t,discriminator:e,...P(n)})}var df=N(`ZodIntersection`,(e,t)=>{kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zu(e,t,n,r)});function ff(e,t){return new df({type:`intersection`,left:e,right:t})}var pf=N(`ZodTuple`,(e,t)=>{Mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bu(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function mf(e,t,n){let r=t instanceof Fs;return new pf({type:`tuple`,items:e,rest:r?t:null,...P(r?n:t)})}var hf=N(`ZodRecord`,(e,t)=>{Ic.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vu(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function H(e,t,n){return!t||!t._zod?new hf({type:`record`,keyType:F(),valueType:e,...P(t)}):new hf({type:`record`,keyType:e,valueType:t,...P(n)})}var gf=N(`ZodEnum`,(e,t)=>{Lc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ju(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);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 gf({...t,checks:[],...P(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 gf({...t,checks:[],...P(r),entries:i})}});function U(e,t){return new gf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var _f=N(`ZodLiteral`,(e,t)=>{Rc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mu(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 W(e,t){return new _f({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var vf=N(`ZodTransform`,(e,t)=>{zc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fu(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ja(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(go(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(go(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function yf(e){return new vf({type:`transform`,transform:e})}var bf=N(`ZodOptional`,(e,t)=>{Vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new bf({type:`optional`,innerType:e})}var Sf=N(`ZodExactOptional`,(e,t)=>{Hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new Sf({type:`optional`,innerType:e})}var wf=N(`ZodNullable`,(e,t)=>{Uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tf(e){return new wf({type:`nullable`,innerType:e})}var Ef=N(`ZodDefault`,(e,t)=>{Wc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Df(e,t){return new Ef({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Of=N(`ZodPrefault`,(e,t)=>{Kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kf(e,t){return new Of({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Af=N(`ZodNonOptional`,(e,t)=>{qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jf(e,t){return new Af({type:`nonoptional`,innerType:e,...P(t)})}var Mf=N(`ZodCatch`,(e,t)=>{Yc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ku(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nf(e,t){return new Mf({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Pf=N(`ZodPipe`,(e,t)=>{Xc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qu(e,t,n,r),e.in=t.in,e.out=t.out});function Ff(e,t){return new Pf({type:`pipe`,in:e,out:t})}var If=N(`ZodReadonly`,(e,t)=>{Qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ju(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lf(e){return new If({type:`readonly`,innerType:e})}var Rf=N(`ZodLazy`,(e,t)=>{nl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zu(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function zf(e){return new Rf({type:`lazy`,getter:e})}var Bf=N(`ZodPromise`,(e,t)=>{tl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vf(e){return new Bf({type:`promise`,innerType:e})}var Hf=N(`ZodFunction`,(e,t)=>{el.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pu(e,t,n,r)});function Uf(e){return new Hf({type:`function`,input:Array.isArray(e?.input)?mf(e?.input):e?.input??z(R()),output:e?.output??R()})}var Wf=N(`ZodCustom`,(e,t)=>{rl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nu(e,t,n,r)});function Gf(e,t){return fu(Wf,e??(()=>!0),t)}function Kf(e,t={}){return pu(Wf,e,t)}function qf(e,t){return mu(e,t)}var Jf=c(_(),1);function G(e){if(typeof process<`u`&&{}.OS_EAGER_SCHEMAS===`1`)return e();let t,n=()=>(t===void 0&&(t=e()),t);return new Proxy(function(){},{get(e,t){let r=n(),i=r[t];return typeof i==`function`?i.bind(r):i},set(e,t,r){let i=n();return i[t]=r,!0},has(e,t){return t in n()},ownKeys(){return Reflect.ownKeys(n())},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(n(),t)},getPrototypeOf(){return Reflect.getPrototypeOf(n())}})}var Yf=G(()=>B({$field:F().describe(`Field Reference/Column Name`)}));G(()=>B({$eq:Zd().optional(),$ne:Zd().optional()})),G(()=>B({$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional()})),G(()=>B({$in:z(Zd()).optional(),$nin:z(Zd()).optional()})),G(()=>B({$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional()})),G(()=>B({$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional()})),G(()=>B({$null:L().optional(),$exists:L().optional()}));var Xf=G(()=>B({$eq:Zd().optional(),$ne:Zd().optional(),$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional(),$in:z(Zd()).optional(),$nin:z(Zd()).optional(),$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional(),$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional(),$null:L().optional(),$exists:L().optional()})),Zf=zf(()=>H(F(),R()).and(B({$and:z(Zf).optional(),$or:z(Zf).optional(),$not:Zf.optional()})));G(()=>B({where:Zf.optional()}));var Qf=zf(()=>B({$and:z(V([H(F(),Xf),Qf])).optional(),$or:z(V([H(F(),Xf),Qf])).optional(),$not:V([H(F(),Xf),Qf]).optional()})),$f=new Set([`=`,`==`,`!=`,`<>`,`>`,`>=`,`<`,`<=`,`in`,`nin`,`not_in`,`contains`,`notcontains`,`not_contains`,`like`,`startswith`,`starts_with`,`endswith`,`ends_with`,`between`,`is_null`,`is_not_null`]);function ep(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];if(typeof t==`string`){let n=t.toLowerCase();if(n===`and`||n===`or`)return e.length>=2&&e.slice(1).every(e=>ep(e));if(e.length>=2&&typeof e[1]==`string`)return $f.has(e[1].toLowerCase())}return e.every(e=>ep(e))?e.length>0:!1}var tp=[`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`,`$in`,`$nin`,`$between`,`$contains`,`$notContains`,`$startsWith`,`$endsWith`,`$null`,`$exists`],np=[`$and`,`$or`,`$not`];[...tp,...np];var rp=G(()=>B({field:F(),order:U([`asc`,`desc`]).default(`asc`)})),ip=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`array_agg`,`string_agg`]),ap=U([`day`,`week`,`month`,`quarter`,`year`]),op=G(()=>V([F(),B({field:F().describe(`Field to group by`),dateGranularity:ap.optional().describe(`Bucket date values into uniform periods (day/week/month/quarter/year)`),alias:F().optional().describe(`Alias for the projected group value`)})])),sp=G(()=>B({function:ip.describe(`Aggregation function`),field:F().optional().describe(`Field to aggregate (optional for COUNT(*))`),alias:F().describe(`Result column alias`),distinct:L().optional().describe(`Apply DISTINCT before aggregation`),filter:Zf.optional().describe(`Filter/Condition to apply to the aggregation (FILTER WHERE clause)`)})),cp=U([`inner`,`left`,`right`,`full`]),lp=U([`auto`,`database`,`hash`,`loop`]),up=zf(()=>B({type:cp.describe(`Join type`),strategy:lp.optional().describe(`Execution strategy hint`),object:F().describe(`Object/table to join`),alias:F().optional().describe(`Table alias`),on:Zf.describe(`Join condition`),subquery:zf(()=>_p).optional().describe(`Subquery instead of object`)})),dp=U([`row_number`,`rank`,`dense_rank`,`percent_rank`,`lag`,`lead`,`first_value`,`last_value`,`sum`,`avg`,`count`,`min`,`max`]),fp=G(()=>B({partitionBy:z(F()).optional().describe(`PARTITION BY fields`),orderBy:z(rp).optional().describe(`ORDER BY specification`),frame:B({type:U([`rows`,`range`]).optional(),start:F().optional().describe(`Frame start (e.g., "UNBOUNDED PRECEDING", "1 PRECEDING")`),end:F().optional().describe(`Frame end (e.g., "CURRENT ROW", "1 FOLLOWING")`)}).optional().describe(`Window frame specification`)})),pp=G(()=>B({function:dp.describe(`Window function name`),field:F().optional().describe(`Field to operate on (for aggregate window functions)`),alias:F().describe(`Result column alias`),over:fp.describe(`Window specification (OVER clause)`)})),mp=zf(()=>V([F(),B({field:F(),fields:z(mp).optional(),alias:F().optional()})])),hp=G(()=>B({query:F().describe(`Search query text`),fields:z(F()).optional().describe(`Fields to search in (if not specified, searches all text fields)`),fuzzy:L().optional().default(!1).describe(`Enable fuzzy matching (tolerates typos)`),operator:U([`and`,`or`]).optional().default(`or`).describe(`Logical operator between terms`),boost:H(F(),I()).optional().describe(`Field-specific relevance boosting (field name -> boost factor)`),minScore:I().optional().describe(`Minimum relevance score threshold`),language:F().optional().describe(`Language for text analysis (e.g., "en", "zh", "es")`),highlight:L().optional().default(!1).describe(`Enable search result highlighting`)})),gp=B({object:F().describe(`Object name (e.g. account)`),fields:z(mp).optional().describe(`Fields to retrieve`),where:Zf.optional().describe(`Filtering criteria (WHERE)`),search:hp.optional().describe(`Full-text search configuration ($search parameter)`),orderBy:z(rp).optional().describe(`Sorting instructions (ORDER BY)`),limit:I().optional().describe(`Max records to return (LIMIT)`),offset:I().optional().describe(`Records to skip (OFFSET)`),top:I().optional().describe(`Alias for limit (OData compatibility)`),cursor:H(F(),R()).optional().describe(`Cursor for keyset pagination`),joins:z(up).optional().describe(`Explicit Table Joins`),aggregations:z(sp).optional().describe(`Aggregation functions`),groupBy:z(op).optional().describe("GROUP BY targets (strings or `{field, dateGranularity?}` objects for date bucketing)"),having:Zf.optional().describe(`HAVING clause for aggregation filtering`),windowFunctions:z(pp).optional().describe(`Window functions with OVER clause`),distinct:L().optional().describe(`SELECT DISTINCT flag`)}),_p=G(()=>gp.extend({expand:zf(()=>H(F(),_p)).optional().describe(`Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select, filter, sort, and further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3.`)})),vp=[`today`,`yesterday`,`tomorrow`,`now`],yp=[`current_week_start`,`current_week_end`,`current_month_start`,`current_month_end`,`current_quarter_start`,`current_quarter_end`,`current_year_start`,`current_year_end`,`last_week_start`,`last_week_end`,`last_month_start`,`last_month_end`,`last_quarter_start`,`last_quarter_end`,`last_year_start`,`last_year_end`,`next_week_start`,`next_week_end`,`next_month_start`,`next_month_end`,`next_quarter_start`,`next_quarter_end`,`next_year_start`,`next_year_end`],bp=[`week_start`,`week_end`,`month_start`,`month_end`,`quarter_start`,`quarter_end`,`year_start`,`year_end`],xp=[...vp,...yp,...bp],Sp=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,Cp=[`minute`,`hour`,`day`,`week`,`month`,`year`];function wp(e){return xp.includes(e)||Sp.test(e)}F().refine(wp,{message:`Unknown date macro. Must be a fixed token (see DATE_MACRO_TOKENS) or match {N_<unit>_(ago|from_now)} where unit is one of: `+Cp.join(`, `)});var Tp=/^\$?\{([a-zA-Z0-9_]+)\}$/;F().refine(e=>{let t=e.match(Tp);return!!t&&wp(t[1])},{message:`Not a recognised {date-macro} placeholder`});var Ep=G(()=>F().min(2,{message:`System identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")`}).describe(`System identifier (lowercase with underscores or dots)`)),Dp=G(()=>F().min(2,{message:`Identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_]*$/,{message:`Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")`}).describe(`Snake case identifier (lowercase with underscores only)`));G(()=>F().min(3,{message:`Event name must be at least 3 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")`}).describe(`Event name (lowercase with dot notation for namespacing)`));var Op=U([`cel`,`js`,`cron`,`template`]),kp=B({rationale:F().optional(),generatedBy:F().optional()}),Ap=B({dialect:Op,source:F().min(1).optional(),ast:R().optional(),meta:kp.optional()}).refine(e=>e.source!==void 0||e.ast!==void 0,{message:"Expression requires at least one of `source` or `ast`"}),jp=V([F().min(1).transform(e=>({dialect:`cel`,source:e})),Ap]);V([F().min(1).transform(e=>({dialect:`cron`,source:e})),Ap]);var Mp=V([F().min(1).transform(e=>({dialect:`template`,source:e})),Ap]),Np=G(()=>U([`aes-256-gcm`,`aes-256-cbc`,`chacha20-poly1305`]).describe(`Supported encryption algorithm`)),Pp=G(()=>U([`local`,`aws-kms`,`azure-key-vault`,`gcp-kms`,`hashicorp-vault`]).describe(`Key management service provider`)),Fp=G(()=>B({enabled:L().default(!1).describe(`Enable automatic key rotation`),frequencyDays:I().min(1).default(90).describe(`Rotation frequency in days`),retainOldVersions:I().default(3).describe(`Number of old key versions to retain`),autoRotate:L().default(!0).describe(`Automatically rotate without manual approval`)}).describe(`Policy for automatic encryption key rotation`)),Ip=G(()=>B({enabled:L().default(!1).describe(`Enable field-level encryption`),algorithm:Np.default(`aes-256-gcm`).describe(`Encryption algorithm`),keyManagement:B({provider:Pp.describe(`Key management service provider`),keyId:F().optional().describe(`Key identifier in the provider`),rotationPolicy:Fp.optional().describe(`Key rotation policy`)}).describe(`Key management configuration`),scope:U([`field`,`record`,`table`,`database`]).describe(`Encryption scope level`),deterministicEncryption:L().default(!1).describe(`Allows equality queries on encrypted data`),searchableEncryption:L().default(!1).describe(`Allows search on encrypted data`)}).describe(`Field-level encryption configuration`));G(()=>B({fieldName:F().describe(`Name of the field to encrypt`),encryptionConfig:Ip.describe(`Encryption settings for this field`),indexable:L().default(!1).describe(`Allow indexing on encrypted field`)}).describe(`Per-field encryption assignment`));var Lp=G(()=>U([`redact`,`partial`,`hash`,`tokenize`,`randomize`,`nullify`,`substitute`]).describe(`Data masking strategy for PII protection`)),Rp=G(()=>B({field:F().describe(`Field name to apply masking to`),strategy:Lp.describe(`Masking strategy to use`),pattern:F().optional().describe(`Regex pattern for partial masking`),preserveFormat:L().default(!0).describe(`Keep the original data format after masking`),preserveLength:L().default(!0).describe(`Keep the original data length after masking`),roles:z(F()).optional().describe(`Roles that see masked data`),exemptRoles:z(F()).optional().describe(`Roles that see unmasked data`)}).describe(`Masking rule for a single field`));G(()=>B({enabled:L().default(!1).describe(`Enable data masking`),rules:z(Rp).describe(`List of field-level masking rules`),auditUnmasking:L().default(!0).describe(`Log when masked data is accessed unmasked`)}).describe(`Top-level data masking configuration for PII protection`));var zp=U(`text.textarea.email.url.phone.password.secret.markdown.html.richtext.number.currency.percent.date.datetime.time.boolean.toggle.select.multiselect.radio.checkboxes.lookup.master_detail.tree.image.file.avatar.video.audio.formula.summary.autonumber.composite.repeater.record.location.address.code.json.color.rating.slider.signature.qrcode.progress.tags.vector`.split(`.`)),Bp=G(()=>B({label:F().describe(`Display label (human-readable, any case allowed)`),value:Ep.describe(`Stored value (lowercase machine identifier)`),color:F().optional().describe(`Color code for badges/charts`),default:L().optional().describe(`Is default option`)}));G(()=>B({latitude:I().min(-90).max(90).describe(`Latitude coordinate`),longitude:I().min(-180).max(180).describe(`Longitude coordinate`),altitude:I().optional().describe(`Altitude in meters`),accuracy:I().optional().describe(`Accuracy in meters`)}));var Vp=G(()=>B({precision:I().int().min(0).max(10).default(2).describe(`Decimal precision (default: 2)`),currencyMode:U([`dynamic`,`fixed`]).default(`dynamic`).describe(`Currency mode: dynamic (user selectable) or fixed (single currency)`),defaultCurrency:F().length(3).default(`CNY`).describe(`Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)`)}));G(()=>B({value:I().describe(`Monetary amount`),currency:F().length(3).describe(`Currency code (ISO 4217)`)})),G(()=>B({street:F().optional().describe(`Street address`),city:F().optional().describe(`City name`),state:F().optional().describe(`State/Province`),postalCode:F().optional().describe(`Postal/ZIP code`),country:F().optional().describe(`Country name or code`),countryCode:F().optional().describe(`ISO country code (e.g., US, GB)`),formatted:F().optional().describe(`Formatted address string`)}));var Hp=G(()=>B({dimensions:I().int().min(1).max(1e4).describe(`Vector dimensionality (e.g., 1536 for OpenAI embeddings)`),distanceMetric:U([`cosine`,`euclidean`,`dotProduct`,`manhattan`]).default(`cosine`).describe(`Distance/similarity metric for vector search`),normalized:L().default(!1).describe(`Whether vectors are normalized (unit length)`),indexed:L().default(!0).describe(`Whether to create a vector index for fast similarity search`),indexType:U([`hnsw`,`ivfflat`,`flat`]).optional().describe(`Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)`)})),Up=G(()=>B({minSize:I().min(0).optional().describe(`Minimum file size in bytes`),maxSize:I().min(1).optional().describe(`Maximum file size in bytes (e.g., 10485760 = 10MB)`),allowedTypes:z(F()).optional().describe(`Allowed file extensions (e.g., [".pdf", ".docx", ".jpg"])`),blockedTypes:z(F()).optional().describe(`Blocked file extensions (e.g., [".exe", ".bat", ".sh"])`),allowedMimeTypes:z(F()).optional().describe(`Allowed MIME types (e.g., ["image/jpeg", "application/pdf"])`),blockedMimeTypes:z(F()).optional().describe(`Blocked MIME types`),virusScan:L().default(!1).describe(`Enable virus scanning for uploaded files`),virusScanProvider:U([`clamav`,`virustotal`,`metadefender`,`custom`]).optional().describe(`Virus scanning service provider`),virusScanOnUpload:L().default(!0).describe(`Scan files immediately on upload`),quarantineOnThreat:L().default(!0).describe(`Quarantine files if threat detected`),storageProvider:F().optional().describe(`Object storage provider name (references ObjectStorageConfig)`),storageBucket:F().optional().describe(`Target bucket name`),storagePrefix:F().optional().describe(`Storage path prefix (e.g., "uploads/documents/")`),imageValidation:B({minWidth:I().min(1).optional().describe(`Minimum image width in pixels`),maxWidth:I().min(1).optional().describe(`Maximum image width in pixels`),minHeight:I().min(1).optional().describe(`Minimum image height in pixels`),maxHeight:I().min(1).optional().describe(`Maximum image height in pixels`),aspectRatio:F().optional().describe(`Required aspect ratio (e.g., "16:9", "1:1")`),generateThumbnails:L().default(!1).describe(`Auto-generate thumbnails`),thumbnailSizes:z(B({name:F().describe(`Thumbnail variant name (e.g., "small", "medium", "large")`),width:I().min(1).describe(`Thumbnail width in pixels`),height:I().min(1).describe(`Thumbnail height in pixels`),crop:L().default(!1).describe(`Crop to exact dimensions`)})).optional().describe(`Thumbnail size configurations`),preserveMetadata:L().default(!1).describe(`Preserve EXIF metadata`),autoRotate:L().default(!0).describe(`Auto-rotate based on EXIF orientation`)}).optional().describe(`Image-specific validation rules`),allowMultiple:L().default(!1).describe(`Allow multiple file uploads (overrides field.multiple)`),allowReplace:L().default(!0).describe(`Allow replacing existing files`),allowDelete:L().default(!0).describe(`Allow deleting uploaded files`),requireUpload:L().default(!1).describe(`Require at least one file when field is required`),extractMetadata:L().default(!0).describe(`Extract file metadata (name, size, type, etc.)`),extractText:L().default(!1).describe(`Extract text content from documents (OCR/parsing)`),versioningEnabled:L().default(!1).describe(`Keep previous versions of replaced files`),maxVersions:I().min(1).optional().describe(`Maximum number of versions to retain`),publicRead:L().default(!1).describe(`Allow public read access to uploaded files`),presignedUrlExpiry:I().min(60).max(604800).default(3600).describe(`Presigned URL expiration in seconds (default: 1 hour)`)}).refine(e=>!(e.minSize!==void 0&&e.maxSize!==void 0&&e.minSize>e.maxSize),{message:`minSize must be less than or equal to maxSize`}).refine(e=>!(e.virusScanProvider!==void 0&&e.virusScan!==!0),{message:`virusScanProvider requires virusScan to be enabled`})),Wp=G(()=>B({uniqueness:L().default(!1).describe(`Enforce unique values across all records`),completeness:I().min(0).max(1).default(0).describe(`Minimum ratio of non-null values (0-1, default: 0 = no requirement)`),accuracy:B({source:F().describe(`Reference data source for validation (e.g., "api.verify.com", "master_data")`),threshold:I().min(0).max(1).describe(`Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)`)}).optional().describe(`Accuracy validation configuration`)})),Gp=G(()=>B({enabled:L().describe(`Enable caching for computed field results`),ttl:I().min(0).describe(`Cache TTL in seconds (0 = no expiration)`),invalidateOn:z(F()).describe(`Field paths that invalidate cache (e.g., ["inventory.quantity", "pricing.base_price"])`)})),Kp=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine name (snake_case)`).optional(),label:F().optional().describe(`Human readable label`),type:zp.describe(`Field Data Type`),description:F().optional().describe(`Tooltip/Help text`),format:F().optional().describe(`Format string (e.g. email, phone)`),columnName:F().optional().describe(`Physical column name in the target datasource. Defaults to the field key when not set.`),required:L().default(!1).describe(`Is required`),searchable:L().default(!1).describe(`Is searchable`),multiple:L().default(!1).describe(`Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.`),unique:L().default(!1).describe(`Is unique constraint`),defaultValue:R().optional().describe(`Default value`),maxLength:I().optional().describe(`Max character length`),minLength:I().optional().describe(`Min character length`),precision:I().optional().describe(`Total digits`),scale:I().optional().describe(`Decimal places`),min:I().optional().describe(`Minimum value`),max:I().optional().describe(`Maximum value`),options:z(Bp).optional().describe(`Static options for select/multiselect`),reference:F().optional().describe(`Target object name (snake_case) for lookup/master_detail fields. Required for relationship types. Used by $expand to resolve foreign key IDs into full objects.`),referenceFilters:z(F()).optional().describe(`Filters applied to lookup dialogs (e.g. "active = true")`),writeRequiresMasterRead:L().optional().describe(`If true, user needs read access to master record to edit this field`),deleteBehavior:U([`set_null`,`cascade`,`restrict`]).optional().default(`set_null`).describe(`What happens if referenced record is deleted`),inlineEdit:V([L(),U([`grid`,`form`])]).optional().describe(`Edit these child records inline within the parent's form (atomic master-detail). true = auto-pick grid/form by child shape; 'grid' = editable line-item grid; 'form' = list + per-row full form.`),inlineTitle:F().optional().describe(`Title for the inline master-detail grid`),inlineColumns:z(Zd()).optional().describe(`Explicit columns for the inline grid (derived from the child object when omitted)`),inlineAmountField:F().optional().describe(`Numeric child field summed for the inline grid total`),relatedList:L().optional().describe(`Show this child collection as a related list on the parent's detail page (read-side mirror of inlineEdit). Defaults to shown for master_detail/lookup; set false to suppress.`),relatedListTitle:F().optional().describe(`Title for the detail-page related list`),relatedListColumns:z(Zd()).optional().describe(`Explicit columns for the detail-page related list (derived from the child object when omitted)`),expression:jp.optional().describe("Formula expression (CEL). e.g. F`record.amount * 0.1`"),summaryOperations:B({object:F().describe(`Source child object name for roll-up`),field:F().describe(`Field on child object to aggregate (ignored for count)`),function:U([`count`,`sum`,`min`,`max`,`avg`]).describe(`Aggregation function to apply`),relationshipField:F().optional().describe(`FK field on the child pointing back to this parent. Auto-detected from the child's lookup/master_detail field referencing this object when omitted; set explicitly only when the child has more than one such reference.`)}).optional().describe(`Roll-up summary definition. The engine recomputes the value when child records are inserted/updated/deleted.`),language:F().optional().describe(`Programming language for syntax highlighting (e.g., javascript, python, sql)`),theme:F().optional().describe(`Code editor theme (e.g., dark, light, monokai)`),lineNumbers:L().optional().describe(`Show line numbers in code editor`),maxRating:I().optional().describe(`Maximum rating value (default: 5)`),allowHalf:L().optional().describe(`Allow half-star ratings`),displayMap:L().optional().describe(`Display map widget for location field`),allowGeocoding:L().optional().describe(`Allow address-to-coordinate conversion`),addressFormat:U([`us`,`uk`,`international`]).optional().describe(`Address format template`),colorFormat:U([`hex`,`rgb`,`rgba`,`hsl`]).optional().describe(`Color value format`),allowAlpha:L().optional().describe(`Allow transparency/alpha channel`),presetColors:z(F()).optional().describe(`Preset color options`),step:I().optional().describe(`Step increment for slider (default: 1)`),showValue:L().optional().describe(`Display current value on slider`),marks:H(F(),F()).optional().describe(`Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})`),barcodeFormat:U([`qr`,`ean13`,`ean8`,`code128`,`code39`,`upca`,`upce`]).optional().describe(`Barcode format type`),qrErrorCorrection:U([`L`,`M`,`Q`,`H`]).optional().describe(`QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"`),displayValue:L().optional().describe(`Display human-readable value below barcode/QR code`),allowScanning:L().optional().describe(`Enable camera scanning for barcode/QR code input`),currencyConfig:Vp.optional().describe(`Configuration for currency field type`),vectorConfig:Hp.optional().describe(`Configuration for vector field type (AI/ML embeddings)`),fileAttachmentConfig:Up.optional().describe(`Configuration for file and attachment field types`),encryptionConfig:Ip.optional().describe(`Field-level encryption configuration for sensitive data (GDPR/HIPAA/PCI-DSS)`),maskingRule:Rp.optional().describe(`Data masking rules for PII protection`),auditTrail:L().default(!1).describe(`Enable detailed audit trail for this field (tracks all changes with user and timestamp)`),dependencies:z(F()).optional().describe(`Array of field names that this field depends on (for formulas, visibility rules, etc.)`),cached:Gp.optional().describe(`Caching configuration for computed/formula fields`),dataQuality:Wp.optional().describe(`Data quality validation and monitoring rules`),group:F().optional().describe(`Field group name for organizing fields in forms and layouts (e.g., "contact_info", "billing", "system")`),visibleWhen:jp.optional().describe("Predicate (CEL) — field is shown only when TRUE (else hidden). e.g. P`record.type == 'invoice'`"),readonlyWhen:jp.optional().describe("Predicate (CEL) — field is read-only when TRUE. e.g. P`record.status == 'paid'`"),requiredWhen:jp.optional().describe("Predicate (CEL) — field is required when TRUE. Canonical name for `conditionalRequired`."),conditionalRequired:jp.optional().describe("Predicate (CEL) — field is required when TRUE. Alias of `requiredWhen`."),hidden:L().default(!1).describe(`Hidden from default UI`),readonly:L().default(!1).describe(`Read-only in UI`),system:L().optional().describe(`Auto-injected system/audit field (e.g. created_at, updated_by, organization_id). Tools that surface system fields separately from author-declared business fields should branch on this flag.`),sortable:L().optional().default(!0).describe(`Whether field is sortable in list views`),inlineHelpText:F().optional().describe(`Help text displayed below the field in forms`),trackFeedHistory:L().optional().describe(`Track field changes in Chatter/activity feed (Salesforce pattern)`),caseSensitive:L().optional().describe(`Whether text comparisons are case-sensitive`),autonumberFormat:F().optional().describe(`Auto-number display format pattern (e.g., "CASE-{0000}")`),index:L().default(!1).describe(`Create standard database index`),externalId:L().default(!1).describe(`Is external ID for upsert operations`)})),qp=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique rule name (snake_case)`),label:F().optional().describe(`Human-readable label for the rule listing`),description:F().optional().describe(`Administrative notes explaining the business reason`),active:L().default(!0),events:z(U([`insert`,`update`,`delete`])).default([`insert`,`update`]).describe(`Validation contexts`),priority:I().int().min(0).max(9999).default(100).describe(`Execution priority (lower runs first, default: 100)`),tags:z(F()).optional().describe(`Categorization tags (e.g., "compliance", "billing")`),severity:U([`error`,`warning`,`info`]).default(`error`),message:F().describe(`Error message to display to the user`)}),Jp=G(()=>qp.extend({type:W(`script`),condition:jp.describe("Predicate (CEL). If TRUE, validation fails. e.g. P`record.amount < 0`")})),Yp=G(()=>qp.extend({type:W(`state_machine`),field:F().describe(`State field (e.g. status)`),transitions:H(F(),z(F())).describe(`Map of { OldState: [AllowedNewStates] }`)})),Xp=G(()=>qp.extend({type:W(`format`),field:F(),regex:F().optional(),format:U([`email`,`url`,`phone`,`json`]).optional()})),Zp=G(()=>qp.extend({type:W(`cross_field`),condition:jp.describe("Predicate (CEL) comparing fields. e.g. P`record.end_date > record.start_date`"),fields:z(F()).describe(`Fields involved in the validation`)})),Qp=G(()=>qp.extend({type:W(`json_schema`),field:F().describe(`JSON field to validate`),schema:H(F(),R()).describe(`JSON Schema object definition`)})),$p=zf(()=>uf(`type`,[Jp,Yp,Xp,Zp,Qp,em])),em=G(()=>qp.extend({type:W(`conditional`),when:jp.describe("Predicate (CEL). e.g. P`record.type == 'enterprise'`"),then:$p.describe(`Validation rule to apply when condition is true`),otherwise:$p.optional().describe(`Validation rule to apply when condition is false`)}));G(()=>B({key:F().describe(`Translation key (e.g., "views.task_list.label")`),defaultValue:F().optional().describe(`Fallback value when translation key is not found`),params:H(F(),V([F(),I(),L()])).optional().describe(`Interpolation parameters (e.g., { count: 5 })`)}));var tm=G(()=>F().describe(`Display label (plain string; i18n keys are auto-generated by the framework)`)),nm=G(()=>B({ariaLabel:tm.optional().describe(`Accessible label for screen readers (WAI-ARIA aria-label)`),ariaDescribedBy:F().optional().describe(`ID of element providing additional description (WAI-ARIA aria-describedby)`),role:F().optional().describe(`WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")`)}).describe(`ARIA accessibility attributes`));G(()=>B({key:F().describe(`Translation key`),zero:F().optional().describe(`Zero form (e.g., "No items")`),one:F().optional().describe(`Singular form (e.g., "{count} item")`),two:F().optional().describe(`Dual form (e.g., "{count} items" for exactly 2)`),few:F().optional().describe(`Few form (e.g., for 2-4 in some languages)`),many:F().optional().describe(`Many form (e.g., for 5+ in some languages)`),other:F().describe(`Default plural form (e.g., "{count} items")`)}).describe(`ICU plural rules for a translation key`));var rm=G(()=>B({style:U([`decimal`,`currency`,`percent`,`unit`]).default(`decimal`).describe(`Number formatting style`),currency:F().optional().describe(`ISO 4217 currency code (e.g., "USD", "EUR")`),unit:F().optional().describe(`Unit for unit formatting (e.g., "kilometer", "liter")`),minimumFractionDigits:I().optional().describe(`Minimum number of fraction digits`),maximumFractionDigits:I().optional().describe(`Maximum number of fraction digits`),useGrouping:L().optional().describe(`Whether to use grouping separators (e.g., 1,000)`)}).describe(`Number formatting rules`)),im=G(()=>B({dateStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Date display style`),timeStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Time display style`),timeZone:F().optional().describe(`IANA time zone (e.g., "America/New_York")`),hour12:L().optional().describe(`Use 12-hour format`)}).describe(`Date/time formatting rules`));G(()=>B({code:F().describe(`BCP 47 language code (e.g., "en-US", "zh-CN")`),fallbackChain:z(F()).optional().describe(`Fallback language codes in priority order (e.g., ["zh-TW", "en"])`),direction:U([`ltr`,`rtl`]).default(`ltr`).describe(`Text direction: left-to-right or right-to-left`),numberFormat:rm.optional().describe(`Default number formatting rules`),dateFormat:im.optional().describe(`Default date/time formatting rules`)}).describe(`Locale configuration`));var am=U([`api.read`,`api.write`,`crypto.uuid`,`crypto.hash`,`log`]),om=uf(`language`,[B({language:W(`expression`),source:F().min(1).describe(`Formula expression source`)}).describe(`L1 expression body — pure formula, no IO`),B({language:W(`js`),source:F().min(1).describe(`Function body source`),capabilities:z(am).default([]).describe(`Granted capability tokens`),timeoutMs:I().int().positive().max(3e4).optional().describe(`Per-invocation timeout (ms)`),memoryMb:I().int().positive().max(256).optional().describe(`Per-invocation memory cap (MB)`)}).describe(`L2 sandboxed JS body — runs inside an isolated VM with declared capabilities`)]).describe(`Hook/Action body — expression (L1) or sandboxed JS (L2)`),sm=G(()=>B({name:F().optional(),field:Dp.optional(),objectOverride:Dp.optional(),label:tm.optional(),type:zp.optional(),required:L().optional().default(!1),options:z(B({label:tm,value:F()})).optional(),placeholder:F().optional(),helpText:F().optional(),defaultValue:R().optional(),defaultFromRow:L().optional()}).refine(e=>!!e.name||!!e.field,{message:`ActionParam requires either "name" or "field"`})),cm=U([`script`,`url`,`modal`,`flow`,`api`,`form`]),lm=new Set(cm.options.filter(e=>e!==`script`)),um=U([`list_toolbar`,`list_item`,`record_header`,`record_more`,`record_related`,`record_section`,`global_nav`]),dm=U([`data`,`action`,`flow`,`integration`,`vector_search`,`analytics`,`utility`]),fm=B({exposed:L().default(!1).describe("Expose this action to AI agents. Requires `description` when true."),description:F().min(40).optional().describe(`LLM-facing description (≥40 chars). Required when exposed.`),category:dm.optional().describe(`Tool category override (defaults to "action").`),paramHints:H(F(),B({description:F().optional(),enum:z(V([F(),I()])).optional(),examples:z(R()).optional()})).optional().describe(`Per-parameter AI hints keyed by param name.`),outputSchema:H(F(),R()).optional().describe(`JSON Schema for the action return value.`),requiresConfirmation:L().optional().describe(`Override HITL confirmation for AI invocations.`)}),pm=G(()=>B({name:Dp.describe(`Machine name (lowercase snake_case)`),label:tm.describe(`Display label`),objectName:F().regex(/^[a-z_][a-z0-9_]*$/).optional().describe(`Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack().`),icon:F().optional().describe(`Icon name`),locations:z(um).optional().describe(`Locations where this action is visible`),component:U([`action:button`,`action:icon`,`action:menu`,`action:group`]).optional().describe(`Visual component override`),type:cm.default(`script`).describe(`Action functionality type`),target:F().optional().describe("URL, Script Name, Flow ID, or API Endpoint. Supports ${param.X} and ${ctx.X} interpolation."),body:om.optional().describe("Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`."),execute:F().optional().describe(`@deprecated — Use target instead. Auto-migrated to target during parsing.`),params:z(sm).optional().describe(`Input parameters required from user`),variant:U([`primary`,`secondary`,`danger`,`ghost`,`link`]).optional().describe(`Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)`),confirmText:tm.optional().describe(`Confirmation message before execution`),successMessage:tm.optional().describe(`Success message to show after execution`),refreshAfter:L().default(!1).describe(`Refresh view after execution`),resultDialog:B({title:tm.optional(),description:tm.optional(),acknowledge:tm.optional().describe(`Acknowledge button label, e.g. "I have saved this"`),format:U([`qrcode`,`code-list`,`secret`,`text`,`json`]).optional().describe(`Default format for fields without their own format. Defaults to json when omitted.`),fields:z(B({path:F().describe(`Dot path into result.data (e.g. "totpURI", "client.client_secret").`),label:tm.optional(),format:U([`qrcode`,`code-list`,`secret`,`text`,`json`]).optional().describe(`Per-field format override.`)})).optional().describe(`Which fields from result.data to render. Omit to dump full JSON.`)}).optional().describe(`Render API response in a one-shot reveal dialog (suppresses successMessage when set).`),visible:jp.optional().describe(`Visibility predicate (CEL).`),disabled:V([L(),jp]).optional().describe(`Boolean or predicate (CEL) — action is disabled when TRUE.`),shortcut:F().optional().describe(`Keyboard shortcut to trigger this action (e.g., "Ctrl+S")`),bulkEnabled:L().optional().describe(`Whether this action can be applied to multiple selected records`),ai:fm.optional().describe(`AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents.`),recordIdParam:F().optional().describe(`Body key to inject the row id into when running from a list_item context.`),recordIdField:F().optional().describe(`Row field whose value seeds recordIdParam. Defaults to "id".`),bodyShape:V([W(`flat`),B({wrap:F()})]).optional().describe(`Body wrapping: flat (default) or { wrap: key } to nest user-collected params under a key.`),method:U([`POST`,`PATCH`,`PUT`,`DELETE`]).optional().describe(`HTTP method for type:"api" actions. Defaults to POST.`),bodyExtra:H(F(),R()).optional().describe(`Constant body fields merged into the API request (applied last; overrides user params).`),mode:U([`create`,`edit`,`delete`,`custom`]).optional().describe(`Semantic mode of the action.`),timeout:I().optional().describe(`Maximum execution time in milliseconds for the action`),aria:nm.optional().describe(`ARIA accessibility attributes`)}).transform(e=>e.execute&&!e.target?{...e,target:e.execute}:e).refine(e=>!(lm.has(e.type)&&!e.target),{message:`Action 'target' is required when type is 'url', 'flow', 'modal', 'api', or 'form'.`,path:[`target`]}).refine(e=>!(e.ai?.exposed===!0&&!e.ai.description),{message:`ai.description is required (≥40 chars) when ai.exposed is true.`,path:[`ai`,`description`]}).refine(e=>{let t=e.ai?.paramHints;if(!t)return!0;let n=new Set([`recordId`]);for(let t of e.params??[]){let e=t.name??t.field;e&&n.add(e)}return Object.keys(t).every(e=>n.has(e))},{message:`ai.paramHints keys must match a declared param name (or "recordId").`,path:[`ai`,`paramHints`]})),mm=U([`none`,`no-overlay`,`no-delete`,`full`]),hm=U([`artifact`,`package`,`env-forced`]),gm=U([`package`,`org`,`env-forced`]),_m={_lock:mm.optional().describe(`Item-level lock — controls overlay & delete (ADR-0010).`),_lockReason:F().max(500).optional().describe(`Human-readable reason shown when a write is refused by _lock.`),_lockSource:hm.optional().describe(`Layer that set _lock (artifact | package | env-forced).`),_provenance:gm.optional().describe(`Origin of the item (package | org | env-forced).`),_packageId:F().optional().describe(`Owning package machine id.`),_packageVersion:F().optional().describe(`Owning package version.`),_lockDocsUrl:F().optional().describe(`Optional documentation link surfaced next to _lockReason.`)},vm=B({lock:mm.describe(`Lock policy — none | no-overlay | no-delete | full.`),reason:F().min(1).max(500).describe(`User-visible reason shown when the lock blocks an action.`),docsUrl:F().url().optional().describe(`Optional URL the Studio banner links to for more context.`)}).strict(),ym=G(()=>B({enabled:L().default(!1).describe(`Enable public sharing`),publicLink:F().optional().describe(`Generated public share URL`),password:F().optional().describe(`Password required to access shared link`),allowedDomains:z(F()).optional().describe(`Restrict access to specific email domains (e.g. ["example.com"])`),expiresAt:F().optional().describe(`Expiration date/time in ISO 8601 format`),allowAnonymous:L().optional().default(!1).describe(`Allow access without authentication`)}));G(()=>B({enabled:L().default(!1).describe(`Enable iframe embedding`),allowedOrigins:z(F()).optional().describe(`Allowed iframe parent origins (e.g. ["https://example.com"])`),width:F().optional().default(`100%`).describe(`Embed width (CSS value)`),height:F().optional().default(`600px`).describe(`Embed height (CSS value)`),showHeader:L().optional().default(!0).describe(`Show interface header in embed`),showNavigation:L().optional().default(!1).describe(`Show navigation in embed`),responsive:L().optional().default(!0).describe(`Enable responsive resizing`)}));var bm=U([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),xm=G(()=>B({xs:I().min(1).max(12).optional(),sm:I().min(1).max(12).optional(),md:I().min(1).max(12).optional(),lg:I().min(1).max(12).optional(),xl:I().min(1).max(12).optional(),"2xl":I().min(1).max(12).optional()}).describe(`Grid columns per breakpoint (1-12)`)),Sm=G(()=>B({xs:I().optional(),sm:I().optional(),md:I().optional(),lg:I().optional(),xl:I().optional(),"2xl":I().optional()}).describe(`Display order per breakpoint`)),Cm=G(()=>B({breakpoint:bm.optional().describe(`Minimum breakpoint for visibility`),hiddenOn:z(bm).optional().describe(`Hide on these breakpoints`),columns:xm.optional().describe(`Grid columns per breakpoint`),order:Sm.optional().describe(`Display order per breakpoint`)}).describe(`Responsive layout configuration`)),wm=G(()=>B({lazyLoad:L().optional().describe(`Enable lazy loading (defer rendering until visible)`),virtualScroll:B({enabled:L().default(!1).describe(`Enable virtual scrolling`),itemHeight:I().optional().describe(`Fixed item height in pixels (for estimation)`),overscan:I().optional().describe(`Number of extra items to render outside viewport`)}).optional().describe(`Virtual scrolling configuration`),cacheStrategy:U([`none`,`cache-first`,`network-first`,`stale-while-revalidate`]).optional().describe(`Client-side data caching strategy`),prefetch:L().optional().describe(`Prefetch data before component is visible`),pageSize:I().optional().describe(`Number of items per page for pagination`),debounceMs:I().optional().describe(`Debounce interval for user interactions in milliseconds`)}).describe(`Performance optimization configuration`)),Tm=U([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`]),Em=G(()=>U([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`])),Dm=G(()=>B({url:F().describe(`API endpoint URL`),method:Em.optional().default(`GET`).describe(`HTTP method`),headers:H(F(),F()).optional().describe(`Custom HTTP headers`),params:H(F(),R()).optional().describe(`Query parameters`),body:R().optional().describe(`Request body for POST/PUT/PATCH`)}));G(()=>B({enabled:L().default(!0).describe(`Enable CORS`),origins:V([F(),z(F())]).default(`*`).describe(`Allowed origins (* for all)`),methods:z(Tm).optional().describe(`Allowed HTTP methods`),credentials:L().default(!1).describe(`Allow credentials (cookies, authorization headers)`),maxAge:I().int().optional().describe(`Preflight cache duration in seconds`)})),G(()=>B({enabled:L().default(!1).describe(`Enable rate limiting`),windowMs:I().int().default(6e4).describe(`Time window in milliseconds`),maxRequests:I().int().default(100).describe(`Max requests per window`)})),G(()=>B({path:F().describe(`URL path to serve from`),directory:F().describe(`Physical directory to serve`),cacheControl:F().optional().describe(`Cache-Control header value`)}));var Om=G(()=>uf(`provider`,[B({provider:W(`object`),object:F().describe(`Target object name`)}),B({provider:W(`api`),read:Dm.optional().describe(`Configuration for fetching data`),write:Dm.optional().describe(`Configuration for submitting data (for forms/editable tables)`)}),B({provider:W(`value`),items:z(R()).describe(`Static data array`)}),B({provider:W(`schema`),schemaId:F().describe(`Schema identifier — typically the metadata type name`),schema:H(F(),R()).optional().describe(`Inline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.`)})])),km=G(()=>B({field:F().describe(`Field name to filter on`),operator:F().describe(`Filter operator (e.g. equals, not_equals, contains, this_quarter)`),value:V([F(),I(),L(),Yd(),z(V([F(),I()]))]).optional().describe(`Filter value`)}).describe(`View filter rule`)),Am=G(()=>U([`none`,`count`,`count_empty`,`count_filled`,`count_unique`,`percent_empty`,`percent_filled`,`sum`,`avg`,`min`,`max`]).describe(`Aggregation function for column footer summary`)),jm=G(()=>B({field:F().describe(`Field name (snake_case)`),label:tm.optional().describe(`Display label override`),width:I().positive().optional().describe(`Column width in pixels`),align:U([`left`,`center`,`right`]).optional().describe(`Text alignment`),hidden:L().optional().describe(`Hide column by default`),sortable:L().optional().describe(`Allow sorting by this column`),resizable:L().optional().describe(`Allow resizing this column`),wrap:L().optional().describe(`Allow text wrapping`),type:F().optional().describe(`Renderer type override (e.g., "currency", "date")`),pinned:U([`left`,`right`]).optional().describe(`Pin/freeze column to left or right side`),summary:Am.optional().describe(`Footer aggregation function for this column`),link:L().optional().describe(`Functions as the primary navigation link (triggers View navigation)`),action:F().optional().describe(`Registered Action ID to execute when clicked`)})),Mm=G(()=>B({type:U([`none`,`single`,`multiple`]).default(`none`).describe(`Selection mode`)})),Nm=G(()=>B({pageSize:I().int().positive().default(25).describe(`Number of records per page`),pageSizeOptions:z(I().int().positive()).optional().describe(`Available page size options`)})),Pm=G(()=>U([`compact`,`short`,`medium`,`tall`,`extra_tall`]).describe(`Row height / density setting for list view`)),Fm=G(()=>B({field:F().describe(`Field name to group by`),order:U([`asc`,`desc`]).default(`asc`).describe(`Group sort order`),collapsed:L().default(!1).describe(`Collapse groups by default`)})),Im=G(()=>B({fields:z(Fm).min(1).describe(`Fields to group by (supports up to 3 levels)`)}).describe(`Record grouping configuration`)),Lm=G(()=>B({coverField:F().optional().describe(`Attachment/image field to display as card cover`),coverFit:U([`cover`,`contain`]).default(`cover`).describe(`Image fit mode for card cover`),cardSize:U([`small`,`medium`,`large`]).default(`medium`).describe(`Card size in gallery view`),titleField:F().optional().describe(`Field to display as card title`),visibleFields:z(F()).optional().describe(`Fields to display on card body`)}).describe(`Gallery/card view configuration`)),Rm=G(()=>B({startDateField:F().describe(`Field for timeline item start date`),endDateField:F().optional().describe(`Field for timeline item end date`),titleField:F().describe(`Field to display as timeline item title`),groupByField:F().optional().describe(`Field to group timeline rows`),colorField:F().optional().describe(`Field to determine item color`),scale:U([`hour`,`day`,`week`,`month`,`quarter`,`year`]).default(`week`).describe(`Default timeline scale`)}).describe(`Timeline view configuration`)),zm=G(()=>B({type:U([`personal`,`collaborative`]).default(`collaborative`).describe(`View ownership type`),lockedBy:F().optional().describe(`User who locked the view configuration`)}).describe(`View sharing and access configuration`)),Bm=G(()=>B({field:F().describe(`Field to derive color from (typically a select/status field)`),colors:H(F(),F()).optional().describe(`Map of field value to color (hex/token)`)}).describe(`Row color configuration based on field values`)),Vm=G(()=>U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`]).describe(`Visualization type that users can switch to`)),Hm=G(()=>B({sort:L().default(!0).describe(`Allow users to sort records`),search:L().default(!0).describe(`Allow users to search records`),filter:L().default(!0).describe(`Allow users to filter records`),rowHeight:L().default(!0).describe(`Allow users to toggle row height/density`),addRecordForm:L().default(!1).describe(`Add records through a form instead of inline`),buttons:z(F()).optional().describe(`Custom action button IDs to show in the toolbar`)}).describe(`User action toggles for the view toolbar`)),Um=G(()=>B({showDescription:L().default(!0).describe(`Show the view description text`),allowedVisualizations:z(Vm).optional().describe(`Whitelist of visualization types users can switch between (e.g. ["grid", "gallery", "kanban"])`)}).describe(`Appearance and visualization configuration`)),Wm=G(()=>B({name:Dp.describe(`Tab identifier (snake_case)`),label:tm.optional().describe(`Display label`),icon:F().optional().describe(`Tab icon name`),view:F().optional().describe(`Referenced list view name from listViews`),filter:z(km).optional().describe(`Tab-specific filter criteria`),order:I().int().min(0).optional().describe(`Tab display order`),pinned:L().default(!1).describe(`Pin tab (cannot be removed by users)`),isDefault:L().default(!1).describe(`Set as the default active tab`),visible:L().default(!0).describe(`Tab visibility`)}).describe(`Tab configuration for multi-tab view interface`)),Gm=G(()=>B({enabled:L().default(!0).describe(`Show the add record entry point`),position:U([`top`,`bottom`,`both`]).default(`bottom`).describe(`Position of the add record button`),mode:U([`inline`,`form`,`modal`]).default(`inline`).describe(`How to add a new record`),formView:F().optional().describe(`Named form view to use when mode is "form" or "modal"`)}).describe(`Add record entry point configuration`)),Km=G(()=>B({groupByField:F().describe(`Field to group columns by (usually status/select)`),summarizeField:F().optional().describe(`Field to sum at top of column (e.g. amount)`),columns:z(F()).describe(`Fields to show on cards`)})),qm=G(()=>B({chartType:U([`bar`,`line`,`pie`,`area`,`scatter`]).default(`bar`).describe(`Chart visualisation type`),xAxisField:F().describe(`Field used as the X axis / category dimension`),yAxisFields:z(F()).min(1).describe(`Field(s) used as the Y axis / measures`),aggregation:U([`sum`,`avg`,`count`,`min`,`max`]).optional().describe(`Aggregation function applied to Y axis fields`),groupByField:F().optional().describe(`Optional field used to split / stack the chart`)}).describe(`List chart view configuration`)),Jm=G(()=>B({startDateField:F(),endDateField:F().optional(),titleField:F(),colorField:F().optional()})),Ym=G(()=>B({startDateField:F(),endDateField:F(),titleField:F(),progressField:F().optional(),dependenciesField:F().optional()})),Xm=G(()=>U([`page`,`drawer`,`modal`,`split`,`popover`,`new_window`,`none`])),Zm=G(()=>B({mode:Xm.default(`page`),view:F().optional().describe(`Name of the form view to use for details (e.g. "summary_view", "edit_form")`),preventNavigation:L().default(!1).describe(`Disable standard navigation entirely`),openNewTab:L().default(!1).describe(`Force open in new tab (applies to page mode)`),width:V([F(),I()]).optional().describe(`Width of the drawer/modal (e.g. "600px", "50%")`)})),Qm=G(()=>B({name:Dp.optional().describe(`Internal view name (lowercase snake_case)`),label:tm.optional(),type:U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`,`chart`]).default(`grid`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),columns:V([z(F()),z(jm)]).describe(`Fields to display as columns`),filter:z(km).optional().describe(`Filter criteria (JSON Rules)`),sort:V([F(),z(B({field:F(),order:U([`asc`,`desc`])}))]).optional(),searchableFields:z(F()).optional().describe(`Fields enabled for search`),filterableFields:z(F()).optional().describe(`Fields enabled for end-user filtering in the top bar`),resizable:L().optional().describe(`Enable column resizing`),striped:L().optional().describe(`Striped row styling`),bordered:L().optional().describe(`Show borders`),compactToolbar:L().optional().describe(`Collapse Group/Color/Density/Hide-fields into a single View settings popover`),selection:Mm.optional().describe(`Row selection configuration`),navigation:Zm.optional().describe(`Configuration for item click navigation (page, drawer, modal, etc.)`),pagination:Nm.optional().describe(`Pagination configuration`),kanban:Km.optional(),calendar:Jm.optional(),gantt:Ym.optional(),gallery:Lm.optional(),timeline:Rm.optional(),chart:qm.optional(),description:tm.optional().describe(`View description for documentation/tooltips`),sharing:zm.optional().describe(`View sharing and access configuration`),rowHeight:Pm.optional().describe(`Row height / density setting`),grouping:Im.optional().describe(`Group records by one or more fields`),rowColor:Bm.optional().describe(`Color rows based on field value`),hiddenFields:z(F()).optional().describe(`Fields to hide in this specific view`),fieldOrder:z(F()).optional().describe(`Explicit field display order for this view`),rowActions:z(F()).optional().describe(`Actions available for individual row items`),bulkActions:z(F()).optional().describe(`Actions available when multiple rows are selected`),bulkActionDefs:z(H(F(),Zd())).optional().describe(`Rich bulk action definitions (schema-driven, executed via BulkActionDialog)`),virtualScroll:L().optional().describe(`Enable virtual scrolling for large datasets`),conditionalFormatting:z(B({condition:jp.describe(`Predicate (CEL) to evaluate.`),style:H(F(),F()).describe(`CSS styles to apply when condition is true`)})).optional().describe(`Conditional formatting rules for list rows`),inlineEdit:L().optional().describe(`Allow inline editing of records directly in the list view`),exportOptions:z(U([`csv`,`xlsx`,`pdf`,`json`])).optional().describe(`Available export format options`),userActions:Hm.optional().describe(`User action toggles for the view toolbar`),appearance:Um.optional().describe(`Appearance and visualization configuration`),tabs:z(Wm).optional().describe(`Tab definitions for multi-tab view interface`),addRecord:Gm.optional().describe(`Add record entry point configuration`),showRecordCount:L().optional().describe(`Show record count at the bottom of the list`),allowPrinting:L().optional().describe(`Allow users to print the view`),emptyState:B({title:tm.optional(),message:tm.optional(),icon:F().optional()}).optional().describe(`Empty state configuration when no records found`),aria:nm.optional().describe(`ARIA accessibility attributes for the list view`),responsive:Cm.optional().describe(`Responsive layout configuration`),performance:wm.optional().describe(`Performance optimization settings`)})),$m=G(()=>B({field:F().describe(`Field name (snake_case)`),type:zp.optional().describe(`Field type (auto-infers widget if omitted)`),options:z(Bp).optional().describe(`Options for select/multiselect/radio/checkboxes fields`),reference:F().optional().describe(`Target object name for lookup/master_detail fields`),maxLength:I().optional().describe(`Maximum character length (for text/textarea/email/url/phone)`),minLength:I().optional().describe(`Minimum character length`),min:I().optional().describe(`Minimum value (for number/currency/percent/slider)`),max:I().optional().describe(`Maximum value`),precision:I().optional().describe(`Total digits (for number/currency)`),scale:I().optional().describe(`Decimal places`),multiple:L().optional().describe(`Allow multiple values (for select/lookup/file/image)`),label:tm.optional().describe(`Display label override`),placeholder:tm.optional().describe(`Placeholder text`),helpText:tm.optional().describe(`Help/hint text`),readonly:L().optional().describe(`Read-only override`),immutable:L().optional().describe(`Editable on create, locked once the record exists (e.g. machine names).`),required:L().optional().describe(`Required override`),hidden:L().optional().describe(`Hidden override`),colSpan:I().int().min(1).max(4).optional().describe(`Column span in grid layout (1-4)`),widget:F().optional().describe(`Custom widget/component name (overrides type-based inference)`),language:F().optional().describe(`Code editor language (for type=code)`),fields:z(zf(()=>$m)).optional().describe(`Sub-fields for composite/repeater/record types`),keyField:B({field:F().default(`name`).describe(`Property name that holds the key inside each item (defaults to "name")`),label:tm.optional().describe(`Display label for the key column`),placeholder:tm.optional().describe(`Placeholder when entering a new key`),helpText:tm.optional().describe(`Help text under the key input`),regex:F().optional().describe(`JS regex source string the key must match (no flags)`),immutable:L().default(!0).describe(`If true, the key is read-only after creation`)}).optional().describe(`Key column config for record-typed fields`),dependsOn:F().optional().describe(`Parent field name for cascading`),visibleOn:jp.optional().describe(`Visibility predicate (CEL).`)})),eh=G(()=>B({name:F().optional().describe(`Stable section identifier for i18n lookup (snake_case)`),label:tm.optional(),description:F().optional().describe(`Optional description rendered under the section header.`),collapsible:L().default(!1),collapsed:L().default(!1),visibleOn:jp.optional().describe(`Visibility predicate (CEL). Hides the whole section when false.`),columns:V([U([`1`,`2`,`3`,`4`]),W(1),W(2),W(3),W(4)]).default(1).transform(e=>typeof e==`string`?parseInt(e):e),fields:z(V([F(),$m]))})),th=G(()=>B({type:U([`simple`,`tabbed`,`wizard`,`split`,`drawer`,`modal`]).default(`simple`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),sections:z(eh).optional(),groups:z(eh).optional(),subforms:z(B({childObject:F().describe(`Child object whose records are entered inline`),relationshipField:F().optional().describe(`FK on the child pointing back to the parent (auto-detected when omitted)`),columns:z(Zd()).optional().describe(`Editable grid columns (derived from the child object when omitted)`),amountField:F().optional().describe(`Numeric child column summed for the running total`),totalField:F().optional().describe(`Parent field to receive the rolled-up sum`),title:F().optional().describe(`Section title`),addLabel:F().optional().describe(`Add-row button label`),minRows:I().optional(),maxRows:I().optional()})).optional().describe(`Inline master-detail child collections`),defaultSort:z(B({field:F().describe(`Field name to sort by`),order:U([`asc`,`desc`]).default(`desc`).describe(`Sort direction`)})).optional().describe(`Default sort order for related list views within this form`),sharing:ym.optional().describe(`Public sharing configuration for this form`),submitBehavior:V([B({kind:W(`thank-you`),title:F().optional(),message:F().optional()}),B({kind:W(`redirect`),url:F(),delayMs:I().int().min(0).optional()}),B({kind:W(`continue`)}),B({kind:W(`next-record`)})]).optional().describe(`Post-submit behavior`),aria:nm.optional().describe(`ARIA accessibility attributes for the form view`)}));G(()=>B({list:Qm.optional(),form:th.optional(),listViews:H(F(),Qm).optional().describe(`Additional named list views`),formViews:H(F(),th).optional().describe(`Additional named form views`),protection:vm.optional().describe(`Package author protection block — lock policy for this view.`),..._m}));var nh=F().regex(/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/,`View item name must be a dotted snake_case qualified name, e.g. "crm_lead.pipeline".`).describe("Globally-unique view id, `<object>.<viewKey>`."),rh=U([`package`,`shared`,`personal`]).describe(`View identity layer: package | shared | personal.`);U([`list`,`form`]).describe("Whether `config` is a ListView (list family) or a FormView.");function ih(){return{name:nh,object:F().describe(`Bound object name — the foreign key used to aggregate views.`),label:tm.optional().describe(`Display label (supports i18n).`),isDefault:L().optional().describe(`Whether this is the object's default view in the switcher.`),order:I().int().optional().describe(`Sort order within the object's view switcher / left rail.`),scope:rh.optional().describe("Identity layer (defaults to `package` for source-loaded views)."),owner:F().optional().describe("Owner user id — set when `scope` is `personal`."),hidden:L().optional().describe(`Hidden from the switcher (per-user / per-org declutter).`),protection:vm.optional().describe(`Package author protection block — lock policy for this view.`),..._m}}G(()=>uf(`viewKind`,[B({viewKind:W(`list`),config:Qm.describe(`List-family view configuration.`),...ih()}),B({viewKind:W(`form`),config:th.describe(`Form view configuration.`),...ih()})]));function ah(e){let{schemaId:t,...n}=e;return th.parse({...n,data:{provider:`schema`,schemaId:t}})}var oh=U([`get`,`list`,`create`,`update`,`delete`,`upsert`,`bulk`,`aggregate`,`history`,`search`,`restore`,`purge`,`import`,`export`]),sh=B({trackHistory:L().default(!1).describe(`Enable field history tracking for audit compliance`),searchable:L().default(!0).describe(`Index records for global search`),apiEnabled:L().default(!0).describe(`Expose object via automatic APIs`),apiMethods:z(oh).optional().describe(`Whitelist of allowed API operations`),files:L().default(!1).describe(`Enable file attachments and document management`),feeds:L().default(!1).describe(`Enable social feed, comments, and mentions (Chatter-like)`),activities:L().default(!1).describe(`Enable standard tasks and events tracking`),trash:L().default(!0).describe(`Enable soft-delete with restore capability`),mru:L().default(!0).describe(`Track Most Recently Used (MRU) list for users`),clone:L().default(!0).describe(`Allow record deep cloning`)}),ch=G(()=>B({name:F().optional().describe(`Index name (auto-generated if not provided)`),fields:z(F()).describe(`Fields included in the index`),type:U([`btree`,`hash`,`gin`,`gist`,`fulltext`]).optional().default(`btree`).describe(`Index algorithm type`),unique:L().optional().default(!1).describe(`Whether the index enforces uniqueness`),partial:F().optional().describe(`Partial index condition (SQL WHERE clause for conditional indexes)`)})),lh=G(()=>B({fields:z(F()).describe(`Fields to index for full-text search weighting`),displayFields:z(F()).optional().describe(`Fields to display in search result cards`),filters:z(F()).optional().describe(`Default filters for search results`)})),uh=G(()=>B({enabled:L().describe(`Enable multi-tenancy for this object`),strategy:U([`shared`,`isolated`,`hybrid`]).describe(`Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)`),tenantField:F().default(`tenant_id`).describe(`Field name for tenant identifier`),crossTenantAccess:L().default(!1).describe(`Allow cross-tenant data access (with explicit permission)`)})),dh=G(()=>B({enabled:L().describe(`Enable soft delete (trash/recycle bin)`),field:F().default(`deleted_at`).describe(`Field name for soft delete timestamp`),cascadeDelete:L().default(!1).describe(`Cascade soft delete to related records`)})),fh=G(()=>B({enabled:L().describe(`Enable record versioning`),strategy:U([`snapshot`,`delta`,`event-sourcing`]).describe(`Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)`),retentionDays:I().min(1).optional().describe(`Number of days to retain old versions (undefined = infinite)`),versionField:F().default(`version`).describe(`Field name for version number/timestamp`)})),ph=G(()=>B({enabled:L().describe(`Enable table partitioning`),strategy:U([`range`,`hash`,`list`]).describe(`Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)`),key:F().describe(`Field name to partition by`),interval:F().optional().describe(`Partition interval for range strategy (e.g., "1 month", "1 year")`)}).refine(e=>!(e.strategy===`range`&&!e.interval),{message:`interval is required when strategy is "range"`})),mh=G(()=>B({enabled:L().describe(`Enable Change Data Capture`),events:z(U([`insert`,`update`,`delete`])).describe(`Event types to capture`),destination:F().describe(`Destination endpoint (e.g., "kafka://topic", "webhook://url")`)})),hh=G(()=>B({key:F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field group key must be lowercase snake_case (e.g., "contact_info", "billing", "system")`}).describe(`Group machine key (snake_case). Referenced by Field.group.`),label:F().describe(`Group display label`),icon:F().optional().describe(`Icon name (Lucide/Material) for the group header`),description:F().optional().describe(`Optional description shown under the group header`),defaultExpanded:L().optional().default(!0).describe(`Whether the group is expanded by default`),visibleOn:jp.optional().describe(`Visibility predicate (CEL); group is hidden when FALSE.`)})),gh=B({remoteName:F().optional().describe(`Remote table/view name. Defaults to object.name.`),remoteSchema:F().optional().describe(`Remote schema/database qualifier.`),writable:L().default(!1).describe(`Per-object write opt-in (also requires datasource.external.allowWrites).`),columnMap:H(F(),F()).optional().describe(`Remote column name → local field name.`),introspectedAt:F().datetime().optional().describe("Set by `os datasource introspect`; informational."),ignoreColumns:z(F()).optional().describe(`Remote columns to skip during validation (dev convenience).`)}).describe(`External datasource binding (ADR-0015)`),_h=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine unique key (snake_case). Immutable.`),label:F().optional().describe(`Human readable singular label (e.g. "Account")`),pluralLabel:F().optional().describe(`Human readable plural label (e.g. "Accounts")`),description:F().optional().describe(`Developer documentation / description`),icon:F().optional().describe(`Icon name (Lucide/Material) for UI representation`),tags:z(F()).optional().describe(`Categorization tags (e.g. "sales", "system", "reference")`),active:L().optional().default(!0).describe(`Is the object active and usable`),isSystem:L().optional().default(!1).describe(`Is system object (protected from deletion)`),abstract:L().optional().default(!1).describe(`Is abstract base object (cannot be instantiated)`),managedBy:U([`platform`,`config`,`system`,`append-only`,`better-auth`]).optional().describe(`Lifecycle bucket — platform (user CRUD) | config (admin authored) | system (engine-managed) | append-only (audit) | better-auth (identity). UI clients honour the resolved affordance matrix.`),userActions:B({create:L().optional().describe(`Show generic "New" button.`),import:L().optional().describe(`Show CSV import wizard entry.`),edit:L().optional().describe(`Allow inline / form edit of existing rows.`),delete:L().optional().describe(`Show row-level delete + bulk delete.`),exportCsv:L().optional().describe(`Show CSV export entry.`)}).optional().describe(`Per-object override of the resolved CRUD affordance matrix.`),systemFields:V([W(!1),B({tenant:L().optional().describe(`Inject organization_id (multi-tenant only). Default true.`),owner:L().optional().describe(`Reserved for future owner_id auto-injection.`),audit:L().optional().describe(`Reserved for future created_by/updated_by auto-injection.`)})]).optional().describe(`Opt out of, or selectively disable, registry-level system-field auto-injection.`),datasource:F().optional().default(`default`).describe(`Target Datasource ID. "default" is the primary DB.`),external:gh.optional().describe(`Remote table binding for federated (external) objects.`),fields:H(F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")`}),Kp).describe(`Field definitions map. Keys must be snake_case identifiers.`),indexes:z(ch).optional().describe(`Database performance indexes`),fieldGroups:z(hh).refine(e=>new Set(e.map(e=>e.key)).size===e.length,{message:`fieldGroups[].key must be unique within an object`}).optional().describe(`Ordered list of field groups (array order = display order). See ObjectFieldGroupSchema.`),tenancy:uh.optional().describe(`Multi-tenancy configuration for SaaS applications`),softDelete:dh.optional().describe(`Soft delete (trash/recycle bin) configuration`),versioning:fh.optional().describe(`Record versioning and history tracking configuration`),partitioning:ph.optional().describe(`Table partitioning configuration for performance`),cdc:mh.optional().describe(`Change Data Capture (CDC) configuration for real-time data streaming`),validations:z($p).optional().describe(`Object-level validation rules`),displayNameField:F().optional().describe(`Field to use as the record display name (e.g., "name", "title"). Defaults to "name" if present.`),recordName:B({type:U([`text`,`autonumber`]).describe(`Record name type: text (user-entered) or autonumber (system-generated)`),displayFormat:F().optional().describe(`Auto-number format pattern (e.g., "CASE-{0000}", "INV-{YYYY}-{0000}")`),startNumber:I().int().min(0).optional().describe(`Starting number for autonumber (default: 1)`)}).optional().describe(`Record name generation configuration (Salesforce pattern)`),titleFormat:Mp.optional().describe(`Title template — supports {{record.field}} interpolation. Overrides displayNameField.`),compactLayout:z(F()).optional().describe(`Primary fields for hover/cards/lookups`),listViews:H(F(),Qm).optional().describe(`Built-in named list views (segmented tabs) shipped with the object schema`),defaultDetailForm:F().optional().describe(`Name of the default FormView for record detail / edit screens`),search:lh.optional().describe(`Search engine configuration`),enable:sh.optional().describe(`Enabled system features modules`),recordTypes:z(F()).optional().describe(`Record type names for this object`),sharingModel:U([`private`,`read`,`read_write`,`full`]).optional().describe(`Default sharing model`),publicSharing:B({enabled:L().default(!1).describe(`Allow records of this object to be published via share link`),allowedAudiences:z(U([`public`,`link_only`,`signed_in`,`email`])).optional().describe(`Audiences callers may select when creating a link`),allowedPermissions:z(U([`view`,`comment`,`edit`])).optional().describe(`Permission levels selectable on the share dialog`),maxExpiryDays:I().int().positive().optional().describe(`Reject links with expiry beyond this many days`),redactFields:z(F()).optional().describe(`Field names removed from records served via a share token`),eligibility:F().optional().describe(`CEL expression that must evaluate to true on the target record`)}).optional().describe(`Public share-link policy (Notion/Figma-style link sharing)`),keyPrefix:F().max(5).optional().describe(`Short prefix for record IDs (e.g., "001" for Account)`),detail:B({renderViaSchema:L().optional().describe(`Opt this object out of the schema-driven detail renderer`),hideReferenceRail:L().optional().describe(`Suppress the right-hand reference-rail on the detail page`),hideRelatedTab:L().optional().describe(`Suppress the Related tab on the detail page`)}).passthrough().optional().describe(`Detail-page UI hints consumed by @object-ui/plugin-detail synth`),actions:z(pm).optional().describe(`Actions associated with this object (auto-populated from top-level actions via objectName)`),protection:vm.optional().describe(`Package author protection block — lock policy for this object.`),..._m});function vh(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var yh={workflows:"`workflows` is not an ObjectSchema field. Object-level, record-triggered automation is authored as a lifecycle hook (`src/objects/<name>.hook.ts`, registered via `defineHook()`) or as a top-level `record_change` flow — not as `workflows[]` on the object schema.",workflow:"`workflow` is not an ObjectSchema field. Record-triggered automation is authored as a lifecycle hook (`src/objects/<name>.hook.ts`) or a top-level `record_change` flow.",hooks:"`hooks` is not an ObjectSchema field. Lifecycle hooks live in their own `src/objects/<name>.hook.ts` module, registered via `defineHook()`.",triggers:"`triggers` is not an ObjectSchema field. Use a lifecycle hook (`src/objects/<name>.hook.ts`) or a top-level `record_change` flow."};function bh(e,t){let n=Array.from({length:e.length+1},()=>Array(t.length+1).fill(0));for(let t=0;t<=e.length;t++)n[t][0]=t;for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=e.length;r++)for(let i=1;i<=t.length;i++)n[r][i]=e[r-1]===t[i-1]?n[r-1][i-1]:1+Math.min(n[r-1][i],n[r][i-1],n[r-1][i-1]);return n[e.length][t.length]}function xh(e,t){let n,r=1/0;for(let i of t){let t=bh(e.toLowerCase(),i.toLowerCase());t<r&&(r=t,n=i)}return n!==void 0&&r<=Math.max(2,Math.floor(e.length/3))?n:void 0}function Sh(e,t,n){let r=typeof e==`string`&&e.length>0?e:`<unnamed>`,i=t.map(e=>{let t=yh[e];if(t)return` \u2022 ${t}`;let r=xh(e,n);return r?` \u2022 \`${e}\` is not an ObjectSchema field \u2014 did you mean \`${r}\`?`:` \u2022 \`${e}\` is not an ObjectSchema field.`});return Error(`ObjectSchema.create('${r}'): unknown key(s) \u2014 ${t.join(`, `)}.
|
|
102
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function yu(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:Su(t,`input`,e.processors),output:Su(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bu(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 bu(r.element,n);if(r.type===`set`)return bu(r.valueType,n);if(r.type===`lazy`)return bu(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`)return bu(r.innerType,n);if(r.type===`intersection`)return bu(r.left,n)||bu(r.right,n);if(r.type===`record`||r.type===`map`)return bu(r.keyType,n)||bu(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bu(r.in,n)||bu(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bu(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bu(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bu(e,n))return!0;return!!(r.rest&&bu(r.rest,n))}return!1}var xu=(e,t={})=>n=>{let r=gu({...n,processors:t});return _u(e,r),vu(r,e),yu(r,e)},Su=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gu({...i??{},target:a,io:t,processors:n});return _u(e,o),vu(o,e),yu(o,e)},Cu={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wu=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Cu[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},Tu=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Eu=(e,t,n,r)=>{n.type=`boolean`},Du=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ou=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ku=(e,t,n,r)=>{n.not={}},Au=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ju=(e,t,n,r)=>{let i=e._zod.def,a=Pa(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Mu=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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},Nu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Pu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Fu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Iu=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_u(a.element,t,{...r,path:[...r.path,`items`]})},Lu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=_u(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_u(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ru=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_u(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zu=(e,t,n,r)=>{let i=e._zod.def,a=_u(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_u(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Bu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>_u(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?_u(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Vu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=_u(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=_u(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=_u(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Hu=(e,t,n,r)=>{let i=e._zod.def,a=_u(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`}]},Uu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Gu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ku=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},qu=(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;_u(o,t,r);let s=t.seen.get(e);s.ref=o},Ju=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zu=(e,t,n,r)=>{let i=e._zod.innerType;_u(i,t,r);let a=t.seen.get(e);a.ref=i},Qu=N(`ZodISODateTime`,(e,t)=>{Ys.init(e,t),wd.init(e,t)});function $u(e){return Ml(Qu,e)}var ed=N(`ZodISODate`,(e,t)=>{Xs.init(e,t),wd.init(e,t)});function td(e){return Nl(ed,e)}var nd=N(`ZodISOTime`,(e,t)=>{Zs.init(e,t),wd.init(e,t)});function rd(e){return Pl(nd,e)}var id=N(`ZodISODuration`,(e,t)=>{Qs.init(e,t),wd.init(e,t)});function ad(e){return Fl(id,e)}var od=N(`ZodError`,(e,t)=>{vo.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xo(e,t)},flatten:{value:t=>bo(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fa,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fa,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),sd=So(od),cd=wo(od),ld=Eo(od),ud=Oo(od),dd=Ao(od),fd=jo(od),pd=Mo(od),md=No(od),hd=Po(od),gd=Fo(od),_d=Io(od),vd=Lo(od),yd=new WeakMap;function bd(e,t,n){let r=Object.getPrototypeOf(e),i=yd.get(r);if(i||(i=new Set,yd.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var xd=N(`ZodType`,(e,t)=>(Fs.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Su(e,`input`),output:Su(e,`output`)}}),e.toJSONSchema=xu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>sd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ld(e,t,n),e.parseAsync=async(t,n)=>cd(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ud(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dd(e,t,n),e.decode=(t,n)=>fd(e,t,n),e.encodeAsync=async(t,n)=>pd(e,t,n),e.decodeAsync=async(t,n)=>md(e,t,n),e.safeEncode=(t,n)=>hd(e,t,n),e.safeDecode=(t,n)=>gd(e,t,n),e.safeEncodeAsync=async(t,n)=>_d(e,t,n),e.safeDecodeAsync=async(t,n)=>vd(e,t,n),bd(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ua(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 $a(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kf(e,t))},superRefine(e,t){return this.check(qf(e,t))},overwrite(e){return this.check(au(e))},optional(){return xf(this)},exactOptional(){return Cf(this)},nullable(){return Tf(this)},nullish(){return xf(Tf(this))},nonoptional(e){return jf(this,e)},array(){return z(this)},or(e){return V([this,e])},and(e){return ff(this,e)},transform(e){return Ff(this,yf(e))},default(e){return Df(this,e)},prefault(e){return kf(this,e)},catch(e){return Nf(this,e)},pipe(e){return Ff(this,e)},readonly(){return Lf(this)},describe(e){let t=this.clone();return cl.add(t,{description:e}),t},meta(...e){if(e.length===0)return cl.get(this);let t=this.clone();return cl.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return cl.get(e)?.description},configurable:!0}),e)),Sd=N(`_ZodString`,(e,t)=>{Is.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wu(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,bd(e,`_ZodString`,{regex(...e){return this.check($l(...e))},includes(...e){return this.check(nu(...e))},startsWith(...e){return this.check(ru(...e))},endsWith(...e){return this.check(iu(...e))},min(...e){return this.check(Zl(...e))},max(...e){return this.check(Xl(...e))},length(...e){return this.check(Ql(...e))},nonempty(...e){return this.check(Zl(1,...e))},lowercase(e){return this.check(eu(e))},uppercase(e){return this.check(tu(e))},trim(){return this.check(su())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(cu())},toUpperCase(){return this.check(lu())},slugify(){return this.check(uu())}})}),Cd=N(`ZodString`,(e,t)=>{Is.init(e,t),Sd.init(e,t),e.email=t=>e.check(ul(Td,t)),e.url=t=>e.check(gl(Od,t)),e.jwt=t=>e.check(jl(Ud,t)),e.emoji=t=>e.check(_l(kd,t)),e.guid=t=>e.check(dl(Ed,t)),e.uuid=t=>e.check(fl(Dd,t)),e.uuidv4=t=>e.check(pl(Dd,t)),e.uuidv6=t=>e.check(ml(Dd,t)),e.uuidv7=t=>e.check(hl(Dd,t)),e.nanoid=t=>e.check(vl(Ad,t)),e.guid=t=>e.check(dl(Ed,t)),e.cuid=t=>e.check(yl(jd,t)),e.cuid2=t=>e.check(bl(Md,t)),e.ulid=t=>e.check(xl(Nd,t)),e.base64=t=>e.check(Ol(Bd,t)),e.base64url=t=>e.check(kl(Vd,t)),e.xid=t=>e.check(Sl(Pd,t)),e.ksuid=t=>e.check(Cl(Fd,t)),e.ipv4=t=>e.check(wl(Id,t)),e.ipv6=t=>e.check(Tl(Ld,t)),e.cidrv4=t=>e.check(El(Rd,t)),e.cidrv6=t=>e.check(Dl(zd,t)),e.e164=t=>e.check(Al(Hd,t)),e.datetime=t=>e.check($u(t)),e.date=t=>e.check(td(t)),e.time=t=>e.check(rd(t)),e.duration=t=>e.check(ad(t))});function F(e){return ll(Cd,e)}var wd=N(`ZodStringFormat`,(e,t)=>{Ls.init(e,t),Sd.init(e,t)}),Td=N(`ZodEmail`,(e,t)=>{Bs.init(e,t),wd.init(e,t)}),Ed=N(`ZodGUID`,(e,t)=>{Rs.init(e,t),wd.init(e,t)}),Dd=N(`ZodUUID`,(e,t)=>{zs.init(e,t),wd.init(e,t)}),Od=N(`ZodURL`,(e,t)=>{Vs.init(e,t),wd.init(e,t)}),kd=N(`ZodEmoji`,(e,t)=>{Hs.init(e,t),wd.init(e,t)}),Ad=N(`ZodNanoID`,(e,t)=>{Us.init(e,t),wd.init(e,t)}),jd=N(`ZodCUID`,(e,t)=>{Ws.init(e,t),wd.init(e,t)}),Md=N(`ZodCUID2`,(e,t)=>{Gs.init(e,t),wd.init(e,t)}),Nd=N(`ZodULID`,(e,t)=>{Ks.init(e,t),wd.init(e,t)}),Pd=N(`ZodXID`,(e,t)=>{qs.init(e,t),wd.init(e,t)}),Fd=N(`ZodKSUID`,(e,t)=>{Js.init(e,t),wd.init(e,t)}),Id=N(`ZodIPv4`,(e,t)=>{$s.init(e,t),wd.init(e,t)}),Ld=N(`ZodIPv6`,(e,t)=>{ec.init(e,t),wd.init(e,t)}),Rd=N(`ZodCIDRv4`,(e,t)=>{tc.init(e,t),wd.init(e,t)}),zd=N(`ZodCIDRv6`,(e,t)=>{nc.init(e,t),wd.init(e,t)}),Bd=N(`ZodBase64`,(e,t)=>{ic.init(e,t),wd.init(e,t)}),Vd=N(`ZodBase64URL`,(e,t)=>{oc.init(e,t),wd.init(e,t)}),Hd=N(`ZodE164`,(e,t)=>{sc.init(e,t),wd.init(e,t)}),Ud=N(`ZodJWT`,(e,t)=>{lc.init(e,t),wd.init(e,t)}),Wd=N(`ZodNumber`,(e,t)=>{uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tu(e,t,n,r),bd(e,`ZodNumber`,{gt(e,t){return this.check(ql(e,t))},gte(e,t){return this.check(Jl(e,t))},min(e,t){return this.check(Jl(e,t))},lt(e,t){return this.check(Gl(e,t))},lte(e,t){return this.check(Kl(e,t))},max(e,t){return this.check(Kl(e,t))},int(e){return this.check(Kd(e))},safe(e){return this.check(Kd(e))},positive(e){return this.check(ql(0,e))},nonnegative(e){return this.check(Jl(0,e))},negative(e){return this.check(Gl(0,e))},nonpositive(e){return this.check(Kl(0,e))},multipleOf(e,t){return this.check(Yl(e,t))},step(e,t){return this.check(Yl(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Il(Wd,e)}var Gd=N(`ZodNumberFormat`,(e,t)=>{dc.init(e,t),Wd.init(e,t)});function Kd(e){return Ll(Gd,e)}var qd=N(`ZodBoolean`,(e,t)=>{fc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eu(e,t,n,r)});function L(e){return Rl(qd,e)}var Jd=N(`ZodNull`,(e,t)=>{pc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Du(e,t,n,r)});function Yd(e){return zl(Jd,e)}var Xd=N(`ZodAny`,(e,t)=>{mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Zd(){return Bl(Xd)}var Qd=N(`ZodUnknown`,(e,t)=>{hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Vl(Qd)}var $d=N(`ZodNever`,(e,t)=>{gc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ku(e,t,n,r)});function ef(e){return Hl($d,e)}var tf=N(`ZodVoid`,(e,t)=>{_c.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ou(e,t,n,r)});function nf(e){return Ul(tf,e)}var rf=N(`ZodDate`,(e,t)=>{vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Au(e,t,n,r),e.min=(t,n)=>e.check(Jl(t,n)),e.max=(t,n)=>e.check(Kl(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function af(e){return Wl(rf,e)}var of=N(`ZodArray`,(e,t)=>{bc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iu(e,t,n,r),e.element=t.element,bd(e,`ZodArray`,{min(e,t){return this.check(Zl(e,t))},nonempty(e){return this.check(Zl(1,e))},max(e,t){return this.check(Xl(e,t))},length(e,t){return this.check(Ql(e,t))},unwrap(){return this.element}})});function z(e,t){return du(of,e,t)}var sf=N(`ZodObject`,(e,t)=>{Tc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lu(e,t,n,r),Va(e,`shape`,()=>t.shape),bd(e,`ZodObject`,{keyof(){return U(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:ef()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return io(this,e)},safeExtend(e){return ao(this,e)},merge(e){return oo(this,e)},pick(e){return no(this,e)},omit(e){return ro(this,e)},partial(...e){return so(bf,this,e[0])},required(...e){return co(Af,this,e[0])}})});function B(e,t){return new sf({type:`object`,shape:e??{},...P(t)})}var cf=N(`ZodUnion`,(e,t)=>{Dc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ru(e,t,n,r),e.options=t.options});function V(e,t){return new cf({type:`union`,options:e,...P(t)})}var lf=N(`ZodDiscriminatedUnion`,(e,t)=>{cf.init(e,t),Oc.init(e,t)});function uf(e,t,n){return new lf({type:`union`,options:t,discriminator:e,...P(n)})}var df=N(`ZodIntersection`,(e,t)=>{kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zu(e,t,n,r)});function ff(e,t){return new df({type:`intersection`,left:e,right:t})}var pf=N(`ZodTuple`,(e,t)=>{Mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bu(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function mf(e,t,n){let r=t instanceof Fs;return new pf({type:`tuple`,items:e,rest:r?t:null,...P(r?n:t)})}var hf=N(`ZodRecord`,(e,t)=>{Ic.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vu(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function H(e,t,n){return!t||!t._zod?new hf({type:`record`,keyType:F(),valueType:e,...P(t)}):new hf({type:`record`,keyType:e,valueType:t,...P(n)})}var gf=N(`ZodEnum`,(e,t)=>{Lc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ju(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);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 gf({...t,checks:[],...P(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 gf({...t,checks:[],...P(r),entries:i})}});function U(e,t){return new gf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var _f=N(`ZodLiteral`,(e,t)=>{Rc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mu(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 W(e,t){return new _f({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var vf=N(`ZodTransform`,(e,t)=>{zc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fu(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ja(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(go(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(go(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function yf(e){return new vf({type:`transform`,transform:e})}var bf=N(`ZodOptional`,(e,t)=>{Vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new bf({type:`optional`,innerType:e})}var Sf=N(`ZodExactOptional`,(e,t)=>{Hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new Sf({type:`optional`,innerType:e})}var wf=N(`ZodNullable`,(e,t)=>{Uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tf(e){return new wf({type:`nullable`,innerType:e})}var Ef=N(`ZodDefault`,(e,t)=>{Wc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Df(e,t){return new Ef({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Of=N(`ZodPrefault`,(e,t)=>{Kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kf(e,t){return new Of({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Af=N(`ZodNonOptional`,(e,t)=>{qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jf(e,t){return new Af({type:`nonoptional`,innerType:e,...P(t)})}var Mf=N(`ZodCatch`,(e,t)=>{Yc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ku(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nf(e,t){return new Mf({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Pf=N(`ZodPipe`,(e,t)=>{Xc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qu(e,t,n,r),e.in=t.in,e.out=t.out});function Ff(e,t){return new Pf({type:`pipe`,in:e,out:t})}var If=N(`ZodReadonly`,(e,t)=>{Qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ju(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lf(e){return new If({type:`readonly`,innerType:e})}var Rf=N(`ZodLazy`,(e,t)=>{nl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zu(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function zf(e){return new Rf({type:`lazy`,getter:e})}var Bf=N(`ZodPromise`,(e,t)=>{tl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vf(e){return new Bf({type:`promise`,innerType:e})}var Hf=N(`ZodFunction`,(e,t)=>{el.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pu(e,t,n,r)});function Uf(e){return new Hf({type:`function`,input:Array.isArray(e?.input)?mf(e?.input):e?.input??z(R()),output:e?.output??R()})}var Wf=N(`ZodCustom`,(e,t)=>{rl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nu(e,t,n,r)});function Gf(e,t){return fu(Wf,e??(()=>!0),t)}function Kf(e,t={}){return pu(Wf,e,t)}function qf(e,t){return mu(e,t)}var Jf=c(_(),1);function G(e){if(typeof process<`u`&&{}.OS_EAGER_SCHEMAS===`1`)return e();let t,n=()=>(t===void 0&&(t=e()),t);return new Proxy(function(){},{get(e,t){let r=n(),i=r[t];return typeof i==`function`?i.bind(r):i},set(e,t,r){let i=n();return i[t]=r,!0},has(e,t){return t in n()},ownKeys(){return Reflect.ownKeys(n())},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(n(),t)},getPrototypeOf(){return Reflect.getPrototypeOf(n())}})}var Yf=G(()=>B({$field:F().describe(`Field Reference/Column Name`)}));G(()=>B({$eq:Zd().optional(),$ne:Zd().optional()})),G(()=>B({$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional()})),G(()=>B({$in:z(Zd()).optional(),$nin:z(Zd()).optional()})),G(()=>B({$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional()})),G(()=>B({$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional()})),G(()=>B({$null:L().optional(),$exists:L().optional()}));var Xf=G(()=>B({$eq:Zd().optional(),$ne:Zd().optional(),$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional(),$in:z(Zd()).optional(),$nin:z(Zd()).optional(),$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional(),$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional(),$null:L().optional(),$exists:L().optional()})),Zf=zf(()=>H(F(),R()).and(B({$and:z(Zf).optional(),$or:z(Zf).optional(),$not:Zf.optional()})));G(()=>B({where:Zf.optional()}));var Qf=zf(()=>B({$and:z(V([H(F(),Xf),Qf])).optional(),$or:z(V([H(F(),Xf),Qf])).optional(),$not:V([H(F(),Xf),Qf]).optional()})),$f=new Set([`=`,`==`,`!=`,`<>`,`>`,`>=`,`<`,`<=`,`in`,`nin`,`not_in`,`contains`,`notcontains`,`not_contains`,`like`,`startswith`,`starts_with`,`endswith`,`ends_with`,`between`,`is_null`,`is_not_null`]);function ep(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];if(typeof t==`string`){let n=t.toLowerCase();if(n===`and`||n===`or`)return e.length>=2&&e.slice(1).every(e=>ep(e));if(e.length>=2&&typeof e[1]==`string`)return $f.has(e[1].toLowerCase())}return e.every(e=>ep(e))?e.length>0:!1}var tp=[`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`,`$in`,`$nin`,`$between`,`$contains`,`$notContains`,`$startsWith`,`$endsWith`,`$null`,`$exists`],np=[`$and`,`$or`,`$not`];[...tp,...np];var rp=G(()=>B({field:F(),order:U([`asc`,`desc`]).default(`asc`)})),ip=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`array_agg`,`string_agg`]),ap=U([`day`,`week`,`month`,`quarter`,`year`]),op=G(()=>V([F(),B({field:F().describe(`Field to group by`),dateGranularity:ap.optional().describe(`Bucket date values into uniform periods (day/week/month/quarter/year)`),alias:F().optional().describe(`Alias for the projected group value`)})])),sp=G(()=>B({function:ip.describe(`Aggregation function`),field:F().optional().describe(`Field to aggregate (optional for COUNT(*))`),alias:F().describe(`Result column alias`),distinct:L().optional().describe(`Apply DISTINCT before aggregation`),filter:Zf.optional().describe(`Filter/Condition to apply to the aggregation (FILTER WHERE clause)`)})),cp=U([`inner`,`left`,`right`,`full`]),lp=U([`auto`,`database`,`hash`,`loop`]),up=zf(()=>B({type:cp.describe(`Join type`),strategy:lp.optional().describe(`Execution strategy hint`),object:F().describe(`Object/table to join`),alias:F().optional().describe(`Table alias`),on:Zf.describe(`Join condition`),subquery:zf(()=>_p).optional().describe(`Subquery instead of object`)})),dp=U([`row_number`,`rank`,`dense_rank`,`percent_rank`,`lag`,`lead`,`first_value`,`last_value`,`sum`,`avg`,`count`,`min`,`max`]),fp=G(()=>B({partitionBy:z(F()).optional().describe(`PARTITION BY fields`),orderBy:z(rp).optional().describe(`ORDER BY specification`),frame:B({type:U([`rows`,`range`]).optional(),start:F().optional().describe(`Frame start (e.g., "UNBOUNDED PRECEDING", "1 PRECEDING")`),end:F().optional().describe(`Frame end (e.g., "CURRENT ROW", "1 FOLLOWING")`)}).optional().describe(`Window frame specification`)})),pp=G(()=>B({function:dp.describe(`Window function name`),field:F().optional().describe(`Field to operate on (for aggregate window functions)`),alias:F().describe(`Result column alias`),over:fp.describe(`Window specification (OVER clause)`)})),mp=zf(()=>V([F(),B({field:F(),fields:z(mp).optional(),alias:F().optional()})])),hp=G(()=>B({query:F().describe(`Search query text`),fields:z(F()).optional().describe(`Fields to search in (if not specified, searches all text fields)`),fuzzy:L().optional().default(!1).describe(`Enable fuzzy matching (tolerates typos)`),operator:U([`and`,`or`]).optional().default(`or`).describe(`Logical operator between terms`),boost:H(F(),I()).optional().describe(`Field-specific relevance boosting (field name -> boost factor)`),minScore:I().optional().describe(`Minimum relevance score threshold`),language:F().optional().describe(`Language for text analysis (e.g., "en", "zh", "es")`),highlight:L().optional().default(!1).describe(`Enable search result highlighting`)})),gp=B({object:F().describe(`Object name (e.g. account)`),fields:z(mp).optional().describe(`Fields to retrieve`),where:Zf.optional().describe(`Filtering criteria (WHERE)`),search:hp.optional().describe(`Full-text search configuration ($search parameter)`),orderBy:z(rp).optional().describe(`Sorting instructions (ORDER BY)`),limit:I().optional().describe(`Max records to return (LIMIT)`),offset:I().optional().describe(`Records to skip (OFFSET)`),top:I().optional().describe(`Alias for limit (OData compatibility)`),cursor:H(F(),R()).optional().describe(`Cursor for keyset pagination`),joins:z(up).optional().describe(`Explicit Table Joins`),aggregations:z(sp).optional().describe(`Aggregation functions`),groupBy:z(op).optional().describe("GROUP BY targets (strings or `{field, dateGranularity?}` objects for date bucketing)"),having:Zf.optional().describe(`HAVING clause for aggregation filtering`),windowFunctions:z(pp).optional().describe(`Window functions with OVER clause`),distinct:L().optional().describe(`SELECT DISTINCT flag`)}),_p=G(()=>gp.extend({expand:zf(()=>H(F(),_p)).optional().describe(`Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select, filter, sort, and further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3.`)})),vp=[`today`,`yesterday`,`tomorrow`,`now`],yp=[`current_week_start`,`current_week_end`,`current_month_start`,`current_month_end`,`current_quarter_start`,`current_quarter_end`,`current_year_start`,`current_year_end`,`last_week_start`,`last_week_end`,`last_month_start`,`last_month_end`,`last_quarter_start`,`last_quarter_end`,`last_year_start`,`last_year_end`,`next_week_start`,`next_week_end`,`next_month_start`,`next_month_end`,`next_quarter_start`,`next_quarter_end`,`next_year_start`,`next_year_end`],bp=[`week_start`,`week_end`,`month_start`,`month_end`,`quarter_start`,`quarter_end`,`year_start`,`year_end`],xp=[...vp,...yp,...bp],Sp=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,Cp=[`minute`,`hour`,`day`,`week`,`month`,`year`];function wp(e){return xp.includes(e)||Sp.test(e)}F().refine(wp,{message:`Unknown date macro. Must be a fixed token (see DATE_MACRO_TOKENS) or match {N_<unit>_(ago|from_now)} where unit is one of: `+Cp.join(`, `)});var Tp=/^\$?\{([a-zA-Z0-9_]+)\}$/;F().refine(e=>{let t=e.match(Tp);return!!t&&wp(t[1])},{message:`Not a recognised {date-macro} placeholder`});var Ep=G(()=>F().min(2,{message:`System identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")`}).describe(`System identifier (lowercase with underscores or dots)`)),Dp=G(()=>F().min(2,{message:`Identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_]*$/,{message:`Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")`}).describe(`Snake case identifier (lowercase with underscores only)`));G(()=>F().min(3,{message:`Event name must be at least 3 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")`}).describe(`Event name (lowercase with dot notation for namespacing)`));var Op=U([`cel`,`js`,`cron`,`template`]),kp=B({rationale:F().optional(),generatedBy:F().optional()}),Ap=B({dialect:Op,source:F().min(1).optional(),ast:R().optional(),meta:kp.optional()}).refine(e=>e.source!==void 0||e.ast!==void 0,{message:"Expression requires at least one of `source` or `ast`"}),jp=V([F().min(1).transform(e=>({dialect:`cel`,source:e})),Ap]);V([F().min(1).transform(e=>({dialect:`cron`,source:e})),Ap]);var Mp=V([F().min(1).transform(e=>({dialect:`template`,source:e})),Ap]),Np=G(()=>U([`aes-256-gcm`,`aes-256-cbc`,`chacha20-poly1305`]).describe(`Supported encryption algorithm`)),Pp=G(()=>U([`local`,`aws-kms`,`azure-key-vault`,`gcp-kms`,`hashicorp-vault`]).describe(`Key management service provider`)),Fp=G(()=>B({enabled:L().default(!1).describe(`Enable automatic key rotation`),frequencyDays:I().min(1).default(90).describe(`Rotation frequency in days`),retainOldVersions:I().default(3).describe(`Number of old key versions to retain`),autoRotate:L().default(!0).describe(`Automatically rotate without manual approval`)}).describe(`Policy for automatic encryption key rotation`)),Ip=G(()=>B({enabled:L().default(!1).describe(`Enable field-level encryption`),algorithm:Np.default(`aes-256-gcm`).describe(`Encryption algorithm`),keyManagement:B({provider:Pp.describe(`Key management service provider`),keyId:F().optional().describe(`Key identifier in the provider`),rotationPolicy:Fp.optional().describe(`Key rotation policy`)}).describe(`Key management configuration`),scope:U([`field`,`record`,`table`,`database`]).describe(`Encryption scope level`),deterministicEncryption:L().default(!1).describe(`Allows equality queries on encrypted data`),searchableEncryption:L().default(!1).describe(`Allows search on encrypted data`)}).describe(`Field-level encryption configuration`));G(()=>B({fieldName:F().describe(`Name of the field to encrypt`),encryptionConfig:Ip.describe(`Encryption settings for this field`),indexable:L().default(!1).describe(`Allow indexing on encrypted field`)}).describe(`Per-field encryption assignment`));var Lp=G(()=>U([`redact`,`partial`,`hash`,`tokenize`,`randomize`,`nullify`,`substitute`]).describe(`Data masking strategy for PII protection`)),Rp=G(()=>B({field:F().describe(`Field name to apply masking to`),strategy:Lp.describe(`Masking strategy to use`),pattern:F().optional().describe(`Regex pattern for partial masking`),preserveFormat:L().default(!0).describe(`Keep the original data format after masking`),preserveLength:L().default(!0).describe(`Keep the original data length after masking`),roles:z(F()).optional().describe(`Roles that see masked data`),exemptRoles:z(F()).optional().describe(`Roles that see unmasked data`)}).describe(`Masking rule for a single field`));G(()=>B({enabled:L().default(!1).describe(`Enable data masking`),rules:z(Rp).describe(`List of field-level masking rules`),auditUnmasking:L().default(!0).describe(`Log when masked data is accessed unmasked`)}).describe(`Top-level data masking configuration for PII protection`));var zp=U(`text.textarea.email.url.phone.password.secret.markdown.html.richtext.number.currency.percent.date.datetime.time.boolean.toggle.select.multiselect.radio.checkboxes.lookup.master_detail.tree.image.file.avatar.video.audio.formula.summary.autonumber.composite.repeater.record.location.address.code.json.color.rating.slider.signature.qrcode.progress.tags.vector`.split(`.`)),Bp=G(()=>B({label:F().describe(`Display label (human-readable, any case allowed)`),value:Ep.describe(`Stored value (lowercase machine identifier)`),color:F().optional().describe(`Color code for badges/charts`),default:L().optional().describe(`Is default option`)}));G(()=>B({latitude:I().min(-90).max(90).describe(`Latitude coordinate`),longitude:I().min(-180).max(180).describe(`Longitude coordinate`),altitude:I().optional().describe(`Altitude in meters`),accuracy:I().optional().describe(`Accuracy in meters`)}));var Vp=G(()=>B({precision:I().int().min(0).max(10).default(2).describe(`Decimal precision (default: 2)`),currencyMode:U([`dynamic`,`fixed`]).default(`dynamic`).describe(`Currency mode: dynamic (user selectable) or fixed (single currency)`),defaultCurrency:F().length(3).default(`CNY`).describe(`Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)`)}));G(()=>B({value:I().describe(`Monetary amount`),currency:F().length(3).describe(`Currency code (ISO 4217)`)})),G(()=>B({street:F().optional().describe(`Street address`),city:F().optional().describe(`City name`),state:F().optional().describe(`State/Province`),postalCode:F().optional().describe(`Postal/ZIP code`),country:F().optional().describe(`Country name or code`),countryCode:F().optional().describe(`ISO country code (e.g., US, GB)`),formatted:F().optional().describe(`Formatted address string`)}));var Hp=G(()=>B({dimensions:I().int().min(1).max(1e4).describe(`Vector dimensionality (e.g., 1536 for OpenAI embeddings)`),distanceMetric:U([`cosine`,`euclidean`,`dotProduct`,`manhattan`]).default(`cosine`).describe(`Distance/similarity metric for vector search`),normalized:L().default(!1).describe(`Whether vectors are normalized (unit length)`),indexed:L().default(!0).describe(`Whether to create a vector index for fast similarity search`),indexType:U([`hnsw`,`ivfflat`,`flat`]).optional().describe(`Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)`)})),Up=G(()=>B({minSize:I().min(0).optional().describe(`Minimum file size in bytes`),maxSize:I().min(1).optional().describe(`Maximum file size in bytes (e.g., 10485760 = 10MB)`),allowedTypes:z(F()).optional().describe(`Allowed file extensions (e.g., [".pdf", ".docx", ".jpg"])`),blockedTypes:z(F()).optional().describe(`Blocked file extensions (e.g., [".exe", ".bat", ".sh"])`),allowedMimeTypes:z(F()).optional().describe(`Allowed MIME types (e.g., ["image/jpeg", "application/pdf"])`),blockedMimeTypes:z(F()).optional().describe(`Blocked MIME types`),virusScan:L().default(!1).describe(`Enable virus scanning for uploaded files`),virusScanProvider:U([`clamav`,`virustotal`,`metadefender`,`custom`]).optional().describe(`Virus scanning service provider`),virusScanOnUpload:L().default(!0).describe(`Scan files immediately on upload`),quarantineOnThreat:L().default(!0).describe(`Quarantine files if threat detected`),storageProvider:F().optional().describe(`Object storage provider name (references ObjectStorageConfig)`),storageBucket:F().optional().describe(`Target bucket name`),storagePrefix:F().optional().describe(`Storage path prefix (e.g., "uploads/documents/")`),imageValidation:B({minWidth:I().min(1).optional().describe(`Minimum image width in pixels`),maxWidth:I().min(1).optional().describe(`Maximum image width in pixels`),minHeight:I().min(1).optional().describe(`Minimum image height in pixels`),maxHeight:I().min(1).optional().describe(`Maximum image height in pixels`),aspectRatio:F().optional().describe(`Required aspect ratio (e.g., "16:9", "1:1")`),generateThumbnails:L().default(!1).describe(`Auto-generate thumbnails`),thumbnailSizes:z(B({name:F().describe(`Thumbnail variant name (e.g., "small", "medium", "large")`),width:I().min(1).describe(`Thumbnail width in pixels`),height:I().min(1).describe(`Thumbnail height in pixels`),crop:L().default(!1).describe(`Crop to exact dimensions`)})).optional().describe(`Thumbnail size configurations`),preserveMetadata:L().default(!1).describe(`Preserve EXIF metadata`),autoRotate:L().default(!0).describe(`Auto-rotate based on EXIF orientation`)}).optional().describe(`Image-specific validation rules`),allowMultiple:L().default(!1).describe(`Allow multiple file uploads (overrides field.multiple)`),allowReplace:L().default(!0).describe(`Allow replacing existing files`),allowDelete:L().default(!0).describe(`Allow deleting uploaded files`),requireUpload:L().default(!1).describe(`Require at least one file when field is required`),extractMetadata:L().default(!0).describe(`Extract file metadata (name, size, type, etc.)`),extractText:L().default(!1).describe(`Extract text content from documents (OCR/parsing)`),versioningEnabled:L().default(!1).describe(`Keep previous versions of replaced files`),maxVersions:I().min(1).optional().describe(`Maximum number of versions to retain`),publicRead:L().default(!1).describe(`Allow public read access to uploaded files`),presignedUrlExpiry:I().min(60).max(604800).default(3600).describe(`Presigned URL expiration in seconds (default: 1 hour)`)}).refine(e=>!(e.minSize!==void 0&&e.maxSize!==void 0&&e.minSize>e.maxSize),{message:`minSize must be less than or equal to maxSize`}).refine(e=>!(e.virusScanProvider!==void 0&&e.virusScan!==!0),{message:`virusScanProvider requires virusScan to be enabled`})),Wp=G(()=>B({uniqueness:L().default(!1).describe(`Enforce unique values across all records`),completeness:I().min(0).max(1).default(0).describe(`Minimum ratio of non-null values (0-1, default: 0 = no requirement)`),accuracy:B({source:F().describe(`Reference data source for validation (e.g., "api.verify.com", "master_data")`),threshold:I().min(0).max(1).describe(`Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)`)}).optional().describe(`Accuracy validation configuration`)})),Gp=G(()=>B({enabled:L().describe(`Enable caching for computed field results`),ttl:I().min(0).describe(`Cache TTL in seconds (0 = no expiration)`),invalidateOn:z(F()).describe(`Field paths that invalidate cache (e.g., ["inventory.quantity", "pricing.base_price"])`)})),Kp=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine name (snake_case)`).optional(),label:F().optional().describe(`Human readable label`),type:zp.describe(`Field Data Type`),description:F().optional().describe(`Tooltip/Help text`),format:F().optional().describe(`Format string (e.g. email, phone)`),columnName:F().optional().describe(`Physical column name in the target datasource. Defaults to the field key when not set.`),required:L().default(!1).describe(`Is required`),searchable:L().default(!1).describe(`Is searchable`),multiple:L().default(!1).describe(`Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.`),unique:L().default(!1).describe(`Is unique constraint`),defaultValue:R().optional().describe(`Default value`),maxLength:I().optional().describe(`Max character length`),minLength:I().optional().describe(`Min character length`),precision:I().optional().describe(`Total digits`),scale:I().optional().describe(`Decimal places`),min:I().optional().describe(`Minimum value`),max:I().optional().describe(`Maximum value`),options:z(Bp).optional().describe(`Static options for select/multiselect`),reference:F().optional().describe(`Target object name (snake_case) for lookup/master_detail fields. Required for relationship types. Used by $expand to resolve foreign key IDs into full objects.`),referenceFilters:z(F()).optional().describe(`Filters applied to lookup dialogs (e.g. "active = true")`),writeRequiresMasterRead:L().optional().describe(`If true, user needs read access to master record to edit this field`),deleteBehavior:U([`set_null`,`cascade`,`restrict`]).optional().default(`set_null`).describe(`What happens if referenced record is deleted`),inlineEdit:V([L(),U([`grid`,`form`])]).optional().describe(`Edit these child records inline within the parent's form (atomic master-detail). true = auto-pick grid/form by child shape; 'grid' = editable line-item grid; 'form' = list + per-row full form.`),inlineTitle:F().optional().describe(`Title for the inline master-detail grid`),inlineColumns:z(Zd()).optional().describe(`Explicit columns for the inline grid (derived from the child object when omitted)`),inlineAmountField:F().optional().describe(`Numeric child field summed for the inline grid total`),relatedList:L().optional().describe(`Show this child collection as a related list on the parent's detail page (read-side mirror of inlineEdit). Defaults to shown for master_detail/lookup; set false to suppress.`),relatedListTitle:F().optional().describe(`Title for the detail-page related list`),relatedListColumns:z(Zd()).optional().describe(`Explicit columns for the detail-page related list (derived from the child object when omitted)`),expression:jp.optional().describe("Formula expression (CEL). e.g. F`record.amount * 0.1`"),summaryOperations:B({object:F().describe(`Source child object name for roll-up`),field:F().describe(`Field on child object to aggregate (ignored for count)`),function:U([`count`,`sum`,`min`,`max`,`avg`]).describe(`Aggregation function to apply`),relationshipField:F().optional().describe(`FK field on the child pointing back to this parent. Auto-detected from the child's lookup/master_detail field referencing this object when omitted; set explicitly only when the child has more than one such reference.`)}).optional().describe(`Roll-up summary definition. The engine recomputes the value when child records are inserted/updated/deleted.`),language:F().optional().describe(`Programming language for syntax highlighting (e.g., javascript, python, sql)`),theme:F().optional().describe(`Code editor theme (e.g., dark, light, monokai)`),lineNumbers:L().optional().describe(`Show line numbers in code editor`),maxRating:I().optional().describe(`Maximum rating value (default: 5)`),allowHalf:L().optional().describe(`Allow half-star ratings`),displayMap:L().optional().describe(`Display map widget for location field`),allowGeocoding:L().optional().describe(`Allow address-to-coordinate conversion`),addressFormat:U([`us`,`uk`,`international`]).optional().describe(`Address format template`),colorFormat:U([`hex`,`rgb`,`rgba`,`hsl`]).optional().describe(`Color value format`),allowAlpha:L().optional().describe(`Allow transparency/alpha channel`),presetColors:z(F()).optional().describe(`Preset color options`),step:I().optional().describe(`Step increment for slider (default: 1)`),showValue:L().optional().describe(`Display current value on slider`),marks:H(F(),F()).optional().describe(`Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})`),barcodeFormat:U([`qr`,`ean13`,`ean8`,`code128`,`code39`,`upca`,`upce`]).optional().describe(`Barcode format type`),qrErrorCorrection:U([`L`,`M`,`Q`,`H`]).optional().describe(`QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"`),displayValue:L().optional().describe(`Display human-readable value below barcode/QR code`),allowScanning:L().optional().describe(`Enable camera scanning for barcode/QR code input`),currencyConfig:Vp.optional().describe(`Configuration for currency field type`),vectorConfig:Hp.optional().describe(`Configuration for vector field type (AI/ML embeddings)`),fileAttachmentConfig:Up.optional().describe(`Configuration for file and attachment field types`),encryptionConfig:Ip.optional().describe(`Field-level encryption configuration for sensitive data (GDPR/HIPAA/PCI-DSS)`),maskingRule:Rp.optional().describe(`Data masking rules for PII protection`),auditTrail:L().default(!1).describe(`Enable detailed audit trail for this field (tracks all changes with user and timestamp)`),dependencies:z(F()).optional().describe(`Array of field names that this field depends on (for formulas, visibility rules, etc.)`),cached:Gp.optional().describe(`Caching configuration for computed/formula fields`),dataQuality:Wp.optional().describe(`Data quality validation and monitoring rules`),group:F().optional().describe(`Field group name for organizing fields in forms and layouts (e.g., "contact_info", "billing", "system")`),visibleWhen:jp.optional().describe("Predicate (CEL) — field is shown only when TRUE (else hidden). e.g. P`record.type == 'invoice'`"),readonlyWhen:jp.optional().describe("Predicate (CEL) — field is read-only when TRUE. e.g. P`record.status == 'paid'`"),requiredWhen:jp.optional().describe("Predicate (CEL) — field is required when TRUE. Canonical name for `conditionalRequired`."),conditionalRequired:jp.optional().describe("Predicate (CEL) — field is required when TRUE. Alias of `requiredWhen`."),hidden:L().default(!1).describe(`Hidden from default UI`),readonly:L().default(!1).describe(`Read-only in UI`),system:L().optional().describe(`Auto-injected system/audit field (e.g. created_at, updated_by, organization_id). Tools that surface system fields separately from author-declared business fields should branch on this flag.`),sortable:L().optional().default(!0).describe(`Whether field is sortable in list views`),inlineHelpText:F().optional().describe(`Help text displayed below the field in forms`),trackFeedHistory:L().optional().describe(`Track field changes in Chatter/activity feed (Salesforce pattern)`),caseSensitive:L().optional().describe(`Whether text comparisons are case-sensitive`),autonumberFormat:F().optional().describe(`Auto-number display format pattern (e.g., "CASE-{0000}")`),index:L().default(!1).describe(`Create standard database index`),externalId:L().default(!1).describe(`Is external ID for upsert operations`)})),qp=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique rule name (snake_case)`),label:F().optional().describe(`Human-readable label for the rule listing`),description:F().optional().describe(`Administrative notes explaining the business reason`),active:L().default(!0),events:z(U([`insert`,`update`,`delete`])).default([`insert`,`update`]).describe(`Validation contexts`),priority:I().int().min(0).max(9999).default(100).describe(`Execution priority (lower runs first, default: 100)`),tags:z(F()).optional().describe(`Categorization tags (e.g., "compliance", "billing")`),severity:U([`error`,`warning`,`info`]).default(`error`),message:F().describe(`Error message to display to the user`)}),Jp=G(()=>qp.extend({type:W(`script`),condition:jp.describe("Predicate (CEL). If TRUE, validation fails. e.g. P`record.amount < 0`")})),Yp=G(()=>qp.extend({type:W(`state_machine`),field:F().describe(`State field (e.g. status)`),transitions:H(F(),z(F())).describe(`Map of { OldState: [AllowedNewStates] }`)})),Xp=G(()=>qp.extend({type:W(`format`),field:F(),regex:F().optional(),format:U([`email`,`url`,`phone`,`json`]).optional()})),Zp=G(()=>qp.extend({type:W(`cross_field`),condition:jp.describe("Predicate (CEL) comparing fields. e.g. P`record.end_date > record.start_date`"),fields:z(F()).describe(`Fields involved in the validation`)})),Qp=G(()=>qp.extend({type:W(`json_schema`),field:F().describe(`JSON field to validate`),schema:H(F(),R()).describe(`JSON Schema object definition`)})),$p=zf(()=>uf(`type`,[Jp,Yp,Xp,Zp,Qp,em])),em=G(()=>qp.extend({type:W(`conditional`),when:jp.describe("Predicate (CEL). e.g. P`record.type == 'enterprise'`"),then:$p.describe(`Validation rule to apply when condition is true`),otherwise:$p.optional().describe(`Validation rule to apply when condition is false`)}));G(()=>B({key:F().describe(`Translation key (e.g., "views.task_list.label")`),defaultValue:F().optional().describe(`Fallback value when translation key is not found`),params:H(F(),V([F(),I(),L()])).optional().describe(`Interpolation parameters (e.g., { count: 5 })`)}));var tm=G(()=>F().describe(`Display label (plain string; i18n keys are auto-generated by the framework)`)),nm=G(()=>B({ariaLabel:tm.optional().describe(`Accessible label for screen readers (WAI-ARIA aria-label)`),ariaDescribedBy:F().optional().describe(`ID of element providing additional description (WAI-ARIA aria-describedby)`),role:F().optional().describe(`WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")`)}).describe(`ARIA accessibility attributes`));G(()=>B({key:F().describe(`Translation key`),zero:F().optional().describe(`Zero form (e.g., "No items")`),one:F().optional().describe(`Singular form (e.g., "{count} item")`),two:F().optional().describe(`Dual form (e.g., "{count} items" for exactly 2)`),few:F().optional().describe(`Few form (e.g., for 2-4 in some languages)`),many:F().optional().describe(`Many form (e.g., for 5+ in some languages)`),other:F().describe(`Default plural form (e.g., "{count} items")`)}).describe(`ICU plural rules for a translation key`));var rm=G(()=>B({style:U([`decimal`,`currency`,`percent`,`unit`]).default(`decimal`).describe(`Number formatting style`),currency:F().optional().describe(`ISO 4217 currency code (e.g., "USD", "EUR")`),unit:F().optional().describe(`Unit for unit formatting (e.g., "kilometer", "liter")`),minimumFractionDigits:I().optional().describe(`Minimum number of fraction digits`),maximumFractionDigits:I().optional().describe(`Maximum number of fraction digits`),useGrouping:L().optional().describe(`Whether to use grouping separators (e.g., 1,000)`)}).describe(`Number formatting rules`)),im=G(()=>B({dateStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Date display style`),timeStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Time display style`),timeZone:F().optional().describe(`IANA time zone (e.g., "America/New_York")`),hour12:L().optional().describe(`Use 12-hour format`)}).describe(`Date/time formatting rules`));G(()=>B({code:F().describe(`BCP 47 language code (e.g., "en-US", "zh-CN")`),fallbackChain:z(F()).optional().describe(`Fallback language codes in priority order (e.g., ["zh-TW", "en"])`),direction:U([`ltr`,`rtl`]).default(`ltr`).describe(`Text direction: left-to-right or right-to-left`),numberFormat:rm.optional().describe(`Default number formatting rules`),dateFormat:im.optional().describe(`Default date/time formatting rules`)}).describe(`Locale configuration`));var am=U([`api.read`,`api.write`,`crypto.uuid`,`crypto.hash`,`log`]),om=uf(`language`,[B({language:W(`expression`),source:F().min(1).describe(`Formula expression source`)}).describe(`L1 expression body — pure formula, no IO`),B({language:W(`js`),source:F().min(1).describe(`Function body source`),capabilities:z(am).default([]).describe(`Granted capability tokens`),timeoutMs:I().int().positive().max(3e4).optional().describe(`Per-invocation timeout (ms)`),memoryMb:I().int().positive().max(256).optional().describe(`Per-invocation memory cap (MB)`)}).describe(`L2 sandboxed JS body — runs inside an isolated VM with declared capabilities`)]).describe(`Hook/Action body — expression (L1) or sandboxed JS (L2)`),sm=G(()=>B({name:F().optional(),field:Dp.optional(),objectOverride:Dp.optional(),label:tm.optional(),type:zp.optional(),required:L().optional().default(!1),options:z(B({label:tm,value:F()})).optional(),placeholder:F().optional(),helpText:F().optional(),defaultValue:R().optional(),defaultFromRow:L().optional()}).refine(e=>!!e.name||!!e.field,{message:`ActionParam requires either "name" or "field"`})),cm=U([`script`,`url`,`modal`,`flow`,`api`,`form`]),lm=new Set(cm.options.filter(e=>e!==`script`)),um=U([`list_toolbar`,`list_item`,`record_header`,`record_more`,`record_related`,`record_section`,`global_nav`]),dm=U([`data`,`action`,`flow`,`integration`,`vector_search`,`analytics`,`utility`]),fm=B({exposed:L().default(!1).describe("Expose this action to AI agents. Requires `description` when true."),description:F().min(40).optional().describe(`LLM-facing description (≥40 chars). Required when exposed.`),category:dm.optional().describe(`Tool category override (defaults to "action").`),paramHints:H(F(),B({description:F().optional(),enum:z(V([F(),I()])).optional(),examples:z(R()).optional()})).optional().describe(`Per-parameter AI hints keyed by param name.`),outputSchema:H(F(),R()).optional().describe(`JSON Schema for the action return value.`),requiresConfirmation:L().optional().describe(`Override HITL confirmation for AI invocations.`)}),pm=G(()=>B({name:Dp.describe(`Machine name (lowercase snake_case)`),label:tm.describe(`Display label`),objectName:F().regex(/^[a-z_][a-z0-9_]*$/).optional().describe(`Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack().`),icon:F().optional().describe(`Icon name`),locations:z(um).optional().describe(`Locations where this action is visible`),component:U([`action:button`,`action:icon`,`action:menu`,`action:group`]).optional().describe(`Visual component override`),type:cm.default(`script`).describe(`Action functionality type`),target:F().optional().describe("URL, Script Name, Flow ID, or API Endpoint. Supports ${param.X} and ${ctx.X} interpolation."),body:om.optional().describe("Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`."),execute:F().optional().describe(`@deprecated — Use target instead. Auto-migrated to target during parsing.`),params:z(sm).optional().describe(`Input parameters required from user`),variant:U([`primary`,`secondary`,`danger`,`ghost`,`link`]).optional().describe(`Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)`),confirmText:tm.optional().describe(`Confirmation message before execution`),successMessage:tm.optional().describe(`Success message to show after execution`),refreshAfter:L().default(!1).describe(`Refresh view after execution`),resultDialog:B({title:tm.optional(),description:tm.optional(),acknowledge:tm.optional().describe(`Acknowledge button label, e.g. "I have saved this"`),format:U([`qrcode`,`code-list`,`secret`,`text`,`json`]).optional().describe(`Default format for fields without their own format. Defaults to json when omitted.`),fields:z(B({path:F().describe(`Dot path into result.data (e.g. "totpURI", "client.client_secret").`),label:tm.optional(),format:U([`qrcode`,`code-list`,`secret`,`text`,`json`]).optional().describe(`Per-field format override.`)})).optional().describe(`Which fields from result.data to render. Omit to dump full JSON.`)}).optional().describe(`Render API response in a one-shot reveal dialog (suppresses successMessage when set).`),visible:jp.optional().describe(`Visibility predicate (CEL).`),disabled:V([L(),jp]).optional().describe(`Boolean or predicate (CEL) — action is disabled when TRUE.`),shortcut:F().optional().describe(`Keyboard shortcut to trigger this action (e.g., "Ctrl+S")`),bulkEnabled:L().optional().describe(`Whether this action can be applied to multiple selected records`),ai:fm.optional().describe(`AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents.`),recordIdParam:F().optional().describe(`Body key to inject the row id into when running from a list_item context.`),recordIdField:F().optional().describe(`Row field whose value seeds recordIdParam. Defaults to "id".`),bodyShape:V([W(`flat`),B({wrap:F()})]).optional().describe(`Body wrapping: flat (default) or { wrap: key } to nest user-collected params under a key.`),method:U([`POST`,`PATCH`,`PUT`,`DELETE`]).optional().describe(`HTTP method for type:"api" actions. Defaults to POST.`),bodyExtra:H(F(),R()).optional().describe(`Constant body fields merged into the API request (applied last; overrides user params).`),mode:U([`create`,`edit`,`delete`,`custom`]).optional().describe(`Semantic mode of the action.`),timeout:I().optional().describe(`Maximum execution time in milliseconds for the action`),aria:nm.optional().describe(`ARIA accessibility attributes`)}).transform(e=>e.execute&&!e.target?{...e,target:e.execute}:e).refine(e=>!(lm.has(e.type)&&!e.target),{message:`Action 'target' is required when type is 'url', 'flow', 'modal', 'api', or 'form'.`,path:[`target`]}).refine(e=>!(e.ai?.exposed===!0&&!e.ai.description),{message:`ai.description is required (≥40 chars) when ai.exposed is true.`,path:[`ai`,`description`]}).refine(e=>{let t=e.ai?.paramHints;if(!t)return!0;let n=new Set([`recordId`]);for(let t of e.params??[]){let e=t.name??t.field;e&&n.add(e)}return Object.keys(t).every(e=>n.has(e))},{message:`ai.paramHints keys must match a declared param name (or "recordId").`,path:[`ai`,`paramHints`]})),mm=U([`none`,`no-overlay`,`no-delete`,`full`]),hm=U([`artifact`,`package`,`env-forced`]),gm=U([`package`,`org`,`env-forced`]),_m={_lock:mm.optional().describe(`Item-level lock — controls overlay & delete (ADR-0010).`),_lockReason:F().max(500).optional().describe(`Human-readable reason shown when a write is refused by _lock.`),_lockSource:hm.optional().describe(`Layer that set _lock (artifact | package | env-forced).`),_provenance:gm.optional().describe(`Origin of the item (package | org | env-forced).`),_packageId:F().optional().describe(`Owning package machine id.`),_packageVersion:F().optional().describe(`Owning package version.`),_lockDocsUrl:F().optional().describe(`Optional documentation link surfaced next to _lockReason.`)},vm=B({lock:mm.describe(`Lock policy — none | no-overlay | no-delete | full.`),reason:F().min(1).max(500).describe(`User-visible reason shown when the lock blocks an action.`),docsUrl:F().url().optional().describe(`Optional URL the Studio banner links to for more context.`)}).strict(),ym=G(()=>B({enabled:L().default(!1).describe(`Enable public sharing`),publicLink:F().optional().describe(`Generated public share URL`),password:F().optional().describe(`Password required to access shared link`),allowedDomains:z(F()).optional().describe(`Restrict access to specific email domains (e.g. ["example.com"])`),expiresAt:F().optional().describe(`Expiration date/time in ISO 8601 format`),allowAnonymous:L().optional().default(!1).describe(`Allow access without authentication`)}));G(()=>B({enabled:L().default(!1).describe(`Enable iframe embedding`),allowedOrigins:z(F()).optional().describe(`Allowed iframe parent origins (e.g. ["https://example.com"])`),width:F().optional().default(`100%`).describe(`Embed width (CSS value)`),height:F().optional().default(`600px`).describe(`Embed height (CSS value)`),showHeader:L().optional().default(!0).describe(`Show interface header in embed`),showNavigation:L().optional().default(!1).describe(`Show navigation in embed`),responsive:L().optional().default(!0).describe(`Enable responsive resizing`)}));var bm=U([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),xm=G(()=>B({xs:I().min(1).max(12).optional(),sm:I().min(1).max(12).optional(),md:I().min(1).max(12).optional(),lg:I().min(1).max(12).optional(),xl:I().min(1).max(12).optional(),"2xl":I().min(1).max(12).optional()}).describe(`Grid columns per breakpoint (1-12)`)),Sm=G(()=>B({xs:I().optional(),sm:I().optional(),md:I().optional(),lg:I().optional(),xl:I().optional(),"2xl":I().optional()}).describe(`Display order per breakpoint`)),Cm=G(()=>B({breakpoint:bm.optional().describe(`Minimum breakpoint for visibility`),hiddenOn:z(bm).optional().describe(`Hide on these breakpoints`),columns:xm.optional().describe(`Grid columns per breakpoint`),order:Sm.optional().describe(`Display order per breakpoint`)}).describe(`Responsive layout configuration`)),wm=G(()=>B({lazyLoad:L().optional().describe(`Enable lazy loading (defer rendering until visible)`),virtualScroll:B({enabled:L().default(!1).describe(`Enable virtual scrolling`),itemHeight:I().optional().describe(`Fixed item height in pixels (for estimation)`),overscan:I().optional().describe(`Number of extra items to render outside viewport`)}).optional().describe(`Virtual scrolling configuration`),cacheStrategy:U([`none`,`cache-first`,`network-first`,`stale-while-revalidate`]).optional().describe(`Client-side data caching strategy`),prefetch:L().optional().describe(`Prefetch data before component is visible`),pageSize:I().optional().describe(`Number of items per page for pagination`),debounceMs:I().optional().describe(`Debounce interval for user interactions in milliseconds`)}).describe(`Performance optimization configuration`)),Tm=U([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`]),Em=G(()=>U([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`])),Dm=G(()=>B({url:F().describe(`API endpoint URL`),method:Em.optional().default(`GET`).describe(`HTTP method`),headers:H(F(),F()).optional().describe(`Custom HTTP headers`),params:H(F(),R()).optional().describe(`Query parameters`),body:R().optional().describe(`Request body for POST/PUT/PATCH`)}));G(()=>B({enabled:L().default(!0).describe(`Enable CORS`),origins:V([F(),z(F())]).default(`*`).describe(`Allowed origins (* for all)`),methods:z(Tm).optional().describe(`Allowed HTTP methods`),credentials:L().default(!1).describe(`Allow credentials (cookies, authorization headers)`),maxAge:I().int().optional().describe(`Preflight cache duration in seconds`)})),G(()=>B({enabled:L().default(!1).describe(`Enable rate limiting`),windowMs:I().int().default(6e4).describe(`Time window in milliseconds`),maxRequests:I().int().default(100).describe(`Max requests per window`)})),G(()=>B({path:F().describe(`URL path to serve from`),directory:F().describe(`Physical directory to serve`),cacheControl:F().optional().describe(`Cache-Control header value`)}));var Om=G(()=>uf(`provider`,[B({provider:W(`object`),object:F().describe(`Target object name`)}),B({provider:W(`api`),read:Dm.optional().describe(`Configuration for fetching data`),write:Dm.optional().describe(`Configuration for submitting data (for forms/editable tables)`)}),B({provider:W(`value`),items:z(R()).describe(`Static data array`)}),B({provider:W(`schema`),schemaId:F().describe(`Schema identifier — typically the metadata type name`),schema:H(F(),R()).optional().describe(`Inline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.`)})])),km=G(()=>B({field:F().describe(`Field name to filter on`),operator:F().describe(`Filter operator (e.g. equals, not_equals, contains, this_quarter)`),value:V([F(),I(),L(),Yd(),z(V([F(),I()]))]).optional().describe(`Filter value`)}).describe(`View filter rule`)),Am=G(()=>U([`none`,`count`,`count_empty`,`count_filled`,`count_unique`,`percent_empty`,`percent_filled`,`sum`,`avg`,`min`,`max`]).describe(`Aggregation function for column footer summary`)),jm=G(()=>B({field:F().describe(`Field name (snake_case)`),label:tm.optional().describe(`Display label override`),width:I().positive().optional().describe(`Column width in pixels`),align:U([`left`,`center`,`right`]).optional().describe(`Text alignment`),hidden:L().optional().describe(`Hide column by default`),sortable:L().optional().describe(`Allow sorting by this column`),resizable:L().optional().describe(`Allow resizing this column`),wrap:L().optional().describe(`Allow text wrapping`),type:F().optional().describe(`Renderer type override (e.g., "currency", "date")`),pinned:U([`left`,`right`]).optional().describe(`Pin/freeze column to left or right side`),summary:Am.optional().describe(`Footer aggregation function for this column`),link:L().optional().describe(`Functions as the primary navigation link (triggers View navigation)`),action:F().optional().describe(`Registered Action ID to execute when clicked`)})),Mm=G(()=>B({type:U([`none`,`single`,`multiple`]).default(`none`).describe(`Selection mode`)})),Nm=G(()=>B({pageSize:I().int().positive().default(25).describe(`Number of records per page`),pageSizeOptions:z(I().int().positive()).optional().describe(`Available page size options`)})),Pm=G(()=>U([`compact`,`short`,`medium`,`tall`,`extra_tall`]).describe(`Row height / density setting for list view`)),Fm=G(()=>B({field:F().describe(`Field name to group by`),order:U([`asc`,`desc`]).default(`asc`).describe(`Group sort order`),collapsed:L().default(!1).describe(`Collapse groups by default`)})),Im=G(()=>B({fields:z(Fm).min(1).describe(`Fields to group by (supports up to 3 levels)`)}).describe(`Record grouping configuration`)),Lm=G(()=>B({coverField:F().optional().describe(`Attachment/image field to display as card cover`),coverFit:U([`cover`,`contain`]).default(`cover`).describe(`Image fit mode for card cover`),cardSize:U([`small`,`medium`,`large`]).default(`medium`).describe(`Card size in gallery view`),titleField:F().optional().describe(`Field to display as card title`),visibleFields:z(F()).optional().describe(`Fields to display on card body`)}).describe(`Gallery/card view configuration`)),Rm=G(()=>B({startDateField:F().describe(`Field for timeline item start date`),endDateField:F().optional().describe(`Field for timeline item end date`),titleField:F().describe(`Field to display as timeline item title`),groupByField:F().optional().describe(`Field to group timeline rows`),colorField:F().optional().describe(`Field to determine item color`),scale:U([`hour`,`day`,`week`,`month`,`quarter`,`year`]).default(`week`).describe(`Default timeline scale`)}).describe(`Timeline view configuration`)),zm=G(()=>B({type:U([`personal`,`collaborative`]).default(`collaborative`).describe(`View ownership type`),lockedBy:F().optional().describe(`User who locked the view configuration`)}).describe(`View sharing and access configuration`)),Bm=G(()=>B({field:F().describe(`Field to derive color from (typically a select/status field)`),colors:H(F(),F()).optional().describe(`Map of field value to color (hex/token)`)}).describe(`Row color configuration based on field values`)),Vm=G(()=>U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`]).describe(`Visualization type that users can switch to`)),Hm=G(()=>B({sort:L().default(!0).describe(`Allow users to sort records`),search:L().default(!0).describe(`Allow users to search records`),filter:L().default(!0).describe(`Allow users to filter records`),rowHeight:L().default(!0).describe(`Allow users to toggle row height/density`),addRecordForm:L().default(!1).describe(`Add records through a form instead of inline`),buttons:z(F()).optional().describe(`Custom action button IDs to show in the toolbar`)}).describe(`User action toggles for the view toolbar`)),Um=G(()=>B({showDescription:L().default(!0).describe(`Show the view description text`),allowedVisualizations:z(Vm).optional().describe(`Whitelist of visualization types users can switch between (e.g. ["grid", "gallery", "kanban"])`)}).describe(`Appearance and visualization configuration`)),Wm=G(()=>B({name:Dp.describe(`Tab identifier (snake_case)`),label:tm.optional().describe(`Display label`),icon:F().optional().describe(`Tab icon name`),view:F().optional().describe(`Referenced list view name from listViews`),filter:z(km).optional().describe(`Tab-specific filter criteria`),order:I().int().min(0).optional().describe(`Tab display order`),pinned:L().default(!1).describe(`Pin tab (cannot be removed by users)`),isDefault:L().default(!1).describe(`Set as the default active tab`),visible:L().default(!0).describe(`Tab visibility`)}).describe(`Tab configuration for multi-tab view interface`)),Gm=G(()=>B({enabled:L().default(!0).describe(`Show the add record entry point`),position:U([`top`,`bottom`,`both`]).default(`bottom`).describe(`Position of the add record button`),mode:U([`inline`,`form`,`modal`]).default(`inline`).describe(`How to add a new record`),formView:F().optional().describe(`Named form view to use when mode is "form" or "modal"`)}).describe(`Add record entry point configuration`)),Km=G(()=>B({groupByField:F().describe(`Field to group columns by (usually status/select)`),summarizeField:F().optional().describe(`Field to sum at top of column (e.g. amount)`),columns:z(F()).describe(`Fields to show on cards`)})),qm=G(()=>B({chartType:U([`bar`,`line`,`pie`,`area`,`scatter`]).default(`bar`).describe(`Chart visualisation type`),dataset:Dp.describe(`Dataset name to bind (ADR-0021)`),dimensions:z(F()).optional().describe(`Dimension names — X/group/split`),values:z(F()).min(1).describe(`Measure names — Y (at least one)`)}).describe(`List chart view configuration`)),Jm=G(()=>B({startDateField:F(),endDateField:F().optional(),titleField:F(),colorField:F().optional()})),Ym=G(()=>B({startDateField:F(),endDateField:F(),titleField:F(),progressField:F().optional(),dependenciesField:F().optional()})),Xm=G(()=>U([`page`,`drawer`,`modal`,`split`,`popover`,`new_window`,`none`])),Zm=G(()=>B({mode:Xm.default(`page`),view:F().optional().describe(`Name of the form view to use for details (e.g. "summary_view", "edit_form")`),preventNavigation:L().default(!1).describe(`Disable standard navigation entirely`),openNewTab:L().default(!1).describe(`Force open in new tab (applies to page mode)`),width:V([F(),I()]).optional().describe(`Width of the drawer/modal (e.g. "600px", "50%")`)})),Qm=G(()=>B({name:Dp.optional().describe(`Internal view name (lowercase snake_case)`),label:tm.optional(),type:U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`,`chart`]).default(`grid`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),columns:V([z(F()),z(jm)]).describe(`Fields to display as columns`),filter:z(km).optional().describe(`Filter criteria (JSON Rules)`),sort:V([F(),z(B({field:F(),order:U([`asc`,`desc`])}))]).optional(),searchableFields:z(F()).optional().describe(`Fields enabled for search`),filterableFields:z(F()).optional().describe(`Fields enabled for end-user filtering in the top bar`),resizable:L().optional().describe(`Enable column resizing`),striped:L().optional().describe(`Striped row styling`),bordered:L().optional().describe(`Show borders`),compactToolbar:L().optional().describe(`Collapse Group/Color/Density/Hide-fields into a single View settings popover`),selection:Mm.optional().describe(`Row selection configuration`),navigation:Zm.optional().describe(`Configuration for item click navigation (page, drawer, modal, etc.)`),pagination:Nm.optional().describe(`Pagination configuration`),kanban:Km.optional(),calendar:Jm.optional(),gantt:Ym.optional(),gallery:Lm.optional(),timeline:Rm.optional(),chart:qm.optional(),description:tm.optional().describe(`View description for documentation/tooltips`),sharing:zm.optional().describe(`View sharing and access configuration`),rowHeight:Pm.optional().describe(`Row height / density setting`),grouping:Im.optional().describe(`Group records by one or more fields`),rowColor:Bm.optional().describe(`Color rows based on field value`),hiddenFields:z(F()).optional().describe(`Fields to hide in this specific view`),fieldOrder:z(F()).optional().describe(`Explicit field display order for this view`),rowActions:z(F()).optional().describe(`Actions available for individual row items`),bulkActions:z(F()).optional().describe(`Actions available when multiple rows are selected`),bulkActionDefs:z(H(F(),Zd())).optional().describe(`Rich bulk action definitions (schema-driven, executed via BulkActionDialog)`),virtualScroll:L().optional().describe(`Enable virtual scrolling for large datasets`),conditionalFormatting:z(B({condition:jp.describe(`Predicate (CEL) to evaluate.`),style:H(F(),F()).describe(`CSS styles to apply when condition is true`)})).optional().describe(`Conditional formatting rules for list rows`),inlineEdit:L().optional().describe(`Allow inline editing of records directly in the list view`),exportOptions:z(U([`csv`,`xlsx`,`pdf`,`json`])).optional().describe(`Available export format options`),userActions:Hm.optional().describe(`User action toggles for the view toolbar`),appearance:Um.optional().describe(`Appearance and visualization configuration`),tabs:z(Wm).optional().describe(`Tab definitions for multi-tab view interface`),addRecord:Gm.optional().describe(`Add record entry point configuration`),showRecordCount:L().optional().describe(`Show record count at the bottom of the list`),allowPrinting:L().optional().describe(`Allow users to print the view`),emptyState:B({title:tm.optional(),message:tm.optional(),icon:F().optional()}).optional().describe(`Empty state configuration when no records found`),aria:nm.optional().describe(`ARIA accessibility attributes for the list view`),responsive:Cm.optional().describe(`Responsive layout configuration`),performance:wm.optional().describe(`Performance optimization settings`)})),$m=G(()=>B({field:F().describe(`Field name (snake_case)`),type:zp.optional().describe(`Field type (auto-infers widget if omitted)`),options:z(Bp).optional().describe(`Options for select/multiselect/radio/checkboxes fields`),reference:F().optional().describe(`Target object name for lookup/master_detail fields`),maxLength:I().optional().describe(`Maximum character length (for text/textarea/email/url/phone)`),minLength:I().optional().describe(`Minimum character length`),min:I().optional().describe(`Minimum value (for number/currency/percent/slider)`),max:I().optional().describe(`Maximum value`),precision:I().optional().describe(`Total digits (for number/currency)`),scale:I().optional().describe(`Decimal places`),multiple:L().optional().describe(`Allow multiple values (for select/lookup/file/image)`),label:tm.optional().describe(`Display label override`),placeholder:tm.optional().describe(`Placeholder text`),helpText:tm.optional().describe(`Help/hint text`),readonly:L().optional().describe(`Read-only override`),immutable:L().optional().describe(`Editable on create, locked once the record exists (e.g. machine names).`),required:L().optional().describe(`Required override`),hidden:L().optional().describe(`Hidden override`),colSpan:I().int().min(1).max(4).optional().describe(`Column span in grid layout (1-4)`),widget:F().optional().describe(`Custom widget/component name (overrides type-based inference)`),language:F().optional().describe(`Code editor language (for type=code)`),fields:z(zf(()=>$m)).optional().describe(`Sub-fields for composite/repeater/record types`),keyField:B({field:F().default(`name`).describe(`Property name that holds the key inside each item (defaults to "name")`),label:tm.optional().describe(`Display label for the key column`),placeholder:tm.optional().describe(`Placeholder when entering a new key`),helpText:tm.optional().describe(`Help text under the key input`),regex:F().optional().describe(`JS regex source string the key must match (no flags)`),immutable:L().default(!0).describe(`If true, the key is read-only after creation`)}).optional().describe(`Key column config for record-typed fields`),dependsOn:F().optional().describe(`Parent field name for cascading`),visibleOn:jp.optional().describe(`Visibility predicate (CEL).`)})),eh=G(()=>B({name:F().optional().describe(`Stable section identifier for i18n lookup (snake_case)`),label:tm.optional(),description:F().optional().describe(`Optional description rendered under the section header.`),collapsible:L().default(!1),collapsed:L().default(!1),visibleOn:jp.optional().describe(`Visibility predicate (CEL). Hides the whole section when false.`),columns:V([U([`1`,`2`,`3`,`4`]),W(1),W(2),W(3),W(4)]).default(1).transform(e=>typeof e==`string`?parseInt(e):e),fields:z(V([F(),$m]))})),th=G(()=>B({type:U([`simple`,`tabbed`,`wizard`,`split`,`drawer`,`modal`]).default(`simple`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),sections:z(eh).optional(),groups:z(eh).optional(),subforms:z(B({childObject:F().describe(`Child object whose records are entered inline`),relationshipField:F().optional().describe(`FK on the child pointing back to the parent (auto-detected when omitted)`),columns:z(Zd()).optional().describe(`Editable grid columns (derived from the child object when omitted)`),amountField:F().optional().describe(`Numeric child column summed for the running total`),totalField:F().optional().describe(`Parent field to receive the rolled-up sum`),title:F().optional().describe(`Section title`),addLabel:F().optional().describe(`Add-row button label`),minRows:I().optional(),maxRows:I().optional()})).optional().describe(`Inline master-detail child collections`),defaultSort:z(B({field:F().describe(`Field name to sort by`),order:U([`asc`,`desc`]).default(`desc`).describe(`Sort direction`)})).optional().describe(`Default sort order for related list views within this form`),sharing:ym.optional().describe(`Public sharing configuration for this form`),submitBehavior:V([B({kind:W(`thank-you`),title:F().optional(),message:F().optional()}),B({kind:W(`redirect`),url:F(),delayMs:I().int().min(0).optional()}),B({kind:W(`continue`)}),B({kind:W(`next-record`)})]).optional().describe(`Post-submit behavior`),aria:nm.optional().describe(`ARIA accessibility attributes for the form view`)}));G(()=>B({list:Qm.optional(),form:th.optional(),listViews:H(F(),Qm).optional().describe(`Additional named list views`),formViews:H(F(),th).optional().describe(`Additional named form views`),protection:vm.optional().describe(`Package author protection block — lock policy for this view.`),..._m}));var nh=F().regex(/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/,`View item name must be a dotted snake_case qualified name, e.g. "crm_lead.pipeline".`).describe("Globally-unique view id, `<object>.<viewKey>`."),rh=U([`package`,`shared`,`personal`]).describe(`View identity layer: package | shared | personal.`);U([`list`,`form`]).describe("Whether `config` is a ListView (list family) or a FormView.");function ih(){return{name:nh,object:F().describe(`Bound object name — the foreign key used to aggregate views.`),label:tm.optional().describe(`Display label (supports i18n).`),isDefault:L().optional().describe(`Whether this is the object's default view in the switcher.`),order:I().int().optional().describe(`Sort order within the object's view switcher / left rail.`),scope:rh.optional().describe("Identity layer (defaults to `package` for source-loaded views)."),owner:F().optional().describe("Owner user id — set when `scope` is `personal`."),hidden:L().optional().describe(`Hidden from the switcher (per-user / per-org declutter).`),protection:vm.optional().describe(`Package author protection block — lock policy for this view.`),..._m}}G(()=>uf(`viewKind`,[B({viewKind:W(`list`),config:Qm.describe(`List-family view configuration.`),...ih()}),B({viewKind:W(`form`),config:th.describe(`Form view configuration.`),...ih()})]));function ah(e){let{schemaId:t,...n}=e;return th.parse({...n,data:{provider:`schema`,schemaId:t}})}var oh=U([`get`,`list`,`create`,`update`,`delete`,`upsert`,`bulk`,`aggregate`,`history`,`search`,`restore`,`purge`,`import`,`export`]),sh=B({trackHistory:L().default(!1).describe(`Enable field history tracking for audit compliance`),searchable:L().default(!0).describe(`Index records for global search`),apiEnabled:L().default(!0).describe(`Expose object via automatic APIs`),apiMethods:z(oh).optional().describe(`Whitelist of allowed API operations`),files:L().default(!1).describe(`Enable file attachments and document management`),feeds:L().default(!1).describe(`Enable social feed, comments, and mentions (Chatter-like)`),activities:L().default(!1).describe(`Enable standard tasks and events tracking`),trash:L().default(!0).describe(`Enable soft-delete with restore capability`),mru:L().default(!0).describe(`Track Most Recently Used (MRU) list for users`),clone:L().default(!0).describe(`Allow record deep cloning`)}),ch=G(()=>B({name:F().optional().describe(`Index name (auto-generated if not provided)`),fields:z(F()).describe(`Fields included in the index`),type:U([`btree`,`hash`,`gin`,`gist`,`fulltext`]).optional().default(`btree`).describe(`Index algorithm type`),unique:L().optional().default(!1).describe(`Whether the index enforces uniqueness`),partial:F().optional().describe(`Partial index condition (SQL WHERE clause for conditional indexes)`)})),lh=G(()=>B({fields:z(F()).describe(`Fields to index for full-text search weighting`),displayFields:z(F()).optional().describe(`Fields to display in search result cards`),filters:z(F()).optional().describe(`Default filters for search results`)})),uh=G(()=>B({enabled:L().describe(`Enable multi-tenancy for this object`),strategy:U([`shared`,`isolated`,`hybrid`]).describe(`Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)`),tenantField:F().default(`tenant_id`).describe(`Field name for tenant identifier`),crossTenantAccess:L().default(!1).describe(`Allow cross-tenant data access (with explicit permission)`)})),dh=G(()=>B({enabled:L().describe(`Enable soft delete (trash/recycle bin)`),field:F().default(`deleted_at`).describe(`Field name for soft delete timestamp`),cascadeDelete:L().default(!1).describe(`Cascade soft delete to related records`)})),fh=G(()=>B({enabled:L().describe(`Enable record versioning`),strategy:U([`snapshot`,`delta`,`event-sourcing`]).describe(`Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)`),retentionDays:I().min(1).optional().describe(`Number of days to retain old versions (undefined = infinite)`),versionField:F().default(`version`).describe(`Field name for version number/timestamp`)})),ph=G(()=>B({enabled:L().describe(`Enable table partitioning`),strategy:U([`range`,`hash`,`list`]).describe(`Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)`),key:F().describe(`Field name to partition by`),interval:F().optional().describe(`Partition interval for range strategy (e.g., "1 month", "1 year")`)}).refine(e=>!(e.strategy===`range`&&!e.interval),{message:`interval is required when strategy is "range"`})),mh=G(()=>B({enabled:L().describe(`Enable Change Data Capture`),events:z(U([`insert`,`update`,`delete`])).describe(`Event types to capture`),destination:F().describe(`Destination endpoint (e.g., "kafka://topic", "webhook://url")`)})),hh=G(()=>B({key:F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field group key must be lowercase snake_case (e.g., "contact_info", "billing", "system")`}).describe(`Group machine key (snake_case). Referenced by Field.group.`),label:F().describe(`Group display label`),icon:F().optional().describe(`Icon name (Lucide/Material) for the group header`),description:F().optional().describe(`Optional description shown under the group header`),defaultExpanded:L().optional().default(!0).describe(`Whether the group is expanded by default`),visibleOn:jp.optional().describe(`Visibility predicate (CEL); group is hidden when FALSE.`)})),gh=B({remoteName:F().optional().describe(`Remote table/view name. Defaults to object.name.`),remoteSchema:F().optional().describe(`Remote schema/database qualifier.`),writable:L().default(!1).describe(`Per-object write opt-in (also requires datasource.external.allowWrites).`),columnMap:H(F(),F()).optional().describe(`Remote column name → local field name.`),introspectedAt:F().datetime().optional().describe("Set by `os datasource introspect`; informational."),ignoreColumns:z(F()).optional().describe(`Remote columns to skip during validation (dev convenience).`)}).describe(`External datasource binding (ADR-0015)`),_h=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine unique key (snake_case). Immutable.`),label:F().optional().describe(`Human readable singular label (e.g. "Account")`),pluralLabel:F().optional().describe(`Human readable plural label (e.g. "Accounts")`),description:F().optional().describe(`Developer documentation / description`),icon:F().optional().describe(`Icon name (Lucide/Material) for UI representation`),tags:z(F()).optional().describe(`Categorization tags (e.g. "sales", "system", "reference")`),active:L().optional().default(!0).describe(`Is the object active and usable`),isSystem:L().optional().default(!1).describe(`Is system object (protected from deletion)`),abstract:L().optional().default(!1).describe(`Is abstract base object (cannot be instantiated)`),managedBy:U([`platform`,`config`,`system`,`append-only`,`better-auth`]).optional().describe(`Lifecycle bucket — platform (user CRUD) | config (admin authored) | system (engine-managed) | append-only (audit) | better-auth (identity). UI clients honour the resolved affordance matrix.`),userActions:B({create:L().optional().describe(`Show generic "New" button.`),import:L().optional().describe(`Show CSV import wizard entry.`),edit:L().optional().describe(`Allow inline / form edit of existing rows.`),delete:L().optional().describe(`Show row-level delete + bulk delete.`),exportCsv:L().optional().describe(`Show CSV export entry.`)}).optional().describe(`Per-object override of the resolved CRUD affordance matrix.`),systemFields:V([W(!1),B({tenant:L().optional().describe(`Inject organization_id (multi-tenant only). Default true.`),owner:L().optional().describe(`Reserved for future owner_id auto-injection.`),audit:L().optional().describe(`Reserved for future created_by/updated_by auto-injection.`)})]).optional().describe(`Opt out of, or selectively disable, registry-level system-field auto-injection.`),datasource:F().optional().default(`default`).describe(`Target Datasource ID. "default" is the primary DB.`),external:gh.optional().describe(`Remote table binding for federated (external) objects.`),fields:H(F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")`}),Kp).describe(`Field definitions map. Keys must be snake_case identifiers.`),indexes:z(ch).optional().describe(`Database performance indexes`),fieldGroups:z(hh).refine(e=>new Set(e.map(e=>e.key)).size===e.length,{message:`fieldGroups[].key must be unique within an object`}).optional().describe(`Ordered list of field groups (array order = display order). See ObjectFieldGroupSchema.`),tenancy:uh.optional().describe(`Multi-tenancy configuration for SaaS applications`),softDelete:dh.optional().describe(`Soft delete (trash/recycle bin) configuration`),versioning:fh.optional().describe(`Record versioning and history tracking configuration`),partitioning:ph.optional().describe(`Table partitioning configuration for performance`),cdc:mh.optional().describe(`Change Data Capture (CDC) configuration for real-time data streaming`),validations:z($p).optional().describe(`Object-level validation rules`),displayNameField:F().optional().describe(`Field to use as the record display name (e.g., "name", "title"). Defaults to "name" if present.`),recordName:B({type:U([`text`,`autonumber`]).describe(`Record name type: text (user-entered) or autonumber (system-generated)`),displayFormat:F().optional().describe(`Auto-number format pattern (e.g., "CASE-{0000}", "INV-{YYYY}-{0000}")`),startNumber:I().int().min(0).optional().describe(`Starting number for autonumber (default: 1)`)}).optional().describe(`Record name generation configuration (Salesforce pattern)`),titleFormat:Mp.optional().describe(`Title template — supports {{record.field}} interpolation. Overrides displayNameField.`),compactLayout:z(F()).optional().describe(`Primary fields for hover/cards/lookups`),listViews:H(F(),Qm).optional().describe(`Built-in named list views (segmented tabs) shipped with the object schema`),defaultDetailForm:F().optional().describe(`Name of the default FormView for record detail / edit screens`),search:lh.optional().describe(`Search engine configuration`),enable:sh.optional().describe(`Enabled system features modules`),recordTypes:z(F()).optional().describe(`Record type names for this object`),sharingModel:U([`private`,`read`,`read_write`,`full`]).optional().describe(`Default sharing model`),publicSharing:B({enabled:L().default(!1).describe(`Allow records of this object to be published via share link`),allowedAudiences:z(U([`public`,`link_only`,`signed_in`,`email`])).optional().describe(`Audiences callers may select when creating a link`),allowedPermissions:z(U([`view`,`comment`,`edit`])).optional().describe(`Permission levels selectable on the share dialog`),maxExpiryDays:I().int().positive().optional().describe(`Reject links with expiry beyond this many days`),redactFields:z(F()).optional().describe(`Field names removed from records served via a share token`),eligibility:F().optional().describe(`CEL expression that must evaluate to true on the target record`)}).optional().describe(`Public share-link policy (Notion/Figma-style link sharing)`),keyPrefix:F().max(5).optional().describe(`Short prefix for record IDs (e.g., "001" for Account)`),detail:B({renderViaSchema:L().optional().describe(`Opt this object out of the schema-driven detail renderer`),hideReferenceRail:L().optional().describe(`Suppress the right-hand reference-rail on the detail page`),hideRelatedTab:L().optional().describe(`Suppress the Related tab on the detail page`)}).passthrough().optional().describe(`Detail-page UI hints consumed by @object-ui/plugin-detail synth`),actions:z(pm).optional().describe(`Actions associated with this object (auto-populated from top-level actions via objectName)`),protection:vm.optional().describe(`Package author protection block — lock policy for this object.`),..._m});function vh(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var yh={workflows:"`workflows` is not an ObjectSchema field. Object-level, record-triggered automation is authored as a lifecycle hook (`src/objects/<name>.hook.ts`, registered via `defineHook()`) or as a top-level `record_change` flow — not as `workflows[]` on the object schema.",workflow:"`workflow` is not an ObjectSchema field. Record-triggered automation is authored as a lifecycle hook (`src/objects/<name>.hook.ts`) or a top-level `record_change` flow.",hooks:"`hooks` is not an ObjectSchema field. Lifecycle hooks live in their own `src/objects/<name>.hook.ts` module, registered via `defineHook()`.",triggers:"`triggers` is not an ObjectSchema field. Use a lifecycle hook (`src/objects/<name>.hook.ts`) or a top-level `record_change` flow."};function bh(e,t){let n=Array.from({length:e.length+1},()=>Array(t.length+1).fill(0));for(let t=0;t<=e.length;t++)n[t][0]=t;for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=e.length;r++)for(let i=1;i<=t.length;i++)n[r][i]=e[r-1]===t[i-1]?n[r-1][i-1]:1+Math.min(n[r-1][i],n[r][i-1],n[r-1][i-1]);return n[e.length][t.length]}function xh(e,t){let n,r=1/0;for(let i of t){let t=bh(e.toLowerCase(),i.toLowerCase());t<r&&(r=t,n=i)}return n!==void 0&&r<=Math.max(2,Math.floor(e.length/3))?n:void 0}function Sh(e,t,n){let r=typeof e==`string`&&e.length>0?e:`<unnamed>`,i=t.map(e=>{let t=yh[e];if(t)return` \u2022 ${t}`;let r=xh(e,n);return r?` \u2022 \`${e}\` is not an ObjectSchema field \u2014 did you mean \`${r}\`?`:` \u2022 \`${e}\` is not an ObjectSchema field.`});return Error(`ObjectSchema.create('${r}'): unknown key(s) \u2014 ${t.join(`, `)}.
|
|
103
103
|
These keys would previously have been stripped silently at build, shipping dead metadata with no diagnostic (ADR-0032 "no silent failure", issue #1535).
|
|
104
104
|
|
|
105
105
|
${i.join(`
|
|
106
106
|
`)}
|
|
107
107
|
|
|
108
108
|
Remove the unknown key(s), fix the typo, or move the logic to a supported mechanism.`)}G(()=>Object.assign(_h,{create:e=>{let t=e,n=Object.keys(_h.shape),r=Object.keys(t).filter(e=>!n.includes(e));if(r.length>0)throw Sh(t.name,r,n);let i={...t,label:t.label??vh(t.name)};return _h.parse(i)}})),U([`own`,`extend`]),G(()=>B({extend:F().describe(`Target object name (FQN) to extend`),fields:H(F(),Kp).optional().describe(`Fields to add/override`),label:F().optional().describe(`Override label for the extended object`),pluralLabel:F().optional().describe(`Override plural label for the extended object`),description:F().optional().describe(`Override description for the extended object`),validations:z($p).optional().describe(`Additional validation rules to merge into the target object`),indexes:z(ch).optional().describe(`Additional indexes to merge into the target object`),priority:I().int().min(0).max(999).default(200).describe(`Merge priority (higher = applied later)`)}));var Ch=U([`beforeFind`,`afterFind`,`beforeFindOne`,`afterFindOne`,`beforeCount`,`afterCount`,`beforeAggregate`,`afterAggregate`,`beforeInsert`,`afterInsert`,`beforeUpdate`,`afterUpdate`,`beforeDelete`,`afterDelete`,`beforeUpdateMany`,`afterUpdateMany`,`beforeDeleteMany`,`afterDeleteMany`]);G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Hook unique name (snake_case)`),label:F().optional().describe(`Description of what this hook does`),object:V([F(),z(F())]).describe(`Target object(s)`),events:z(Ch).describe(`Lifecycle events`),handler:V([F(),Gf(e=>typeof e==`function`,{message:`Expected function`})]).optional().describe("Handler function name (string, post-build) or inline function (pre-build) — DEPRECATED, prefer `body`"),body:om.optional().describe(`Hook body — expression (L1) or sandboxed JS (L2)`),priority:I().default(100).describe(`Execution priority`),async:L().default(!1).describe(`Run specifically as fire-and-forget`),condition:jp.optional().describe('Predicate (CEL); hook runs only when TRUE. e.g. P`record.status == "closed" && record.amount > 1000`'),description:F().optional().describe(`Human-readable description of what this hook does`),retryPolicy:B({maxRetries:I().default(3).describe(`Maximum retry attempts on failure`),backoffMs:I().default(1e3).describe(`Backoff delay between retries in milliseconds`)}).optional().describe(`Retry policy for failed hook executions`),timeout:I().optional().describe(`Maximum execution time in milliseconds before the hook is aborted`),onError:U([`abort`,`log`]).default(`abort`).describe(`Error handling strategy`)})),G(()=>B({id:F().optional().describe(`Unique execution ID for tracing`),object:F(),event:Ch,input:H(F(),R()).describe(`Mutable input parameters`),result:R().optional().describe(`Operation result (After hooks only)`),previous:H(F(),R()).optional().describe(`Record state before operation`),session:B({userId:F().optional(),tenantId:F().optional(),roles:z(F()).optional(),accessToken:F().optional(),isSystem:L().optional().describe(`True when the call was made with an elevated system context (engine self-writes)`)}).optional().describe(`Current session context`),transaction:R().optional().describe(`Database transaction handle`),ql:R().describe(`ObjectQL Engine Reference`),api:R().optional().describe(`Cross-object data access (ScopedContext)`),user:B({id:F().optional(),name:F().optional(),email:F().optional()}).optional().describe(`Current user info shortcut`)}));var wh=U([`none`,`constant`,`lookup`,`split`,`join`,`javascript`,`map`]),Th=G(()=>B({source:V([F(),z(F())]).describe(`Source column header(s)`),target:V([F(),z(F())]).describe(`Target object field(s)`),transform:wh.default(`none`),params:B({value:R().optional(),object:F().optional(),fromField:F().optional(),toField:F().optional(),autoCreate:L().optional(),valueMap:H(F(),R()).optional(),separator:F().optional()}).optional()}));G(()=>B({name:Dp.describe(`Mapping unique name (lowercase snake_case)`),label:F().optional(),sourceFormat:U([`csv`,`json`,`xml`,`sql`]).default(`csv`),targetObject:F().describe(`Target Object Name`),fieldMapping:z(Th),mode:U([`insert`,`update`,`upsert`]).default(`insert`),upsertKey:z(F()).optional().describe(`Fields to match for upsert (e.g. email)`),extractQuery:_p.optional().describe(`Query to run for export only`),errorPolicy:U([`skip`,`abort`,`retry`]).default(`skip`),batchSize:I().default(1e3)}));var Eh=G(()=>B({userId:F().optional(),tenantId:F().optional(),roles:z(F()).default([]),permissions:z(F()).default([]),systemPermissions:z(F()).optional(),tabPermissions:H(F(),U([`visible`,`hidden`,`default_on`,`default_off`])).optional(),org_user_ids:z(F()).optional(),isSystem:L().default(!1),accessToken:F().optional(),transaction:R().optional(),traceId:F().optional()})),Dh=G(()=>V([H(F(),R()),Zf]).describe(`Data Engine query filter conditions`)),Oh=G(()=>V([H(F(),U([`asc`,`desc`])),H(F(),V([W(1),W(-1)])),z(rp)]).describe(`Sort order definition`)),kh=G(()=>B({context:Eh.optional()})),Ah=G(()=>kh.extend({where:V([H(F(),R()),Zf]).optional(),fields:z(mp).optional(),orderBy:z(rp).optional(),limit:I().optional(),offset:I().optional(),top:I().optional(),cursor:H(F(),R()).optional(),search:hp.optional(),expand:zf(()=>H(F(),_p)).optional(),distinct:L().optional()}).describe(`QueryAST-aligned query options for IDataEngine.find() operations`));G(()=>kh.extend({filter:Dh.optional(),select:z(F()).optional(),sort:Oh.optional(),limit:I().int().min(1).optional(),skip:I().int().min(0).optional(),top:I().int().min(1).optional(),populate:z(F()).optional()}).describe(`Query options for IDataEngine.find() operations`));var jh=G(()=>kh.extend({returning:L().default(!0).optional()}).describe(`Options for DataEngine.insert operations`)),Mh=G(()=>kh.extend({where:V([H(F(),R()),Zf]).optional(),upsert:L().default(!1).optional(),multi:L().default(!1).optional(),returning:L().default(!1).optional()}).describe(`QueryAST-aligned options for DataEngine.update operations`));G(()=>kh.extend({filter:Dh.optional(),upsert:L().default(!1).optional(),multi:L().default(!1).optional(),returning:L().default(!1).optional()}).describe(`Options for DataEngine.update operations`));var Nh=G(()=>kh.extend({where:V([H(F(),R()),Zf]).optional(),multi:L().default(!1).optional()}).describe(`QueryAST-aligned options for DataEngine.delete operations`));G(()=>kh.extend({filter:Dh.optional(),multi:L().default(!1).optional()}).describe(`Options for DataEngine.delete operations`));var Ph=G(()=>kh.extend({where:V([H(F(),R()),Zf]).optional(),groupBy:z(F()).optional(),aggregations:z(sp).optional()}).describe(`QueryAST-aligned options for DataEngine.aggregate operations`));G(()=>kh.extend({filter:Dh.optional(),groupBy:z(F()).optional(),aggregations:z(B({field:F(),method:U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`]),alias:F().optional()})).optional()}).describe(`Options for DataEngine.aggregate operations`));var Fh=G(()=>kh.extend({where:V([H(F(),R()),Zf]).optional()}).describe(`QueryAST-aligned options for DataEngine.count operations`));G(()=>kh.extend({filter:Dh.optional()}).describe(`Options for DataEngine.count operations`)),G(()=>B({find:Uf().input(mf([F(),Ah.optional()])).output(Vf(z(R()))),findOne:Uf().input(mf([F(),Ah.optional()])).output(Vf(R())),insert:Uf().input(mf([F(),V([H(F(),R()),z(H(F(),R()))]),jh.optional()])).output(Vf(R())),update:Uf().input(mf([F(),H(F(),R()),Mh.optional()])).output(Vf(R())),delete:Uf().input(mf([F(),Nh.optional()])).output(Vf(R())),count:Uf().input(mf([F(),Fh.optional()])).output(Vf(I())),aggregate:Uf().input(mf([F(),Ph])).output(Vf(z(R())))}).describe(`Standard Data Engine Contract`));var Ih={filter:Dh.optional()},Lh=Ah.extend({...Ih,select:z(F()).optional(),sort:Oh.optional(),skip:I().int().min(0).optional(),populate:z(F()).optional()}),Rh=G(()=>B({method:W(`find`),object:F(),query:Lh.optional()})),zh=G(()=>B({method:W(`findOne`),object:F(),query:Lh.optional()})),Bh=G(()=>B({method:W(`insert`),object:F(),data:V([H(F(),R()),z(H(F(),R()))]),options:jh.optional()})),Vh=G(()=>B({method:W(`update`),object:F(),data:H(F(),R()),id:V([F(),I()]).optional().describe(`ID for single update, or use where in options`),options:Mh.extend(Ih).optional()})),Hh=G(()=>B({method:W(`delete`),object:F(),id:V([F(),I()]).optional().describe(`ID for single delete, or use where in options`),options:Nh.extend(Ih).optional()})),Uh=G(()=>B({method:W(`count`),object:F(),query:Fh.extend(Ih).optional()})),Wh=G(()=>B({method:W(`aggregate`),object:F(),query:Ph.extend(Ih)})),Gh=G(()=>B({method:W(`execute`),command:R(),options:H(F(),R()).optional()})),Kh=G(()=>B({method:W(`vectorFind`),object:F(),vector:z(I()),where:V([H(F(),R()),Zf]).optional(),fields:z(F()).optional(),limit:I().int().default(5).optional(),threshold:I().optional()})),qh=G(()=>B({method:W(`batch`),requests:z(uf(`method`,[Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh])),transaction:L().default(!0).optional()}));G(()=>uf(`method`,[Rh,zh,Bh,Vh,Hh,Uh,Wh,qh,Gh,Kh]).describe(`Virtual ObjectQL Request Protocol`)),U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`percentile`,`median`,`stddev`,`variance`]).describe(`Standard aggregation functions`);var Jh=U([`asc`,`desc`]).describe(`Sort order direction`);G(()=>B({field:F().describe(`Field name to sort by`),order:Jh.describe(`Sort direction`)}).describe(`Sort field and direction pair`)),U([`insert`,`update`,`delete`,`upsert`]).describe(`Data mutation event types`);var Yh=U([`read_uncommitted`,`read_committed`,`repeatable_read`,`serializable`,`snapshot`]).describe(`Transaction isolation levels (snake_case standard)`);U([`lru`,`lfu`,`ttl`,`fifo`]).describe(`Cache eviction strategy`);var Xh=G(()=>B({transaction:R().optional().describe(`Transaction handle`),timeout:I().optional().describe(`Timeout in ms`),skipCache:L().optional().describe(`Bypass cache`),traceContext:H(F(),F()).optional().describe(`OpenTelemetry context or request ID`),tenantId:F().optional().describe(`Tenant Isolation identifier`)})),Zh=G(()=>B({create:L().default(!0).describe(`Supports CREATE operations`),read:L().default(!0).describe(`Supports READ operations`),update:L().default(!0).describe(`Supports UPDATE operations`),delete:L().default(!0).describe(`Supports DELETE operations`),bulkCreate:L().default(!1).describe(`Supports bulk CREATE operations`),bulkUpdate:L().default(!1).describe(`Supports bulk UPDATE operations`),bulkDelete:L().default(!1).describe(`Supports bulk DELETE operations`),transactions:L().default(!1).describe(`Supports ACID transactions`),savepoints:L().default(!1).describe(`Supports transaction savepoints`),isolationLevels:z(Yh).optional().describe(`Supported isolation levels`),queryFilters:L().default(!0).describe(`Supports WHERE clause filtering`),queryAggregations:L().default(!1).describe(`Supports GROUP BY and aggregation functions`),queryDateGranularity:H(ap,L()).optional().describe(`Per-granularity native date bucketing (day/week/month/quarter/year). Missing keys fall back to in-memory bucketing.`),querySorting:L().default(!0).describe(`Supports ORDER BY sorting`),queryPagination:L().default(!0).describe(`Supports LIMIT/OFFSET pagination`),queryWindowFunctions:L().default(!1).describe(`Supports window functions with OVER clause`),querySubqueries:L().default(!1).describe(`Supports subqueries`),queryCTE:L().default(!1).describe(`Supports Common Table Expressions (WITH clause)`),joins:L().default(!1).describe(`Supports SQL joins`),fullTextSearch:L().default(!1).describe(`Supports full-text search`),jsonQuery:L().default(!1).describe(`Supports JSON field querying`),geospatialQuery:L().default(!1).describe(`Supports geospatial queries`),streaming:L().default(!1).describe(`Supports result streaming (cursors/iterators)`),jsonFields:L().default(!1).describe(`Supports JSON field types`),arrayFields:L().default(!1).describe(`Supports array field types`),vectorSearch:L().default(!1).describe(`Supports vector embeddings and similarity search`),autonumber:L().optional().describe(`Driver natively generates persistent autonumber/sequence values`),schemaSync:L().default(!1).describe(`Supports automatic schema synchronization`),batchSchemaSync:L().default(!1).describe(`Supports batched schema sync to reduce schema DDL round-trips`),migrations:L().default(!1).describe(`Supports database migrations`),indexes:L().default(!1).describe(`Supports index creation and management`),connectionPooling:L().default(!1).describe(`Supports connection pooling`),preparedStatements:L().default(!1).describe(`Supports prepared statements (SQL injection prevention)`),queryCache:L().default(!1).describe(`Supports query result caching`)}));G(()=>B({name:F().describe(`Driver unique name`),version:F().describe(`Driver version`),supports:Zh,connect:Uf().input(mf([])).output(Vf(nf())).describe(`Establish connection`),disconnect:Uf().input(mf([])).output(Vf(nf())).describe(`Close connection`),checkHealth:Uf().input(mf([])).output(Vf(L())).describe(`Health check`),getPoolStats:Uf().input(mf([])).output(B({total:I(),idle:I(),active:I(),waiting:I()}).optional()).optional().describe(`Get connection pool statistics`),execute:Uf().input(mf([R(),z(R()).optional(),Xh.optional()])).output(Vf(R())).describe(`Execute raw command`),find:Uf().input(mf([F(),_p,Xh.optional()])).output(Vf(z(H(F(),R())))).describe(`Find records`),findStream:Uf().input(mf([F(),_p,Xh.optional()])).output(R()).describe(`Stream records (AsyncIterable)`),findOne:Uf().input(mf([F(),_p,Xh.optional()])).output(Vf(H(F(),R()).nullable())).describe(`Find one record`),create:Uf().input(mf([F(),H(F(),R()),Xh.optional()])).output(Vf(H(F(),R()))).describe(`Create record`),update:Uf().input(mf([F(),F().or(I()),H(F(),R()),Xh.optional()])).output(Vf(H(F(),R()))).describe(`Update record`),upsert:Uf().input(mf([F(),H(F(),R()),z(F()).optional(),Xh.optional()])).output(Vf(H(F(),R()))).describe(`Upsert record`),delete:Uf().input(mf([F(),F().or(I()),Xh.optional()])).output(Vf(L())).describe(`Delete record`),count:Uf().input(mf([F(),_p.optional(),Xh.optional()])).output(Vf(I())).describe(`Count records`),bulkCreate:Uf().input(mf([F(),z(H(F(),R())),Xh.optional()])).output(Vf(z(H(F(),R())))),bulkUpdate:Uf().input(mf([F(),z(B({id:F().or(I()),data:H(F(),R())})),Xh.optional()])).output(Vf(z(H(F(),R())))),bulkDelete:Uf().input(mf([F(),z(F().or(I())),Xh.optional()])).output(Vf(nf())),updateMany:Uf().input(mf([F(),_p,H(F(),R()),Xh.optional()])).output(Vf(I())).optional(),deleteMany:Uf().input(mf([F(),_p,Xh.optional()])).output(Vf(I())).optional(),beginTransaction:Uf().input(mf([B({isolationLevel:Yh.optional()}).optional()])).output(Vf(R())).describe(`Start transaction`),commit:Uf().input(mf([R()])).output(Vf(nf())).describe(`Commit transaction`),rollback:Uf().input(mf([R()])).output(Vf(nf())).describe(`Rollback transaction`),syncSchema:Uf().input(mf([F(),R(),Xh.optional()])).output(Vf(nf())).describe(`Sync object schema to DB`),syncSchemasBatch:Uf().input(mf([z(B({object:F(),schema:R()})),Xh.optional()])).output(Vf(nf())).optional().describe(`Batch sync multiple schemas in one round-trip`),dropTable:Uf().input(mf([F(),Xh.optional()])).output(Vf(nf())),explain:Uf().input(mf([F(),_p,Xh.optional()])).output(Vf(R())).optional()}));var Qh=G(()=>B({min:I().min(0).default(2).describe(`Minimum number of connections in pool`),max:I().min(1).default(10).describe(`Maximum number of connections in pool`),idleTimeoutMillis:I().min(0).default(3e4).describe(`Time in ms before idle connection is closed`),connectionTimeoutMillis:I().min(0).default(5e3).describe(`Time in ms to wait for available connection`)})),$h=G(()=>B({name:F().describe(`Driver instance name`),type:U([`sql`,`nosql`,`cache`,`search`,`graph`,`timeseries`]).describe(`Driver type category`),capabilities:Zh.describe(`Driver capability flags`),connectionString:F().optional().describe(`Database connection string (driver-specific format)`),poolConfig:Qh.optional().describe(`Connection pool configuration`)})),eg=G(()=>U([`postgresql`,`mysql`,`sqlite`,`mssql`,`oracle`,`mariadb`])),tg=G(()=>B({text:F().describe(`SQL type for text fields (e.g., VARCHAR, TEXT)`),number:F().describe(`SQL type for number fields (e.g., NUMERIC, DECIMAL, INT)`),boolean:F().describe(`SQL type for boolean fields (e.g., BOOLEAN, BIT)`),date:F().describe(`SQL type for date fields (e.g., DATE)`),datetime:F().describe(`SQL type for datetime fields (e.g., TIMESTAMP, DATETIME)`),json:F().optional().describe(`SQL type for JSON fields (e.g., JSON, JSONB)`),uuid:F().optional().describe(`SQL type for UUID fields (e.g., UUID, CHAR(36))`),binary:F().optional().describe(`SQL type for binary fields (e.g., BLOB, BYTEA)`)})),ng=G(()=>B({rejectUnauthorized:L().default(!0).describe(`Reject connections with invalid certificates`),ca:F().optional().describe(`CA certificate file path or content`),cert:F().optional().describe(`Client certificate file path or content`),key:F().optional().describe(`Client private key file path or content`)}).refine(e=>e.cert!==void 0==(e.key!==void 0),{message:`Client certificate (cert) and private key (key) must be provided together`}));G(()=>$h.extend({type:W(`sql`).describe(`Driver type must be "sql"`),dialect:eg.describe(`SQL database dialect`),dataTypeMapping:tg.describe(`SQL data type mapping configuration`),ssl:L().default(!1).describe(`Enable SSL/TLS connection`),sslConfig:ng.optional().describe(`SSL/TLS configuration (required when ssl is true)`)}).refine(e=>!(e.ssl&&!e.sslConfig),{message:`sslConfig is required when ssl is true`}));var rg=G(()=>U([`mongodb`,`couchdb`,`dynamodb`,`cassandra`,`redis`,`elasticsearch`,`neo4j`,`orientdb`]));G(()=>U([`find`,`findOne`,`insert`,`update`,`delete`,`aggregate`,`mapReduce`,`count`,`distinct`,`createIndex`,`dropIndex`]));var ig=G(()=>U([`all`,`quorum`,`one`,`local_quorum`,`each_quorum`,`eventual`])),ag=G(()=>U([`single`,`compound`,`unique`,`text`,`geospatial`,`hashed`,`ttl`,`sparse`])),og=G(()=>B({enabled:L().default(!1).describe(`Enable sharding`),shardKey:F().optional().describe(`Field to use as shard key`),shardingStrategy:U([`hash`,`range`,`zone`]).optional().describe(`Sharding strategy`),numShards:I().int().positive().optional().describe(`Number of shards`)})),sg=G(()=>B({enabled:L().default(!1).describe(`Enable replication`),replicaSetName:F().optional().describe(`Replica set name`),replicas:I().int().positive().optional().describe(`Number of replicas`),readPreference:U([`primary`,`primaryPreferred`,`secondary`,`secondaryPreferred`,`nearest`]).optional().describe(`Read preference for replica set`),writeConcern:U([`majority`,`acknowledged`,`unacknowledged`]).optional().describe(`Write concern level`)})),cg=G(()=>B({enabled:L().default(!1).describe(`Enable schema validation`),validationLevel:U([`strict`,`moderate`,`off`]).optional().describe(`Validation strictness`),validationAction:U([`error`,`warn`]).optional().describe(`Action on validation failure`),jsonSchema:H(F(),R()).optional().describe(`JSON Schema for validation`)})),lg=G(()=>B({text:F().describe(`NoSQL type for text fields`),number:F().describe(`NoSQL type for number fields`),boolean:F().describe(`NoSQL type for boolean fields`),date:F().describe(`NoSQL type for date fields`),datetime:F().describe(`NoSQL type for datetime fields`),json:F().optional().describe(`NoSQL type for JSON/object fields`),uuid:F().optional().describe(`NoSQL type for UUID fields`),binary:F().optional().describe(`NoSQL type for binary fields`),array:F().optional().describe(`NoSQL type for array fields`),objectId:F().optional().describe(`NoSQL type for ObjectID fields (MongoDB)`),geopoint:F().optional().describe(`NoSQL type for geospatial point fields`)}));G(()=>$h.extend({type:W(`nosql`).describe(`Driver type must be "nosql"`),databaseType:rg.describe(`Specific NoSQL database type`),dataTypeMapping:lg.describe(`NoSQL data type mapping configuration`),consistency:ig.optional().describe(`Consistency level for operations`),replication:sg.optional().describe(`Replication configuration`),sharding:og.optional().describe(`Sharding configuration`),schemaValidation:cg.optional().describe(`Document schema validation`),region:F().optional().describe(`AWS region (for managed NoSQL services)`),accessKeyId:F().optional().describe(`AWS access key ID`),secretAccessKey:F().optional().describe(`AWS secret access key`),ttlField:F().optional().describe(`Field name for TTL (auto-deletion)`),maxDocumentSize:I().int().positive().optional().describe(`Maximum document size in bytes`),collectionPrefix:F().optional().describe(`Prefix for collection/table names`)}));var ug=G(()=>B({consistency:ig.optional().describe(`Consistency level override`),readFromSecondary:L().optional().describe(`Allow reading from secondary replicas`),projection:H(F(),V([W(0),W(1)])).optional().describe(`Field projection`),timeout:I().int().positive().optional().describe(`Query timeout (ms)`),useCursor:L().optional().describe(`Use cursor instead of loading all results`),batchSize:I().int().positive().optional().describe(`Cursor batch size`),profile:L().optional().describe(`Enable query profiling`),hint:F().optional().describe(`Index hint for query optimization`)})),dg=G(()=>B({operator:F().describe(`Aggregation operator (e.g., $match, $group, $sort)`),options:H(F(),R()).describe(`Stage-specific options`)}));G(()=>B({collection:F().describe(`Collection/table name`),stages:z(dg).describe(`Aggregation pipeline stages`),options:ug.optional().describe(`Query options`)})),G(()=>B({name:F().describe(`Index name`),type:ag.describe(`Index type`),fields:z(B({field:F().describe(`Field name`),order:U([`asc`,`desc`,`text`,`2dsphere`]).optional().describe(`Index order or type`)})).describe(`Fields to index`),unique:L().default(!1).describe(`Enforce uniqueness`),sparse:L().default(!1).describe(`Sparse index`),expireAfterSeconds:I().int().positive().optional().describe(`TTL in seconds`),partialFilterExpression:H(F(),R()).optional().describe(`Partial index filter`),background:L().default(!1).describe(`Create index in background`)})),G(()=>B({readConcern:U([`local`,`majority`,`linearizable`,`snapshot`]).optional().describe(`Read concern level`),writeConcern:U([`majority`,`acknowledged`,`unacknowledged`]).optional().describe(`Write concern level`),readPreference:U([`primary`,`primaryPreferred`,`secondary`,`secondaryPreferred`,`nearest`]).optional().describe(`Read preference`),maxCommitTimeMS:I().int().positive().optional().describe(`Transaction commit timeout (ms)`)}));var fg=U([`insert`,`update`,`upsert`,`replace`,`ignore`]),pg=G(()=>B({object:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Target Object Name`),externalId:F().default(`name`).describe(`Field match for uniqueness check`),mode:fg.default(`upsert`).describe(`Conflict resolution strategy`),env:z(U([`prod`,`dev`,`test`])).default([`prod`,`dev`,`test`]).describe(`Applicable environments`),records:z(H(F(),R())).describe(`Data records`)}));ah({schemaId:`object`,type:`simple`,sections:[{name:`basics`,label:`Basics`,description:`Identity, labels, and taxonomy.`,columns:2,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,colSpan:1,helpText:`snake_case unique identifier (immutable after creation)`},{field:`label`,type:`text`,colSpan:1,helpText:`Singular display name (e.g. "Account")`},{field:`pluralLabel`,type:`text`,colSpan:1,helpText:`Plural display name (e.g. "Accounts")`},{field:`icon`,type:`text`,colSpan:1,helpText:`Lucide icon name (e.g. "building", "users")`},{field:`description`,type:`textarea`,colSpan:2,helpText:`Developer documentation`},{field:`tags`,type:`tags`,colSpan:2,helpText:`Categorization tags (e.g. "sales", "system")`},{field:`active`,type:`boolean`,colSpan:1,helpText:`Is the object active and usable`},{field:`isSystem`,type:`boolean`,colSpan:1,helpText:`System object (protected from deletion)`},{field:`abstract`,type:`boolean`,colSpan:1,helpText:`Abstract base (cannot be instantiated)`}]},{name:`fields`,label:`Fields`,description:`Define the data model — each entry becomes a column in the database table.`,fields:[{field:`fields`,type:`record`,required:!0,helpText:`Add the columns this object will store`,keyField:{field:`name`,label:`Name`,placeholder:`snake_case_identifier`,helpText:`snake_case machine name (used as column name and API key)`,regex:`^[a-z_][a-z0-9_]*$`,immutable:!0},fields:[{field:`label`,type:`text`,helpText:`Display label`},{field:`type`,type:`select`,required:!0,helpText:`Field type`,options:[{label:`Text`,value:`text`},{label:`Textarea`,value:`textarea`},{label:`Email`,value:`email`},{label:`URL`,value:`url`},{label:`Phone`,value:`phone`},{label:`Password`,value:`password`},{label:`Markdown`,value:`markdown`},{label:`HTML`,value:`html`},{label:`Rich Text`,value:`richtext`},{label:`Number`,value:`number`},{label:`Currency`,value:`currency`},{label:`Percent`,value:`percent`},{label:`Date`,value:`date`},{label:`Date & Time`,value:`datetime`},{label:`Time`,value:`time`},{label:`Boolean`,value:`boolean`},{label:`Toggle`,value:`toggle`},{label:`Select`,value:`select`},{label:`Multiselect`,value:`multiselect`},{label:`Radio`,value:`radio`},{label:`Checkboxes`,value:`checkboxes`},{label:`Lookup (reference)`,value:`lookup`},{label:`Master–Detail`,value:`master_detail`},{label:`Tree`,value:`tree`},{label:`Image`,value:`image`},{label:`File`,value:`file`},{label:`Avatar`,value:`avatar`},{label:`Video`,value:`video`},{label:`Audio`,value:`audio`},{label:`Formula (computed)`,value:`formula`},{label:`Summary (rollup)`,value:`summary`},{label:`Autonumber`,value:`autonumber`},{label:`Composite (embedded)`,value:`composite`},{label:`Repeater (embedded array)`,value:`repeater`},{label:`Record (keyed map)`,value:`record`},{label:`Location (GPS)`,value:`location`},{label:`Address`,value:`address`},{label:`Code`,value:`code`},{label:`JSON`,value:`json`},{label:`Color`,value:`color`},{label:`Rating`,value:`rating`},{label:`Slider`,value:`slider`},{label:`Signature`,value:`signature`},{label:`QR / Barcode`,value:`qrcode`},{label:`Progress`,value:`progress`},{label:`Tags`,value:`tags`},{label:`Vector embedding`,value:`vector`}]},{field:`description`,type:`textarea`,helpText:`Developer documentation for this column`},{field:`required`,type:`boolean`,helpText:`Must be set on every record`},{field:`unique`,type:`boolean`,helpText:`Disallow duplicate values`},{field:`indexed`,type:`boolean`,helpText:`Create a database index for faster querying`},{field:`readonly`,type:`boolean`,helpText:`Visible but never user-editable`},{field:`immutable`,type:`boolean`,helpText:`Editable on create, locked thereafter`},{field:`hidden`,type:`boolean`,helpText:`Hidden from default UI`},{field:`searchable`,type:`boolean`,helpText:`Include in full-text search`},{field:`sortable`,type:`boolean`,helpText:`Allow sorting on this column`},{field:`filterable`,type:`boolean`,helpText:`Allow filtering on this column`},{field:`defaultValue`,type:`text`,helpText:`Default value for new records (JSON literal)`},{field:`placeholder`,type:`text`,helpText:`Placeholder hint`},{field:`maxLength`,type:`number`,helpText:`Max characters`,visibleOn:`type in ['text','textarea','email','url','phone','password','markdown','html','richtext']`},{field:`minLength`,type:`number`,helpText:`Min characters`,visibleOn:`type in ['text','textarea','email','url','phone','password','markdown','html','richtext']`},{field:`min`,type:`number`,helpText:`Minimum value`,visibleOn:`type in ['number','currency','percent','rating','slider','progress']`},{field:`max`,type:`number`,helpText:`Maximum value`,visibleOn:`type in ['number','currency','percent','rating','slider','progress']`},{field:`precision`,type:`number`,helpText:`Total digits`,visibleOn:`type in ['number','currency','percent']`},{field:`scale`,type:`number`,helpText:`Decimal places`,visibleOn:`type in ['number','currency','percent']`},{field:`options`,type:`repeater`,helpText:`Available choices`,visibleOn:`type in ['select','multiselect','radio','checkboxes']`,fields:[{field:`label`,type:`text`,required:!0},{field:`value`,type:`text`,required:!0},{field:`color`,type:`color`},{field:`icon`,type:`text`,helpText:`Lucide icon name`},{field:`description`,type:`text`}]},{field:`reference`,type:`text`,helpText:`Target object name`,visibleOn:`type in ['lookup','master_detail','tree']`},{field:`referenceFilter`,type:`code`,language:`expression`,helpText:`CEL filter applied to the picker`,visibleOn:`type in ['lookup','master_detail']`},{field:`cascadeDelete`,type:`boolean`,helpText:`Delete children when parent is deleted`,visibleOn:`type == 'master_detail'`},{field:`multiple`,type:`boolean`,helpText:`Allow selecting multiple records`,visibleOn:`type in ['lookup']`},{field:`formula`,type:`code`,language:`expression`,helpText:`CEL formula expression`,visibleOn:`type == 'formula'`},{field:`returnType`,type:`select`,helpText:`Result type for formulas`,visibleOn:`type == 'formula'`,options:[{label:`Text`,value:`text`},{label:`Number`,value:`number`},{label:`Boolean`,value:`boolean`},{label:`Date`,value:`date`},{label:`Datetime`,value:`datetime`},{label:`Currency`,value:`currency`}]},{field:`summaryType`,type:`select`,helpText:`Aggregation`,visibleOn:`type == 'summary'`,options:[{label:`Count`,value:`count`},{label:`Sum`,value:`sum`},{label:`Avg`,value:`avg`},{label:`Min`,value:`min`},{label:`Max`,value:`max`}]},{field:`summaryField`,type:`text`,helpText:`Field on child object to aggregate`,visibleOn:`type == 'summary'`},{field:`displayFormat`,type:`text`,helpText:`e.g. "INV-{0000}"`,visibleOn:`type == 'autonumber'`},{field:`startingNumber`,type:`number`,helpText:`Starting sequence value`,visibleOn:`type == 'autonumber'`},{field:`language`,type:`text`,helpText:`Editor language (e.g. sql, javascript)`,visibleOn:`type == 'code'`},{field:`validation`,type:`code`,language:`expression`,helpText:`CEL predicate — must evaluate true`},{field:`errorMessage`,type:`text`,helpText:`Shown when validation fails`},{field:`audit`,type:`boolean`,helpText:`Audit changes to this field`},{field:`trackHistory`,type:`boolean`,helpText:`Keep change history`},{field:`pii`,type:`boolean`,helpText:`Personally identifiable information`},{field:`encrypted`,type:`boolean`,helpText:`Encrypt at rest`}]}]},{name:`capabilities`,label:`Capabilities`,description:`System features and API exposure.`,collapsible:!0,collapsed:!0,fields:[{field:`capabilities`,type:`composite`,helpText:`Enable/disable system features`,fields:[{field:`trackHistory`,type:`boolean`},{field:`searchable`,type:`boolean`},{field:`apiEnabled`,type:`boolean`},{field:`files`,type:`boolean`},{field:`feeds`,type:`boolean`},{field:`activities`,type:`boolean`},{field:`trash`,type:`boolean`},{field:`mru`,type:`boolean`},{field:`clone`,type:`boolean`}]}]},{name:`advanced`,label:`Advanced`,description:`State machines, actions, and storage.`,collapsible:!0,collapsed:!0,fields:[{field:`datasource`,type:`text`,helpText:`Target datasource ID (default: "default")`}]}]}),ah({schemaId:`field`,type:`simple`,sections:[{name:`basics`,label:`Basics`,description:`Core field identity and constraints.`,columns:2,fields:[{field:`name`,required:!0,immutable:!0,colSpan:1,helpText:`Unique identifier (snake_case, immutable after creation)`},{field:`label`,required:!0,colSpan:1,helpText:`Display name for users`},{field:`type`,required:!0,colSpan:1,helpText:`Data type of this field`},{field:`group`,colSpan:1,helpText:`Group name for form layout`},{field:`description`,widget:`textarea`,colSpan:2,helpText:`Help text shown to users`},{field:`required`,colSpan:1,helpText:`User must provide a value`},{field:`unique`,colSpan:1,helpText:`No two records can have the same value`},{field:`multiple`,colSpan:1,helpText:`Allow multiple values (for select/lookup)`}]},{name:`configuration`,label:`Configuration`,description:`Field-type specific settings (visible blocks depend on the chosen type).`,fields:[{field:`defaultValue`,helpText:`Default value for new records`},{field:`minLength`,visibleOn:`data.type == 'text' || data.type == 'textarea' || data.type == 'email'`,helpText:`Minimum character length`},{field:`maxLength`,visibleOn:`data.type == 'text' || data.type == 'textarea' || data.type == 'email'`,helpText:`Maximum character length`},{field:`min`,visibleOn:`data.type == 'number' || data.type == 'currency'`,helpText:`Minimum value`},{field:`max`,visibleOn:`data.type == 'number' || data.type == 'currency'`,helpText:`Maximum value`},{field:`precision`,visibleOn:`data.type == 'currency' || data.type == 'number'`,helpText:`Decimal places (e.g., 2 for $10.50)`},{field:`scale`,visibleOn:`data.type == 'number'`,helpText:`Number of decimal digits`},{field:`options`,type:`repeater`,visibleOn:`data.type == 'select' || data.type == 'multiselect'`,helpText:`Available options (label/value pairs)`},{field:`reference`,widget:`ref:object`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`Referenced object name`},{field:`referenceFilters`,widget:`string-tags`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`Filter expressions (e.g., "active = true")`},{field:`deleteBehavior`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`What happens when referenced record is deleted`}]},{name:`formula`,label:`Formula & Computed`,description:`Calculated values and roll-up summaries.`,collapsible:!0,collapsed:!0,fields:[{field:`expression`,widget:`textarea`,helpText:`CEL expression to calculate this field (makes it read-only)`},{field:`summaryOperations`,type:`composite`,helpText:`Roll-up summary configuration (for parent-child relationships)`},{field:`cached`,type:`composite`,helpText:`Caching configuration for computed fields`}]},{name:`advanced`,label:`Advanced`,description:`Database, UI, audit, and security settings.`,collapsible:!0,collapsed:!0,columns:2,fields:[{field:`columnName`,colSpan:2,helpText:`Physical column name in database (defaults to field name)`},{field:`index`,colSpan:1,helpText:`Create database index for faster queries`},{field:`externalId`,colSpan:1,helpText:`Mark as external ID for upsert operations`},{field:`readonly`,colSpan:1,helpText:`Field is read-only in forms`},{field:`hidden`,colSpan:1,helpText:`Hide field from default UI views`},{field:`searchable`,colSpan:1,helpText:`Include in global search results`},{field:`sortable`,colSpan:1,helpText:`Allow sorting lists by this field`},{field:`auditTrail`,colSpan:1,helpText:`Track detailed changes with user and timestamp`},{field:`trackFeedHistory`,colSpan:1,helpText:`Show changes in activity feed`},{field:`encryptionConfig`,type:`composite`,colSpan:2,helpText:`Field-level encryption (GDPR/HIPAA/PCI-DSS)`},{field:`maskingRule`,type:`composite`,colSpan:2,helpText:`Data masking rules for PII protection`}]}]}),ah({schemaId:`hook`,type:`simple`,sections:[{label:`Identity`,description:`What this hook is and when it fires.`,columns:2,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,colSpan:1,helpText:`snake_case identifier (immutable after creation)`},{field:`label`,type:`text`,colSpan:1},{field:`description`,type:`textarea`,colSpan:2},{field:`object`,type:`text`,required:!0,colSpan:1,helpText:`Target object name (or "*" for global)`},{field:`events`,type:`tags`,required:!0,colSpan:1,helpText:`Lifecycle events (e.g. beforeInsert, afterUpdate)`},{field:`priority`,type:`number`,colSpan:1,helpText:`Lower numbers run first`}]},{label:`Body`,description:`Inline expression or sandboxed JavaScript executed when the hook fires.`,fields:[{field:`body`,type:`composite`,helpText:`Either an L1 expression or an L2 sandboxed JS body`,fields:[{field:`language`,type:`select`,required:!0,helpText:`expression = pure formula; js = sandboxed JavaScript`,options:[{label:`Expression (L1)`,value:`expression`},{label:`JavaScript (L2 sandboxed)`,value:`js`}]},{field:`source`,type:`code`,language:`javascript`,required:!0,helpText:`Function body source — no top-level imports`},{field:`capabilities`,type:`tags`,helpText:`Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)`},{field:`timeoutMs`,type:`number`,helpText:`Per-invocation timeout (ms)`}]}]},{label:`Legacy handler`,description:`Function name reference — deprecated in favour of body.`,collapsible:!0,collapsed:!0,fields:[{field:`handler`,type:`text`,helpText:"Handler function name (deprecated — prefer `body`)"}]},{label:`Execution`,collapsible:!0,collapsed:!0,columns:2,fields:[{field:`async`,type:`boolean`,colSpan:1,helpText:`Run in background, do not block the transaction`},{field:`onError`,type:`select`,colSpan:1,options:[{label:`Abort`,value:`abort`},{label:`Log`,value:`log`}]},{field:`condition`,type:`code`,language:`javascript`,colSpan:2,helpText:`Optional formula — skip the hook when this evaluates to false`}]}]});var mg=G(()=>B({field:F().describe(`Source field name containing the reference value`),targetObject:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Target object name (snake_case)`),targetField:F().default(`name`).describe(`Field on target object used for matching`),fieldType:U([`lookup`,`master_detail`]).describe(`Relationship field type`)}).describe(`Describes how a field reference is resolved during seed loading`)),hg=G(()=>B({object:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Object name (snake_case)`),dependsOn:z(F()).describe(`Objects this object depends on`),references:z(mg).describe(`Field-level reference details`)}).describe(`Object node in the seed data dependency graph`)),gg=G(()=>B({nodes:z(hg).describe(`All objects in the dependency graph`),insertOrder:z(F()).describe(`Topologically sorted insert order`),circularDependencies:z(z(F())).default([]).describe(`Circular dependency chains (e.g., [["a", "b", "a"]])`)}).describe(`Complete object dependency graph for seed data loading`)),_g=G(()=>B({sourceObject:F().describe(`Object with the broken reference`),field:F().describe(`Field name with unresolved reference`),targetObject:F().describe(`Target object searched for the reference`),targetField:F().describe(`ExternalId field used for matching`),attemptedValue:R().describe(`Value that failed to resolve`),recordIndex:I().int().min(0).describe(`Index of the record in the dataset`),message:F().describe(`Human-readable error description`)}).describe(`Actionable error for a failed reference resolution`)),vg=B({user:B({id:F().min(1),role:F().optional(),email:F().optional()}).optional().describe(`Subject bound to os.user in seed CEL expressions`),org:B({id:F().min(1),tier:F().optional()}).optional().describe(`Organization bound to os.org in seed CEL expressions`)}).describe(`Identity context for resolving os.user / os.org in seed CEL values`),yg=G(()=>B({dryRun:L().default(!1).describe(`Validate references without writing data`),haltOnError:L().default(!1).describe(`Stop on first reference resolution error`),multiPass:L().default(!0).describe(`Enable multi-pass loading for circular dependencies`),defaultMode:fg.default(`upsert`).describe(`Default conflict resolution strategy`),batchSize:I().int().min(1).default(1e3).describe(`Maximum records per batch insert/upsert`),transaction:L().default(!1).describe(`Wrap entire load in a transaction (all-or-nothing)`),env:U([`prod`,`dev`,`test`]).optional().describe(`Only load datasets matching this environment`),organizationId:F().min(1).optional().describe(`Target organization id for per-tenant seed replay`),identity:vg.optional().describe(`Identity bound to os.user / os.org when resolving CEL seed values`)}).describe(`Seed data loader configuration`)),bg=G(()=>B({object:F().describe(`Object that was loaded`),mode:fg.describe(`Import mode used`),inserted:I().int().min(0).describe(`Records inserted`),updated:I().int().min(0).describe(`Records updated`),skipped:I().int().min(0).describe(`Records skipped`),errored:I().int().min(0).describe(`Records with errors`),total:I().int().min(0).describe(`Total records in dataset`),referencesResolved:I().int().min(0).describe(`References resolved via externalId`),referencesDeferred:I().int().min(0).describe(`References deferred to second pass`),errors:z(_g).default([]).describe(`Reference resolution errors`)}).describe(`Result of loading a single dataset`));G(()=>B({success:L().describe(`Overall success status`),dryRun:L().describe(`Whether this was a dry-run`),dependencyGraph:gg.describe(`Object dependency graph`),results:z(bg).describe(`Per-object load results`),errors:z(_g).describe(`All reference resolution errors`),summary:B({objectsProcessed:I().int().min(0).describe(`Total objects processed`),totalRecords:I().int().min(0).describe(`Total records across all objects`),totalInserted:I().int().min(0).describe(`Total records inserted`),totalUpdated:I().int().min(0).describe(`Total records updated`),totalSkipped:I().int().min(0).describe(`Total records skipped`),totalErrored:I().int().min(0).describe(`Total records with errors`),totalReferencesResolved:I().int().min(0).describe(`Total references resolved`),totalReferencesDeferred:I().int().min(0).describe(`Total references deferred`),circularDependencyCount:I().int().min(0).describe(`Circular dependency chains detected`),durationMs:I().min(0).describe(`Load duration in milliseconds`)}).describe(`Summary statistics`)}).describe(`Complete seed loader result`)),G(()=>B({seeds:z(pg).min(1).describe(`Seeds to load`),config:yg.default(()=>yg.parse({})).describe(`Loader configuration`)}).describe(`Seed loader request with datasets and configuration`));var xg=G(()=>B({versionNumber:I().describe(`Version number`),createdAt:I().describe(`Creation timestamp`),createdBy:F().describe(`Creator user ID`),size:I().describe(`File size in bytes`),checksum:F().describe(`File checksum`),downloadUrl:F().url().describe(`Download URL`),isLatest:L().optional().default(!1).describe(`Is latest version`)})),Sg=G(()=>B({id:F().describe(`Template ID`),name:F().describe(`Template name`),description:F().optional().describe(`Template description`),fileUrl:F().url().describe(`Template file URL`),fileType:F().describe(`File MIME type`),placeholders:z(B({key:F().describe(`Placeholder key`),label:F().describe(`Placeholder label`),type:U([`text`,`number`,`date`,`image`]).describe(`Placeholder type`),required:L().optional().default(!1).describe(`Is required`)})).describe(`Template placeholders`)})),Cg=G(()=>B({provider:U([`docusign`,`adobe-sign`,`hellosign`,`custom`]).describe(`E-signature provider`),enabled:L().optional().default(!1).describe(`E-signature enabled`),signers:z(B({email:F().email().describe(`Signer email`),name:F().describe(`Signer name`),role:F().describe(`Signer role`),order:I().describe(`Signing order`)})).describe(`Document signers`),expirationDays:I().optional().default(30).describe(`Expiration days`),reminderDays:I().optional().default(7).describe(`Reminder interval days`)}));G(()=>B({id:F().describe(`Document ID`),name:F().describe(`Document name`),description:F().optional().describe(`Document description`),fileType:F().describe(`File MIME type`),fileSize:I().describe(`File size in bytes`),category:F().optional().describe(`Document category`),tags:z(F()).optional().describe(`Document tags`),versioning:B({enabled:L().describe(`Versioning enabled`),versions:z(xg).describe(`Version history`),majorVersion:I().describe(`Major version`),minorVersion:I().describe(`Minor version`)}).optional().describe(`Version control`),template:Sg.optional().describe(`Document template`),eSignature:Cg.optional().describe(`E-signature config`),access:B({isPublic:L().optional().default(!1).describe(`Public access`),sharedWith:z(F()).optional().describe(`Shared with`),expiresAt:I().optional().describe(`Access expiration`)}).optional().describe(`Access control`),metadata:H(F(),R()).optional().describe(`Custom metadata`)}));var wg=G(()=>uf(`type`,[B({type:W(`constant`),value:R().describe(`Constant value to use`)}).describe(`Set a constant value`),B({type:W(`cast`),targetType:U([`string`,`number`,`boolean`,`date`]).describe(`Target data type`)}).describe(`Cast to a specific data type`),B({type:W(`lookup`),table:F().describe(`Lookup table name`),keyField:F().describe(`Field to match on`),valueField:F().describe(`Field to retrieve`)}).describe(`Lookup value from another table`),B({type:W(`javascript`),expression:jp.describe(`JS expression (dialect="js" recommended). e.g. value.toUpperCase()`)}).describe(`Custom JavaScript transformation`),B({type:W(`map`),mappings:H(F(),R()).describe(`Value mappings (e.g., {"Active": "active"})`)}).describe(`Map values using a dictionary`)])),Tg=G(()=>B({source:F().describe(`Source field name`),target:F().describe(`Target field name`),transform:wg.optional().describe(`Transformation to apply`),defaultValue:R().optional().describe(`Default if source is null/undefined`)})),Eg=G(()=>B({id:F().describe(`Data source ID`),name:F().describe(`Data source name`),type:U([`odata`,`rest-api`,`graphql`,`custom`]).describe(`Protocol type`),endpoint:F().url().describe(`API endpoint URL`),authentication:B({type:U([`oauth2`,`api-key`,`basic`,`none`]).describe(`Auth type`),config:H(F(),R()).describe(`Auth configuration`)}).describe(`Authentication`)})),Dg=G(()=>Tg.extend({type:F().optional().describe(`Field type`),readonly:L().optional().default(!0).describe(`Read-only field`)}));G(()=>B({fieldName:F().describe(`Field name`),dataSource:Eg.describe(`External data source`),query:B({endpoint:F().describe(`Query endpoint path`),method:U([`GET`,`POST`]).optional().default(`GET`).describe(`HTTP method`),parameters:H(F(),R()).optional().describe(`Query parameters`)}).describe(`Query configuration`),fieldMappings:z(Dg).describe(`Field mappings`),caching:B({enabled:L().optional().default(!0).describe(`Cache enabled`),ttl:I().optional().default(300).describe(`Cache TTL (seconds)`),strategy:U([`lru`,`lfu`,`ttl`]).optional().default(`ttl`).describe(`Cache strategy`)}).optional().describe(`Caching configuration`),fallback:B({enabled:L().optional().default(!0).describe(`Fallback enabled`),defaultValue:R().optional().describe(`Default fallback value`),showError:L().optional().default(!0).describe(`Show error to user`)}).optional().describe(`Fallback configuration`),rateLimit:B({requestsPerSecond:I().describe(`Requests per second limit`),burstSize:I().optional().describe(`Burst size`)}).optional().describe(`Rate limiting`),retry:B({maxRetries:I().min(0).default(3).describe(`Maximum retry attempts`),initialDelayMs:I().default(1e3).describe(`Initial retry delay in milliseconds`),maxDelayMs:I().default(3e4).describe(`Maximum retry delay in milliseconds`),backoffMultiplier:I().default(2).describe(`Exponential backoff multiplier`),retryableStatusCodes:z(I()).default([429,500,502,503,504]).describe(`HTTP status codes that are retryable`)}).optional().describe(`Retry configuration with exponential backoff`),transform:B({request:B({headers:H(F(),F()).optional().describe(`Additional request headers`),queryParams:H(F(),F()).optional().describe(`Additional query parameters`)}).optional().describe(`Request transformation`),response:B({dataPath:F().optional().describe(`JSONPath to extract data (e.g., "$.data.results")`),totalPath:F().optional().describe(`JSONPath to extract total count (e.g., "$.meta.total")`)}).optional().describe(`Response transformation`)}).optional().describe(`Request/response transformation pipeline`),pagination:B({type:U([`offset`,`cursor`,`page`]).default(`offset`).describe(`Pagination type`),pageSize:I().default(100).describe(`Items per page`),maxPages:I().optional().describe(`Maximum number of pages to fetch`)}).optional().describe(`Pagination configuration for external data`)}));var Og=F().describe(`Underlying driver identifier`);G(()=>B({id:F().describe(`Unique driver identifier (e.g. "postgres")`),label:F().describe(`Display label (e.g. "PostgreSQL")`),description:F().optional(),icon:F().optional(),configSchema:H(F(),R()).describe(`JSON Schema for connection configuration`),capabilities:zf(()=>kg).optional()}));var kg=B({transactions:L().default(!1),queryFilters:L().default(!1),queryAggregations:L().default(!1),querySorting:L().default(!1),queryPagination:L().default(!1),queryWindowFunctions:L().default(!1),querySubqueries:L().default(!1),joins:L().default(!1),fullTextSearch:L().default(!1),readOnly:L().default(!1),dynamicSchema:L().default(!1)}),Ag=U([`managed`,`external`,`validate-only`]).describe(`Schema ownership mode`),jg=B({label:F().optional().describe(`Display label, e.g. "Snowflake — ANALYTICS / PROD"`),allowedSchemas:z(F()).optional().describe(`Whitelist of remote schemas/databases that may be exposed.`),allowWrites:L().default(!1).describe(`Global write gate. Individual objects must also opt in via object.external.writable.`),validation:B({onMismatch:U([`fail`,`warn`,`ignore`]).default(`fail`).describe(`What to do when a federated object diverges from the remote table.`),checkOnBoot:L().default(!0).describe(`Validate federated objects against the remote schema at boot.`),checkIntervalMs:I().optional().describe(`Optional background drift-check interval in milliseconds.`)}).default({onMismatch:`fail`,checkOnBoot:!0}).describe(`Boot/drift validation policy`),credentialsRef:F().optional().describe(`Reference into the secrets store; never inline credentials.`),queryTimeoutMs:I().default(3e4).describe(`Hard cap on per-query execution time.`),requirePermission:F().optional().describe(`Optional convenience: gate the entire datasource behind a single role.`)}).describe(`External datasource federation settings (schemaMode != "managed")`);G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique datasource identifier`),label:F().optional().describe(`Display label`),driver:Og.describe(`Underlying driver type`),config:H(F(),R()).describe(`Driver specific configuration`),pool:B({min:I().default(0).describe(`Minimum connections`),max:I().default(10).describe(`Maximum connections`),idleTimeoutMillis:I().default(3e4).describe(`Idle timeout`),connectionTimeoutMillis:I().default(3e3).describe(`Connection establishment timeout`)}).optional().describe(`Connection pool settings`),readReplicas:z(H(F(),R())).optional().describe(`Read-only replica configurations`),capabilities:kg.optional().describe(`Capability overrides`),healthCheck:B({enabled:L().default(!0).describe(`Enable health check endpoint`),intervalMs:I().default(3e4).describe(`Health check interval in milliseconds`),timeoutMs:I().default(5e3).describe(`Health check timeout in milliseconds`)}).optional().describe(`Datasource health check configuration`),ssl:B({enabled:L().default(!1).describe(`Enable SSL/TLS for database connection`),rejectUnauthorized:L().default(!0).describe(`Reject connections with invalid/self-signed certificates`),ca:F().optional().describe(`CA certificate (PEM format or path to file)`),cert:F().optional().describe(`Client certificate (PEM format or path to file)`),key:F().optional().describe(`Client private key (PEM format or path to file)`)}).optional().describe(`SSL/TLS configuration for secure database connections`),retryPolicy:B({maxRetries:I().default(3).describe(`Maximum number of retry attempts`),baseDelayMs:I().default(1e3).describe(`Base delay between retries in milliseconds`),maxDelayMs:I().default(3e4).describe(`Maximum delay between retries in milliseconds`),backoffMultiplier:I().default(2).describe(`Exponential backoff multiplier`)}).optional().describe(`Connection retry policy for transient failures`),description:F().optional().describe(`Internal description`),active:L().default(!0).describe(`Is datasource enabled`),schemaMode:Ag.default(`managed`),external:jg.optional(),origin:U([`code`,`runtime`]).default(`code`).describe(`Datasource provenance (server-managed, read-only)`)}).superRefine((e,t)=>{e.schemaMode!==`managed`&&!e.external&&t.addIssue({code:`custom`,path:[`external`],message:`schemaMode='${e.schemaMode}' requires 'external' settings.`}),e.schemaMode===`managed`&&e.external&&t.addIssue({code:`custom`,path:[`external`],message:`'external' settings only apply when schemaMode != 'managed'.`})}));var Mg=B({name:F().describe(`Remote column name`),sqlType:F().describe(`Raw remote SQL type (e.g. "numeric(10,2)")`),nullable:L().describe(`Whether the remote column is nullable`),primaryKey:L().default(!1).describe(`Part of the remote primary key`),suggestedFieldType:F().optional().describe(`ObjectStack field type suggested by the type-compat matrix`)}),Ng=B({remoteSchema:F().optional().describe(`Remote schema/database qualifier`),remoteName:F().describe(`Remote table/view name`),columns:z(Mg).describe(`Remote columns`),indexes:z(B({name:F(),columns:z(F()),unique:L()})).optional().describe(`Remote indexes, when introspectable`),rowCountEstimate:I().optional().describe(`Approximate row count`)});G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe("Catalog id, conventionally `<datasource>_catalog`."),datasource:F().describe(`Datasource.name this catalog snapshots.`),snapshotAt:F().datetime().describe(`When the snapshot was taken (ISO 8601).`),dialect:F().optional().describe(`Remote SQL dialect, when known.`),tables:z(Ng).describe(`Snapshotted remote tables.`)}));var Pg=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`number`,`string`,`boolean`]),Fg=U([`string`,`number`,`boolean`,`time`,`geo`]),Ig=U([`second`,`minute`,`hour`,`day`,`week`,`month`,`quarter`,`year`]),Lg=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique metric ID`),label:F().describe(`Human readable label`),description:F().optional(),type:Pg,sql:F().describe(`SQL expression or field reference`),filters:z(B({sql:F()})).optional(),format:F().optional()})),Rg=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique dimension ID`),label:F().describe(`Human readable label`),description:F().optional(),type:Fg,sql:F().describe(`SQL expression or column reference`),granularities:z(Ig).optional()})),zg=G(()=>B({name:F().describe(`Target cube name`),relationship:U([`one_to_one`,`one_to_many`,`many_to_one`]).default(`many_to_one`),sql:F().describe(`Join condition (ON clause)`)}));G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Cube name (snake_case)`),title:F().optional(),description:F().optional(),sql:F().describe(`Base SQL statement or Table Name`),measures:H(F(),Lg).describe(`Quantitative metrics`),dimensions:H(F(),Rg).describe(`Qualitative attributes`),joins:H(F(),zg).optional(),refreshKey:B({every:F().optional(),sql:F().optional()}).optional(),public:L().default(!1)})),G(()=>B({cube:F().optional().describe(`Target cube name (optional when provided externally, e.g. in API request wrapper)`),measures:z(F()).describe(`List of metrics to calculate`),dimensions:z(F()).optional().describe(`List of dimensions to group by`),where:Zf.optional().describe(`Filtering criteria (canonical Query DSL FilterCondition)`),timeDimensions:z(B({dimension:F(),granularity:Ig.optional(),dateRange:V([F(),z(F())]).optional()})).optional(),order:H(F(),U([`asc`,`desc`])).optional(),limit:I().optional(),offset:I().optional(),timezone:F().optional().default(`UTC`)}));var Bg=U([`comment`,`field_change`,`task`,`event`,`email`,`call`,`note`,`file`,`record_create`,`record_delete`,`approval`,`sharing`,`system`]),Vg=G(()=>B({type:U([`user`,`team`,`record`]).describe(`Mention target type`),id:F().describe(`Target ID`),name:F().describe(`Display name for rendering`),offset:I().int().min(0).describe(`Character offset in body text`),length:I().int().min(1).describe(`Length of mention token in body text`)})),Hg=G(()=>B({field:F().describe(`Field machine name`),fieldLabel:F().optional().describe(`Field display label`),oldValue:R().optional().describe(`Previous value`),newValue:R().optional().describe(`New value`),oldDisplayValue:F().optional().describe(`Human-readable old value`),newDisplayValue:F().optional().describe(`Human-readable new value`)})),Ug=G(()=>B({emoji:F().describe(`Emoji character or shortcode (e.g., "👍", ":thumbsup:")`),userIds:z(F()).describe(`Users who reacted`),count:I().int().min(1).describe(`Total reaction count`)})),Wg=G(()=>B({type:U([`user`,`system`,`service`,`automation`]).describe(`Actor type`),id:F().describe(`Actor ID`),name:F().optional().describe(`Actor display name`),avatarUrl:F().url().optional().describe(`Actor avatar URL`),source:F().optional().describe(`Source application (e.g., "Omni", "API", "Studio")`)})),Gg=U([`public`,`internal`,`private`]);G(()=>B({id:F().describe(`Feed item ID`),type:Bg.describe(`Activity type`),object:F().describe(`Object name (e.g., "account")`),recordId:F().describe(`Record ID this feed item belongs to`),actor:Wg.describe(`Who performed this action`),body:F().optional().describe(`Rich text body (Markdown supported)`),mentions:z(Vg).optional().describe(`Mentioned users/teams/records`),changes:z(Hg).optional().describe(`Field-level changes`),reactions:z(Ug).optional().describe(`Emoji reactions on this item`),parentId:F().optional().describe(`Parent feed item ID for threaded replies`),replyCount:I().int().min(0).default(0).describe(`Number of replies`),pinned:L().default(!1).describe(`Whether the feed item is pinned to the top of the timeline`),pinnedAt:F().datetime().optional().describe(`Timestamp when the item was pinned`),pinnedBy:F().optional().describe(`User ID who pinned the item`),starred:L().default(!1).describe(`Whether the feed item is starred/bookmarked by the current user`),starredAt:F().datetime().optional().describe(`Timestamp when the item was starred`),visibility:Gg.default(`public`).describe(`Visibility: public (all users), internal (team only), private (author + mentioned)`),createdAt:F().datetime().describe(`Creation timestamp`),updatedAt:F().datetime().optional().describe(`Last update timestamp`),editedAt:F().datetime().optional().describe(`When comment was last edited`),isEdited:L().default(!1).describe(`Whether comment has been edited`)})),U([`all`,`comments_only`,`changes_only`,`tasks_only`]);var Kg=U([`comment`,`mention`,`field_change`,`task`,`approval`,`all`]),qg=U([`in_app`,`email`,`push`,`slack`]);G(()=>B({object:F().describe(`Object name`),recordId:F().describe(`Record ID`),userId:F().describe(`Subscribing user ID`),events:z(Kg).default([`all`]).describe(`Event types to receive notifications for`),channels:z(qg).default([`in_app`]).describe(`Notification delivery channels`),active:L().default(!0).describe(`Whether the subscription is active`),createdAt:F().datetime().describe(`Subscription creation timestamp`)}));var Jg=(e=>l===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(l===void 0?e:l)[t]}):e:l)(function(e){if(l!==void 0)return l.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),Yg={debug:0,info:1,warn:2,error:3,fatal:4,silent:5},Xg={debug:`\x1B[36m`,info:`\x1B[32m`,warn:`\x1B[33m`,error:`\x1B[31m`,fatal:`\x1B[35m`,silent:``},Zg=`\x1B[0m`,Qg=class e{constructor(e={},t={}){this.config={name:e.name,level:e.level??`info`,format:e.format??`pretty`,redact:e.redact??[`password`,`token`,`secret`,`key`],sourceLocation:e.sourceLocation??!1,file:e.file,rotation:e.rotation??{maxSize:`10m`,maxFiles:5}},this.bindings=t,this.config.file&&typeof process<`u`&&this.openFileStream(this.config.file)}openFileStream(e){try{let t=Jg(`fs`),n=Jg(`path`).dirname(e);t.mkdirSync(n,{recursive:!0}),this.fileStream=t.createWriteStream(e,{flags:`a`})}catch{}}isEnabled(e){return Yg[e]>=Yg[this.config.level]}redactSensitive(e){if(!e||typeof e!=`object`)return e;let t=Array.isArray(e)?[...e]:{...e};for(let e in t){let n=e.toLowerCase();this.config.redact.some(e=>n.includes(e.toLowerCase()))?t[e]=`***REDACTED***`:typeof t[e]==`object`&&t[e]!==null&&(t[e]=this.redactSensitive(t[e]))}return t}write(e,t,n,r){if(!this.isEnabled(e))return;let i=this.redactSensitive({...this.bindings,...n,...r?{error:{message:r.message,stack:r.stack}}:{}}),a=Object.keys(i).length>0,o=new Date().toISOString(),s;if(this.config.format===`json`)s=JSON.stringify({time:o,level:e,...this.config.name?{name:this.config.name}:{},msg:t,...i});else if(this.config.format===`text`){let n=[o,e.toUpperCase(),t];a&&n.push(JSON.stringify(i)),s=n.join(` | `)}else{let n=Xg[e]||``,r=this.config.name?`[${this.config.name}] `:``;s=`${n}${o} ${e.toUpperCase()}${Zg} ${r}${t}`,a&&(s+=` ${JSON.stringify(i)}`)}let c=s+`
|
|
109
|
-
`;typeof process<`u`&&process.stderr?e===`error`||e===`fatal`?process.stderr.write(c):process.stdout?.write(c):typeof console<`u`&&(e===`error`||e===`fatal`?console.error:e===`warn`?console.warn:e===`debug`?console.debug:console.log)(s),this.fileStream&&this.fileStream.write(c)}debug(e,t){this.write(`debug`,e,t)}info(e,t){this.write(`info`,e,t)}warn(e,t){this.write(`warn`,e,t)}error(e,t,n){t instanceof Error?this.write(`error`,e,n,t):this.write(`error`,e,t)}fatal(e,t,n){t instanceof Error?this.write(`fatal`,e,n,t):this.write(`fatal`,e,t)}log(e,...t){this.info(e,t.length>0?{args:t}:void 0)}child(t){let n=new e(this.config,{...this.bindings,...t});return n.fileStream=this.fileStream,n}withTrace(e,t){return this.child({traceId:e,spanId:t})}async destroy(){this.fileStream&&=(await new Promise(e=>this.fileStream.end(e)),void 0)}};function $g(e){return new Qg(e)}var e_=class{constructor(e,t){this.subscriptions=new Map,this.eventBuffer=[],this._baseUrl=e,this._token=t}subscribeMetadata(e,t,n){let r=`metadata-${e}-${Date.now()}`;return this.subscriptions.set(r,{filter:{type:e,packageId:n?.packageId,eventTypes:[`metadata.${e}.created`,`metadata.${e}.updated`,`metadata.${e}.deleted`]},handler:e=>{e.type.startsWith(`metadata.`)&&t(e)}}),this.startPolling(),()=>{this.subscriptions.delete(r),this.subscriptions.size===0&&this.stopPolling()}}subscribeData(e,t,n){let r=`data-${e}-${Date.now()}`;return this.subscriptions.set(r,{filter:{type:e,recordId:n?.recordId,eventTypes:[`data.record.created`,`data.record.updated`,`data.record.deleted`]},handler:r=>{r.type.startsWith(`data.`)&&r.object===e&&(!n?.recordId||r.payload?.recordId===n.recordId)&&t(r)}}),this.startPolling(),()=>{this.subscriptions.delete(r),this.subscriptions.size===0&&this.stopPolling()}}emitEvent(e){for(let t of this.subscriptions.values()){let n=!t.filter.type||e.type.includes(t.filter.type)||e.object===t.filter.type,r=!t.filter.eventTypes?.length||t.filter.eventTypes.includes(e.type),i=!t.filter.packageId||e.payload?.packageId===t.filter.packageId;if(n&&r&&i)try{t.handler(e)}catch(e){console.error(`Error in realtime event handler:`,e)}}}startPolling(){this.pollInterval||=setInterval(()=>{for(;this.eventBuffer.length>0;){let e=this.eventBuffer.shift();e&&this.emitEvent(e)}},2e3)}stopPolling(){this.pollInterval&&=(clearInterval(this.pollInterval),void 0)}_bufferEvent(e){this.eventBuffer.push(e)}disconnect(){this.stopPolling(),this.subscriptions.clear(),this.eventBuffer=[]}},t_=class{constructor(e){this.meta={getTypes:async()=>{let e=this.getRoute(`metadata`),t=await this.fetch(`${this.baseUrl}${e}`);return this.unwrapResponse(t)},getItems:async(e,t)=>{let n=this.getRoute(`metadata`),r=new URLSearchParams;t?.packageId&&r.set(`package`,t.packageId);let i=r.toString(),a=`${this.baseUrl}${n}/${e}${i?`?${i}`:``}`,o=await this.fetch(a);return this.unwrapResponse(o)},getItem:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=new URLSearchParams;n?.packageId&&i.set(`package`,n.packageId);let a=i.toString(),o=`${this.baseUrl}${r}/${e}/${t}${a?`?${a}`:``}`,s=await this.fetch(o);return this.unwrapResponse(s)},saveItem:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=await this.fetch(`${this.baseUrl}${r}/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)});return this.unwrapResponse(i)},deleteItem:async(e,t)=>{let n=this.getRoute(`metadata`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(r)},getHistory:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=new URLSearchParams;n?.sinceSeq!==void 0&&i.set(`sinceSeq`,String(n.sinceSeq)),n?.limit!==void 0&&i.set(`limit`,String(n.limit));let a=i.toString(),o=`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/history${a?`?${a}`:``}`,s=await this.fetch(o);return this.unwrapResponse(s)},getCached:async(e,t)=>{let n=this.getRoute(`metadata`),r={};t?.ifNoneMatch&&(r[`If-None-Match`]=t.ifNoneMatch),t?.ifModifiedSince&&(r[`If-Modified-Since`]=t.ifModifiedSince);let i=await this.fetch(`${this.baseUrl}${n}/object/${e}`,{headers:r});if(i.status===304)return{notModified:!0,etag:t?.ifNoneMatch?{value:t.ifNoneMatch.replace(/^W\/|"/g,``),weak:t.ifNoneMatch.startsWith(`W/`)}:void 0};let a=await i.json(),o=i.headers.get(`ETag`),s=i.headers.get(`Last-Modified`);return{data:a,etag:o?{value:o.replace(/^W\/|"/g,``),weak:o.startsWith(`W/`)}:void 0,lastModified:s||void 0,notModified:!1}},getView:async(e,t=`list`)=>{let n=this.getRoute(`ui`),r=await this.fetch(`${this.baseUrl}${n}/view/${e}?type=${t}`);return this.unwrapResponse(r)}},this.analytics={query:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/query`,{method:`POST`,body:JSON.stringify(e)})).json()},meta:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/meta/${e}`)).json()},explain:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/explain`,{method:`POST`,body:JSON.stringify(e)})).json()}},this.packages={list:async e=>{let t=this.getRoute(`packages`),n=new URLSearchParams;e?.status&&n.set(`status`,e.status),e?.type&&n.set(`type`,e.type),e?.enabled!==void 0&&n.set(`enabled`,String(e.enabled));let r=n.toString(),i=`${this.baseUrl}${t}${r?`?`+r:``}`,a=await this.fetch(i);return this.unwrapResponse(a)},get:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},install:async(e,t)=>{let n=this.getRoute(`packages`),r=await this.fetch(`${this.baseUrl}${n}`,{method:`POST`,body:JSON.stringify({manifest:e,settings:t?.settings,enableOnInstall:t?.enableOnInstall})});return this.unwrapResponse(r)},uninstall:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`,{method:`DELETE`});return this.unwrapResponse(n)},enable:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/enable`,{method:`PATCH`});return this.unwrapResponse(n)},disable:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/disable`,{method:`PATCH`});return this.unwrapResponse(n)}},this.projects={list:async e=>{let t=new URLSearchParams;e?.organization_id&&t.set(`organizationId`,e.organization_id),e?.env_type&&t.set(`envType`,e.env_type),e?.status&&t.set(`status`,e.status);let n=t.toString(),r=`${this.baseUrl}/api/v1/cloud/environments${n?`?`+n:``}`,i=await this.fetch(r);return this.unwrapResponse(i)},get:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`);return this.unwrapResponse(t)},create:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(t)},update:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)});return this.unwrapResponse(n)},delete:async(e,t)=>{let n=t?.force?`?force=1`:``,r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}${n}`,{method:`DELETE`});return this.unwrapResponse(r)},activate:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/activate`,{method:`POST`});return this.unwrapResponse(t)},rotateCredential:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/credentials/rotate`,{method:`POST`,body:JSON.stringify({plaintext:t})});return this.unwrapResponse(n)},updateHostname:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/hostname`,{method:`POST`,body:JSON.stringify({hostname:t})});return this.unwrapResponse(n)},updateVisibility:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({visibility:t})});return this.unwrapResponse(n)},listRevisions:async(e,t)=>{let n=new URLSearchParams;t?.limit&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor),t?.branch&&n.set(`branch`,t.branch);let r=n.toString(),i=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/revisions${r?`?${r}`:``}`);return this.unwrapResponse(i)},listBranches:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches`);return this.unwrapResponse(t)},renameBranch:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches/${encodeURIComponent(t)}/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({newName:n})});return this.unwrapResponse(r)},deleteBranch:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},activateRevision:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/revisions/${encodeURIComponent(t)}/activate`,{method:`POST`});return this.unwrapResponse(n)},retryProvisioning:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/retry`,{method:`POST`});return this.unwrapResponse(t)},listMembers:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members`);return this.unwrapResponse(t)},addMember:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return this.unwrapResponse(n)},updateMemberRole:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({role:n})});return this.unwrapResponse(r)},removeMember:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},listDrivers:async()=>{let e=await this.fetch(`${this.baseUrl}/api/v1/cloud/drivers`);return this.unwrapResponse(e)},listTemplates:async()=>{let e=await this.fetch(`${this.baseUrl}/api/v1/cloud/templates`);return this.unwrapResponse(e)},packages:{list:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages`);return this.unwrapResponse(t)},install:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(n)},get:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}`);return this.unwrapResponse(n)},enable:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/enable`,{method:`PATCH`});return this.unwrapResponse(n)},disable:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/disable`,{method:`PATCH`});return this.unwrapResponse(n)},uninstall:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},upgrade:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/upgrade`,{method:`POST`,body:JSON.stringify({targetVersion:n})});return this.unwrapResponse(r)}}},this.organizations={list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/organization/list`)).json();return{organizations:Array.isArray(t)?t:t?.data??[]}},create:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/create`,{method:`POST`,body:JSON.stringify(e)})).json()},update:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/update`,{method:`POST`,body:JSON.stringify({organizationId:e,data:t})})).json()},setActive:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/set-active`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},get:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/get-full-organization?organizationId=${encodeURIComponent(e)}`)).json()},listMembers:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/list-members?organizationId=${encodeURIComponent(e)}`)).json()},invite:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/invite-member`,{method:`POST`,body:JSON.stringify(e)})).json()},leave:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/leave`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/delete`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},removeMember:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/remove-member`,{method:`POST`,body:JSON.stringify({memberIdOrEmail:t.memberIdOrEmail,organizationId:e})})).json()},updateMemberRole:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/update-member-role`,{method:`POST`,body:JSON.stringify({memberId:t.memberId,role:t.role,organizationId:e})})).json()},getActiveMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/get-active-member?organizationId=${encodeURIComponent(e)}`)).json()},invitations:{list:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-invitations?organizationId=${encodeURIComponent(e)}`)).json();return{invitations:Array.isArray(n)?n:n?.data??n?.invitations??[]}},listMine:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/organization/list-user-invitations`)).json();return{invitations:Array.isArray(t)?t:t?.data??t?.invitations??[]}},cancel:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/cancel-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},accept:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/accept-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},reject:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/reject-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},resend:async e=>{if(e.id)try{await this.organizations.invitations.cancel(e.id)}catch{}return this.organizations.invite({email:e.email,role:e.role??`member`,organizationId:e.organizationId})}},teams:{list:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-teams?organizationId=${encodeURIComponent(e)}`)).json();return{teams:Array.isArray(n)?n:n?.data??n?.teams??[]}},create:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/create-team`,{method:`POST`,body:JSON.stringify(e)})).json()},update:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/update-team`,{method:`POST`,body:JSON.stringify(e)})).json()},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/remove-team`,{method:`POST`,body:JSON.stringify(e)})).json()},listMembers:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-team-members?teamId=${encodeURIComponent(e)}`)).json();return{members:Array.isArray(n)?n:n?.data??n?.members??[]}},addMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/add-team-member`,{method:`POST`,body:JSON.stringify(e)})).json()},removeMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/remove-team-member`,{method:`POST`,body:JSON.stringify(e)})).json()}}},this.oauth={applications:{register:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/create-client`,{method:`POST`,body:JSON.stringify(e)})).json()},get:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/get-client?client_id=${encodeURIComponent(e)}`)).json()},getPublic:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/public-client?client_id=${encodeURIComponent(e)}`)).json()},list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/oauth2/get-clients`)).json();return{applications:Array.isArray(t)?t:t?.clients??t?.data??[]}},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/delete-client`,{method:`POST`,body:JSON.stringify({client_id:e})})).json()}},consent:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/consent`,{method:`POST`,body:JSON.stringify(e)})).json()}},this.auth={getConfig:async()=>{let e=this.getRoute(`auth`),t=await this.fetch(`${this.baseUrl}${e}/config`);return this.unwrapResponse(t)},login:async e=>{let t=this.getRoute(`auth`),n=await this.fetch(`${this.baseUrl}${t}/sign-in/email`,{method:`POST`,headers:{Origin:this.baseUrl},body:JSON.stringify(e)}),r=await n.json().catch(()=>({}));if(!n.ok){let e=r?.message||r?.error?.message||`Login failed (HTTP ${n.status})`,t=Error(e);throw r?.code&&(t.code=r.code),t.status=n.status,t}let i=r&&(r.data??(r.token||r.user?{token:r.token,user:r.user}:void 0)),a=i?{...r,data:i}:r;return a.data?.token&&(this.token=a.data.token),a},logout:async()=>{let e=this.getRoute(`auth`);await this.fetch(`${this.baseUrl}${e}/sign-out`,{method:`POST`,headers:{"Content-Type":`application/json`,Origin:this.baseUrl},body:`{}`}),this.token=void 0},me:async()=>{let e=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${e}/get-session`,{headers:{Origin:this.baseUrl}})).json()},register:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/sign-up/email`,{method:`POST`,headers:{Origin:this.baseUrl},body:JSON.stringify(e)})).json(),r=n&&(n.data??(n.token||n.user?{token:n.token,user:n.user}:void 0)),i=r?{...n,data:r}:n;return i.data?.token&&(this.token=i.data.token),i},signInWithProvider:async(e,t)=>{if(typeof window>`u`)throw Error(`signInWithProvider requires a browser environment`);let n=this.getRoute(`auth`),r=t?.callbackURL??window.location.origin+`/login`,i=t?.type===`oidc`,a=i?`/sign-in/oauth2`:`/sign-in/social`,o=i?{providerId:e,callbackURL:r}:{provider:e,callbackURL:r};t?.errorCallbackURL&&(o.errorCallbackURL=t.errorCallbackURL);let s=await(await this.fetch(`${this.baseUrl}${n}${a}`,{method:`POST`,body:JSON.stringify(o)})).json(),c=s?.url??s?.data?.url;if(c)window.location.assign(c);else throw Error(`signInWithProvider: no redirect URL returned for provider "${e}"`)},refreshToken:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/get-session`,{method:`GET`})).json();return n.data?.token&&(this.token=n.data.token),n},bootstrapStatus:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/bootstrap-status`)).json();return{hasOwner:!!(t?.data??t)?.hasOwner}},updateUser:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/update-user`,{method:`POST`,body:JSON.stringify(e)})).json()},changePassword:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/change-password`,{method:`POST`,body:JSON.stringify(e)})).json()},changeEmail:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/change-email`,{method:`POST`,body:JSON.stringify(e)})).json()},sendVerificationEmail:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/send-verification-email`,{method:`POST`,body:JSON.stringify(e)})).json()},verifyEmail:async e=>{let t=this.getRoute(`auth`),n=new URL(`${this.baseUrl}${t}/verify-email`);return n.searchParams.set(`token`,e.token),e.callbackURL&&n.searchParams.set(`callbackURL`,e.callbackURL),(await this.fetch(n.toString())).json()},deleteUser:async e=>{let t=this.getRoute(`auth`),n=await this.fetch(`${this.baseUrl}${t}/delete-user`,{method:`POST`,body:JSON.stringify(e)});return this.token=void 0,n.json()},sessions:{list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/list-sessions`)).json();return{sessions:Array.isArray(t)?t:t?.data??t?.sessions??[]}},revoke:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/revoke-session`,{method:`POST`,body:JSON.stringify({token:e})})).json()},revokeOthers:async()=>{let e=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${e}/revoke-other-sessions`,{method:`POST`,body:`{}`})).json()},revokeAll:async()=>{let e=this.getRoute(`auth`),t=await this.fetch(`${this.baseUrl}${e}/revoke-sessions`,{method:`POST`,body:`{}`});return this.token=void 0,t.json()}},twoFactor:{enable:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/two-factor/enable`,{method:`POST`,body:JSON.stringify(e)})).json();return n?.data??n},verifyTotp:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/verify-totp`,{method:`POST`,body:JSON.stringify(e)})).json()},disable:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/disable`,{method:`POST`,body:JSON.stringify(e)})).json()},generateBackupCodes:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/two-factor/generate-backup-codes`,{method:`POST`,body:JSON.stringify(e)})).json();return n?.data??n},verifyBackupCode:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/verify-backup-code`,{method:`POST`,body:JSON.stringify(e)})).json()}},accounts:{list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/list-accounts`)).json();return{accounts:Array.isArray(t)?t:t?.data??t?.accounts??[]}},unlink:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/unlink-account`,{method:`POST`,body:JSON.stringify(e)})).json()},linkSocial:async e=>{let t=this.getRoute(`auth`),n=e.callbackURL??(typeof window<`u`?window.location.href:void 0),r=await(await this.fetch(`${this.baseUrl}${t}/link-social`,{method:`POST`,body:JSON.stringify({provider:e.provider,callbackURL:n})})).json();return r?.data??r}}},this.storage={upload:async(e,t=`user`)=>{let n={filename:e.name,mimeType:e.type,size:e.size,scope:t},r=this.getRoute(`storage`),{data:i}=await(await this.fetch(`${this.baseUrl}${r}/upload/presigned`,{method:`POST`,body:JSON.stringify(n)})).json(),a=await this.fetchImpl(i.uploadUrl,{method:i.method,headers:i.headers,body:e});if(!a.ok)throw Error(`Storage Upload Failed: ${a.statusText}`);let o={fileId:i.fileId};return(await this.fetch(`${this.baseUrl}${r}/upload/complete`,{method:`POST`,body:JSON.stringify(o)})).json()},getDownloadUrl:async e=>{let t=this.getRoute(`storage`);return(await(await this.fetch(`${this.baseUrl}${t}/files/${e}/url`)).json()).url},getPresignedUrl:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/presigned`,{method:`POST`,body:JSON.stringify(e)})).json()},initChunkedUpload:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/chunked`,{method:`POST`,body:JSON.stringify(e)})).json()},uploadPart:async(e,t,n,r)=>{let i=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${i}/upload/chunked/${e}/chunk/${t}`,{method:`PUT`,headers:{"x-resume-token":n},body:r})).json()},completeChunkedUpload:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/chunked/${e.uploadId}/complete`,{method:`POST`,body:JSON.stringify(e)})).json()},resumeUpload:async(e,t,n,r)=>{let i=this.getRoute(`storage`),{totalChunks:a,uploadedChunks:o}=(await(await this.fetch(`${this.baseUrl}${i}/upload/chunked/${e}/progress`)).json()).data,s=[],c=t instanceof ArrayBuffer?t:await t.arrayBuffer();for(let t=o;t<a;t++){let i=t*n,a=Math.min(i+n,c.byteLength),o=new Blob([c.slice(i,a)]),l=await this.storage.uploadPart(e,t,r,o);s.push({chunkIndex:t,eTag:l.data.eTag})}return this.storage.completeChunkedUpload({uploadId:e,parts:s})}},this.automation={trigger:async(e,t)=>{let n=this.getRoute(`automation`);return(await this.fetch(`${this.baseUrl}${n}/trigger/${e}`,{method:`POST`,body:JSON.stringify(t)})).json()},list:async()=>{let e=this.getRoute(`automation`),t=await this.fetch(`${this.baseUrl}${e}`);return this.unwrapResponse(t)},get:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${e}`);return this.unwrapResponse(n)},create:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}`,{method:`POST`,body:JSON.stringify({name:e,...t})});return this.unwrapResponse(r)},update:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}`,{method:`PUT`,body:JSON.stringify({definition:t})});return this.unwrapResponse(r)},delete:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${e}`,{method:`DELETE`});return this.unwrapResponse(n)},toggle:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}/toggle`,{method:`POST`,body:JSON.stringify({enabled:t})});return this.unwrapResponse(r)},runs:{list:async(e,t)=>{let n=this.getRoute(`automation`),r=new URLSearchParams;t?.limit&&r.set(`limit`,String(t.limit)),t?.cursor&&r.set(`cursor`,t.cursor);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${e}/runs${i?`?${i}`:``}`);return this.unwrapResponse(a)},get:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}/runs/${t}`);return this.unwrapResponse(r)}},getFlow:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},execute:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/trigger`,{method:`POST`,body:JSON.stringify(t??{})});return this.unwrapResponse(r)},listRuns:async(e,t)=>{let n=this.getRoute(`automation`),r=new URLSearchParams;t?.limit!=null&&r.set(`limit`,String(t.limit)),t?.cursor&&r.set(`cursor`,t.cursor);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/runs${i?`?${i}`:``}`);return this.unwrapResponse(a)},getRun:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`);return this.unwrapResponse(r)}},this.permissions={check:async e=>{let t=this.getRoute(`permissions`),n=new URLSearchParams({object:e.object,action:e.action});e.recordId!==void 0&&n.set(`recordId`,e.recordId),e.field!==void 0&&n.set(`field`,e.field);let r=await this.fetch(`${this.baseUrl}${t}/check?${n.toString()}`);return this.unwrapResponse(r)},getObjectPermissions:async e=>{let t=this.getRoute(`permissions`),n=await this.fetch(`${this.baseUrl}${t}/objects/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},getEffectivePermissions:async()=>{let e=this.getRoute(`permissions`),t=await this.fetch(`${this.baseUrl}${e}/effective`);return this.unwrapResponse(t)}},this.realtime={connect:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/connect`,{method:`POST`,body:JSON.stringify(e||{})});return this.unwrapResponse(n)},disconnect:async()=>{let e=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${e}/disconnect`,{method:`POST`})},subscribe:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/subscribe`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},unsubscribe:async e=>{let t=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${t}/unsubscribe`,{method:`POST`,body:JSON.stringify({subscriptionId:e})})},setPresence:async(e,t)=>{let n=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${n}/presence`,{method:`PUT`,body:JSON.stringify({channel:e,state:t})})},getPresence:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/presence/${encodeURIComponent(e)}`);return this.unwrapResponse(n)}},this.workflow={getConfig:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/config`);return this.unwrapResponse(n)},getState:async(e,t)=>{let n=this.getRoute(`workflow`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/state`);return this.unwrapResponse(r)},transition:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e.object)}/${encodeURIComponent(e.recordId)}/transition`,{method:`POST`,body:JSON.stringify({transition:e.transition,comment:e.comment,data:e.data})});return this.unwrapResponse(n)}},this.approvals={listRequests:async e=>{let t=this.getRoute(`approvals`),n=new URLSearchParams;e?.object&&n.set(`object`,e.object),e?.recordId&&n.set(`recordId`,e.recordId),e?.status&&n.set(`status`,Array.isArray(e.status)?e.status.join(`,`):e.status),e?.approverId&&n.set(`approverId`,Array.isArray(e.approverId)?e.approverId.join(`,`):e.approverId),e?.submitterId&&n.set(`submitterId`,e.submitterId);let r=n.toString(),i=await this.fetch(`${this.baseUrl}${t}/requests${r?`?${r}`:``}`),a=await this.unwrapResponse(i);return Array.isArray(a)?a:a?.data??[]},getRequest:async e=>{let t=this.getRoute(`approvals`),n=await this.fetch(`${this.baseUrl}${t}/requests/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},approve:async(e,t)=>{let n=this.getRoute(`approvals`),r=await this.fetch(`${this.baseUrl}${n}/requests/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify({actorId:t?.actorId,comment:t?.comment})});return this.unwrapResponse(r)},reject:async(e,t)=>{let n=this.getRoute(`approvals`),r=await this.fetch(`${this.baseUrl}${n}/requests/${encodeURIComponent(e)}/reject`,{method:`POST`,body:JSON.stringify({actorId:t?.actorId,comment:t?.comment})});return this.unwrapResponse(r)},listActions:async e=>{let t=this.getRoute(`approvals`),n=await this.fetch(`${this.baseUrl}${t}/requests/${encodeURIComponent(e)}/actions`),r=await this.unwrapResponse(n);return Array.isArray(r)?r:r?.data??[]}},this.views={list:async(e,t)=>{let n=this.getRoute(`views`),r=new URLSearchParams;t&&r.set(`type`,t);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}${i?`?${i}`:``}`);return this.unwrapResponse(a)},get:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`);return this.unwrapResponse(r)},create:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({object:e,data:t})});return this.unwrapResponse(r)},update:async(e,t,n)=>{let r=this.getRoute(`views`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PUT`,body:JSON.stringify({object:e,viewId:t,data:n})});return this.unwrapResponse(i)},delete:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(r)}},this.notifications={registerDevice:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/devices`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},unregisterDevice:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/devices/${encodeURIComponent(e)}`,{method:`DELETE`});return this.unwrapResponse(n)},getPreferences:async()=>{let e=this.getRoute(`notifications`),t=await this.fetch(`${this.baseUrl}${e}/preferences`);return this.unwrapResponse(t)},updatePreferences:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/preferences`,{method:`PUT`,body:JSON.stringify({preferences:e})});return this.unwrapResponse(n)},list:async e=>{let t=this.getRoute(`notifications`),n=new URLSearchParams;e?.read!==void 0&&n.set(`read`,String(e.read)),e?.type&&n.set(`type`,e.type),e?.limit&&n.set(`limit`,String(e.limit)),e?.cursor&&n.set(`cursor`,e.cursor);let r=n.toString(),i=await this.fetch(`${this.baseUrl}${t}${r?`?${r}`:``}`);return this.unwrapResponse(i)},markRead:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/read`,{method:`POST`,body:JSON.stringify({ids:e})});return this.unwrapResponse(n)},markAllRead:async()=>{let e=this.getRoute(`notifications`),t=await this.fetch(`${this.baseUrl}${e}/read/all`,{method:`POST`});return this.unwrapResponse(t)}},this.ai={nlq:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/nlq`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},suggest:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/suggest`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},insights:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/insights`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)}},this.i18n={getLocales:async()=>{let e=this.getRoute(`i18n`),t=await this.fetch(`${this.baseUrl}${e}/locales`);return this.unwrapResponse(t)},getTranslations:async(e,t)=>{let n=this.getRoute(`i18n`),r=new URLSearchParams;r.set(`locale`,e),t?.namespace&&r.set(`namespace`,t.namespace),t?.keys&&r.set(`keys`,t.keys.join(`,`));let i=await this.fetch(`${this.baseUrl}${n}/translations?${r.toString()}`);return this.unwrapResponse(i)},getFieldLabels:async(e,t)=>{let n=this.getRoute(`i18n`),r=await this.fetch(`${this.baseUrl}${n}/labels/${encodeURIComponent(e)}?locale=${encodeURIComponent(t)}`);return this.unwrapResponse(r)}},this.feed={list:async(e,t,n)=>{let r=this.getRoute(`data`),i=new URLSearchParams;n?.type&&i.set(`type`,n.type),n?.limit&&i.set(`limit`,String(n.limit)),n?.cursor&&i.set(`cursor`,n.cursor);let a=i.toString(),o=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed${a?`?${a}`:``}`);return this.unwrapResponse(o)},create:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed`,{method:`POST`,body:JSON.stringify(n)});return this.unwrapResponse(i)},update:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}`,{method:`PUT`,body:JSON.stringify(r)});return this.unwrapResponse(a)},delete:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}`,{method:`DELETE`});return this.unwrapResponse(i)},addReaction:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/reactions`,{method:`POST`,body:JSON.stringify({emoji:r})});return this.unwrapResponse(a)},removeReaction:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/reactions/${encodeURIComponent(r)}`,{method:`DELETE`});return this.unwrapResponse(a)},pin:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/pin`,{method:`POST`});return this.unwrapResponse(i)},unpin:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/pin`,{method:`DELETE`});return this.unwrapResponse(i)},star:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/star`,{method:`POST`});return this.unwrapResponse(i)},unstar:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/star`,{method:`DELETE`});return this.unwrapResponse(i)},search:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=new URLSearchParams;a.set(`query`,n),r?.type&&a.set(`type`,r.type),r?.actorId&&a.set(`actorId`,r.actorId),r?.dateFrom&&a.set(`dateFrom`,r.dateFrom),r?.dateTo&&a.set(`dateTo`,r.dateTo),r?.limit&&a.set(`limit`,String(r.limit)),r?.cursor&&a.set(`cursor`,r.cursor);let o=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/search?${a.toString()}`);return this.unwrapResponse(o)},getChangelog:async(e,t,n)=>{let r=this.getRoute(`data`),i=new URLSearchParams;n?.field&&i.set(`field`,n.field),n?.actorId&&i.set(`actorId`,n.actorId),n?.dateFrom&&i.set(`dateFrom`,n.dateFrom),n?.dateTo&&i.set(`dateTo`,n.dateTo),n?.limit&&i.set(`limit`,String(n.limit)),n?.cursor&&i.set(`cursor`,n.cursor);let a=i.toString(),o=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/changelog${a?`?${a}`:``}`);return this.unwrapResponse(o)},subscribe:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/subscribe`,{method:`POST`,body:JSON.stringify(n||{})});return this.unwrapResponse(i)},unsubscribe:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/subscribe`,{method:`DELETE`});return this.unwrapResponse(r)}},this.data={query:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/query`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},find:async(e,t={})=>{let n=this.getRoute(`data`),r=new URLSearchParams,i=t,a={};if(`where`in t||`fields`in t||`orderBy`in t||`offset`in t?(i.where&&(a.filter=i.where),i.fields&&(a.select=i.fields),i.orderBy&&(a.sort=i.orderBy),i.limit!=null&&(a.top=i.limit),i.offset!=null&&(a.skip=i.offset),i.aggregations&&(a.aggregations=i.aggregations),i.groupBy&&(a.groupBy=i.groupBy)):Object.assign(a,t),a.top&&r.set(`top`,a.top.toString()),a.skip&&r.set(`skip`,a.skip.toString()),a.sort)if(Array.isArray(a.sort)&&typeof a.sort[0]==`object`)r.set(`sort`,JSON.stringify(a.sort));else{let e=Array.isArray(a.sort)?a.sort.join(`,`):a.sort;r.set(`sort`,e)}a.select&&r.set(`select`,a.select.join(`,`));let o=a.filter??a.filters;o&&(this.isFilterAST(o)||Array.isArray(o)?r.set(`filter`,JSON.stringify(o)):typeof o==`object`&&o&&Object.entries(o).forEach(([e,t])=>{t!=null&&r.append(e,String(t))})),a.aggregations&&r.set(`aggregations`,JSON.stringify(a.aggregations)),a.groupBy&&r.set(`groupBy`,a.groupBy.join(`,`));let s=await this.fetch(`${this.baseUrl}${n}/${e}?${r.toString()}`);return this.unwrapResponse(s)},get:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/${t}`);return this.unwrapResponse(r)},create:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},createMany:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/createMany`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},update:async(e,t,n,r)=>{let i=this.getRoute(`data`),a={};r?.ifMatch&&(a[`If-Match`]=String(r.ifMatch));let o=await this.fetch(`${this.baseUrl}${i}/${e}/${t}`,{method:`PATCH`,body:JSON.stringify(n),...Object.keys(a).length?{headers:a}:{}});return this.unwrapResponse(o)},batch:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/batch`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},updateMany:async(e,t,n)=>{let r=this.getRoute(`data`),i={records:t,options:n},a=await this.fetch(`${this.baseUrl}${r}/${e}/updateMany`,{method:`POST`,body:JSON.stringify(i)});return this.unwrapResponse(a)},delete:async(e,t,n)=>{let r=this.getRoute(`data`),i={};n?.ifMatch&&(i[`If-Match`]=String(n.ifMatch));let a=await this.fetch(`${this.baseUrl}${r}/${e}/${t}`,{method:`DELETE`,...Object.keys(i).length?{headers:i}:{}});return this.unwrapResponse(a)},deleteMany:async(e,t,n)=>{let r=this.getRoute(`data`),i={ids:t,options:n},a=await this.fetch(`${this.baseUrl}${r}/${e}/deleteMany`,{method:`POST`,body:JSON.stringify(i)});return this.unwrapResponse(a)}},this.baseUrl=e.baseUrl.replace(/\/$/,``),this.token=e.token,this.environmentId=e.environmentId,this.locale=e.locale,this.fetchImpl=e.fetch||globalThis.fetch.bind(globalThis),this.logger=e.logger||$g({level:e.debug?`debug`:`info`,format:`pretty`}),this.realtimeAPI=new e_(this.baseUrl,this.token),this.logger.debug(`ObjectStack client created`,{baseUrl:this.baseUrl})}async connect(){this.logger.debug(`Connecting to ObjectStack server`,{baseUrl:this.baseUrl});try{let e;try{let t=`${this.baseUrl}/api/v1/discovery`;this.logger.debug(`Probing protocol-standard discovery endpoint`,{url:t});let n=await this.fetchImpl(t);if(n.ok){let t=await n.json();e=t.data||t,this.logger.debug(`Discovered via /api/v1/discovery`)}}catch(e){this.logger.debug(`Protocol-standard discovery probe failed`,{error:e.message})}if(!e){let t;try{t=`${new URL(this.baseUrl).origin}/.well-known/objectstack`}catch{t=`/.well-known/objectstack`}this.logger.debug(`Falling back to .well-known discovery`,{url:t});let n=await this.fetchImpl(t);if(!n.ok)throw Error(`Failed to connect to ${t}: ${n.statusText}`);let r=await n.json();e=r.data||r}if(!e)throw Error(`Connection failed: No discovery data returned`);return this.discoveryInfo=e,this.logger.info(`Connected to ObjectStack server`,{version:e.version,apiName:e.apiName,services:e.services}),e}catch(e){throw this.logger.error(`Failed to connect to ObjectStack server`,e,{baseUrl:this.baseUrl}),e}}get capabilities(){let e=this.discoveryInfo?.capabilities;if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`object`&&r?!!r.enabled:!!r;return t}project(e){if(!e)throw Error(`[ObjectStack] project(id): environmentId is required`);return new n_(this,e)}_baseUrl(){return this.baseUrl}_fetch(e,t){return this.fetch(e,t)}_unwrap(e){return this.unwrapResponse(e)}_isFilterAST(e){return this.isFilterAST(e)}setProjectId(e){this.environmentId=e,this.logger.debug(`Active project changed`,{environmentId:e})}getProjectId(){return this.environmentId}setLocale(e){this.locale=e,this.logger.debug(`Active locale changed`,{locale:e})}getLocale(){return this.locale}get events(){return this.realtimeAPI}isFilterAST(e){return ep(e)}async unwrapResponse(e){let t=await e.json();return t&&typeof t.success==`boolean`&&`data`in t?t.data:t}async fetch(e,t={}){this.logger.debug(`HTTP request`,{method:t.method||`GET`,url:e,hasBody:!!t.body});let n={"Content-Type":`application/json`,...t.headers||{}};this.token&&(n.Authorization=`Bearer ${this.token}`),this.environmentId&&(n[`X-Environment-Id`]=this.environmentId),this.locale&&!Object.keys(n).some(e=>e.toLowerCase()===`accept-language`)&&(n[`Accept-Language`]=this.locale);let r=await this.fetchImpl(e,{...t,headers:n});if(this.logger.debug(`HTTP response`,{method:t.method||`GET`,url:e,status:r.status,ok:r.ok}),!r.ok){let n;try{n=await r.json()}catch{n={message:r.statusText}}this.logger.error(`HTTP request failed`,void 0,{method:t.method||`GET`,url:e,status:r.status,error:n});let i=n?.message??n?.error?.message??(typeof n?.error==`string`?n.error:void 0)??r.statusText,a=n?.code||n?.error?.code,o=Error(`[ObjectStack] ${a?`${a}: `:``}${i}`);throw o.code=a,o.category=n?.category,o.httpStatus=r.status,o.retryable=n?.retryable,o.details=n?.details||n,o}return r}getRoute(e){let t=this.discoveryInfo?.routes;if(t){let n=t[e];if(n)return n}return{data:`/api/v1/data`,metadata:`/api/v1/meta`,discovery:`/api/v1/discovery`,ui:`/api/v1/ui`,auth:`/api/v1/auth`,analytics:`/api/v1/analytics`,storage:`/api/v1/storage`,automation:`/api/v1/automation`,packages:`/api/v1/packages`,permissions:`/api/v1/permissions`,realtime:`/api/v1/realtime`,workflow:`/api/v1/workflow`,approvals:`/api/v1/approvals`,views:`/api/v1/ui/views`,notifications:`/api/v1/notifications`,ai:`/api/v1/ai`,i18n:`/api/v1/i18n`,feed:`/api/v1/feed`,graphql:`/graphql`}[e]||`/api/v1/${e}`}},n_=class{constructor(e,t){this.meta={getTypes:async()=>{let e=await this.parent._fetch(this.url(`/meta`));return this.parent._unwrap(e)},getItems:async(e,t)=>{let n=new URLSearchParams;t?.packageId&&n.set(`package`,t.packageId);let r=n.toString(),i=await this.parent._fetch(this.url(`/meta/${e}${r?`?${r}`:``}`));return this.parent._unwrap(i)},getItem:async(e,t,n)=>{let r=new URLSearchParams;n?.packageId&&r.set(`package`,n.packageId);let i=r.toString(),a=await this.parent._fetch(this.url(`/meta/${e}/${t}${i?`?${i}`:``}`));return this.parent._unwrap(a)},saveItem:async(e,t,n)=>{let r=await this.parent._fetch(this.url(`/meta/${e}/${t}`),{method:`PUT`,body:JSON.stringify(n)});return this.parent._unwrap(r)},deleteItem:async(e,t)=>{let n=await this.parent._fetch(this.url(`/meta/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),{method:`DELETE`});return this.parent._unwrap(n)},getHistory:async(e,t,n)=>{let r=new URLSearchParams;n?.sinceSeq!==void 0&&r.set(`sinceSeq`,String(n.sinceSeq)),n?.limit!==void 0&&r.set(`limit`,String(n.limit));let i=r.toString(),a=await this.parent._fetch(this.url(`/meta/${encodeURIComponent(e)}/${encodeURIComponent(t)}/history${i?`?${i}`:``}`));return this.parent._unwrap(a)}},this.data={query:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/query`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},find:async(e,t={})=>{let n=new URLSearchParams,r=t,i={};if(`where`in t||`fields`in t||`orderBy`in t||`offset`in t?(r.where&&(i.filter=r.where),r.fields&&(i.select=r.fields),r.orderBy&&(i.sort=r.orderBy),r.limit!=null&&(i.top=r.limit),r.offset!=null&&(i.skip=r.offset),r.aggregations&&(i.aggregations=r.aggregations),r.groupBy&&(i.groupBy=r.groupBy)):Object.assign(i,t),i.top&&n.set(`top`,i.top.toString()),i.skip&&n.set(`skip`,i.skip.toString()),i.sort)if(Array.isArray(i.sort)&&typeof i.sort[0]==`object`)n.set(`sort`,JSON.stringify(i.sort));else{let e=Array.isArray(i.sort)?i.sort.join(`,`):i.sort;n.set(`sort`,e)}i.select&&n.set(`select`,i.select.join(`,`));let a=i.filter??i.filters;a&&(this.parent._isFilterAST(a)||Array.isArray(a)?n.set(`filter`,JSON.stringify(a)):typeof a==`object`&&a&&Object.entries(a).forEach(([e,t])=>{t!=null&&n.append(e,String(t))})),i.aggregations&&n.set(`aggregations`,JSON.stringify(i.aggregations)),i.groupBy&&n.set(`groupBy`,i.groupBy.join(`,`));let o=n.toString(),s=await this.parent._fetch(this.url(`/data/${e}${o?`?${o}`:``}`));return this.parent._unwrap(s)},get:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/${t}`));return this.parent._unwrap(n)},create:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},createMany:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/createMany`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},update:async(e,t,n)=>{let r=await this.parent._fetch(this.url(`/data/${e}/${t}`),{method:`PATCH`,body:JSON.stringify(n)});return this.parent._unwrap(r)},batch:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/batch`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},updateMany:async(e,t,n)=>{let r={records:t,options:n},i=await this.parent._fetch(this.url(`/data/${e}/updateMany`),{method:`POST`,body:JSON.stringify(r)});return this.parent._unwrap(i)},delete:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/${t}`),{method:`DELETE`});return this.parent._unwrap(n)},deleteMany:async(e,t,n)=>{let r={ids:t,options:n},i=await this.parent._fetch(this.url(`/data/${e}/deleteMany`),{method:`POST`,body:JSON.stringify(r)});return this.parent._unwrap(i)}},this.packages={list:async()=>{let e=await this.parent._fetch(this.url(`/packages`));return this.parent._unwrap(e)},get:async(e,t)=>{let n=t?`?version=${encodeURIComponent(t)}`:``,r=await this.parent._fetch(this.url(`/packages/${encodeURIComponent(e)}${n}`));return this.parent._unwrap(r)}},this.automation={getFlow:async e=>{let t=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}`));return this.parent._unwrap(t)},execute:async(e,t)=>{let n=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/trigger`),{method:`POST`,body:JSON.stringify(t??{})});return this.parent._unwrap(n)},listRuns:async(e,t)=>{let n=new URLSearchParams;t?.limit!=null&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor);let r=n.toString(),i=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/runs${r?`?${r}`:``}`));return this.parent._unwrap(i)},getRun:async(e,t)=>{let n=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`));return this.parent._unwrap(n)}},this.parent=e,this.environmentId=t}getProjectId(){return this.environmentId}scope(){return`/api/v1/environments/${encodeURIComponent(this.environmentId)}`}url(e){return`${this.parent._baseUrl()}${this.scope()}${e}`}},r_=(0,j.createContext)(null),i_=(0,j.createContext)(void 0);function a_({client:e,locale:t,children:n}){let r=(0,j.useRef)(null);return(r.current?.client!==e||r.current?.locale!==t)&&(r.current={client:e,locale:t},e.setLocale?.(t)),j.createElement(r_.Provider,{value:e},j.createElement(i_.Provider,{value:t},n))}function o_(){let e=(0,j.useContext)(r_);if(!e)throw Error(`useClient must be used within an ObjectStackProvider. Make sure your component is wrapped with <ObjectStackProvider client={...}>.`);return e}var s_=1,c_=1e6,l_=0;function u_(){return l_=(l_+1)%(2**53-1),l_.toString()}var d_=new Map,f_=e=>{if(d_.has(e))return;let t=setTimeout(()=>{d_.delete(e),g_({type:`REMOVE_TOAST`,toastId:e})},c_);d_.set(e,t)},p_=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,s_)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?f_(n):e.toasts.forEach(e=>{f_(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},m_=[],h_={toasts:[]};function g_(e){h_=p_(h_,e),m_.forEach(e=>{e(h_)})}function K({...e}){let t=u_(),n=e=>g_({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>g_({type:`DISMISS_TOAST`,toastId:t});return g_({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function __(){let[e,t]=j.useState(h_);return j.useEffect(()=>(m_.push(t),()=>{let e=m_.indexOf(t);e>-1&&m_.splice(e,1)}),[e]),{...e,toast:K,dismiss:e=>g_({type:`DISMISS_TOAST`,toastId:e})}}typeof window<`u`&&window.document&&window.document.createElement;function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function v_(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function y_(...e){return t=>{let n=!1,r=e.map(e=>{let r=v_(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():v_(e[t],null)}}}}function b_(...e){return j.useCallback(y_(...e),e)}function x_(e,t){let n=j.createContext(t),r=e=>{let{children:t,...r}=e,i=j.useMemo(()=>r,Object.values(r));return(0,M.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=j.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function S_(e,t=[]){let n=[];function r(t,r){let i=j.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=j.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=j.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>j.createContext(e));return function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,C_(i,...t)]}function C_(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function w_(e){let t=T_(e),n=j.forwardRef((e,n)=>{let{children:r,...i}=e,a=j.Children.toArray(r),o=a.find(O_);if(o){let e=o.props.children,r=a.map(t=>t===o?j.Children.count(e)>1?j.Children.only(null):j.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:j.isValidElement(e)?j.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function T_(e){let t=j.forwardRef((e,t)=>{let{children:n,...r}=e;if(j.isValidElement(n)){let e=A_(n),i=k_(r,n.props);return n.type!==j.Fragment&&(i.ref=t?y_(t,e):e),j.cloneElement(n,i)}return j.Children.count(n)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var E_=Symbol(`radix.slottable`);function D_(e){let t=({children:e})=>(0,M.jsx)(M.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=E_,t}function O_(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===E_}function k_(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function A_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function j_(e){let t=e+`CollectionProvider`,[n,r]=S_(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=j.useRef(null),a=j.useRef(new Map).current;return(0,M.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=w_(s),l=j.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,M.jsx)(c,{ref:b_(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=w_(u),p=j.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=j.useRef(null),s=b_(t,o),c=a(u,n);return j.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,M.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return j.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var M_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w_(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function N_(e,t){e&&Gi.flushSync(()=>e.dispatchEvent(t))}function P_(e){let t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...e)=>t.current?.(...e),[])}function F_(e,t=globalThis?.document){let n=P_(e);j.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var I_=`DismissableLayer`,L_=`dismissableLayer.update`,R_=`dismissableLayer.pointerDownOutside`,z_=`dismissableLayer.focusOutside`,B_,V_=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),H_=j.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=j.useContext(V_),[u,d]=j.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=j.useState({}),m=b_(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=G_(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=K_(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return F_(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),j.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(B_=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),q_(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=B_)}},[u,f,n,l]),j.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),q_())},[u,l]),j.useEffect(()=>{let e=()=>p({});return document.addEventListener(L_,e),()=>document.removeEventListener(L_,e)},[]),(0,M.jsx)(M_.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,S.onFocusCapture),onBlurCapture:q(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,x.onPointerDownCapture)})});H_.displayName=I_;var U_=`DismissableLayerBranch`,W_=j.forwardRef((e,t)=>{let n=j.useContext(V_),r=j.useRef(null),i=b_(t,r);return j.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)(M_.div,{...e,ref:i})});W_.displayName=U_;function G_(e,t=globalThis?.document){let n=P_(e),r=j.useRef(!1),i=j.useRef(()=>{});return j.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){J_(R_,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function K_(e,t=globalThis?.document){let n=P_(e),r=j.useRef(!1);return j.useEffect(()=>{let e=e=>{e.target&&!r.current&&J_(z_,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function q_(){let e=new CustomEvent(L_);document.dispatchEvent(e)}function J_(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?N_(i,a):i.dispatchEvent(a)}var Y_=H_,X_=W_,Z_=globalThis?.document?j.useLayoutEffect:()=>{},Q_=`Portal`,$_=j.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=j.useState(!1);Z_(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Gi.createPortal((0,M.jsx)(M_.div,{...r,ref:t}),o):null});$_.displayName=Q_;function ev(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}var tv=e=>{let{present:t,children:n}=e,r=nv(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=b_(r.ref,iv(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null};tv.displayName=`Presence`;function nv(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),[o,s]=ev(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{let e=rv(r.current);a.current=o===`mounted`?e:`none`},[o]),Z_(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=rv(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Z_(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=rv(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=rv(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:j.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function rv(e){return e?.animationName||`none`}function iv(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var av=j.useInsertionEffect||Z_;function ov({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=sv({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=j.useRef(e!==void 0);j.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,j.useCallback(t=>{if(s){let n=cv(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function sv({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return av(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function cv(e){return typeof e==`function`}var lv=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),uv=`VisuallyHidden`,dv=j.forwardRef((e,t)=>(0,M.jsx)(M_.span,{...e,ref:t,style:{...lv,...e.style}}));dv.displayName=uv;var fv=dv,pv=`ToastProvider`,[mv,hv,gv]=j_(`Toast`),[_v,vv]=S_(`Toast`,[gv]),[yv,bv]=_v(pv),xv=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=j.useState(null),[l,u]=j.useState(0),d=j.useRef(!1),f=j.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${pv}\`. Expected non-empty \`string\`.`),(0,M.jsx)(mv.Provider,{scope:t,children:(0,M.jsx)(yv,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:j.useCallback(()=>u(e=>e+1),[]),onToastRemove:j.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};xv.displayName=pv;var Sv=`ToastViewport`,Cv=[`F8`],wv=`toast.viewportPause`,Tv=`toast.viewportResume`,Ev=j.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=Cv,label:i=`Notifications ({hotkey})`,...a}=e,o=bv(Sv,n),s=hv(n),c=j.useRef(null),l=j.useRef(null),u=j.useRef(null),d=j.useRef(null),f=b_(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;j.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),j.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(wv);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Tv);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=j.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...$v(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return j.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);ey(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,M.jsxs)(X_,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,M.jsx)(Ov,{ref:l,onFocusFromOutsideViewport:()=>{ey(h({tabbingDirection:`forwards`}))}}),(0,M.jsx)(mv.Slot,{scope:n,children:(0,M.jsx)(M_.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,M.jsx)(Ov,{ref:u,onFocusFromOutsideViewport:()=>{ey(h({tabbingDirection:`backwards`}))}})]})});Ev.displayName=Sv;var Dv=`ToastFocusProxy`,Ov=j.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=bv(Dv,n);return(0,M.jsx)(dv,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});Ov.displayName=Dv;var kv=`Toast`,Av=`toast.swipeStart`,jv=`toast.swipeMove`,Mv=`toast.swipeCancel`,Nv=`toast.swipeEnd`,Pv=j.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=ov({prop:r,defaultProp:i??!0,onChange:a,caller:kv});return(0,M.jsx)(tv,{present:n||s,children:(0,M.jsx)(Lv,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:P_(e.onPause),onResume:P_(e.onResume),onSwipeStart:q(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:q(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:q(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:q(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Pv.displayName=kv;var[Fv,Iv]=_v(kv,{onClose(){}}),Lv=j.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=bv(kv,n),[g,_]=j.useState(null),v=b_(t,e=>_(e)),y=j.useRef(null),b=j.useRef(null),x=i||h.duration,S=j.useRef(0),C=j.useRef(x),w=j.useRef(0),{onToastAdd:T,onToastRemove:E}=h,D=P_(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),O=j.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),S.current=new Date().getTime(),w.current=window.setTimeout(D,e))},[D]);j.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{O(C.current),l?.()},n=()=>{let e=new Date().getTime()-S.current;C.current-=e,window.clearTimeout(w.current),c?.()};return e.addEventListener(wv,n),e.addEventListener(Tv,t),()=>{e.removeEventListener(wv,n),e.removeEventListener(Tv,t)}}},[h.viewport,x,c,l,O]),j.useEffect(()=>{a&&!h.isClosePausedRef.current&&O(x)},[a,x,h.isClosePausedRef,O]),j.useEffect(()=>(T(),()=>E()),[T,E]);let ee=j.useMemo(()=>g?Jv(g):null,[g]);return h.viewport?(0,M.jsxs)(M.Fragment,{children:[ee&&(0,M.jsx)(Rv,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ee}),(0,M.jsx)(Fv,{scope:n,onClose:D,children:Gi.createPortal((0,M.jsx)(mv.ItemSlot,{scope:n,children:(0,M.jsx)(Y_,{asChild:!0,onEscapeKeyDown:q(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||D(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,M.jsx)(M_.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:q(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:q(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:q(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!b.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(b.current=l,Yv(jv,d,f,{discrete:!1})):Xv(l,h.swipeDirection,c)?(b.current=l,Yv(Av,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:q(e.onPointerUp,e=>{let t=b.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),b.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Xv(t,h.swipeDirection,h.swipeThreshold)?Yv(Nv,p,r,{discrete:!0}):Yv(Mv,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Rv=e=>{let{__scopeToast:t,children:n,...r}=e,i=bv(kv,t),[a,o]=j.useState(!1),[s,c]=j.useState(!1);return Zv(()=>o(!0)),j.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,M.jsx)($_,{asChild:!0,children:(0,M.jsx)(dv,{...r,children:a&&(0,M.jsxs)(M.Fragment,{children:[i.label,` `,n]})})})},zv=`ToastTitle`,Bv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,M.jsx)(M_.div,{...r,ref:t})});Bv.displayName=zv;var Vv=`ToastDescription`,Hv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,M.jsx)(M_.div,{...r,ref:t})});Hv.displayName=Vv;var Uv=`ToastAction`,Wv=j.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,M.jsx)(qv,{altText:n,asChild:!0,children:(0,M.jsx)(Kv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Uv}\`. Expected non-empty \`string\`.`),null)});Wv.displayName=Uv;var Gv=`ToastClose`,Kv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Iv(Gv,n);return(0,M.jsx)(qv,{asChild:!0,children:(0,M.jsx)(M_.button,{type:`button`,...r,ref:t,onClick:q(e.onClick,i.onClose)})})});Kv.displayName=Gv;var qv=j.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,M.jsx)(M_.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Jv(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Qv(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Jv(e))}}),t}function Yv(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?N_(i,a):i.dispatchEvent(a)}var Xv=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Zv(e=()=>{}){let t=P_(e);Z_(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Qv(e){return e.nodeType===e.ELEMENT_NODE}function $v(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ey(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var ty=xv,ny=Ev,ry=Pv,iy=Bv,ay=Hv,oy=Wv,sy=Kv;function cy(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=cy(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ly(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=cy(e))&&(r&&(r+=` `),r+=t);return r}var uy=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,dy=ly,fy=(e,t)=>n=>{if(t?.variants==null)return dy(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=uy(t)||uy(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return dy(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},py=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),my=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),hy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),gy=e=>{let t=hy(e);return t.charAt(0).toUpperCase()+t.slice(1)},_y={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},vy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},yy=(0,j.createContext)({}),by=()=>(0,j.useContext)(yy),xy=(0,j.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=by()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,j.createElement)(`svg`,{ref:c,..._y,width:t??l??_y.width,height:t??l??_y.height,stroke:e??f,strokeWidth:m,className:py(`lucide`,p,i),...!a&&!vy(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,j.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),J=(e,t)=>{let n=(0,j.forwardRef)(({className:n,...r},i)=>(0,j.createElement)(xy,{ref:i,iconNode:t,className:py(`lucide-${my(gy(e))}`,`lucide-${e}`,n),...r}));return n.displayName=gy(e),n},Sy=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Cy=J(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),wy=J(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ty=J(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ey=J(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Dy=J(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Oy=J(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),ky=J(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ay=J(`circle-user-round`,[[`path`,{d:`M17.925 20.056a6 6 0 0 0-11.851.001`,key:`z69sun`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),jy=J(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),My=J(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ny=J(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Py=J(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Fy=J(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Iy=J(`gallery-vertical-end`,[[`path`,{d:`M7 2h10`,key:`nczekb`}],[`path`,{d:`M5 6h14`,key:`u2x4p`}],[`rect`,{width:`18`,height:`12`,x:`3`,y:`10`,rx:`2`,key:`l0tzu3`}]]),Ly=J(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ry=J(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),zy=J(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),By=J(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Vy=J(`languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Hy=J(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),Uy=J(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Wy=J(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Gy=J(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),Ky=J(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),qy=J(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Jy=J(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Yy=J(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Xy=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Zy=J(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Qy=J(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),$y=J(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),eb=J(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),tb=J(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),nb=J(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),rb=J(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),ib=J(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),ab=J(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ob=J(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),sb=J(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),cb=J(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),lb=J(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),ub=J(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),db=J(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),fb=J(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),pb=J(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),mb=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},hb=(e,t)=>({classGroupId:e,validator:t}),gb=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),_b=`-`,vb=[],yb=`arbitrary..`,bb=e=>{let t=Cb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Sb(e);let n=e.split(_b);return xb(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?mb(i,t):t:i||vb}return n[e]||vb}}},xb=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=xb(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(_b):e.slice(t).join(_b),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Sb=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?yb+r:void 0})(),Cb=e=>{let{theme:t,classGroups:n}=e;return wb(n,t)},wb=(e,t)=>{let n=gb();for(let r in e){let i=e[r];Tb(i,n,r,t)}return n},Tb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Eb(i,t,n,r)}},Eb=(e,t,n,r)=>{if(typeof e==`string`){Db(e,t,n);return}if(typeof e==`function`){Ob(e,t,n,r);return}kb(e,t,n,r)},Db=(e,t,n)=>{let r=e===``?t:Ab(t,e);r.classGroupId=n},Ob=(e,t,n,r)=>{if(jb(e)){Tb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(hb(n,e))},kb=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Tb(o,Ab(t,a),n,r)}},Ab=(e,t)=>{let n=e,r=t.split(_b),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=gb(),n.nextPart.set(t,i)),n=i}return n},jb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Mb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Nb=`!`,Pb=`:`,Fb=[],Ib=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Lb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Pb){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Nb)?(c=s.slice(0,-1),l=!0):s.startsWith(Nb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ib(t,l,c,u)};if(t){let e=t+Pb,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ib(Fb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Rb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},zb=e=>({cache:Mb(e.cacheSize),parseClassName:Lb(e),sortModifiers:Rb(e),postfixLookupClassGroupIds:Bb(e),...bb(e)}),Bb=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Vb=/\s+/,Hb=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Vb),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Nb:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ub=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Wb(n))&&(i&&(i+=` `),i+=r);return i},Wb=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Wb(e[r]))&&(n&&(n+=` `),n+=t);return n},Gb=(e,...t)=>{let n,r,i,a,o=o=>(n=zb(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Hb(e,n);return i(e,a),a};return a=o,(...e)=>a(Ub(...e))},Kb=[],qb=e=>{let t=t=>t[e]||Kb;return t.isThemeGetter=!0,t},Jb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Yb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Zb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$b=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nx=e=>Xb.test(e),rx=e=>!!e&&!Number.isNaN(Number(e)),ix=e=>!!e&&Number.isInteger(Number(e)),ax=e=>e.endsWith(`%`)&&rx(e.slice(0,-1)),ox=e=>Zb.test(e),sx=()=>!0,cx=e=>Qb.test(e)&&!$b.test(e),lx=()=>!1,ux=e=>ex.test(e),dx=e=>tx.test(e),fx=e=>!Y(e)&&!X(e),px=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),mx=e=>kx(e,Nx,lx),Y=e=>Jb.test(e),hx=e=>kx(e,Px,cx),gx=e=>kx(e,Fx,rx),_x=e=>kx(e,Lx,sx),vx=e=>kx(e,Ix,lx),yx=e=>kx(e,jx,lx),bx=e=>kx(e,Mx,dx),xx=e=>kx(e,Rx,ux),X=e=>Yb.test(e),Sx=e=>Ax(e,Px),Cx=e=>Ax(e,Ix),wx=e=>Ax(e,jx),Tx=e=>Ax(e,Nx),Ex=e=>Ax(e,Mx),Dx=e=>Ax(e,Rx,!0),Ox=e=>Ax(e,Lx,!0),kx=(e,t,n)=>{let r=Jb.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ax=(e,t,n=!1)=>{let r=Yb.exec(e);return r?r[1]?t(r[1]):n:!1},jx=e=>e===`position`||e===`percentage`,Mx=e=>e===`image`||e===`url`,Nx=e=>e===`length`||e===`size`||e===`bg-size`,Px=e=>e===`length`,Fx=e=>e===`number`,Ix=e=>e===`family-name`,Lx=e=>e===`number`||e===`weight`,Rx=e=>e===`shadow`,zx=Gb(()=>{let e=qb(`color`),t=qb(`font`),n=qb(`text`),r=qb(`font-weight`),i=qb(`tracking`),a=qb(`leading`),o=qb(`breakpoint`),s=qb(`container`),c=qb(`spacing`),l=qb(`radius`),u=qb(`shadow`),d=qb(`inset-shadow`),f=qb(`text-shadow`),p=qb(`drop-shadow`),m=qb(`blur`),h=qb(`perspective`),g=qb(`aspect`),_=qb(`ease`),v=qb(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,Y],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,Y,c],T=()=>[nx,`full`,`auto`,...w()],E=()=>[ix,`none`,`subgrid`,X,Y],D=()=>[`auto`,{span:[`full`,ix,X,Y]},ix,X,Y],O=()=>[ix,`auto`,X,Y],ee=()=>[`auto`,`min`,`max`,`fr`,X,Y],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[nx,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[nx,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[nx,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,X,Y],se=()=>[...b(),wx,yx,{position:[X,Y]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,Tx,mx,{size:[X,Y]}],ue=()=>[ax,Sx,hx],A=()=>[``,`none`,`full`,l,X,Y],de=()=>[``,rx,Sx,hx],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[rx,ax,wx,yx],he=()=>[``,`none`,m,X,Y],ge=()=>[`none`,rx,X,Y],_e=()=>[`none`,rx,X,Y],ve=()=>[rx,X,Y],ye=()=>[nx,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ox],breakpoint:[ox],color:[sx],container:[ox],"drop-shadow":[ox],ease:[`in`,`out`,`in-out`],font:[fx],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ox],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ox],shadow:[ox],spacing:[`px`,rx],text:[ox],"text-shadow":[ox],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,nx,Y,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,Y]}],"container-named":[px],columns:[{columns:[rx,Y,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ix,`auto`,X,Y]}],basis:[{basis:[nx,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[rx,nx,`auto`,`initial`,`none`,Y]}],grow:[{grow:[``,rx,X,Y]}],shrink:[{shrink:[``,rx,X,Y]}],order:[{order:[ix,`first`,`last`,`none`,X,Y]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,...ie()]}],"font-size":[{text:[`base`,n,Sx,hx]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ox,_x]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ax,Y]}],"font-family":[{font:[Cx,vx,t]}],"font-features":[{"font-features":[Y]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,Y]}],"line-clamp":[{"line-clamp":[rx,`none`,X,gx]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,X,Y]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,Y]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[rx,`from-font`,`auto`,X,hx]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[rx,`auto`,X,Y]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ix,X,Y]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,Y]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,Y]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ix,X,Y],radial:[``,X,Y],conic:[ix,X,Y]},Ex,bx]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":de()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[rx,X,Y]}],"outline-w":[{outline:[``,rx,Sx,hx]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`none`,u,Dx,xx]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,Dx,xx]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:de()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[rx,hx]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,Dx,xx]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[rx,X,Y]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[rx]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[X,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[rx]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,Y]}],filter:[{filter:[``,`none`,X,Y]}],blur:[{blur:he()}],brightness:[{brightness:[rx,X,Y]}],contrast:[{contrast:[rx,X,Y]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Dx,xx]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,rx,X,Y]}],"hue-rotate":[{"hue-rotate":[rx,X,Y]}],invert:[{invert:[``,rx,X,Y]}],saturate:[{saturate:[rx,X,Y]}],sepia:[{sepia:[``,rx,X,Y]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,Y]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[rx,X,Y]}],"backdrop-contrast":[{"backdrop-contrast":[rx,X,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,rx,X,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rx,X,Y]}],"backdrop-invert":[{"backdrop-invert":[``,rx,X,Y]}],"backdrop-opacity":[{"backdrop-opacity":[rx,X,Y]}],"backdrop-saturate":[{"backdrop-saturate":[rx,X,Y]}],"backdrop-sepia":[{"backdrop-sepia":[``,rx,X,Y]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,Y]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[rx,`initial`,X,Y]}],ease:[{ease:[`linear`,`initial`,_,X,Y]}],delay:[{delay:[rx,X,Y]}],animate:[{animate:[`none`,v,X,Y]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,Y]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":[`scale-3d`],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[X,Y,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":[`translate-none`],zoom:[{zoom:[ix,X,Y]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,Y]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,Y]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[rx,Sx,hx,gx]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Z(...e){return zx(ly(e))}var Bx=ty,Vx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(ny,{ref:n,className:Z(`fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]`,e),...t}));Vx.displayName=ny.displayName;var Hx=fy(`group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full`,{variants:{variant:{default:`border bg-background text-foreground`,destructive:`destructive group border-destructive bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),Ux=j.forwardRef(({className:e,variant:t,...n},r)=>(0,M.jsx)(ry,{ref:r,className:Z(Hx({variant:t}),e),...n}));Ux.displayName=ry.displayName;var Wx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(oy,{ref:n,className:Z(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive`,e),...t}));Wx.displayName=oy.displayName;var Gx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(sy,{ref:n,className:Z(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,M.jsx)(pb,{className:`h-4 w-4`})}));Gx.displayName=sy.displayName;var Kx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(iy,{ref:n,className:Z(`text-sm font-semibold`,e),...t}));Kx.displayName=iy.displayName;var qx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(ay,{ref:n,className:Z(`text-sm opacity-90`,e),...t}));qx.displayName=ay.displayName;function Jx(){let{toasts:e}=__();return(0,M.jsxs)(Bx,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,M.jsxs)(Ux,{...i,children:[(0,M.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,M.jsx)(Kx,{children:t}),n&&(0,M.jsx)(qx,{children:n})]}),r,(0,M.jsx)(Gx,{})]},e)}),(0,M.jsx)(Vx,{})]})}var Yx=Symbol.for(`react.lazy`),Xx=j.use;function Zx(e){return typeof e==`object`&&!!e&&`then`in e}function Qx(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Yx&&`_payload`in e&&Zx(e._payload)}function $x(e){let t=tS(e),n=j.forwardRef((e,n)=>{let{children:r,...i}=e;Qx(r)&&typeof Xx==`function`&&(r=Xx(r._payload));let a=j.Children.toArray(r),o=a.find(rS);if(o){let e=o.props.children,r=a.map(t=>t===o?j.Children.count(e)>1?j.Children.only(null):j.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:j.isValidElement(e)?j.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var eS=$x(`Slot`);function tS(e){let t=j.forwardRef((e,t)=>{let{children:n,...r}=e;if(Qx(n)&&typeof Xx==`function`&&(n=Xx(n._payload)),j.isValidElement(n)){let e=aS(n),i=iS(r,n.props);return n.type!==j.Fragment&&(i.ref=t?y_(t,e):e),j.cloneElement(n,i)}return j.Children.count(n)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nS=Symbol(`radix.slottable`);function rS(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===nS}function iS(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function aS(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oS=768;function sS(){let[e,t]=j.useState(void 0);return j.useEffect(()=>{let e=window.matchMedia(`(max-width: ${oS-1}px)`),n=()=>{t(window.innerWidth<oS)};return e.addEventListener(`change`,n),t(window.innerWidth<oS),()=>e.removeEventListener(`change`,n)},[]),!!e}var cS=fy(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Q=j.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,M.jsx)(r?eS:`button`,{className:Z(cS({variant:t,size:n,className:e})),ref:a,...i}));Q.displayName=`Button`;var lS=j.forwardRef(({className:e,type:t,...n},r)=>(0,M.jsx)(`input`,{type:t,className:Z(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));lS.displayName=`Input`;var uS=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=$x(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),dS=`Separator`,fS=`horizontal`,pS=[`horizontal`,`vertical`],mS=j.forwardRef((e,t)=>{let{decorative:n,orientation:r=fS,...i}=e,a=hS(r)?r:fS,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,M.jsx)(uS.div,{"data-orientation":a,...o,...i,ref:t})});mS.displayName=dS;function hS(e){return pS.includes(e)}var gS=mS,_S=j.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,M.jsx)(gS,{ref:i,decorative:n,orientation:t,className:Z(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));_S.displayName=gS.displayName;var vS=j.useId||(()=>void 0),yS=0;function bS(e){let[t,n]=j.useState(vS());return Z_(()=>{e||n(e=>e??String(yS++))},[e]),e||(t?`radix-${t}`:``)}var xS=`focusScope.autoFocusOnMount`,SS=`focusScope.autoFocusOnUnmount`,CS={bubbles:!1,cancelable:!0},wS=`FocusScope`,TS=j.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=j.useState(null),l=P_(i),u=P_(a),d=j.useRef(null),f=b_(t,e=>c(e)),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:MS(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||MS(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&MS(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){NS.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(xS,CS);s.addEventListener(xS,l),s.dispatchEvent(t),t.defaultPrevented||(ES(IS(OS(s)),{select:!0}),document.activeElement===e&&MS(s))}return()=>{s.removeEventListener(xS,l),setTimeout(()=>{let t=new CustomEvent(SS,CS);s.addEventListener(SS,u),s.dispatchEvent(t),t.defaultPrevented||MS(e??document.body,{select:!0}),s.removeEventListener(SS,u),NS.remove(p)},0)}}},[s,l,u,p]);let m=j.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=DS(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&MS(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&MS(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(M_.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});TS.displayName=wS;function ES(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(MS(r,{select:t}),document.activeElement!==n)return}function DS(e){let t=OS(e);return[kS(t,e),kS(t.reverse(),e)]}function OS(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kS(e,t){for(let n of e)if(!AS(n,{upTo:t}))return n}function AS(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function jS(e){return e instanceof HTMLInputElement&&`select`in e}function MS(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jS(e)&&t&&e.select()}}var NS=PS();function PS(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=FS(e,t),e.unshift(t)},remove(t){e=FS(e,t),e[0]?.resume()}}}function FS(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function IS(e){return e.filter(e=>e.tagName!==`A`)}var LS=0;function RS(){j.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??zS()),document.body.insertAdjacentElement(`beforeend`,e[1]??zS()),LS++,()=>{LS===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),LS--}},[])}function zS(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var BS=function(){return BS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},BS.apply(this,arguments)};function VS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function HS(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var US=`right-scroll-bar-position`,WS=`width-before-scroll-bar`,GS=`with-scroll-bars-hidden`,KS=`--removed-body-scroll-bar-size`;function qS(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function JS(e,t){var n=(0,j.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var YS=typeof window<`u`?j.useLayoutEffect:j.useEffect,XS=new WeakMap;function ZS(e,t){var n=JS(t||null,function(t){return e.forEach(function(e){return qS(e,t)})});return YS(function(){var t=XS.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||qS(e,null)}),i.forEach(function(e){r.has(e)||qS(e,a)})}XS.set(n,e)},[e]),n}function QS(e){return e}function $S(e,t){t===void 0&&(t=QS);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function eC(e){e===void 0&&(e={});var t=$S(null);return t.options=BS({async:!0,ssr:!1},e),t}var tC=function(e){var t=e.sideCar,n=VS(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return j.createElement(r,BS({},n))};tC.isSideCarExport=!0;function nC(e,t){return e.useMedium(t),tC}var rC=eC(),iC=function(){},aC=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:iC,onWheelCapture:iC,onTouchMoveCapture:iC}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=VS(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=ZS([n,t]),C=BS(BS({},b),i);return j.createElement(j.Fragment,null,u&&j.createElement(x,{sideCar:rC,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?j.cloneElement(j.Children.only(s),BS(BS({},C),{ref:S})):j.createElement(v,BS({},C,{className:c,ref:S}),s))});aC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},aC.classNames={fullWidth:WS,zeroRight:US};var oC,sC=function(){if(oC)return oC;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cC(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sC();return t&&e.setAttribute(`nonce`,t),e}function lC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uC(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var dC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cC())&&(lC(t,n),uC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fC=function(){var e=dC();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pC=function(){var e=fC();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},mC={left:0,top:0,right:0,gap:0},hC=function(e){return parseInt(e||``,10)||0},gC=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[hC(n),hC(r),hC(i)]},_C=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return mC;var t=gC(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vC=pC(),yC=`data-scroll-locked`,bC=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
110
|
-
.${
|
|
109
|
+
`;typeof process<`u`&&process.stderr?e===`error`||e===`fatal`?process.stderr.write(c):process.stdout?.write(c):typeof console<`u`&&(e===`error`||e===`fatal`?console.error:e===`warn`?console.warn:e===`debug`?console.debug:console.log)(s),this.fileStream&&this.fileStream.write(c)}debug(e,t){this.write(`debug`,e,t)}info(e,t){this.write(`info`,e,t)}warn(e,t){this.write(`warn`,e,t)}error(e,t,n){t instanceof Error?this.write(`error`,e,n,t):this.write(`error`,e,t)}fatal(e,t,n){t instanceof Error?this.write(`fatal`,e,n,t):this.write(`fatal`,e,t)}log(e,...t){this.info(e,t.length>0?{args:t}:void 0)}child(t){let n=new e(this.config,{...this.bindings,...t});return n.fileStream=this.fileStream,n}withTrace(e,t){return this.child({traceId:e,spanId:t})}async destroy(){this.fileStream&&=(await new Promise(e=>this.fileStream.end(e)),void 0)}};function $g(e){return new Qg(e)}var e_=class{constructor(e,t){this.subscriptions=new Map,this.eventBuffer=[],this._baseUrl=e,this._token=t}subscribeMetadata(e,t,n){let r=`metadata-${e}-${Date.now()}`;return this.subscriptions.set(r,{filter:{type:e,packageId:n?.packageId,eventTypes:[`metadata.${e}.created`,`metadata.${e}.updated`,`metadata.${e}.deleted`]},handler:e=>{e.type.startsWith(`metadata.`)&&t(e)}}),this.startPolling(),()=>{this.subscriptions.delete(r),this.subscriptions.size===0&&this.stopPolling()}}subscribeData(e,t,n){let r=`data-${e}-${Date.now()}`;return this.subscriptions.set(r,{filter:{type:e,recordId:n?.recordId,eventTypes:[`data.record.created`,`data.record.updated`,`data.record.deleted`]},handler:r=>{r.type.startsWith(`data.`)&&r.object===e&&(!n?.recordId||r.payload?.recordId===n.recordId)&&t(r)}}),this.startPolling(),()=>{this.subscriptions.delete(r),this.subscriptions.size===0&&this.stopPolling()}}emitEvent(e){for(let t of this.subscriptions.values()){let n=!t.filter.type||e.type.includes(t.filter.type)||e.object===t.filter.type,r=!t.filter.eventTypes?.length||t.filter.eventTypes.includes(e.type),i=!t.filter.packageId||e.payload?.packageId===t.filter.packageId;if(n&&r&&i)try{t.handler(e)}catch(e){console.error(`Error in realtime event handler:`,e)}}}startPolling(){this.pollInterval||=setInterval(()=>{for(;this.eventBuffer.length>0;){let e=this.eventBuffer.shift();e&&this.emitEvent(e)}},2e3)}stopPolling(){this.pollInterval&&=(clearInterval(this.pollInterval),void 0)}_bufferEvent(e){this.eventBuffer.push(e)}disconnect(){this.stopPolling(),this.subscriptions.clear(),this.eventBuffer=[]}},t_=class{constructor(e){this.meta={getTypes:async()=>{let e=this.getRoute(`metadata`),t=await this.fetch(`${this.baseUrl}${e}`);return this.unwrapResponse(t)},getItems:async(e,t)=>{let n=this.getRoute(`metadata`),r=new URLSearchParams;t?.packageId&&r.set(`package`,t.packageId);let i=r.toString(),a=`${this.baseUrl}${n}/${e}${i?`?${i}`:``}`,o=await this.fetch(a);return this.unwrapResponse(o)},getItem:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=new URLSearchParams;n?.packageId&&i.set(`package`,n.packageId);let a=i.toString(),o=`${this.baseUrl}${r}/${e}/${t}${a?`?${a}`:``}`,s=await this.fetch(o);return this.unwrapResponse(s)},saveItem:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=await this.fetch(`${this.baseUrl}${r}/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)});return this.unwrapResponse(i)},deleteItem:async(e,t)=>{let n=this.getRoute(`metadata`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(r)},getHistory:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=new URLSearchParams;n?.sinceSeq!==void 0&&i.set(`sinceSeq`,String(n.sinceSeq)),n?.limit!==void 0&&i.set(`limit`,String(n.limit));let a=i.toString(),o=`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/history${a?`?${a}`:``}`,s=await this.fetch(o);return this.unwrapResponse(s)},getCached:async(e,t)=>{let n=this.getRoute(`metadata`),r={};t?.ifNoneMatch&&(r[`If-None-Match`]=t.ifNoneMatch),t?.ifModifiedSince&&(r[`If-Modified-Since`]=t.ifModifiedSince);let i=await this.fetch(`${this.baseUrl}${n}/object/${e}`,{headers:r});if(i.status===304)return{notModified:!0,etag:t?.ifNoneMatch?{value:t.ifNoneMatch.replace(/^W\/|"/g,``),weak:t.ifNoneMatch.startsWith(`W/`)}:void 0};let a=await i.json(),o=i.headers.get(`ETag`),s=i.headers.get(`Last-Modified`);return{data:a,etag:o?{value:o.replace(/^W\/|"/g,``),weak:o.startsWith(`W/`)}:void 0,lastModified:s||void 0,notModified:!1}},getView:async(e,t=`list`)=>{let n=this.getRoute(`ui`),r=await this.fetch(`${this.baseUrl}${n}/view/${e}?type=${t}`);return this.unwrapResponse(r)}},this.analytics={query:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/query`,{method:`POST`,body:JSON.stringify(e)})).json()},meta:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/meta/${e}`)).json()},explain:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/explain`,{method:`POST`,body:JSON.stringify(e)})).json()}},this.packages={list:async e=>{let t=this.getRoute(`packages`),n=new URLSearchParams;e?.status&&n.set(`status`,e.status),e?.type&&n.set(`type`,e.type),e?.enabled!==void 0&&n.set(`enabled`,String(e.enabled));let r=n.toString(),i=`${this.baseUrl}${t}${r?`?`+r:``}`,a=await this.fetch(i);return this.unwrapResponse(a)},get:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},install:async(e,t)=>{let n=this.getRoute(`packages`),r=await this.fetch(`${this.baseUrl}${n}`,{method:`POST`,body:JSON.stringify({manifest:e,settings:t?.settings,enableOnInstall:t?.enableOnInstall})});return this.unwrapResponse(r)},uninstall:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`,{method:`DELETE`});return this.unwrapResponse(n)},enable:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/enable`,{method:`PATCH`});return this.unwrapResponse(n)},disable:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/disable`,{method:`PATCH`});return this.unwrapResponse(n)}},this.projects={list:async e=>{let t=new URLSearchParams;e?.organization_id&&t.set(`organizationId`,e.organization_id),e?.env_type&&t.set(`envType`,e.env_type),e?.status&&t.set(`status`,e.status);let n=t.toString(),r=`${this.baseUrl}/api/v1/cloud/environments${n?`?`+n:``}`,i=await this.fetch(r);return this.unwrapResponse(i)},get:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`);return this.unwrapResponse(t)},create:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(t)},update:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)});return this.unwrapResponse(n)},delete:async(e,t)=>{let n=t?.force?`?force=1`:``,r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}${n}`,{method:`DELETE`});return this.unwrapResponse(r)},activate:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/activate`,{method:`POST`});return this.unwrapResponse(t)},rotateCredential:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/credentials/rotate`,{method:`POST`,body:JSON.stringify({plaintext:t})});return this.unwrapResponse(n)},updateHostname:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/hostname`,{method:`POST`,body:JSON.stringify({hostname:t})});return this.unwrapResponse(n)},updateVisibility:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({visibility:t})});return this.unwrapResponse(n)},listRevisions:async(e,t)=>{let n=new URLSearchParams;t?.limit&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor),t?.branch&&n.set(`branch`,t.branch);let r=n.toString(),i=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/revisions${r?`?${r}`:``}`);return this.unwrapResponse(i)},listBranches:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches`);return this.unwrapResponse(t)},renameBranch:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches/${encodeURIComponent(t)}/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({newName:n})});return this.unwrapResponse(r)},deleteBranch:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},activateRevision:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/revisions/${encodeURIComponent(t)}/activate`,{method:`POST`});return this.unwrapResponse(n)},retryProvisioning:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/retry`,{method:`POST`});return this.unwrapResponse(t)},listMembers:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members`);return this.unwrapResponse(t)},addMember:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return this.unwrapResponse(n)},updateMemberRole:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({role:n})});return this.unwrapResponse(r)},removeMember:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},listDrivers:async()=>{let e=await this.fetch(`${this.baseUrl}/api/v1/cloud/drivers`);return this.unwrapResponse(e)},listTemplates:async()=>{let e=await this.fetch(`${this.baseUrl}/api/v1/cloud/templates`);return this.unwrapResponse(e)},packages:{list:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages`);return this.unwrapResponse(t)},install:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(n)},get:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}`);return this.unwrapResponse(n)},enable:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/enable`,{method:`PATCH`});return this.unwrapResponse(n)},disable:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/disable`,{method:`PATCH`});return this.unwrapResponse(n)},uninstall:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},upgrade:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/upgrade`,{method:`POST`,body:JSON.stringify({targetVersion:n})});return this.unwrapResponse(r)}}},this.organizations={list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/organization/list`)).json();return{organizations:Array.isArray(t)?t:t?.data??[]}},create:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/create`,{method:`POST`,body:JSON.stringify(e)})).json()},update:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/update`,{method:`POST`,body:JSON.stringify({organizationId:e,data:t})})).json()},setActive:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/set-active`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},get:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/get-full-organization?organizationId=${encodeURIComponent(e)}`)).json()},listMembers:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/list-members?organizationId=${encodeURIComponent(e)}`)).json()},invite:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/invite-member`,{method:`POST`,body:JSON.stringify(e)})).json()},leave:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/leave`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/delete`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},removeMember:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/remove-member`,{method:`POST`,body:JSON.stringify({memberIdOrEmail:t.memberIdOrEmail,organizationId:e})})).json()},updateMemberRole:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/update-member-role`,{method:`POST`,body:JSON.stringify({memberId:t.memberId,role:t.role,organizationId:e})})).json()},getActiveMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/get-active-member?organizationId=${encodeURIComponent(e)}`)).json()},invitations:{list:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-invitations?organizationId=${encodeURIComponent(e)}`)).json();return{invitations:Array.isArray(n)?n:n?.data??n?.invitations??[]}},listMine:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/organization/list-user-invitations`)).json();return{invitations:Array.isArray(t)?t:t?.data??t?.invitations??[]}},cancel:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/cancel-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},accept:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/accept-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},reject:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/reject-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},resend:async e=>{if(e.id)try{await this.organizations.invitations.cancel(e.id)}catch{}return this.organizations.invite({email:e.email,role:e.role??`member`,organizationId:e.organizationId})}},teams:{list:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-teams?organizationId=${encodeURIComponent(e)}`)).json();return{teams:Array.isArray(n)?n:n?.data??n?.teams??[]}},create:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/create-team`,{method:`POST`,body:JSON.stringify(e)})).json()},update:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/update-team`,{method:`POST`,body:JSON.stringify(e)})).json()},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/remove-team`,{method:`POST`,body:JSON.stringify(e)})).json()},listMembers:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-team-members?teamId=${encodeURIComponent(e)}`)).json();return{members:Array.isArray(n)?n:n?.data??n?.members??[]}},addMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/add-team-member`,{method:`POST`,body:JSON.stringify(e)})).json()},removeMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/remove-team-member`,{method:`POST`,body:JSON.stringify(e)})).json()}}},this.oauth={applications:{register:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/create-client`,{method:`POST`,body:JSON.stringify(e)})).json()},get:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/get-client?client_id=${encodeURIComponent(e)}`)).json()},getPublic:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/public-client?client_id=${encodeURIComponent(e)}`)).json()},list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/oauth2/get-clients`)).json();return{applications:Array.isArray(t)?t:t?.clients??t?.data??[]}},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/delete-client`,{method:`POST`,body:JSON.stringify({client_id:e})})).json()}},consent:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/consent`,{method:`POST`,body:JSON.stringify(e)})).json()}},this.auth={getConfig:async()=>{let e=this.getRoute(`auth`),t=await this.fetch(`${this.baseUrl}${e}/config`);return this.unwrapResponse(t)},login:async e=>{let t=this.getRoute(`auth`),n=await this.fetch(`${this.baseUrl}${t}/sign-in/email`,{method:`POST`,headers:{Origin:this.baseUrl},body:JSON.stringify(e)}),r=await n.json().catch(()=>({}));if(!n.ok){let e=r?.message||r?.error?.message||`Login failed (HTTP ${n.status})`,t=Error(e);throw r?.code&&(t.code=r.code),t.status=n.status,t}let i=r&&(r.data??(r.token||r.user?{token:r.token,user:r.user}:void 0)),a=i?{...r,data:i}:r;return a.data?.token&&(this.token=a.data.token),a},logout:async()=>{let e=this.getRoute(`auth`);await this.fetch(`${this.baseUrl}${e}/sign-out`,{method:`POST`,headers:{"Content-Type":`application/json`,Origin:this.baseUrl},body:`{}`}),this.token=void 0},me:async()=>{let e=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${e}/get-session`,{headers:{Origin:this.baseUrl}})).json()},register:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/sign-up/email`,{method:`POST`,headers:{Origin:this.baseUrl},body:JSON.stringify(e)})).json(),r=n&&(n.data??(n.token||n.user?{token:n.token,user:n.user}:void 0)),i=r?{...n,data:r}:n;return i.data?.token&&(this.token=i.data.token),i},signInWithProvider:async(e,t)=>{if(typeof window>`u`)throw Error(`signInWithProvider requires a browser environment`);let n=this.getRoute(`auth`),r=t?.callbackURL??window.location.origin+`/login`,i=t?.type===`oidc`,a=i?`/sign-in/oauth2`:`/sign-in/social`,o=i?{providerId:e,callbackURL:r}:{provider:e,callbackURL:r};t?.errorCallbackURL&&(o.errorCallbackURL=t.errorCallbackURL);let s=await(await this.fetch(`${this.baseUrl}${n}${a}`,{method:`POST`,body:JSON.stringify(o)})).json(),c=s?.url??s?.data?.url;if(c)window.location.assign(c);else throw Error(`signInWithProvider: no redirect URL returned for provider "${e}"`)},refreshToken:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/get-session`,{method:`GET`})).json();return n.data?.token&&(this.token=n.data.token),n},bootstrapStatus:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/bootstrap-status`)).json();return{hasOwner:!!(t?.data??t)?.hasOwner}},updateUser:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/update-user`,{method:`POST`,body:JSON.stringify(e)})).json()},changePassword:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/change-password`,{method:`POST`,body:JSON.stringify(e)})).json()},changeEmail:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/change-email`,{method:`POST`,body:JSON.stringify(e)})).json()},sendVerificationEmail:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/send-verification-email`,{method:`POST`,body:JSON.stringify(e)})).json()},verifyEmail:async e=>{let t=this.getRoute(`auth`),n=new URL(`${this.baseUrl}${t}/verify-email`);return n.searchParams.set(`token`,e.token),e.callbackURL&&n.searchParams.set(`callbackURL`,e.callbackURL),(await this.fetch(n.toString())).json()},deleteUser:async e=>{let t=this.getRoute(`auth`),n=await this.fetch(`${this.baseUrl}${t}/delete-user`,{method:`POST`,body:JSON.stringify(e)});return this.token=void 0,n.json()},sessions:{list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/list-sessions`)).json();return{sessions:Array.isArray(t)?t:t?.data??t?.sessions??[]}},revoke:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/revoke-session`,{method:`POST`,body:JSON.stringify({token:e})})).json()},revokeOthers:async()=>{let e=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${e}/revoke-other-sessions`,{method:`POST`,body:`{}`})).json()},revokeAll:async()=>{let e=this.getRoute(`auth`),t=await this.fetch(`${this.baseUrl}${e}/revoke-sessions`,{method:`POST`,body:`{}`});return this.token=void 0,t.json()}},twoFactor:{enable:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/two-factor/enable`,{method:`POST`,body:JSON.stringify(e)})).json();return n?.data??n},verifyTotp:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/verify-totp`,{method:`POST`,body:JSON.stringify(e)})).json()},disable:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/disable`,{method:`POST`,body:JSON.stringify(e)})).json()},generateBackupCodes:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/two-factor/generate-backup-codes`,{method:`POST`,body:JSON.stringify(e)})).json();return n?.data??n},verifyBackupCode:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/verify-backup-code`,{method:`POST`,body:JSON.stringify(e)})).json()}},accounts:{list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/list-accounts`)).json();return{accounts:Array.isArray(t)?t:t?.data??t?.accounts??[]}},unlink:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/unlink-account`,{method:`POST`,body:JSON.stringify(e)})).json()},linkSocial:async e=>{let t=this.getRoute(`auth`),n=e.callbackURL??(typeof window<`u`?window.location.href:void 0),r=await(await this.fetch(`${this.baseUrl}${t}/link-social`,{method:`POST`,body:JSON.stringify({provider:e.provider,callbackURL:n})})).json();return r?.data??r}}},this.storage={upload:async(e,t=`user`)=>{let n={filename:e.name,mimeType:e.type,size:e.size,scope:t},r=this.getRoute(`storage`),{data:i}=await(await this.fetch(`${this.baseUrl}${r}/upload/presigned`,{method:`POST`,body:JSON.stringify(n)})).json(),a=await this.fetchImpl(i.uploadUrl,{method:i.method,headers:i.headers,body:e});if(!a.ok)throw Error(`Storage Upload Failed: ${a.statusText}`);let o={fileId:i.fileId};return(await this.fetch(`${this.baseUrl}${r}/upload/complete`,{method:`POST`,body:JSON.stringify(o)})).json()},getDownloadUrl:async e=>{let t=this.getRoute(`storage`);return(await(await this.fetch(`${this.baseUrl}${t}/files/${e}/url`)).json()).url},getPresignedUrl:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/presigned`,{method:`POST`,body:JSON.stringify(e)})).json()},initChunkedUpload:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/chunked`,{method:`POST`,body:JSON.stringify(e)})).json()},uploadPart:async(e,t,n,r)=>{let i=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${i}/upload/chunked/${e}/chunk/${t}`,{method:`PUT`,headers:{"x-resume-token":n},body:r})).json()},completeChunkedUpload:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/chunked/${e.uploadId}/complete`,{method:`POST`,body:JSON.stringify(e)})).json()},resumeUpload:async(e,t,n,r)=>{let i=this.getRoute(`storage`),{totalChunks:a,uploadedChunks:o}=(await(await this.fetch(`${this.baseUrl}${i}/upload/chunked/${e}/progress`)).json()).data,s=[],c=t instanceof ArrayBuffer?t:await t.arrayBuffer();for(let t=o;t<a;t++){let i=t*n,a=Math.min(i+n,c.byteLength),o=new Blob([c.slice(i,a)]),l=await this.storage.uploadPart(e,t,r,o);s.push({chunkIndex:t,eTag:l.data.eTag})}return this.storage.completeChunkedUpload({uploadId:e,parts:s})}},this.automation={trigger:async(e,t)=>{let n=this.getRoute(`automation`);return(await this.fetch(`${this.baseUrl}${n}/trigger/${e}`,{method:`POST`,body:JSON.stringify(t)})).json()},list:async()=>{let e=this.getRoute(`automation`),t=await this.fetch(`${this.baseUrl}${e}`);return this.unwrapResponse(t)},get:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${e}`);return this.unwrapResponse(n)},create:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}`,{method:`POST`,body:JSON.stringify({name:e,...t})});return this.unwrapResponse(r)},update:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}`,{method:`PUT`,body:JSON.stringify({definition:t})});return this.unwrapResponse(r)},delete:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${e}`,{method:`DELETE`});return this.unwrapResponse(n)},toggle:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}/toggle`,{method:`POST`,body:JSON.stringify({enabled:t})});return this.unwrapResponse(r)},runs:{list:async(e,t)=>{let n=this.getRoute(`automation`),r=new URLSearchParams;t?.limit&&r.set(`limit`,String(t.limit)),t?.cursor&&r.set(`cursor`,t.cursor);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${e}/runs${i?`?${i}`:``}`);return this.unwrapResponse(a)},get:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}/runs/${t}`);return this.unwrapResponse(r)}},getFlow:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},execute:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/trigger`,{method:`POST`,body:JSON.stringify(t??{})});return this.unwrapResponse(r)},listRuns:async(e,t)=>{let n=this.getRoute(`automation`),r=new URLSearchParams;t?.limit!=null&&r.set(`limit`,String(t.limit)),t?.cursor&&r.set(`cursor`,t.cursor);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/runs${i?`?${i}`:``}`);return this.unwrapResponse(a)},getRun:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`);return this.unwrapResponse(r)}},this.permissions={check:async e=>{let t=this.getRoute(`permissions`),n=new URLSearchParams({object:e.object,action:e.action});e.recordId!==void 0&&n.set(`recordId`,e.recordId),e.field!==void 0&&n.set(`field`,e.field);let r=await this.fetch(`${this.baseUrl}${t}/check?${n.toString()}`);return this.unwrapResponse(r)},getObjectPermissions:async e=>{let t=this.getRoute(`permissions`),n=await this.fetch(`${this.baseUrl}${t}/objects/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},getEffectivePermissions:async()=>{let e=this.getRoute(`permissions`),t=await this.fetch(`${this.baseUrl}${e}/effective`);return this.unwrapResponse(t)}},this.realtime={connect:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/connect`,{method:`POST`,body:JSON.stringify(e||{})});return this.unwrapResponse(n)},disconnect:async()=>{let e=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${e}/disconnect`,{method:`POST`})},subscribe:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/subscribe`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},unsubscribe:async e=>{let t=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${t}/unsubscribe`,{method:`POST`,body:JSON.stringify({subscriptionId:e})})},setPresence:async(e,t)=>{let n=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${n}/presence`,{method:`PUT`,body:JSON.stringify({channel:e,state:t})})},getPresence:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/presence/${encodeURIComponent(e)}`);return this.unwrapResponse(n)}},this.workflow={getConfig:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/config`);return this.unwrapResponse(n)},getState:async(e,t)=>{let n=this.getRoute(`workflow`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/state`);return this.unwrapResponse(r)},transition:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e.object)}/${encodeURIComponent(e.recordId)}/transition`,{method:`POST`,body:JSON.stringify({transition:e.transition,comment:e.comment,data:e.data})});return this.unwrapResponse(n)}},this.approvals={listRequests:async e=>{let t=this.getRoute(`approvals`),n=new URLSearchParams;e?.object&&n.set(`object`,e.object),e?.recordId&&n.set(`recordId`,e.recordId),e?.status&&n.set(`status`,Array.isArray(e.status)?e.status.join(`,`):e.status),e?.approverId&&n.set(`approverId`,Array.isArray(e.approverId)?e.approverId.join(`,`):e.approverId),e?.submitterId&&n.set(`submitterId`,e.submitterId);let r=n.toString(),i=await this.fetch(`${this.baseUrl}${t}/requests${r?`?${r}`:``}`),a=await this.unwrapResponse(i);return Array.isArray(a)?a:a?.data??[]},getRequest:async e=>{let t=this.getRoute(`approvals`),n=await this.fetch(`${this.baseUrl}${t}/requests/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},approve:async(e,t)=>{let n=this.getRoute(`approvals`),r=await this.fetch(`${this.baseUrl}${n}/requests/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify({actorId:t?.actorId,comment:t?.comment})});return this.unwrapResponse(r)},reject:async(e,t)=>{let n=this.getRoute(`approvals`),r=await this.fetch(`${this.baseUrl}${n}/requests/${encodeURIComponent(e)}/reject`,{method:`POST`,body:JSON.stringify({actorId:t?.actorId,comment:t?.comment})});return this.unwrapResponse(r)},listActions:async e=>{let t=this.getRoute(`approvals`),n=await this.fetch(`${this.baseUrl}${t}/requests/${encodeURIComponent(e)}/actions`),r=await this.unwrapResponse(n);return Array.isArray(r)?r:r?.data??[]}},this.views={list:async(e,t)=>{let n=this.getRoute(`views`),r=new URLSearchParams;t&&r.set(`type`,t);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}${i?`?${i}`:``}`);return this.unwrapResponse(a)},get:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`);return this.unwrapResponse(r)},create:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({object:e,data:t})});return this.unwrapResponse(r)},update:async(e,t,n)=>{let r=this.getRoute(`views`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PUT`,body:JSON.stringify({object:e,viewId:t,data:n})});return this.unwrapResponse(i)},delete:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(r)}},this.notifications={registerDevice:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/devices`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},unregisterDevice:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/devices/${encodeURIComponent(e)}`,{method:`DELETE`});return this.unwrapResponse(n)},getPreferences:async()=>{let e=this.getRoute(`notifications`),t=await this.fetch(`${this.baseUrl}${e}/preferences`);return this.unwrapResponse(t)},updatePreferences:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/preferences`,{method:`PUT`,body:JSON.stringify({preferences:e})});return this.unwrapResponse(n)},list:async e=>{let t=this.getRoute(`notifications`),n=new URLSearchParams;e?.read!==void 0&&n.set(`read`,String(e.read)),e?.type&&n.set(`type`,e.type),e?.limit&&n.set(`limit`,String(e.limit)),e?.cursor&&n.set(`cursor`,e.cursor);let r=n.toString(),i=await this.fetch(`${this.baseUrl}${t}${r?`?${r}`:``}`);return this.unwrapResponse(i)},markRead:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/read`,{method:`POST`,body:JSON.stringify({ids:e})});return this.unwrapResponse(n)},markAllRead:async()=>{let e=this.getRoute(`notifications`),t=await this.fetch(`${this.baseUrl}${e}/read/all`,{method:`POST`});return this.unwrapResponse(t)}},this.ai={nlq:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/nlq`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},suggest:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/suggest`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},insights:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/insights`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)}},this.i18n={getLocales:async()=>{let e=this.getRoute(`i18n`),t=await this.fetch(`${this.baseUrl}${e}/locales`);return this.unwrapResponse(t)},getTranslations:async(e,t)=>{let n=this.getRoute(`i18n`),r=new URLSearchParams;r.set(`locale`,e),t?.namespace&&r.set(`namespace`,t.namespace),t?.keys&&r.set(`keys`,t.keys.join(`,`));let i=await this.fetch(`${this.baseUrl}${n}/translations?${r.toString()}`);return this.unwrapResponse(i)},getFieldLabels:async(e,t)=>{let n=this.getRoute(`i18n`),r=await this.fetch(`${this.baseUrl}${n}/labels/${encodeURIComponent(e)}?locale=${encodeURIComponent(t)}`);return this.unwrapResponse(r)}},this.feed={list:async(e,t,n)=>{let r=this.getRoute(`data`),i=new URLSearchParams;n?.type&&i.set(`type`,n.type),n?.limit&&i.set(`limit`,String(n.limit)),n?.cursor&&i.set(`cursor`,n.cursor);let a=i.toString(),o=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed${a?`?${a}`:``}`);return this.unwrapResponse(o)},create:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed`,{method:`POST`,body:JSON.stringify(n)});return this.unwrapResponse(i)},update:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}`,{method:`PUT`,body:JSON.stringify(r)});return this.unwrapResponse(a)},delete:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}`,{method:`DELETE`});return this.unwrapResponse(i)},addReaction:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/reactions`,{method:`POST`,body:JSON.stringify({emoji:r})});return this.unwrapResponse(a)},removeReaction:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/reactions/${encodeURIComponent(r)}`,{method:`DELETE`});return this.unwrapResponse(a)},pin:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/pin`,{method:`POST`});return this.unwrapResponse(i)},unpin:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/pin`,{method:`DELETE`});return this.unwrapResponse(i)},star:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/star`,{method:`POST`});return this.unwrapResponse(i)},unstar:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/star`,{method:`DELETE`});return this.unwrapResponse(i)},search:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=new URLSearchParams;a.set(`query`,n),r?.type&&a.set(`type`,r.type),r?.actorId&&a.set(`actorId`,r.actorId),r?.dateFrom&&a.set(`dateFrom`,r.dateFrom),r?.dateTo&&a.set(`dateTo`,r.dateTo),r?.limit&&a.set(`limit`,String(r.limit)),r?.cursor&&a.set(`cursor`,r.cursor);let o=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/search?${a.toString()}`);return this.unwrapResponse(o)},getChangelog:async(e,t,n)=>{let r=this.getRoute(`data`),i=new URLSearchParams;n?.field&&i.set(`field`,n.field),n?.actorId&&i.set(`actorId`,n.actorId),n?.dateFrom&&i.set(`dateFrom`,n.dateFrom),n?.dateTo&&i.set(`dateTo`,n.dateTo),n?.limit&&i.set(`limit`,String(n.limit)),n?.cursor&&i.set(`cursor`,n.cursor);let a=i.toString(),o=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/changelog${a?`?${a}`:``}`);return this.unwrapResponse(o)},subscribe:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/subscribe`,{method:`POST`,body:JSON.stringify(n||{})});return this.unwrapResponse(i)},unsubscribe:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/subscribe`,{method:`DELETE`});return this.unwrapResponse(r)}},this.data={query:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/query`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},find:async(e,t={})=>{let n=this.getRoute(`data`),r=new URLSearchParams,i=t,a={};if(`where`in t||`fields`in t||`orderBy`in t||`offset`in t?(i.where&&(a.filter=i.where),i.fields&&(a.select=i.fields),i.orderBy&&(a.sort=i.orderBy),i.limit!=null&&(a.top=i.limit),i.offset!=null&&(a.skip=i.offset),i.aggregations&&(a.aggregations=i.aggregations),i.groupBy&&(a.groupBy=i.groupBy)):Object.assign(a,t),a.top&&r.set(`top`,a.top.toString()),a.skip&&r.set(`skip`,a.skip.toString()),a.sort)if(Array.isArray(a.sort)&&typeof a.sort[0]==`object`)r.set(`sort`,JSON.stringify(a.sort));else{let e=Array.isArray(a.sort)?a.sort.join(`,`):a.sort;r.set(`sort`,e)}a.select&&r.set(`select`,a.select.join(`,`));let o=a.filter??a.filters;o&&(this.isFilterAST(o)||Array.isArray(o)?r.set(`filter`,JSON.stringify(o)):typeof o==`object`&&o&&Object.entries(o).forEach(([e,t])=>{t!=null&&r.append(e,String(t))})),a.aggregations&&r.set(`aggregations`,JSON.stringify(a.aggregations)),a.groupBy&&r.set(`groupBy`,a.groupBy.join(`,`));let s=await this.fetch(`${this.baseUrl}${n}/${e}?${r.toString()}`);return this.unwrapResponse(s)},get:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/${t}`);return this.unwrapResponse(r)},create:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},createMany:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/createMany`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},update:async(e,t,n,r)=>{let i=this.getRoute(`data`),a={};r?.ifMatch&&(a[`If-Match`]=String(r.ifMatch));let o=await this.fetch(`${this.baseUrl}${i}/${e}/${t}`,{method:`PATCH`,body:JSON.stringify(n),...Object.keys(a).length?{headers:a}:{}});return this.unwrapResponse(o)},batch:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/batch`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},updateMany:async(e,t,n)=>{let r=this.getRoute(`data`),i={records:t,options:n},a=await this.fetch(`${this.baseUrl}${r}/${e}/updateMany`,{method:`POST`,body:JSON.stringify(i)});return this.unwrapResponse(a)},delete:async(e,t,n)=>{let r=this.getRoute(`data`),i={};n?.ifMatch&&(i[`If-Match`]=String(n.ifMatch));let a=await this.fetch(`${this.baseUrl}${r}/${e}/${t}`,{method:`DELETE`,...Object.keys(i).length?{headers:i}:{}});return this.unwrapResponse(a)},deleteMany:async(e,t,n)=>{let r=this.getRoute(`data`),i={ids:t,options:n},a=await this.fetch(`${this.baseUrl}${r}/${e}/deleteMany`,{method:`POST`,body:JSON.stringify(i)});return this.unwrapResponse(a)}},this.baseUrl=e.baseUrl.replace(/\/$/,``),this.token=e.token,this.environmentId=e.environmentId,this.locale=e.locale,this.fetchImpl=e.fetch||globalThis.fetch.bind(globalThis),this.logger=e.logger||$g({level:e.debug?`debug`:`info`,format:`pretty`}),this.realtimeAPI=new e_(this.baseUrl,this.token),this.logger.debug(`ObjectStack client created`,{baseUrl:this.baseUrl})}async connect(){this.logger.debug(`Connecting to ObjectStack server`,{baseUrl:this.baseUrl});try{let e;try{let t=`${this.baseUrl}/api/v1/discovery`;this.logger.debug(`Probing protocol-standard discovery endpoint`,{url:t});let n=await this.fetchImpl(t);if(n.ok){let t=await n.json();e=t.data||t,this.logger.debug(`Discovered via /api/v1/discovery`)}}catch(e){this.logger.debug(`Protocol-standard discovery probe failed`,{error:e.message})}if(!e){let t;try{t=`${new URL(this.baseUrl).origin}/.well-known/objectstack`}catch{t=`/.well-known/objectstack`}this.logger.debug(`Falling back to .well-known discovery`,{url:t});let n=await this.fetchImpl(t);if(!n.ok)throw Error(`Failed to connect to ${t}: ${n.statusText}`);let r=await n.json();e=r.data||r}if(!e)throw Error(`Connection failed: No discovery data returned`);return this.discoveryInfo=e,this.logger.info(`Connected to ObjectStack server`,{version:e.version,apiName:e.apiName,services:e.services}),e}catch(e){throw this.logger.error(`Failed to connect to ObjectStack server`,e,{baseUrl:this.baseUrl}),e}}get capabilities(){let e=this.discoveryInfo?.capabilities;if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`object`&&r?!!r.enabled:!!r;return t}project(e){if(!e)throw Error(`[ObjectStack] project(id): environmentId is required`);return new n_(this,e)}_baseUrl(){return this.baseUrl}_fetch(e,t){return this.fetch(e,t)}_unwrap(e){return this.unwrapResponse(e)}_isFilterAST(e){return this.isFilterAST(e)}setProjectId(e){this.environmentId=e,this.logger.debug(`Active project changed`,{environmentId:e})}getProjectId(){return this.environmentId}setLocale(e){this.locale=e,this.logger.debug(`Active locale changed`,{locale:e})}getLocale(){return this.locale}get events(){return this.realtimeAPI}isFilterAST(e){return ep(e)}async unwrapResponse(e){let t=await e.json();return t&&typeof t.success==`boolean`&&`data`in t?t.data:t}async fetch(e,t={}){this.logger.debug(`HTTP request`,{method:t.method||`GET`,url:e,hasBody:!!t.body});let n={"Content-Type":`application/json`,...t.headers||{}};this.token&&(n.Authorization=`Bearer ${this.token}`),this.environmentId&&(n[`X-Environment-Id`]=this.environmentId),this.locale&&!Object.keys(n).some(e=>e.toLowerCase()===`accept-language`)&&(n[`Accept-Language`]=this.locale);let r=await this.fetchImpl(e,{...t,headers:n});if(this.logger.debug(`HTTP response`,{method:t.method||`GET`,url:e,status:r.status,ok:r.ok}),!r.ok){let n;try{n=await r.json()}catch{n={message:r.statusText}}this.logger.error(`HTTP request failed`,void 0,{method:t.method||`GET`,url:e,status:r.status,error:n});let i=n?.message??n?.error?.message??(typeof n?.error==`string`?n.error:void 0)??r.statusText,a=n?.code||n?.error?.code,o=Error(`[ObjectStack] ${a?`${a}: `:``}${i}`);throw o.code=a,o.category=n?.category,o.httpStatus=r.status,o.retryable=n?.retryable,o.details=n?.details||n,o}return r}getRoute(e){let t=this.discoveryInfo?.routes;if(t){let n=t[e];if(n)return n}return{data:`/api/v1/data`,metadata:`/api/v1/meta`,discovery:`/api/v1/discovery`,ui:`/api/v1/ui`,auth:`/api/v1/auth`,analytics:`/api/v1/analytics`,storage:`/api/v1/storage`,automation:`/api/v1/automation`,packages:`/api/v1/packages`,permissions:`/api/v1/permissions`,realtime:`/api/v1/realtime`,workflow:`/api/v1/workflow`,approvals:`/api/v1/approvals`,views:`/api/v1/ui/views`,notifications:`/api/v1/notifications`,ai:`/api/v1/ai`,i18n:`/api/v1/i18n`,feed:`/api/v1/feed`,graphql:`/graphql`}[e]||`/api/v1/${e}`}},n_=class{constructor(e,t){this.meta={getTypes:async()=>{let e=await this.parent._fetch(this.url(`/meta`));return this.parent._unwrap(e)},getItems:async(e,t)=>{let n=new URLSearchParams;t?.packageId&&n.set(`package`,t.packageId);let r=n.toString(),i=await this.parent._fetch(this.url(`/meta/${e}${r?`?${r}`:``}`));return this.parent._unwrap(i)},getItem:async(e,t,n)=>{let r=new URLSearchParams;n?.packageId&&r.set(`package`,n.packageId);let i=r.toString(),a=await this.parent._fetch(this.url(`/meta/${e}/${t}${i?`?${i}`:``}`));return this.parent._unwrap(a)},saveItem:async(e,t,n)=>{let r=await this.parent._fetch(this.url(`/meta/${e}/${t}`),{method:`PUT`,body:JSON.stringify(n)});return this.parent._unwrap(r)},deleteItem:async(e,t)=>{let n=await this.parent._fetch(this.url(`/meta/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),{method:`DELETE`});return this.parent._unwrap(n)},getHistory:async(e,t,n)=>{let r=new URLSearchParams;n?.sinceSeq!==void 0&&r.set(`sinceSeq`,String(n.sinceSeq)),n?.limit!==void 0&&r.set(`limit`,String(n.limit));let i=r.toString(),a=await this.parent._fetch(this.url(`/meta/${encodeURIComponent(e)}/${encodeURIComponent(t)}/history${i?`?${i}`:``}`));return this.parent._unwrap(a)}},this.data={query:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/query`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},find:async(e,t={})=>{let n=new URLSearchParams,r=t,i={};if(`where`in t||`fields`in t||`orderBy`in t||`offset`in t?(r.where&&(i.filter=r.where),r.fields&&(i.select=r.fields),r.orderBy&&(i.sort=r.orderBy),r.limit!=null&&(i.top=r.limit),r.offset!=null&&(i.skip=r.offset),r.aggregations&&(i.aggregations=r.aggregations),r.groupBy&&(i.groupBy=r.groupBy)):Object.assign(i,t),i.top&&n.set(`top`,i.top.toString()),i.skip&&n.set(`skip`,i.skip.toString()),i.sort)if(Array.isArray(i.sort)&&typeof i.sort[0]==`object`)n.set(`sort`,JSON.stringify(i.sort));else{let e=Array.isArray(i.sort)?i.sort.join(`,`):i.sort;n.set(`sort`,e)}i.select&&n.set(`select`,i.select.join(`,`));let a=i.filter??i.filters;a&&(this.parent._isFilterAST(a)||Array.isArray(a)?n.set(`filter`,JSON.stringify(a)):typeof a==`object`&&a&&Object.entries(a).forEach(([e,t])=>{t!=null&&n.append(e,String(t))})),i.aggregations&&n.set(`aggregations`,JSON.stringify(i.aggregations)),i.groupBy&&n.set(`groupBy`,i.groupBy.join(`,`));let o=n.toString(),s=await this.parent._fetch(this.url(`/data/${e}${o?`?${o}`:``}`));return this.parent._unwrap(s)},get:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/${t}`));return this.parent._unwrap(n)},create:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},createMany:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/createMany`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},update:async(e,t,n)=>{let r=await this.parent._fetch(this.url(`/data/${e}/${t}`),{method:`PATCH`,body:JSON.stringify(n)});return this.parent._unwrap(r)},batch:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/batch`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},updateMany:async(e,t,n)=>{let r={records:t,options:n},i=await this.parent._fetch(this.url(`/data/${e}/updateMany`),{method:`POST`,body:JSON.stringify(r)});return this.parent._unwrap(i)},delete:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/${t}`),{method:`DELETE`});return this.parent._unwrap(n)},deleteMany:async(e,t,n)=>{let r={ids:t,options:n},i=await this.parent._fetch(this.url(`/data/${e}/deleteMany`),{method:`POST`,body:JSON.stringify(r)});return this.parent._unwrap(i)}},this.packages={list:async()=>{let e=await this.parent._fetch(this.url(`/packages`));return this.parent._unwrap(e)},get:async(e,t)=>{let n=t?`?version=${encodeURIComponent(t)}`:``,r=await this.parent._fetch(this.url(`/packages/${encodeURIComponent(e)}${n}`));return this.parent._unwrap(r)}},this.automation={getFlow:async e=>{let t=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}`));return this.parent._unwrap(t)},execute:async(e,t)=>{let n=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/trigger`),{method:`POST`,body:JSON.stringify(t??{})});return this.parent._unwrap(n)},listRuns:async(e,t)=>{let n=new URLSearchParams;t?.limit!=null&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor);let r=n.toString(),i=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/runs${r?`?${r}`:``}`));return this.parent._unwrap(i)},getRun:async(e,t)=>{let n=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`));return this.parent._unwrap(n)}},this.parent=e,this.environmentId=t}getProjectId(){return this.environmentId}scope(){return`/api/v1/environments/${encodeURIComponent(this.environmentId)}`}url(e){return`${this.parent._baseUrl()}${this.scope()}${e}`}},r_=(0,j.createContext)(null),i_=(0,j.createContext)(void 0);function a_({client:e,locale:t,children:n}){let r=(0,j.useRef)(null);return(r.current?.client!==e||r.current?.locale!==t)&&(r.current={client:e,locale:t},e.setLocale?.(t)),j.createElement(r_.Provider,{value:e},j.createElement(i_.Provider,{value:t},n))}function o_(){let e=(0,j.useContext)(r_);if(!e)throw Error(`useClient must be used within an ObjectStackProvider. Make sure your component is wrapped with <ObjectStackProvider client={...}>.`);return e}var s_=1,c_=1e6,l_=0;function u_(){return l_=(l_+1)%(2**53-1),l_.toString()}var d_=new Map,f_=e=>{if(d_.has(e))return;let t=setTimeout(()=>{d_.delete(e),g_({type:`REMOVE_TOAST`,toastId:e})},c_);d_.set(e,t)},p_=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,s_)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?f_(n):e.toasts.forEach(e=>{f_(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},m_=[],h_={toasts:[]};function g_(e){h_=p_(h_,e),m_.forEach(e=>{e(h_)})}function K({...e}){let t=u_(),n=e=>g_({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>g_({type:`DISMISS_TOAST`,toastId:t});return g_({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function __(){let[e,t]=j.useState(h_);return j.useEffect(()=>(m_.push(t),()=>{let e=m_.indexOf(t);e>-1&&m_.splice(e,1)}),[e]),{...e,toast:K,dismiss:e=>g_({type:`DISMISS_TOAST`,toastId:e})}}typeof window<`u`&&window.document&&window.document.createElement;function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function v_(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function y_(...e){return t=>{let n=!1,r=e.map(e=>{let r=v_(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():v_(e[t],null)}}}}function b_(...e){return j.useCallback(y_(...e),e)}function x_(e,t){let n=j.createContext(t);n.displayName=e+`Context`;let r=e=>{let{children:t,...r}=e,i=j.useMemo(()=>r,Object.values(r));return(0,M.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=j.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function S_(e,t=[]){let n=[];function r(t,r){let i=j.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=j.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=j.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>j.createContext(e));return function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,C_(i,...t)]}function C_(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function w_(e){let t=j.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];N_(r)&&typeof L_==`function`&&(r=L_(r._payload)),j.Children.forEach(r,e=>{if(j_(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;N_(n)&&typeof L_==`function`&&(n=L_(n._payload)),a=O_(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=j.cloneElement(a,void 0,s):!o&&j.Children.count(r)===1&&j.isValidElement(r)&&(a=r);let c=a?A_(a):void 0,l=b_(n,c);if(!a){if(r||r===0)throw Error(o?I_(e):F_(e));return r}let u=k_(i,a.props??{});return a.type!==j.Fragment&&(u.ref=n?l:c),j.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var T_=w_(`Slot`),E_=Symbol.for(`radix.slottable`);function D_(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=E_,t}var O_=(e,t)=>{if(`child`in e.props){let t=e.props.child;return j.isValidElement(t)?j.cloneElement(t,void 0,e.props.children(t.props.children)):null}return j.isValidElement(t)?t:null};function k_(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function A_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function j_(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===E_}var M_=Symbol.for(`react.lazy`);function N_(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===M_&&`_payload`in e&&P_(e._payload)}function P_(e){return typeof e==`object`&&!!e&&`then`in e}var F_=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,I_=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,L_=j.use;function R_(e){let t=e+`CollectionProvider`,[n,r]=S_(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=j.useRef(null),a=j.useRef(new Map).current;return(0,M.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=w_(s),l=j.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,M.jsx)(c,{ref:b_(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=w_(u),p=j.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=j.useRef(null),s=b_(t,o),c=a(u,n);return j.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,M.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return j.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var z_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w_(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function B_(e,t){e&&Gi.flushSync(()=>e.dispatchEvent(t))}function V_(e){let t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>((...e)=>t.current?.(...e)),[])}function H_(e,t=globalThis?.document){let n=V_(e);j.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var U_=`DismissableLayer`,W_=`dismissableLayer.update`,G_=`dismissableLayer.pointerDownOutside`,K_=`dismissableLayer.focusOutside`,q_,J_=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Y_=j.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=j.useContext(J_),[u,d]=j.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=j.useState({}),m=b_(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Q_(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=$_(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return H_(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),j.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(q_=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),ev(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(u),l.layersWithOutsidePointerEventsDisabled.size===0&&(f.body.style.pointerEvents=q_))}},[u,f,n,l]),j.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),ev())},[u,l]),j.useEffect(()=>{let e=()=>p({});return document.addEventListener(W_,e),()=>document.removeEventListener(W_,e)},[]),(0,M.jsx)(z_.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,S.onFocusCapture),onBlurCapture:q(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,x.onPointerDownCapture)})});Y_.displayName=U_;var X_=`DismissableLayerBranch`,Z_=j.forwardRef((e,t)=>{let n=j.useContext(J_),r=j.useRef(null),i=b_(t,r);return j.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)(z_.div,{...e,ref:i})});Z_.displayName=X_;function Q_(e,t=globalThis?.document){let n=V_(e),r=j.useRef(!1),i=j.useRef(()=>{});return j.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){tv(G_,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $_(e,t=globalThis?.document){let n=V_(e),r=j.useRef(!1);return j.useEffect(()=>{let e=e=>{e.target&&!r.current&&tv(K_,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ev(){let e=new CustomEvent(W_);document.dispatchEvent(e)}function tv(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?B_(i,a):i.dispatchEvent(a)}var nv=Y_,rv=Z_,iv=globalThis?.document?j.useLayoutEffect:()=>{},av=`Portal`,ov=j.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=j.useState(!1);iv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Gi.createPortal((0,M.jsx)(z_.div,{...r,ref:t}),o):null});ov.displayName=av;function sv(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}var cv=e=>{let{present:t,children:n}=e,r=lv(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=dv(r.ref,pv(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null};cv.displayName=`Presence`;function lv(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),[o,s]=sv(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{let e=fv(r.current);a.current=o===`mounted`?e:`none`},[o]),iv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=fv(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),iv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=fv(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=fv(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:j.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function uv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function dv(...e){let t=j.useRef(e);return t.current=e,j.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=uv(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():uv(n[e],null)}}},[])}function fv(e){return e?.animationName||`none`}function pv(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mv=j.useInsertionEffect||iv;function hv({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=gv({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=j.useRef(e!==void 0);j.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,j.useCallback(t=>{if(s){let n=_v(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function gv({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return mv(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function _v(e){return typeof e==`function`}var vv=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),yv=`VisuallyHidden`,bv=j.forwardRef((e,t)=>(0,M.jsx)(z_.span,{...e,ref:t,style:{...vv,...e.style}}));bv.displayName=yv;var xv=bv,Sv=`ToastProvider`,[Cv,wv,Tv]=R_(`Toast`),[Ev,Dv]=S_(`Toast`,[Tv]),[Ov,kv]=Ev(Sv),Av=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=j.useState(null),[u,d]=j.useState(0),f=j.useRef(!1),p=j.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Sv}\`. Expected non-empty \`string\`.`),(0,M.jsx)(Cv.Provider,{scope:t,children:(0,M.jsx)(Ov,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:j.useCallback(()=>d(e=>e+1),[]),onToastRemove:j.useCallback(()=>d(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,announcerContainer:o,children:s})})};Av.displayName=Sv;var jv=`ToastViewport`,Mv=[`F8`],Nv=`toast.viewportPause`,Pv=`toast.viewportResume`,Fv=j.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=Mv,label:i=`Notifications ({hotkey})`,...a}=e,o=kv(jv,n),s=wv(n),c=j.useRef(null),l=j.useRef(null),u=j.useRef(null),d=j.useRef(null),f=b_(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;j.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),j.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(Nv);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Pv);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=j.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...cy(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return j.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);ly(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,M.jsxs)(rv,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,M.jsx)(Lv,{ref:l,onFocusFromOutsideViewport:()=>{ly(h({tabbingDirection:`forwards`}))}}),(0,M.jsx)(Cv.Slot,{scope:n,children:(0,M.jsx)(z_.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,M.jsx)(Lv,{ref:u,onFocusFromOutsideViewport:()=>{ly(h({tabbingDirection:`backwards`}))}})]})});Fv.displayName=jv;var Iv=`ToastFocusProxy`,Lv=j.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=kv(Iv,n);return(0,M.jsx)(bv,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});Lv.displayName=Iv;var Rv=`Toast`,zv=`toast.swipeStart`,Bv=`toast.swipeMove`,Vv=`toast.swipeCancel`,Hv=`toast.swipeEnd`,Uv=j.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=hv({prop:r,defaultProp:i??!0,onChange:a,caller:Rv});return(0,M.jsx)(cv,{present:n||s,children:(0,M.jsx)(Kv,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:V_(e.onPause),onResume:V_(e.onResume),onSwipeStart:q(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:q(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:q(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:q(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Uv.displayName=Rv;var[Wv,Gv]=Ev(Rv,{onClose(){}}),Kv=j.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=kv(Rv,n),[g,_]=j.useState(null),v=b_(t,e=>_(e)),y=j.useRef(null),b=j.useRef(null),x=i||h.duration,S=j.useRef(0),C=j.useRef(x),w=j.useRef(0),{onToastAdd:T,onToastRemove:E}=h,D=V_(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),O=j.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),S.current=new Date().getTime(),w.current=window.setTimeout(D,e))},[D]);j.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{O(C.current),l?.()},n=()=>{let e=new Date().getTime()-S.current;C.current-=e,window.clearTimeout(w.current),c?.()};return e.addEventListener(Nv,n),e.addEventListener(Pv,t),()=>{e.removeEventListener(Nv,n),e.removeEventListener(Pv,t)}}},[h.viewport,x,c,l,O]),j.useEffect(()=>{a&&!h.isClosePausedRef.current&&O(x)},[a,x,h.isClosePausedRef,O]),j.useEffect(()=>(T(),()=>E()),[T,E]);let ee=j.useMemo(()=>g?ry(g):null,[g]);return h.viewport?(0,M.jsxs)(M.Fragment,{children:[ee&&(0,M.jsx)(qv,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ee}),(0,M.jsx)(Wv,{scope:n,onClose:D,children:Gi.createPortal((0,M.jsx)(Cv.ItemSlot,{scope:n,children:(0,M.jsx)(nv,{asChild:!0,onEscapeKeyDown:q(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||D(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,M.jsx)(z_.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:q(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:q(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:q(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!b.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(b.current=l,iy(Bv,d,f,{discrete:!1})):ay(l,h.swipeDirection,c)?(b.current=l,iy(zv,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:q(e.onPointerUp,e=>{let t=b.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),b.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};ay(t,h.swipeDirection,h.swipeThreshold)?iy(Hv,p,r,{discrete:!0}):iy(Vv,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),qv=e=>{let{__scopeToast:t,children:n,...r}=e,i=kv(Rv,t),[a,o]=j.useState(!1),[s,c]=j.useState(!1);return oy(()=>o(!0)),j.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,M.jsx)(ov,{asChild:!0,container:i.announcerContainer||void 0,children:(0,M.jsx)(bv,{...r,children:a&&(0,M.jsxs)(M.Fragment,{children:[i.label,` `,n]})})})},Jv=`ToastTitle`,Yv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,M.jsx)(z_.div,{...r,ref:t})});Yv.displayName=Jv;var Xv=`ToastDescription`,Zv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,M.jsx)(z_.div,{...r,ref:t})});Zv.displayName=Xv;var Qv=`ToastAction`,$v=j.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,M.jsx)(ny,{altText:n,asChild:!0,children:(0,M.jsx)(ty,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Qv}\`. Expected non-empty \`string\`.`),null)});$v.displayName=Qv;var ey=`ToastClose`,ty=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Gv(ey,n);return(0,M.jsx)(ny,{asChild:!0,children:(0,M.jsx)(z_.button,{type:`button`,...r,ref:t,onClick:q(e.onClick,i.onClose)})})});ty.displayName=ey;var ny=j.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,M.jsx)(z_.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function ry(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),sy(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...ry(e))}}),t}function iy(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?B_(i,a):i.dispatchEvent(a)}var ay=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function oy(e=()=>{}){let t=V_(e);iv(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function sy(e){return e.nodeType===e.ELEMENT_NODE}function cy(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ly(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var uy=Av,dy=Fv,fy=Uv,py=Yv,my=Zv,hy=$v,gy=ty;function _y(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=_y(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function vy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_y(e))&&(r&&(r+=` `),r+=t);return r}var yy=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,by=vy,xy=(e,t)=>n=>{if(t?.variants==null)return by(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=yy(t)||yy(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return by(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Sy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Cy=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),wy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ty=e=>{let t=wy(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ey={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Dy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Oy=(0,j.createContext)({}),ky=()=>(0,j.useContext)(Oy),Ay=(0,j.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ky()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,j.createElement)(`svg`,{ref:c,...Ey,width:t??l??Ey.width,height:t??l??Ey.height,stroke:e??f,strokeWidth:m,className:Sy(`lucide`,p,i),...!a&&!Dy(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,j.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),jy=(e,t)=>{let n=(0,j.forwardRef)(({className:n,...r},i)=>(0,j.createElement)(Ay,{ref:i,iconNode:t,className:Sy(`lucide-${Cy(Ty(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ty(e),n},My=jy(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ny=jy(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),Py=jy(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Fy=jy(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Iy=jy(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ly=jy(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ry=jy(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),zy=jy(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),By=jy(`circle-user-round`,[[`path`,{d:`M17.925 20.056a6 6 0 0 0-11.851.001`,key:`z69sun`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Vy=jy(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Hy=jy(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Uy=jy(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Wy=jy(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Gy=jy(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Ky=jy(`gallery-vertical-end`,[[`path`,{d:`M7 2h10`,key:`nczekb`}],[`path`,{d:`M5 6h14`,key:`u2x4p`}],[`rect`,{width:`18`,height:`12`,x:`3`,y:`10`,rx:`2`,key:`l0tzu3`}]]),qy=jy(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Jy=jy(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Yy=jy(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Xy=jy(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Zy=jy(`languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Qy=jy(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),$y=jy(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),eb=jy(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),tb=jy(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),nb=jy(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),rb=jy(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),ib=jy(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ab=jy(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),ob=jy(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),sb=jy(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),cb=jy(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),lb=jy(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ub=jy(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),db=jy(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),fb=jy(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),pb=jy(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),mb=jy(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),hb=jy(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),gb=jy(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_b=jy(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),vb=jy(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),yb=jy(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),bb=jy(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),xb=jy(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Sb=jy(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Cb=jy(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),wb=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Tb=(e,t)=>({classGroupId:e,validator:t}),Eb=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Db=`-`,Ob=[],kb=`arbitrary..`,Ab=e=>{let t=Nb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Mb(e);let n=e.split(Db);return jb(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?wb(i,t):t:i||Ob}return n[e]||Ob}}},jb=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=jb(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Db):e.slice(t).join(Db),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Mb=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?kb+r:void 0})(),Nb=e=>{let{theme:t,classGroups:n}=e;return Pb(n,t)},Pb=(e,t)=>{let n=Eb();for(let r in e){let i=e[r];Fb(i,n,r,t)}return n},Fb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ib(i,t,n,r)}},Ib=(e,t,n,r)=>{if(typeof e==`string`){Lb(e,t,n);return}if(typeof e==`function`){Rb(e,t,n,r);return}zb(e,t,n,r)},Lb=(e,t,n)=>{let r=e===``?t:Bb(t,e);r.classGroupId=n},Rb=(e,t,n,r)=>{if(Vb(e)){Fb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Tb(n,e))},zb=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Fb(o,Bb(t,a),n,r)}},Bb=(e,t)=>{let n=e,r=t.split(Db),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Eb(),n.nextPart.set(t,i)),n=i}return n},Vb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Hb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ub=`!`,Wb=`:`,Gb=[],Kb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),qb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Wb){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Ub)?(c=s.slice(0,-1),l=!0):s.startsWith(Ub)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Kb(t,l,c,u)};if(t){let e=t+Wb,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Kb(Gb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Jb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Yb=e=>({cache:Hb(e.cacheSize),parseClassName:qb(e),sortModifiers:Jb(e),postfixLookupClassGroupIds:Xb(e),...Ab(e)}),Xb=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Zb=/\s+/,Qb=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Zb),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ub:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},$b=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ex(n))&&(i&&(i+=` `),i+=r);return i},ex=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ex(e[r]))&&(n&&(n+=` `),n+=t);return n},tx=(e,...t)=>{let n,r,i,a,o=o=>(n=Yb(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Qb(e,n);return i(e,a),a};return a=o,(...e)=>a($b(...e))},nx=[],rx=e=>{let t=t=>t[e]||nx;return t.isThemeGetter=!0,t},ix=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ax=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ox=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ux=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fx=e=>ox.test(e),px=e=>!!e&&!Number.isNaN(Number(e)),mx=e=>!!e&&Number.isInteger(Number(e)),hx=e=>e.endsWith(`%`)&&px(e.slice(0,-1)),gx=e=>sx.test(e),_x=()=>!0,vx=e=>cx.test(e)&&!lx.test(e),yx=()=>!1,bx=e=>ux.test(e),xx=e=>dx.test(e),Sx=e=>!J(e)&&!Y(e),Cx=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),wx=e=>zx(e,Ux,yx),J=e=>ix.test(e),Tx=e=>zx(e,Wx,vx),Ex=e=>zx(e,Gx,px),Dx=e=>zx(e,qx,_x),Ox=e=>zx(e,Kx,yx),kx=e=>zx(e,Vx,yx),Ax=e=>zx(e,Hx,xx),jx=e=>zx(e,Jx,bx),Y=e=>ax.test(e),Mx=e=>Bx(e,Wx),Nx=e=>Bx(e,Kx),Px=e=>Bx(e,Vx),Fx=e=>Bx(e,Ux),Ix=e=>Bx(e,Hx),Lx=e=>Bx(e,Jx,!0),Rx=e=>Bx(e,qx,!0),zx=(e,t,n)=>{let r=ix.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Bx=(e,t,n=!1)=>{let r=ax.exec(e);return r?r[1]?t(r[1]):n:!1},Vx=e=>e===`position`||e===`percentage`,Hx=e=>e===`image`||e===`url`,Ux=e=>e===`length`||e===`size`||e===`bg-size`,Wx=e=>e===`length`,Gx=e=>e===`number`,Kx=e=>e===`family-name`,qx=e=>e===`number`||e===`weight`,Jx=e=>e===`shadow`,Yx=tx(()=>{let e=rx(`color`),t=rx(`font`),n=rx(`text`),r=rx(`font-weight`),i=rx(`tracking`),a=rx(`leading`),o=rx(`breakpoint`),s=rx(`container`),c=rx(`spacing`),l=rx(`radius`),u=rx(`shadow`),d=rx(`inset-shadow`),f=rx(`text-shadow`),p=rx(`drop-shadow`),m=rx(`blur`),h=rx(`perspective`),g=rx(`aspect`),_=rx(`ease`),v=rx(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[fx,`full`,`auto`,...w()],E=()=>[mx,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,mx,Y,J]},mx,Y,J],O=()=>[mx,`auto`,Y,J],ee=()=>[`auto`,`min`,`max`,`fr`,Y,J],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[fx,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[fx,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[fx,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,Y,J],se=()=>[...b(),Px,kx,{position:[Y,J]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,Fx,wx,{size:[Y,J]}],ue=()=>[hx,Mx,Tx],A=()=>[``,`none`,`full`,l,Y,J],de=()=>[``,px,Mx,Tx],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[px,hx,Px,kx],he=()=>[``,`none`,m,Y,J],ge=()=>[`none`,px,Y,J],_e=()=>[`none`,px,Y,J],ve=()=>[px,Y,J],ye=()=>[fx,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[gx],breakpoint:[gx],color:[_x],container:[gx],"drop-shadow":[gx],ease:[`in`,`out`,`in-out`],font:[Sx],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[gx],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[gx],shadow:[gx],spacing:[`px`,px],text:[gx],"text-shadow":[gx],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,fx,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[Cx],columns:[{columns:[px,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[mx,`auto`,Y,J]}],basis:[{basis:[fx,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[px,fx,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,px,Y,J]}],shrink:[{shrink:[``,px,Y,J]}],order:[{order:[mx,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,...ie()]}],"font-size":[{text:[`base`,n,Mx,Tx]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Rx,Dx]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,hx,J]}],"font-family":[{font:[Nx,Ox,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[px,`none`,Y,Ex]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[px,`from-font`,`auto`,Y,Tx]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[px,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[mx,Y,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},mx,Y,J],radial:[``,Y,J],conic:[mx,Y,J]},Ix,Ax]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":de()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[px,Y,J]}],"outline-w":[{outline:[``,px,Mx,Tx]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`none`,u,Lx,jx]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,Lx,jx]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:de()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[px,Tx]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,Lx,jx]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[px,Y,J]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[px]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[px]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:he()}],brightness:[{brightness:[px,Y,J]}],contrast:[{contrast:[px,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Lx,jx]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,px,Y,J]}],"hue-rotate":[{"hue-rotate":[px,Y,J]}],invert:[{invert:[``,px,Y,J]}],saturate:[{saturate:[px,Y,J]}],sepia:[{sepia:[``,px,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[px,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[px,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,px,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[px,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,px,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[px,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[px,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,px,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[px,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[px,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":[`scale-3d`],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":[`translate-none`],zoom:[{zoom:[mx,Y,J]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[px,Mx,Tx,Ex]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function X(...e){return Yx(vy(e))}var Xx=uy,Zx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(dy,{ref:n,className:X(`fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]`,e),...t}));Zx.displayName=dy.displayName;var Qx=xy(`group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full`,{variants:{variant:{default:`border bg-background text-foreground`,destructive:`destructive group border-destructive bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),$x=j.forwardRef(({className:e,variant:t,...n},r)=>(0,M.jsx)(fy,{ref:r,className:X(Qx({variant:t}),e),...n}));$x.displayName=fy.displayName;var eS=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(hy,{ref:n,className:X(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive`,e),...t}));eS.displayName=hy.displayName;var tS=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(gy,{ref:n,className:X(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,M.jsx)(Cb,{className:`h-4 w-4`})}));tS.displayName=gy.displayName;var nS=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(py,{ref:n,className:X(`text-sm font-semibold`,e),...t}));nS.displayName=py.displayName;var rS=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(my,{ref:n,className:X(`text-sm opacity-90`,e),...t}));rS.displayName=my.displayName;function iS(){let{toasts:e}=__();return(0,M.jsxs)(Xx,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,M.jsxs)($x,{...i,children:[(0,M.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,M.jsx)(nS,{children:t}),n&&(0,M.jsx)(rS,{children:n})]}),r,(0,M.jsx)(tS,{})]},e)}),(0,M.jsx)(Zx,{})]})}var aS=768;function oS(){let[e,t]=j.useState(void 0);return j.useEffect(()=>{let e=window.matchMedia(`(max-width: ${aS-1}px)`),n=()=>{t(window.innerWidth<aS)};return e.addEventListener(`change`,n),t(window.innerWidth<aS),()=>e.removeEventListener(`change`,n)},[]),!!e}var sS=xy(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Z=j.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,M.jsx)(r?T_:`button`,{className:X(sS({variant:t,size:n,className:e})),ref:a,...i}));Z.displayName=`Button`;var cS=j.forwardRef(({className:e,type:t,...n},r)=>(0,M.jsx)(`input`,{type:t,className:X(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));cS.displayName=`Input`;var lS=`Separator`,uS=`horizontal`,dS=[`horizontal`,`vertical`],fS=j.forwardRef((e,t)=>{let{decorative:n,orientation:r=uS,...i}=e,a=pS(r)?r:uS,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,M.jsx)(z_.div,{"data-orientation":a,...o,...i,ref:t})});fS.displayName=lS;function pS(e){return dS.includes(e)}var mS=fS,hS=j.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,M.jsx)(mS,{ref:i,decorative:n,orientation:t,className:X(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));hS.displayName=mS.displayName;var gS=j.useId||(()=>void 0),_S=0;function vS(e){let[t,n]=j.useState(gS());return iv(()=>{e||n(e=>e??String(_S++))},[e]),e||(t?`radix-${t}`:``)}var yS=`focusScope.autoFocusOnMount`,bS=`focusScope.autoFocusOnUnmount`,xS={bubbles:!1,cancelable:!0},SS=`FocusScope`,CS=j.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=j.useState(null),l=V_(i),u=V_(a),d=j.useRef(null),f=b_(t,e=>c(e)),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:AS(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||AS(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&AS(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){jS.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(yS,xS);s.addEventListener(yS,l),s.dispatchEvent(t),t.defaultPrevented||(wS(PS(ES(s)),{select:!0}),document.activeElement===e&&AS(s))}return()=>{s.removeEventListener(yS,l),setTimeout(()=>{let t=new CustomEvent(bS,xS);s.addEventListener(bS,u),s.dispatchEvent(t),t.defaultPrevented||AS(e??document.body,{select:!0}),s.removeEventListener(bS,u),jS.remove(p)},0)}}},[s,l,u,p]);let m=j.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=TS(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&AS(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&AS(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(z_.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});CS.displayName=SS;function wS(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(AS(r,{select:t}),document.activeElement!==n)return}function TS(e){let t=ES(e);return[DS(t,e),DS(t.reverse(),e)]}function ES(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DS(e,t){for(let n of e)if(!OS(n,{upTo:t}))return n}function OS(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function kS(e){return e instanceof HTMLInputElement&&`select`in e}function AS(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kS(e)&&t&&e.select()}}var jS=MS();function MS(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=NS(e,t),e.unshift(t)},remove(t){e=NS(e,t),e[0]?.resume()}}}function NS(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function PS(e){return e.filter(e=>e.tagName!==`A`)}var FS=0,IS=null;function LS(){j.useEffect(()=>{IS||={start:RS(),end:RS()};let{start:e,end:t}=IS;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),FS++,()=>{FS===1&&(IS?.start.remove(),IS?.end.remove(),IS=null),FS=Math.max(0,FS-1)}},[])}function RS(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var zS=function(){return zS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zS.apply(this,arguments)};function BS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function VS(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var HS=`right-scroll-bar-position`,US=`width-before-scroll-bar`,WS=`with-scroll-bars-hidden`,GS=`--removed-body-scroll-bar-size`;function KS(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function qS(e,t){var n=(0,j.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var JS=typeof window<`u`?j.useLayoutEffect:j.useEffect,YS=new WeakMap;function XS(e,t){var n=qS(t||null,function(t){return e.forEach(function(e){return KS(e,t)})});return JS(function(){var t=YS.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||KS(e,null)}),i.forEach(function(e){r.has(e)||KS(e,a)})}YS.set(n,e)},[e]),n}function ZS(e){return e}function QS(e,t){t===void 0&&(t=ZS);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function $S(e){e===void 0&&(e={});var t=QS(null);return t.options=zS({async:!0,ssr:!1},e),t}var eC=function(e){var t=e.sideCar,n=BS(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return j.createElement(r,zS({},n))};eC.isSideCarExport=!0;function tC(e,t){return e.useMedium(t),eC}var nC=$S(),rC=function(){},iC=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:rC,onWheelCapture:rC,onTouchMoveCapture:rC}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=BS(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=XS([n,t]),C=zS(zS({},b),i);return j.createElement(j.Fragment,null,u&&j.createElement(x,{sideCar:nC,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?j.cloneElement(j.Children.only(s),zS(zS({},C),{ref:S})):j.createElement(v,zS({},C,{className:c,ref:S}),s))});iC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},iC.classNames={fullWidth:US,zeroRight:HS};var aC,oC=function(){if(aC)return aC;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function sC(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=oC();return t&&e.setAttribute(`nonce`,t),e}function cC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function lC(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var uC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=sC())&&(cC(t,n),lC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},dC=function(){var e=uC();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fC=function(){var e=dC();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},pC={left:0,top:0,right:0,gap:0},mC=function(e){return parseInt(e||``,10)||0},hC=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[mC(n),mC(r),mC(i)]},gC=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return pC;var t=hC(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_C=fC(),vC=`data-scroll-locked`,yC=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
110
|
+
.${WS} {
|
|
111
111
|
overflow: hidden ${r};
|
|
112
112
|
padding-right: ${s}px ${r};
|
|
113
113
|
}
|
|
114
|
-
body[${
|
|
114
|
+
body[${vC}] {
|
|
115
115
|
overflow: hidden ${r};
|
|
116
116
|
overscroll-behavior: contain;
|
|
117
117
|
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
@@ -124,31 +124,31 @@ Remove the unknown key(s), fix the typo, or move the logic to a supported mechan
|
|
|
124
124
|
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.${
|
|
127
|
+
.${HS} {
|
|
128
128
|
right: ${s}px ${r};
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.${
|
|
131
|
+
.${US} {
|
|
132
132
|
margin-right: ${s}px ${r};
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
.${
|
|
135
|
+
.${HS} .${HS} {
|
|
136
136
|
right: 0 ${r};
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
.${
|
|
139
|
+
.${US} .${US} {
|
|
140
140
|
margin-right: 0 ${r};
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
body[${
|
|
144
|
-
${
|
|
143
|
+
body[${vC}] {
|
|
144
|
+
${GS}: ${s}px;
|
|
145
145
|
}
|
|
146
|
-
`},
|
|
146
|
+
`},bC=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},xC=function(){j.useEffect(function(){return document.body.setAttribute(vC,(bC()+1).toString()),function(){var e=bC()-1;e<=0?document.body.removeAttribute(vC):document.body.setAttribute(vC,e.toString())}},[])},SC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;xC();var a=j.useMemo(function(){return gC(i)},[i]);return j.createElement(_C,{styles:yC(a,!t,i,n?``:`!important`)})},CC=!1;if(typeof window<`u`)try{var wC=Object.defineProperty({},"passive",{get:function(){return CC=!0,!0}});window.addEventListener(`test`,wC,wC),window.removeEventListener(`test`,wC,wC)}catch{CC=!1}var TC=CC?{passive:!1}:!1,EC=function(e){return e.tagName===`TEXTAREA`},DC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!EC(e)&&n[t]===`visible`)},OC=function(e){return DC(e,`overflowY`)},kC=function(e){return DC(e,`overflowX`)},AC=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),NC(e,r)){var i=PC(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jC=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},MC=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},NC=function(e,t){return e===`v`?OC(t):kC(t)},PC=function(e,t){return e===`v`?jC(t):MC(t)},FC=function(e,t){return e===`h`&&t===`rtl`?-1:1},IC=function(e,t,n,r,i){var a=FC(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=PC(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&NC(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},LC=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},RC=function(e){return[e.deltaX,e.deltaY]},zC=function(e){return e&&`current`in e?e.current:e},BC=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VC=function(e){return`
|
|
147
147
|
.block-interactivity-${e} {pointer-events: none;}
|
|
148
148
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
149
|
-
`},
|
|
149
|
+
`},HC=0,UC=[];function WC(e){var t=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),i=j.useState(HC++)[0],a=j.useState(fC)[0],o=j.useRef(e);j.useEffect(function(){o.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=VS([e.lockRef.current],(e.shards||[]).map(zC),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=j.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=LC(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=AC(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=AC(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return IC(h,t,e,h===`h`?s:c,!0)},[]),c=j.useCallback(function(e){var n=e;if(!(!UC.length||UC[UC.length-1]!==a)){var r=`deltaY`in n?RC(n):LC(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&BC(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zC).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=j.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:GC(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=j.useCallback(function(e){n.current=LC(e),r.current=void 0},[]),d=j.useCallback(function(t){l(t.type,RC(t),t.target,s(t,e.lockRef.current))},[]),f=j.useCallback(function(t){l(t.type,LC(t),t.target,s(t,e.lockRef.current))},[]);j.useEffect(function(){return UC.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,TC),document.addEventListener(`touchmove`,c,TC),document.addEventListener(`touchstart`,u,TC),function(){UC=UC.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,TC),document.removeEventListener(`touchmove`,c,TC),document.removeEventListener(`touchstart`,u,TC)}},[]);var p=e.removeScrollBar,m=e.inert;return j.createElement(j.Fragment,null,m?j.createElement(a,{styles:VC(i)}):null,p?j.createElement(SC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function GC(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var KC=tC(nC,WC),qC=j.forwardRef(function(e,t){return j.createElement(iC,zS({},e,{ref:t,sideCar:KC}))});qC.classNames=iC.classNames;var JC=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},YC=new WeakMap,XC=new WeakMap,ZC={},QC=0,$C=function(e){return e&&(e.host||$C(e.parentNode))},ew=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$C(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},tw=function(e,t,n,r){var i=ew(t,Array.isArray(e)?e:[e]);ZC[n]||(ZC[n]=new WeakMap);var a=ZC[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(YC.get(e)||0)+1,l=(a.get(e)||0)+1;YC.set(e,c),a.set(e,l),o.push(e),c===1&&i&&XC.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),QC++,function(){o.forEach(function(e){var t=YC.get(e)-1,i=a.get(e)-1;YC.set(e,t),a.set(e,i),t||(XC.has(e)||e.removeAttribute(r),XC.delete(e)),i||e.removeAttribute(n)}),QC--,QC||(YC=new WeakMap,YC=new WeakMap,XC=new WeakMap,ZC={})}},nw=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||JC(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),tw(r,i,n,`aria-hidden`)):function(){return null}},rw=`Dialog`,[iw,aw]=S_(rw),[ow,sw]=iw(rw),cw=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=j.useRef(null),c=j.useRef(null),[l,u]=hv({prop:r,defaultProp:i??!1,onChange:a,caller:rw});return(0,M.jsx)(ow,{scope:t,triggerRef:s,contentRef:c,contentId:vS(),titleId:vS(),descriptionId:vS(),open:l,onOpenChange:u,onOpenToggle:j.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};cw.displayName=rw;var lw=`DialogTrigger`,uw=j.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sw(lw,n),a=b_(t,i.triggerRef);return(0,M.jsx)(z_.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Aw(i.open),...r,ref:a,onClick:q(e.onClick,i.onOpenToggle)})});uw.displayName=lw;var dw=`DialogPortal`,[fw,pw]=iw(dw,{forceMount:void 0}),mw=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=sw(dw,t);return(0,M.jsx)(fw,{scope:t,forceMount:n,children:j.Children.map(r,e=>(0,M.jsx)(cv,{present:n||a.open,children:(0,M.jsx)(ov,{asChild:!0,container:i,children:e})}))})};mw.displayName=dw;var hw=`DialogOverlay`,gw=j.forwardRef((e,t)=>{let n=pw(hw,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=sw(hw,e.__scopeDialog);return a.modal?(0,M.jsx)(cv,{present:r||a.open,children:(0,M.jsx)(vw,{...i,ref:t})}):null});gw.displayName=hw;var _w=w_(`DialogOverlay.RemoveScroll`),vw=j.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sw(hw,n);return(0,M.jsx)(qC,{as:_w,allowPinchZoom:!0,shards:[i.contentRef],children:(0,M.jsx)(z_.div,{"data-state":Aw(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),yw=`DialogContent`,bw=j.forwardRef((e,t)=>{let n=pw(yw,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=sw(yw,e.__scopeDialog);return(0,M.jsx)(cv,{present:r||a.open,children:a.modal?(0,M.jsx)(xw,{...i,ref:t}):(0,M.jsx)(Sw,{...i,ref:t})})});bw.displayName=yw;var xw=j.forwardRef((e,t)=>{let n=sw(yw,e.__scopeDialog),r=j.useRef(null),i=b_(t,n.contentRef,r);return j.useEffect(()=>{let e=r.current;if(e)return nw(e)},[]),(0,M.jsx)(Cw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault())})}),Sw=j.forwardRef((e,t)=>{let n=sw(yw,e.__scopeDialog),r=j.useRef(!1),i=j.useRef(!1);return(0,M.jsx)(Cw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Cw=j.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=sw(yw,n),c=j.useRef(null),l=b_(t,c);return LS(),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(CS,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,M.jsx)(Y_,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Aw(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Pw,{titleId:s.titleId}),(0,M.jsx)(Iw,{contentRef:c,descriptionId:s.descriptionId})]})]})}),ww=`DialogTitle`,Tw=j.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sw(ww,n);return(0,M.jsx)(z_.h2,{id:i.titleId,...r,ref:t})});Tw.displayName=ww;var Ew=`DialogDescription`,Dw=j.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sw(Ew,n);return(0,M.jsx)(z_.p,{id:i.descriptionId,...r,ref:t})});Dw.displayName=Ew;var Ow=`DialogClose`,kw=j.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sw(Ow,n);return(0,M.jsx)(z_.button,{type:`button`,...r,ref:t,onClick:q(e.onClick,()=>i.onOpenChange(!1))})});kw.displayName=Ow;function Aw(e){return e?`open`:`closed`}var jw=`DialogTitleWarning`,[Mw,Nw]=x_(jw,{contentName:yw,titleName:ww,docsSlug:`dialog`}),Pw=({titleId:e})=>{let t=Nw(jw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
150
150
|
|
|
151
151
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
152
152
|
|
|
153
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Iw=`DialogDescriptionWarning`,Lw=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Pw(Iw).contentName}}.`;return j.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Rw=lw,zw=hw,Bw=_w,Vw=xw,Hw=Ew,Uw=Ow,Ww=Aw,Gw=Rw,Kw=zw,qw=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Bw,{className:Z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));qw.displayName=Bw.displayName;var Jw=fy(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Yw=j.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,M.jsxs)(Kw,{children:[(0,M.jsx)(qw,{}),(0,M.jsxs)(Vw,{ref:i,className:Z(Jw({side:e}),t),...r,children:[n,(0,M.jsxs)(Ww,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,M.jsx)(pb,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Yw.displayName=Vw.displayName;var Xw=({className:e,...t})=>(0,M.jsx)(`div`,{className:Z(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Xw.displayName=`SheetHeader`;var Zw=({className:e,...t})=>(0,M.jsx)(`div`,{className:Z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Zw.displayName=`SheetFooter`;var Qw=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Hw,{ref:n,className:Z(`text-lg font-semibold text-foreground`,e),...t}));Qw.displayName=Hw.displayName;var $w=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Uw,{ref:n,className:Z(`text-sm text-muted-foreground`,e),...t}));$w.displayName=Uw.displayName;function eT({className:e,...t}){return(0,M.jsx)(`div`,{className:Z(`bg-muted animate-pulse rounded-md`,e),...t})}var tT=[`top`,`right`,`bottom`,`left`],nT=Math.min,rT=Math.max,iT=Math.round,aT=Math.floor,oT=e=>({x:e,y:e}),sT={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function cT(e,t,n){return rT(e,nT(t,n))}function lT(e,t){return typeof e==`function`?e(t):e}function uT(e){return e.split(`-`)[0]}function dT(e){return e.split(`-`)[1]}function fT(e){return e===`x`?`y`:`x`}function pT(e){return e===`y`?`height`:`width`}function mT(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function hT(e){return fT(mT(e))}function gT(e,t,n){n===void 0&&(n=!1);let r=dT(e),i=hT(e),a=pT(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=TT(o)),[o,TT(o)]}function _T(e){let t=TT(e);return[vT(e),t,vT(t)]}function vT(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var yT=[`left`,`right`],bT=[`right`,`left`],xT=[`top`,`bottom`],ST=[`bottom`,`top`];function CT(e,t,n){switch(e){case`top`:case`bottom`:return n?t?bT:yT:t?yT:bT;case`left`:case`right`:return t?xT:ST;default:return[]}}function wT(e,t,n,r){let i=dT(e),a=CT(uT(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vT)))),a}function TT(e){let t=uT(e);return sT[t]+e.slice(t.length)}function ET(e){return{top:0,right:0,bottom:0,left:0,...e}}function DT(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ET(e)}function OT(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function kT(e,t,n){let{reference:r,floating:i}=e,a=mT(t),o=hT(t),s=pT(o),c=uT(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(dT(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function AT(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=lT(t,e),p=DT(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=OT(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=OT(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var jT=50,MT=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:AT},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=kT(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<jT&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=kT(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},NT=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=lT(e,t)||{};if(l==null)return{};let d=DT(u),f={x:n,y:r},p=hT(i),m=pT(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=nT(d[_],T),D=nT(d[v],T),O=E,ee=C-h[m]-D,te=C/2-h[m]/2+w,ne=cT(O,te,ee),re=!c.arrow&&dT(i)!=null&&te!==ne&&a.reference[m]/2-(te<O?E:D)-h[m]/2<0,ie=re?te<O?te-O:te-ee:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),PT=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=lT(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=uT(r),_=mT(o),v=uT(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[TT(o)]:_T(o)),x=p!==`none`;!d&&x&&b.push(...wT(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=gT(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==mT(t))||T.every(e=>mT(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=mT(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function FT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function IT(e){return tT.some(t=>e[t]>=0)}var LT=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=lT(e,t);switch(i){case`referenceHidden`:{let e=FT(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:IT(e)}}}case`escaped`:{let e=FT(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:IT(e)}}}default:return{}}}}},RT=new Set([`left`,`top`]);async function zT(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=uT(n),s=dT(n),c=mT(n)===`y`,l=RT.has(o)?-1:1,u=a&&c?-1:1,d=lT(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var BT=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await zT(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},VT=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=lT(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=mT(uT(i)),p=fT(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=cT(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=cT(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},HT=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=lT(e,t),u={x:n,y:r},d=mT(i),f=fT(d),p=u[f],m=u[d],h=lT(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=RT.has(uT(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},UT=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=lT(e,t),u=await o.detectOverflow(t,l),d=uT(i),f=dT(i),p=mT(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=nT(h-u[g],v),x=nT(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=rT(u.left,0),t=rT(u.right,0),n=rT(u.top,0),r=rT(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:rT(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:rT(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function WT(){return typeof window<`u`}function GT(e){return JT(e)?(e.nodeName||``).toLowerCase():`#document`}function KT(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qT(e){return((JT(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function JT(e){return WT()?e instanceof Node||e instanceof KT(e).Node:!1}function YT(e){return WT()?e instanceof Element||e instanceof KT(e).Element:!1}function XT(e){return WT()?e instanceof HTMLElement||e instanceof KT(e).HTMLElement:!1}function ZT(e){return!WT()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof KT(e).ShadowRoot}function QT(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=lE(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function $T(e){return/^(table|td|th)$/.test(GT(e))}function eE(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var tE=/transform|translate|scale|rotate|perspective|filter/,nE=/paint|layout|strict|content/,rE=e=>!!e&&e!==`none`,iE;function aE(e){let t=YT(e)?lE(e):e;return rE(t.transform)||rE(t.translate)||rE(t.scale)||rE(t.rotate)||rE(t.perspective)||!sE()&&(rE(t.backdropFilter)||rE(t.filter))||tE.test(t.willChange||``)||nE.test(t.contain||``)}function oE(e){let t=dE(e);for(;XT(t)&&!cE(t);){if(aE(t))return t;if(eE(t))return null;t=dE(t)}return null}function sE(){return iE??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),iE}function cE(e){return/^(html|body|#document)$/.test(GT(e))}function lE(e){return KT(e).getComputedStyle(e)}function uE(e){return YT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function dE(e){if(GT(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ZT(e)&&e.host||qT(e);return ZT(t)?t.host:t}function fE(e){let t=dE(e);return cE(t)?e.ownerDocument?e.ownerDocument.body:e.body:XT(t)&&QT(t)?t:fE(t)}function pE(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=fE(e),i=r===e.ownerDocument?.body,a=KT(r);if(i){let e=mE(a);return t.concat(a,a.visualViewport||[],QT(r)?r:[],e&&n?pE(e):[])}else return t.concat(r,pE(r,[],n))}function mE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hE(e){let t=lE(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=XT(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=iT(n)!==a||iT(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function gE(e){return YT(e)?e:e.contextElement}function _E(e){let t=gE(e);if(!XT(t))return oT(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=hE(t),o=(a?iT(n.width):n.width)/r,s=(a?iT(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var vE=oT(0);function yE(e){let t=KT(e);return!sE()||!t.visualViewport?vE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==KT(e)?!1:t}function xE(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=gE(e),o=oT(1);t&&(r?YT(r)&&(o=_E(r)):o=_E(e));let s=bE(a,n,r)?yE(a):oT(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=KT(a),t=r&&YT(r)?KT(r):r,n=e,i=mE(n);for(;i&&r&&t!==n;){let e=_E(i),t=i.getBoundingClientRect(),r=lE(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=KT(i),i=mE(n)}}return OT({width:u,height:d,x:c,y:l})}function SE(e,t){let n=uE(e).scrollLeft;return t?t.left+n:xE(qT(e)).left+n}function CE(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-SE(e,n),y:n.top+t.scrollTop}}function wE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=qT(r),s=t?eE(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=oT(1),u=oT(0),d=XT(r);if((d||!d&&!a)&&((GT(r)!==`body`||QT(o))&&(c=uE(r)),d)){let e=xE(r);l=_E(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?CE(o,c):oT(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function TE(e){return Array.from(e.getClientRects())}function EE(e){let t=qT(e),n=uE(e),r=e.ownerDocument.body,i=rT(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=rT(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+SE(e),s=-n.scrollTop;return lE(r).direction===`rtl`&&(o+=rT(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var DE=25;function OE(e,t){let n=KT(e),r=qT(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=sE();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=SE(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=DE&&(a-=o)}else l<=DE&&(a+=l);return{width:a,height:o,x:s,y:c}}function kE(e,t){let n=xE(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=XT(e)?_E(e):oT(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function AE(e,t,n){let r;if(t===`viewport`)r=OE(e,n);else if(t===`document`)r=EE(qT(e));else if(YT(t))r=kE(t,n);else{let n=yE(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return OT(r)}function jE(e,t){let n=dE(e);return n===t||!YT(n)||cE(n)?!1:lE(n).position===`fixed`||jE(n,t)}function ME(e,t){let n=t.get(e);if(n)return n;let r=pE(e,[],!1).filter(e=>YT(e)&>(e)!==`body`),i=null,a=lE(e).position===`fixed`,o=a?dE(e):e;for(;YT(o)&&!cE(o);){let t=lE(o),n=aE(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||QT(o)&&!n&&jE(e,o))?r=r.filter(e=>e!==o):i=t,o=dE(o)}return t.set(e,r),r}function NE(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?eE(t)?[]:ME(t,this._c):[].concat(n),r],o=AE(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=AE(t,a[e],i);s=rT(n.top,s),c=nT(n.right,c),l=nT(n.bottom,l),u=rT(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function PE(e){let{width:t,height:n}=hE(e);return{width:t,height:n}}function FE(e,t,n){let r=XT(t),i=qT(t),a=n===`fixed`,o=xE(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=oT(0);function l(){c.x=SE(i)}if(r||!r&&!a)if((GT(t)!==`body`||QT(i))&&(s=uE(t)),r){let e=xE(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?CE(i,s):oT(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function IE(e){return lE(e).position===`static`}function LE(e,t){if(!XT(e)||lE(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return qT(e)===n&&(n=n.ownerDocument.body),n}function RE(e,t){let n=KT(e);if(eE(e))return n;if(!XT(e)){let t=dE(e);for(;t&&!cE(t);){if(YT(t)&&!IE(t))return t;t=dE(t)}return n}let r=LE(e,t);for(;r&&$T(r)&&IE(r);)r=LE(r,t);return r&&cE(r)&&IE(r)&&!aE(r)?n:r||oE(e)||n}var zE=async function(e){let t=this.getOffsetParent||RE,n=this.getDimensions,r=await n(e.floating);return{reference:FE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function BE(e){return lE(e).direction===`rtl`}var VE={convertOffsetParentRelativeRectToViewportRelativeRect:wE,getDocumentElement:qT,getClippingRect:NE,getOffsetParent:RE,getElementRects:zE,getClientRects:TE,getDimensions:PE,getScale:_E,isElement:YT,isRTL:BE};function HE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UE(e,t){let n=null,r,i=qT(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=aT(d),h=aT(i.clientWidth-(u+f)),g=aT(i.clientHeight-(d+p)),_=aT(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:rT(0,nT(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!HE(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function WE(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=gE(e),u=i||a?[...l?pE(l):[],...t?pE(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?UE(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?xE(e):null;c&&g();function g(){let t=xE(e);h&&!HE(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var GE=BT,KE=VT,qE=PT,JE=UT,YE=LT,XE=NT,ZE=HT,QE=(e,t,n)=>{let r=new Map,i={platform:VE,...n},a={...i.platform,_c:r};return MT(e,t,{...i,platform:a})},$E=typeof document<`u`?j.useLayoutEffect:function(){};function eD(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!eD(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!eD(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function tD(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nD(e,t){let n=tD(e);return Math.round(t*n)/n}function rD(e){let t=j.useRef(e);return $E(()=>{t.current=e}),t}function iD(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=j.useState(r);eD(f,r)||p(r);let[m,h]=j.useState(null),[g,_]=j.useState(null),v=j.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=j.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=j.useRef(null),C=j.useRef(null),w=j.useRef(u),T=c!=null,E=rD(c),D=rD(i),O=rD(l),ee=j.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),QE(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};te.current&&!eD(w.current,t)&&(w.current=t,Gi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);$E(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=j.useRef(!1);$E(()=>(te.current=!0,()=>{te.current=!1}),[]),$E(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let ne=j.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),re=j.useMemo(()=>({reference:b,floating:x}),[b,x]),ie=j.useMemo(()=>{let e={position:n,left:0,top:0};if(!re.floating)return e;let t=nD(re.floating,u.x),r=nD(re.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...tD(re.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,re.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:ee,refs:ne,elements:re,floatingStyles:ie}),[u,ee,ne,re,ie])}var aD=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:XE({element:r.current,padding:i}).fn(n):r?XE({element:r,padding:i}).fn(n):{}}}},oD=(e,t)=>{let n=GE(e);return{name:n.name,fn:n.fn,options:[e,t]}},sD=(e,t)=>{let n=KE(e);return{name:n.name,fn:n.fn,options:[e,t]}},cD=(e,t)=>({fn:ZE(e).fn,options:[e,t]}),lD=(e,t)=>{let n=qE(e);return{name:n.name,fn:n.fn,options:[e,t]}},uD=(e,t)=>{let n=JE(e);return{name:n.name,fn:n.fn,options:[e,t]}},dD=(e,t)=>{let n=YE(e);return{name:n.name,fn:n.fn,options:[e,t]}},fD=(e,t)=>{let n=aD(e);return{name:n.name,fn:n.fn,options:[e,t]}},pD=`Arrow`,mD=j.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,M.jsx)(M_.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,M.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});mD.displayName=pD;var hD=mD;function gD(e){let[t,n]=j.useState(void 0);return Z_(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var _D=`Popper`,[vD,yD]=S_(_D),[bD,xD]=vD(_D),SD=e=>{let{__scopePopper:t,children:n}=e,[r,i]=j.useState(null);return(0,M.jsx)(bD,{scope:t,anchor:r,onAnchorChange:i,children:n})};SD.displayName=_D;var CD=`PopperAnchor`,wD=j.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=xD(CD,n),o=j.useRef(null),s=b_(t,o),c=j.useRef(null);return j.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,M.jsx)(M_.div,{...i,ref:s})});wD.displayName=CD;var TD=`PopperContent`,[ED,DD]=vD(TD),OD=j.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=xD(TD,n),[_,v]=j.useState(null),y=b_(t,e=>v(e)),[b,x]=j.useState(null),S=gD(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,ee={padding:E,boundary:D.filter(MD),altBoundary:O},{refs:te,floatingStyles:ne,placement:re,isPositioned:ie,middlewareData:ae}=iD({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>WE(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[oD({mainAxis:i+w,alignmentAxis:o}),c&&sD({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?cD():void 0,...ee}),c&&lD({...ee}),uD({...ee,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&fD({element:b,padding:s}),ND({arrowWidth:C,arrowHeight:w}),f&&dD({strategy:`referenceHidden`,...ee})]}),[oe,k]=PD(re),se=P_(m);Z_(()=>{ie&&se?.()},[ie,se]);let ce=ae.arrow?.x,le=ae.arrow?.y,ue=ae.arrow?.centerOffset!==0,[A,de]=j.useState();return Z_(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),(0,M.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:ie?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:A,"--radix-popper-transform-origin":[ae.transformOrigin?.x,ae.transformOrigin?.y].join(` `),...ae.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,M.jsx)(ED,{scope:n,placedSide:oe,onArrowChange:x,arrowX:ce,arrowY:le,shouldHideArrow:ue,children:(0,M.jsx)(M_.div,{"data-side":oe,"data-align":k,...h,ref:y,style:{...h.style,animation:ie?void 0:`none`}})})})});OD.displayName=TD;var kD=`PopperArrow`,AD={top:`bottom`,right:`left`,bottom:`top`,left:`right`},jD=j.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=DD(kD,n),a=AD[i.placedSide];return(0,M.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,M.jsx)(hD,{...r,ref:t,style:{...r.style,display:`block`}})})});jD.displayName=kD;function MD(e){return e!==null}var ND=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=PD(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function PD(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var FD=SD,ID=wD,LD=OD,RD=jD,[zD,BD]=S_(`Tooltip`,[yD]),VD=yD(),HD=`TooltipProvider`,UD=700,WD=`tooltip.open`,[GD,KD]=zD(HD),qD=e=>{let{__scopeTooltip:t,delayDuration:n=UD,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=j.useRef(!0),s=j.useRef(!1),c=j.useRef(0);return j.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,M.jsx)(GD,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:j.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:j.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:j.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};qD.displayName=HD;var JD=`Tooltip`,[YD,XD]=zD(JD),ZD=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=KD(JD,e.__scopeTooltip),l=VD(t),[u,d]=j.useState(null),f=bS(),p=j.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=j.useRef(!1),[_,v]=ov({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(WD))):c.onClose(),a?.(e)},caller:JD}),y=j.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=j.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=j.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=j.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return j.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,M.jsx)(FD,{...l,children:(0,M.jsx)(YD,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:j.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:j.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};ZD.displayName=JD;var QD=`TooltipTrigger`,$D=j.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=XD(QD,n),a=KD(QD,n),o=VD(n),s=b_(t,j.useRef(null),i.onTriggerChange),c=j.useRef(!1),l=j.useRef(!1),u=j.useCallback(()=>c.current=!1,[]);return j.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,M.jsx)(ID,{asChild:!0,...o,children:(0,M.jsx)(M_.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:q(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:q(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:q(e.onBlur,i.onClose),onClick:q(e.onClick,i.onClose)})})});$D.displayName=QD;var eO=`TooltipPortal`,[tO,nO]=zD(eO,{forceMount:void 0}),rO=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=XD(eO,t);return(0,M.jsx)(tO,{scope:t,forceMount:n,children:(0,M.jsx)(tv,{present:n||a.open,children:(0,M.jsx)($_,{asChild:!0,container:i,children:r})})})};rO.displayName=eO;var iO=`TooltipContent`,aO=j.forwardRef((e,t)=>{let n=nO(iO,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=XD(iO,e.__scopeTooltip);return(0,M.jsx)(tv,{present:r||o.open,children:o.disableHoverableContent?(0,M.jsx)(uO,{side:i,...a,ref:t}):(0,M.jsx)(oO,{side:i,...a,ref:t})})}),oO=j.forwardRef((e,t)=>{let n=XD(iO,e.__scopeTooltip),r=KD(iO,e.__scopeTooltip),i=j.useRef(null),a=b_(t,i),[o,s]=j.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=j.useCallback(()=>{s(null),d(!1)},[d]),p=j.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=mO(r,pO(r,n.getBoundingClientRect())),a=hO(t.getBoundingClientRect());s(_O([...i,...a])),d(!0)},[d]);return j.useEffect(()=>()=>f(),[f]),j.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),j.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!gO(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,M.jsx)(uO,{...e,ref:a})}),[sO,cO]=zD(JD,{isInside:!1}),lO=D_(`TooltipContent`),uO=j.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=XD(iO,n),l=VD(n),{onClose:u}=c;return j.useEffect(()=>(document.addEventListener(WD,u),()=>document.removeEventListener(WD,u)),[u]),j.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,M.jsx)(H_,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,M.jsxs)(LD,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,M.jsx)(lO,{children:r}),(0,M.jsx)(sO,{scope:n,isInside:!0,children:(0,M.jsx)(fv,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});aO.displayName=iO;var dO=`TooltipArrow`,fO=j.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=VD(n);return cO(dO,n).isInside?null:(0,M.jsx)(RD,{...i,...r,ref:t})});fO.displayName=dO;function pO(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function mO(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function hO(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function gO(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function _O(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),vO(t)}function vO(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var yO=qD,bO=ZD,xO=$D,SO=aO,CO=yO,wO=bO,TO=xO,EO=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,M.jsx)(SO,{ref:r,sideOffset:t,className:Z(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n}));EO.displayName=SO.displayName;var DO=`sidebar_state`,OO=3600*24*7,kO=`16rem`,AO=`18rem`,jO=`3rem`,MO=`b`,NO=j.createContext(null);function PO(){let e=j.useContext(NO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider`);return e}var FO=j.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=sS(),[l,u]=j.useState(!1),[d,f]=j.useState(e),p=t??d,m=j.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${DO}=${t}; path=/; max-age=${OO}`},[n,p]),h=j.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);j.useEffect(()=>{let e=e=>{e.key===MO&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=j.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,M.jsx)(NO.Provider,{value:_,children:(0,M.jsx)(CO,{delayDuration:0,children:(0,M.jsx)(`div`,{style:{"--sidebar-width":kO,"--sidebar-width-icon":jO,...i},className:Z(`group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-0 w-full`,r),ref:s,...o,children:a})})})});FO.displayName=`SidebarProvider`;var IO=j.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=PO();return n===`none`?(0,M.jsx)(`div`,{className:Z(`bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col`,r),ref:o,...a,children:i}):s?(0,M.jsx)(Gw,{open:l,onOpenChange:u,...a,children:(0,M.jsx)(Yw,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden`,style:{"--sidebar-width":AO},side:e,children:(0,M.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})})}):(0,M.jsx)(`div`,{ref:o,className:Z(`bg-sidebar text-sidebar-foreground hidden md:flex h-svh w-[var(--sidebar-width)] shrink-0 flex-col border-r transition-[width] duration-200 ease-linear overflow-hidden`,c===`collapsed`&&n===`offcanvas`&&`w-0 border-0`,c===`collapsed`&&n===`icon`&&`w-[var(--sidebar-width-icon)]`,r),"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,...a,children:i})});IO.displayName=`Sidebar`;var LO=j.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=PO();return(0,M.jsxs)(Q,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:Z(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,M.jsx)(Yy,{}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});LO.displayName=`SidebarTrigger`;var RO=j.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=PO();return(0,M.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:Z(`hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});RO.displayName=`SidebarRail`;var zO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`main`,{ref:n,className:Z(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));zO.displayName=`SidebarInset`;var BO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(lS,{ref:n,"data-sidebar":`input`,className:Z(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));BO.displayName=`SidebarInput`;var VO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:Z(`flex flex-col gap-2 p-2`,e),...t}));VO.displayName=`SidebarHeader`;var HO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:Z(`flex flex-col gap-2 p-2`,e),...t}));HO.displayName=`SidebarFooter`;var UO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(_S,{ref:n,"data-sidebar":`separator`,className:Z(`mx-2 w-auto bg-sidebar-border`,e),...t}));UO.displayName=`SidebarSeparator`;var WO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:Z(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,e),...t}));WO.displayName=`SidebarContent`;var GO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:Z(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));GO.displayName=`SidebarGroup`;var KO=j.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,M.jsx)(t?eS:`div`,{ref:r,"data-sidebar":`group-label`,className:Z(`text-xs/6 font-medium text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 [[data-collapsible=icon]_&]:-mt-8 [[data-collapsible=icon]_&]:opacity-0 [[data-collapsible=icon]_&]:overflow-hidden`,e),...n}));KO.displayName=`SidebarGroupLabel`;var qO=j.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,M.jsx)(t?eS:`button`,{ref:r,"data-sidebar":`group-action`,className:Z(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));qO.displayName=`SidebarGroupAction`;var JO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:Z(`w-full text-sm`,e),...t}));JO.displayName=`SidebarGroupContent`;var YO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:Z(`flex w-full min-w-0 flex-col gap-1`,e),...t}));YO.displayName=`SidebarMenu`;var XO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:Z(`group/menu-item relative`,e),...t}));XO.displayName=`SidebarMenuItem`;var ZO=j.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?eS:`button`,{isMobile:l,state:u}=PO(),d=(0,M.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:Z(QO({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,M.jsxs)(wO,{children:[(0,M.jsx)(TO,{asChild:!0,children:d}),(0,M.jsx)(EO,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]})):d});ZO.displayName=`SidebarMenuButton`;var QO=fy(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),$O=j.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,M.jsx)(t?eS:`button`,{ref:i,"data-sidebar":`menu-action`,className:Z(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));$O.displayName=`SidebarMenuAction`;var ek=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:Z(`text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));ek.displayName=`SidebarMenuBadge`;var tk=j.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=j.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,M.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:Z(`rounded-md h-8 flex gap-2 px-2 items-center`,e),...n,children:[t&&(0,M.jsx)(eT,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,M.jsx)(eT,{className:`h-4 flex-1 max-w-[var(--skeleton-width)]`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});tk.displayName=`SidebarMenuSkeleton`;var nk=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:Z(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));nk.displayName=`SidebarMenuSub`;var rk=j.forwardRef(({...e},t)=>(0,M.jsx)(`li`,{ref:t,...e}));rk.displayName=`SidebarMenuSubItem`;var ik=j.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,M.jsx)(e?eS:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:Z(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,r),...i}));ik.displayName=`SidebarMenuSubButton`;var ak=fy(`text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5`),ok=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`nav`,{ref:n,"aria-label":`breadcrumb`,className:Z(ak(),e),...t}));ok.displayName=`Breadcrumb`;var sk=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ol`,{ref:n,className:Z(`text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5`,e),...t}));sk.displayName=`BreadcrumbList`;var ck=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`li`,{ref:n,className:Z(`inline-flex items-center gap-1.5`,e),...t}));ck.displayName=`BreadcrumbItem`;var lk=j.forwardRef(({asChild:e,className:t,...n},r)=>(0,M.jsx)(e?eS:`a`,{ref:r,className:Z(`hover:text-foreground transition-colors`,t),...n}));lk.displayName=`BreadcrumbLink`;var uk=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:Z(`text-foreground font-normal`,e),...t}));uk.displayName=`BreadcrumbPage`;var dk=({children:e,className:t,...n})=>(0,M.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:Z(`[&>svg]:size-3.5`,t),...n,children:e??(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:(0,M.jsx)(`path`,{d:`m9 18 6-6-6-6`})})});dk.displayName=`BreadcrumbSeparator`;var fk=({className:e,...t})=>(0,M.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:Z(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,M.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,M.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1`}),(0,M.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1`})]}),(0,M.jsx)(`span`,{className:`sr-only`,children:`More`})]});fk.displayName=`BreadcrumbElipssis`;var pk=j.createContext(void 0);function mk(e){let t=j.useContext(pk);return e||t||`ltr`}var hk=`rovingFocusGroup.onEntryFocus`,gk={bubbles:!1,cancelable:!0},_k=`RovingFocusGroup`,[vk,yk,bk]=j_(_k),[xk,Sk]=S_(_k,[bk]),[Ck,wk]=xk(_k),Tk=j.forwardRef((e,t)=>(0,M.jsx)(vk.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(vk.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(Ek,{...e,ref:t})})}));Tk.displayName=_k;var Ek=j.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=j.useRef(null),p=b_(t,f),m=mk(a),[h,g]=ov({prop:o,defaultProp:s??null,onChange:c,caller:_k}),[_,v]=j.useState(!1),y=P_(l),b=yk(n),x=j.useRef(!1),[S,C]=j.useState(0);return j.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(hk,y),()=>e.removeEventListener(hk,y)},[y]),(0,M.jsx)(Ck,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:j.useCallback(e=>g(e),[g]),onItemShiftTab:j.useCallback(()=>v(!0),[]),onFocusableItemAdd:j.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:j.useCallback(()=>C(e=>e-1),[]),children:(0,M.jsx)(M_.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:q(e.onMouseDown,()=>{x.current=!0}),onFocus:q(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(hk,gk);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Mk([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:q(e.onBlur,()=>v(!1))})})}),Dk=`RovingFocusGroupItem`,Ok=j.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=bS(),l=a||c,u=wk(Dk,n),d=u.currentTabStopId===l,f=yk(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return j.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,M.jsx)(vk.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,M.jsx)(M_.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=jk(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Nk(n,r+1):n.slice(r+1)}setTimeout(()=>Mk(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ok.displayName=Dk;var kk={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ak(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function jk(e,t,n){let r=Ak(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return kk[r]}function Mk(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Nk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pk=Tk,Fk=Ok,Ik=[`Enter`,` `],Lk=[`ArrowDown`,`PageUp`,`Home`],Rk=[`ArrowUp`,`PageDown`,`End`],zk=[...Lk,...Rk],Bk={ltr:[...Ik,`ArrowRight`],rtl:[...Ik,`ArrowLeft`]},Vk={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Hk=`Menu`,[Uk,Wk,Gk]=j_(Hk),[Kk,qk]=S_(Hk,[Gk,yD,Sk]),Jk=yD(),Yk=Sk(),[Xk,Zk]=Kk(Hk),[Qk,$k]=Kk(Hk),eA=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Jk(t),[c,l]=j.useState(null),u=j.useRef(!1),d=P_(a),f=mk(i);return j.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,M.jsx)(FD,{...s,children:(0,M.jsx)(Xk,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,M.jsx)(Qk,{scope:t,onClose:j.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};eA.displayName=Hk;var tA=`MenuAnchor`,nA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Jk(n);return(0,M.jsx)(ID,{...i,...r,ref:t})});nA.displayName=tA;var rA=`MenuPortal`,[iA,aA]=Kk(rA,{forceMount:void 0}),oA=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Zk(rA,t);return(0,M.jsx)(iA,{scope:t,forceMount:n,children:(0,M.jsx)(tv,{present:n||a.open,children:(0,M.jsx)($_,{asChild:!0,container:i,children:r})})})};oA.displayName=rA;var sA=`MenuContent`,[cA,lA]=Kk(sA),uA=j.forwardRef((e,t)=>{let n=aA(sA,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Zk(sA,e.__scopeMenu),o=$k(sA,e.__scopeMenu);return(0,M.jsx)(Uk.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(tv,{present:r||a.open,children:(0,M.jsx)(Uk.Slot,{scope:e.__scopeMenu,children:o.modal?(0,M.jsx)(dA,{...i,ref:t}):(0,M.jsx)(fA,{...i,ref:t})})})})}),dA=j.forwardRef((e,t)=>{let n=Zk(sA,e.__scopeMenu),r=j.useRef(null),i=b_(t,r);return j.useEffect(()=>{let e=r.current;if(e)return rw(e)},[]),(0,M.jsx)(mA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),fA=j.forwardRef((e,t)=>{let n=Zk(sA,e.__scopeMenu);return(0,M.jsx)(mA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pA=w_(`MenuContent.ScrollLock`),mA=j.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Zk(sA,n),_=$k(sA,n),v=Jk(n),y=Yk(n),b=Wk(n),[x,S]=j.useState(null),C=j.useRef(null),w=b_(t,C,g.onContentChange),T=j.useRef(0),E=j.useRef(``),D=j.useRef(0),O=j.useRef(null),ee=j.useRef(`right`),te=j.useRef(0),ne=m?JC:j.Fragment,re=m?{as:pA,allowPinchZoom:!0}:void 0,ie=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=QA(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};j.useEffect(()=>()=>window.clearTimeout(T.current),[]),RS();let ae=j.useCallback(e=>ee.current===O.current?.side&&ej(e,O.current?.area),[]);return(0,M.jsx)(cA,{scope:n,searchRef:E,onItemEnter:j.useCallback(e=>{ae(e)&&e.preventDefault()},[ae]),onItemLeave:j.useCallback(e=>{ae(e)||(C.current?.focus(),S(null))},[ae]),onTriggerLeave:j.useCallback(e=>{ae(e)&&e.preventDefault()},[ae]),pointerGraceTimerRef:D,onPointerGraceIntentChange:j.useCallback(e=>{O.current=e},[]),children:(0,M.jsx)(ne,{...re,children:(0,M.jsx)(TS,{asChild:!0,trapped:i,onMountAutoFocus:q(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,M.jsx)(H_,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,M.jsx)(Pk,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:q(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,M.jsx)(LD,{role:`menu`,"aria-orientation":`vertical`,"data-state":qA(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:q(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ie(e.key));let i=C.current;if(e.target!==i||!zk.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);Rk.includes(e.key)&&a.reverse(),XA(a)}),onBlur:q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:q(e.onPointerMove,tj(e=>{let t=e.target,n=te.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ee.current=e.clientX>te.current?`right`:`left`,te.current=e.clientX)}))})})})})})})});uA.displayName=sA;var hA=`MenuGroup`,gA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,M.jsx)(M_.div,{role:`group`,...r,ref:t})});gA.displayName=hA;var _A=`MenuLabel`,vA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,M.jsx)(M_.div,{...r,ref:t})});vA.displayName=_A;var yA=`MenuItem`,bA=`menu.itemSelect`,xA=j.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=j.useRef(null),o=$k(yA,e.__scopeMenu),s=lA(yA,e.__scopeMenu),c=b_(t,a),l=j.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(bA,{bubbles:!0,cancelable:!0});e.addEventListener(bA,e=>r?.(e),{once:!0}),N_(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,M.jsx)(SA,{...i,ref:c,disabled:n,onClick:q(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:q(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:q(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Ik.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});xA.displayName=yA;var SA=j.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=lA(yA,n),s=Yk(n),c=j.useRef(null),l=b_(t,c),[u,d]=j.useState(!1),[f,p]=j.useState(``);return j.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,M.jsx)(Uk.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,M.jsx)(Fk,{asChild:!0,...s,focusable:!r,children:(0,M.jsx)(M_.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:q(e.onPointerMove,tj(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,tj(e=>o.onItemLeave(e))),onFocus:q(e.onFocus,()=>d(!0)),onBlur:q(e.onBlur,()=>d(!1))})})})}),CA=`MenuCheckboxItem`,wA=j.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,M.jsx)(MA,{scope:e.__scopeMenu,checked:n,children:(0,M.jsx)(xA,{role:`menuitemcheckbox`,"aria-checked":JA(n)?`mixed`:n,...i,ref:t,"data-state":YA(n),onSelect:q(i.onSelect,()=>r?.(JA(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wA.displayName=CA;var TA=`MenuRadioGroup`,[EA,DA]=Kk(TA,{value:void 0,onValueChange:()=>{}}),OA=j.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=P_(r);return(0,M.jsx)(EA,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,M.jsx)(gA,{...i,ref:t})})});OA.displayName=TA;var kA=`MenuRadioItem`,AA=j.forwardRef((e,t)=>{let{value:n,...r}=e,i=DA(kA,e.__scopeMenu),a=n===i.value;return(0,M.jsx)(MA,{scope:e.__scopeMenu,checked:a,children:(0,M.jsx)(xA,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":YA(a),onSelect:q(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});AA.displayName=kA;var jA=`MenuItemIndicator`,[MA,NA]=Kk(jA,{checked:!1}),PA=j.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=NA(jA,n);return(0,M.jsx)(tv,{present:r||JA(a.checked)||a.checked===!0,children:(0,M.jsx)(M_.span,{...i,ref:t,"data-state":YA(a.checked)})})});PA.displayName=jA;var FA=`MenuSeparator`,IA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,M.jsx)(M_.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});IA.displayName=FA;var LA=`MenuArrow`,RA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Jk(n);return(0,M.jsx)(RD,{...i,...r,ref:t})});RA.displayName=LA;var zA=`MenuSub`,[BA,VA]=Kk(zA),HA=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Zk(zA,t),o=Jk(t),[s,c]=j.useState(null),[l,u]=j.useState(null),d=P_(i);return j.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,M.jsx)(FD,{...o,children:(0,M.jsx)(Xk,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,M.jsx)(BA,{scope:t,contentId:bS(),triggerId:bS(),trigger:s,onTriggerChange:c,children:n})})})};HA.displayName=zA;var UA=`MenuSubTrigger`,WA=j.forwardRef((e,t)=>{let n=Zk(UA,e.__scopeMenu),r=$k(UA,e.__scopeMenu),i=VA(UA,e.__scopeMenu),a=lA(UA,e.__scopeMenu),o=j.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=j.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return j.useEffect(()=>u,[u]),j.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,M.jsx)(nA,{asChild:!0,...l,children:(0,M.jsx)(SA,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":qA(n.open),...e,ref:y_(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:q(e.onPointerMove,tj(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:q(e.onPointerLeave,tj(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:q(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Bk[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});WA.displayName=UA;var GA=`MenuSubContent`,KA=j.forwardRef((e,t)=>{let n=aA(sA,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Zk(sA,e.__scopeMenu),o=$k(sA,e.__scopeMenu),s=VA(GA,e.__scopeMenu),c=j.useRef(null),l=b_(t,c);return(0,M.jsx)(Uk.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(tv,{present:r||a.open,children:(0,M.jsx)(Uk.Slot,{scope:e.__scopeMenu,children:(0,M.jsx)(mA,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:q(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:q(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:q(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Vk[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});KA.displayName=GA;function qA(e){return e?`open`:`closed`}function JA(e){return e===`indeterminate`}function YA(e){return JA(e)?`indeterminate`:e?`checked`:`unchecked`}function XA(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ZA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QA(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ZA(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function $A(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ej(e,t){return t?$A({x:e.clientX,y:e.clientY},t):!1}function tj(e){return t=>t.pointerType===`mouse`?e(t):void 0}var nj=eA,rj=nA,ij=oA,aj=uA,oj=gA,sj=vA,cj=xA,lj=wA,uj=OA,dj=AA,fj=PA,pj=IA,mj=RA,hj=WA,gj=KA,_j=`DropdownMenu`,[vj,yj]=S_(_j,[qk]),bj=qk(),[xj,Sj]=vj(_j),Cj=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=bj(t),l=j.useRef(null),[u,d]=ov({prop:i,defaultProp:a??!1,onChange:o,caller:_j});return(0,M.jsx)(xj,{scope:t,triggerId:bS(),triggerRef:l,contentId:bS(),open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,M.jsx)(nj,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Cj.displayName=_j;var wj=`DropdownMenuTrigger`,Tj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Sj(wj,n),o=bj(n);return(0,M.jsx)(rj,{asChild:!0,...o,children:(0,M.jsx)(M_.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:y_(t,a.triggerRef),onPointerDown:q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Tj.displayName=wj;var Ej=`DropdownMenuPortal`,Dj=e=>{let{__scopeDropdownMenu:t,...n}=e,r=bj(t);return(0,M.jsx)(ij,{...r,...n})};Dj.displayName=Ej;var Oj=`DropdownMenuContent`,kj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Sj(Oj,n),a=bj(n),o=j.useRef(!1);return(0,M.jsx)(aj,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:q(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});kj.displayName=Oj;var Aj=`DropdownMenuGroup`,jj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(oj,{...i,...r,ref:t})});jj.displayName=Aj;var Mj=`DropdownMenuLabel`,Nj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(sj,{...i,...r,ref:t})});Nj.displayName=Mj;var Pj=`DropdownMenuItem`,Fj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(cj,{...i,...r,ref:t})});Fj.displayName=Pj;var Ij=`DropdownMenuCheckboxItem`,Lj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(lj,{...i,...r,ref:t})});Lj.displayName=Ij;var Rj=`DropdownMenuRadioGroup`,zj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(uj,{...i,...r,ref:t})});zj.displayName=Rj;var Bj=`DropdownMenuRadioItem`,Vj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(dj,{...i,...r,ref:t})});Vj.displayName=Bj;var Hj=`DropdownMenuItemIndicator`,Uj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(fj,{...i,...r,ref:t})});Uj.displayName=Hj;var Wj=`DropdownMenuSeparator`,Gj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(pj,{...i,...r,ref:t})});Gj.displayName=Wj;var Kj=`DropdownMenuArrow`,qj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(mj,{...i,...r,ref:t})});qj.displayName=Kj;var Jj=`DropdownMenuSubTrigger`,Yj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(hj,{...i,...r,ref:t})});Yj.displayName=Jj;var Xj=`DropdownMenuSubContent`,Zj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=bj(n);return(0,M.jsx)(gj,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Zj.displayName=Xj;var Qj=Cj,$j=Tj,eM=Dj,tM=kj,nM=Nj,rM=Fj,iM=Lj,aM=Vj,oM=Uj,sM=Gj,cM=Yj,lM=Zj,uM=Qj,dM=$j,fM=j.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,M.jsxs)(cM,{ref:i,className:Z(`flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,M.jsx)(Ey,{className:`ml-auto`})]}));fM.displayName=cM.displayName;var pM=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(lM,{ref:n,className:Z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));pM.displayName=lM.displayName;var mM=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,M.jsx)(eM,{children:(0,M.jsx)(tM,{ref:r,sideOffset:t,className:Z(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));mM.displayName=tM.displayName;var hM=j.forwardRef(({className:e,inset:t,...n},r)=>(0,M.jsx)(rM,{ref:r,className:Z(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));hM.displayName=rM.displayName;var gM=j.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,M.jsxs)(iM,{ref:i,className:Z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,M.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,M.jsx)(oM,{children:(0,M.jsx)(wy,{className:`h-4 w-4`})})}),t]}));gM.displayName=iM.displayName;var _M=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(aM,{ref:r,className:Z(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,M.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,M.jsx)(oM,{children:(0,M.jsx)(My,{className:`h-2 w-2 fill-current`})})}),t]}));_M.displayName=aM.displayName;var vM=j.forwardRef(({className:e,inset:t,...n},r)=>(0,M.jsx)(nM,{ref:r,className:Z(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));vM.displayName=nM.displayName;var yM=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(sM,{ref:n,className:Z(`-mx-1 my-1 h-px bg-muted`,e),...t}));yM.displayName=sM.displayName;var bM=({className:e,...t})=>(0,M.jsx)(`span`,{className:Z(`ml-auto text-xs tracking-widest opacity-60`,e),...t});bM.displayName=`DropdownMenuShortcut`;var xM=`modulepreload`,SM=function(e){return`/_account/`+e},CM={},wM=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=SM(t,n),t in CM)return;CM[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:xM,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},TM=[`en`,`zh-CN`],EM={en:()=>wM(()=>import(`./en-QM3gmMOi.js`),[]),"zh-CN":()=>wM(()=>import(`./zh-CN-B0Jn4kQl.js`),[])};function DM(e){return TM.includes(e)?e:e.toLowerCase().startsWith(`zh`)?`zh-CN`:`en`}async function OM(e){let t=DM(e);try{return(await EM[t]()).default}catch(t){return console.warn(`[account/i18n] Failed to load language pack '${e}':`,t),{}}}var kM={en:`English`,"zh-CN":`中文`};function AM(){let{t:e,language:t,changeLanguage:n}=vt();async function r(e){await n(e);try{localStorage.setItem(`account.lang`,e)}catch{}}return(0,M.jsxs)(uM,{children:[(0,M.jsx)(dM,{asChild:!0,children:(0,M.jsxs)(Q,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":e(`common.language`),children:[(0,M.jsx)(Vy,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:e(`common.language`)})]})}),(0,M.jsx)(mM,{align:`end`,children:TM.map(e=>(0,M.jsx)(hM,{onSelect:()=>void r(e),className:e===t?`font-medium`:void 0,children:kM[e]},e))})]})}function jM(e){let t=document.documentElement;e===`dark`?t.classList.add(`dark`):t.classList.remove(`dark`)}function MM(){let{t:e}=vt(),[,t]=(0,j.useState)(`light`);(0,j.useEffect)(()=>{let e=localStorage.getItem(`theme`);e?(t(e),jM(e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e)):(t(`system`),jM(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`))},[]);function n(e){t(e),localStorage.setItem(`theme`,e),jM(e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e)}return(0,M.jsxs)(uM,{children:[(0,M.jsx)(dM,{asChild:!0,children:(0,M.jsxs)(Q,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:[(0,M.jsx)(rb,{className:`h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,M.jsx)(Jy,{className:`absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`}),(0,M.jsx)(`span`,{className:`sr-only`,children:e(`common.toggleTheme`)})]})}),(0,M.jsxs)(mM,{align:`end`,children:[(0,M.jsxs)(hM,{onClick:()=>n(`light`),children:[(0,M.jsx)(rb,{className:`mr-2 h-4 w-4`}),e(`common.light`)]}),(0,M.jsxs)(hM,{onClick:()=>n(`dark`),children:[(0,M.jsx)(Jy,{className:`mr-2 h-4 w-4`}),e(`common.dark`)]}),(0,M.jsx)(hM,{onClick:()=>n(`system`),children:e(`common.system`)})]})]})}function NM(e,t=[]){let n=[];function r(t,r){let i=j.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=j.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=j.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>j.createContext(e));return function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,PM(i,...t)]}function PM(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function FM(){return(0,ot.useSyncExternalStore)(IM,()=>!0,()=>!1)}function IM(){return()=>{}}var LM=`Avatar`,[RM,zM]=NM(LM),[BM,VM]=RM(LM),HM=j.forwardRef((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,a]=j.useState(`idle`);return(0,M.jsx)(BM,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:(0,M.jsx)(uS.span,{...r,ref:t})})});HM.displayName=LM;var UM=`AvatarImage`,WM=j.forwardRef((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=VM(UM,n),s=JM(r,a),c=P_(e=>{i(e),o.onImageLoadingStatusChange(e)});return Z_(()=>{s!==`idle`&&c(s)},[s,c]),s===`loaded`?(0,M.jsx)(uS.img,{...a,ref:t,src:r}):null});WM.displayName=UM;var GM=`AvatarFallback`,KM=j.forwardRef((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,a=VM(GM,n),[o,s]=j.useState(r===void 0);return j.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,M.jsx)(uS.span,{...i,ref:t}):null});KM.displayName=GM;function qM(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function JM(e,{referrerPolicy:t,crossOrigin:n}){let r=FM(),i=j.useRef(null),a=r?(i.current||=new window.Image,i.current):null,[o,s]=j.useState(()=>qM(a,e));return Z_(()=>{s(qM(a,e))},[a,e]),Z_(()=>{let e=e=>()=>{s(e)};if(!a)return;let r=e(`loaded`),i=e(`error`);return a.addEventListener(`load`,r),a.addEventListener(`error`,i),t&&(a.referrerPolicy=t),typeof n==`string`&&(a.crossOrigin=n),()=>{a.removeEventListener(`load`,r),a.removeEventListener(`error`,i)}},[a,n,t]),o}var YM=HM,XM=WM,ZM=KM,QM=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(YM,{ref:n,className:Z(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));QM.displayName=YM.displayName;var $M=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(XM,{ref:n,className:Z(`aspect-square h-full w-full`,e),...t}));$M.displayName=XM.displayName;var eN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(ZM,{ref:n,className:Z(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));eN.displayName=ZM.displayName;var tN=(0,j.createContext)(null),nN=`auth-session-token`,rN=`auth-active-organization-id`;function iN(e){if(!(typeof window>`u`))try{e?.token?localStorage.setItem(nN,e.token):localStorage.removeItem(nN),e?.activeOrganizationId?localStorage.setItem(rN,e.activeOrganizationId):localStorage.removeItem(rN)}catch{}}function aN(e){if(!e)return{user:null,session:null};let t=e.data===void 0?e:e.data;return t?{user:t.user??null,session:t.session??null}:{user:null,session:null}}function oN({children:e}){let t=o_(),[n,r]=(0,j.useState)(null),[i,a]=(0,j.useState)(null),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(null),[u,d]=(0,j.useState)([]),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(!1),[g,_]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!t?.auth?.getConfig)return;let e=!1;return t.auth.getConfig().then(t=>{if(e)return;let n=t?.data??t??{},r={...n.features??{}};n.emailPassword?.disableSignUp===!0&&(r.signUpDisabled=!0),_(r)}).catch(()=>{e||_(null)}),()=>{e=!0}},[t]);let v=(0,j.useCallback)(async()=>{if(t?.organizations){p(!0);try{d((await t.organizations.list())?.organizations??[])}catch{d([])}finally{p(!1),h(!0)}}},[t]),y=(0,j.useCallback)(async()=>{if(t?.auth){s(!0),l(null);try{let{user:e,session:n}=aN(await t.auth.me());r(e),a(n),iN(e?n:null)}catch(e){l(e),r(null),a(null),iN(null)}finally{s(!1)}}},[t]);(0,j.useEffect)(()=>{y()},[y]),(0,j.useEffect)(()=>{n?v():(d([]),h(!1))},[n,v]);let b=(0,j.useCallback)(async()=>{if(t?.auth)try{await t.auth.logout()}finally{r(null),a(null),d([]),h(!1),iN(null)}},[t]),x=(0,j.useCallback)(async e=>{if(t?.organizations){await t.organizations.setActive(e),await y();try{localStorage.setItem(rN,e)}catch{}}},[t,y]),S=(0,j.useMemo)(()=>({user:n,session:i,loading:o,error:c,refresh:y,logout:b,setActiveOrganization:x,organizations:u,organizationsLoading:f,organizationsFetched:m,reloadOrganizations:v,features:g}),[n,i,o,c,y,b,x,u,f,m,v,g]);return(0,j.createElement)(tN.Provider,{value:S},e)}function sN(){let e=(0,j.useContext)(tN);if(!e)throw Error(`useSession must be used inside <SessionProvider>.`);return e}function cN(){let{organizations:e,organizationsLoading:t,reloadOrganizations:n}=sN();return{organizations:e,loading:t,error:null,reload:n}}function lN(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null);return{create:(0,j.useCallback)(async t=>{if(!e?.organizations)throw Error(`Client not ready`);n(!0),i(null);try{return await e.organizations.create(t)}catch(e){throw i(e),e}finally{n(!1)}},[e]),creating:t,error:r}}function uN(){let e=o_(),{reloadOrganizations:t,refresh:n}=sN(),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null);return{update:(0,j.useCallback)(async(r,a)=>{if(!e?.organizations?.update)throw Error(`Client not ready`);i(!0),o(null);try{let i=await e.organizations.update(r,a);return await t(),await n(),i}catch(e){throw o(e),e}finally{i(!1)}},[e,t,n]),updating:r,error:a}}function dN(){let e=o_(),{reloadOrganizations:t,refresh:n}=sN(),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null);return{remove:(0,j.useCallback)(async r=>{if(!e?.organizations?.delete)throw Error(`Client not ready`);i(!0),o(null);try{let i=await e.organizations.delete(r);return await t(),await n(),i}catch(e){throw o(e),e}finally{i(!1)}},[e,t,n]),deleting:r,error:a}}function fN({message:e}){return typeof document>`u`?null:(0,Gi.createPortal)((0,M.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm`,children:(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-8 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:e})]})}),document.body)}function pN(e,t){let n=(e||t||`?`).trim(),r=n.split(/\s+/);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():n.slice(0,2).toUpperCase()}function mN(){let{t:e}=vt(),t=Hi(),{user:n,loading:r,logout:i}=sN(),[a,o]=(0,j.useState)(!1);return r&&!n?(0,M.jsx)(`div`,{className:`h-8 w-8 animate-pulse rounded-full bg-muted`,"aria-hidden":!0}):n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(uM,{children:[(0,M.jsx)(dM,{asChild:!0,children:(0,M.jsx)(Q,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,children:(0,M.jsxs)(QM,{className:`h-7 w-7`,children:[n.image?(0,M.jsx)($M,{src:n.image,alt:n.name??n.email??e(`userMenu.user`)}):null,(0,M.jsx)(eN,{className:`text-[11px]`,children:pN(n.name,n.email)})]})})}),(0,M.jsxs)(mM,{align:`end`,className:`w-64`,children:[(0,M.jsx)(vM,{children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,M.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.name||n.email}),n.email&&(0,M.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:n.email})]})}),(0,M.jsx)(yM,{}),(0,M.jsxs)(hM,{onSelect:()=>t({to:`/account`}),children:[(0,M.jsx)(db,{className:`mr-2 h-3.5 w-3.5`}),e(`userMenu.account`)]}),(0,M.jsxs)(hM,{onSelect:()=>t({to:`/organizations`}),children:[(0,M.jsx)(Cy,{className:`mr-2 h-3.5 w-3.5`}),e(`userMenu.organizations`)]}),(0,M.jsx)(yM,{}),(0,M.jsxs)(hM,{onSelect:async()=>{o(!0);try{await i()}finally{window.location.assign(`/_account/login`)}},disabled:a,children:[(0,M.jsx)(Wy,{className:`mr-2 h-3.5 w-3.5`}),e(`userMenu.signOut`)]})]})]}),a?(0,M.jsx)(fN,{message:e(`auth.userMenu.signingOut`,{defaultValue:`Signing you out…`})}):null]}):(0,M.jsx)(Q,{variant:`outline`,size:`sm`,className:`h-8`,onClick:()=>t({to:`/login`}),children:e(`userMenu.signIn`)})}function hN(){let{t:e}=vt(),t=Hi(),n=Oa(),{organizations:r,loading:i,reload:a}=cN(),{session:o,setActiveOrganization:s}=sN(),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(!1),f=o?.activeOrganizationId??void 0,p=(0,j.useMemo)(()=>r.find(e=>e.id===f)??null,[r,f]),m=async r=>{if(l(!1),r===f){t({to:`/organizations/$orgId/general`,params:{orgId:r}});return}d(!0);try{await s(r),await a(),K({title:e(`organizations.general.switched`)});let i=n.pathname.match(/^\/organizations\/[^/]+\/(general|members)\/?$/);t({to:(i?i[1]:`general`)===`members`?`/organizations/$orgId/members`:`/organizations/$orgId/general`,params:{orgId:r}})}catch(t){K({title:e(`organizations.switchFailed`),description:t.message,variant:`destructive`})}finally{d(!1)}};return(0,M.jsxs)(uM,{open:c,onOpenChange:l,children:[(0,M.jsx)(dM,{asChild:!0,children:(0,M.jsxs)(Q,{variant:`ghost`,size:`sm`,className:`h-8 gap-2 px-2 text-sm font-medium`,disabled:u,children:[p?(0,M.jsx)(`span`,{className:`max-w-[160px] truncate`,children:p.name}):(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(i?`organizations.loading`:`organizationSwitcher.select`)}),(0,M.jsx)(Oy,{className:`h-3 w-3 opacity-50`})]})}),(0,M.jsxs)(mM,{align:`start`,className:`w-[280px]`,sideOffset:4,children:[(0,M.jsx)(vM,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:e(`organizations.title`)}),r.length===0&&!i&&(0,M.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:e(`organizations.emptyTitle`)}),r.map(e=>(0,M.jsxs)(hM,{onSelect:t=>{t.preventDefault(),m(e.id)},className:`flex items-center gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,M.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),e.slug&&(0,M.jsx)(`code`,{className:`text-[11px] text-muted-foreground font-mono`,children:e.slug})]}),e.id===f&&(0,M.jsx)(wy,{className:`h-3.5 w-3.5 text-primary`})]},e.id)),(0,M.jsx)(yM,{}),(0,M.jsxs)(hM,{onSelect:e=>{e.preventDefault(),l(!1),t({to:`/organizations/new`})},className:`gap-2 text-sm`,children:[(0,M.jsx)(Xy,{className:`h-3.5 w-3.5`}),e(`organizationSwitcher.new`)]}),(0,M.jsx)(hM,{onSelect:e=>{e.preventDefault(),l(!1),t({to:`/organizations`})},className:`gap-2 text-sm text-muted-foreground`,children:e(`organizationSwitcher.manage`)})]})]})}function gN({label:e}){return(0,M.jsx)(`a`,{href:`/`,className:`flex h-8 w-8 items-center justify-center rounded-md bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30 ring-1 ring-white/15 transition-transform hover:scale-105`,"aria-label":e,children:(0,M.jsx)(Ay,{className:`h-4 w-4`})})}function _N(){return(0,M.jsx)(Ey,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground/50`})}function vN(){let{t:e}=vt(),t=Oa(),n=Bi({strict:!1}),r=(0,j.useMemo)(()=>{let r=t.pathname,i=t=>e(`topBar.breadcrumb.${t}`);if(r.startsWith(`/account`)){let e=[{label:i(`account`)}];return r===`/account/profile`?e.push({label:i(`profile`)}):r===`/account/security`?e.push({label:i(`security`)}):r===`/account/sessions`?e.push({label:i(`sessions`)}):r===`/account/two-factor`?e.push({label:i(`twoFactor`)}):r===`/account/oauth-applications`?e.push({label:i(`oauthApps`)}):r===`/account/oauth-applications/new`?e.push({label:i(`oauthApps`)},{label:i(`new`)}):r.startsWith(`/account/oauth-applications/`)&&e.push({label:i(`oauthApps`)}),e}if(r===`/organizations/new`)return[{label:i(`organizations`)},{label:i(`new`)}];if(n.orgId){let e=r.endsWith(`/general`)?i(`general`):r.endsWith(`/members`)?i(`members`):i(`settings`);return[{label:i(`organizations`)},{label:e}]}return r===`/organizations`||r.startsWith(`/organizations/`)?[{label:i(`organizations`)}]:r.startsWith(`/accept-invitation/`)?[{label:i(`acceptInvitation`)}]:r.startsWith(`/auth/device`)?[{label:i(`deviceAuthorization`)}]:[{label:i(`account`)}]},[t.pathname,n.orgId,e]);return(0,M.jsxs)(`header`,{className:`sticky top-0 z-30 flex h-14 shrink-0 items-center justify-between gap-2 border-b bg-background/80 px-2 backdrop-blur supports-[backdrop-filter]:bg-background/70 sm:px-4`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 sm:gap-2.5`,children:[(0,M.jsx)(`div`,{className:`sm:hidden`,children:(0,M.jsx)(LO,{className:`h-9 w-9`})}),(0,M.jsx)(gN,{label:e(`topBar.accountHome`)}),(0,M.jsx)(`span`,{className:`hidden text-sm font-semibold tracking-tight sm:inline`,children:e(`topBar.brand`)}),(0,M.jsxs)(`div`,{className:`hidden items-center gap-1.5 sm:flex`,children:[(0,M.jsx)(_S,{orientation:`vertical`,className:`mx-1 h-4`}),(0,M.jsx)(hN,{}),(0,M.jsx)(_N,{}),(0,M.jsx)(ok,{children:(0,M.jsx)(sk,{children:r.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center`,children:[t>0&&(0,M.jsx)(dk,{}),(0,M.jsx)(ck,{children:(0,M.jsx)(uk,{className:`font-medium`,children:e.label})})]},t))})})]}),(0,M.jsx)(`div`,{className:`min-w-0 flex-1 sm:hidden`,children:r.length>0&&(0,M.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r[r.length-1].label})})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1 sm:gap-2`,children:[(0,M.jsx)(`div`,{className:`hidden sm:block`,children:(0,M.jsx)(AM,{})}),(0,M.jsx)(`div`,{className:`hidden sm:block`,children:(0,M.jsx)(MM,{})}),(0,M.jsx)(mN,{})]})]})}var yN=[{to:`/account`,label:`home`,icon:Ry,exact:!0},{to:`/account/profile`,label:`profile`,icon:db},{to:`/account/security`,label:`security`,icon:tb},{to:`/account/sessions`,label:`sessions`,icon:qy},{to:`/account/two-factor`,label:`twoFactor`,icon:eb},{to:`/account/invitations`,label:`invitations`,icon:zy},{to:`/account/linked-accounts`,label:`linkedAccounts`,icon:Uy}],bN=[`group/nav relative transition-all duration-150`,`before:absolute before:left-0 before:top-1/2 before:h-5 before:w-[3px] before:-translate-y-1/2 before:rounded-r-full before:bg-brand-gradient before:opacity-0 before:transition-opacity`,`data-[active=true]:before:opacity-100`,`data-[active=true]:bg-sidebar-accent/80 data-[active=true]:text-sidebar-accent-foreground`,`[&>svg]:transition-transform [&>svg]:duration-150 hover:[&>svg]:scale-110`,`data-[active=true]:[&>svg]:text-primary`].join(` `);function xN(){let{t:e}=vt(),{pathname:t}=Oa(),{organizations:n}=cN(),r=t,i=t.match(/^\/organizations\/([^/]+)(?:\/.*)?$/),a=i&&n.some(e=>e.id===i[1])?i[1]:null;return(0,M.jsxs)(IO,{collapsible:`icon`,className:`h-full`,children:[(0,M.jsxs)(WO,{children:[(0,M.jsxs)(GO,{children:[(0,M.jsx)(KO,{children:e(`sidebar.groups.account`)}),(0,M.jsx)(JO,{children:(0,M.jsx)(YO,{children:yN.map(t=>{let n=t.icon;return(0,M.jsx)(XO,{children:(0,M.jsx)(ZO,{asChild:!0,isActive:t.exact?r===t.to||r===`${t.to}/`:r===t.to||r.startsWith(`${t.to}/`),tooltip:e(`sidebar.items.${t.label}`),className:bN,children:(0,M.jsxs)(ra,{to:t.to,children:[(0,M.jsx)(n,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.${t.label}`)})]})})},t.to)})})})]}),(0,M.jsx)(UO,{}),(0,M.jsxs)(GO,{children:[(0,M.jsx)(KO,{children:e(`sidebar.groups.organization`)}),(0,M.jsx)(JO,{children:(0,M.jsxs)(YO,{children:[(0,M.jsx)(XO,{children:(0,M.jsx)(ZO,{asChild:!0,isActive:t===`/organizations`,tooltip:e(`sidebar.items.overview`),className:bN,children:(0,M.jsxs)(ra,{to:`/organizations`,children:[(0,M.jsx)(Cy,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.overview`)})]})})}),a&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(XO,{children:(0,M.jsx)(ZO,{asChild:!0,isActive:t===`/organizations/${a}/general`,tooltip:e(`sidebar.items.general`),className:bN,children:(0,M.jsxs)(ra,{to:`/organizations/$orgId/general`,params:{orgId:a},children:[(0,M.jsx)($y,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.general`)})]})})}),(0,M.jsx)(XO,{children:(0,M.jsx)(ZO,{asChild:!0,isActive:t===`/organizations/${a}/members`,tooltip:e(`sidebar.items.members`),className:bN,children:(0,M.jsxs)(ra,{to:`/organizations/$orgId/members`,params:{orgId:a},children:[(0,M.jsx)(fb,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.members`)})]})})}),(0,M.jsx)(XO,{children:(0,M.jsx)(ZO,{asChild:!0,isActive:t===`/organizations/${a}/teams`,tooltip:e(`sidebar.items.teams`),className:bN,children:(0,M.jsxs)(ra,{to:`/organizations/$orgId/teams`,params:{orgId:a},children:[(0,M.jsx)(ub,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.teams`)})]})})})]})]})})]}),(0,M.jsx)(UO,{}),(0,M.jsxs)(GO,{children:[(0,M.jsx)(KO,{children:e(`sidebar.groups.developer`)}),(0,M.jsx)(JO,{children:(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{children:(0,M.jsx)(ZO,{asChild:!0,isActive:t.startsWith(`/account/oauth-applications`),tooltip:e(`sidebar.items.oauthApps`),className:bN,children:(0,M.jsxs)(ra,{to:`/account/oauth-applications`,children:[(0,M.jsx)(By,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.oauthApps`)})]})})})})})]})]}),(0,M.jsx)(HO,{children:(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{children:(0,M.jsx)(SN,{})})})})]})}function SN(){let{t:e}=vt(),{state:t,toggleSidebar:n}=PO(),r=e(t===`collapsed`?`sidebar.expand`:`sidebar.collapse`);return(0,M.jsx)(ZO,{onClick:n,tooltip:r,"aria-label":r,children:(0,M.jsx)(Yy,{className:`size-4`})})}function CN(){return typeof window<`u`&&window.location.pathname.startsWith(`/_account`)?window.location.origin:`http://localhost:3000`}var wN=new Set([`/login`,`/register`,`/forgot-password`,`/reset-password`,`/verify-email`,`/verify-email-prompt`,`/auth/device`,`/setup`]);function TN(e){return wN.has(e)||e.startsWith(`/accept-invitation/`)}function EN(){let[e,t]=(0,j.useState)(null);return(0,j.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await fetch(`/api/v1/auth/bootstrap-status`);if(!n.ok){e||t(!0);return}let r=await n.json();e||t(r.hasOwner!==!1)}catch{e||t(!0)}})(),()=>{e=!0}},[]),e}function DN({children:e}){let{user:t,loading:n}=sN(),r=Hi(),i=Oa(),a=TN(i.pathname),o=i.pathname.startsWith(`/oauth/`)||i.pathname===`/organizations/new`,s=EN(),c=i.pathname===`/setup`;return(0,j.useEffect)(()=>{s===!1&&!c&&!t&&r({to:`/setup`,replace:!0})},[s,c,t,r]),(0,j.useEffect)(()=>{n||s!==!1&&!t&&!a&&r({to:`/login`,search:{redirect:i.pathname+i.searchStr},replace:!0})},[t,n,a,r,i.pathname,i.searchStr,s]),s===null||n&&!t?(0,M.jsx)(`div`,{className:`flex min-h-screen w-full flex-1 items-center justify-center bg-background`,children:(0,M.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary`})}):s===!1&&!c||!t&&!a?null:a||o?(0,M.jsx)(`div`,{className:`flex min-h-screen w-full`,children:e}):(0,M.jsxs)(FO,{className:`flex h-svh w-full flex-col`,children:[(0,M.jsx)(vN,{}),(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 w-full`,children:[(0,M.jsx)(xN,{}),(0,M.jsx)(zO,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-auto bg-background`,children:e})})]})]})}function ON(){let e=CN(),t=(0,j.useMemo)(()=>new t_({baseUrl:e}),[e]),{language:n}=vt();return(0,M.jsx)(a_,{client:t,locale:n,children:(0,M.jsxs)(oN,{children:[(0,M.jsx)(DN,{children:(0,M.jsx)(ya,{})}),(0,M.jsx)(Jx,{})]})})}var kN=ca({component:ON}),$=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:Z(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));$.displayName=`Card`;var AN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:Z(`flex flex-col space-y-1.5 p-6`,e),...t}));AN.displayName=`CardHeader`;var jN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`h3`,{ref:n,className:Z(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));jN.displayName=`CardTitle`;var MN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`p`,{ref:n,className:Z(`text-sm text-muted-foreground`,e),...t}));MN.displayName=`CardDescription`;var NN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:Z(`p-6 pt-0`,e),...t}));NN.displayName=`CardContent`;var PN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:Z(`flex items-center p-6 pt-0`,e),...t}));PN.displayName=`CardFooter`;function FN(e){let t=e.split(`:`)[0].toLowerCase();return/^cloud\./.test(t)}function IN(){return typeof window>`u`?null:window.location.host||null}function LN({children:e,formWidth:t=`sm`}){let{t:n}=vt(),r=t===`md`?`max-w-md`:`max-w-sm`,i=IN(),a=!!i&&!FN(i);return j.useEffect(()=>{if(typeof document>`u`||!i)return;let e=document.title;return a&&(document.title=i),()=>{document.title=e}},[i,a]),(0,M.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted p-6`,children:(0,M.jsxs)(`div`,{className:Z(`flex w-full flex-col gap-4`,r),children:[a?(0,M.jsx)(`div`,{className:`flex justify-center`,children:(0,M.jsx)(`span`,{className:`rounded-full border border-border/60 bg-background/60 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wide text-muted-foreground`,title:n(`auth.shell.tenantHostHint`,{defaultValue:`You are signing in to this workspace`}),children:i})}):null,e]})})}var RN=la(`/verify-email-prompt`)({validateSearch:e=>({email:typeof e.email==`string`?e.email:void 0,redirect:typeof e.redirect==`string`?e.redirect:void 0}),component:zN});function zN(){let{t:e}=vt(),t=Hi(),{email:n,redirect:r}=RN.useSearch(),i=o_(),[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(!1);return(0,M.jsx)(LN,{children:(0,M.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,M.jsxs)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-primary/10`,children:(0,M.jsx)(Gy,{className:`size-8 text-primary`})}),(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.title`,{defaultValue:`Verify your email address`})}),(0,M.jsx)(MN,{children:e(`auth.verifyEmail.description`,{defaultValue:`We sent a verification link to your email address. Please click the link to verify your account.`})})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n?(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.verifyEmail.sentTo`,{defaultValue:`Sent to:`}),` `,(0,M.jsx)(`span`,{className:`font-medium text-foreground`,children:n})]}):null,(0,M.jsx)(Q,{onClick:async()=>{if(!n||!i?.auth){K({title:e(`auth.verifyEmail.resendFailed`,{defaultValue:`Cannot resend verification email`}),description:e(`auth.verifyEmail.emailMissing`,{defaultValue:`Email address is missing`}),variant:`destructive`});return}o(!0);try{let t=await fetch(`/api/v1/auth/send-verification-email`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:n,callbackURL:r||`/`})});if(!t.ok){let e=await t.json().catch(()=>({message:`Unknown error`}));throw Error(e.message||`Failed to send verification email`)}c(!0),K({title:e(`auth.verifyEmail.resentSuccess`,{defaultValue:`Verification email sent!`}),description:e(`auth.verifyEmail.resentDescription`,{defaultValue:`Please check your inbox and click the verification link.`})})}catch(t){K({title:e(`auth.verifyEmail.resendFailed`,{defaultValue:`Failed to resend verification email`}),description:t.message,variant:`destructive`})}finally{o(!1)}},disabled:a||s,className:`w-full`,variant:s?`outline`:`default`,children:a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Zy,{className:`mr-2 size-4 animate-spin`}),e(`auth.verifyEmail.resending`,{defaultValue:`Sending...`})]}):s?e(`auth.verifyEmail.resent`,{defaultValue:`Email sent! Check your inbox`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Zy,{className:`mr-2 size-4`}),e(`auth.verifyEmail.resendButton`,{defaultValue:`Resend verification email`})]})}),(0,M.jsxs)(`div`,{className:`relative`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,M.jsx)(`span`,{className:`w-full border-t`})}),(0,M.jsx)(`div`,{className:`relative flex justify-center text-xs uppercase`,children:(0,M.jsx)(`span`,{className:`bg-card px-2 text-muted-foreground`,children:e(`auth.verifyEmail.or`,{defaultValue:`Or`})})})]}),(0,M.jsx)(Q,{onClick:()=>{t({to:`/login`,search:r?{redirect:r}:void 0})},variant:`ghost`,className:`w-full`,children:e(`auth.verifyEmail.backToLogin`,{defaultValue:`Back to login`})}),(0,M.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:e(`auth.verifyEmail.checkSpam`,{defaultValue:`Didn't receive the email? Check your spam folder or contact support.`})})]})})]})})})}var BN=la(`/verify-email`)({validateSearch:e=>{let t=e.token;return typeof t==`string`?{token:t}:{}},component:VN});function VN(){let{t:e}=vt(),{token:t}=BN.useSearch(),n=o_(),[r,i]=(0,j.useState)(`loading`),[a,o]=(0,j.useState)(``);return(0,j.useEffect)(()=>{if(!t){i(`error`),o(e(`auth.verifyEmail.missingToken`));return}let r=!1;return(async()=>{try{await n.auth.verifyEmail({token:t}),r||i(`success`)}catch(t){r||(i(`error`),o(t.message||e(`auth.verifyEmail.errorDescription`)))}})(),()=>{r=!0}},[t,e,n]),(0,M.jsx)(LN,{children:(0,M.jsxs)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[r===`loading`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.verifyingTitle`)}),(0,M.jsx)(MN,{children:e(`auth.verifyEmail.verifyingDescription`)})]}),(0,M.jsx)(NN,{className:`flex justify-center py-6`,children:(0,M.jsx)(`div`,{className:`h-10 w-10 animate-spin rounded-full border-4 border-muted border-t-primary`})})]}),r===`success`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-2 flex size-12 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-500 ring-1 ring-emerald-500/30`,children:(0,M.jsx)(ky,{className:`size-6`})}),(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.successTitle`)}),(0,M.jsx)(MN,{children:e(`auth.verifyEmail.successDescription`)})]}),(0,M.jsx)(NN,{className:`text-center`,children:(0,M.jsx)(ra,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.verifyEmail.signInLink`)})})]}),r===`error`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-2 flex size-12 items-center justify-center rounded-full bg-destructive/10 text-destructive ring-1 ring-destructive/30`,children:(0,M.jsx)(jy,{className:`size-6`})}),(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.errorTitle`)}),(0,M.jsx)(MN,{children:a||e(`auth.verifyEmail.errorDescription`)})]}),(0,M.jsx)(NN,{className:`text-center`,children:(0,M.jsx)(ra,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.verifyEmail.backToSignIn`)})})]})]})})}var HN=`Label`,UN=j.forwardRef((e,t)=>(0,M.jsx)(uS.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));UN.displayName=HN;var WN=UN,GN=fy(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),KN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(WN,{ref:n,className:Z(GN(),e),...t}));KN.displayName=WN.displayName;var qN=la(`/setup`)({component:YN});function JN(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function YN(){let{t:e}=vt(),t=Hi(),n=o_(),{user:r,refresh:i}=sN(),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null);return(0,j.useEffect)(()=>{let e=!1;return(async()=>{try{let{hasOwner:t}=await n.auth.bootstrapStatus();e||g(t)}catch{e||g(!1)}})(),()=>{e=!0}},[n]),(0,j.useEffect)(()=>{h===!0&&!r&&t({to:`/login`,replace:!0})},[h,r,t]),(0,j.useEffect)(()=>{r&&window.location.assign(`/`)},[r]),h===null?(0,M.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted`,children:(0,M.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-4 border-muted-foreground/20 border-t-primary`})}):(0,M.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted p-6`,children:(0,M.jsx)(`div`,{className:`flex w-full max-w-md flex-col gap-6`,children:(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{children:e(`auth.setup.welcomeTitle`)}),(0,M.jsx)(MN,{children:e(`auth.setup.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),n?.auth){m(!0);try{await n.auth.register({name:a,email:s,password:l}),await i();let e=d.trim();if(e)try{let{organizations:t}=await n.organizations.list(),r=t?.[0],i;if(r?.id)await n.organizations.update(r.id,{name:e,slug:JN(e)}),i=r.id;else{let t=await n.organizations.create({name:e,slug:JN(e)});i=t?.id??t?.data?.id}i&&await n.organizations.setActive(i).catch(()=>{})}catch(e){console.warn(`[setup] organization rename/create failed`,e)}window.location.assign(`/`)}catch(t){K({title:e(`auth.setup.failed`),description:t.message,variant:`destructive`})}finally{m(!1)}}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`name`,children:e(`auth.setup.yourName`)}),(0,M.jsx)(lS,{id:`name`,autoComplete:`name`,required:!0,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`orgName`,children:e(`auth.setup.orgName`)}),(0,M.jsx)(lS,{id:`orgName`,required:!0,placeholder:e(`auth.setup.orgNamePlaceholder`),value:d,onChange:e=>f(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(lS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:s,onChange:e=>c(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`password`,children:e(`auth.passwordLabel`)}),(0,M.jsx)(lS,{id:`password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,placeholder:e(`auth.setup.passwordHint`),value:l,onChange:e=>u(e.target.value)})]}),(0,M.jsx)(Q,{type:`submit`,className:`mt-2 w-full`,disabled:p,children:e(p?`auth.setup.submitting`:`auth.setup.submit`)})]})})]})})})}var XN=la(`/reset-password`)({validateSearch:e=>{let t=e.token;return typeof t==`string`?{token:t}:{}},component:ZN});function ZN(){let{t:e}=vt(),t=Hi(),{token:n}=XN.useSearch(),[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(!1);return(0,M.jsx)(LN,{children:(0,M.jsxs)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.resetPassword.title`)}),(0,M.jsx)(MN,{children:e(`auth.resetPassword.description`)})]}),(0,M.jsx)(NN,{children:n?(0,M.jsxs)(`form`,{onSubmit:async i=>{if(i.preventDefault(),r!==a){K({title:e(`auth.resetPassword.passwordsMismatch`),variant:`destructive`});return}if(!n){K({title:e(`auth.resetPassword.missingToken`),variant:`destructive`});return}c(!0);try{let i=await fetch(`/api/v1/auth/reset-password`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({token:n,newPassword:r})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.message||`Request failed: ${i.status}`)}K({title:e(`auth.resetPassword.success`)}),t({to:`/login`})}catch(t){K({title:e(`auth.resetPassword.failed`),description:t.message,variant:`destructive`})}finally{c(!1)}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`new-password`,children:e(`auth.resetPassword.newPassword`)}),(0,M.jsx)(lS,{id:`new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:r,onChange:e=>i(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`confirm-password`,children:e(`auth.resetPassword.confirmPassword`)}),(0,M.jsx)(lS,{id:`confirm-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsx)(Q,{type:`submit`,className:`w-full bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,disabled:s,children:e(s?`auth.resetPassword.submitting`:`auth.resetPassword.submit`)})]}):(0,M.jsxs)(`p`,{className:`text-sm text-muted-foreground text-center`,children:[e(`auth.resetPassword.invalidToken`),` `,(0,M.jsx)(ra,{to:`/forgot-password`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.resetPassword.requestNewLink`)})]})})]})})}function QN({mode:e,redirect:t}){let{t:n}=vt(),r=o_(),[i,a]=(0,j.useState)([]),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(null);if((0,j.useEffect)(()=>{r?.auth?.getConfig&&r.auth.getConfig().then(e=>{a((e?.socialProviders??e?.data?.socialProviders??[]).filter(e=>e.enabled))}).catch(e=>{console.warn(`[SocialSignInButtons] failed to load auth config`,e)}).finally(()=>s(!1))},[r]),o||i.length===0)return null;let u=n(e===`sign-in`?`auth.social.continueWith`:`auth.social.signUpWith`),d=window.location.origin+`/_account/login`+(t?`?redirect=${encodeURIComponent(t)}`:``),f=e=>{c||(l(e),Promise.resolve(r.auth.signInWithProvider(e.id,{callbackURL:d,errorCallbackURL:d,type:e.type??`social`})).catch(e=>{console.warn(`[SocialSignInButtons] signInWithProvider failed`,e),l(null)}))};return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.map(e=>{let t=c?.id===e.id;return(0,M.jsxs)(Q,{type:`button`,variant:`outline`,className:`w-full`,disabled:!!c,onClick:()=>f(e),children:[t?(0,M.jsx)(`span`,{className:`mr-2 inline-block size-4 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}):(0,M.jsx)(`span`,{className:`mr-2 flex h-4 w-4 items-center justify-center rounded-sm bg-muted text-[10px] font-bold uppercase`,children:e.id[0]}),t?n(`auth.social.redirectingTo`,{provider:e.name,defaultValue:`Redirecting to ${e.name}…`}):`${u} ${e.name}`]},e.id)}),(0,M.jsxs)(`div`,{className:`relative my-1`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,M.jsx)(`span`,{className:`w-full border-t`})}),(0,M.jsx)(`div`,{className:`relative flex justify-center text-xs uppercase`,children:(0,M.jsx)(`span`,{className:`bg-card px-2 text-muted-foreground`,children:n(`auth.social.orContinueEmail`)})})]}),c&&typeof document<`u`?(0,Gi.createPortal)((0,M.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm`,children:(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-8 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:n(`auth.social.redirectingTo`,{provider:c.name,defaultValue:`Redirecting to ${c.name}…`})})]})}),document.body):null]})}function $N(e,t){if(e.metaKey||e.ctrlKey||e.shiftKey||e.button===1)return;e.preventDefault();let n=Math.min(960,window.screen.availWidth-80),r=Math.min(720,window.screen.availHeight-80),i=Math.max(0,Math.round((window.screen.availWidth-n)/2)),a=Math.max(0,Math.round((window.screen.availHeight-r)/2)),o=[`popup=yes`,`width=${n}`,`height=${r}`,`left=${i}`,`top=${a}`,`resizable=yes`,`scrollbars=yes`,`noopener=yes`,`noreferrer=yes`].join(`,`);window.open(t,`objectstack-legal`,o)||window.open(t,`_blank`,`noopener,noreferrer`)}function eP({termsUrl:e,privacyUrl:t}){let{t:n}=vt(`account`),r=typeof e==`string`&&e.length>0,i=typeof t==`string`&&t.length>0;return!r&&!i?null:(0,M.jsxs)(`p`,{className:`px-6 text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary`,children:[n(`legal.agreementPrefix`),` `,r?(0,M.jsx)(`a`,{href:e,target:`objectstack-legal`,rel:`noreferrer noopener`,onClick:t=>$N(t,e),children:n(`legal.termsOfService`)}):null,r&&i?(0,M.jsxs)(M.Fragment,{children:[` `,n(`legal.and`),` `]}):null,i?(0,M.jsx)(`a`,{href:t,target:`objectstack-legal`,rel:`noreferrer noopener`,onClick:e=>$N(e,t),children:n(`legal.privacyPolicy`)}):null,`.`]})}var tP=la(`/register`)({validateSearch:e=>{let t=e.redirect;return typeof t==`string`?{redirect:t}:{}},component:iP});function nP(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function rP(e){return e.startsWith(`/_`)?e:`/_account/`.replace(/\/$/,``)+e}function iP(){let{t:e}=vt(),t=Hi(),{redirect:n}=tP.useSearch(),r=o_(),{session:i,user:a,loading:o,refresh:s,organizations:c,organizationsLoading:l,organizationsFetched:u,setActiveOrganization:d,features:f}=sN();(0,j.useEffect)(()=>{f?.signUpDisabled===!0&&t({to:`/login`,search:n?{redirect:n}:{},replace:!0})},[f?.signUpDisabled,t,n]);let[p,m]=(0,j.useState)(``),[h,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{if(a){if(typeof window<`u`){let e=new URLSearchParams(window.location.search);if(e.has(`client_id`)&&e.has(`redirect_uri`)){window.location.assign(`/api/v1/auth/oauth2/authorize${window.location.search}`);return}}if(!i?.activeOrganizationId){if(!u||l||x)return;if(c.length===1){S(!0),d(c[0].id).catch(()=>void 0).finally(()=>S(!1));return}if(!f)return;if(c.length>1){t({to:`/organizations`});return}if(f.multiOrgEnabled===!1){nP(n)?window.location.assign(rP(n)):window.location.assign(`/`);return}t({to:`/organizations/new`,search:n?{redirect:n}:{}});return}if(!x){if(nP(n)){window.location.assign(rP(n));return}window.location.assign(`/`)}}},[a,i,t,n,c,l,u,x,d,f]),(0,M.jsx)(LN,{children:o||a?(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:a?e(`auth.register.signingIn`,{defaultValue:`Setting up your account…`}):e(`auth.login.redirecting`,{defaultValue:`Loading…`})})]}):(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.register.title`)}),(0,M.jsx)(MN,{children:e(`auth.register.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsx)(`form`,{onSubmit:async i=>{if(i.preventDefault(),r?.auth){b(!0);try{let i=await r.auth.register({name:p,email:h,password:_}),a=i?.data??i;if(a&&a.token===null&&a.user){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}try{await s()}catch(e){let r=e.message;if(r.includes(`email`)&&(r.toLowerCase().includes(`verif`)||r.toLowerCase().includes(`not verified`))){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}throw e}K({title:e(`auth.register.successToast`)})}catch(r){let i=r.message;if(i.includes(`email`)&&(i.toLowerCase().includes(`verif`)||i.toLowerCase().includes(`sent`))){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}K({title:e(`auth.register.failed`),description:i,variant:`destructive`})}finally{b(!1)}}},children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsx)(QN,{mode:`sign-up`,redirect:n}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`name`,children:e(`auth.nameLabel`)}),(0,M.jsx)(lS,{id:`name`,autoComplete:`name`,required:!0,value:p,onChange:e=>m(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(lS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:h,onChange:e=>g(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`password`,children:e(`auth.passwordLabel`)}),(0,M.jsx)(lS,{id:`password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:_,onChange:e=>v(e.target.value)})]}),(0,M.jsx)(Q,{type:`submit`,className:`w-full`,disabled:y,children:e(y?`auth.register.submitting`:`auth.register.submit`)}),(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.register.haveAccount`),` `,(0,M.jsx)(ra,{to:`/login`,search:n?{redirect:n}:void 0,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.register.signIn`)})]})]})})})]}),(0,M.jsx)(eP,{termsUrl:f?.termsUrl,privacyUrl:f?.privacyUrl})]})})}var aP=la(`/login`)({validateSearch:e=>{let t=e.redirect;return typeof t==`string`?{redirect:t}:{}},component:cP});function oP(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function sP(e){return e.startsWith(`/_`)?e:`/_account/`.replace(/\/$/,``)+e}function cP(){let{t:e}=vt(),t=Hi(),{redirect:n}=aP.useSearch(),r=o_(),i=null;if(typeof window<`u`){let e=new URLSearchParams(window.location.search),t=e.get(`redirect_uri`);if(e.has(`client_id`)&&t)try{i=new URL(t).host}catch{i=null}}let{session:a,user:o,loading:s,refresh:c,organizations:l,organizationsLoading:u,organizationsFetched:d,setActiveOrganization:f,features:p}=sN(),m=p?.signUpDisabled===!0,[h,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{if(o){if(typeof window<`u`){let e=new URLSearchParams(window.location.search);if(e.has(`client_id`)&&e.has(`redirect_uri`)){window.location.assign(`/api/v1/auth/oauth2/authorize${window.location.search}`);return}}if(!a?.activeOrganizationId){if(!d||u||x)return;if(l.length===1){S(!0),f(l[0].id).catch(()=>void 0).finally(()=>S(!1));return}if(!p)return;if(l.length===0){if(p.multiOrgEnabled===!1){oP(n)?window.location.assign(sP(n)):window.location.assign(`/`);return}t({to:`/organizations/new`});return}if(p.multiOrgEnabled===!1){S(!0),f(l[0].id).catch(()=>void 0).finally(()=>S(!1));return}t({to:`/organizations`});return}if(!x){if(oP(n)){window.location.assign(sP(n));return}window.location.assign(`/`)}}},[o,a,t,n,l,u,d,x,f,p]),s||o?(0,M.jsx)(LN,{children:(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:e(`auth.login.signingIn`,{defaultValue:`Signing you in…`})})]})}):(0,M.jsxs)(LN,{children:[y?(0,M.jsx)(fN,{message:e(`auth.login.signingIn`,{defaultValue:`Signing you in…`})}):null,(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i?(0,M.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-md border border-primary/30 bg-primary/5 px-4 py-3 text-sm text-foreground`,children:[(0,M.jsx)(`span`,{className:`mt-0.5 inline-block size-2 shrink-0 rounded-full bg-primary`}),(0,M.jsx)(`span`,{children:e(`auth.login.ssoHandoff`,{target:i,defaultValue:`Continue to ${i}`})})]}):null,(0,M.jsxs)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.login.title`)}),(0,M.jsx)(MN,{children:e(`auth.login.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsx)(`form`,{onSubmit:async i=>{if(i.preventDefault(),r?.auth){b(!0);try{await r.auth.login({type:`email`,email:h,password:_}),await c(),K({title:e(`auth.login.welcomeToast`)})}catch(r){let i=r.message,a=r.code,o=(i||``).toLowerCase();if(a===`EMAIL_NOT_VERIFIED`||o.includes(`email`)&&(o.includes(`verif`)||o.includes(`not verified`))){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}K({title:e(`auth.login.failed`),description:i,variant:`destructive`})}finally{b(!1)}}},children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsx)(QN,{mode:`sign-in`,redirect:n}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(lS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:h,onChange:e=>g(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center`,children:[(0,M.jsx)(KN,{htmlFor:`password`,children:e(`auth.passwordLabel`)}),(0,M.jsx)(ra,{to:`/forgot-password`,className:`ml-auto text-sm underline-offset-4 hover:underline`,children:e(`auth.login.forgotPassword`)})]}),(0,M.jsx)(lS,{id:`password`,type:`password`,autoComplete:`current-password`,required:!0,value:_,onChange:e=>v(e.target.value)})]}),(0,M.jsx)(Q,{type:`submit`,className:`w-full`,disabled:y,children:e(y?`auth.login.submitting`:`auth.login.submit`)}),m?null:(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.login.noAccount`),` `,(0,M.jsx)(ra,{to:`/register`,search:n?{redirect:n}:void 0,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.login.signUp`)})]})]})})})]}),(0,M.jsx)(eP,{termsUrl:p?.termsUrl,privacyUrl:p?.privacyUrl})]})]})}var lP=la(`/forgot-password`)({component:uP});function uP(){let{t:e}=vt(),[t,n]=(0,j.useState)(``),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(!1);return(0,M.jsx)(LN,{children:(0,M.jsx)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.forgotPassword.checkEmailTitle`)}),(0,M.jsx)(MN,{children:e(`auth.forgotPassword.checkEmailDescription`,{email:t})})]}),(0,M.jsx)(NN,{className:`text-center`,children:(0,M.jsx)(ra,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.forgotPassword.backToSignIn`)})})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`auth.forgotPassword.title`)}),(0,M.jsx)(MN,{children:e(`auth.forgotPassword.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),i(!0);try{let e=window.location.origin+`/_account/`.replace(/\/$/,``)+`/reset-password`,n=await fetch(`/api/v1/auth/request-password-reset`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({email:t,redirectTo:e})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e?.message||`Request failed: ${n.status}`)}o(!0)}catch(t){K({title:e(`auth.forgotPassword.failed`),description:t.message,variant:`destructive`})}finally{i(!1)}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(lS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:t,onChange:e=>n(e.target.value)})]}),(0,M.jsx)(Q,{type:`submit`,className:`w-full bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,disabled:r,children:e(r?`auth.forgotPassword.submitting`:`auth.forgotPassword.submit`)}),(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.forgotPassword.rememberPassword`),` `,(0,M.jsx)(ra,{to:`/login`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.forgotPassword.signIn`)})]})]})})]})})})}var dP=la(`/account`)({component:fP});function fP(){return(0,M.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex-1 overflow-auto px-4 py-6 sm:px-6 sm:py-8`,children:(0,M.jsx)(`div`,{className:`page-enter mx-auto flex max-w-4xl flex-col gap-6`,children:(0,M.jsx)(ya,{})})})})}var pP=la(`/`)({component:mP});function mP(){return(0,M.jsx)(Ui,{to:`/login`})}var hP=fy(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function gP({className:e,variant:t,...n}){return(0,M.jsx)(`div`,{className:Z(hP({variant:t}),e),...n})}function _P({title:e,description:t,icon:n,actions:r,className:i,...a}){return(0,M.jsxs)(`div`,{className:Z(`relative overflow-hidden rounded-xl border bg-brand-gradient-subtle`,`px-5 py-5 sm:px-6 sm:py-6`,i),...a,children:[(0,M.jsx)(`div`,{className:`pointer-events-none absolute inset-0 opacity-60`,style:{backgroundImage:`radial-gradient(ellipse 60% 80% at 0% 0%, hsl(var(--brand-from) / 0.12), transparent 60%)`},"aria-hidden":!0}),(0,M.jsxs)(`div`,{className:`relative flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-start gap-4`,children:[n?(0,M.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30 ring-1 ring-white/15`,children:(0,M.jsx)(n,{className:`size-5`})}):null,(0,M.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,M.jsx)(`h1`,{className:`truncate text-xl font-semibold tracking-tight sm:text-2xl`,children:e}),t?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t}):null]})]}),r?(0,M.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:r}):null]})]})}var vP=la(`/organizations/`)({component:yP});function yP(){let{t:e}=vt(),{organizations:t,loading:n}=cN(),{session:r,setActiveOrganization:i,features:a}=sN(),o=Hi(),s=r?.activeOrganizationId??void 0,c=a?.multiOrgEnabled!==!1,l=async t=>{try{t!==s&&await i(t),o({to:`/organizations/$orgId`,params:{orgId:t}})}catch(t){K({title:e(`organizations.switchFailed`),description:t.message,variant:`destructive`})}},u=e=>e.split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return(0,M.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex-1 overflow-auto px-4 py-6 sm:px-6 sm:py-8`,children:(0,M.jsxs)(`div`,{className:`page-enter mx-auto flex max-w-3xl flex-col gap-6`,children:[(0,M.jsx)(_P,{icon:Cy,title:e(`organizations.title`),description:e(`organizations.description`),actions:c?(0,M.jsxs)(Q,{onClick:()=>o({to:`/organizations/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:[(0,M.jsx)(Xy,{className:`mr-2 h-4 w-4`}),e(`organizations.newOrganization`)]}):null}),n&&(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`organizations.loading`)}),!n&&t.length===0&&(0,M.jsxs)($,{className:`p-10 text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-3 flex size-12 items-center justify-center rounded-lg bg-brand-gradient-subtle text-primary ring-1 ring-primary/15`,children:(0,M.jsx)(Cy,{className:`h-6 w-6`})}),(0,M.jsx)(`h3`,{className:`text-base font-medium`,children:e(`organizations.emptyTitle`)}),(0,M.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:e(`organizations.emptyDescription`)}),c&&(0,M.jsxs)(Q,{onClick:()=>o({to:`/organizations/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20`,children:[(0,M.jsx)(Xy,{className:`mr-2 h-4 w-4`}),e(`organizations.createOrganization`)]})]}),(0,M.jsx)(`div`,{className:`grid gap-3`,children:t.map(t=>{let n=t.id===s;return(0,M.jsx)($,{role:`button`,tabIndex:0,onClick:()=>l(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l(t.id))},className:`group cursor-pointer p-4 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5 focus:outline-none focus:ring-2 focus:ring-ring ${n?`border-primary/50 bg-brand-gradient-subtle ring-1 ring-primary/30`:``}`,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,M.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg font-semibold `+(n?`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30 ring-1 ring-white/15`:`bg-muted text-muted-foreground group-hover:bg-brand-gradient-subtle group-hover:text-primary`),children:u(t.name)||(0,M.jsx)(Cy,{className:`h-5 w-5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`h3`,{className:`truncate text-base font-medium`,children:t.name}),n&&(0,M.jsxs)(gP,{className:`gap-1 border-transparent bg-emerald-500/15 text-[10px] font-medium text-emerald-600 dark:text-emerald-400`,children:[(0,M.jsx)(wy,{className:`h-3 w-3`}),e(`organizations.active`)]})]}),t.slug&&(0,M.jsx)(`code`,{className:`mt-0.5 block font-mono text-xs text-muted-foreground`,children:t.slug})]}),(0,M.jsx)(Ey,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-primary`})]})},t.id)})})]})})})}var bP=la(`/account/`)({component:xP});function xP(){let{t:e}=vt(),{user:t}=sN(),{organizations:n}=cN(),r=[!!t?.emailVerified,!!t?.twoFactorEnabled,!!t?.name,!!t?.image].filter(Boolean).length*25,i=r>=75?`success`:r>=50?`warn`:`danger`,a=(t?.name??t?.email??`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase(),o=[{to:`/account/profile`,label:e(`home.tiles.profile.title`,{defaultValue:`Profile`}),description:e(`home.tiles.profile.description`,{defaultValue:`Display name, avatar and contact info.`}),icon:db},{to:`/account/security`,label:e(`home.tiles.security.title`,{defaultValue:`Security`}),description:e(`home.tiles.security.description`,{defaultValue:`Change your password and review activity.`}),icon:tb},{to:`/account/two-factor`,label:e(`home.tiles.twoFactor.title`,{defaultValue:`Two-factor auth`}),description:e(`home.tiles.twoFactor.description`,{defaultValue:`Add an authenticator app for stronger sign-in.`}),icon:eb},{to:`/account/sessions`,label:e(`home.tiles.sessions.title`,{defaultValue:`Active sessions`}),description:e(`home.tiles.sessions.description`,{defaultValue:`See and revoke devices that are signed in.`}),icon:qy},{to:`/account/linked-accounts`,label:e(`home.tiles.linked.title`,{defaultValue:`Linked accounts`}),description:e(`home.tiles.linked.description`,{defaultValue:`Manage your social and SSO providers.`}),icon:Uy},{to:`/account/oauth-applications`,label:e(`home.tiles.oauth.title`,{defaultValue:`OAuth applications`}),description:e(`home.tiles.oauth.description`,{defaultValue:`Apps you have authorised to access your account.`}),icon:By}];return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 bg-brand-gradient`,"aria-hidden":!0}),(0,M.jsx)(`div`,{className:`absolute inset-0 opacity-40 mix-blend-soft-light`,style:{backgroundImage:`radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.4), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(0,0,0,0.25), transparent 60%)`},"aria-hidden":!0}),(0,M.jsxs)(`div`,{className:`relative flex flex-col gap-4 p-6 text-white sm:flex-row sm:items-center sm:gap-6 sm:p-8`,children:[(0,M.jsxs)(QM,{className:`size-16 shrink-0 ring-4 ring-white/30 shadow-md sm:size-20`,children:[t?.image?(0,M.jsx)($M,{src:t.image,alt:t?.name??``}):null,(0,M.jsx)(eN,{className:`bg-white/20 text-base font-semibold text-white backdrop-blur`,children:a})]}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-xs uppercase tracking-wider text-white/70`,children:e(`home.welcome`,{defaultValue:`Welcome back`})}),(0,M.jsx)(`h2`,{className:`truncate text-2xl font-semibold tracking-tight`,children:t?.name||t?.email||`ObjectStack user`}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm text-white/80`,children:[(0,M.jsx)(Ky,{className:`size-3.5`,"aria-hidden":!0}),(0,M.jsx)(`span`,{className:`truncate`,children:t?.email}),t?.emailVerified?(0,M.jsx)(gP,{className:`border-white/30 bg-white/15 text-[10px] font-medium text-white backdrop-blur hover:bg-white/20`,children:e(`home.verified`,{defaultValue:`Verified`})}):null]})]})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-3`,children:[(0,M.jsx)(SP,{icon:eb,label:e(`home.stats.score`,{defaultValue:`Security score`}),value:`${r}%`,tone:i,extra:(0,M.jsx)(`div`,{className:`mt-2 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,M.jsx)(`div`,{className:`h-full bg-brand-gradient transition-[width] duration-500`,style:{width:`${r}%`}})})}),(0,M.jsx)(SP,{icon:Cy,label:e(`home.stats.orgs`,{defaultValue:`Organizations`}),value:String(n.length),extra:(0,M.jsxs)(ra,{to:`/organizations`,className:`mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline`,children:[e(`home.stats.manage`,{defaultValue:`Manage`}),(0,M.jsx)(Sy,{className:`size-3`})]})}),(0,M.jsx)(SP,{icon:t?.twoFactorEnabled?eb:tb,label:e(`home.stats.twoFactor`,{defaultValue:`Two-factor auth`}),value:t?.twoFactorEnabled?e(`home.stats.enabled`,{defaultValue:`Enabled`}):e(`home.stats.disabled`,{defaultValue:`Disabled`}),tone:t?.twoFactorEnabled?`success`:`warn`,extra:(0,M.jsxs)(ra,{to:`/account/two-factor`,className:`mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline`,children:[t?.twoFactorEnabled?e(`home.stats.review`,{defaultValue:`Review`}):e(`home.stats.enable`,{defaultValue:`Enable now`}),(0,M.jsx)(Sy,{className:`size-3`})]})})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-muted-foreground`,children:e(`home.quickAccess`,{defaultValue:`Quick access`})}),(0,M.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:o.map(({to:e,label:t,description:n,icon:r})=>(0,M.jsxs)(ra,{to:e,className:`group relative flex items-start gap-3 rounded-lg border bg-card p-4 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5`,children:[(0,M.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-brand-gradient-subtle text-primary ring-1 ring-primary/10 transition-transform group-hover:scale-110`,children:(0,M.jsx)(r,{className:`size-4`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,M.jsx)(`span`,{className:`truncate font-medium`,children:t}),(0,M.jsx)(Sy,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-primary`})]}),(0,M.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:n})]})]},e))})]})]})}function SP({icon:e,label:t,value:n,tone:r=`neutral`,extra:i}){let a=r===`success`?`text-emerald-600 dark:text-emerald-400`:r===`warn`?`text-amber-600 dark:text-amber-400`:r===`danger`?`text-destructive`:`text-foreground`;return(0,M.jsx)($,{className:`overflow-hidden`,children:(0,M.jsxs)(NN,{className:`p-5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:t}),(0,M.jsx)(e,{className:`size-4 ${a}`})]}),(0,M.jsx)(`p`,{className:`mt-1 text-2xl font-semibold tracking-tight ${a}`,children:n}),i]})})}var CP=la(`/organizations/new`)({validateSearch:e=>{let t=e.redirect;return typeof t==`string`?{redirect:t}:{}},component:DP});function wP(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48)}function TP(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function EP(e){return e.startsWith(`/_`)?e:`/_account/`.replace(/\/$/,``)+e}function DP(){let{t:e}=vt(),t=Hi(),{redirect:n}=CP.useSearch(),{create:r,creating:i}=lN(),{setActiveOrganization:a,reloadOrganizations:o,features:s}=sN(),[c,l]=(0,j.useState)(``),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(!1);(0,j.useEffect)(()=>{s&&s.multiOrgEnabled===!1&&t({to:`/organizations`})},[s,t]);let m=e=>{l(e),f||d(wP(e))};return(0,M.jsx)(LN,{formWidth:`md`,children:(0,M.jsxs)($,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl tracking-tight`,children:e(`organizations.new.title`)}),(0,M.jsx)(MN,{children:e(`organizations.new.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();try{let t=await r({name:c,slug:u||void 0}),i=t?.data??t,s=i?.id??i?.organization?.id;s&&await a(s).catch(()=>{}),await o().catch(()=>{}),K({title:e(`organizations.new.successToast`)}),TP(n)?window.location.assign(EP(n)):window.location.assign(`/`)}catch(t){K({title:e(`organizations.new.failed`),description:t.message,variant:`destructive`})}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`name`,children:e(`organizations.new.name`)}),(0,M.jsx)(lS,{id:`name`,required:!0,autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:e(`organizations.new.namePlaceholder`)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(KN,{htmlFor:`slug`,children:e(`organizations.new.slug`)}),(0,M.jsx)(lS,{id:`slug`,value:u,onChange:e=>{d(e.target.value),p(!0)},placeholder:e(`organizations.new.slugPlaceholder`),pattern:`[a-z0-9-]+`}),(0,M.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e(`organizations.new.slugHint`)})]}),(0,M.jsx)(Q,{type:`submit`,className:`w-full`,disabled:i||!c,children:e(i?`organizations.new.submitting`:`organizations.new.submit`)}),(0,M.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:(0,M.jsx)(ra,{to:`/organizations`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`organizations.new.cancel`)})})]})})]})})}var OP=la(`/organizations/$orgId`)({component:kP});function kP(){let{t:e}=vt(),{orgId:t}=OP.useParams(),{organizations:n}=cN(),r=n.find(e=>e.id===t);return(0,M.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex-1 overflow-auto px-6 py-8`,children:(0,M.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-6`,children:[(0,M.jsxs)(`header`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:r?.name??e(`organizations.title`)}),r?.slug&&(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground font-mono`,children:r.slug})]}),(0,M.jsx)(ya,{})]})})})}function AP(){let e=o_(),[t,n]=(0,j.useState)([]),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null),s=(0,j.useCallback)(async()=>{if(e?.oauth?.applications){i(!0),o(null);try{n((await e.oauth.applications.list())?.applications??[])}catch(e){o(e),n([])}finally{i(!1)}}},[e]);return(0,j.useEffect)(()=>{s()},[s]),{applications:t,loading:r,error:a,reload:s}}function jP(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null),[a,o]=(0,j.useState)(null);return{register:(0,j.useCallback)(async t=>{if(!e?.oauth?.applications?.register)throw Error(`Client not ready`);n(!0),i(null);try{let n=await e.oauth.applications.register(t);return o(n),n}catch(e){throw i(e),e}finally{n(!1)}},[e]),registering:t,error:r,lastResult:a}}function MP(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null);return{remove:(0,j.useCallback)(async t=>{if(!e?.oauth?.applications?.delete)throw Error(`Client not ready`);n(!0),i(null);try{return await e.oauth.applications.delete(t)}catch(e){throw i(e),e}finally{n(!1)}},[e]),deleting:t,error:r}}function NP(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null);return{submit:(0,j.useCallback)(async t=>{if(!e?.oauth?.consent)throw Error(`Client not ready`);n(!0),i(null);try{return await e.oauth.consent(t)}catch(e){throw i(e),e}finally{n(!1)}},[e]),submitting:t,error:r}}var PP=la(`/oauth/consent`)({validateSearch:e=>e,component:FP});function FP(){let{t:e}=vt(),t=Hi(),n=o_(),{user:r,loading:i}=sN(),{submit:a,submitting:o}=NP(),[s,c]=(0,j.useState)(null),l=typeof window<`u`?window.location.search:``,u=l.startsWith(`?`)?l.slice(1):l,d=new URLSearchParams(u),f=d.get(`client_id`)??void 0,p=d.get(`scope`)??``;(0,j.useEffect)(()=>{i||r||t({to:`/login`,search:{redirect:window.location.pathname+window.location.search}})},[r,i,t]),(0,j.useEffect)(()=>{if(!f||!n?.oauth?.applications?.getPublic)return;let e=!1;return n.oauth.applications.getPublic(f).then(t=>{if(e)return;let n=t?.data??t;c({name:n?.name??n?.client_name,icon:n?.icon??n?.logo_uri})},()=>{}),()=>{e=!0}},[n,f]);let m=p.split(/\s+/).filter(Boolean),h=async t=>{try{let n=await a({accept:t,oauth_query:u}),r=n?.redirect_uri??n?.redirectURI??n?.url;if(r){window.location.href=r;return}K({title:e(t?`oauth.consent.granted`:`oauth.consent.denied`),description:e(`oauth.consent.noRedirect`),variant:t?void 0:`destructive`})}catch(t){K({title:e(`oauth.consent.failed`),description:t.message,variant:`destructive`})}},g=s?.name??f??e(`oauth.consent.unknownApp`);return(0,M.jsx)(`div`,{className:`flex min-h-svh w-full flex-1 items-center justify-center bg-background px-4`,children:(0,M.jsxs)($,{className:`w-full max-w-md`,children:[(0,M.jsxs)(AN,{className:`items-center text-center`,children:[(0,M.jsx)(`div`,{className:`mb-3 rounded-full border bg-muted p-3`,children:s?.icon?(0,M.jsx)(`img`,{src:s.icon,alt:``,className:`h-8 w-8 rounded`,onError:e=>e.currentTarget.style.display=`none`}):(0,M.jsx)(By,{className:`h-7 w-7 text-muted-foreground`})}),(0,M.jsx)(jN,{className:`text-xl`,children:e(`oauth.consent.title`,{appName:g})}),(0,M.jsx)(MN,{children:e(`oauth.consent.request`,{appName:g,suffix:r?.email?` (${r.email})`:``})})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[m.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`mb-2 text-sm font-medium`,children:e(`oauth.consent.willAllow`)}),(0,M.jsx)(`ul`,{className:`space-y-1.5 rounded-md border bg-muted/40 p-3 text-sm`,children:m.map(t=>(0,M.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(wy,{className:`mt-0.5 h-4 w-4 text-green-600 dark:text-green-400`}),(0,M.jsx)(`span`,{children:IP(t,e)})]},t))})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pt-2`,children:[(0,M.jsxs)(Q,{variant:`outline`,onClick:()=>h(!1),disabled:o,children:[(0,M.jsx)(pb,{className:`mr-2 h-4 w-4`}),e(`oauth.consent.deny`)]}),(0,M.jsxs)(Q,{onClick:()=>h(!0),disabled:o,children:[(0,M.jsx)(wy,{className:`mr-2 h-4 w-4`}),e(o?`oauth.consent.submitting`:`oauth.consent.authorize`)]})]}),(0,M.jsx)(`p`,{className:`pt-2 text-center text-xs text-muted-foreground`,children:e(`oauth.consent.footer`)})]})]})})}function IP(e,t){switch(e){case`openid`:return t(`oauth.consent.scope.openid`);case`profile`:return t(`oauth.consent.scope.profile`);case`email`:return t(`oauth.consent.scope.email`);case`offline_access`:return t(`oauth.consent.scope.offlineAccess`);default:return e}}var LP=la(`/auth/device`)({validateSearch:e=>({user_code:e.user_code??e.code??``}),component:zP});function RP({children:e}){return(0,M.jsx)(`div`,{className:`flex min-h-svh w-full flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10`,children:(0,M.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-6`,children:[(0,M.jsxs)(`a`,{href:`#`,className:`flex items-center gap-2 self-center font-medium`,children:[(0,M.jsx)(`div`,{className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground`,children:(0,M.jsx)(Iy,{className:`size-4`})}),`ObjectStack`]}),(0,M.jsx)(`div`,{className:`flex flex-col gap-6`,children:e})]})})}function zP(){let{t:e}=vt(),{user_code:t}=LP.useSearch(),{user:n,loading:r}=sN(),i=Hi(),[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(!1),[d,f]=(0,j.useState)(!1),[p,m]=(0,j.useState)(``);return t?r?(0,M.jsx)(RP,{children:(0,M.jsx)($,{children:(0,M.jsx)(AN,{className:`text-center`,children:(0,M.jsx)(MN,{children:e(`auth.device.loading`)})})})}):n?l?(0,M.jsx)(RP,{children:(0,M.jsx)($,{children:(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(ky,{className:`h-10 w-10 text-green-500 mx-auto mb-2`}),(0,M.jsx)(jN,{children:e(`auth.device.approvedTitle`)}),(0,M.jsx)(MN,{children:e(`auth.device.approvedDescription`)})]})})}):d?(0,M.jsx)(RP,{children:(0,M.jsx)($,{children:(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{children:e(`auth.device.deniedTitle`)}),(0,M.jsx)(MN,{children:e(`auth.device.deniedDescription`)})]})})}):(0,M.jsx)(RP,{children:(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{children:e(`auth.device.title`)}),(0,M.jsx)(MN,{children:e(`auth.device.subtitle`,{email:n.email})})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`rounded-md border bg-background px-4 py-3 text-center`,children:[(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:e(`auth.device.userCodeLabel`)}),(0,M.jsx)(`p`,{className:`font-mono font-semibold tracking-widest text-lg`,children:t})]}),(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(`p`,{className:`text-sm text-center text-muted-foreground`,children:e(`auth.device.loggedInAs`,{email:n.email})}),p&&(0,M.jsx)(`p`,{className:`text-sm text-destructive text-center`,children:p}),(0,M.jsx)(Q,{onClick:async()=>{m(``),o(!0);try{let n=await fetch(`/api/v1/auth/device/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({userCode:t})});if(!n.ok){let t=await n.json().catch(()=>({}));throw Error(t?.message??t?.error?.message??e(`auth.device.approveFailed`))}u(!0),K({title:e(`auth.device.approveSuccess`),description:e(`auth.device.approveSuccessDescription`)})}catch(t){m(t?.message??e(`auth.device.approveFailed`))}finally{o(!1)}},className:`w-full`,disabled:a||s,children:e(a?`auth.device.approving`:`auth.device.approve`)}),(0,M.jsx)(Q,{onClick:async()=>{m(``),c(!0);try{await fetch(`/api/v1/auth/device/deny`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({userCode:t})}),f(!0)}catch(t){m(t?.message??e(`auth.device.denyFailed`))}finally{c(!1)}},variant:`outline`,className:`w-full`,disabled:a||s,children:e(s?`auth.device.denying`:`auth.device.deny`)}),(0,M.jsx)(`div`,{className:`text-center`,children:(0,M.jsx)(`button`,{type:`button`,className:`text-sm text-muted-foreground underline-offset-4 hover:underline`,onClick:()=>i({to:`/`}),children:e(`auth.device.cancel`)})})]})]})]})}):(0,M.jsx)(Ui,{to:`/login`,search:{redirect:`/auth/device?user_code=${encodeURIComponent(t)}`}}):(0,M.jsx)(RP,{children:(0,M.jsx)($,{children:(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{children:e(`auth.device.invalidTitle`)}),(0,M.jsx)(MN,{children:e(`auth.device.invalidDescription`)})]})})})}var BP=la(`/account/two-factor`)({component:VP});function VP(){let{t:e}=vt(),t=o_(),{user:n,loading:r,refresh:i}=sN(),[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(!1),[d,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(null),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(``),[C,w]=(0,j.useState)(!1),[T,E]=(0,j.useState)(``),[D,O]=(0,j.useState)(!1),[ee,te]=(0,j.useState)(null);(0,j.useEffect)(()=>{r||o(!!n?.twoFactorEnabled)},[r,n?.twoFactorEnabled]);let ne=async n=>{n.preventDefault(),u(!0);try{let e=await t.auth.twoFactor.enable({password:s});f(e?.totpURI??null),m(e?.backupCodes??null),c(``)}catch(t){K({title:e(`twoFactor.enableFailed`),description:t.message,variant:`destructive`})}finally{u(!1)}},re=async n=>{n.preventDefault(),b(!0);try{await t.auth.twoFactor.verifyTotp({code:_,trustDevice:h}),K({title:e(`twoFactor.enableSuccess`)}),o(!0),f(null),v(``),await i()}catch(t){K({title:e(`twoFactor.invalidCode`),description:t.message,variant:`destructive`})}finally{b(!1)}},ie=async n=>{n.preventDefault(),w(!0);try{await t.auth.twoFactor.disable({password:x}),K({title:e(`twoFactor.disableSuccess`)}),o(!1),S(``),te(null),await i()}catch(t){K({title:e(`twoFactor.disableFailed`),description:t.message,variant:`destructive`})}finally{w(!1)}},ae=async n=>{n.preventDefault(),O(!0);try{te((await t.auth.twoFactor.generateBackupCodes({password:T}))?.backupCodes??[]),E(``),K({title:e(`twoFactor.backupCodes.regenerated`)})}catch(t){K({title:e(`twoFactor.backupCodes.regenerateFailed`),description:t.message,variant:`destructive`})}finally{O(!1)}},oe=async t=>{try{await navigator.clipboard.writeText(t.join(`
|
|
154
|
-
`)),K({title:e(`twoFactor.backupCodes.copied`)})}catch{K({title:e(`twoFactor.backupCodes.copyFailed`),variant:`destructive`})}},k=(0,M.jsx)(_P,{icon:eb,title:e(`twoFactor.title`),description:e(`twoFactor.notEnabledDescription`),actions:a===!0?(0,M.jsx)(gP,{className:`border-transparent bg-emerald-500/15 font-medium text-emerald-600 dark:text-emerald-400`,children:e(`twoFactor.enabled`)}):a===!1?(0,M.jsx)(gP,{variant:`outline`,className:`font-medium`,children:e(`twoFactor.notEnabled`)}):null});if(a===null)return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)($,{children:[(0,M.jsx)(AN,{children:(0,M.jsx)(jN,{className:`text-base`,children:e(`twoFactor.loadingStatus`)})}),(0,M.jsxs)(NN,{className:`space-y-2`,children:[(0,M.jsx)(eT,{className:`h-4 w-48`}),(0,M.jsx)(eT,{className:`h-9 w-full`}),(0,M.jsx)(eT,{className:`h-9 w-32`})]})]})]});if(d){let t=`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(d)}`;return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`twoFactor.setupTitle`)}),(0,M.jsx)(MN,{children:e(`twoFactor.setupDescription`)})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,M.jsx)(`img`,{src:t,alt:e(`twoFactor.qrAlt`),width:200,height:200,className:`rounded border bg-white p-2`}),(0,M.jsx)(`div`,{className:`w-full rounded bg-muted p-3 font-mono text-xs break-all`,children:d}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`twoFactor.uriHint`)})]}),p&&p.length>0&&(0,M.jsxs)(`div`,{className:`rounded border bg-muted/40 p-3`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:e(`twoFactor.backupCodes.savedTitle`)}),(0,M.jsxs)(Q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>oe(p),children:[(0,M.jsx)(Py,{className:`mr-1 h-3 w-3`}),e(`twoFactor.backupCodes.copy`)]})]}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`twoFactor.backupCodes.savedHint`)}),(0,M.jsx)(`div`,{className:`mt-2 grid grid-cols-2 gap-1 font-mono text-xs`,children:p.map(e=>(0,M.jsx)(`span`,{className:`rounded bg-background px-2 py-1`,children:e},e))})]}),(0,M.jsx)(_S,{}),(0,M.jsxs)(`form`,{onSubmit:re,className:`space-y-3`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`totp-code`,children:e(`twoFactor.verificationCode`)}),(0,M.jsx)(lS,{id:`totp-code`,placeholder:`000000`,maxLength:6,inputMode:`numeric`,autoComplete:`one-time-code`,value:_,onChange:e=>v(e.target.value),required:!0})]}),(0,M.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),e(`twoFactor.trustDevice`)]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsx)(Q,{type:`submit`,disabled:y||_.length<6,children:e(y?`twoFactor.verifying`:`twoFactor.verify`)}),(0,M.jsx)(Q,{type:`button`,variant:`outline`,onClick:()=>f(null),children:e(`twoFactor.cancel`)})]})]})]})]})]})}return a===!0?(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`twoFactor.enabledTitle`,{defaultValue:`Authenticator app`})}),(0,M.jsx)(MN,{children:e(`twoFactor.enabledDescription`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:ie,className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`disable-password`,children:e(`twoFactor.password`)}),(0,M.jsx)(lS,{id:`disable-password`,type:`password`,autoComplete:`current-password`,required:!0,value:x,onChange:e=>S(e.target.value)})]}),(0,M.jsx)(Q,{variant:`destructive`,type:`submit`,disabled:C,children:e(C?`twoFactor.disabling`:`twoFactor.disable`)})]})})]}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsxs)(jN,{className:`text-base flex items-center gap-2`,children:[(0,M.jsx)(By,{className:`h-4 w-4`}),e(`twoFactor.backupCodes.title`)]}),(0,M.jsx)(MN,{children:e(`twoFactor.backupCodes.description`)})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`form`,{onSubmit:ae,className:`space-y-3`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`backup-password`,children:e(`twoFactor.password`)}),(0,M.jsx)(lS,{id:`backup-password`,type:`password`,autoComplete:`current-password`,required:!0,value:T,onChange:e=>E(e.target.value)})]}),(0,M.jsxs)(Q,{type:`submit`,variant:`outline`,disabled:D,children:[(0,M.jsx)(Zy,{className:`mr-2 h-4 w-4`}),e(D?`common.saving`:`twoFactor.backupCodes.regenerate`)]})]}),ee&&ee.length>0&&(0,M.jsxs)(`div`,{className:`rounded border bg-muted/40 p-3`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:e(`twoFactor.backupCodes.newTitle`)}),(0,M.jsxs)(Q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>oe(ee),children:[(0,M.jsx)(Py,{className:`mr-1 h-3 w-3`}),e(`twoFactor.backupCodes.copy`)]})]}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`twoFactor.backupCodes.savedHint`)}),(0,M.jsx)(`div`,{className:`mt-2 grid grid-cols-2 gap-1 font-mono text-xs`,children:ee.map(e=>(0,M.jsx)(`span`,{className:`rounded bg-background px-2 py-1`,children:e},e))})]})]})]})]}):(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`twoFactor.enable`)}),(0,M.jsx)(MN,{children:e(`twoFactor.notEnabledDescription`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:ne,className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`enable-password`,children:e(`twoFactor.password`)}),(0,M.jsx)(lS,{id:`enable-password`,type:`password`,autoComplete:`current-password`,required:!0,value:s,onChange:e=>c(e.target.value),placeholder:e(`twoFactor.passwordPlaceholder`)})]}),(0,M.jsx)(Q,{type:`submit`,disabled:l,className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:e(l?`twoFactor.loading`:`twoFactor.enable`)})]})})]})]})}var HP=[[/Edg\//i,`Edge`],[/OPR\//i,`Opera`],[/Chrome\//i,`Chrome`],[/Firefox\//i,`Firefox`],[/Safari\//i,`Safari`]],UP=[[/Windows NT 10/i,`Windows 10/11`],[/Windows/i,`Windows`],[/Mac OS X|Macintosh/i,`macOS`],[/iPhone|iOS/i,`iOS`],[/iPad/i,`iPadOS`],[/Android/i,`Android`],[/Linux/i,`Linux`]];function WP(e){if(!e)return{browser:`Unknown`,os:`Unknown`,device:`desktop`,label:`Unknown device`,icon:Ly};let t=HP.find(([t])=>t.test(e))?.[1]??`Browser`,n=UP.find(([t])=>t.test(e))?.[1]??`Unknown OS`,r=/iPad|Tablet/i.test(e),i=!r&&/Mobile|Android|iPhone|iPod/i.test(e),a=r?`tablet`:i?`mobile`:`desktop`,o=qy;return o=a===`mobile`?nb:a===`tablet`?ib:/Linux|Windows|Mac/i.test(e)?qy:Ly,{browser:t,os:n,device:a,label:`${t} · ${n}`,icon:o}}var GP=la(`/account/sessions`)({component:KP});function KP(){let{t:e}=vt(),t=o_(),{session:n}=sN(),[r,i]=(0,j.useState)([]),[a,o]=(0,j.useState)(!0),[s,c]=(0,j.useState)(null),[l,u]=(0,j.useState)(!1),d=async()=>{try{i((await t.auth.sessions.list())?.sessions??[])}catch(t){K({title:e(`sessions.loadFailed`),description:t.message,variant:`destructive`})}finally{o(!1)}};(0,j.useEffect)(()=>{d()},[]);let f=async n=>{c(n);try{await t.auth.sessions.revoke(n),K({title:e(`sessions.revoked`)}),await d()}catch(t){K({title:e(`sessions.revokeFailed`),description:t.message,variant:`destructive`})}finally{c(null)}},p=async()=>{u(!0);try{await t.auth.sessions.revokeOthers(),K({title:e(`sessions.othersRevoked`)}),await d()}catch(t){K({title:e(`sessions.revokeOthersFailed`),description:t.message,variant:`destructive`})}finally{u(!1)}},m=n?.token,h=r.find(e=>e.token===m),g=r.filter(e=>e.token!==m);return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:qy,title:e(`sessions.title`),description:e(`sessions.description`),actions:r.length>1?(0,M.jsxs)(Q,{variant:`outline`,size:`sm`,onClick:p,disabled:l,children:[(0,M.jsx)(Wy,{className:`mr-2 h-4 w-4`}),e(l?`sessions.revokingOthers`:`sessions.revokeOthers`)]}):null}),a&&(0,M.jsx)(`div`,{className:`space-y-3`,children:[0,1,2].map(e=>(0,M.jsx)($,{className:`overflow-hidden`,children:(0,M.jsxs)(NN,{className:`flex items-center gap-3 p-4`,children:[(0,M.jsx)(eT,{className:`size-10 rounded-lg`}),(0,M.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,M.jsx)(eT,{className:`h-4 w-40`}),(0,M.jsx)(eT,{className:`h-3 w-64`})]})]})},e))}),!a&&r.length===0&&(0,M.jsx)($,{children:(0,M.jsxs)(NN,{className:`flex flex-col items-center gap-3 p-10 text-center text-sm text-muted-foreground`,children:[(0,M.jsx)(qy,{className:`size-10 text-muted-foreground/50`}),e(`sessions.empty`)]})}),!a&&h&&(0,M.jsx)(qP,{session:h,isCurrent:!0,revoking:!1,onRevoke:()=>void 0,t:e}),!a&&g.length>0&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:e(`sessions.otherDevices`,{defaultValue:`Other signed-in devices`})}),(0,M.jsx)(`div`,{className:`space-y-2`,children:g.map(t=>(0,M.jsx)(qP,{session:t,isCurrent:!1,revoking:s===t.token,onRevoke:()=>f(t.token),t:e},t.id))})]})]})}function qP({session:e,isCurrent:t,revoking:n,onRevoke:r,t:i}){let a=WP(e.userAgent),o=a.icon;return(0,M.jsx)($,{className:t?`border-primary/40 bg-brand-gradient-subtle shadow-sm shadow-primary/10`:`transition-colors hover:bg-accent/30`,children:(0,M.jsxs)(NN,{className:`flex items-center gap-3 p-4`,children:[(0,M.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg `+(t?`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30`:`bg-muted text-muted-foreground`),children:(0,M.jsx)(o,{className:`size-5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`truncate text-sm font-medium`,children:a.label}),t&&(0,M.jsx)(gP,{className:`border-transparent bg-emerald-500/15 text-[10px] font-medium text-emerald-600 dark:text-emerald-400`,children:i(`sessions.current`)})]}),(0,M.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[e.ipAddress&&(0,M.jsx)(`span`,{className:`font-mono`,children:e.ipAddress}),(0,M.jsx)(`span`,{children:i(`sessions.expires`,{date:new Date(e.expiresAt).toLocaleDateString()})})]})]}),!t&&(0,M.jsxs)(Q,{variant:`ghost`,size:`sm`,onClick:r,disabled:n,className:`ml-3 shrink-0 text-muted-foreground hover:text-destructive`,children:[(0,M.jsx)(Wy,{className:`mr-1.5 h-4 w-4`}),i(`sessions.revoke`,{defaultValue:`Revoke`})]})]})})}var JP=Rw,YP=zw,XP=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Bw,{ref:n,className:Z(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));XP.displayName=Bw.displayName;var ZP=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(YP,{children:[(0,M.jsx)(XP,{}),(0,M.jsxs)(Vw,{ref:r,className:Z(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg`,e),...n,children:[t,(0,M.jsxs)(Ww,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,M.jsx)(pb,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));ZP.displayName=Vw.displayName;var QP=({className:e,...t})=>(0,M.jsx)(`div`,{className:Z(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});QP.displayName=`DialogHeader`;var $P=({className:e,...t})=>(0,M.jsx)(`div`,{className:Z(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});$P.displayName=`DialogFooter`;var eF=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Hw,{ref:n,className:Z(`text-lg font-semibold leading-none tracking-tight`,e),...t}));eF.displayName=Hw.displayName;var tF=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Uw,{ref:n,className:Z(`text-sm text-muted-foreground`,e),...t}));tF.displayName=Uw.displayName;var nF=la(`/account/security`)({component:rF});function rF(){let{t:e}=vt(),t=o_(),n=Hi(),{user:r,logout:i}=sN(),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(!0),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(!1),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(``),[C,w]=(0,j.useState)(``),[T,E]=(0,j.useState)(!1);return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:tb,title:e(`security.title`),description:e(`security.description`)}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsxs)(jN,{className:`text-base flex items-center gap-2`,children:[(0,M.jsx)(tb,{className:`h-4 w-4 text-primary`}),e(`security.changePasswordTitle`,{defaultValue:`Change password`})]}),(0,M.jsx)(MN,{children:e(`security.changePasswordDescription`,{defaultValue:`Use at least 8 characters. Mix letters, numbers and symbols for strength.`})})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),s!==l){K({title:e(`security.passwordsMismatch`),variant:`destructive`});return}m(!0);try{await t.auth.changePassword({currentPassword:a,newPassword:s,revokeOtherSessions:d}),K({title:e(`security.changed`)}),o(``),c(``),u(``)}catch(t){K({title:e(`security.changeFailed`),description:t.message,variant:`destructive`})}finally{m(!1)}},className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`current-password`,children:e(`security.currentPassword`)}),(0,M.jsx)(lS,{id:`current-password`,type:`password`,autoComplete:`current-password`,required:!0,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`new-password`,children:e(`security.newPassword`)}),(0,M.jsx)(lS,{id:`new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:s,onChange:e=>c(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`confirm-new-password`,children:e(`security.confirmPassword`)}),(0,M.jsx)(lS,{id:`confirm-new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:l,onChange:e=>u(e.target.value)})]}),(0,M.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),e(`security.revokeOtherSessions`)]}),(0,M.jsx)(Q,{type:`submit`,disabled:p,children:e(p?`common.saving`:`security.submit`)})]})})]}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsxs)(jN,{className:`text-base flex items-center gap-2`,children:[(0,M.jsx)(Ky,{className:`h-4 w-4 text-primary`}),e(`security.email.title`)]}),(0,M.jsx)(MN,{children:e(`security.email.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),!(!h||h===r?.email)){v(!0);try{await t.auth.changeEmail({newEmail:h,callbackURL:window.location.origin+`/login`}),K({title:e(`security.email.requested`),description:e(`security.email.checkInbox`,{email:h})}),g(``)}catch(t){K({title:e(`security.email.requestFailed`),description:t.message,variant:`destructive`})}finally{v(!1)}}},className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`current-email`,children:e(`security.email.current`)}),(0,M.jsx)(lS,{id:`current-email`,value:r?.email??``,disabled:!0})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`new-email`,children:e(`security.email.new`)}),(0,M.jsx)(lS,{id:`new-email`,type:`email`,value:h,onChange:e=>g(e.target.value),placeholder:e(`security.email.placeholder`),required:!0})]}),(0,M.jsx)(Q,{type:`submit`,disabled:_||!h||h===r?.email,children:e(_?`common.saving`:`security.email.submit`)})]})})]}),(0,M.jsxs)($,{className:`border-destructive/40 bg-destructive/5`,children:[(0,M.jsxs)(AN,{children:[(0,M.jsxs)(jN,{className:`text-base flex items-center gap-2 text-destructive`,children:[(0,M.jsx)(ob,{className:`h-4 w-4`}),e(`security.delete.title`)]}),(0,M.jsx)(MN,{children:e(`security.delete.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(Q,{variant:`destructive`,onClick:()=>b(!0),children:[(0,M.jsx)(ab,{className:`mr-2 h-4 w-4`}),e(`security.delete.cta`)]})})]}),(0,M.jsx)(JP,{open:y,onOpenChange:b,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`security.delete.dialogTitle`)}),(0,M.jsx)(tF,{children:e(`security.delete.dialogDescription`,{email:r?.email??``})})]}),(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`delete-password`,children:e(`security.delete.password`)}),(0,M.jsx)(lS,{id:`delete-password`,type:`password`,autoComplete:`current-password`,value:x,onChange:e=>S(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`delete-confirm`,children:e(`security.delete.typeEmail`,{email:r?.email??``})}),(0,M.jsx)(lS,{id:`delete-confirm`,value:C,onChange:e=>w(e.target.value),placeholder:r?.email??``})]})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>b(!1),disabled:T,children:e(`common.cancel`)}),(0,M.jsx)(Q,{variant:`destructive`,onClick:async()=>{if(C!==r?.email){K({title:e(`security.delete.confirmationMismatch`),description:e(`security.delete.confirmationHint`,{email:r?.email??``}),variant:`destructive`});return}E(!0);try{await t.auth.deleteUser({password:x}),K({title:e(`security.delete.success`)});try{await i()}catch{}n({to:`/login`,replace:!0})}catch(t){K({title:e(`security.delete.failed`),description:t.message,variant:`destructive`})}finally{E(!1)}},disabled:T||C!==r?.email,children:e(T?`common.saving`:`security.delete.confirm`)})]})]})})]})}var iF=la(`/account/profile`)({component:aF});function aF(){let{t:e}=vt(),t=o_(),{user:n,refresh:r}=sN(),[i,a]=(0,j.useState)(n?.name??``),[o,s]=(0,j.useState)(n?.image??null),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(!1),f=(0,j.useRef)(null);(0,j.useEffect)(()=>{a(n?.name??``),s(n?.image??null)},[n?.id,n?.name,n?.image]);let p=async n=>{n.preventDefault(),l(!0);try{await t.auth.updateUser({name:i,image:o}),await r(),K({title:e(`profile.updated`)})}catch(t){K({title:e(`profile.updateFailed`),description:t.message,variant:`destructive`})}finally{l(!1)}},m=()=>f.current?.click(),h=async n=>{let i=n.target.files?.[0];if(n.target.value=``,i){d(!0);try{if(!t?.storage?.upload)throw Error(e(`profile.avatarStorageUnavailable`));let n=await t.storage.upload(i,`user`),a=n?.data?.url??n?.url;if(!a)throw Error(`Upload returned no URL`);s(a),await t.auth.updateUser({image:a}),await r(),K({title:e(`profile.avatarUpdated`)})}catch(t){K({title:e(`profile.avatarUploadFailed`),description:t.message,variant:`destructive`})}finally{d(!1)}}},g=(n?.name??n?.email??`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card`,children:[(0,M.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-24 bg-brand-gradient`,"aria-hidden":!0}),(0,M.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-24 opacity-30`,style:{backgroundImage:`radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.4), transparent 60%)`},"aria-hidden":!0}),(0,M.jsx)(`div`,{className:`relative px-5 pb-5 pt-12 sm:px-6 sm:pb-6 sm:pt-16`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-end sm:gap-5`,children:[(0,M.jsxs)(QM,{className:`size-20 shrink-0 ring-4 ring-card shadow-md`,children:[o?(0,M.jsx)($M,{src:o,alt:n?.name??``}):null,(0,M.jsx)(eN,{className:`bg-brand-gradient text-base font-semibold text-primary-foreground`,children:g})]}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,M.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight`,children:n?.name||e(`profile.namePlaceholder`)}),(0,M.jsx)(`p`,{className:`truncate text-sm text-muted-foreground`,children:n?.email})]}),(0,M.jsxs)(Q,{type:`button`,variant:`outline`,size:`sm`,onClick:m,disabled:u,className:`self-start sm:self-auto`,children:[(0,M.jsx)(sb,{className:`mr-2 h-4 w-4`}),e(u?`profile.avatarUploading`:`profile.changeAvatar`)]}),(0,M.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,className:`hidden`,onChange:h})]})})]}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`profile.title`)}),(0,M.jsx)(MN,{children:e(`profile.description`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(`form`,{onSubmit:p,className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`profile-email`,children:e(`profile.email`)}),(0,M.jsx)(lS,{id:`profile-email`,value:n?.email??``,disabled:!0})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)(KN,{htmlFor:`profile-name`,children:e(`profile.name`)}),(0,M.jsx)(lS,{id:`profile-name`,value:i,onChange:e=>a(e.target.value),placeholder:e(`profile.namePlaceholder`)})]}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`profile.avatarHint`)}),(0,M.jsx)(Q,{type:`submit`,disabled:c,className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:e(c?`common.saving`:`profile.save`)})]})})]})]})}var oF=la(`/account/linked-accounts`)({component:cF}),sF={google:`Google`,github:`GitHub`,microsoft:`Microsoft`,apple:`Apple`,discord:`Discord`,gitlab:`GitLab`,twitter:`Twitter / X`,facebook:`Facebook`};function cF(){let{t:e}=vt(),t=o_(),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!0),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(async()=>{if(t?.auth?.accounts){a(!0);try{let e=await t.auth.accounts.list();r(e?.accounts??e?.data??(Array.isArray(e)?e:[]))}catch{r([])}finally{a(!1)}}},[t]);(0,j.useEffect)(()=>{c()},[c]);let l=async n=>{if(confirm(e(`linkedAccounts.unlinkConfirm`,{provider:sF[n.providerId]??n.providerId}))){s(n.id);try{await t.auth.accounts.unlink({providerId:n.providerId,accountId:n.accountId}),K({title:e(`linkedAccounts.unlinked`)}),await c()}catch(t){K({title:e(`linkedAccounts.unlinkFailed`),description:t.message,variant:`destructive`})}finally{s(null)}}},u=async n=>{try{let r=await t.auth.accounts.linkSocial({provider:n,callbackURL:window.location.href}),i=r?.url??r?.data?.url;i?window.location.assign(i):K({title:e(`linkedAccounts.linkFailed`),variant:`destructive`})}catch(t){K({title:e(`linkedAccounts.linkFailed`),description:t.message,variant:`destructive`})}},d=new Set(n.map(e=>e.providerId)),f=Object.keys(sF).filter(e=>!d.has(e));return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:Uy,title:e(`linkedAccounts.title`),description:e(`linkedAccounts.description`)}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`linkedAccounts.connectedTitle`,{defaultValue:`Connected providers`})}),(0,M.jsx)(MN,{children:e(`linkedAccounts.connectedDescription`,{defaultValue:`Sign-in providers currently linked to this account.`})})]}),(0,M.jsxs)(NN,{children:[i&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(eT,{className:`h-12 w-full`}),(0,M.jsx)(eT,{className:`h-12 w-full`})]}),!i&&n.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(Uy,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`linkedAccounts.empty`)})]}),!i&&n.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:n.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)(gP,{variant:`secondary`,children:sF[t.providerId]??t.providerId}),t.createdAt&&(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`linkedAccounts.linkedOn`,{date:new Date(t.createdAt).toLocaleDateString()})})]}),(0,M.jsxs)(Q,{variant:`ghost`,size:`sm`,disabled:o===t.id,onClick:()=>l(t),children:[(0,M.jsx)(Hy,{className:`mr-1 h-4 w-4`}),e(`linkedAccounts.unlink`)]})]},t.id))})]})]}),f.length>0&&(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`linkedAccounts.addTitle`)}),(0,M.jsx)(MN,{children:e(`linkedAccounts.addDescription`)})]}),(0,M.jsx)(NN,{children:(0,M.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:f.map(e=>(0,M.jsxs)(Q,{variant:`outline`,size:`sm`,onClick:()=>u(e),children:[(0,M.jsx)(Xy,{className:`mr-1 h-3 w-3`}),sF[e]]},e))})})]})]})}function lF(e){let t=o_(),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!1),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(async()=>{if(!(!e||!t?.organizations)){a(!0),s(null);try{let n=await t.organizations.listMembers(e);r(n?.members??n?.data?.members??(Array.isArray(n)?n:[]))}catch(e){s(e),r([])}finally{a(!1)}}},[t,e]);return(0,j.useEffect)(()=>{c()},[c]),{members:n,loading:i,error:o,reload:c,inviteMember:(0,j.useCallback)(async(n,r=`member`)=>{if(!e||!t?.organizations)throw Error(`Organization ID or client not available`);let i=await t.organizations.invite({email:n,role:r,organizationId:e});return await c(),i},[t,e,c]),removeMember:(0,j.useCallback)(async n=>{if(!e||!t?.organizations?.removeMember)throw Error(`Organization ID or client not available`);let r=await t.organizations.removeMember(e,{memberIdOrEmail:n});return await c(),r},[t,e,c]),updateMemberRole:(0,j.useCallback)(async(n,r)=>{if(!e||!t?.organizations?.updateMemberRole)throw Error(`Organization ID or client not available`);let i=await t.organizations.updateMemberRole(e,{memberId:n,role:r});return await c(),i},[t,e,c])}}function uF(e){let t=o_(),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!1),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(async()=>{if(!(!e||!t?.organizations?.invitations)){a(!0),s(null);try{let n=await t.organizations.invitations.list(e);r(n?.invitations??n?.data?.invitations??(Array.isArray(n)?n:[]))}catch(e){s(e),r([])}finally{a(!1)}}},[t,e]);return(0,j.useEffect)(()=>{c()},[c]),{invitations:n,loading:i,error:o,reload:c,cancelInvitation:(0,j.useCallback)(async e=>{if(!t?.organizations?.invitations?.cancel)throw Error(`Client not available`);let n=await t.organizations.invitations.cancel(e);return await c(),n},[t,c]),resendInvitation:(0,j.useCallback)(async e=>{if(!t?.organizations?.invitations?.resend)throw Error(`Client not available`);let n=await t.organizations.invitations.resend({id:e.id,email:e.email,role:e.role,organizationId:e.organizationId,teamId:e.teamId??null});return await c(),n},[t,c])}}function dF(){let e=o_(),[t,n]=(0,j.useState)([]),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null),s=(0,j.useCallback)(async()=>{if(e?.organizations?.invitations?.listMine){i(!0),o(null);try{let t=await e.organizations.invitations.listMine();n(t?.invitations??t?.data?.invitations??(Array.isArray(t)?t:[]))}catch(e){o(e),n([])}finally{i(!1)}}},[e]);return(0,j.useEffect)(()=>{s()},[s]),{invitations:t,loading:r,error:a,reload:s,accept:(0,j.useCallback)(async t=>{let n=await e.organizations.invitations.accept(t);return await s(),n},[e,s]),reject:(0,j.useCallback)(async t=>{let n=await e.organizations.invitations.reject(t);return await s(),n},[e,s])}}var fF=la(`/account/invitations`)({component:pF});function pF(){let{t:e}=vt(),{invitations:t,loading:n,accept:r,reject:i}=dF(),a=t.filter(e=>e.status===`pending`),o=async t=>{try{await r(t),K({title:e(`invitations.accepted`)})}catch(t){K({title:e(`invitations.acceptFailed`),description:t.message,variant:`destructive`})}},s=async t=>{try{await i(t),K({title:e(`invitations.rejected`)})}catch(t){K({title:e(`invitations.rejectFailed`),description:t.message,variant:`destructive`})}};return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:zy,title:e(`invitations.title`),description:e(`invitations.description`),actions:a.length>0?(0,M.jsx)(gP,{variant:`outline`,className:`font-medium`,children:e(`invitations.pendingCount`,{count:a.length,defaultValue:`{{count}} pending`})}):null}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`invitations.pendingTitle`,{defaultValue:`Pending invitations`})}),(0,M.jsx)(MN,{children:e(`invitations.pendingDescription`,{defaultValue:`Accept to join an organization, or reject to remove it from your inbox.`})})]}),(0,M.jsxs)(NN,{children:[n&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(eT,{className:`h-12 w-full`}),(0,M.jsx)(eT,{className:`h-12 w-full`})]}),!n&&a.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(zy,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`invitations.empty`)})]}),!n&&a.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:a.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`div`,{className:`text-sm font-medium`,children:t.organizationId}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,M.jsx)(gP,{variant:`outline`,className:`text-xs`,children:e(`common.roles.${t.role}`)}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`invitations.expires`,{date:new Date(t.expiresAt).toLocaleDateString()})})]})]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsxs)(Q,{size:`sm`,onClick:()=>o(t.id),children:[(0,M.jsx)(wy,{className:`mr-1 h-4 w-4`}),e(`invitations.accept`)]}),(0,M.jsxs)(Q,{size:`sm`,variant:`outline`,onClick:()=>s(t.id),children:[(0,M.jsx)(pb,{className:`mr-1 h-4 w-4`}),e(`invitations.reject`)]})]})]},t.id))})]})]})]})}var mF=la(`/accept-invitation/$invitationId`)({component:hF});function hF(){let{t:e}=vt(),{invitationId:t}=mF.useParams(),n=Hi(),r=o_(),{user:i,loading:a,reloadOrganizations:o}=sN(),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{a||i||n({to:`/login`,search:{redirect:`/accept-invitation/${t}`},replace:!0})},[a,i,t,n]),(0,M.jsx)(`div`,{className:`flex min-h-svh w-full flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10`,children:(0,M.jsx)(`div`,{className:`flex w-full max-w-sm flex-col gap-6`,children:(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{className:`text-center`,children:[(0,M.jsx)(jN,{className:`text-xl`,children:e(`acceptInvitation.title`)}),(0,M.jsx)(MN,{children:e(`acceptInvitation.description`)})]}),(0,M.jsxs)(NN,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(Q,{className:`w-full`,onClick:async()=>{c(!0);try{await r.organizations.invitations.accept(t),await o().catch(()=>{}),K({title:e(`acceptInvitation.accepted`)}),n({to:`/organizations`})}catch(t){K({title:e(`acceptInvitation.acceptFailed`),description:t.message,variant:`destructive`})}finally{c(!1)}},disabled:s||l,children:e(s?`acceptInvitation.accepting`:`acceptInvitation.accept`)}),(0,M.jsx)(Q,{variant:`outline`,className:`w-full`,onClick:async()=>{u(!0);try{await r.organizations.invitations.reject(t),K({title:e(`acceptInvitation.declined`)}),n({to:`/organizations`})}catch(t){K({title:e(`acceptInvitation.declineFailed`),description:t.message,variant:`destructive`})}finally{u(!1)}},disabled:s||l,children:e(l?`acceptInvitation.declining`:`acceptInvitation.decline`)})]})]})})})}var gF=la(`/organizations/$orgId/`)({component:()=>{let{orgId:e}=gF.useParams();return(0,M.jsx)(Ui,{to:`/organizations/$orgId/general`,params:{orgId:e},replace:!0})}}),_F=la(`/account/oauth-applications/`)({component:vF});function vF(){let{t:e}=vt(),t=Hi(),{applications:n,loading:r,reload:i}=AP(),{remove:a,deleting:o}=MP(),[s,c]=(0,j.useState)(null);return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:By,title:e(`oauth.applications.title`),description:e(`oauth.applications.description`),actions:(0,M.jsxs)(Q,{onClick:()=>t({to:`/account/oauth-applications/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:[(0,M.jsx)(Xy,{className:`mr-2 h-4 w-4`}),e(`oauth.applications.new`)]})}),r?(0,M.jsx)(`div`,{className:`space-y-3`,children:[0,1,2].map(e=>(0,M.jsx)($,{children:(0,M.jsxs)(NN,{className:`flex items-center gap-3 p-4`,children:[(0,M.jsx)(eT,{className:`size-10 rounded-md`}),(0,M.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,M.jsx)(eT,{className:`h-4 w-40`}),(0,M.jsx)(eT,{className:`h-3 w-64`})]})]})},e))}):n.length===0?(0,M.jsx)($,{children:(0,M.jsxs)(NN,{className:`flex flex-col items-center gap-3 p-12 text-center`,children:[(0,M.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-lg bg-brand-gradient-subtle text-primary ring-1 ring-primary/15`,children:(0,M.jsx)(By,{className:`h-6 w-6`})}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`font-medium`,children:e(`oauth.applications.emptyTitle`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.emptyDescription`)})]}),(0,M.jsxs)(Q,{onClick:()=>t({to:`/account/oauth-applications/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20`,children:[(0,M.jsx)(Xy,{className:`mr-2 h-4 w-4`}),e(`oauth.applications.register`)]})]})}):(0,M.jsx)(`div`,{className:`grid gap-3`,children:n.map(t=>(0,M.jsx)($,{className:`group transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5`,children:(0,M.jsx)(AN,{className:`pb-3`,children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsxs)(ra,{to:`/account/oauth-applications/$clientId`,params:{clientId:t.client_id},className:`flex flex-1 items-center gap-3`,children:[(0,M.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-md bg-brand-gradient-subtle text-primary ring-1 ring-primary/15 transition-transform group-hover:scale-105`,children:(0,M.jsx)(By,{className:`h-5 w-5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(jN,{className:`text-base`,children:t.name}),(0,M.jsx)(MN,{className:`font-mono text-xs`,children:t.client_id})]}),(0,M.jsx)(gP,{variant:`outline`,className:`capitalize`,children:t.type}),t.disabled&&(0,M.jsx)(gP,{variant:`destructive`,children:e(`oauth.applications.disabled`)})]}),(0,M.jsx)(Q,{variant:`ghost`,size:`icon`,className:`text-muted-foreground hover:text-destructive`,onClick:e=>{e.preventDefault(),e.stopPropagation(),c(t)},children:(0,M.jsx)(ab,{className:`h-4 w-4`})})]})})},t.id))}),(0,M.jsx)(JP,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`oauth.applications.deleteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`oauth.applications.deleteDialogDescription`,{name:s?.name??``})})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>c(null),disabled:o,children:e(`common.cancel`)}),(0,M.jsx)(Q,{variant:`destructive`,onClick:async()=>{if(s)try{await a(s.client_id),K({title:e(`oauth.applications.deleted`)}),c(null),await i()}catch(t){K({title:e(`oauth.applications.deleteFailed`),description:t.message,variant:`destructive`})}},disabled:o,children:e(o?`oauth.applications.deleting`:`common.delete`)})]})]})})]})}function yF(e,[t,n]){return Math.min(n,Math.max(t,e))}function bF(e){let t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xF=[` `,`Enter`,`ArrowUp`,`ArrowDown`],SF=[` `,`Enter`],CF=`Select`,[wF,TF,EF]=j_(CF),[DF,OF]=S_(CF,[EF,yD]),kF=yD(),[AF,jF]=DF(CF),[MF,NF]=DF(CF),PF=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=kF(t),[g,_]=j.useState(null),[v,y]=j.useState(null),[b,x]=j.useState(!1),S=mk(l),[C,w]=ov({prop:r,defaultProp:i??!1,onChange:a,caller:CF}),[T,E]=ov({prop:o,defaultProp:s,onChange:c,caller:CF}),D=j.useRef(null),O=g?m||!!g.closest(`form`):!0,[ee,te]=j.useState(new Set),ne=Array.from(ee).map(e=>e.props.value).join(`;`);return(0,M.jsx)(FD,{...h,children:(0,M.jsxs)(AF,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:bS(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,M.jsx)(wF.Provider,{scope:t,children:(0,M.jsx)(MF,{scope:e.__scopeSelect,onNativeOptionAdd:j.useCallback(e=>{te(t=>new Set(t).add(e))},[]),onNativeOptionRemove:j.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,M.jsxs)(kI,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,M.jsx)(`option`,{value:``}):null,Array.from(ee)]},ne):null]})})};PF.displayName=CF;var FF=`SelectTrigger`,IF=j.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kF(n),o=jF(FF,n),s=o.disabled||r,c=b_(t,o.onTriggerChange),l=TF(n),u=j.useRef(`touch`),[d,f,p]=jI(e=>{let t=l().filter(e=>!e.disabled),n=MI(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,M.jsx)(ID,{asChild:!0,...a,children:(0,M.jsx)(M_.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":AI(o.value)?``:void 0,...i,ref:c,onClick:q(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:q(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:q(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&xF.includes(e.key)&&(m(),e.preventDefault())})})})});IF.displayName=FF;var LF=`SelectValue`,RF=j.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=jF(LF,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=b_(t,c.onValueNodeChange);return Z_(()=>{l(u)},[l,u]),(0,M.jsx)(M_.span,{...s,ref:d,style:{pointerEvents:`none`},children:AI(c.value)?(0,M.jsx)(M.Fragment,{children:o}):a})});RF.displayName=LF;var zF=`SelectIcon`,BF=j.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,M.jsx)(M_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});BF.displayName=zF;var VF=`SelectPortal`,HF=e=>(0,M.jsx)($_,{asChild:!0,...e});HF.displayName=VF;var UF=`SelectContent`,WF=j.forwardRef((e,t)=>{let n=jF(UF,e.__scopeSelect),[r,i]=j.useState();if(Z_(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Gi.createPortal((0,M.jsx)(KF,{scope:e.__scopeSelect,children:(0,M.jsx)(wF.Slot,{scope:e.__scopeSelect,children:(0,M.jsx)(`div`,{children:e.children})})}),t):null}return(0,M.jsx)(XF,{...e,ref:t})});WF.displayName=UF;var GF=10,[KF,qF]=DF(UF),JF=`SelectContentImpl`,YF=w_(`SelectContent.RemoveScroll`),XF=j.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=jF(UF,n),[y,b]=j.useState(null),[x,S]=j.useState(null),C=b_(t,e=>b(e)),[w,T]=j.useState(null),[E,D]=j.useState(null),O=TF(n),[ee,te]=j.useState(!1),ne=j.useRef(!1);j.useEffect(()=>{if(y)return rw(y)},[y]),RS();let re=j.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),ie=j.useCallback(()=>re([w,y]),[re,w,y]);j.useEffect(()=>{ee&&ie()},[ee,ie]);let{onOpenChange:ae,triggerPointerDownPosRef:oe}=v;j.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(oe.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(oe.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||ae(!1),document.removeEventListener(`pointermove`,t),oe.current=null};return oe.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,ae,oe]),j.useEffect(()=>{let e=()=>ae(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ae]);let[k,se]=jI(e=>{let t=O().filter(e=>!e.disabled),n=MI(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ce=j.useCallback((e,t,n)=>{let r=!ne.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(ne.current=!0))},[v.value]),le=j.useCallback(()=>y?.focus(),[y]),ue=j.useCallback((e,t,n)=>{let r=!ne.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),A=r===`popper`?eI:QF,de=A===eI?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,M.jsx)(KF,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ce,selectedItem:w,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:ie,selectedItemText:E,position:r,isPositioned:ee,searchRef:k,children:(0,M.jsx)(JC,{as:YF,allowPinchZoom:!0,children:(0,M.jsx)(TS,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:q(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,M.jsx)(H_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,M.jsx)(A,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>te(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:q(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&se(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>re(t)),e.preventDefault()}})})})})})})});XF.displayName=JF;var ZF=`SelectItemAlignedPosition`,QF=j.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=jF(UF,n),o=qF(UF,n),[s,c]=j.useState(null),[l,u]=j.useState(null),d=b_(t,e=>u(e)),f=TF(n),p=j.useRef(!1),m=j.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=j.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-GF,d=yF(a,[GF,Math.max(GF,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-GF,d=yF(a,[GF,Math.max(GF,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-GF*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-GF,D=c-E,O=g.offsetHeight/2,ee=g.offsetTop+O,te=m+v+ee,ne=x-te;if(te<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=te+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+ne;s.style.height=t+`px`,h.scrollTop=te-E+h.offsetTop}s.style.margin=`${GF}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Z_(()=>y(),[y]);let[b,x]=j.useState();return Z_(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,M.jsx)(tI,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:j.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,M.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,M.jsx)(M_.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});QF.displayName=ZF;var $F=`SelectPopperPosition`,eI=j.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=GF,...a}=e,o=kF(n);return(0,M.jsx)(LD,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});eI.displayName=$F;var[tI,nI]=DF(UF,{}),rI=`SelectViewport`,iI=j.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=qF(rI,n),o=nI(rI,n),s=b_(t,a.onViewportChange),c=j.useRef(0);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,M.jsx)(wF.Slot,{scope:n,children:(0,M.jsx)(M_.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:q(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-GF*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});iI.displayName=rI;var aI=`SelectGroup`,[oI,sI]=DF(aI),cI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=bS();return(0,M.jsx)(oI,{scope:n,id:i,children:(0,M.jsx)(M_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});cI.displayName=aI;var lI=`SelectLabel`,uI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=sI(lI,n);return(0,M.jsx)(M_.div,{id:i.id,...r,ref:t})});uI.displayName=lI;var dI=`SelectItem`,[fI,pI]=DF(dI),mI=j.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jF(dI,n),c=qF(dI,n),l=s.value===r,[u,d]=j.useState(a??``),[f,p]=j.useState(!1),m=b_(t,e=>c.itemRefCallback?.(e,r,i)),h=bS(),g=j.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,M.jsx)(fI,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:j.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,M.jsx)(wF.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,M.jsx)(M_.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:q(o.onFocus,()=>p(!0)),onBlur:q(o.onBlur,()=>p(!1)),onClick:q(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:q(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:q(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:q(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:q(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:q(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(SF.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});mI.displayName=dI;var hI=`SelectItemText`,gI=j.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=jF(hI,n),s=qF(hI,n),c=pI(hI,n),l=NF(hI,n),[u,d]=j.useState(null),f=b_(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=j.useMemo(()=>(0,M.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return Z_(()=>(h(m),()=>g(m)),[h,g,m]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(M_.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gi.createPortal(a.children,o.valueNode):null]})});gI.displayName=hI;var _I=`SelectItemIndicator`,vI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return pI(_I,n).isSelected?(0,M.jsx)(M_.span,{"aria-hidden":!0,...r,ref:t}):null});vI.displayName=_I;var yI=`SelectScrollUpButton`,bI=j.forwardRef((e,t)=>{let n=qF(yI,e.__scopeSelect),r=nI(yI,e.__scopeSelect),[i,a]=j.useState(!1),o=b_(t,r.onScrollButtonChange);return Z_(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,M.jsx)(CI,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});bI.displayName=yI;var xI=`SelectScrollDownButton`,SI=j.forwardRef((e,t)=>{let n=qF(xI,e.__scopeSelect),r=nI(xI,e.__scopeSelect),[i,a]=j.useState(!1),o=b_(t,r.onScrollButtonChange);return Z_(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,M.jsx)(CI,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});SI.displayName=xI;var CI=j.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=qF(`SelectScrollButton`,n),o=j.useRef(null),s=TF(n),c=j.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return j.useEffect(()=>()=>c(),[c]),Z_(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,M.jsx)(M_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:q(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:q(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:q(i.onPointerLeave,()=>{c()})})}),wI=`SelectSeparator`,TI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,M.jsx)(M_.div,{"aria-hidden":!0,...r,ref:t})});TI.displayName=wI;var EI=`SelectArrow`,DI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=kF(n),a=jF(EI,n),o=qF(EI,n);return a.open&&o.position===`popper`?(0,M.jsx)(RD,{...i,...r,ref:t}):null});DI.displayName=EI;var OI=`SelectBubbleInput`,kI=j.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=j.useRef(null),a=b_(r,i),o=bF(t);return j.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,M.jsx)(M_.select,{...n,style:{...lv,...n.style},ref:a,defaultValue:t})});kI.displayName=OI;function AI(e){return e===``||e===void 0}function jI(e){let t=P_(e),n=j.useRef(``),r=j.useRef(0),i=j.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=j.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function MI(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=NI(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function NI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PI=PF,FI=IF,II=RF,LI=BF,RI=HF,zI=WF,BI=iI,VI=uI,HI=mI,UI=gI,WI=vI,GI=bI,KI=SI,qI=TI,JI=PI,YI=II,XI=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(FI,{ref:r,className:Z(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,M.jsx)(LI,{asChild:!0,children:(0,M.jsx)(Ty,{className:`h-4 w-4 opacity-50`})})]}));XI.displayName=FI.displayName;var ZI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(GI,{ref:n,className:Z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,M.jsx)(Dy,{className:`h-4 w-4`})}));ZI.displayName=GI.displayName;var QI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(KI,{ref:n,className:Z(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,M.jsx)(Ty,{className:`h-4 w-4`})}));QI.displayName=KI.displayName;var $I=j.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,M.jsx)(RI,{children:(0,M.jsxs)(zI,{ref:i,className:Z(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,M.jsx)(ZI,{}),(0,M.jsx)(BI,{className:Z(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,M.jsx)(QI,{})]})}));$I.displayName=zI.displayName;var eL=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(VI,{ref:n,className:Z(`px-2 py-1.5 text-sm font-semibold`,e),...t}));eL.displayName=VI.displayName;var tL=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(HI,{ref:r,className:Z(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,M.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,M.jsx)(WI,{children:(0,M.jsx)(wy,{className:`h-4 w-4`})})}),(0,M.jsx)(UI,{children:t})]}));tL.displayName=HI.displayName;var nL=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(qI,{ref:n,className:Z(`-mx-1 my-1 h-px bg-muted`,e),...t}));nL.displayName=qI.displayName;var rL=la(`/organizations/$orgId/teams`)({component:iL});function iL(){let{t:e}=vt(),{orgId:t}=rL.useParams(),n=o_(),{members:r}=lF(t),[i,a]=(0,j.useState)([]),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(null),[g,_]=(0,j.useState)([]),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(!1),[S,C]=(0,j.useState)(``),w=(0,j.useCallback)(async()=>{if(n?.organizations?.teams){s(!0);try{a((await n.organizations.teams.list(t))?.teams??[])}catch{a([])}finally{s(!1)}}},[n,t]);(0,j.useEffect)(()=>{w()},[w]);let T=(0,j.useCallback)(async e=>{if(n?.organizations?.teams){y(!0);try{_((await n.organizations.teams.listMembers(e))?.members??[])}catch{_([])}finally{y(!1)}}},[n]);(0,j.useEffect)(()=>{m&&T(m)},[m,T]);let E=async r=>{if(r.preventDefault(),u.trim()){p(!0);try{await n.organizations.teams.create({name:u.trim(),organizationId:t}),K({title:e(`teams.created`)}),l(!1),d(``),await w()}catch(t){K({title:e(`teams.createFailed`),description:t.message,variant:`destructive`})}finally{p(!1)}}},D=async r=>{if(confirm(e(`teams.deleteConfirm`,{name:r.name})))try{await n.organizations.teams.delete({teamId:r.id,organizationId:t}),K({title:e(`teams.deleted`)}),m===r.id&&h(null),await w()}catch(t){K({title:e(`teams.deleteFailed`),description:t.message,variant:`destructive`})}},O=async()=>{if(!(!m||!S))try{await n.organizations.teams.addMember({teamId:m,userId:S}),K({title:e(`teams.memberAdded`)}),x(!1),C(``),await T(m)}catch(t){K({title:e(`teams.addMemberFailed`),description:t.message,variant:`destructive`})}},ee=async(t,r)=>{try{await n.organizations.teams.removeMember({teamId:t,userId:r}),K({title:e(`teams.memberRemoved`)}),await T(t)}catch(t){K({title:e(`teams.removeMemberFailed`),description:t.message,variant:`destructive`})}},te=Object.fromEntries(r.map(e=>[e.userId,e])),ne=new Set(g.map(e=>e.userId)),re=r.filter(e=>!ne.has(e.userId));return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)($,{children:[(0,M.jsx)(AN,{children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`teams.title`,{count:i.length})}),(0,M.jsx)(MN,{children:e(`teams.description`)})]}),(0,M.jsxs)(Q,{size:`sm`,onClick:()=>l(!0),children:[(0,M.jsx)(Xy,{className:`mr-2 h-4 w-4`}),e(`teams.create`)]})]})}),(0,M.jsxs)(NN,{children:[o&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(eT,{className:`h-12 w-full`}),(0,M.jsx)(eT,{className:`h-12 w-full`})]}),!o&&i.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(ub,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`teams.empty`)})]}),!o&&i.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:i.map(t=>(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`flex-1 text-left`,onClick:()=>h(m===t.id?null:t.id),children:[(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:t.name}),t.createdAt&&(0,M.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:new Date(t.createdAt).toLocaleDateString()})]}),(0,M.jsxs)(uM,{children:[(0,M.jsx)(dM,{asChild:!0,children:(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,children:(0,M.jsx)(Fy,{className:`h-4 w-4`})})}),(0,M.jsx)(mM,{align:`end`,children:(0,M.jsxs)(hM,{className:`text-destructive`,onClick:()=>D(t),children:[(0,M.jsx)(ab,{className:`mr-2 h-4 w-4`}),e(`teams.delete`)]})})]})]}),m===t.id&&(0,M.jsxs)(`div`,{className:`pb-3 pl-4 border-l-2 ml-2 space-y-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:e(`teams.members`,{count:g.length})}),(0,M.jsxs)(Q,{size:`sm`,variant:`outline`,onClick:()=>x(!0),children:[(0,M.jsx)(lb,{className:`mr-1 h-3 w-3`}),e(`teams.addMember`)]})]}),v&&(0,M.jsx)(eT,{className:`h-8 w-full`}),!v&&g.length===0&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`teams.noMembers`)}),!v&&g.map(e=>{let n=te[e.userId];return(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-1`,children:[(0,M.jsx)(`span`,{className:`text-sm`,children:n?.user?.name||n?.user?.email||e.userId}),(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,onClick:()=>ee(t.id,e.userId),children:(0,M.jsx)(cb,{className:`h-3 w-3`})})]},e.id)})]})]},t.id))})]})]}),(0,M.jsx)(JP,{open:c,onOpenChange:l,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`teams.createTitle`)}),(0,M.jsx)(tF,{children:e(`teams.createDescription`)})]}),(0,M.jsxs)(`form`,{onSubmit:E,children:[(0,M.jsx)(`div`,{className:`space-y-4 py-4`,children:(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`team-name`,children:e(`teams.nameLabel`)}),(0,M.jsx)(lS,{id:`team-name`,required:!0,placeholder:e(`teams.namePlaceholder`),value:u,onChange:e=>d(e.target.value)})]})}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,type:`button`,onClick:()=>l(!1),children:e(`common.cancel`)}),(0,M.jsx)(Q,{type:`submit`,disabled:f,children:e(f?`common.saving`:`teams.create`)})]})]})]})}),(0,M.jsx)(JP,{open:b,onOpenChange:x,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`teams.addMemberTitle`)}),(0,M.jsx)(tF,{children:e(`teams.addMemberDescription`)})]}),(0,M.jsx)(`div`,{className:`space-y-4 py-4`,children:(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{children:e(`teams.selectMember`)}),(0,M.jsxs)(JI,{value:S,onValueChange:C,children:[(0,M.jsx)(XI,{children:(0,M.jsx)(YI,{placeholder:e(`teams.selectMemberPlaceholder`)})}),(0,M.jsx)($I,{children:re.map(e=>(0,M.jsx)(tL,{value:e.userId,children:e.user?.name||e.user?.email||e.userId},e.userId))})]})]})}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>x(!1),children:e(`common.cancel`)}),(0,M.jsx)(Q,{onClick:O,disabled:!S,children:e(`teams.addMember`)})]})]})})]})}var aL=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`textarea`,{className:Z(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));aL.displayName=`Textarea`;var oL=la(`/organizations/$orgId/members`)({component:sL});function sL(){let{t:e}=vt(),{orgId:t}=oL.useParams(),{organizations:n}=cN(),{user:r}=sN(),i=o_(),a=n.find(e=>e.id===t),{members:o,loading:s,inviteMember:c,removeMember:l,updateMemberRole:u}=lF(t),{invitations:d,loading:f,cancelInvitation:p,resendInvitation:m}=uF(t),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(!1),[y,b]=(0,j.useState)(``),[x,S]=(0,j.useState)(``),[C,w]=(0,j.useState)(`member`),[T,E]=(0,j.useState)(!1),[D,O]=(0,j.useState)(!1),ee=d.filter(e=>e.status===`pending`),te=o.find(e=>e.userId===r?.id),ne=te?.role===`owner`||te?.role===`admin`,re=async()=>{let t=_?x.split(/[,;\n]+/).map(e=>e.trim()).filter(Boolean):[y.trim()].filter(Boolean);if(t.length===0){K({title:e(`organizations.members.emailRequired`),variant:`destructive`});return}E(!0);let n=0;try{for(let e of t)try{await c(e,C)}catch{n++}n>0&&n<t.length?K({title:e(`organizations.members.invitePartialSuccess`,{sent:t.length-n,failed:n}),variant:`destructive`}):n===t.length?K({title:e(`organizations.members.inviteFailed`),variant:`destructive`}):K({title:e(`organizations.members.invitationSent`)}),g(!1),b(``),S(``),w(`member`)}finally{E(!1)}},ie=async(t,n)=>{if(confirm(e(`organizations.members.removeConfirm`,{name:n})))try{await l(t),K({title:e(`organizations.members.memberRemoved`)})}catch(t){K({title:e(`organizations.members.removeFailed`),description:t.message,variant:`destructive`})}},ae=async(t,n)=>{try{await u(t,n),K({title:e(`organizations.members.roleUpdated`)})}catch(t){K({title:e(`organizations.members.roleUpdateFailed`),description:t.message,variant:`destructive`})}},oe=async()=>{if(confirm(e(`organizations.members.leaveConfirm`,{org:a?.name??t}))){O(!0);try{await i.organizations.leave(t),K({title:e(`organizations.members.leftOrg`)}),window.location.assign(`/`)}catch(t){K({title:e(`organizations.members.leaveFailed`),description:t.message,variant:`destructive`})}finally{O(!1)}}},k=async(t,n)=>{if(confirm(e(`organizations.members.cancelConfirm`,{email:n})))try{await p(t),K({title:e(`organizations.members.invitationCanceled`)})}catch(t){K({title:e(`organizations.members.cancelFailed`),description:t.message,variant:`destructive`})}},se=async t=>{try{await m(t),K({title:e(`organizations.members.invitationResent`)})}catch(t){K({title:e(`organizations.members.resendFailed`),description:t.message,variant:`destructive`})}},ce=async t=>{let n=`${window.location.origin}/accept-invitation/${t}`;try{await navigator.clipboard.writeText(n),K({title:e(`organizations.members.linkCopied`)})}catch{K({title:e(`organizations.members.linkCopyFailed`),variant:`destructive`})}};return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)($,{children:[(0,M.jsx)(AN,{children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`organizations.members.title`,{count:o.length})}),(0,M.jsx)(MN,{children:e(`organizations.members.description`)})]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[te&&te.role!==`owner`&&(0,M.jsxs)(Q,{size:`sm`,variant:`outline`,onClick:oe,disabled:D,children:[(0,M.jsx)(Wy,{className:`mr-2 h-4 w-4`}),e(`organizations.members.leave`)]}),ne&&(0,M.jsxs)(Q,{size:`sm`,onClick:()=>g(!0),children:[(0,M.jsx)(lb,{className:`mr-2 h-4 w-4`}),e(`organizations.members.invite`)]})]})]})}),(0,M.jsxs)(NN,{children:[s&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.members.loadingMembers`)}),!s&&o.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(fb,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`organizations.members.empty`)})]}),!s&&o.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:o.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsxs)(`div`,{className:`font-medium text-sm`,children:[t.user?.name||t.user?.email||t.userId,t.userId===r?.id&&(0,M.jsx)(gP,{variant:`secondary`,className:`ml-2 text-xs`,children:e(`organizations.members.you`)})]}),t.user?.email&&(0,M.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.user.email})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ne&&t.role!==`owner`&&t.userId!==r?.id?(0,M.jsxs)(JI,{value:t.role,onValueChange:e=>ae(t.id,e),children:[(0,M.jsx)(XI,{className:`h-7 w-24 text-xs`,children:(0,M.jsx)(YI,{})}),(0,M.jsxs)($I,{children:[(0,M.jsx)(tL,{value:`admin`,children:e(`common.roles.admin`)}),(0,M.jsx)(tL,{value:`member`,children:e(`common.roles.member`)})]})]}):(0,M.jsx)(gP,{variant:`secondary`,className:`text-xs`,children:e(`common.roles.${t.role??`member`}`)}),ne&&t.role!==`owner`&&t.userId!==r?.id&&(0,M.jsxs)(uM,{children:[(0,M.jsx)(dM,{asChild:!0,children:(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,children:(0,M.jsx)(Fy,{className:`h-4 w-4`})})}),(0,M.jsx)(mM,{align:`end`,children:(0,M.jsxs)(hM,{className:`text-destructive`,onClick:()=>ie(t.id,t.user?.name||t.user?.email||t.userId),children:[(0,M.jsx)(ab,{className:`mr-2 h-4 w-4`}),e(`organizations.members.removeMember`)]})})]})]})]},t.id))})]})]}),(0,M.jsxs)($,{children:[(0,M.jsx)(AN,{children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(jN,{className:`text-base`,children:e(`organizations.members.pendingTitle`,{count:ee.length})}),(0,M.jsx)(MN,{children:e(`organizations.members.pendingDescription`)})]}),ne&&(0,M.jsxs)(Q,{size:`sm`,variant:`outline`,onClick:()=>g(!0),children:[(0,M.jsx)(lb,{className:`mr-2 h-4 w-4`}),e(`organizations.members.sendInvitation`)]})]})}),(0,M.jsxs)(NN,{children:[f&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.members.loadingInvitations`)}),!f&&ee.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(Ky,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`organizations.members.noPending`)})]}),!f&&ee.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:ee.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:t.email}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,M.jsx)(gP,{variant:`outline`,className:`text-xs`,children:e(`common.roles.${t.role}`)}),(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,M.jsx)(Ny,{className:`h-3 w-3`}),e(`organizations.members.expires`,{date:new Date(t.expiresAt).toLocaleDateString()})]})]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,title:e(`organizations.members.copyLink`),onClick:()=>ce(t.id),children:(0,M.jsx)(Py,{className:`h-4 w-4`})}),(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,title:e(`organizations.members.resend`),onClick:()=>se(t),children:(0,M.jsx)(Zy,{className:`h-4 w-4`})}),(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,title:e(`organizations.members.cancel`),onClick:()=>k(t.id,t.email),children:(0,M.jsx)(pb,{className:`h-4 w-4`})})]})]},t.id))})]})]}),(0,M.jsx)(JP,{open:h,onOpenChange:g,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`organizations.members.inviteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`organizations.members.inviteDialogDescription`,{organization:a?.name??``})})]}),(0,M.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(Q,{type:`button`,variant:_?`outline`:`default`,size:`sm`,onClick:()=>v(!1),children:e(`organizations.members.singleInvite`)}),(0,M.jsx)(Q,{type:`button`,variant:_?`default`:`outline`,size:`sm`,onClick:()=>v(!0),children:e(`organizations.members.bulkInvite`)})]}),_?(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{children:e(`organizations.members.bulkEmails`)}),(0,M.jsx)(aL,{placeholder:e(`organizations.members.bulkEmailsPlaceholder`),rows:5,value:x,onChange:e=>S(e.target.value)}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.members.bulkEmailsHint`)})]}):(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`invite-email`,children:e(`organizations.members.email`)}),(0,M.jsx)(lS,{id:`invite-email`,type:`email`,placeholder:e(`organizations.members.emailPlaceholder`),value:y,onChange:e=>b(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`role`,children:e(`organizations.members.role`)}),(0,M.jsxs)(JI,{value:C,onValueChange:w,children:[(0,M.jsx)(XI,{id:`role`,children:(0,M.jsx)(YI,{})}),(0,M.jsxs)($I,{children:[(0,M.jsx)(tL,{value:`owner`,children:e(`common.roles.owner`)}),(0,M.jsx)(tL,{value:`admin`,children:e(`common.roles.admin`)}),(0,M.jsx)(tL,{value:`member`,children:e(`common.roles.member`)})]})]})]})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>g(!1),disabled:T,children:e(`common.cancel`)}),(0,M.jsx)(Q,{onClick:re,disabled:T,children:e(T?`organizations.members.sending`:`organizations.members.sendInvitation`)})]})]})})]})}var cL=la(`/organizations/$orgId/general`)({component:lL});function lL(){let{t:e}=vt(),{orgId:t}=cL.useParams(),n=Hi(),{organizations:r}=cN(),{session:i,user:a,setActiveOrganization:o}=sN(),s=r.find(e=>e.id===t),{members:c}=lF(t),{invitations:l}=uF(t),{remove:u,deleting:d}=dN(),{update:f,updating:p}=uN(),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(``),[v,y]=(0,j.useState)(``),[b,x]=(0,j.useState)(!1),[S,C]=(0,j.useState)(``);(0,j.useEffect)(()=>{h(s?.name??``),_(s?.slug??``),y(s?.logo??``)},[s?.id,s?.name,s?.slug,s?.logo]);let w=i?.activeOrganizationId===t,T=l.filter(e=>e.status===`pending`),E=(a?c.find(e=>e.userId===a.id):void 0)?.role??null,D=E===`owner`||E===`admin`,O=D&&s!=null&&(m.trim()!==(s.name??``)||g.trim()!==(s.slug??``)||v.trim()!==(s.logo??``));return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w&&(0,M.jsx)(gP,{variant:`outline`,children:e(`organizations.active`)}),E&&(0,M.jsx)(gP,{variant:`secondary`,className:`capitalize`,children:e(`common.roles.${E}`)})]}),!w&&(0,M.jsx)(Q,{size:`sm`,variant:`outline`,onClick:async()=>{try{await o(t),K({title:e(`organizations.general.switched`)})}catch(t){K({title:e(`organizations.general.switchFailed`),description:t.message,variant:`destructive`})}},children:e(`organizations.general.setActive`)})]}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{children:e(`organizations.general.detailsTitle`)}),(0,M.jsx)(MN,{children:e(D?`organizations.general.detailsDescription`:`organizations.general.detailsReadOnly`)})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`org-name`,children:e(`organizations.new.name`)}),(0,M.jsx)(lS,{id:`org-name`,value:m,onChange:e=>h(e.target.value),disabled:!D||p,placeholder:e(`organizations.general.namePlaceholder`)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`org-slug`,children:e(`organizations.new.slug`)}),(0,M.jsx)(lS,{id:`org-slug`,value:g,onChange:e=>_(e.target.value),disabled:!D||p,placeholder:e(`organizations.general.slugPlaceholder`),className:`font-mono text-sm`}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.general.slugHint`)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`org-logo`,children:e(`organizations.general.logo`)}),(0,M.jsx)(lS,{id:`org-logo`,value:v,onChange:e=>y(e.target.value),disabled:!D||p,placeholder:e(`organizations.general.logoPlaceholder`)})]}),(0,M.jsxs)(`div`,{className:`flex justify-between border-t pt-4 text-xs`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`organizations.general.organizationId`)}),(0,M.jsx)(`code`,{className:`font-mono`,children:t})]})]}),D&&(0,M.jsxs)(NN,{className:`flex justify-end gap-2 border-t pt-4`,children:[(0,M.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:()=>{h(s?.name??``),_(s?.slug??``),y(s?.logo??``)},disabled:!O||p,children:e(`organizations.general.reset`)}),(0,M.jsxs)(Q,{size:`sm`,onClick:async()=>{if(!s||!D||!O)return;let n=m.trim();if(!n){K({title:e(`organizations.general.nameRequired`),variant:`destructive`});return}try{await f(t,{name:n,slug:g.trim()||void 0,logo:v.trim()||void 0}),K({title:e(`organizations.general.updated`)})}catch(t){K({title:e(`organizations.general.updateFailed`),description:t.message,variant:`destructive`})}},disabled:!O||p,children:[(0,M.jsx)(Qy,{className:`mr-2 h-4 w-4`}),e(p?`common.saving`:`organizations.general.save`)]})]})]}),(0,M.jsxs)($,{children:[(0,M.jsx)(AN,{children:(0,M.jsx)(jN,{className:`text-base`,children:e(`organizations.general.overviewTitle`)})}),(0,M.jsxs)(NN,{className:`space-y-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`organizations.general.members`)}),(0,M.jsx)(`span`,{children:c.length})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`organizations.general.pendingInvitations`)}),(0,M.jsx)(`span`,{children:T.length})]})]})]}),D&&(0,M.jsxs)($,{className:`border-destructive/40`,children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base text-destructive`,children:e(`organizations.general.dangerTitle`)}),(0,M.jsx)(MN,{children:e(`organizations.general.dangerDescription`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(Q,{variant:`destructive`,size:`sm`,onClick:()=>x(!0),disabled:d,children:[(0,M.jsx)(ab,{className:`mr-2 h-4 w-4`}),e(`organizations.general.delete`)]})})]}),(0,M.jsx)(JP,{open:b,onOpenChange:e=>{x(e),e||C(``)},children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{className:`text-destructive`,children:e(`organizations.general.deleteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`organizations.general.deleteDialogDescription`,{name:s?.name??``})})]}),(0,M.jsx)(`div`,{className:`space-y-4 py-2`,children:(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`delete-confirm`,children:e(`organizations.general.deleteDialogLabel`,{name:s?.name??``})}),(0,M.jsx)(lS,{id:`delete-confirm`,value:S,onChange:e=>C(e.target.value),placeholder:s?.name??``,disabled:d})]})}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>x(!1),disabled:d,children:e(`common.cancel`)}),(0,M.jsx)(Q,{variant:`destructive`,onClick:async()=>{if(s){if(S!==s.name){K({title:e(`organizations.general.confirmationMismatch`),description:e(`organizations.general.confirmationHint`,{name:s.name}),variant:`destructive`});return}try{let r=await u(t),i=r?.warnings,a=r?.deletedProjects??0;K({title:e(`organizations.general.deleted`),description:i?.length?e(`organizations.general.deletedWithWarnings`,{deletedProjects:a,warning:i[0],extraCount:Math.max(i.length-1,0)}):e(`organizations.general.deletedDescription`,{name:s.name,deletedProjects:a}),variant:i?.length?`destructive`:void 0}),x(!1),C(``),n({to:`/organizations`})}catch(t){K({title:e(`organizations.general.deleteFailed`),description:t.message,variant:`destructive`})}}},disabled:d||!s||S!==s.name,children:e(d?`organizations.general.deleting`:`organizations.general.delete`)})]})]})})]})}var uL=la(`/account/oauth-applications/new`)({component:dL});function dL(){let{t:e}=vt(),t=Hi(),{register:n,registering:r}=jP(),[i,a]=(0,j.useState)(``),[o,s]=(0,j.useState)(``),[c,l]=(0,j.useState)(`client_secret_basic`),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(``),[m,h]=(0,j.useState)(null),g=async()=>{let t=i.trim(),r=o.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean);if(!t){K({title:e(`oauth.applications.form.nameRequired`),variant:`destructive`});return}if(r.length===0){K({title:e(`oauth.applications.form.redirectRequired`),variant:`destructive`});return}try{let i=await n({client_name:t,redirect_uris:r,token_endpoint_auth_method:c,...u.trim()?{client_uri:u.trim()}:{},...f.trim()?{logo_uri:f.trim()}:{}});h({client_id:i?.client_id??``,client_secret:i?.client_secret}),K({title:e(`oauth.applications.registered`)})}catch(t){K({title:e(`oauth.applications.registerFailed`),description:t.message,variant:`destructive`})}},_=(t,n)=>{navigator.clipboard.writeText(t).then(()=>K({title:e(`oauth.applications.copied`,{label:n})}),()=>K({title:e(`oauth.applications.copyFailed`,{label:n}),variant:`destructive`}))};return m?(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`oauth.applications.registeredTitle`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.registeredDescription`)})]}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{children:e(`oauth.applications.credentials`)}),(0,M.jsx)(MN,{children:e(`oauth.applications.credentialsDescription`)})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(KN,{children:e(`oauth.applications.clientId`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`code`,{className:`flex-1 rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:m.client_id}),(0,M.jsx)(Q,{size:`icon`,variant:`outline`,onClick:()=>_(m.client_id,e(`oauth.applications.clientId`)),children:(0,M.jsx)(Py,{className:`h-4 w-4`})})]})]}),m.client_secret&&(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(KN,{children:e(`oauth.applications.clientSecret`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`code`,{className:`flex-1 break-all rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:m.client_secret}),(0,M.jsx)(Q,{size:`icon`,variant:`outline`,onClick:()=>_(m.client_secret,e(`oauth.applications.clientSecret`)),children:(0,M.jsx)(Py,{className:`h-4 w-4`})})]}),(0,M.jsx)(`p`,{className:`text-xs text-destructive`,children:e(`oauth.applications.clientSecretWarning`)})]})]})]}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>t({to:`/account/oauth-applications`}),children:e(`oauth.applications.backToList`)}),(0,M.jsx)(Q,{onClick:()=>t({to:`/account/oauth-applications/$clientId`,params:{clientId:m.client_id}}),children:e(`oauth.applications.viewApplication`)})]})]}):(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`oauth.applications.form.title`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.form.description`)})]}),(0,M.jsxs)($,{children:[(0,M.jsx)(AN,{children:(0,M.jsxs)(jN,{className:`flex items-center gap-2 text-base`,children:[(0,M.jsx)(By,{className:`h-4 w-4`}),e(`oauth.applications.form.details`)]})}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`oauth-name`,children:e(`oauth.applications.form.name`)}),(0,M.jsx)(lS,{id:`oauth-name`,value:i,onChange:e=>a(e.target.value),placeholder:e(`oauth.applications.form.namePlaceholder`),disabled:r})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`oauth-redirect`,children:e(`oauth.applications.form.redirectUris`)}),(0,M.jsx)(aL,{id:`oauth-redirect`,value:o,onChange:e=>s(e.target.value),placeholder:e(`oauth.applications.form.redirectPlaceholder`),rows:3,disabled:r}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`oauth.applications.form.redirectHint`)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{children:e(`oauth.applications.form.authMethod`)}),(0,M.jsxs)(JI,{value:c,onValueChange:e=>l(e),disabled:r,children:[(0,M.jsx)(XI,{children:(0,M.jsx)(YI,{})}),(0,M.jsxs)($I,{children:[(0,M.jsx)(tL,{value:`client_secret_basic`,children:e(`oauth.applications.form.authMethodBasic`)}),(0,M.jsx)(tL,{value:`client_secret_post`,children:e(`oauth.applications.form.authMethodPost`)}),(0,M.jsx)(tL,{value:`none`,children:e(`oauth.applications.form.authMethodNone`)})]})]})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`oauth-client-uri`,children:e(`oauth.applications.form.clientUri`)}),(0,M.jsx)(lS,{id:`oauth-client-uri`,value:u,onChange:e=>d(e.target.value),placeholder:e(`oauth.applications.form.clientUriPlaceholder`),disabled:r})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(KN,{htmlFor:`oauth-logo`,children:e(`oauth.applications.form.logoUri`)}),(0,M.jsx)(lS,{id:`oauth-logo`,value:f,onChange:e=>p(e.target.value),placeholder:e(`oauth.applications.form.logoUriPlaceholder`),disabled:r}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`oauth.applications.form.logoHint`)})]})]})]}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,M.jsx)(Q,{variant:`ghost`,onClick:()=>t({to:`/account/oauth-applications`}),disabled:r,children:e(`common.cancel`)}),(0,M.jsx)(Q,{onClick:g,disabled:r,children:e(r?`oauth.applications.form.registering`:`oauth.applications.register`)})]})]})}var fL=la(`/account/oauth-applications/$clientId`)({component:pL});function pL(){let{t:e}=vt(),{clientId:t}=fL.useParams(),n=Hi(),{applications:r,loading:i,reload:a}=AP(),{remove:o,deleting:s}=MP(),c=o_(),l=r.find(e=>e.client_id===t),[u,d]=(0,j.useState)(null);(0,j.useEffect)(()=>{let e=!1;if(!l&&c?.oauth?.applications?.get)return c.oauth.applications.get(t).then(t=>{e||d(t?.data??t)},()=>{}),()=>{e=!0}},[c,t,l]);let f=l??u,[p,m]=(0,j.useState)(!1),h=(t,n)=>{navigator.clipboard.writeText(t).then(()=>K({title:e(`oauth.applications.copied`,{label:n})}),()=>K({title:e(`oauth.applications.copyFailed`,{label:n}),variant:`destructive`}))},g=async()=>{if(f)try{await o(f.client_id),K({title:e(`oauth.applications.deleted`)}),await a(),n({to:`/account/oauth-applications`})}catch(t){K({title:e(`oauth.applications.deleteFailed`),description:t.message,variant:`destructive`})}};if(i&&!f)return(0,M.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:e(`common.loading`)});if(!f)return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`oauth.applications.notFoundTitle`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.notFoundDescription`)}),(0,M.jsx)(Q,{onClick:()=>n({to:`/account/oauth-applications`}),children:e(`oauth.applications.backToList`)})]});let _=typeof f.redirect_urls==`string`?f.redirect_urls.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean):Array.isArray(f.redirect_urls)?f.redirect_urls:[];return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:f.name}),(0,M.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:f.client_id})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f.type&&(0,M.jsx)(gP,{variant:`outline`,className:`capitalize`,children:f.type}),f.disabled&&(0,M.jsx)(gP,{variant:`destructive`,children:e(`oauth.applications.disabled`)})]})]}),(0,M.jsxs)($,{children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{children:e(`oauth.applications.credentials`)}),(0,M.jsx)(MN,{children:e(`oauth.applications.credentialsDescriptionDetail`)})]}),(0,M.jsxs)(NN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(KN,{children:e(`oauth.applications.clientId`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`code`,{className:`flex-1 rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:f.client_id}),(0,M.jsx)(Q,{size:`icon`,variant:`outline`,onClick:()=>h(f.client_id,e(`oauth.applications.clientId`)),children:(0,M.jsx)(Py,{className:`h-4 w-4`})})]})]}),(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(KN,{children:e(`oauth.applications.redirectUris`)}),_.length===0?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.noRedirectUris`)}):(0,M.jsx)(`ul`,{className:`space-y-1`,children:_.map((e,t)=>(0,M.jsx)(`li`,{className:`rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:e},t))})]})]})]}),(0,M.jsxs)($,{className:`border-destructive/40`,children:[(0,M.jsxs)(AN,{children:[(0,M.jsx)(jN,{className:`text-base text-destructive`,children:e(`oauth.applications.dangerTitle`)}),(0,M.jsx)(MN,{children:e(`oauth.applications.dangerDescription`)})]}),(0,M.jsx)(NN,{children:(0,M.jsxs)(Q,{variant:`destructive`,size:`sm`,onClick:()=>m(!0),disabled:s,children:[(0,M.jsx)(ab,{className:`mr-2 h-4 w-4`}),e(`oauth.applications.delete`)]})})]}),(0,M.jsx)(JP,{open:p,onOpenChange:m,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{className:`text-destructive`,children:e(`oauth.applications.deleteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`oauth.applications.deleteDialogDescription`,{name:f.name})})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Q,{variant:`outline`,onClick:()=>m(!1),disabled:s,children:e(`common.cancel`)}),(0,M.jsx)(Q,{variant:`destructive`,onClick:g,disabled:s,children:e(s?`oauth.applications.deleting`:`common.delete`)})]})]})})]})}var mL=RN.update({id:`/verify-email-prompt`,path:`/verify-email-prompt`,getParentRoute:()=>kN}),hL=BN.update({id:`/verify-email`,path:`/verify-email`,getParentRoute:()=>kN}),gL=qN.update({id:`/setup`,path:`/setup`,getParentRoute:()=>kN}),_L=XN.update({id:`/reset-password`,path:`/reset-password`,getParentRoute:()=>kN}),vL=tP.update({id:`/register`,path:`/register`,getParentRoute:()=>kN}),yL=aP.update({id:`/login`,path:`/login`,getParentRoute:()=>kN}),bL=lP.update({id:`/forgot-password`,path:`/forgot-password`,getParentRoute:()=>kN}),xL=dP.update({id:`/account`,path:`/account`,getParentRoute:()=>kN}),SL=pP.update({id:`/`,path:`/`,getParentRoute:()=>kN}),CL=vP.update({id:`/organizations/`,path:`/organizations/`,getParentRoute:()=>kN}),wL=bP.update({id:`/`,path:`/`,getParentRoute:()=>xL}),TL=CP.update({id:`/organizations/new`,path:`/organizations/new`,getParentRoute:()=>kN}),EL=OP.update({id:`/organizations/$orgId`,path:`/organizations/$orgId`,getParentRoute:()=>kN}),DL=PP.update({id:`/oauth/consent`,path:`/oauth/consent`,getParentRoute:()=>kN}),OL=LP.update({id:`/auth/device`,path:`/auth/device`,getParentRoute:()=>kN}),kL=BP.update({id:`/two-factor`,path:`/two-factor`,getParentRoute:()=>xL}),AL=GP.update({id:`/sessions`,path:`/sessions`,getParentRoute:()=>xL}),jL=nF.update({id:`/security`,path:`/security`,getParentRoute:()=>xL}),ML=iF.update({id:`/profile`,path:`/profile`,getParentRoute:()=>xL}),NL=oF.update({id:`/linked-accounts`,path:`/linked-accounts`,getParentRoute:()=>xL}),PL=fF.update({id:`/invitations`,path:`/invitations`,getParentRoute:()=>xL}),FL=mF.update({id:`/accept-invitation/$invitationId`,path:`/accept-invitation/$invitationId`,getParentRoute:()=>kN}),IL=gF.update({id:`/`,path:`/`,getParentRoute:()=>EL}),LL=_F.update({id:`/oauth-applications/`,path:`/oauth-applications/`,getParentRoute:()=>xL}),RL=rL.update({id:`/teams`,path:`/teams`,getParentRoute:()=>EL}),zL=oL.update({id:`/members`,path:`/members`,getParentRoute:()=>EL}),BL=cL.update({id:`/general`,path:`/general`,getParentRoute:()=>EL}),VL=uL.update({id:`/oauth-applications/new`,path:`/oauth-applications/new`,getParentRoute:()=>xL}),HL={AccountInvitationsRoute:PL,AccountLinkedAccountsRoute:NL,AccountProfileRoute:ML,AccountSecurityRoute:jL,AccountSessionsRoute:AL,AccountTwoFactorRoute:kL,AccountIndexRoute:wL,AccountOauthApplicationsClientIdRoute:fL.update({id:`/oauth-applications/$clientId`,path:`/oauth-applications/$clientId`,getParentRoute:()=>xL}),AccountOauthApplicationsNewRoute:VL,AccountOauthApplicationsIndexRoute:LL},UL=xL._addFileChildren(HL),WL={OrganizationsOrgIdGeneralRoute:BL,OrganizationsOrgIdMembersRoute:zL,OrganizationsOrgIdTeamsRoute:RL,OrganizationsOrgIdIndexRoute:IL},GL={IndexRoute:SL,AccountRoute:UL,ForgotPasswordRoute:bL,LoginRoute:yL,RegisterRoute:vL,ResetPasswordRoute:_L,SetupRoute:gL,VerifyEmailRoute:hL,VerifyEmailPromptRoute:mL,AcceptInvitationInvitationIdRoute:FL,AuthDeviceRoute:OL,OauthConsentRoute:DL,OrganizationsOrgIdRoute:EL._addFileChildren(WL),OrganizationsNewRoute:TL,OrganizationsIndexRoute:CL},KL=kN._addFileChildren(GL)._addFileTypes();function qL(){let e=`/_account/`;return e.endsWith(`/`)?e.slice(0,-1):e}var JL=wa({routeTree:KL,basepath:qL()});function YL(){return(0,M.jsx)(Da,{router:JL})}var XL=typeof localStorage<`u`&&localStorage.getItem(`account.lang`)||typeof navigator<`u`&&navigator.language||`en`;function ZL({children:e}){let{i18n:t,language:n}=yt(),[r,i]=j.useReducer(e=>e+1,0),[a,o]=j.useState(!1);return j.useEffect(()=>{let e=()=>i();t.on(`loaded`,e),t.on(`languageChanged`,e);let n=window.setTimeout(()=>o(!0),1500);return()=>{t.off(`loaded`,e),t.off(`languageChanged`,e),window.clearTimeout(n)}},[t]),a||t.isInitialized&&t.hasResourceBundle?.(n,`translation`)?(0,M.jsx)(M.Fragment,{children:e}):null}Jf.createRoot(document.getElementById(`root`)).render((0,M.jsx)(j.StrictMode,{children:(0,M.jsx)(_t,{config:{defaultLanguage:XL,fallbackLanguage:`en`},loadLanguage:OM,children:(0,M.jsx)(ZL,{children:(0,M.jsx)(YL,{})})})}));
|
|
153
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Fw=`DialogDescriptionWarning`,Iw=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nw(Fw).contentName}}.`;return j.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Lw=cw,Rw=mw,zw=gw,Bw=bw,Vw=Tw,Hw=Dw,Uw=kw,Ww=Lw,Gw=Rw,Kw=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(zw,{className:X(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Kw.displayName=zw.displayName;var qw=xy(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Jw=j.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,M.jsxs)(Gw,{children:[(0,M.jsx)(Kw,{}),(0,M.jsxs)(Bw,{ref:i,className:X(qw({side:e}),t),...r,children:[n,(0,M.jsxs)(Uw,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,M.jsx)(Cb,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Jw.displayName=Bw.displayName;var Yw=({className:e,...t})=>(0,M.jsx)(`div`,{className:X(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Yw.displayName=`SheetHeader`;var Xw=({className:e,...t})=>(0,M.jsx)(`div`,{className:X(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Xw.displayName=`SheetFooter`;var Zw=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Vw,{ref:n,className:X(`text-lg font-semibold text-foreground`,e),...t}));Zw.displayName=Vw.displayName;var Qw=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Hw,{ref:n,className:X(`text-sm text-muted-foreground`,e),...t}));Qw.displayName=Hw.displayName;function $w({className:e,...t}){return(0,M.jsx)(`div`,{className:X(`bg-muted animate-pulse rounded-md`,e),...t})}var eT=[`top`,`right`,`bottom`,`left`],tT=Math.min,nT=Math.max,rT=Math.round,iT=Math.floor,aT=e=>({x:e,y:e}),oT={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sT(e,t,n){return nT(e,tT(t,n))}function cT(e,t){return typeof e==`function`?e(t):e}function lT(e){return e.split(`-`)[0]}function uT(e){return e.split(`-`)[1]}function dT(e){return e===`x`?`y`:`x`}function fT(e){return e===`y`?`height`:`width`}function pT(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function mT(e){return dT(pT(e))}function hT(e,t,n){n===void 0&&(n=!1);let r=uT(e),i=mT(e),a=fT(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=wT(o)),[o,wT(o)]}function gT(e){let t=wT(e);return[_T(e),t,_T(t)]}function _T(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var vT=[`left`,`right`],yT=[`right`,`left`],bT=[`top`,`bottom`],xT=[`bottom`,`top`];function ST(e,t,n){switch(e){case`top`:case`bottom`:return n?t?yT:vT:t?vT:yT;case`left`:case`right`:return t?bT:xT;default:return[]}}function CT(e,t,n,r){let i=uT(e),a=ST(lT(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_T)))),a}function wT(e){let t=lT(e);return oT[t]+e.slice(t.length)}function TT(e){return{top:0,right:0,bottom:0,left:0,...e}}function ET(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:TT(e)}function DT(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function OT(e,t,n){let{reference:r,floating:i}=e,a=pT(t),o=mT(t),s=fT(o),c=lT(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(uT(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function kT(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=cT(t,e),p=ET(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=DT(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=DT(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var AT=50,jT=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kT},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=OT(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<AT&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=OT(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},MT=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=cT(e,t)||{};if(l==null)return{};let d=ET(u),f={x:n,y:r},p=mT(i),m=fT(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=tT(d[_],T),D=tT(d[v],T),O=E,ee=C-h[m]-D,te=C/2-h[m]/2+w,ne=sT(O,te,ee),re=!c.arrow&&uT(i)!=null&&te!==ne&&a.reference[m]/2-(te<O?E:D)-h[m]/2<0,ie=re?te<O?te-O:te-ee:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),NT=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=cT(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=lT(r),_=pT(o),v=lT(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[wT(o)]:gT(o)),x=p!==`none`;!d&&x&&b.push(...CT(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=hT(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==pT(t))||T.every(e=>pT(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=pT(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function PT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function FT(e){return eT.some(t=>e[t]>=0)}var IT=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=cT(e,t);switch(i){case`referenceHidden`:{let e=PT(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:FT(e)}}}case`escaped`:{let e=PT(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:FT(e)}}}default:return{}}}}},LT=new Set([`left`,`top`]);async function RT(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=lT(n),s=uT(n),c=pT(n)===`y`,l=LT.has(o)?-1:1,u=a&&c?-1:1,d=cT(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var zT=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await RT(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},BT=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cT(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=pT(lT(i)),p=dT(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=sT(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=sT(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},VT=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=cT(e,t),u={x:n,y:r},d=pT(i),f=dT(d),p=u[f],m=u[d],h=cT(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=LT.has(lT(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},HT=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=cT(e,t),u=await o.detectOverflow(t,l),d=lT(i),f=uT(i),p=pT(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=tT(h-u[g],v),x=tT(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=nT(u.left,0),t=nT(u.right,0),n=nT(u.top,0),r=nT(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:nT(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:nT(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function UT(){return typeof window<`u`}function WT(e){return qT(e)?(e.nodeName||``).toLowerCase():`#document`}function GT(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function KT(e){return((qT(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qT(e){return UT()?e instanceof Node||e instanceof GT(e).Node:!1}function JT(e){return UT()?e instanceof Element||e instanceof GT(e).Element:!1}function YT(e){return UT()?e instanceof HTMLElement||e instanceof GT(e).HTMLElement:!1}function XT(e){return!UT()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof GT(e).ShadowRoot}function ZT(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=cE(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function QT(e){return/^(table|td|th)$/.test(WT(e))}function $T(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var eE=/transform|translate|scale|rotate|perspective|filter/,tE=/paint|layout|strict|content/,nE=e=>!!e&&e!==`none`,rE;function iE(e){let t=JT(e)?cE(e):e;return nE(t.transform)||nE(t.translate)||nE(t.scale)||nE(t.rotate)||nE(t.perspective)||!oE()&&(nE(t.backdropFilter)||nE(t.filter))||eE.test(t.willChange||``)||tE.test(t.contain||``)}function aE(e){let t=uE(e);for(;YT(t)&&!sE(t);){if(iE(t))return t;if($T(t))return null;t=uE(t)}return null}function oE(){return rE??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),rE}function sE(e){return/^(html|body|#document)$/.test(WT(e))}function cE(e){return GT(e).getComputedStyle(e)}function lE(e){return JT(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uE(e){if(WT(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||XT(e)&&e.host||KT(e);return XT(t)?t.host:t}function dE(e){let t=uE(e);return sE(t)?e.ownerDocument?e.ownerDocument.body:e.body:YT(t)&&ZT(t)?t:dE(t)}function fE(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=dE(e),i=r===e.ownerDocument?.body,a=GT(r);if(i){let e=pE(a);return t.concat(a,a.visualViewport||[],ZT(r)?r:[],e&&n?fE(e):[])}else return t.concat(r,fE(r,[],n))}function pE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mE(e){let t=cE(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=YT(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=rT(n)!==a||rT(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function hE(e){return JT(e)?e:e.contextElement}function gE(e){let t=hE(e);if(!YT(t))return aT(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=mE(t),o=(a?rT(n.width):n.width)/r,s=(a?rT(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var _E=aT(0);function vE(e){let t=GT(e);return!oE()||!t.visualViewport?_E:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==GT(e)?!1:t}function bE(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=hE(e),o=aT(1);t&&(r?JT(r)&&(o=gE(r)):o=gE(e));let s=yE(a,n,r)?vE(a):aT(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=GT(a),t=r&&JT(r)?GT(r):r,n=e,i=pE(n);for(;i&&r&&t!==n;){let e=gE(i),t=i.getBoundingClientRect(),r=cE(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=GT(i),i=pE(n)}}return DT({width:u,height:d,x:c,y:l})}function xE(e,t){let n=lE(e).scrollLeft;return t?t.left+n:bE(KT(e)).left+n}function SE(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xE(e,n),y:n.top+t.scrollTop}}function CE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=KT(r),s=t?$T(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=aT(1),u=aT(0),d=YT(r);if((d||!d&&!a)&&((WT(r)!==`body`||ZT(o))&&(c=lE(r)),d)){let e=bE(r);l=gE(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?SE(o,c):aT(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function wE(e){return Array.from(e.getClientRects())}function TE(e){let t=KT(e),n=lE(e),r=e.ownerDocument.body,i=nT(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=nT(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xE(e),s=-n.scrollTop;return cE(r).direction===`rtl`&&(o+=nT(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var EE=25;function DE(e,t){let n=GT(e),r=KT(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=oE();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xE(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=EE&&(a-=o)}else l<=EE&&(a+=l);return{width:a,height:o,x:s,y:c}}function OE(e,t){let n=bE(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=YT(e)?gE(e):aT(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function kE(e,t,n){let r;if(t===`viewport`)r=DE(e,n);else if(t===`document`)r=TE(KT(e));else if(JT(t))r=OE(t,n);else{let n=vE(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return DT(r)}function AE(e,t){let n=uE(e);return n===t||!JT(n)||sE(n)?!1:cE(n).position===`fixed`||AE(n,t)}function jE(e,t){let n=t.get(e);if(n)return n;let r=fE(e,[],!1).filter(e=>JT(e)&&WT(e)!==`body`),i=null,a=cE(e).position===`fixed`,o=a?uE(e):e;for(;JT(o)&&!sE(o);){let t=cE(o),n=iE(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||ZT(o)&&!n&&AE(e,o))?r=r.filter(e=>e!==o):i=t,o=uE(o)}return t.set(e,r),r}function ME(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$T(t)?[]:jE(t,this._c):[].concat(n),r],o=kE(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=kE(t,a[e],i);s=nT(n.top,s),c=tT(n.right,c),l=tT(n.bottom,l),u=nT(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function NE(e){let{width:t,height:n}=mE(e);return{width:t,height:n}}function PE(e,t,n){let r=YT(t),i=KT(t),a=n===`fixed`,o=bE(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=aT(0);function l(){c.x=xE(i)}if(r||!r&&!a)if((WT(t)!==`body`||ZT(i))&&(s=lE(t)),r){let e=bE(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?SE(i,s):aT(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function FE(e){return cE(e).position===`static`}function IE(e,t){if(!YT(e)||cE(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return KT(e)===n&&(n=n.ownerDocument.body),n}function LE(e,t){let n=GT(e);if($T(e))return n;if(!YT(e)){let t=uE(e);for(;t&&!sE(t);){if(JT(t)&&!FE(t))return t;t=uE(t)}return n}let r=IE(e,t);for(;r&&QT(r)&&FE(r);)r=IE(r,t);return r&&sE(r)&&FE(r)&&!iE(r)?n:r||aE(e)||n}var RE=async function(e){let t=this.getOffsetParent||LE,n=this.getDimensions,r=await n(e.floating);return{reference:PE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zE(e){return cE(e).direction===`rtl`}var BE={convertOffsetParentRelativeRectToViewportRelativeRect:CE,getDocumentElement:KT,getClippingRect:ME,getOffsetParent:LE,getElementRects:RE,getClientRects:wE,getDimensions:NE,getScale:gE,isElement:JT,isRTL:zE};function VE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function HE(e,t){let n=null,r,i=KT(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=iT(d),h=iT(i.clientWidth-(u+f)),g=iT(i.clientHeight-(d+p)),_=iT(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:nT(0,tT(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!VE(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function UE(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=hE(e),u=i||a?[...l?fE(l):[],...t?fE(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?HE(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?bE(e):null;c&&g();function g(){let t=bE(e);h&&!VE(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var WE=zT,GE=BT,KE=NT,qE=HT,JE=IT,YE=MT,XE=VT,ZE=(e,t,n)=>{let r=new Map,i={platform:BE,...n},a={...i.platform,_c:r};return jT(e,t,{...i,platform:a})},QE=typeof document<`u`?j.useLayoutEffect:function(){};function $E(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$E(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!$E(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function eD(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tD(e,t){let n=eD(e);return Math.round(t*n)/n}function nD(e){let t=j.useRef(e);return QE(()=>{t.current=e}),t}function rD(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=j.useState(r);$E(f,r)||p(r);let[m,h]=j.useState(null),[g,_]=j.useState(null),v=j.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=j.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=j.useRef(null),C=j.useRef(null),w=j.useRef(u),T=c!=null,E=nD(c),D=nD(i),O=nD(l),ee=j.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ZE(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};te.current&&!$E(w.current,t)&&(w.current=t,Gi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);QE(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=j.useRef(!1);QE(()=>(te.current=!0,()=>{te.current=!1}),[]),QE(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let ne=j.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),re=j.useMemo(()=>({reference:b,floating:x}),[b,x]),ie=j.useMemo(()=>{let e={position:n,left:0,top:0};if(!re.floating)return e;let t=tD(re.floating,u.x),r=tD(re.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...eD(re.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,re.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:ee,refs:ne,elements:re,floatingStyles:ie}),[u,ee,ne,re,ie])}var iD=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:YE({element:r.current,padding:i}).fn(n):r?YE({element:r,padding:i}).fn(n):{}}}},aD=(e,t)=>{let n=WE(e);return{name:n.name,fn:n.fn,options:[e,t]}},oD=(e,t)=>{let n=GE(e);return{name:n.name,fn:n.fn,options:[e,t]}},sD=(e,t)=>({fn:XE(e).fn,options:[e,t]}),cD=(e,t)=>{let n=KE(e);return{name:n.name,fn:n.fn,options:[e,t]}},lD=(e,t)=>{let n=qE(e);return{name:n.name,fn:n.fn,options:[e,t]}},uD=(e,t)=>{let n=JE(e);return{name:n.name,fn:n.fn,options:[e,t]}},dD=(e,t)=>{let n=iD(e);return{name:n.name,fn:n.fn,options:[e,t]}},fD=`Arrow`,pD=j.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,M.jsx)(z_.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,M.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});pD.displayName=fD;var mD=pD;function hD(e){let[t,n]=j.useState(void 0);return iv(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var gD=`Popper`,[_D,vD]=S_(gD),[yD,bD]=_D(gD),xD=e=>{let{__scopePopper:t,children:n}=e,[r,i]=j.useState(null),[a,o]=j.useState(void 0);return(0,M.jsx)(yD,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};xD.displayName=gD;var SD=`PopperAnchor`,CD=j.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=bD(SD,n),o=j.useRef(null),s=a.onAnchorChange,c=b_(t,j.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=j.useRef(null);j.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ND(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,M.jsx)(z_.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});CD.displayName=SD;var wD=`PopperContent`,[TD,ED]=_D(wD),DD=j.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l,collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=bD(wD,n),[_,v]=j.useState(null),y=b_(t,e=>v(e)),[b,x]=j.useState(null),S=hD(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=l?Array.isArray(l)?l:[l]:void 0,O=D!==void 0&&D.length>0,ee={padding:E,boundary:D?.filter(jD),altBoundary:O},{refs:te,floatingStyles:ne,placement:re,isPositioned:ie,middlewareData:ae}=rD({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>UE(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[aD({mainAxis:i+w,alignmentAxis:o}),c&&oD({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?sD():void 0,...ee}),c&&cD({...ee}),lD({...ee,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&dD({element:b,padding:s}),MD({arrowWidth:C,arrowHeight:w}),f&&uD({strategy:`referenceHidden`,...ee})]}),oe=g.setPlacementState;iv(()=>(oe(re),()=>{oe(void 0)}),[re,oe]);let[k,se]=ND(re),ce=V_(m);iv(()=>{ie&&ce?.()},[ie,ce]);let le=ae.arrow?.x,ue=ae.arrow?.y,A=ae.arrow?.centerOffset!==0,[de,fe]=j.useState();return iv(()=>{_&&fe(window.getComputedStyle(_).zIndex)},[_]),(0,M.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:ie?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[ae.transformOrigin?.x,ae.transformOrigin?.y].join(` `),...ae.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,M.jsx)(TD,{scope:n,placedSide:k,placedAlign:se,onArrowChange:x,arrowX:le,arrowY:ue,shouldHideArrow:A,children:(0,M.jsx)(z_.div,{"data-side":k,"data-align":se,...h,ref:y,style:{...h.style,animation:ie?void 0:`none`}})})})});DD.displayName=wD;var OD=`PopperArrow`,kD={top:`bottom`,right:`left`,bottom:`top`,left:`right`},AD=j.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=ED(OD,n),a=kD[i.placedSide];return(0,M.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,M.jsx)(mD,{...r,ref:t,style:{...r.style,display:`block`}})})});AD.displayName=OD;function jD(e){return e!==null}var MD=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ND(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function ND(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var PD=xD,FD=CD,ID=DD,LD=AD,[RD,zD]=S_(`Tooltip`,[vD]),BD=vD(),VD=`TooltipProvider`,HD=700,UD=`tooltip.open`,[WD,GD]=RD(VD),KD=e=>{let{__scopeTooltip:t,delayDuration:n=HD,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=j.useRef(!0),s=j.useRef(!1),c=j.useRef(0);return j.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,M.jsx)(WD,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:j.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:j.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:j.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};KD.displayName=VD;var qD=`Tooltip`,[JD,YD]=RD(qD),XD=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=GD(qD,e.__scopeTooltip),l=BD(t),[u,d]=j.useState(null),f=vS(),p=j.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=j.useRef(!1),[_,v]=hv({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(UD))):c.onClose(),a?.(e)},caller:qD}),y=j.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=j.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=j.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=j.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return j.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,M.jsx)(PD,{...l,children:(0,M.jsx)(JD,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:j.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:j.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};XD.displayName=qD;var ZD=`TooltipTrigger`,QD=j.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=YD(ZD,n),a=GD(ZD,n),o=BD(n),s=b_(t,j.useRef(null),i.onTriggerChange),c=j.useRef(!1),l=j.useRef(!1),u=j.useCallback(()=>c.current=!1,[]);return j.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,M.jsx)(FD,{asChild:!0,...o,children:(0,M.jsx)(z_.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:q(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:q(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:q(e.onBlur,i.onClose),onClick:q(e.onClick,i.onClose)})})});QD.displayName=ZD;var $D=`TooltipPortal`,[eO,tO]=RD($D,{forceMount:void 0}),nO=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=YD($D,t);return(0,M.jsx)(eO,{scope:t,forceMount:n,children:(0,M.jsx)(cv,{present:n||a.open,children:(0,M.jsx)(ov,{asChild:!0,container:i,children:r})})})};nO.displayName=$D;var rO=`TooltipContent`,iO=j.forwardRef((e,t)=>{let n=tO(rO,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=YD(rO,e.__scopeTooltip);return(0,M.jsx)(cv,{present:r||o.open,children:o.disableHoverableContent?(0,M.jsx)(lO,{side:i,...a,ref:t}):(0,M.jsx)(aO,{side:i,...a,ref:t})})}),aO=j.forwardRef((e,t)=>{let n=YD(rO,e.__scopeTooltip),r=GD(rO,e.__scopeTooltip),i=j.useRef(null),a=b_(t,i),[o,s]=j.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=j.useCallback(()=>{s(null),d(!1)},[d]),p=j.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=pO(r,fO(r,n.getBoundingClientRect())),a=mO(t.getBoundingClientRect());s(gO([...i,...a])),d(!0)},[d]);return j.useEffect(()=>()=>f(),[f]),j.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),j.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!hO(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,M.jsx)(lO,{...e,ref:a})}),[oO,sO]=RD(qD,{isInside:!1}),cO=D_(`TooltipContent`),lO=j.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=YD(rO,n),l=BD(n),{onClose:u}=c;return j.useEffect(()=>(document.addEventListener(UD,u),()=>document.removeEventListener(UD,u)),[u]),j.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,M.jsx)(Y_,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,M.jsxs)(ID,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,M.jsx)(cO,{children:r}),(0,M.jsx)(oO,{scope:n,isInside:!0,children:(0,M.jsx)(xv,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});iO.displayName=rO;var uO=`TooltipArrow`,dO=j.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=BD(n);return sO(uO,n).isInside?null:(0,M.jsx)(LD,{...i,...r,ref:t})});dO.displayName=uO;function fO(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function pO(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function mO(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function hO(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function gO(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),_O(t)}function _O(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vO=KD,yO=XD,bO=QD,xO=iO,SO=vO,CO=yO,wO=bO,TO=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,M.jsx)(xO,{ref:r,sideOffset:t,className:X(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n}));TO.displayName=xO.displayName;var EO=`sidebar_state`,DO=3600*24*7,OO=`16rem`,kO=`18rem`,AO=`3rem`,jO=`b`,MO=j.createContext(null);function NO(){let e=j.useContext(MO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider`);return e}var PO=j.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=oS(),[l,u]=j.useState(!1),[d,f]=j.useState(e),p=t??d,m=j.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${EO}=${t}; path=/; max-age=${DO}`},[n,p]),h=j.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);j.useEffect(()=>{let e=e=>{e.key===jO&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=j.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,M.jsx)(MO.Provider,{value:_,children:(0,M.jsx)(SO,{delayDuration:0,children:(0,M.jsx)(`div`,{style:{"--sidebar-width":OO,"--sidebar-width-icon":AO,...i},className:X(`group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-0 w-full`,r),ref:s,...o,children:a})})})});PO.displayName=`SidebarProvider`;var FO=j.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=NO();return n===`none`?(0,M.jsx)(`div`,{className:X(`bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col`,r),ref:o,...a,children:i}):s?(0,M.jsx)(Ww,{open:l,onOpenChange:u,...a,children:(0,M.jsx)(Jw,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden`,style:{"--sidebar-width":kO},side:e,children:(0,M.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})})}):(0,M.jsx)(`div`,{ref:o,className:X(`bg-sidebar text-sidebar-foreground hidden md:flex h-svh w-[var(--sidebar-width)] shrink-0 flex-col border-r transition-[width] duration-200 ease-linear overflow-hidden`,c===`collapsed`&&n===`offcanvas`&&`w-0 border-0`,c===`collapsed`&&n===`icon`&&`w-[var(--sidebar-width-icon)]`,r),"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,...a,children:i})});FO.displayName=`Sidebar`;var IO=j.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=NO();return(0,M.jsxs)(Z,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:X(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,M.jsx)(ab,{}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});IO.displayName=`SidebarTrigger`;var LO=j.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=NO();return(0,M.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:X(`hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});LO.displayName=`SidebarRail`;var RO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`main`,{ref:n,className:X(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));RO.displayName=`SidebarInset`;var zO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(cS,{ref:n,"data-sidebar":`input`,className:X(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));zO.displayName=`SidebarInput`;var BO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:X(`flex flex-col gap-2 p-2`,e),...t}));BO.displayName=`SidebarHeader`;var VO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:X(`flex flex-col gap-2 p-2`,e),...t}));VO.displayName=`SidebarFooter`;var HO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(hS,{ref:n,"data-sidebar":`separator`,className:X(`mx-2 w-auto bg-sidebar-border`,e),...t}));HO.displayName=`SidebarSeparator`;var UO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:X(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,e),...t}));UO.displayName=`SidebarContent`;var WO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:X(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));WO.displayName=`SidebarGroup`;var GO=j.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,M.jsx)(t?T_:`div`,{ref:r,"data-sidebar":`group-label`,className:X(`text-xs/6 font-medium text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 [[data-collapsible=icon]_&]:-mt-8 [[data-collapsible=icon]_&]:opacity-0 [[data-collapsible=icon]_&]:overflow-hidden`,e),...n}));GO.displayName=`SidebarGroupLabel`;var KO=j.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,M.jsx)(t?T_:`button`,{ref:r,"data-sidebar":`group-action`,className:X(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));KO.displayName=`SidebarGroupAction`;var qO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:X(`w-full text-sm`,e),...t}));qO.displayName=`SidebarGroupContent`;var JO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:X(`flex w-full min-w-0 flex-col gap-1`,e),...t}));JO.displayName=`SidebarMenu`;var YO=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:X(`group/menu-item relative`,e),...t}));YO.displayName=`SidebarMenuItem`;var XO=j.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?T_:`button`,{isMobile:l,state:u}=NO(),d=(0,M.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:X(ZO({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,M.jsxs)(CO,{children:[(0,M.jsx)(wO,{asChild:!0,children:d}),(0,M.jsx)(TO,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]})):d});XO.displayName=`SidebarMenuButton`;var ZO=xy(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),QO=j.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,M.jsx)(t?T_:`button`,{ref:i,"data-sidebar":`menu-action`,className:X(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));QO.displayName=`SidebarMenuAction`;var $O=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:X(`text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));$O.displayName=`SidebarMenuBadge`;var ek=j.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=j.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,M.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:X(`rounded-md h-8 flex gap-2 px-2 items-center`,e),...n,children:[t&&(0,M.jsx)($w,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,M.jsx)($w,{className:`h-4 flex-1 max-w-[var(--skeleton-width)]`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});ek.displayName=`SidebarMenuSkeleton`;var tk=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:X(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));tk.displayName=`SidebarMenuSub`;var nk=j.forwardRef(({...e},t)=>(0,M.jsx)(`li`,{ref:t,...e}));nk.displayName=`SidebarMenuSubItem`;var rk=j.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,M.jsx)(e?T_:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:X(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,r),...i}));rk.displayName=`SidebarMenuSubButton`;var ik=xy(`text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5`),ak=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`nav`,{ref:n,"aria-label":`breadcrumb`,className:X(ik(),e),...t}));ak.displayName=`Breadcrumb`;var ok=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ol`,{ref:n,className:X(`text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5`,e),...t}));ok.displayName=`BreadcrumbList`;var sk=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`li`,{ref:n,className:X(`inline-flex items-center gap-1.5`,e),...t}));sk.displayName=`BreadcrumbItem`;var ck=j.forwardRef(({asChild:e,className:t,...n},r)=>(0,M.jsx)(e?T_:`a`,{ref:r,className:X(`hover:text-foreground transition-colors`,t),...n}));ck.displayName=`BreadcrumbLink`;var lk=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:X(`text-foreground font-normal`,e),...t}));lk.displayName=`BreadcrumbPage`;var uk=({children:e,className:t,...n})=>(0,M.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:X(`[&>svg]:size-3.5`,t),...n,children:e??(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:(0,M.jsx)(`path`,{d:`m9 18 6-6-6-6`})})});uk.displayName=`BreadcrumbSeparator`;var dk=({className:e,...t})=>(0,M.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:X(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,M.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,M.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1`}),(0,M.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1`})]}),(0,M.jsx)(`span`,{className:`sr-only`,children:`More`})]});dk.displayName=`BreadcrumbElipssis`;var fk=j.createContext(void 0);function pk(e){let t=j.useContext(fk);return e||t||`ltr`}var mk=`rovingFocusGroup.onEntryFocus`,hk={bubbles:!1,cancelable:!0},gk=`RovingFocusGroup`,[_k,vk,yk]=R_(gk),[bk,xk]=S_(gk,[yk]),[Sk,Ck]=bk(gk),wk=j.forwardRef((e,t)=>(0,M.jsx)(_k.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(_k.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,M.jsx)(Tk,{...e,ref:t})})}));wk.displayName=gk;var Tk=j.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=j.useRef(null),p=b_(t,f),m=pk(a),[h,g]=hv({prop:o,defaultProp:s??null,onChange:c,caller:gk}),[_,v]=j.useState(!1),y=V_(l),b=vk(n),x=j.useRef(!1),[S,C]=j.useState(0);return j.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(mk,y),()=>e.removeEventListener(mk,y)},[y]),(0,M.jsx)(Sk,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:j.useCallback(e=>g(e),[g]),onItemShiftTab:j.useCallback(()=>v(!0),[]),onFocusableItemAdd:j.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:j.useCallback(()=>C(e=>e-1),[]),children:(0,M.jsx)(z_.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:q(e.onMouseDown,()=>{x.current=!0}),onFocus:q(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(mk,hk);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);jk([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:q(e.onBlur,()=>v(!1))})})}),Ek=`RovingFocusGroupItem`,Dk=j.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=vS(),l=a||c,u=Ck(Ek,n),d=u.currentTabStopId===l,f=vk(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return j.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,M.jsx)(_k.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,M.jsx)(z_.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ak(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Mk(n,r+1):n.slice(r+1)}setTimeout(()=>jk(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Dk.displayName=Ek;var Ok={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function kk(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ak(e,t,n){let r=kk(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ok[r]}function jk(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Mk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Nk=wk,Pk=Dk,Fk=[`Enter`,` `],Ik=[`ArrowDown`,`PageUp`,`Home`],Lk=[`ArrowUp`,`PageDown`,`End`],Rk=[...Ik,...Lk],zk={ltr:[...Fk,`ArrowRight`],rtl:[...Fk,`ArrowLeft`]},Bk={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Vk=`Menu`,[Hk,Uk,Wk]=R_(Vk),[Gk,Kk]=S_(Vk,[Wk,vD,xk]),qk=vD(),Jk=xk(),[Yk,Xk]=Gk(Vk),[Zk,Qk]=Gk(Vk),$k=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=qk(t),[c,l]=j.useState(null),u=j.useRef(!1),d=V_(a),f=pk(i);return j.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,M.jsx)(PD,{...s,children:(0,M.jsx)(Yk,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,M.jsx)(Zk,{scope:t,onClose:j.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};$k.displayName=Vk;var eA=`MenuAnchor`,tA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=qk(n);return(0,M.jsx)(FD,{...i,...r,ref:t})});tA.displayName=eA;var nA=`MenuPortal`,[rA,iA]=Gk(nA,{forceMount:void 0}),aA=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Xk(nA,t);return(0,M.jsx)(rA,{scope:t,forceMount:n,children:(0,M.jsx)(cv,{present:n||a.open,children:(0,M.jsx)(ov,{asChild:!0,container:i,children:r})})})};aA.displayName=nA;var oA=`MenuContent`,[sA,cA]=Gk(oA),lA=j.forwardRef((e,t)=>{let n=iA(oA,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Xk(oA,e.__scopeMenu),o=Qk(oA,e.__scopeMenu);return(0,M.jsx)(Hk.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(cv,{present:r||a.open,children:(0,M.jsx)(Hk.Slot,{scope:e.__scopeMenu,children:o.modal?(0,M.jsx)(uA,{...i,ref:t}):(0,M.jsx)(dA,{...i,ref:t})})})})}),uA=j.forwardRef((e,t)=>{let n=Xk(oA,e.__scopeMenu),r=j.useRef(null),i=b_(t,r);return j.useEffect(()=>{let e=r.current;if(e)return nw(e)},[]),(0,M.jsx)(pA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),dA=j.forwardRef((e,t)=>{let n=Xk(oA,e.__scopeMenu);return(0,M.jsx)(pA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),fA=w_(`MenuContent.ScrollLock`),pA=j.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Xk(oA,n),_=Qk(oA,n),v=qk(n),y=Jk(n),b=Uk(n),[x,S]=j.useState(null),C=j.useRef(null),w=b_(t,C,g.onContentChange),T=j.useRef(0),E=j.useRef(``),D=j.useRef(0),O=j.useRef(null),ee=j.useRef(`right`),te=j.useRef(0),ne=m?qC:j.Fragment,re=m?{as:fA,allowPinchZoom:!0}:void 0,ie=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ZA(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};j.useEffect(()=>()=>window.clearTimeout(T.current),[]),LS();let ae=j.useCallback(e=>ee.current===O.current?.side&&$A(e,O.current?.area),[]);return(0,M.jsx)(sA,{scope:n,searchRef:E,onItemEnter:j.useCallback(e=>{ae(e)&&e.preventDefault()},[ae]),onItemLeave:j.useCallback(e=>{ae(e)||(C.current?.focus(),S(null))},[ae]),onTriggerLeave:j.useCallback(e=>{ae(e)&&e.preventDefault()},[ae]),pointerGraceTimerRef:D,onPointerGraceIntentChange:j.useCallback(e=>{O.current=e},[]),children:(0,M.jsx)(ne,{...re,children:(0,M.jsx)(CS,{asChild:!0,trapped:i,onMountAutoFocus:q(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,M.jsx)(Y_,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,M.jsx)(Nk,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:q(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,M.jsx)(ID,{role:`menu`,"aria-orientation":`vertical`,"data-state":KA(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:q(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ie(e.key));let i=C.current;if(e.target!==i||!Rk.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);Lk.includes(e.key)&&a.reverse(),YA(a)}),onBlur:q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:q(e.onPointerMove,ej(e=>{let t=e.target,n=te.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ee.current=e.clientX>te.current?`right`:`left`,te.current=e.clientX)}))})})})})})})});lA.displayName=oA;var mA=`MenuGroup`,hA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,M.jsx)(z_.div,{role:`group`,...r,ref:t})});hA.displayName=mA;var gA=`MenuLabel`,_A=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,M.jsx)(z_.div,{...r,ref:t})});_A.displayName=gA;var vA=`MenuItem`,yA=`menu.itemSelect`,bA=j.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=j.useRef(null),o=Qk(vA,e.__scopeMenu),s=cA(vA,e.__scopeMenu),c=b_(t,a),l=j.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(yA,{bubbles:!0,cancelable:!0});e.addEventListener(yA,e=>r?.(e),{once:!0}),B_(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,M.jsx)(xA,{...i,ref:c,disabled:n,onClick:q(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:q(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:q(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Fk.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});bA.displayName=vA;var xA=j.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=cA(vA,n),s=Jk(n),c=j.useRef(null),l=b_(t,c),[u,d]=j.useState(!1),[f,p]=j.useState(``);return j.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,M.jsx)(Hk.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,M.jsx)(Pk,{asChild:!0,...s,focusable:!r,children:(0,M.jsx)(z_.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:q(e.onPointerMove,ej(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,ej(e=>o.onItemLeave(e))),onFocus:q(e.onFocus,()=>d(!0)),onBlur:q(e.onBlur,()=>d(!1))})})})}),SA=`MenuCheckboxItem`,CA=j.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,M.jsx)(jA,{scope:e.__scopeMenu,checked:n,children:(0,M.jsx)(bA,{role:`menuitemcheckbox`,"aria-checked":qA(n)?`mixed`:n,...i,ref:t,"data-state":JA(n),onSelect:q(i.onSelect,()=>r?.(qA(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CA.displayName=SA;var wA=`MenuRadioGroup`,[TA,EA]=Gk(wA,{value:void 0,onValueChange:()=>{}}),DA=j.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=V_(r);return(0,M.jsx)(TA,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,M.jsx)(hA,{...i,ref:t})})});DA.displayName=wA;var OA=`MenuRadioItem`,kA=j.forwardRef((e,t)=>{let{value:n,...r}=e,i=EA(OA,e.__scopeMenu),a=n===i.value;return(0,M.jsx)(jA,{scope:e.__scopeMenu,checked:a,children:(0,M.jsx)(bA,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":JA(a),onSelect:q(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});kA.displayName=OA;var AA=`MenuItemIndicator`,[jA,MA]=Gk(AA,{checked:!1}),NA=j.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=MA(AA,n);return(0,M.jsx)(cv,{present:r||qA(a.checked)||a.checked===!0,children:(0,M.jsx)(z_.span,{...i,ref:t,"data-state":JA(a.checked)})})});NA.displayName=AA;var PA=`MenuSeparator`,FA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,M.jsx)(z_.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});FA.displayName=PA;var IA=`MenuArrow`,LA=j.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=qk(n);return(0,M.jsx)(LD,{...i,...r,ref:t})});LA.displayName=IA;var RA=`MenuSub`,[zA,BA]=Gk(RA),VA=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Xk(RA,t),o=qk(t),[s,c]=j.useState(null),[l,u]=j.useState(null),d=V_(i);return j.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,M.jsx)(PD,{...o,children:(0,M.jsx)(Yk,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,M.jsx)(zA,{scope:t,contentId:vS(),triggerId:vS(),trigger:s,onTriggerChange:c,children:n})})})};VA.displayName=RA;var HA=`MenuSubTrigger`,UA=j.forwardRef((e,t)=>{let n=Xk(HA,e.__scopeMenu),r=Qk(HA,e.__scopeMenu),i=BA(HA,e.__scopeMenu),a=cA(HA,e.__scopeMenu),o=j.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=j.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return j.useEffect(()=>u,[u]),j.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,M.jsx)(tA,{asChild:!0,...l,children:(0,M.jsx)(xA,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":KA(n.open),...e,ref:y_(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:q(e.onPointerMove,ej(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:q(e.onPointerLeave,ej(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:q(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||zk[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});UA.displayName=HA;var WA=`MenuSubContent`,GA=j.forwardRef((e,t)=>{let n=iA(oA,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Xk(oA,e.__scopeMenu),s=Qk(oA,e.__scopeMenu),c=BA(WA,e.__scopeMenu),l=j.useRef(null),u=b_(t,l);return(0,M.jsx)(Hk.Provider,{scope:e.__scopeMenu,children:(0,M.jsx)(cv,{present:r||o.open,children:(0,M.jsx)(Hk.Slot,{scope:e.__scopeMenu,children:(0,M.jsx)(pA,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:q(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:q(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:q(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Bk[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});GA.displayName=WA;function KA(e){return e?`open`:`closed`}function qA(e){return e===`indeterminate`}function JA(e){return qA(e)?`indeterminate`:e?`checked`:`unchecked`}function YA(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function XA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ZA(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=XA(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function QA(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function $A(e,t){return t?QA({x:e.clientX,y:e.clientY},t):!1}function ej(e){return t=>t.pointerType===`mouse`?e(t):void 0}var tj=$k,nj=tA,rj=aA,ij=lA,aj=hA,oj=_A,sj=bA,cj=CA,lj=DA,uj=kA,dj=NA,fj=FA,pj=LA,mj=UA,hj=GA,gj=`DropdownMenu`,[_j,vj]=S_(gj,[Kk]),yj=Kk(),[bj,xj]=_j(gj),Sj=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=yj(t),l=j.useRef(null),[u,d]=hv({prop:i,defaultProp:a??!1,onChange:o,caller:gj});return(0,M.jsx)(bj,{scope:t,triggerId:vS(),triggerRef:l,contentId:vS(),open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,M.jsx)(tj,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Sj.displayName=gj;var Cj=`DropdownMenuTrigger`,wj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=xj(Cj,n),o=yj(n);return(0,M.jsx)(nj,{asChild:!0,...o,children:(0,M.jsx)(z_.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:y_(t,a.triggerRef),onPointerDown:q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});wj.displayName=Cj;var Tj=`DropdownMenuPortal`,Ej=e=>{let{__scopeDropdownMenu:t,...n}=e,r=yj(t);return(0,M.jsx)(rj,{...r,...n})};Ej.displayName=Tj;var Dj=`DropdownMenuContent`,Oj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xj(Dj,n),a=yj(n),o=j.useRef(!1);return(0,M.jsx)(ij,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:q(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Oj.displayName=Dj;var kj=`DropdownMenuGroup`,Aj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(aj,{...i,...r,ref:t})});Aj.displayName=kj;var jj=`DropdownMenuLabel`,Mj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(oj,{...i,...r,ref:t})});Mj.displayName=jj;var Nj=`DropdownMenuItem`,Pj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(sj,{...i,...r,ref:t})});Pj.displayName=Nj;var Fj=`DropdownMenuCheckboxItem`,Ij=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(cj,{...i,...r,ref:t})});Ij.displayName=Fj;var Lj=`DropdownMenuRadioGroup`,Rj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(lj,{...i,...r,ref:t})});Rj.displayName=Lj;var zj=`DropdownMenuRadioItem`,Bj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(uj,{...i,...r,ref:t})});Bj.displayName=zj;var Vj=`DropdownMenuItemIndicator`,Hj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(dj,{...i,...r,ref:t})});Hj.displayName=Vj;var Uj=`DropdownMenuSeparator`,Wj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(fj,{...i,...r,ref:t})});Wj.displayName=Uj;var Gj=`DropdownMenuArrow`,Kj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(pj,{...i,...r,ref:t})});Kj.displayName=Gj;var qj=`DropdownMenuSubTrigger`,Jj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(mj,{...i,...r,ref:t})});Jj.displayName=qj;var Yj=`DropdownMenuSubContent`,Xj=j.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=yj(n);return(0,M.jsx)(hj,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Xj.displayName=Yj;var Zj=Sj,Qj=wj,$j=Ej,eM=Oj,tM=Mj,nM=Pj,rM=Ij,iM=Bj,aM=Hj,oM=Wj,sM=Jj,cM=Xj,lM=Zj,uM=Qj,dM=j.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,M.jsxs)(sM,{ref:i,className:X(`flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,M.jsx)(Iy,{className:`ml-auto`})]}));dM.displayName=sM.displayName;var fM=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(cM,{ref:n,className:X(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));fM.displayName=cM.displayName;var pM=j.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,M.jsx)($j,{children:(0,M.jsx)(eM,{ref:r,sideOffset:t,className:X(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));pM.displayName=eM.displayName;var mM=j.forwardRef(({className:e,inset:t,...n},r)=>(0,M.jsx)(nM,{ref:r,className:X(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...n}));mM.displayName=nM.displayName;var hM=j.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,M.jsxs)(rM,{ref:i,className:X(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,M.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,M.jsx)(aM,{children:(0,M.jsx)(Py,{className:`h-4 w-4`})})}),t]}));hM.displayName=rM.displayName;var gM=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(iM,{ref:r,className:X(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,M.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,M.jsx)(aM,{children:(0,M.jsx)(Hy,{className:`h-2 w-2 fill-current`})})}),t]}));gM.displayName=iM.displayName;var _M=j.forwardRef(({className:e,inset:t,...n},r)=>(0,M.jsx)(tM,{ref:r,className:X(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));_M.displayName=tM.displayName;var vM=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(oM,{ref:n,className:X(`-mx-1 my-1 h-px bg-muted`,e),...t}));vM.displayName=oM.displayName;var yM=({className:e,...t})=>(0,M.jsx)(`span`,{className:X(`ml-auto text-xs tracking-widest opacity-60`,e),...t});yM.displayName=`DropdownMenuShortcut`;var bM=`modulepreload`,xM=function(e){return`/_account/`+e},SM={},CM=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=xM(t,n),t in SM)return;SM[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:bM,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},wM=[`en`,`zh-CN`],TM={en:()=>CM(()=>import(`./en-QM3gmMOi.js`),[]),"zh-CN":()=>CM(()=>import(`./zh-CN-B0Jn4kQl.js`),[])};function EM(e){return wM.includes(e)?e:e.toLowerCase().startsWith(`zh`)?`zh-CN`:`en`}async function DM(e){let t=EM(e);try{return(await TM[t]()).default}catch(t){return console.warn(`[account/i18n] Failed to load language pack '${e}':`,t),{}}}var OM={en:`English`,"zh-CN":`中文`};function kM(){let{t:e,language:t,changeLanguage:n}=vt();async function r(e){await n(e);try{localStorage.setItem(`account.lang`,e)}catch{}}return(0,M.jsxs)(lM,{children:[(0,M.jsx)(uM,{asChild:!0,children:(0,M.jsxs)(Z,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":e(`common.language`),children:[(0,M.jsx)(Zy,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:e(`common.language`)})]})}),(0,M.jsx)(pM,{align:`end`,children:wM.map(e=>(0,M.jsx)(mM,{onSelect:()=>void r(e),className:e===t?`font-medium`:void 0,children:OM[e]},e))})]})}function AM(e){let t=document.documentElement;e===`dark`?t.classList.add(`dark`):t.classList.remove(`dark`)}function jM(){let{t:e}=vt(),[,t]=(0,j.useState)(`light`);(0,j.useEffect)(()=>{let e=localStorage.getItem(`theme`);e?(t(e),AM(e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e)):(t(`system`),AM(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`))},[]);function n(e){t(e),localStorage.setItem(`theme`,e),AM(e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e)}return(0,M.jsxs)(lM,{children:[(0,M.jsx)(uM,{asChild:!0,children:(0,M.jsxs)(Z,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:[(0,M.jsx)(pb,{className:`h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,M.jsx)(ib,{className:`absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`}),(0,M.jsx)(`span`,{className:`sr-only`,children:e(`common.toggleTheme`)})]})}),(0,M.jsxs)(pM,{align:`end`,children:[(0,M.jsxs)(mM,{onClick:()=>n(`light`),children:[(0,M.jsx)(pb,{className:`mr-2 h-4 w-4`}),e(`common.light`)]}),(0,M.jsxs)(mM,{onClick:()=>n(`dark`),children:[(0,M.jsx)(ib,{className:`mr-2 h-4 w-4`}),e(`common.dark`)]}),(0,M.jsx)(mM,{onClick:()=>n(`system`),children:e(`common.system`)})]})]})}var MM=!1;function NM(){let[e,t]=j.useState(MM);return j.useEffect(()=>{MM||(MM=!0,t(!0))},[]),e}var PM=j.useSyncExternalStore;function FM(){return()=>{}}function IM(){return PM(FM,()=>!0,()=>!1)}var LM=typeof PM==`function`?IM:NM,RM=`Avatar`,[zM,BM]=S_(RM),[VM,HM]=zM(RM),UM=j.forwardRef((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,a]=j.useState(`idle`);return(0,M.jsx)(VM,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:(0,M.jsx)(z_.span,{...r,ref:t})})});UM.displayName=RM;var WM=`AvatarImage`,GM=j.forwardRef((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=HM(WM,n),s=YM(r,a),c=V_(e=>{i(e),o.onImageLoadingStatusChange(e)});return iv(()=>{s!==`idle`&&c(s)},[s,c]),s===`loaded`?(0,M.jsx)(z_.img,{...a,ref:t,src:r}):null});GM.displayName=WM;var KM=`AvatarFallback`,qM=j.forwardRef((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,a=HM(KM,n),[o,s]=j.useState(r===void 0);return j.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,M.jsx)(z_.span,{...i,ref:t}):null});qM.displayName=KM;function JM(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function YM(e,{referrerPolicy:t,crossOrigin:n}){let r=LM(),i=j.useRef(null),a=r?(i.current||=new window.Image,i.current):null,[o,s]=j.useState(()=>JM(a,e));return iv(()=>{s(JM(a,e))},[a,e]),iv(()=>{let e=e=>()=>{s(e)};if(!a)return;let r=e(`loaded`),i=e(`error`);return a.addEventListener(`load`,r),a.addEventListener(`error`,i),t&&(a.referrerPolicy=t),typeof n==`string`&&(a.crossOrigin=n),()=>{a.removeEventListener(`load`,r),a.removeEventListener(`error`,i)}},[a,n,t]),o}var XM=UM,ZM=GM,QM=qM,$M=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(XM,{ref:n,className:X(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));$M.displayName=XM.displayName;var eN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(ZM,{ref:n,className:X(`aspect-square h-full w-full`,e),...t}));eN.displayName=ZM.displayName;var tN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(QM,{ref:n,className:X(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));tN.displayName=QM.displayName;var nN=(0,j.createContext)(null),rN=`auth-session-token`,iN=`auth-active-organization-id`;function aN(e){if(!(typeof window>`u`))try{e?.token?localStorage.setItem(rN,e.token):localStorage.removeItem(rN),e?.activeOrganizationId?localStorage.setItem(iN,e.activeOrganizationId):localStorage.removeItem(iN)}catch{}}function oN(e){if(!e)return{user:null,session:null};let t=e.data===void 0?e:e.data;return t?{user:t.user??null,session:t.session??null}:{user:null,session:null}}function sN({children:e}){let t=o_(),[n,r]=(0,j.useState)(null),[i,a]=(0,j.useState)(null),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(null),[u,d]=(0,j.useState)([]),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(!1),[g,_]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!t?.auth?.getConfig)return;let e=!1;return t.auth.getConfig().then(t=>{if(e)return;let n=t?.data??t??{},r={...n.features??{}};n.emailPassword?.disableSignUp===!0&&(r.signUpDisabled=!0),_(r)}).catch(()=>{e||_(null)}),()=>{e=!0}},[t]);let v=(0,j.useCallback)(async()=>{if(t?.organizations){p(!0);try{d((await t.organizations.list())?.organizations??[])}catch{d([])}finally{p(!1),h(!0)}}},[t]),y=(0,j.useCallback)(async()=>{if(t?.auth){s(!0),l(null);try{let{user:e,session:n}=oN(await t.auth.me());r(e),a(n),aN(e?n:null)}catch(e){l(e),r(null),a(null),aN(null)}finally{s(!1)}}},[t]);(0,j.useEffect)(()=>{y()},[y]),(0,j.useEffect)(()=>{n?v():(d([]),h(!1))},[n,v]);let b=(0,j.useCallback)(async()=>{if(t?.auth)try{await t.auth.logout()}finally{r(null),a(null),d([]),h(!1),aN(null)}},[t]),x=(0,j.useCallback)(async e=>{if(t?.organizations){await t.organizations.setActive(e),await y();try{localStorage.setItem(iN,e)}catch{}}},[t,y]),S=(0,j.useMemo)(()=>({user:n,session:i,loading:o,error:c,refresh:y,logout:b,setActiveOrganization:x,organizations:u,organizationsLoading:f,organizationsFetched:m,reloadOrganizations:v,features:g}),[n,i,o,c,y,b,x,u,f,m,v,g]);return(0,j.createElement)(nN.Provider,{value:S},e)}function cN(){let e=(0,j.useContext)(nN);if(!e)throw Error(`useSession must be used inside <SessionProvider>.`);return e}function lN(){let{organizations:e,organizationsLoading:t,reloadOrganizations:n}=cN();return{organizations:e,loading:t,error:null,reload:n}}function uN(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null);return{create:(0,j.useCallback)(async t=>{if(!e?.organizations)throw Error(`Client not ready`);n(!0),i(null);try{return await e.organizations.create(t)}catch(e){throw i(e),e}finally{n(!1)}},[e]),creating:t,error:r}}function dN(){let e=o_(),{reloadOrganizations:t,refresh:n}=cN(),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null);return{update:(0,j.useCallback)(async(r,a)=>{if(!e?.organizations?.update)throw Error(`Client not ready`);i(!0),o(null);try{let i=await e.organizations.update(r,a);return await t(),await n(),i}catch(e){throw o(e),e}finally{i(!1)}},[e,t,n]),updating:r,error:a}}function fN(){let e=o_(),{reloadOrganizations:t,refresh:n}=cN(),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null);return{remove:(0,j.useCallback)(async r=>{if(!e?.organizations?.delete)throw Error(`Client not ready`);i(!0),o(null);try{let i=await e.organizations.delete(r);return await t(),await n(),i}catch(e){throw o(e),e}finally{i(!1)}},[e,t,n]),deleting:r,error:a}}function pN({message:e}){return typeof document>`u`?null:(0,Gi.createPortal)((0,M.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm`,children:(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-8 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:e})]})}),document.body)}function mN(e,t){let n=(e||t||`?`).trim(),r=n.split(/\s+/);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():n.slice(0,2).toUpperCase()}function hN(){let{t:e}=vt(),t=Hi(),{user:n,loading:r,logout:i}=cN(),[a,o]=(0,j.useState)(!1);return r&&!n?(0,M.jsx)(`div`,{className:`h-8 w-8 animate-pulse rounded-full bg-muted`,"aria-hidden":!0}):n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(lM,{children:[(0,M.jsx)(uM,{asChild:!0,children:(0,M.jsx)(Z,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,children:(0,M.jsxs)($M,{className:`h-7 w-7`,children:[n.image?(0,M.jsx)(eN,{src:n.image,alt:n.name??n.email??e(`userMenu.user`)}):null,(0,M.jsx)(tN,{className:`text-[11px]`,children:mN(n.name,n.email)})]})})}),(0,M.jsxs)(pM,{align:`end`,className:`w-64`,children:[(0,M.jsx)(_M,{children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,M.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.name||n.email}),n.email&&(0,M.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:n.email})]})}),(0,M.jsx)(vM,{}),(0,M.jsxs)(mM,{onSelect:()=>t({to:`/account`}),children:[(0,M.jsx)(xb,{className:`mr-2 h-3.5 w-3.5`}),e(`userMenu.account`)]}),(0,M.jsxs)(mM,{onSelect:()=>t({to:`/organizations`}),children:[(0,M.jsx)(Ny,{className:`mr-2 h-3.5 w-3.5`}),e(`userMenu.organizations`)]}),(0,M.jsx)(vM,{}),(0,M.jsxs)(mM,{onSelect:async()=>{o(!0);try{await i()}finally{window.location.assign(`/_account/login`)}},disabled:a,children:[(0,M.jsx)(eb,{className:`mr-2 h-3.5 w-3.5`}),e(`userMenu.signOut`)]})]})]}),a?(0,M.jsx)(pN,{message:e(`auth.userMenu.signingOut`,{defaultValue:`Signing you out…`})}):null]}):(0,M.jsx)(Z,{variant:`outline`,size:`sm`,className:`h-8`,onClick:()=>t({to:`/login`}),children:e(`userMenu.signIn`)})}function gN(){let{t:e}=vt(),t=Hi(),n=Oa(),{organizations:r,loading:i,reload:a}=lN(),{session:o,setActiveOrganization:s}=cN(),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(!1),f=o?.activeOrganizationId??void 0,p=(0,j.useMemo)(()=>r.find(e=>e.id===f)??null,[r,f]),m=async r=>{if(l(!1),r===f){t({to:`/organizations/$orgId/general`,params:{orgId:r}});return}d(!0);try{await s(r),await a(),K({title:e(`organizations.general.switched`)});let i=n.pathname.match(/^\/organizations\/[^/]+\/(general|members)\/?$/);t({to:(i?i[1]:`general`)===`members`?`/organizations/$orgId/members`:`/organizations/$orgId/general`,params:{orgId:r}})}catch(t){K({title:e(`organizations.switchFailed`),description:t.message,variant:`destructive`})}finally{d(!1)}};return(0,M.jsxs)(lM,{open:c,onOpenChange:l,children:[(0,M.jsx)(uM,{asChild:!0,children:(0,M.jsxs)(Z,{variant:`ghost`,size:`sm`,className:`h-8 gap-2 px-2 text-sm font-medium`,disabled:u,children:[p?(0,M.jsx)(`span`,{className:`max-w-[160px] truncate`,children:p.name}):(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(i?`organizations.loading`:`organizationSwitcher.select`)}),(0,M.jsx)(Ry,{className:`h-3 w-3 opacity-50`})]})}),(0,M.jsxs)(pM,{align:`start`,className:`w-[280px]`,sideOffset:4,children:[(0,M.jsx)(_M,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:e(`organizations.title`)}),r.length===0&&!i&&(0,M.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:e(`organizations.emptyTitle`)}),r.map(e=>(0,M.jsxs)(mM,{onSelect:t=>{t.preventDefault(),m(e.id)},className:`flex items-center gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,M.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),e.slug&&(0,M.jsx)(`code`,{className:`text-[11px] text-muted-foreground font-mono`,children:e.slug})]}),e.id===f&&(0,M.jsx)(Py,{className:`h-3.5 w-3.5 text-primary`})]},e.id)),(0,M.jsx)(vM,{}),(0,M.jsxs)(mM,{onSelect:e=>{e.preventDefault(),l(!1),t({to:`/organizations/new`})},className:`gap-2 text-sm`,children:[(0,M.jsx)(ob,{className:`h-3.5 w-3.5`}),e(`organizationSwitcher.new`)]}),(0,M.jsx)(mM,{onSelect:e=>{e.preventDefault(),l(!1),t({to:`/organizations`})},className:`gap-2 text-sm text-muted-foreground`,children:e(`organizationSwitcher.manage`)})]})]})}function _N({label:e}){return(0,M.jsx)(`a`,{href:`/`,className:`flex h-8 w-8 items-center justify-center rounded-md bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30 ring-1 ring-white/15 transition-transform hover:scale-105`,"aria-label":e,children:(0,M.jsx)(By,{className:`h-4 w-4`})})}function vN(){return(0,M.jsx)(Iy,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground/50`})}function yN(){let{t:e}=vt(),t=Oa(),n=Bi({strict:!1}),r=(0,j.useMemo)(()=>{let r=t.pathname,i=t=>e(`topBar.breadcrumb.${t}`);if(r.startsWith(`/account`)){let e=[{label:i(`account`)}];return r===`/account/profile`?e.push({label:i(`profile`)}):r===`/account/security`?e.push({label:i(`security`)}):r===`/account/sessions`?e.push({label:i(`sessions`)}):r===`/account/two-factor`?e.push({label:i(`twoFactor`)}):r===`/account/oauth-applications`?e.push({label:i(`oauthApps`)}):r===`/account/oauth-applications/new`?e.push({label:i(`oauthApps`)},{label:i(`new`)}):r.startsWith(`/account/oauth-applications/`)&&e.push({label:i(`oauthApps`)}),e}if(r===`/organizations/new`)return[{label:i(`organizations`)},{label:i(`new`)}];if(n.orgId){let e=r.endsWith(`/general`)?i(`general`):r.endsWith(`/members`)?i(`members`):i(`settings`);return[{label:i(`organizations`)},{label:e}]}return r===`/organizations`||r.startsWith(`/organizations/`)?[{label:i(`organizations`)}]:r.startsWith(`/accept-invitation/`)?[{label:i(`acceptInvitation`)}]:r.startsWith(`/auth/device`)?[{label:i(`deviceAuthorization`)}]:[{label:i(`account`)}]},[t.pathname,n.orgId,e]);return(0,M.jsxs)(`header`,{className:`sticky top-0 z-30 flex h-14 shrink-0 items-center justify-between gap-2 border-b bg-background/80 px-2 backdrop-blur supports-[backdrop-filter]:bg-background/70 sm:px-4`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 sm:gap-2.5`,children:[(0,M.jsx)(`div`,{className:`sm:hidden`,children:(0,M.jsx)(IO,{className:`h-9 w-9`})}),(0,M.jsx)(_N,{label:e(`topBar.accountHome`)}),(0,M.jsx)(`span`,{className:`hidden text-sm font-semibold tracking-tight sm:inline`,children:e(`topBar.brand`)}),(0,M.jsxs)(`div`,{className:`hidden items-center gap-1.5 sm:flex`,children:[(0,M.jsx)(hS,{orientation:`vertical`,className:`mx-1 h-4`}),(0,M.jsx)(gN,{}),(0,M.jsx)(vN,{}),(0,M.jsx)(ak,{children:(0,M.jsx)(ok,{children:r.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center`,children:[t>0&&(0,M.jsx)(uk,{}),(0,M.jsx)(sk,{children:(0,M.jsx)(lk,{className:`font-medium`,children:e.label})})]},t))})})]}),(0,M.jsx)(`div`,{className:`min-w-0 flex-1 sm:hidden`,children:r.length>0&&(0,M.jsx)(`span`,{className:`truncate text-sm font-medium`,children:r[r.length-1].label})})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1 sm:gap-2`,children:[(0,M.jsx)(`div`,{className:`hidden sm:block`,children:(0,M.jsx)(kM,{})}),(0,M.jsx)(`div`,{className:`hidden sm:block`,children:(0,M.jsx)(jM,{})}),(0,M.jsx)(hN,{})]})]})}var bN=[{to:`/account`,label:`home`,icon:Jy,exact:!0},{to:`/account/profile`,label:`profile`,icon:xb},{to:`/account/security`,label:`security`,icon:db},{to:`/account/sessions`,label:`sessions`,icon:rb},{to:`/account/two-factor`,label:`twoFactor`,icon:ub},{to:`/account/invitations`,label:`invitations`,icon:Yy},{to:`/account/linked-accounts`,label:`linkedAccounts`,icon:$y}],xN=[`group/nav relative transition-all duration-150`,`before:absolute before:left-0 before:top-1/2 before:h-5 before:w-[3px] before:-translate-y-1/2 before:rounded-r-full before:bg-brand-gradient before:opacity-0 before:transition-opacity`,`data-[active=true]:before:opacity-100`,`data-[active=true]:bg-sidebar-accent/80 data-[active=true]:text-sidebar-accent-foreground`,`[&>svg]:transition-transform [&>svg]:duration-150 hover:[&>svg]:scale-110`,`data-[active=true]:[&>svg]:text-primary`].join(` `);function SN(){let{t:e}=vt(),{pathname:t}=Oa(),{organizations:n}=lN(),r=t,i=t.match(/^\/organizations\/([^/]+)(?:\/.*)?$/),a=i&&n.some(e=>e.id===i[1])?i[1]:null;return(0,M.jsxs)(FO,{collapsible:`icon`,className:`h-full`,children:[(0,M.jsxs)(UO,{children:[(0,M.jsxs)(WO,{children:[(0,M.jsx)(GO,{children:e(`sidebar.groups.account`)}),(0,M.jsx)(qO,{children:(0,M.jsx)(JO,{children:bN.map(t=>{let n=t.icon;return(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{asChild:!0,isActive:t.exact?r===t.to||r===`${t.to}/`:r===t.to||r.startsWith(`${t.to}/`),tooltip:e(`sidebar.items.${t.label}`),className:xN,children:(0,M.jsxs)(ra,{to:t.to,children:[(0,M.jsx)(n,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.${t.label}`)})]})})},t.to)})})})]}),(0,M.jsx)(HO,{}),(0,M.jsxs)(WO,{children:[(0,M.jsx)(GO,{children:e(`sidebar.groups.organization`)}),(0,M.jsx)(qO,{children:(0,M.jsxs)(JO,{children:[(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{asChild:!0,isActive:t===`/organizations`,tooltip:e(`sidebar.items.overview`),className:xN,children:(0,M.jsxs)(ra,{to:`/organizations`,children:[(0,M.jsx)(Ny,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.overview`)})]})})}),a&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{asChild:!0,isActive:t===`/organizations/${a}/general`,tooltip:e(`sidebar.items.general`),className:xN,children:(0,M.jsxs)(ra,{to:`/organizations/$orgId/general`,params:{orgId:a},children:[(0,M.jsx)(lb,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.general`)})]})})}),(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{asChild:!0,isActive:t===`/organizations/${a}/members`,tooltip:e(`sidebar.items.members`),className:xN,children:(0,M.jsxs)(ra,{to:`/organizations/$orgId/members`,params:{orgId:a},children:[(0,M.jsx)(Sb,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.members`)})]})})}),(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{asChild:!0,isActive:t===`/organizations/${a}/teams`,tooltip:e(`sidebar.items.teams`),className:xN,children:(0,M.jsxs)(ra,{to:`/organizations/$orgId/teams`,params:{orgId:a},children:[(0,M.jsx)(bb,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.teams`)})]})})})]})]})})]}),(0,M.jsx)(HO,{}),(0,M.jsxs)(WO,{children:[(0,M.jsx)(GO,{children:e(`sidebar.groups.developer`)}),(0,M.jsx)(qO,{children:(0,M.jsx)(JO,{children:(0,M.jsx)(YO,{children:(0,M.jsx)(XO,{asChild:!0,isActive:t.startsWith(`/account/oauth-applications`),tooltip:e(`sidebar.items.oauthApps`),className:xN,children:(0,M.jsxs)(ra,{to:`/account/oauth-applications`,children:[(0,M.jsx)(Xy,{className:`size-4`}),(0,M.jsx)(`span`,{children:e(`sidebar.items.oauthApps`)})]})})})})})]})]}),(0,M.jsx)(VO,{children:(0,M.jsx)(JO,{children:(0,M.jsx)(YO,{children:(0,M.jsx)(CN,{})})})})]})}function CN(){let{t:e}=vt(),{state:t,toggleSidebar:n}=NO(),r=e(t===`collapsed`?`sidebar.expand`:`sidebar.collapse`);return(0,M.jsx)(XO,{onClick:n,tooltip:r,"aria-label":r,children:(0,M.jsx)(ab,{className:`size-4`})})}function wN(){return typeof window<`u`&&window.location.pathname.startsWith(`/_account`)?window.location.origin:`http://localhost:3000`}var TN=new Set([`/login`,`/register`,`/forgot-password`,`/reset-password`,`/verify-email`,`/verify-email-prompt`,`/auth/device`,`/setup`]);function EN(e){return TN.has(e)||e.startsWith(`/accept-invitation/`)}function DN(){let[e,t]=(0,j.useState)(null);return(0,j.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await fetch(`/api/v1/auth/bootstrap-status`);if(!n.ok){e||t(!0);return}let r=await n.json();e||t(r.hasOwner!==!1)}catch{e||t(!0)}})(),()=>{e=!0}},[]),e}function ON({children:e}){let{user:t,loading:n}=cN(),r=Hi(),i=Oa(),a=EN(i.pathname),o=i.pathname.startsWith(`/oauth/`)||i.pathname===`/organizations/new`,s=DN(),c=i.pathname===`/setup`;return(0,j.useEffect)(()=>{s===!1&&!c&&!t&&r({to:`/setup`,replace:!0})},[s,c,t,r]),(0,j.useEffect)(()=>{n||s!==!1&&!t&&!a&&r({to:`/login`,search:{redirect:i.pathname+i.searchStr},replace:!0})},[t,n,a,r,i.pathname,i.searchStr,s]),s===null||n&&!t?(0,M.jsx)(`div`,{className:`flex min-h-screen w-full flex-1 items-center justify-center bg-background`,children:(0,M.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary`})}):s===!1&&!c||!t&&!a?null:a||o?(0,M.jsx)(`div`,{className:`flex min-h-screen w-full`,children:e}):(0,M.jsxs)(PO,{className:`flex h-svh w-full flex-col`,children:[(0,M.jsx)(yN,{}),(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 w-full`,children:[(0,M.jsx)(SN,{}),(0,M.jsx)(RO,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col overflow-auto bg-background`,children:e})})]})]})}function kN(){let e=wN(),t=(0,j.useMemo)(()=>new t_({baseUrl:e}),[e]),{language:n}=vt();return(0,M.jsx)(a_,{client:t,locale:n,children:(0,M.jsxs)(sN,{children:[(0,M.jsx)(ON,{children:(0,M.jsx)(ya,{})}),(0,M.jsx)(iS,{})]})})}var AN=ca({component:kN}),Q=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:X(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));Q.displayName=`Card`;var jN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:X(`flex flex-col space-y-1.5 p-6`,e),...t}));jN.displayName=`CardHeader`;var MN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`h3`,{ref:n,className:X(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));MN.displayName=`CardTitle`;var NN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`p`,{ref:n,className:X(`text-sm text-muted-foreground`,e),...t}));NN.displayName=`CardDescription`;var PN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:X(`p-6 pt-0`,e),...t}));PN.displayName=`CardContent`;var FN=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:X(`flex items-center p-6 pt-0`,e),...t}));FN.displayName=`CardFooter`;function IN(e){let t=e.split(`:`)[0].toLowerCase();return/^cloud\./.test(t)}function LN(){return typeof window>`u`?null:window.location.host||null}function RN({children:e,formWidth:t=`sm`}){let{t:n}=vt(),r=t===`md`?`max-w-md`:`max-w-sm`,i=LN(),a=!!i&&!IN(i);return j.useEffect(()=>{if(typeof document>`u`||!i)return;let e=document.title;return a&&(document.title=i),()=>{document.title=e}},[i,a]),(0,M.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted p-6`,children:(0,M.jsxs)(`div`,{className:X(`flex w-full flex-col gap-4`,r),children:[a?(0,M.jsx)(`div`,{className:`flex justify-center`,children:(0,M.jsx)(`span`,{className:`rounded-full border border-border/60 bg-background/60 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wide text-muted-foreground`,title:n(`auth.shell.tenantHostHint`,{defaultValue:`You are signing in to this workspace`}),children:i})}):null,e]})})}var zN=la(`/verify-email-prompt`)({validateSearch:e=>({email:typeof e.email==`string`?e.email:void 0,redirect:typeof e.redirect==`string`?e.redirect:void 0}),component:BN});function BN(){let{t:e}=vt(),t=Hi(),{email:n,redirect:r}=zN.useSearch(),i=o_(),[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(!1);return(0,M.jsx)(RN,{children:(0,M.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,M.jsxs)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-primary/10`,children:(0,M.jsx)(tb,{className:`size-8 text-primary`})}),(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.title`,{defaultValue:`Verify your email address`})}),(0,M.jsx)(NN,{children:e(`auth.verifyEmail.description`,{defaultValue:`We sent a verification link to your email address. Please click the link to verify your account.`})})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n?(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.verifyEmail.sentTo`,{defaultValue:`Sent to:`}),` `,(0,M.jsx)(`span`,{className:`font-medium text-foreground`,children:n})]}):null,(0,M.jsx)(Z,{onClick:async()=>{if(!n||!i?.auth){K({title:e(`auth.verifyEmail.resendFailed`,{defaultValue:`Cannot resend verification email`}),description:e(`auth.verifyEmail.emailMissing`,{defaultValue:`Email address is missing`}),variant:`destructive`});return}o(!0);try{let t=await fetch(`/api/v1/auth/send-verification-email`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:n,callbackURL:r||`/`})});if(!t.ok){let e=await t.json().catch(()=>({message:`Unknown error`}));throw Error(e.message||`Failed to send verification email`)}c(!0),K({title:e(`auth.verifyEmail.resentSuccess`,{defaultValue:`Verification email sent!`}),description:e(`auth.verifyEmail.resentDescription`,{defaultValue:`Please check your inbox and click the verification link.`})})}catch(t){K({title:e(`auth.verifyEmail.resendFailed`,{defaultValue:`Failed to resend verification email`}),description:t.message,variant:`destructive`})}finally{o(!1)}},disabled:a||s,className:`w-full`,variant:s?`outline`:`default`,children:a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(sb,{className:`mr-2 size-4 animate-spin`}),e(`auth.verifyEmail.resending`,{defaultValue:`Sending...`})]}):s?e(`auth.verifyEmail.resent`,{defaultValue:`Email sent! Check your inbox`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(sb,{className:`mr-2 size-4`}),e(`auth.verifyEmail.resendButton`,{defaultValue:`Resend verification email`})]})}),(0,M.jsxs)(`div`,{className:`relative`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,M.jsx)(`span`,{className:`w-full border-t`})}),(0,M.jsx)(`div`,{className:`relative flex justify-center text-xs uppercase`,children:(0,M.jsx)(`span`,{className:`bg-card px-2 text-muted-foreground`,children:e(`auth.verifyEmail.or`,{defaultValue:`Or`})})})]}),(0,M.jsx)(Z,{onClick:()=>{t({to:`/login`,search:r?{redirect:r}:void 0})},variant:`ghost`,className:`w-full`,children:e(`auth.verifyEmail.backToLogin`,{defaultValue:`Back to login`})}),(0,M.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:e(`auth.verifyEmail.checkSpam`,{defaultValue:`Didn't receive the email? Check your spam folder or contact support.`})})]})})]})})})}var VN=la(`/verify-email`)({validateSearch:e=>{let t=e.token;return typeof t==`string`?{token:t}:{}},component:HN});function HN(){let{t:e}=vt(),{token:t}=VN.useSearch(),n=o_(),[r,i]=(0,j.useState)(`loading`),[a,o]=(0,j.useState)(``);return(0,j.useEffect)(()=>{if(!t){i(`error`),o(e(`auth.verifyEmail.missingToken`));return}let r=!1;return(async()=>{try{await n.auth.verifyEmail({token:t}),r||i(`success`)}catch(t){r||(i(`error`),o(t.message||e(`auth.verifyEmail.errorDescription`)))}})(),()=>{r=!0}},[t,e,n]),(0,M.jsx)(RN,{children:(0,M.jsxs)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[r===`loading`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.verifyingTitle`)}),(0,M.jsx)(NN,{children:e(`auth.verifyEmail.verifyingDescription`)})]}),(0,M.jsx)(PN,{className:`flex justify-center py-6`,children:(0,M.jsx)(`div`,{className:`h-10 w-10 animate-spin rounded-full border-4 border-muted border-t-primary`})})]}),r===`success`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-2 flex size-12 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-500 ring-1 ring-emerald-500/30`,children:(0,M.jsx)(zy,{className:`size-6`})}),(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.successTitle`)}),(0,M.jsx)(NN,{children:e(`auth.verifyEmail.successDescription`)})]}),(0,M.jsx)(PN,{className:`text-center`,children:(0,M.jsx)(ra,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.verifyEmail.signInLink`)})})]}),r===`error`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-2 flex size-12 items-center justify-center rounded-full bg-destructive/10 text-destructive ring-1 ring-destructive/30`,children:(0,M.jsx)(Vy,{className:`size-6`})}),(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.errorTitle`)}),(0,M.jsx)(NN,{children:a||e(`auth.verifyEmail.errorDescription`)})]}),(0,M.jsx)(PN,{className:`text-center`,children:(0,M.jsx)(ra,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.verifyEmail.backToSignIn`)})})]})]})})}var UN=`Label`,WN=j.forwardRef((e,t)=>(0,M.jsx)(z_.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));WN.displayName=UN;var GN=WN,KN=xy(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),$=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(GN,{ref:n,className:X(KN(),e),...t}));$.displayName=GN.displayName;var qN=la(`/setup`)({component:YN});function JN(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function YN(){let{t:e}=vt(),t=Hi(),n=o_(),{user:r,refresh:i}=cN(),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null);return(0,j.useEffect)(()=>{let e=!1;return(async()=>{try{let{hasOwner:t}=await n.auth.bootstrapStatus();e||g(t)}catch{e||g(!1)}})(),()=>{e=!0}},[n]),(0,j.useEffect)(()=>{h===!0&&!r&&t({to:`/login`,replace:!0})},[h,r,t]),(0,j.useEffect)(()=>{r&&window.location.assign(`/`)},[r]),h===null?(0,M.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted`,children:(0,M.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-4 border-muted-foreground/20 border-t-primary`})}):(0,M.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted p-6`,children:(0,M.jsx)(`div`,{className:`flex w-full max-w-md flex-col gap-6`,children:(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{children:e(`auth.setup.welcomeTitle`)}),(0,M.jsx)(NN,{children:e(`auth.setup.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),n?.auth){m(!0);try{await n.auth.register({name:a,email:s,password:l}),await i();let e=d.trim();if(e)try{let{organizations:t}=await n.organizations.list(),r=t?.[0],i;if(r?.id)await n.organizations.update(r.id,{name:e,slug:JN(e)}),i=r.id;else{let t=await n.organizations.create({name:e,slug:JN(e)});i=t?.id??t?.data?.id}i&&await n.organizations.setActive(i).catch(()=>{})}catch(e){console.warn(`[setup] organization rename/create failed`,e)}window.location.assign(`/`)}catch(t){K({title:e(`auth.setup.failed`),description:t.message,variant:`destructive`})}finally{m(!1)}}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`name`,children:e(`auth.setup.yourName`)}),(0,M.jsx)(cS,{id:`name`,autoComplete:`name`,required:!0,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`orgName`,children:e(`auth.setup.orgName`)}),(0,M.jsx)(cS,{id:`orgName`,required:!0,placeholder:e(`auth.setup.orgNamePlaceholder`),value:d,onChange:e=>f(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(cS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:s,onChange:e=>c(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`password`,children:e(`auth.passwordLabel`)}),(0,M.jsx)(cS,{id:`password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,placeholder:e(`auth.setup.passwordHint`),value:l,onChange:e=>u(e.target.value)})]}),(0,M.jsx)(Z,{type:`submit`,className:`mt-2 w-full`,disabled:p,children:e(p?`auth.setup.submitting`:`auth.setup.submit`)})]})})]})})})}var XN=la(`/reset-password`)({validateSearch:e=>{let t=e.token;return typeof t==`string`?{token:t}:{}},component:ZN});function ZN(){let{t:e}=vt(),t=Hi(),{token:n}=XN.useSearch(),[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(!1);return(0,M.jsx)(RN,{children:(0,M.jsxs)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.resetPassword.title`)}),(0,M.jsx)(NN,{children:e(`auth.resetPassword.description`)})]}),(0,M.jsx)(PN,{children:n?(0,M.jsxs)(`form`,{onSubmit:async i=>{if(i.preventDefault(),r!==a){K({title:e(`auth.resetPassword.passwordsMismatch`),variant:`destructive`});return}if(!n){K({title:e(`auth.resetPassword.missingToken`),variant:`destructive`});return}c(!0);try{let i=await fetch(`/api/v1/auth/reset-password`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({token:n,newPassword:r})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.message||`Request failed: ${i.status}`)}K({title:e(`auth.resetPassword.success`)}),t({to:`/login`})}catch(t){K({title:e(`auth.resetPassword.failed`),description:t.message,variant:`destructive`})}finally{c(!1)}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`new-password`,children:e(`auth.resetPassword.newPassword`)}),(0,M.jsx)(cS,{id:`new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:r,onChange:e=>i(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`confirm-password`,children:e(`auth.resetPassword.confirmPassword`)}),(0,M.jsx)(cS,{id:`confirm-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsx)(Z,{type:`submit`,className:`w-full bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,disabled:s,children:e(s?`auth.resetPassword.submitting`:`auth.resetPassword.submit`)})]}):(0,M.jsxs)(`p`,{className:`text-sm text-muted-foreground text-center`,children:[e(`auth.resetPassword.invalidToken`),` `,(0,M.jsx)(ra,{to:`/forgot-password`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.resetPassword.requestNewLink`)})]})})]})})}function QN({mode:e,redirect:t}){let{t:n}=vt(),r=o_(),[i,a]=(0,j.useState)([]),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(null);if((0,j.useEffect)(()=>{r?.auth?.getConfig&&r.auth.getConfig().then(e=>{a((e?.socialProviders??e?.data?.socialProviders??[]).filter(e=>e.enabled))}).catch(e=>{console.warn(`[SocialSignInButtons] failed to load auth config`,e)}).finally(()=>s(!1))},[r]),o||i.length===0)return null;let u=n(e===`sign-in`?`auth.social.continueWith`:`auth.social.signUpWith`),d=window.location.origin+`/_account/login`+(t?`?redirect=${encodeURIComponent(t)}`:``),f=e=>{c||(l(e),Promise.resolve(r.auth.signInWithProvider(e.id,{callbackURL:d,errorCallbackURL:d,type:e.type??`social`})).catch(e=>{console.warn(`[SocialSignInButtons] signInWithProvider failed`,e),l(null)}))};return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.map(e=>{let t=c?.id===e.id;return(0,M.jsxs)(Z,{type:`button`,variant:`outline`,className:`w-full`,disabled:!!c,onClick:()=>f(e),children:[t?(0,M.jsx)(`span`,{className:`mr-2 inline-block size-4 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}):(0,M.jsx)(`span`,{className:`mr-2 flex h-4 w-4 items-center justify-center rounded-sm bg-muted text-[10px] font-bold uppercase`,children:e.id[0]}),t?n(`auth.social.redirectingTo`,{provider:e.name,defaultValue:`Redirecting to ${e.name}…`}):`${u} ${e.name}`]},e.id)}),(0,M.jsxs)(`div`,{className:`relative my-1`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,M.jsx)(`span`,{className:`w-full border-t`})}),(0,M.jsx)(`div`,{className:`relative flex justify-center text-xs uppercase`,children:(0,M.jsx)(`span`,{className:`bg-card px-2 text-muted-foreground`,children:n(`auth.social.orContinueEmail`)})})]}),c&&typeof document<`u`?(0,Gi.createPortal)((0,M.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm`,children:(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-8 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:n(`auth.social.redirectingTo`,{provider:c.name,defaultValue:`Redirecting to ${c.name}…`})})]})}),document.body):null]})}function $N(e,t){if(e.metaKey||e.ctrlKey||e.shiftKey||e.button===1)return;e.preventDefault();let n=Math.min(960,window.screen.availWidth-80),r=Math.min(720,window.screen.availHeight-80),i=Math.max(0,Math.round((window.screen.availWidth-n)/2)),a=Math.max(0,Math.round((window.screen.availHeight-r)/2)),o=[`popup=yes`,`width=${n}`,`height=${r}`,`left=${i}`,`top=${a}`,`resizable=yes`,`scrollbars=yes`,`noopener=yes`,`noreferrer=yes`].join(`,`);window.open(t,`objectstack-legal`,o)||window.open(t,`_blank`,`noopener,noreferrer`)}function eP({termsUrl:e,privacyUrl:t}){let{t:n}=vt(`account`),r=typeof e==`string`&&e.length>0,i=typeof t==`string`&&t.length>0;return!r&&!i?null:(0,M.jsxs)(`p`,{className:`px-6 text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary`,children:[n(`legal.agreementPrefix`),` `,r?(0,M.jsx)(`a`,{href:e,target:`objectstack-legal`,rel:`noreferrer noopener`,onClick:t=>$N(t,e),children:n(`legal.termsOfService`)}):null,r&&i?(0,M.jsxs)(M.Fragment,{children:[` `,n(`legal.and`),` `]}):null,i?(0,M.jsx)(`a`,{href:t,target:`objectstack-legal`,rel:`noreferrer noopener`,onClick:e=>$N(e,t),children:n(`legal.privacyPolicy`)}):null,`.`]})}var tP=la(`/register`)({validateSearch:e=>{let t=e.redirect;return typeof t==`string`?{redirect:t}:{}},component:iP});function nP(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function rP(e){return e.startsWith(`/_`)?e:`/_account/`.replace(/\/$/,``)+e}function iP(){let{t:e}=vt(),t=Hi(),{redirect:n}=tP.useSearch(),r=o_(),{session:i,user:a,loading:o,refresh:s,organizations:c,organizationsLoading:l,organizationsFetched:u,setActiveOrganization:d,features:f}=cN();(0,j.useEffect)(()=>{f?.signUpDisabled===!0&&t({to:`/login`,search:n?{redirect:n}:{},replace:!0})},[f?.signUpDisabled,t,n]);let[p,m]=(0,j.useState)(``),[h,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{if(a){if(typeof window<`u`){let e=new URLSearchParams(window.location.search);if(e.has(`client_id`)&&e.has(`redirect_uri`)){window.location.assign(`/api/v1/auth/oauth2/authorize${window.location.search}`);return}}if(!i?.activeOrganizationId){if(!u||l||x)return;if(c.length===1){S(!0),d(c[0].id).catch(()=>void 0).finally(()=>S(!1));return}if(!f)return;if(c.length>1){t({to:`/organizations`});return}if(f.multiOrgEnabled===!1){nP(n)?window.location.assign(rP(n)):window.location.assign(`/`);return}t({to:`/organizations/new`,search:n?{redirect:n}:{}});return}if(!x){if(nP(n)){window.location.assign(rP(n));return}window.location.assign(`/`)}}},[a,i,t,n,c,l,u,x,d,f]),(0,M.jsx)(RN,{children:o||a?(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:a?e(`auth.register.signingIn`,{defaultValue:`Setting up your account…`}):e(`auth.login.redirecting`,{defaultValue:`Loading…`})})]}):(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.register.title`)}),(0,M.jsx)(NN,{children:e(`auth.register.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsx)(`form`,{onSubmit:async i=>{if(i.preventDefault(),r?.auth){b(!0);try{let i=await r.auth.register({name:p,email:h,password:_}),a=i?.data??i;if(a&&a.token===null&&a.user){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}try{await s()}catch(e){let r=e.message;if(r.includes(`email`)&&(r.toLowerCase().includes(`verif`)||r.toLowerCase().includes(`not verified`))){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}throw e}K({title:e(`auth.register.successToast`)})}catch(r){let i=r.message;if(i.includes(`email`)&&(i.toLowerCase().includes(`verif`)||i.toLowerCase().includes(`sent`))){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}K({title:e(`auth.register.failed`),description:i,variant:`destructive`})}finally{b(!1)}}},children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsx)(QN,{mode:`sign-up`,redirect:n}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`name`,children:e(`auth.nameLabel`)}),(0,M.jsx)(cS,{id:`name`,autoComplete:`name`,required:!0,value:p,onChange:e=>m(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(cS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:h,onChange:e=>g(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`password`,children:e(`auth.passwordLabel`)}),(0,M.jsx)(cS,{id:`password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:_,onChange:e=>v(e.target.value)})]}),(0,M.jsx)(Z,{type:`submit`,className:`w-full`,disabled:y,children:e(y?`auth.register.submitting`:`auth.register.submit`)}),(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.register.haveAccount`),` `,(0,M.jsx)(ra,{to:`/login`,search:n?{redirect:n}:void 0,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.register.signIn`)})]})]})})})]}),(0,M.jsx)(eP,{termsUrl:f?.termsUrl,privacyUrl:f?.privacyUrl})]})})}var aP=la(`/login`)({validateSearch:e=>{let t=e.redirect;return typeof t==`string`?{redirect:t}:{}},component:cP});function oP(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function sP(e){return e.startsWith(`/_`)?e:`/_account/`.replace(/\/$/,``)+e}function cP(){let{t:e}=vt(),t=Hi(),{redirect:n}=aP.useSearch(),r=o_(),i=null;if(typeof window<`u`){let e=new URLSearchParams(window.location.search),t=e.get(`redirect_uri`);if(e.has(`client_id`)&&t)try{i=new URL(t).host}catch{i=null}}let{session:a,user:o,loading:s,refresh:c,organizations:l,organizationsLoading:u,organizationsFetched:d,setActiveOrganization:f,features:p}=cN(),m=p?.signUpDisabled===!0,[h,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{if(o){if(typeof window<`u`){let e=new URLSearchParams(window.location.search);if(e.has(`client_id`)&&e.has(`redirect_uri`)){window.location.assign(`/api/v1/auth/oauth2/authorize${window.location.search}`);return}}if(!a?.activeOrganizationId){if(!d||u||x)return;if(l.length===1){S(!0),f(l[0].id).catch(()=>void 0).finally(()=>S(!1));return}if(!p)return;if(l.length===0){if(p.multiOrgEnabled===!1){oP(n)?window.location.assign(sP(n)):window.location.assign(`/`);return}t({to:`/organizations/new`});return}if(p.multiOrgEnabled===!1){S(!0),f(l[0].id).catch(()=>void 0).finally(()=>S(!1));return}t({to:`/organizations`});return}if(!x){if(oP(n)){window.location.assign(sP(n));return}window.location.assign(`/`)}}},[o,a,t,n,l,u,d,x,f,p]),s||o?(0,M.jsx)(RN,{children:(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,M.jsx)(`span`,{children:e(`auth.login.signingIn`,{defaultValue:`Signing you in…`})})]})}):(0,M.jsxs)(RN,{children:[y?(0,M.jsx)(pN,{message:e(`auth.login.signingIn`,{defaultValue:`Signing you in…`})}):null,(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i?(0,M.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-md border border-primary/30 bg-primary/5 px-4 py-3 text-sm text-foreground`,children:[(0,M.jsx)(`span`,{className:`mt-0.5 inline-block size-2 shrink-0 rounded-full bg-primary`}),(0,M.jsx)(`span`,{children:e(`auth.login.ssoHandoff`,{target:i,defaultValue:`Continue to ${i}`})})]}):null,(0,M.jsxs)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.login.title`)}),(0,M.jsx)(NN,{children:e(`auth.login.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsx)(`form`,{onSubmit:async i=>{if(i.preventDefault(),r?.auth){b(!0);try{await r.auth.login({type:`email`,email:h,password:_}),await c(),K({title:e(`auth.login.welcomeToast`)})}catch(r){let i=r.message,a=r.code,o=(i||``).toLowerCase();if(a===`EMAIL_NOT_VERIFIED`||o.includes(`email`)&&(o.includes(`verif`)||o.includes(`not verified`))){t({to:`/verify-email-prompt`,search:{email:h,redirect:n}});return}K({title:e(`auth.login.failed`),description:i,variant:`destructive`})}finally{b(!1)}}},children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsx)(QN,{mode:`sign-in`,redirect:n}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(cS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:h,onChange:e=>g(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center`,children:[(0,M.jsx)($,{htmlFor:`password`,children:e(`auth.passwordLabel`)}),(0,M.jsx)(ra,{to:`/forgot-password`,className:`ml-auto text-sm underline-offset-4 hover:underline`,children:e(`auth.login.forgotPassword`)})]}),(0,M.jsx)(cS,{id:`password`,type:`password`,autoComplete:`current-password`,required:!0,value:_,onChange:e=>v(e.target.value)})]}),(0,M.jsx)(Z,{type:`submit`,className:`w-full`,disabled:y,children:e(y?`auth.login.submitting`:`auth.login.submit`)}),m?null:(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.login.noAccount`),` `,(0,M.jsx)(ra,{to:`/register`,search:n?{redirect:n}:void 0,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.login.signUp`)})]})]})})})]}),(0,M.jsx)(eP,{termsUrl:p?.termsUrl,privacyUrl:p?.privacyUrl})]})]})}var lP=la(`/forgot-password`)({component:uP});function uP(){let{t:e}=vt(),[t,n]=(0,j.useState)(``),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(!1);return(0,M.jsx)(RN,{children:(0,M.jsx)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:a?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.forgotPassword.checkEmailTitle`)}),(0,M.jsx)(NN,{children:e(`auth.forgotPassword.checkEmailDescription`,{email:t})})]}),(0,M.jsx)(PN,{className:`text-center`,children:(0,M.jsx)(ra,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.forgotPassword.backToSignIn`)})})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`auth.forgotPassword.title`)}),(0,M.jsx)(NN,{children:e(`auth.forgotPassword.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),i(!0);try{let e=window.location.origin+`/_account/`.replace(/\/$/,``)+`/reset-password`,n=await fetch(`/api/v1/auth/request-password-reset`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({email:t,redirectTo:e})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e?.message||`Request failed: ${n.status}`)}o(!0)}catch(t){K({title:e(`auth.forgotPassword.failed`),description:t.message,variant:`destructive`})}finally{i(!1)}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`email`,children:e(`auth.emailLabel`)}),(0,M.jsx)(cS,{id:`email`,type:`email`,placeholder:e(`auth.emailPlaceholder`),autoComplete:`email`,required:!0,value:t,onChange:e=>n(e.target.value)})]}),(0,M.jsx)(Z,{type:`submit`,className:`w-full bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,disabled:r,children:e(r?`auth.forgotPassword.submitting`:`auth.forgotPassword.submit`)}),(0,M.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.forgotPassword.rememberPassword`),` `,(0,M.jsx)(ra,{to:`/login`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.forgotPassword.signIn`)})]})]})})]})})})}var dP=la(`/account`)({component:fP});function fP(){return(0,M.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex-1 overflow-auto px-4 py-6 sm:px-6 sm:py-8`,children:(0,M.jsx)(`div`,{className:`page-enter mx-auto flex max-w-4xl flex-col gap-6`,children:(0,M.jsx)(ya,{})})})})}var pP=la(`/`)({component:mP});function mP(){return(0,M.jsx)(Ui,{to:`/login`})}var hP=xy(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function gP({className:e,variant:t,...n}){return(0,M.jsx)(`div`,{className:X(hP({variant:t}),e),...n})}function _P({title:e,description:t,icon:n,actions:r,className:i,...a}){return(0,M.jsxs)(`div`,{className:X(`relative overflow-hidden rounded-xl border bg-brand-gradient-subtle`,`px-5 py-5 sm:px-6 sm:py-6`,i),...a,children:[(0,M.jsx)(`div`,{className:`pointer-events-none absolute inset-0 opacity-60`,style:{backgroundImage:`radial-gradient(ellipse 60% 80% at 0% 0%, hsl(var(--brand-from) / 0.12), transparent 60%)`},"aria-hidden":!0}),(0,M.jsxs)(`div`,{className:`relative flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between sm:gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-start gap-4`,children:[n?(0,M.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30 ring-1 ring-white/15`,children:(0,M.jsx)(n,{className:`size-5`})}):null,(0,M.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,M.jsx)(`h1`,{className:`truncate text-xl font-semibold tracking-tight sm:text-2xl`,children:e}),t?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t}):null]})]}),r?(0,M.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:r}):null]})]})}var vP=la(`/organizations/`)({component:yP});function yP(){let{t:e}=vt(),{organizations:t,loading:n}=lN(),{session:r,setActiveOrganization:i,features:a}=cN(),o=Hi(),s=r?.activeOrganizationId??void 0,c=a?.multiOrgEnabled!==!1,l=async t=>{try{t!==s&&await i(t),o({to:`/organizations/$orgId`,params:{orgId:t}})}catch(t){K({title:e(`organizations.switchFailed`),description:t.message,variant:`destructive`})}},u=e=>e.split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return(0,M.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex-1 overflow-auto px-4 py-6 sm:px-6 sm:py-8`,children:(0,M.jsxs)(`div`,{className:`page-enter mx-auto flex max-w-3xl flex-col gap-6`,children:[(0,M.jsx)(_P,{icon:Ny,title:e(`organizations.title`),description:e(`organizations.description`),actions:c?(0,M.jsxs)(Z,{onClick:()=>o({to:`/organizations/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:[(0,M.jsx)(ob,{className:`mr-2 h-4 w-4`}),e(`organizations.newOrganization`)]}):null}),n&&(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`organizations.loading`)}),!n&&t.length===0&&(0,M.jsxs)(Q,{className:`p-10 text-center`,children:[(0,M.jsx)(`div`,{className:`mx-auto mb-3 flex size-12 items-center justify-center rounded-lg bg-brand-gradient-subtle text-primary ring-1 ring-primary/15`,children:(0,M.jsx)(Ny,{className:`h-6 w-6`})}),(0,M.jsx)(`h3`,{className:`text-base font-medium`,children:e(`organizations.emptyTitle`)}),(0,M.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:e(`organizations.emptyDescription`)}),c&&(0,M.jsxs)(Z,{onClick:()=>o({to:`/organizations/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20`,children:[(0,M.jsx)(ob,{className:`mr-2 h-4 w-4`}),e(`organizations.createOrganization`)]})]}),(0,M.jsx)(`div`,{className:`grid gap-3`,children:t.map(t=>{let n=t.id===s;return(0,M.jsx)(Q,{role:`button`,tabIndex:0,onClick:()=>l(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l(t.id))},className:`group cursor-pointer p-4 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5 focus:outline-none focus:ring-2 focus:ring-ring ${n?`border-primary/50 bg-brand-gradient-subtle ring-1 ring-primary/30`:``}`,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,M.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg font-semibold `+(n?`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30 ring-1 ring-white/15`:`bg-muted text-muted-foreground group-hover:bg-brand-gradient-subtle group-hover:text-primary`),children:u(t.name)||(0,M.jsx)(Ny,{className:`h-5 w-5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`h3`,{className:`truncate text-base font-medium`,children:t.name}),n&&(0,M.jsxs)(gP,{className:`gap-1 border-transparent bg-emerald-500/15 text-[10px] font-medium text-emerald-600 dark:text-emerald-400`,children:[(0,M.jsx)(Py,{className:`h-3 w-3`}),e(`organizations.active`)]})]}),t.slug&&(0,M.jsx)(`code`,{className:`mt-0.5 block font-mono text-xs text-muted-foreground`,children:t.slug})]}),(0,M.jsx)(Iy,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-primary`})]})},t.id)})})]})})})}var bP=la(`/account/`)({component:xP});function xP(){let{t:e}=vt(),{user:t}=cN(),{organizations:n}=lN(),r=[!!t?.emailVerified,!!t?.twoFactorEnabled,!!t?.name,!!t?.image].filter(Boolean).length*25,i=r>=75?`success`:r>=50?`warn`:`danger`,a=(t?.name??t?.email??`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase(),o=[{to:`/account/profile`,label:e(`home.tiles.profile.title`,{defaultValue:`Profile`}),description:e(`home.tiles.profile.description`,{defaultValue:`Display name, avatar and contact info.`}),icon:xb},{to:`/account/security`,label:e(`home.tiles.security.title`,{defaultValue:`Security`}),description:e(`home.tiles.security.description`,{defaultValue:`Change your password and review activity.`}),icon:db},{to:`/account/two-factor`,label:e(`home.tiles.twoFactor.title`,{defaultValue:`Two-factor auth`}),description:e(`home.tiles.twoFactor.description`,{defaultValue:`Add an authenticator app for stronger sign-in.`}),icon:ub},{to:`/account/sessions`,label:e(`home.tiles.sessions.title`,{defaultValue:`Active sessions`}),description:e(`home.tiles.sessions.description`,{defaultValue:`See and revoke devices that are signed in.`}),icon:rb},{to:`/account/linked-accounts`,label:e(`home.tiles.linked.title`,{defaultValue:`Linked accounts`}),description:e(`home.tiles.linked.description`,{defaultValue:`Manage your social and SSO providers.`}),icon:$y},{to:`/account/oauth-applications`,label:e(`home.tiles.oauth.title`,{defaultValue:`OAuth applications`}),description:e(`home.tiles.oauth.description`,{defaultValue:`Apps you have authorised to access your account.`}),icon:Xy}];return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 bg-brand-gradient`,"aria-hidden":!0}),(0,M.jsx)(`div`,{className:`absolute inset-0 opacity-40 mix-blend-soft-light`,style:{backgroundImage:`radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.4), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(0,0,0,0.25), transparent 60%)`},"aria-hidden":!0}),(0,M.jsxs)(`div`,{className:`relative flex flex-col gap-4 p-6 text-white sm:flex-row sm:items-center sm:gap-6 sm:p-8`,children:[(0,M.jsxs)($M,{className:`size-16 shrink-0 ring-4 ring-white/30 shadow-md sm:size-20`,children:[t?.image?(0,M.jsx)(eN,{src:t.image,alt:t?.name??``}):null,(0,M.jsx)(tN,{className:`bg-white/20 text-base font-semibold text-white backdrop-blur`,children:a})]}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-xs uppercase tracking-wider text-white/70`,children:e(`home.welcome`,{defaultValue:`Welcome back`})}),(0,M.jsx)(`h2`,{className:`truncate text-2xl font-semibold tracking-tight`,children:t?.name||t?.email||`ObjectStack user`}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm text-white/80`,children:[(0,M.jsx)(nb,{className:`size-3.5`,"aria-hidden":!0}),(0,M.jsx)(`span`,{className:`truncate`,children:t?.email}),t?.emailVerified?(0,M.jsx)(gP,{className:`border-white/30 bg-white/15 text-[10px] font-medium text-white backdrop-blur hover:bg-white/20`,children:e(`home.verified`,{defaultValue:`Verified`})}):null]})]})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-3`,children:[(0,M.jsx)(SP,{icon:ub,label:e(`home.stats.score`,{defaultValue:`Security score`}),value:`${r}%`,tone:i,extra:(0,M.jsx)(`div`,{className:`mt-2 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,M.jsx)(`div`,{className:`h-full bg-brand-gradient transition-[width] duration-500`,style:{width:`${r}%`}})})}),(0,M.jsx)(SP,{icon:Ny,label:e(`home.stats.orgs`,{defaultValue:`Organizations`}),value:String(n.length),extra:(0,M.jsxs)(ra,{to:`/organizations`,className:`mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline`,children:[e(`home.stats.manage`,{defaultValue:`Manage`}),(0,M.jsx)(My,{className:`size-3`})]})}),(0,M.jsx)(SP,{icon:t?.twoFactorEnabled?ub:db,label:e(`home.stats.twoFactor`,{defaultValue:`Two-factor auth`}),value:t?.twoFactorEnabled?e(`home.stats.enabled`,{defaultValue:`Enabled`}):e(`home.stats.disabled`,{defaultValue:`Disabled`}),tone:t?.twoFactorEnabled?`success`:`warn`,extra:(0,M.jsxs)(ra,{to:`/account/two-factor`,className:`mt-2 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline`,children:[t?.twoFactorEnabled?e(`home.stats.review`,{defaultValue:`Review`}):e(`home.stats.enable`,{defaultValue:`Enable now`}),(0,M.jsx)(My,{className:`size-3`})]})})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`mb-3 text-sm font-medium text-muted-foreground`,children:e(`home.quickAccess`,{defaultValue:`Quick access`})}),(0,M.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:o.map(({to:e,label:t,description:n,icon:r})=>(0,M.jsxs)(ra,{to:e,className:`group relative flex items-start gap-3 rounded-lg border bg-card p-4 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5`,children:[(0,M.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-brand-gradient-subtle text-primary ring-1 ring-primary/10 transition-transform group-hover:scale-110`,children:(0,M.jsx)(r,{className:`size-4`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,M.jsx)(`span`,{className:`truncate font-medium`,children:t}),(0,M.jsx)(My,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-primary`})]}),(0,M.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:n})]})]},e))})]})]})}function SP({icon:e,label:t,value:n,tone:r=`neutral`,extra:i}){let a=r===`success`?`text-emerald-600 dark:text-emerald-400`:r===`warn`?`text-amber-600 dark:text-amber-400`:r===`danger`?`text-destructive`:`text-foreground`;return(0,M.jsx)(Q,{className:`overflow-hidden`,children:(0,M.jsxs)(PN,{className:`p-5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:t}),(0,M.jsx)(e,{className:`size-4 ${a}`})]}),(0,M.jsx)(`p`,{className:`mt-1 text-2xl font-semibold tracking-tight ${a}`,children:n}),i]})})}var CP=la(`/organizations/new`)({validateSearch:e=>{let t=e.redirect;return typeof t==`string`?{redirect:t}:{}},component:DP});function wP(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48)}function TP(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function EP(e){return e.startsWith(`/_`)?e:`/_account/`.replace(/\/$/,``)+e}function DP(){let{t:e}=vt(),t=Hi(),{redirect:n}=CP.useSearch(),{create:r,creating:i}=uN(),{setActiveOrganization:a,reloadOrganizations:o,features:s}=cN(),[c,l]=(0,j.useState)(``),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(!1);(0,j.useEffect)(()=>{s&&s.multiOrgEnabled===!1&&t({to:`/organizations`})},[s,t]);let m=e=>{l(e),f||d(wP(e))};return(0,M.jsx)(RN,{formWidth:`md`,children:(0,M.jsxs)(Q,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl tracking-tight`,children:e(`organizations.new.title`)}),(0,M.jsx)(NN,{children:e(`organizations.new.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();try{let t=await r({name:c,slug:u||void 0}),i=t?.data??t,s=i?.id??i?.organization?.id;s&&await a(s).catch(()=>{}),await o().catch(()=>{}),K({title:e(`organizations.new.successToast`)}),TP(n)?window.location.assign(EP(n)):window.location.assign(`/`)}catch(t){K({title:e(`organizations.new.failed`),description:t.message,variant:`destructive`})}},className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`name`,children:e(`organizations.new.name`)}),(0,M.jsx)(cS,{id:`name`,required:!0,autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:e(`organizations.new.namePlaceholder`)})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)($,{htmlFor:`slug`,children:e(`organizations.new.slug`)}),(0,M.jsx)(cS,{id:`slug`,value:u,onChange:e=>{d(e.target.value),p(!0)},placeholder:e(`organizations.new.slugPlaceholder`),pattern:`[a-z0-9-]+`}),(0,M.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e(`organizations.new.slugHint`)})]}),(0,M.jsx)(Z,{type:`submit`,className:`w-full`,disabled:i||!c,children:e(i?`organizations.new.submitting`:`organizations.new.submit`)}),(0,M.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:(0,M.jsx)(ra,{to:`/organizations`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`organizations.new.cancel`)})})]})})]})})}var OP=la(`/organizations/$orgId`)({component:kP});function kP(){let{t:e}=vt(),{orgId:t}=OP.useParams(),{organizations:n}=lN(),r=n.find(e=>e.id===t);return(0,M.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex-1 overflow-auto px-6 py-8`,children:(0,M.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-6`,children:[(0,M.jsxs)(`header`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:r?.name??e(`organizations.title`)}),r?.slug&&(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground font-mono`,children:r.slug})]}),(0,M.jsx)(ya,{})]})})})}function AP(){let e=o_(),[t,n]=(0,j.useState)([]),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null),s=(0,j.useCallback)(async()=>{if(e?.oauth?.applications){i(!0),o(null);try{n((await e.oauth.applications.list())?.applications??[])}catch(e){o(e),n([])}finally{i(!1)}}},[e]);return(0,j.useEffect)(()=>{s()},[s]),{applications:t,loading:r,error:a,reload:s}}function jP(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null),[a,o]=(0,j.useState)(null);return{register:(0,j.useCallback)(async t=>{if(!e?.oauth?.applications?.register)throw Error(`Client not ready`);n(!0),i(null);try{let n=await e.oauth.applications.register(t);return o(n),n}catch(e){throw i(e),e}finally{n(!1)}},[e]),registering:t,error:r,lastResult:a}}function MP(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null);return{remove:(0,j.useCallback)(async t=>{if(!e?.oauth?.applications?.delete)throw Error(`Client not ready`);n(!0),i(null);try{return await e.oauth.applications.delete(t)}catch(e){throw i(e),e}finally{n(!1)}},[e]),deleting:t,error:r}}function NP(){let e=o_(),[t,n]=(0,j.useState)(!1),[r,i]=(0,j.useState)(null);return{submit:(0,j.useCallback)(async t=>{if(!e?.oauth?.consent)throw Error(`Client not ready`);n(!0),i(null);try{return await e.oauth.consent(t)}catch(e){throw i(e),e}finally{n(!1)}},[e]),submitting:t,error:r}}var PP=la(`/oauth/consent`)({validateSearch:e=>e,component:FP});function FP(){let{t:e}=vt(),t=Hi(),n=o_(),{user:r,loading:i}=cN(),{submit:a,submitting:o}=NP(),[s,c]=(0,j.useState)(null),l=typeof window<`u`?window.location.search:``,u=l.startsWith(`?`)?l.slice(1):l,d=new URLSearchParams(u),f=d.get(`client_id`)??void 0,p=d.get(`scope`)??``;(0,j.useEffect)(()=>{i||r||t({to:`/login`,search:{redirect:window.location.pathname+window.location.search}})},[r,i,t]),(0,j.useEffect)(()=>{if(!f||!n?.oauth?.applications?.getPublic)return;let e=!1;return n.oauth.applications.getPublic(f).then(t=>{if(e)return;let n=t?.data??t;c({name:n?.name??n?.client_name,icon:n?.icon??n?.logo_uri})},()=>{}),()=>{e=!0}},[n,f]);let m=p.split(/\s+/).filter(Boolean),h=async t=>{try{let n=await a({accept:t,oauth_query:u}),r=n?.redirect_uri??n?.redirectURI??n?.url;if(r){window.location.href=r;return}K({title:e(t?`oauth.consent.granted`:`oauth.consent.denied`),description:e(`oauth.consent.noRedirect`),variant:t?void 0:`destructive`})}catch(t){K({title:e(`oauth.consent.failed`),description:t.message,variant:`destructive`})}},g=s?.name??f??e(`oauth.consent.unknownApp`);return(0,M.jsx)(`div`,{className:`flex min-h-svh w-full flex-1 items-center justify-center bg-background px-4`,children:(0,M.jsxs)(Q,{className:`w-full max-w-md`,children:[(0,M.jsxs)(jN,{className:`items-center text-center`,children:[(0,M.jsx)(`div`,{className:`mb-3 rounded-full border bg-muted p-3`,children:s?.icon?(0,M.jsx)(`img`,{src:s.icon,alt:``,className:`h-8 w-8 rounded`,onError:e=>e.currentTarget.style.display=`none`}):(0,M.jsx)(Xy,{className:`h-7 w-7 text-muted-foreground`})}),(0,M.jsx)(MN,{className:`text-xl`,children:e(`oauth.consent.title`,{appName:g})}),(0,M.jsx)(NN,{children:e(`oauth.consent.request`,{appName:g,suffix:r?.email?` (${r.email})`:``})})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[m.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`mb-2 text-sm font-medium`,children:e(`oauth.consent.willAllow`)}),(0,M.jsx)(`ul`,{className:`space-y-1.5 rounded-md border bg-muted/40 p-3 text-sm`,children:m.map(t=>(0,M.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(Py,{className:`mt-0.5 h-4 w-4 text-green-600 dark:text-green-400`}),(0,M.jsx)(`span`,{children:IP(t,e)})]},t))})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pt-2`,children:[(0,M.jsxs)(Z,{variant:`outline`,onClick:()=>h(!1),disabled:o,children:[(0,M.jsx)(Cb,{className:`mr-2 h-4 w-4`}),e(`oauth.consent.deny`)]}),(0,M.jsxs)(Z,{onClick:()=>h(!0),disabled:o,children:[(0,M.jsx)(Py,{className:`mr-2 h-4 w-4`}),e(o?`oauth.consent.submitting`:`oauth.consent.authorize`)]})]}),(0,M.jsx)(`p`,{className:`pt-2 text-center text-xs text-muted-foreground`,children:e(`oauth.consent.footer`)})]})]})})}function IP(e,t){switch(e){case`openid`:return t(`oauth.consent.scope.openid`);case`profile`:return t(`oauth.consent.scope.profile`);case`email`:return t(`oauth.consent.scope.email`);case`offline_access`:return t(`oauth.consent.scope.offlineAccess`);default:return e}}var LP=la(`/auth/device`)({validateSearch:e=>({user_code:e.user_code??e.code??``}),component:zP});function RP({children:e}){return(0,M.jsx)(`div`,{className:`flex min-h-svh w-full flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10`,children:(0,M.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-6`,children:[(0,M.jsxs)(`a`,{href:`#`,className:`flex items-center gap-2 self-center font-medium`,children:[(0,M.jsx)(`div`,{className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground`,children:(0,M.jsx)(Ky,{className:`size-4`})}),`ObjectStack`]}),(0,M.jsx)(`div`,{className:`flex flex-col gap-6`,children:e})]})})}function zP(){let{t:e}=vt(),{user_code:t}=LP.useSearch(),{user:n,loading:r}=cN(),i=Hi(),[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(!1),[d,f]=(0,j.useState)(!1),[p,m]=(0,j.useState)(``);return t?r?(0,M.jsx)(RP,{children:(0,M.jsx)(Q,{children:(0,M.jsx)(jN,{className:`text-center`,children:(0,M.jsx)(NN,{children:e(`auth.device.loading`)})})})}):n?l?(0,M.jsx)(RP,{children:(0,M.jsx)(Q,{children:(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(zy,{className:`h-10 w-10 text-green-500 mx-auto mb-2`}),(0,M.jsx)(MN,{children:e(`auth.device.approvedTitle`)}),(0,M.jsx)(NN,{children:e(`auth.device.approvedDescription`)})]})})}):d?(0,M.jsx)(RP,{children:(0,M.jsx)(Q,{children:(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{children:e(`auth.device.deniedTitle`)}),(0,M.jsx)(NN,{children:e(`auth.device.deniedDescription`)})]})})}):(0,M.jsx)(RP,{children:(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{children:e(`auth.device.title`)}),(0,M.jsx)(NN,{children:e(`auth.device.subtitle`,{email:n.email})})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`rounded-md border bg-background px-4 py-3 text-center`,children:[(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:e(`auth.device.userCodeLabel`)}),(0,M.jsx)(`p`,{className:`font-mono font-semibold tracking-widest text-lg`,children:t})]}),(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(`p`,{className:`text-sm text-center text-muted-foreground`,children:e(`auth.device.loggedInAs`,{email:n.email})}),p&&(0,M.jsx)(`p`,{className:`text-sm text-destructive text-center`,children:p}),(0,M.jsx)(Z,{onClick:async()=>{m(``),o(!0);try{let n=await fetch(`/api/v1/auth/device/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({userCode:t})});if(!n.ok){let t=await n.json().catch(()=>({}));throw Error(t?.message??t?.error?.message??e(`auth.device.approveFailed`))}u(!0),K({title:e(`auth.device.approveSuccess`),description:e(`auth.device.approveSuccessDescription`)})}catch(t){m(t?.message??e(`auth.device.approveFailed`))}finally{o(!1)}},className:`w-full`,disabled:a||s,children:e(a?`auth.device.approving`:`auth.device.approve`)}),(0,M.jsx)(Z,{onClick:async()=>{m(``),c(!0);try{await fetch(`/api/v1/auth/device/deny`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({userCode:t})}),f(!0)}catch(t){m(t?.message??e(`auth.device.denyFailed`))}finally{c(!1)}},variant:`outline`,className:`w-full`,disabled:a||s,children:e(s?`auth.device.denying`:`auth.device.deny`)}),(0,M.jsx)(`div`,{className:`text-center`,children:(0,M.jsx)(`button`,{type:`button`,className:`text-sm text-muted-foreground underline-offset-4 hover:underline`,onClick:()=>i({to:`/`}),children:e(`auth.device.cancel`)})})]})]})]})}):(0,M.jsx)(Ui,{to:`/login`,search:{redirect:`/auth/device?user_code=${encodeURIComponent(t)}`}}):(0,M.jsx)(RP,{children:(0,M.jsx)(Q,{children:(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{children:e(`auth.device.invalidTitle`)}),(0,M.jsx)(NN,{children:e(`auth.device.invalidDescription`)})]})})})}var BP=la(`/account/two-factor`)({component:VP});function VP(){let{t:e}=vt(),t=o_(),{user:n,loading:r,refresh:i}=cN(),[a,o]=(0,j.useState)(null),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(!1),[d,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(null),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(``),[C,w]=(0,j.useState)(!1),[T,E]=(0,j.useState)(``),[D,O]=(0,j.useState)(!1),[ee,te]=(0,j.useState)(null);(0,j.useEffect)(()=>{r||o(!!n?.twoFactorEnabled)},[r,n?.twoFactorEnabled]);let ne=async n=>{n.preventDefault(),u(!0);try{let e=await t.auth.twoFactor.enable({password:s});f(e?.totpURI??null),m(e?.backupCodes??null),c(``)}catch(t){K({title:e(`twoFactor.enableFailed`),description:t.message,variant:`destructive`})}finally{u(!1)}},re=async n=>{n.preventDefault(),b(!0);try{await t.auth.twoFactor.verifyTotp({code:_,trustDevice:h}),K({title:e(`twoFactor.enableSuccess`)}),o(!0),f(null),v(``),await i()}catch(t){K({title:e(`twoFactor.invalidCode`),description:t.message,variant:`destructive`})}finally{b(!1)}},ie=async n=>{n.preventDefault(),w(!0);try{await t.auth.twoFactor.disable({password:x}),K({title:e(`twoFactor.disableSuccess`)}),o(!1),S(``),te(null),await i()}catch(t){K({title:e(`twoFactor.disableFailed`),description:t.message,variant:`destructive`})}finally{w(!1)}},ae=async n=>{n.preventDefault(),O(!0);try{te((await t.auth.twoFactor.generateBackupCodes({password:T}))?.backupCodes??[]),E(``),K({title:e(`twoFactor.backupCodes.regenerated`)})}catch(t){K({title:e(`twoFactor.backupCodes.regenerateFailed`),description:t.message,variant:`destructive`})}finally{O(!1)}},oe=async t=>{try{await navigator.clipboard.writeText(t.join(`
|
|
154
|
+
`)),K({title:e(`twoFactor.backupCodes.copied`)})}catch{K({title:e(`twoFactor.backupCodes.copyFailed`),variant:`destructive`})}},k=(0,M.jsx)(_P,{icon:ub,title:e(`twoFactor.title`),description:e(`twoFactor.notEnabledDescription`),actions:a===!0?(0,M.jsx)(gP,{className:`border-transparent bg-emerald-500/15 font-medium text-emerald-600 dark:text-emerald-400`,children:e(`twoFactor.enabled`)}):a===!1?(0,M.jsx)(gP,{variant:`outline`,className:`font-medium`,children:e(`twoFactor.notEnabled`)}):null});if(a===null)return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)(Q,{children:[(0,M.jsx)(jN,{children:(0,M.jsx)(MN,{className:`text-base`,children:e(`twoFactor.loadingStatus`)})}),(0,M.jsxs)(PN,{className:`space-y-2`,children:[(0,M.jsx)($w,{className:`h-4 w-48`}),(0,M.jsx)($w,{className:`h-9 w-full`}),(0,M.jsx)($w,{className:`h-9 w-32`})]})]})]});if(d){let t=`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(d)}`;return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`twoFactor.setupTitle`)}),(0,M.jsx)(NN,{children:e(`twoFactor.setupDescription`)})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,M.jsx)(`img`,{src:t,alt:e(`twoFactor.qrAlt`),width:200,height:200,className:`rounded border bg-white p-2`}),(0,M.jsx)(`div`,{className:`w-full rounded bg-muted p-3 font-mono text-xs break-all`,children:d}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`twoFactor.uriHint`)})]}),p&&p.length>0&&(0,M.jsxs)(`div`,{className:`rounded border bg-muted/40 p-3`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:e(`twoFactor.backupCodes.savedTitle`)}),(0,M.jsxs)(Z,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>oe(p),children:[(0,M.jsx)(Wy,{className:`mr-1 h-3 w-3`}),e(`twoFactor.backupCodes.copy`)]})]}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`twoFactor.backupCodes.savedHint`)}),(0,M.jsx)(`div`,{className:`mt-2 grid grid-cols-2 gap-1 font-mono text-xs`,children:p.map(e=>(0,M.jsx)(`span`,{className:`rounded bg-background px-2 py-1`,children:e},e))})]}),(0,M.jsx)(hS,{}),(0,M.jsxs)(`form`,{onSubmit:re,className:`space-y-3`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`totp-code`,children:e(`twoFactor.verificationCode`)}),(0,M.jsx)(cS,{id:`totp-code`,placeholder:`000000`,maxLength:6,inputMode:`numeric`,autoComplete:`one-time-code`,value:_,onChange:e=>v(e.target.value),required:!0})]}),(0,M.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),e(`twoFactor.trustDevice`)]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsx)(Z,{type:`submit`,disabled:y||_.length<6,children:e(y?`twoFactor.verifying`:`twoFactor.verify`)}),(0,M.jsx)(Z,{type:`button`,variant:`outline`,onClick:()=>f(null),children:e(`twoFactor.cancel`)})]})]})]})]})]})}return a===!0?(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`twoFactor.enabledTitle`,{defaultValue:`Authenticator app`})}),(0,M.jsx)(NN,{children:e(`twoFactor.enabledDescription`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:ie,className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`disable-password`,children:e(`twoFactor.password`)}),(0,M.jsx)(cS,{id:`disable-password`,type:`password`,autoComplete:`current-password`,required:!0,value:x,onChange:e=>S(e.target.value)})]}),(0,M.jsx)(Z,{variant:`destructive`,type:`submit`,disabled:C,children:e(C?`twoFactor.disabling`:`twoFactor.disable`)})]})})]}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsxs)(MN,{className:`text-base flex items-center gap-2`,children:[(0,M.jsx)(Xy,{className:`h-4 w-4`}),e(`twoFactor.backupCodes.title`)]}),(0,M.jsx)(NN,{children:e(`twoFactor.backupCodes.description`)})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`form`,{onSubmit:ae,className:`space-y-3`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`backup-password`,children:e(`twoFactor.password`)}),(0,M.jsx)(cS,{id:`backup-password`,type:`password`,autoComplete:`current-password`,required:!0,value:T,onChange:e=>E(e.target.value)})]}),(0,M.jsxs)(Z,{type:`submit`,variant:`outline`,disabled:D,children:[(0,M.jsx)(sb,{className:`mr-2 h-4 w-4`}),e(D?`common.saving`:`twoFactor.backupCodes.regenerate`)]})]}),ee&&ee.length>0&&(0,M.jsxs)(`div`,{className:`rounded border bg-muted/40 p-3`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium`,children:e(`twoFactor.backupCodes.newTitle`)}),(0,M.jsxs)(Z,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>oe(ee),children:[(0,M.jsx)(Wy,{className:`mr-1 h-3 w-3`}),e(`twoFactor.backupCodes.copy`)]})]}),(0,M.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`twoFactor.backupCodes.savedHint`)}),(0,M.jsx)(`div`,{className:`mt-2 grid grid-cols-2 gap-1 font-mono text-xs`,children:ee.map(e=>(0,M.jsx)(`span`,{className:`rounded bg-background px-2 py-1`,children:e},e))})]})]})]})]}):(0,M.jsxs)(`div`,{className:`space-y-6`,children:[k,(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`twoFactor.enable`)}),(0,M.jsx)(NN,{children:e(`twoFactor.notEnabledDescription`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:ne,className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`enable-password`,children:e(`twoFactor.password`)}),(0,M.jsx)(cS,{id:`enable-password`,type:`password`,autoComplete:`current-password`,required:!0,value:s,onChange:e=>c(e.target.value),placeholder:e(`twoFactor.passwordPlaceholder`)})]}),(0,M.jsx)(Z,{type:`submit`,disabled:l,className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:e(l?`twoFactor.loading`:`twoFactor.enable`)})]})})]})]})}var HP=[[/Edg\//i,`Edge`],[/OPR\//i,`Opera`],[/Chrome\//i,`Chrome`],[/Firefox\//i,`Firefox`],[/Safari\//i,`Safari`]],UP=[[/Windows NT 10/i,`Windows 10/11`],[/Windows/i,`Windows`],[/Mac OS X|Macintosh/i,`macOS`],[/iPhone|iOS/i,`iOS`],[/iPad/i,`iPadOS`],[/Android/i,`Android`],[/Linux/i,`Linux`]];function WP(e){if(!e)return{browser:`Unknown`,os:`Unknown`,device:`desktop`,label:`Unknown device`,icon:qy};let t=HP.find(([t])=>t.test(e))?.[1]??`Browser`,n=UP.find(([t])=>t.test(e))?.[1]??`Unknown OS`,r=/iPad|Tablet/i.test(e),i=!r&&/Mobile|Android|iPhone|iPod/i.test(e),a=r?`tablet`:i?`mobile`:`desktop`,o=rb;return o=a===`mobile`?fb:a===`tablet`?mb:/Linux|Windows|Mac/i.test(e)?rb:qy,{browser:t,os:n,device:a,label:`${t} · ${n}`,icon:o}}var GP=la(`/account/sessions`)({component:KP});function KP(){let{t:e}=vt(),t=o_(),{session:n}=cN(),[r,i]=(0,j.useState)([]),[a,o]=(0,j.useState)(!0),[s,c]=(0,j.useState)(null),[l,u]=(0,j.useState)(!1),d=async()=>{try{i((await t.auth.sessions.list())?.sessions??[])}catch(t){K({title:e(`sessions.loadFailed`),description:t.message,variant:`destructive`})}finally{o(!1)}};(0,j.useEffect)(()=>{d()},[]);let f=async n=>{c(n);try{await t.auth.sessions.revoke(n),K({title:e(`sessions.revoked`)}),await d()}catch(t){K({title:e(`sessions.revokeFailed`),description:t.message,variant:`destructive`})}finally{c(null)}},p=async()=>{u(!0);try{await t.auth.sessions.revokeOthers(),K({title:e(`sessions.othersRevoked`)}),await d()}catch(t){K({title:e(`sessions.revokeOthersFailed`),description:t.message,variant:`destructive`})}finally{u(!1)}},m=n?.token,h=r.find(e=>e.token===m),g=r.filter(e=>e.token!==m);return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:rb,title:e(`sessions.title`),description:e(`sessions.description`),actions:r.length>1?(0,M.jsxs)(Z,{variant:`outline`,size:`sm`,onClick:p,disabled:l,children:[(0,M.jsx)(eb,{className:`mr-2 h-4 w-4`}),e(l?`sessions.revokingOthers`:`sessions.revokeOthers`)]}):null}),a&&(0,M.jsx)(`div`,{className:`space-y-3`,children:[0,1,2].map(e=>(0,M.jsx)(Q,{className:`overflow-hidden`,children:(0,M.jsxs)(PN,{className:`flex items-center gap-3 p-4`,children:[(0,M.jsx)($w,{className:`size-10 rounded-lg`}),(0,M.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,M.jsx)($w,{className:`h-4 w-40`}),(0,M.jsx)($w,{className:`h-3 w-64`})]})]})},e))}),!a&&r.length===0&&(0,M.jsx)(Q,{children:(0,M.jsxs)(PN,{className:`flex flex-col items-center gap-3 p-10 text-center text-sm text-muted-foreground`,children:[(0,M.jsx)(rb,{className:`size-10 text-muted-foreground/50`}),e(`sessions.empty`)]})}),!a&&h&&(0,M.jsx)(qP,{session:h,isCurrent:!0,revoking:!1,onRevoke:()=>void 0,t:e}),!a&&g.length>0&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:e(`sessions.otherDevices`,{defaultValue:`Other signed-in devices`})}),(0,M.jsx)(`div`,{className:`space-y-2`,children:g.map(t=>(0,M.jsx)(qP,{session:t,isCurrent:!1,revoking:s===t.token,onRevoke:()=>f(t.token),t:e},t.id))})]})]})}function qP({session:e,isCurrent:t,revoking:n,onRevoke:r,t:i}){let a=WP(e.userAgent),o=a.icon;return(0,M.jsx)(Q,{className:t?`border-primary/40 bg-brand-gradient-subtle shadow-sm shadow-primary/10`:`transition-colors hover:bg-accent/30`,children:(0,M.jsxs)(PN,{className:`flex items-center gap-3 p-4`,children:[(0,M.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg `+(t?`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/30`:`bg-muted text-muted-foreground`),children:(0,M.jsx)(o,{className:`size-5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`truncate text-sm font-medium`,children:a.label}),t&&(0,M.jsx)(gP,{className:`border-transparent bg-emerald-500/15 text-[10px] font-medium text-emerald-600 dark:text-emerald-400`,children:i(`sessions.current`)})]}),(0,M.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[e.ipAddress&&(0,M.jsx)(`span`,{className:`font-mono`,children:e.ipAddress}),(0,M.jsx)(`span`,{children:i(`sessions.expires`,{date:new Date(e.expiresAt).toLocaleDateString()})})]})]}),!t&&(0,M.jsxs)(Z,{variant:`ghost`,size:`sm`,onClick:r,disabled:n,className:`ml-3 shrink-0 text-muted-foreground hover:text-destructive`,children:[(0,M.jsx)(eb,{className:`mr-1.5 h-4 w-4`}),i(`sessions.revoke`,{defaultValue:`Revoke`})]})]})})}var JP=Lw,YP=Rw,XP=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(zw,{ref:n,className:X(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));XP.displayName=zw.displayName;var ZP=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(YP,{children:[(0,M.jsx)(XP,{}),(0,M.jsxs)(Bw,{ref:r,className:X(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg`,e),...n,children:[t,(0,M.jsxs)(Uw,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,M.jsx)(Cb,{className:`h-4 w-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));ZP.displayName=Bw.displayName;var QP=({className:e,...t})=>(0,M.jsx)(`div`,{className:X(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});QP.displayName=`DialogHeader`;var $P=({className:e,...t})=>(0,M.jsx)(`div`,{className:X(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});$P.displayName=`DialogFooter`;var eF=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Vw,{ref:n,className:X(`text-lg font-semibold leading-none tracking-tight`,e),...t}));eF.displayName=Vw.displayName;var tF=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Hw,{ref:n,className:X(`text-sm text-muted-foreground`,e),...t}));tF.displayName=Hw.displayName;var nF=la(`/account/security`)({component:rF});function rF(){let{t:e}=vt(),t=o_(),n=Hi(),{user:r,logout:i}=cN(),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(!0),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(!1),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(``),[C,w]=(0,j.useState)(``),[T,E]=(0,j.useState)(!1);return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:db,title:e(`security.title`),description:e(`security.description`)}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsxs)(MN,{className:`text-base flex items-center gap-2`,children:[(0,M.jsx)(db,{className:`h-4 w-4 text-primary`}),e(`security.changePasswordTitle`,{defaultValue:`Change password`})]}),(0,M.jsx)(NN,{children:e(`security.changePasswordDescription`,{defaultValue:`Use at least 8 characters. Mix letters, numbers and symbols for strength.`})})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),s!==l){K({title:e(`security.passwordsMismatch`),variant:`destructive`});return}m(!0);try{await t.auth.changePassword({currentPassword:a,newPassword:s,revokeOtherSessions:d}),K({title:e(`security.changed`)}),o(``),c(``),u(``)}catch(t){K({title:e(`security.changeFailed`),description:t.message,variant:`destructive`})}finally{m(!1)}},className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`current-password`,children:e(`security.currentPassword`)}),(0,M.jsx)(cS,{id:`current-password`,type:`password`,autoComplete:`current-password`,required:!0,value:a,onChange:e=>o(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`new-password`,children:e(`security.newPassword`)}),(0,M.jsx)(cS,{id:`new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:s,onChange:e=>c(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`confirm-new-password`,children:e(`security.confirmPassword`)}),(0,M.jsx)(cS,{id:`confirm-new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:l,onChange:e=>u(e.target.value)})]}),(0,M.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),e(`security.revokeOtherSessions`)]}),(0,M.jsx)(Z,{type:`submit`,disabled:p,children:e(p?`common.saving`:`security.submit`)})]})})]}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsxs)(MN,{className:`text-base flex items-center gap-2`,children:[(0,M.jsx)(nb,{className:`h-4 w-4 text-primary`}),e(`security.email.title`)]}),(0,M.jsx)(NN,{children:e(`security.email.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),!(!h||h===r?.email)){v(!0);try{await t.auth.changeEmail({newEmail:h,callbackURL:window.location.origin+`/login`}),K({title:e(`security.email.requested`),description:e(`security.email.checkInbox`,{email:h})}),g(``)}catch(t){K({title:e(`security.email.requestFailed`),description:t.message,variant:`destructive`})}finally{v(!1)}}},className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`current-email`,children:e(`security.email.current`)}),(0,M.jsx)(cS,{id:`current-email`,value:r?.email??``,disabled:!0})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`new-email`,children:e(`security.email.new`)}),(0,M.jsx)(cS,{id:`new-email`,type:`email`,value:h,onChange:e=>g(e.target.value),placeholder:e(`security.email.placeholder`),required:!0})]}),(0,M.jsx)(Z,{type:`submit`,disabled:_||!h||h===r?.email,children:e(_?`common.saving`:`security.email.submit`)})]})})]}),(0,M.jsxs)(Q,{className:`border-destructive/40 bg-destructive/5`,children:[(0,M.jsxs)(jN,{children:[(0,M.jsxs)(MN,{className:`text-base flex items-center gap-2 text-destructive`,children:[(0,M.jsx)(gb,{className:`h-4 w-4`}),e(`security.delete.title`)]}),(0,M.jsx)(NN,{children:e(`security.delete.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(Z,{variant:`destructive`,onClick:()=>b(!0),children:[(0,M.jsx)(hb,{className:`mr-2 h-4 w-4`}),e(`security.delete.cta`)]})})]}),(0,M.jsx)(JP,{open:y,onOpenChange:b,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`security.delete.dialogTitle`)}),(0,M.jsx)(tF,{children:e(`security.delete.dialogDescription`,{email:r?.email??``})})]}),(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`delete-password`,children:e(`security.delete.password`)}),(0,M.jsx)(cS,{id:`delete-password`,type:`password`,autoComplete:`current-password`,value:x,onChange:e=>S(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`delete-confirm`,children:e(`security.delete.typeEmail`,{email:r?.email??``})}),(0,M.jsx)(cS,{id:`delete-confirm`,value:C,onChange:e=>w(e.target.value),placeholder:r?.email??``})]})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>b(!1),disabled:T,children:e(`common.cancel`)}),(0,M.jsx)(Z,{variant:`destructive`,onClick:async()=>{if(C!==r?.email){K({title:e(`security.delete.confirmationMismatch`),description:e(`security.delete.confirmationHint`,{email:r?.email??``}),variant:`destructive`});return}E(!0);try{await t.auth.deleteUser({password:x}),K({title:e(`security.delete.success`)});try{await i()}catch{}n({to:`/login`,replace:!0})}catch(t){K({title:e(`security.delete.failed`),description:t.message,variant:`destructive`})}finally{E(!1)}},disabled:T||C!==r?.email,children:e(T?`common.saving`:`security.delete.confirm`)})]})]})})]})}var iF=la(`/account/profile`)({component:aF});function aF(){let{t:e}=vt(),t=o_(),{user:n,refresh:r}=cN(),[i,a]=(0,j.useState)(n?.name??``),[o,s]=(0,j.useState)(n?.image??null),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(!1),f=(0,j.useRef)(null);(0,j.useEffect)(()=>{a(n?.name??``),s(n?.image??null)},[n?.id,n?.name,n?.image]);let p=async n=>{n.preventDefault(),l(!0);try{await t.auth.updateUser({name:i,image:o}),await r(),K({title:e(`profile.updated`)})}catch(t){K({title:e(`profile.updateFailed`),description:t.message,variant:`destructive`})}finally{l(!1)}},m=()=>f.current?.click(),h=async n=>{let i=n.target.files?.[0];if(n.target.value=``,i){d(!0);try{if(!t?.storage?.upload)throw Error(e(`profile.avatarStorageUnavailable`));let n=await t.storage.upload(i,`user`),a=n?.data?.url??n?.url;if(!a)throw Error(`Upload returned no URL`);s(a),await t.auth.updateUser({image:a}),await r(),K({title:e(`profile.avatarUpdated`)})}catch(t){K({title:e(`profile.avatarUploadFailed`),description:t.message,variant:`destructive`})}finally{d(!1)}}},g=(n?.name??n?.email??`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card`,children:[(0,M.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-24 bg-brand-gradient`,"aria-hidden":!0}),(0,M.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-24 opacity-30`,style:{backgroundImage:`radial-gradient(ellipse at 20% 0%, rgba(255,255,255,0.4), transparent 60%)`},"aria-hidden":!0}),(0,M.jsx)(`div`,{className:`relative px-5 pb-5 pt-12 sm:px-6 sm:pb-6 sm:pt-16`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-end sm:gap-5`,children:[(0,M.jsxs)($M,{className:`size-20 shrink-0 ring-4 ring-card shadow-md`,children:[o?(0,M.jsx)(eN,{src:o,alt:n?.name??``}):null,(0,M.jsx)(tN,{className:`bg-brand-gradient text-base font-semibold text-primary-foreground`,children:g})]}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,M.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight`,children:n?.name||e(`profile.namePlaceholder`)}),(0,M.jsx)(`p`,{className:`truncate text-sm text-muted-foreground`,children:n?.email})]}),(0,M.jsxs)(Z,{type:`button`,variant:`outline`,size:`sm`,onClick:m,disabled:u,className:`self-start sm:self-auto`,children:[(0,M.jsx)(_b,{className:`mr-2 h-4 w-4`}),e(u?`profile.avatarUploading`:`profile.changeAvatar`)]}),(0,M.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,className:`hidden`,onChange:h})]})})]}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`profile.title`)}),(0,M.jsx)(NN,{children:e(`profile.description`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(`form`,{onSubmit:p,className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`profile-email`,children:e(`profile.email`)}),(0,M.jsx)(cS,{id:`profile-email`,value:n?.email??``,disabled:!0})]}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,M.jsx)($,{htmlFor:`profile-name`,children:e(`profile.name`)}),(0,M.jsx)(cS,{id:`profile-name`,value:i,onChange:e=>a(e.target.value),placeholder:e(`profile.namePlaceholder`)})]}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`profile.avatarHint`)}),(0,M.jsx)(Z,{type:`submit`,disabled:c,className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:e(c?`common.saving`:`profile.save`)})]})})]})]})}var oF=la(`/account/linked-accounts`)({component:cF}),sF={google:`Google`,github:`GitHub`,microsoft:`Microsoft`,apple:`Apple`,discord:`Discord`,gitlab:`GitLab`,twitter:`Twitter / X`,facebook:`Facebook`};function cF(){let{t:e}=vt(),t=o_(),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!0),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(async()=>{if(t?.auth?.accounts){a(!0);try{let e=await t.auth.accounts.list();r(e?.accounts??e?.data??(Array.isArray(e)?e:[]))}catch{r([])}finally{a(!1)}}},[t]);(0,j.useEffect)(()=>{c()},[c]);let l=async n=>{if(confirm(e(`linkedAccounts.unlinkConfirm`,{provider:sF[n.providerId]??n.providerId}))){s(n.id);try{await t.auth.accounts.unlink({providerId:n.providerId,accountId:n.accountId}),K({title:e(`linkedAccounts.unlinked`)}),await c()}catch(t){K({title:e(`linkedAccounts.unlinkFailed`),description:t.message,variant:`destructive`})}finally{s(null)}}},u=async n=>{try{let r=await t.auth.accounts.linkSocial({provider:n,callbackURL:window.location.href}),i=r?.url??r?.data?.url;i?window.location.assign(i):K({title:e(`linkedAccounts.linkFailed`),variant:`destructive`})}catch(t){K({title:e(`linkedAccounts.linkFailed`),description:t.message,variant:`destructive`})}},d=new Set(n.map(e=>e.providerId)),f=Object.keys(sF).filter(e=>!d.has(e));return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:$y,title:e(`linkedAccounts.title`),description:e(`linkedAccounts.description`)}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`linkedAccounts.connectedTitle`,{defaultValue:`Connected providers`})}),(0,M.jsx)(NN,{children:e(`linkedAccounts.connectedDescription`,{defaultValue:`Sign-in providers currently linked to this account.`})})]}),(0,M.jsxs)(PN,{children:[i&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)($w,{className:`h-12 w-full`}),(0,M.jsx)($w,{className:`h-12 w-full`})]}),!i&&n.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)($y,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`linkedAccounts.empty`)})]}),!i&&n.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:n.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)(gP,{variant:`secondary`,children:sF[t.providerId]??t.providerId}),t.createdAt&&(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`linkedAccounts.linkedOn`,{date:new Date(t.createdAt).toLocaleDateString()})})]}),(0,M.jsxs)(Z,{variant:`ghost`,size:`sm`,disabled:o===t.id,onClick:()=>l(t),children:[(0,M.jsx)(Qy,{className:`mr-1 h-4 w-4`}),e(`linkedAccounts.unlink`)]})]},t.id))})]})]}),f.length>0&&(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`linkedAccounts.addTitle`)}),(0,M.jsx)(NN,{children:e(`linkedAccounts.addDescription`)})]}),(0,M.jsx)(PN,{children:(0,M.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:f.map(e=>(0,M.jsxs)(Z,{variant:`outline`,size:`sm`,onClick:()=>u(e),children:[(0,M.jsx)(ob,{className:`mr-1 h-3 w-3`}),sF[e]]},e))})})]})]})}function lF(e){let t=o_(),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!1),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(async()=>{if(!(!e||!t?.organizations)){a(!0),s(null);try{let n=await t.organizations.listMembers(e);r(n?.members??n?.data?.members??(Array.isArray(n)?n:[]))}catch(e){s(e),r([])}finally{a(!1)}}},[t,e]);return(0,j.useEffect)(()=>{c()},[c]),{members:n,loading:i,error:o,reload:c,inviteMember:(0,j.useCallback)(async(n,r=`member`)=>{if(!e||!t?.organizations)throw Error(`Organization ID or client not available`);let i=await t.organizations.invite({email:n,role:r,organizationId:e});return await c(),i},[t,e,c]),removeMember:(0,j.useCallback)(async n=>{if(!e||!t?.organizations?.removeMember)throw Error(`Organization ID or client not available`);let r=await t.organizations.removeMember(e,{memberIdOrEmail:n});return await c(),r},[t,e,c]),updateMemberRole:(0,j.useCallback)(async(n,r)=>{if(!e||!t?.organizations?.updateMemberRole)throw Error(`Organization ID or client not available`);let i=await t.organizations.updateMemberRole(e,{memberId:n,role:r});return await c(),i},[t,e,c])}}function uF(e){let t=o_(),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!1),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(async()=>{if(!(!e||!t?.organizations?.invitations)){a(!0),s(null);try{let n=await t.organizations.invitations.list(e);r(n?.invitations??n?.data?.invitations??(Array.isArray(n)?n:[]))}catch(e){s(e),r([])}finally{a(!1)}}},[t,e]);return(0,j.useEffect)(()=>{c()},[c]),{invitations:n,loading:i,error:o,reload:c,cancelInvitation:(0,j.useCallback)(async e=>{if(!t?.organizations?.invitations?.cancel)throw Error(`Client not available`);let n=await t.organizations.invitations.cancel(e);return await c(),n},[t,c]),resendInvitation:(0,j.useCallback)(async e=>{if(!t?.organizations?.invitations?.resend)throw Error(`Client not available`);let n=await t.organizations.invitations.resend({id:e.id,email:e.email,role:e.role,organizationId:e.organizationId,teamId:e.teamId??null});return await c(),n},[t,c])}}function dF(){let e=o_(),[t,n]=(0,j.useState)([]),[r,i]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null),s=(0,j.useCallback)(async()=>{if(e?.organizations?.invitations?.listMine){i(!0),o(null);try{let t=await e.organizations.invitations.listMine();n(t?.invitations??t?.data?.invitations??(Array.isArray(t)?t:[]))}catch(e){o(e),n([])}finally{i(!1)}}},[e]);return(0,j.useEffect)(()=>{s()},[s]),{invitations:t,loading:r,error:a,reload:s,accept:(0,j.useCallback)(async t=>{let n=await e.organizations.invitations.accept(t);return await s(),n},[e,s]),reject:(0,j.useCallback)(async t=>{let n=await e.organizations.invitations.reject(t);return await s(),n},[e,s])}}var fF=la(`/account/invitations`)({component:pF});function pF(){let{t:e}=vt(),{invitations:t,loading:n,accept:r,reject:i}=dF(),a=t.filter(e=>e.status===`pending`),o=async t=>{try{await r(t),K({title:e(`invitations.accepted`)})}catch(t){K({title:e(`invitations.acceptFailed`),description:t.message,variant:`destructive`})}},s=async t=>{try{await i(t),K({title:e(`invitations.rejected`)})}catch(t){K({title:e(`invitations.rejectFailed`),description:t.message,variant:`destructive`})}};return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:Yy,title:e(`invitations.title`),description:e(`invitations.description`),actions:a.length>0?(0,M.jsx)(gP,{variant:`outline`,className:`font-medium`,children:e(`invitations.pendingCount`,{count:a.length,defaultValue:`{{count}} pending`})}):null}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`invitations.pendingTitle`,{defaultValue:`Pending invitations`})}),(0,M.jsx)(NN,{children:e(`invitations.pendingDescription`,{defaultValue:`Accept to join an organization, or reject to remove it from your inbox.`})})]}),(0,M.jsxs)(PN,{children:[n&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)($w,{className:`h-12 w-full`}),(0,M.jsx)($w,{className:`h-12 w-full`})]}),!n&&a.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(Yy,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`invitations.empty`)})]}),!n&&a.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:a.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`div`,{className:`text-sm font-medium`,children:t.organizationId}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,M.jsx)(gP,{variant:`outline`,className:`text-xs`,children:e(`common.roles.${t.role}`)}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`invitations.expires`,{date:new Date(t.expiresAt).toLocaleDateString()})})]})]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsxs)(Z,{size:`sm`,onClick:()=>o(t.id),children:[(0,M.jsx)(Py,{className:`mr-1 h-4 w-4`}),e(`invitations.accept`)]}),(0,M.jsxs)(Z,{size:`sm`,variant:`outline`,onClick:()=>s(t.id),children:[(0,M.jsx)(Cb,{className:`mr-1 h-4 w-4`}),e(`invitations.reject`)]})]})]},t.id))})]})]})]})}var mF=la(`/accept-invitation/$invitationId`)({component:hF});function hF(){let{t:e}=vt(),{invitationId:t}=mF.useParams(),n=Hi(),r=o_(),{user:i,loading:a,reloadOrganizations:o}=cN(),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{a||i||n({to:`/login`,search:{redirect:`/accept-invitation/${t}`},replace:!0})},[a,i,t,n]),(0,M.jsx)(`div`,{className:`flex min-h-svh w-full flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10`,children:(0,M.jsx)(`div`,{className:`flex w-full max-w-sm flex-col gap-6`,children:(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{className:`text-center`,children:[(0,M.jsx)(MN,{className:`text-xl`,children:e(`acceptInvitation.title`)}),(0,M.jsx)(NN,{children:e(`acceptInvitation.description`)})]}),(0,M.jsxs)(PN,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(Z,{className:`w-full`,onClick:async()=>{c(!0);try{await r.organizations.invitations.accept(t),await o().catch(()=>{}),K({title:e(`acceptInvitation.accepted`)}),n({to:`/organizations`})}catch(t){K({title:e(`acceptInvitation.acceptFailed`),description:t.message,variant:`destructive`})}finally{c(!1)}},disabled:s||l,children:e(s?`acceptInvitation.accepting`:`acceptInvitation.accept`)}),(0,M.jsx)(Z,{variant:`outline`,className:`w-full`,onClick:async()=>{u(!0);try{await r.organizations.invitations.reject(t),K({title:e(`acceptInvitation.declined`)}),n({to:`/organizations`})}catch(t){K({title:e(`acceptInvitation.declineFailed`),description:t.message,variant:`destructive`})}finally{u(!1)}},disabled:s||l,children:e(l?`acceptInvitation.declining`:`acceptInvitation.decline`)})]})]})})})}var gF=la(`/organizations/$orgId/`)({component:()=>{let{orgId:e}=gF.useParams();return(0,M.jsx)(Ui,{to:`/organizations/$orgId/general`,params:{orgId:e},replace:!0})}}),_F=la(`/account/oauth-applications/`)({component:vF});function vF(){let{t:e}=vt(),t=Hi(),{applications:n,loading:r,reload:i}=AP(),{remove:a,deleting:o}=MP(),[s,c]=(0,j.useState)(null);return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(_P,{icon:Xy,title:e(`oauth.applications.title`),description:e(`oauth.applications.description`),actions:(0,M.jsxs)(Z,{onClick:()=>t({to:`/account/oauth-applications/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20 transition-all hover:opacity-95 hover:shadow-md hover:shadow-primary/30`,children:[(0,M.jsx)(ob,{className:`mr-2 h-4 w-4`}),e(`oauth.applications.new`)]})}),r?(0,M.jsx)(`div`,{className:`space-y-3`,children:[0,1,2].map(e=>(0,M.jsx)(Q,{children:(0,M.jsxs)(PN,{className:`flex items-center gap-3 p-4`,children:[(0,M.jsx)($w,{className:`size-10 rounded-md`}),(0,M.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,M.jsx)($w,{className:`h-4 w-40`}),(0,M.jsx)($w,{className:`h-3 w-64`})]})]})},e))}):n.length===0?(0,M.jsx)(Q,{children:(0,M.jsxs)(PN,{className:`flex flex-col items-center gap-3 p-12 text-center`,children:[(0,M.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-lg bg-brand-gradient-subtle text-primary ring-1 ring-primary/15`,children:(0,M.jsx)(Xy,{className:`h-6 w-6`})}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`font-medium`,children:e(`oauth.applications.emptyTitle`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.emptyDescription`)})]}),(0,M.jsxs)(Z,{onClick:()=>t({to:`/account/oauth-applications/new`}),className:`bg-brand-gradient text-primary-foreground shadow-sm shadow-primary/20`,children:[(0,M.jsx)(ob,{className:`mr-2 h-4 w-4`}),e(`oauth.applications.register`)]})]})}):(0,M.jsx)(`div`,{className:`grid gap-3`,children:n.map(t=>(0,M.jsx)(Q,{className:`group transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5`,children:(0,M.jsx)(jN,{className:`pb-3`,children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsxs)(ra,{to:`/account/oauth-applications/$clientId`,params:{clientId:t.client_id},className:`flex flex-1 items-center gap-3`,children:[(0,M.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-md bg-brand-gradient-subtle text-primary ring-1 ring-primary/15 transition-transform group-hover:scale-105`,children:(0,M.jsx)(Xy,{className:`h-5 w-5`})}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(MN,{className:`text-base`,children:t.name}),(0,M.jsx)(NN,{className:`font-mono text-xs`,children:t.client_id})]}),(0,M.jsx)(gP,{variant:`outline`,className:`capitalize`,children:t.type}),t.disabled&&(0,M.jsx)(gP,{variant:`destructive`,children:e(`oauth.applications.disabled`)})]}),(0,M.jsx)(Z,{variant:`ghost`,size:`icon`,className:`text-muted-foreground hover:text-destructive`,onClick:e=>{e.preventDefault(),e.stopPropagation(),c(t)},children:(0,M.jsx)(hb,{className:`h-4 w-4`})})]})})},t.id))}),(0,M.jsx)(JP,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`oauth.applications.deleteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`oauth.applications.deleteDialogDescription`,{name:s?.name??``})})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>c(null),disabled:o,children:e(`common.cancel`)}),(0,M.jsx)(Z,{variant:`destructive`,onClick:async()=>{if(s)try{await a(s.client_id),K({title:e(`oauth.applications.deleted`)}),c(null),await i()}catch(t){K({title:e(`oauth.applications.deleteFailed`),description:t.message,variant:`destructive`})}},disabled:o,children:e(o?`oauth.applications.deleting`:`common.delete`)})]})]})})]})}function yF(e,[t,n]){return Math.min(n,Math.max(t,e))}function bF(e){let t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xF=[` `,`Enter`,`ArrowUp`,`ArrowDown`],SF=[` `,`Enter`],CF=`Select`,[wF,TF,EF]=R_(CF),[DF,OF]=S_(CF,[EF,vD]),kF=vD(),[AF,jF]=DF(CF),[MF,NF]=DF(CF),PF=`SelectProvider`;function FF(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=kF(t),[_,v]=j.useState(null),[y,b]=j.useState(null),[x,S]=j.useState(!1),C=pk(l),[w,T]=hv({prop:r,defaultProp:i??!1,onChange:a,caller:CF}),[E,D]=hv({prop:o,defaultProp:s,onChange:c,caller:CF}),O=j.useRef(null),ee=_?!!m||!!_.closest(`form`):!0,[te,ne]=j.useState(new Set),re=vS(),ie=Array.from(te).map(e=>e.props.value).join(`;`),ae=j.useCallback(e=>{ne(t=>new Set(t).add(e))},[]),oe=j.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e),n})},[]),k={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:re,value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:ie,isFormControl:ee};return(0,M.jsx)(PD,{...g,children:(0,M.jsx)(AF,{scope:t,...k,children:(0,M.jsx)(wF.Provider,{scope:t,children:(0,M.jsx)(MF,{scope:t,onNativeOptionAdd:ae,onNativeOptionRemove:oe,children:FI(h)?h(k):n})})})})}FF.displayName=PF;var IF=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,M.jsx)(FF,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,M.jsxs)(M.Fragment,{children:[n,e?(0,M.jsx)(PI,{__scopeSelect:t}):null]})})};IF.displayName=CF;var LF=`SelectTrigger`,RF=j.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kF(n),o=jF(LF,n),s=o.disabled||r,c=b_(t,o.onTriggerChange),l=TF(n),u=j.useRef(`touch`),[d,f,p]=LI(e=>{let t=l().filter(e=>!e.disabled),n=RI(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,M.jsx)(FD,{asChild:!0,...a,children:(0,M.jsx)(z_.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":II(o.value)?``:void 0,...i,ref:c,onClick:q(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:q(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:q(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&xF.includes(e.key)&&(m(),e.preventDefault())})})})});RF.displayName=LF;var zF=`SelectValue`,BF=j.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=jF(zF,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=b_(t,c.onValueNodeChange);iv(()=>{l(u)},[l,u]);let f=II(c.value);return(0,M.jsx)(z_.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,M.jsx)(j.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});BF.displayName=zF;var VF=`SelectIcon`,HF=j.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,M.jsx)(z_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});HF.displayName=VF;var UF=`SelectPortal`,[WF,GF]=DF(UF,{forceMount:void 0}),KF=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,M.jsx)(WF,{scope:e.__scopeSelect,forceMount:n,children:(0,M.jsx)(ov,{asChild:!0,...r})})};KF.displayName=UF;var qF=`SelectContent`,JF=j.forwardRef((e,t)=>{let n=GF(qF,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=jF(qF,e.__scopeSelect),[o,s]=j.useState();return iv(()=>{s(new DocumentFragment)},[]),(0,M.jsx)(cv,{present:r||a.open,children:({present:e})=>e?(0,M.jsx)(tI,{...i,ref:t}):(0,M.jsx)(YF,{...i,fragment:o})})});JF.displayName=qF;var YF=j.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?Gi.createPortal((0,M.jsx)(ZF,{scope:n,children:(0,M.jsx)(wF.Slot,{scope:n,children:(0,M.jsx)(`div`,{ref:t,children:r})})}),i):null});YF.displayName=`SelectContentFragment`;var XF=10,[ZF,QF]=DF(qF),$F=`SelectContentImpl`,eI=w_(`SelectContent.RemoveScroll`),tI=j.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=jF(qF,n),[y,b]=j.useState(null),[x,S]=j.useState(null),C=b_(t,e=>b(e)),[w,T]=j.useState(null),[E,D]=j.useState(null),O=TF(n),[ee,te]=j.useState(!1),ne=j.useRef(!1);j.useEffect(()=>{if(y)return nw(y)},[y]),LS();let re=j.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),ie=j.useCallback(()=>re([w,y]),[re,w,y]);j.useEffect(()=>{ee&&ie()},[ee,ie]);let{onOpenChange:ae,triggerPointerDownPosRef:oe}=v;j.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(oe.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(oe.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||ae(!1),document.removeEventListener(`pointermove`,t),oe.current=null};return oe.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,ae,oe]),j.useEffect(()=>{let e=()=>ae(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ae]);let[k,se]=LI(e=>{let t=O().filter(e=>!e.disabled),n=RI(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ce=j.useCallback((e,t,n)=>{let r=!ne.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(ne.current=!0))},[v.value]),le=j.useCallback(()=>y?.focus(),[y]),ue=j.useCallback((e,t,n)=>{let r=!ne.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),A=r===`popper`?aI:rI,de=A===aI?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,M.jsx)(ZF,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ce,selectedItem:w,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:ie,selectedItemText:E,position:r,isPositioned:ee,searchRef:k,children:(0,M.jsx)(qC,{as:eI,allowPinchZoom:!0,children:(0,M.jsx)(CS,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:q(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,M.jsx)(Y_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,M.jsx)(A,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...de,onPlaced:()=>te(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:q(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&se(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>re(t)),e.preventDefault()}})})})})})})});tI.displayName=$F;var nI=`SelectItemAlignedPosition`,rI=j.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=jF(qF,n),o=QF(qF,n),[s,c]=j.useState(null),[l,u]=j.useState(null),d=b_(t,e=>u(e)),f=TF(n),p=j.useRef(!1),m=j.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=j.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-XF,d=yF(a,[XF,Math.max(XF,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-XF,d=yF(a,[XF,Math.max(XF,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-XF*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-XF,D=c-E,O=g.offsetHeight/2,ee=g.offsetTop+O,te=m+v+ee,ne=x-te;if(te<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=te+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+ne;s.style.height=t+`px`,h.scrollTop=te-E+h.offsetTop}s.style.margin=`${XF}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);iv(()=>y(),[y]);let[b,x]=j.useState();return iv(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,M.jsx)(oI,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:j.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,M.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,M.jsx)(z_.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});rI.displayName=nI;var iI=`SelectPopperPosition`,aI=j.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=XF,...a}=e,o=kF(n);return(0,M.jsx)(ID,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});aI.displayName=iI;var[oI,sI]=DF(qF,{}),cI=`SelectViewport`,lI=j.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=QF(cI,n),o=sI(cI,n),s=b_(t,a.onViewportChange),c=j.useRef(0);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,M.jsx)(wF.Slot,{scope:n,children:(0,M.jsx)(z_.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:q(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-XF*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});lI.displayName=cI;var uI=`SelectGroup`,[dI,fI]=DF(uI),pI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=vS();return(0,M.jsx)(dI,{scope:n,id:i,children:(0,M.jsx)(z_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});pI.displayName=uI;var mI=`SelectLabel`,hI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=fI(mI,n);return(0,M.jsx)(z_.div,{id:i.id,...r,ref:t})});hI.displayName=mI;var gI=`SelectItem`,[_I,vI]=DF(gI),yI=j.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jF(gI,n),c=QF(gI,n),l=s.value===r,[u,d]=j.useState(a??``),[f,p]=j.useState(!1),m=b_(t,e=>c.itemRefCallback?.(e,r,i)),h=vS(),g=j.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,M.jsx)(_I,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:j.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,M.jsx)(wF.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,M.jsx)(z_.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:q(o.onFocus,()=>p(!0)),onBlur:q(o.onBlur,()=>p(!1)),onClick:q(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:q(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:q(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:q(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:q(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:q(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(SF.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});yI.displayName=gI;var bI=`SelectItemText`,xI=j.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=jF(bI,n),s=QF(bI,n),c=vI(bI,n),l=NF(bI,n),[u,d]=j.useState(null),f=b_(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=j.useMemo(()=>(0,M.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return iv(()=>(h(m),()=>g(m)),[h,g,m]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(z_.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gi.createPortal(a.children,o.valueNode):null]})});xI.displayName=bI;var SI=`SelectItemIndicator`,CI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return vI(SI,n).isSelected?(0,M.jsx)(z_.span,{"aria-hidden":!0,...r,ref:t}):null});CI.displayName=SI;var wI=`SelectScrollUpButton`,TI=j.forwardRef((e,t)=>{let n=QF(wI,e.__scopeSelect),r=sI(wI,e.__scopeSelect),[i,a]=j.useState(!1),o=b_(t,r.onScrollButtonChange);return iv(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,M.jsx)(OI,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});TI.displayName=wI;var EI=`SelectScrollDownButton`,DI=j.forwardRef((e,t)=>{let n=QF(EI,e.__scopeSelect),r=sI(EI,e.__scopeSelect),[i,a]=j.useState(!1),o=b_(t,r.onScrollButtonChange);return iv(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,M.jsx)(OI,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});DI.displayName=EI;var OI=j.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=QF(`SelectScrollButton`,n),o=j.useRef(null),s=TF(n),c=j.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return j.useEffect(()=>()=>c(),[c]),iv(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,M.jsx)(z_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:q(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:q(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:q(i.onPointerLeave,()=>{c()})})}),kI=`SelectSeparator`,AI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,M.jsx)(z_.div,{"aria-hidden":!0,...r,ref:t})});AI.displayName=kI;var jI=`SelectArrow`,MI=j.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=kF(n);return QF(jI,n).position===`popper`?(0,M.jsx)(LD,{...i,...r,ref:t}):null});MI.displayName=jI;var NI=`SelectBubbleInput`,PI=j.forwardRef(({__scopeSelect:e,...t},n)=>{let r=jF(NI,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=j.useRef(null),m=b_(n,p),h=i??``,g=bF(h);return j.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,M.jsxs)(z_.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...vv,...t.style},ref:m,defaultValue:h,children:[II(i)?(0,M.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});PI.displayName=NI;function FI(e){return typeof e==`function`}function II(e){return e===``||e===void 0}function LI(e){let t=V_(e),n=j.useRef(``),r=j.useRef(0),i=j.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=j.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function RI(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zI(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function zI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var BI=IF,VI=BF,HI=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(RF,{ref:r,className:X(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,M.jsx)(HF,{asChild:!0,children:(0,M.jsx)(Fy,{className:`h-4 w-4 opacity-50`})})]}));HI.displayName=RF.displayName;var UI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(TI,{ref:n,className:X(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,M.jsx)(Ly,{className:`h-4 w-4`})}));UI.displayName=TI.displayName;var WI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(DI,{ref:n,className:X(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,M.jsx)(Fy,{className:`h-4 w-4`})}));WI.displayName=DI.displayName;var GI=j.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,M.jsx)(KF,{children:(0,M.jsxs)(JF,{ref:i,className:X(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,M.jsx)(UI,{}),(0,M.jsx)(lI,{className:X(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,M.jsx)(WI,{})]})}));GI.displayName=JF.displayName;var KI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(hI,{ref:n,className:X(`px-2 py-1.5 text-sm font-semibold`,e),...t}));KI.displayName=hI.displayName;var qI=j.forwardRef(({className:e,children:t,...n},r)=>(0,M.jsxs)(yI,{ref:r,className:X(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,M.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,M.jsx)(CI,{children:(0,M.jsx)(Py,{className:`h-4 w-4`})})}),(0,M.jsx)(xI,{children:t})]}));qI.displayName=yI.displayName;var JI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(AI,{ref:n,className:X(`-mx-1 my-1 h-px bg-muted`,e),...t}));JI.displayName=AI.displayName;var YI=la(`/organizations/$orgId/teams`)({component:XI});function XI(){let{t:e}=vt(),{orgId:t}=YI.useParams(),n=o_(),{members:r}=lF(t),[i,a]=(0,j.useState)([]),[o,s]=(0,j.useState)(!0),[c,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(null),[g,_]=(0,j.useState)([]),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(!1),[S,C]=(0,j.useState)(``),w=(0,j.useCallback)(async()=>{if(n?.organizations?.teams){s(!0);try{a((await n.organizations.teams.list(t))?.teams??[])}catch{a([])}finally{s(!1)}}},[n,t]);(0,j.useEffect)(()=>{w()},[w]);let T=(0,j.useCallback)(async e=>{if(n?.organizations?.teams){y(!0);try{_((await n.organizations.teams.listMembers(e))?.members??[])}catch{_([])}finally{y(!1)}}},[n]);(0,j.useEffect)(()=>{m&&T(m)},[m,T]);let E=async r=>{if(r.preventDefault(),u.trim()){p(!0);try{await n.organizations.teams.create({name:u.trim(),organizationId:t}),K({title:e(`teams.created`)}),l(!1),d(``),await w()}catch(t){K({title:e(`teams.createFailed`),description:t.message,variant:`destructive`})}finally{p(!1)}}},D=async r=>{if(confirm(e(`teams.deleteConfirm`,{name:r.name})))try{await n.organizations.teams.delete({teamId:r.id,organizationId:t}),K({title:e(`teams.deleted`)}),m===r.id&&h(null),await w()}catch(t){K({title:e(`teams.deleteFailed`),description:t.message,variant:`destructive`})}},O=async()=>{if(!(!m||!S))try{await n.organizations.teams.addMember({teamId:m,userId:S}),K({title:e(`teams.memberAdded`)}),x(!1),C(``),await T(m)}catch(t){K({title:e(`teams.addMemberFailed`),description:t.message,variant:`destructive`})}},ee=async(t,r)=>{try{await n.organizations.teams.removeMember({teamId:t,userId:r}),K({title:e(`teams.memberRemoved`)}),await T(t)}catch(t){K({title:e(`teams.removeMemberFailed`),description:t.message,variant:`destructive`})}},te=Object.fromEntries(r.map(e=>[e.userId,e])),ne=new Set(g.map(e=>e.userId)),re=r.filter(e=>!ne.has(e.userId));return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(Q,{children:[(0,M.jsx)(jN,{children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`teams.title`,{count:i.length})}),(0,M.jsx)(NN,{children:e(`teams.description`)})]}),(0,M.jsxs)(Z,{size:`sm`,onClick:()=>l(!0),children:[(0,M.jsx)(ob,{className:`mr-2 h-4 w-4`}),e(`teams.create`)]})]})}),(0,M.jsxs)(PN,{children:[o&&(0,M.jsxs)(`div`,{className:`space-y-3`,children:[(0,M.jsx)($w,{className:`h-12 w-full`}),(0,M.jsx)($w,{className:`h-12 w-full`})]}),!o&&i.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(bb,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`teams.empty`)})]}),!o&&i.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:i.map(t=>(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`flex-1 text-left`,onClick:()=>h(m===t.id?null:t.id),children:[(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:t.name}),t.createdAt&&(0,M.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:new Date(t.createdAt).toLocaleDateString()})]}),(0,M.jsxs)(lM,{children:[(0,M.jsx)(uM,{asChild:!0,children:(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,children:(0,M.jsx)(Gy,{className:`h-4 w-4`})})}),(0,M.jsx)(pM,{align:`end`,children:(0,M.jsxs)(mM,{className:`text-destructive`,onClick:()=>D(t),children:[(0,M.jsx)(hb,{className:`mr-2 h-4 w-4`}),e(`teams.delete`)]})})]})]}),m===t.id&&(0,M.jsxs)(`div`,{className:`pb-3 pl-4 border-l-2 ml-2 space-y-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:e(`teams.members`,{count:g.length})}),(0,M.jsxs)(Z,{size:`sm`,variant:`outline`,onClick:()=>x(!0),children:[(0,M.jsx)(yb,{className:`mr-1 h-3 w-3`}),e(`teams.addMember`)]})]}),v&&(0,M.jsx)($w,{className:`h-8 w-full`}),!v&&g.length===0&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`teams.noMembers`)}),!v&&g.map(e=>{let n=te[e.userId];return(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-1`,children:[(0,M.jsx)(`span`,{className:`text-sm`,children:n?.user?.name||n?.user?.email||e.userId}),(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,onClick:()=>ee(t.id,e.userId),children:(0,M.jsx)(vb,{className:`h-3 w-3`})})]},e.id)})]})]},t.id))})]})]}),(0,M.jsx)(JP,{open:c,onOpenChange:l,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`teams.createTitle`)}),(0,M.jsx)(tF,{children:e(`teams.createDescription`)})]}),(0,M.jsxs)(`form`,{onSubmit:E,children:[(0,M.jsx)(`div`,{className:`space-y-4 py-4`,children:(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`team-name`,children:e(`teams.nameLabel`)}),(0,M.jsx)(cS,{id:`team-name`,required:!0,placeholder:e(`teams.namePlaceholder`),value:u,onChange:e=>d(e.target.value)})]})}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,type:`button`,onClick:()=>l(!1),children:e(`common.cancel`)}),(0,M.jsx)(Z,{type:`submit`,disabled:f,children:e(f?`common.saving`:`teams.create`)})]})]})]})}),(0,M.jsx)(JP,{open:b,onOpenChange:x,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`teams.addMemberTitle`)}),(0,M.jsx)(tF,{children:e(`teams.addMemberDescription`)})]}),(0,M.jsx)(`div`,{className:`space-y-4 py-4`,children:(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{children:e(`teams.selectMember`)}),(0,M.jsxs)(BI,{value:S,onValueChange:C,children:[(0,M.jsx)(HI,{children:(0,M.jsx)(VI,{placeholder:e(`teams.selectMemberPlaceholder`)})}),(0,M.jsx)(GI,{children:re.map(e=>(0,M.jsx)(qI,{value:e.userId,children:e.user?.name||e.user?.email||e.userId},e.userId))})]})]})}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>x(!1),children:e(`common.cancel`)}),(0,M.jsx)(Z,{onClick:O,disabled:!S,children:e(`teams.addMember`)})]})]})})]})}var ZI=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`textarea`,{className:X(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));ZI.displayName=`Textarea`;var QI=la(`/organizations/$orgId/members`)({component:$I});function $I(){let{t:e}=vt(),{orgId:t}=QI.useParams(),{organizations:n}=lN(),{user:r}=cN(),i=o_(),a=n.find(e=>e.id===t),{members:o,loading:s,inviteMember:c,removeMember:l,updateMemberRole:u}=lF(t),{invitations:d,loading:f,cancelInvitation:p,resendInvitation:m}=uF(t),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(!1),[y,b]=(0,j.useState)(``),[x,S]=(0,j.useState)(``),[C,w]=(0,j.useState)(`member`),[T,E]=(0,j.useState)(!1),[D,O]=(0,j.useState)(!1),ee=d.filter(e=>e.status===`pending`),te=o.find(e=>e.userId===r?.id),ne=te?.role===`owner`||te?.role===`admin`,re=async()=>{let t=_?x.split(/[,;\n]+/).map(e=>e.trim()).filter(Boolean):[y.trim()].filter(Boolean);if(t.length===0){K({title:e(`organizations.members.emailRequired`),variant:`destructive`});return}E(!0);let n=0;try{for(let e of t)try{await c(e,C)}catch{n++}n>0&&n<t.length?K({title:e(`organizations.members.invitePartialSuccess`,{sent:t.length-n,failed:n}),variant:`destructive`}):n===t.length?K({title:e(`organizations.members.inviteFailed`),variant:`destructive`}):K({title:e(`organizations.members.invitationSent`)}),g(!1),b(``),S(``),w(`member`)}finally{E(!1)}},ie=async(t,n)=>{if(confirm(e(`organizations.members.removeConfirm`,{name:n})))try{await l(t),K({title:e(`organizations.members.memberRemoved`)})}catch(t){K({title:e(`organizations.members.removeFailed`),description:t.message,variant:`destructive`})}},ae=async(t,n)=>{try{await u(t,n),K({title:e(`organizations.members.roleUpdated`)})}catch(t){K({title:e(`organizations.members.roleUpdateFailed`),description:t.message,variant:`destructive`})}},oe=async()=>{if(confirm(e(`organizations.members.leaveConfirm`,{org:a?.name??t}))){O(!0);try{await i.organizations.leave(t),K({title:e(`organizations.members.leftOrg`)}),window.location.assign(`/`)}catch(t){K({title:e(`organizations.members.leaveFailed`),description:t.message,variant:`destructive`})}finally{O(!1)}}},k=async(t,n)=>{if(confirm(e(`organizations.members.cancelConfirm`,{email:n})))try{await p(t),K({title:e(`organizations.members.invitationCanceled`)})}catch(t){K({title:e(`organizations.members.cancelFailed`),description:t.message,variant:`destructive`})}},se=async t=>{try{await m(t),K({title:e(`organizations.members.invitationResent`)})}catch(t){K({title:e(`organizations.members.resendFailed`),description:t.message,variant:`destructive`})}},ce=async t=>{let n=`${window.location.origin}/accept-invitation/${t}`;try{await navigator.clipboard.writeText(n),K({title:e(`organizations.members.linkCopied`)})}catch{K({title:e(`organizations.members.linkCopyFailed`),variant:`destructive`})}};return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(Q,{children:[(0,M.jsx)(jN,{children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`organizations.members.title`,{count:o.length})}),(0,M.jsx)(NN,{children:e(`organizations.members.description`)})]}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[te&&te.role!==`owner`&&(0,M.jsxs)(Z,{size:`sm`,variant:`outline`,onClick:oe,disabled:D,children:[(0,M.jsx)(eb,{className:`mr-2 h-4 w-4`}),e(`organizations.members.leave`)]}),ne&&(0,M.jsxs)(Z,{size:`sm`,onClick:()=>g(!0),children:[(0,M.jsx)(yb,{className:`mr-2 h-4 w-4`}),e(`organizations.members.invite`)]})]})]})}),(0,M.jsxs)(PN,{children:[s&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.members.loadingMembers`)}),!s&&o.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(Sb,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`organizations.members.empty`)})]}),!s&&o.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:o.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsxs)(`div`,{className:`font-medium text-sm`,children:[t.user?.name||t.user?.email||t.userId,t.userId===r?.id&&(0,M.jsx)(gP,{variant:`secondary`,className:`ml-2 text-xs`,children:e(`organizations.members.you`)})]}),t.user?.email&&(0,M.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t.user.email})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ne&&t.role!==`owner`&&t.userId!==r?.id?(0,M.jsxs)(BI,{value:t.role,onValueChange:e=>ae(t.id,e),children:[(0,M.jsx)(HI,{className:`h-7 w-24 text-xs`,children:(0,M.jsx)(VI,{})}),(0,M.jsxs)(GI,{children:[(0,M.jsx)(qI,{value:`admin`,children:e(`common.roles.admin`)}),(0,M.jsx)(qI,{value:`member`,children:e(`common.roles.member`)})]})]}):(0,M.jsx)(gP,{variant:`secondary`,className:`text-xs`,children:e(`common.roles.${t.role??`member`}`)}),ne&&t.role!==`owner`&&t.userId!==r?.id&&(0,M.jsxs)(lM,{children:[(0,M.jsx)(uM,{asChild:!0,children:(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,children:(0,M.jsx)(Gy,{className:`h-4 w-4`})})}),(0,M.jsx)(pM,{align:`end`,children:(0,M.jsxs)(mM,{className:`text-destructive`,onClick:()=>ie(t.id,t.user?.name||t.user?.email||t.userId),children:[(0,M.jsx)(hb,{className:`mr-2 h-4 w-4`}),e(`organizations.members.removeMember`)]})})]})]})]},t.id))})]})]}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(jN,{children:(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(MN,{className:`text-base`,children:e(`organizations.members.pendingTitle`,{count:ee.length})}),(0,M.jsx)(NN,{children:e(`organizations.members.pendingDescription`)})]}),ne&&(0,M.jsxs)(Z,{size:`sm`,variant:`outline`,onClick:()=>g(!0),children:[(0,M.jsx)(yb,{className:`mr-2 h-4 w-4`}),e(`organizations.members.sendInvitation`)]})]})}),(0,M.jsxs)(PN,{children:[f&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.members.loadingInvitations`)}),!f&&ee.length===0&&(0,M.jsxs)(`div`,{className:`text-center py-8`,children:[(0,M.jsx)(nb,{className:`mx-auto h-12 w-12 text-muted-foreground/50`}),(0,M.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`organizations.members.noPending`)})]}),!f&&ee.length>0&&(0,M.jsx)(`div`,{className:`divide-y`,children:ee.map(t=>(0,M.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`div`,{className:`font-medium text-sm`,children:t.email}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,M.jsx)(gP,{variant:`outline`,className:`text-xs`,children:e(`common.roles.${t.role}`)}),(0,M.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,M.jsx)(Uy,{className:`h-3 w-3`}),e(`organizations.members.expires`,{date:new Date(t.expiresAt).toLocaleDateString()})]})]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,title:e(`organizations.members.copyLink`),onClick:()=>ce(t.id),children:(0,M.jsx)(Wy,{className:`h-4 w-4`})}),(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,title:e(`organizations.members.resend`),onClick:()=>se(t),children:(0,M.jsx)(sb,{className:`h-4 w-4`})}),(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,title:e(`organizations.members.cancel`),onClick:()=>k(t.id,t.email),children:(0,M.jsx)(Cb,{className:`h-4 w-4`})})]})]},t.id))})]})]}),(0,M.jsx)(JP,{open:h,onOpenChange:g,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{children:e(`organizations.members.inviteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`organizations.members.inviteDialogDescription`,{organization:a?.name??``})})]}),(0,M.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(Z,{type:`button`,variant:_?`outline`:`default`,size:`sm`,onClick:()=>v(!1),children:e(`organizations.members.singleInvite`)}),(0,M.jsx)(Z,{type:`button`,variant:_?`default`:`outline`,size:`sm`,onClick:()=>v(!0),children:e(`organizations.members.bulkInvite`)})]}),_?(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{children:e(`organizations.members.bulkEmails`)}),(0,M.jsx)(ZI,{placeholder:e(`organizations.members.bulkEmailsPlaceholder`),rows:5,value:x,onChange:e=>S(e.target.value)}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.members.bulkEmailsHint`)})]}):(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`invite-email`,children:e(`organizations.members.email`)}),(0,M.jsx)(cS,{id:`invite-email`,type:`email`,placeholder:e(`organizations.members.emailPlaceholder`),value:y,onChange:e=>b(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`role`,children:e(`organizations.members.role`)}),(0,M.jsxs)(BI,{value:C,onValueChange:w,children:[(0,M.jsx)(HI,{id:`role`,children:(0,M.jsx)(VI,{})}),(0,M.jsxs)(GI,{children:[(0,M.jsx)(qI,{value:`owner`,children:e(`common.roles.owner`)}),(0,M.jsx)(qI,{value:`admin`,children:e(`common.roles.admin`)}),(0,M.jsx)(qI,{value:`member`,children:e(`common.roles.member`)})]})]})]})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>g(!1),disabled:T,children:e(`common.cancel`)}),(0,M.jsx)(Z,{onClick:re,disabled:T,children:e(T?`organizations.members.sending`:`organizations.members.sendInvitation`)})]})]})})]})}var eL=la(`/organizations/$orgId/general`)({component:tL});function tL(){let{t:e}=vt(),{orgId:t}=eL.useParams(),n=Hi(),{organizations:r}=lN(),{session:i,user:a,setActiveOrganization:o}=cN(),s=r.find(e=>e.id===t),{members:c}=lF(t),{invitations:l}=uF(t),{remove:u,deleting:d}=fN(),{update:f,updating:p}=dN(),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(``),[v,y]=(0,j.useState)(``),[b,x]=(0,j.useState)(!1),[S,C]=(0,j.useState)(``);(0,j.useEffect)(()=>{h(s?.name??``),_(s?.slug??``),y(s?.logo??``)},[s?.id,s?.name,s?.slug,s?.logo]);let w=i?.activeOrganizationId===t,T=l.filter(e=>e.status===`pending`),E=(a?c.find(e=>e.userId===a.id):void 0)?.role??null,D=E===`owner`||E===`admin`,O=D&&s!=null&&(m.trim()!==(s.name??``)||g.trim()!==(s.slug??``)||v.trim()!==(s.logo??``));return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w&&(0,M.jsx)(gP,{variant:`outline`,children:e(`organizations.active`)}),E&&(0,M.jsx)(gP,{variant:`secondary`,className:`capitalize`,children:e(`common.roles.${E}`)})]}),!w&&(0,M.jsx)(Z,{size:`sm`,variant:`outline`,onClick:async()=>{try{await o(t),K({title:e(`organizations.general.switched`)})}catch(t){K({title:e(`organizations.general.switchFailed`),description:t.message,variant:`destructive`})}},children:e(`organizations.general.setActive`)})]}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{children:e(`organizations.general.detailsTitle`)}),(0,M.jsx)(NN,{children:e(D?`organizations.general.detailsDescription`:`organizations.general.detailsReadOnly`)})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`org-name`,children:e(`organizations.new.name`)}),(0,M.jsx)(cS,{id:`org-name`,value:m,onChange:e=>h(e.target.value),disabled:!D||p,placeholder:e(`organizations.general.namePlaceholder`)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`org-slug`,children:e(`organizations.new.slug`)}),(0,M.jsx)(cS,{id:`org-slug`,value:g,onChange:e=>_(e.target.value),disabled:!D||p,placeholder:e(`organizations.general.slugPlaceholder`),className:`font-mono text-sm`}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`organizations.general.slugHint`)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`org-logo`,children:e(`organizations.general.logo`)}),(0,M.jsx)(cS,{id:`org-logo`,value:v,onChange:e=>y(e.target.value),disabled:!D||p,placeholder:e(`organizations.general.logoPlaceholder`)})]}),(0,M.jsxs)(`div`,{className:`flex justify-between border-t pt-4 text-xs`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`organizations.general.organizationId`)}),(0,M.jsx)(`code`,{className:`font-mono`,children:t})]})]}),D&&(0,M.jsxs)(PN,{className:`flex justify-end gap-2 border-t pt-4`,children:[(0,M.jsx)(Z,{variant:`ghost`,size:`sm`,onClick:()=>{h(s?.name??``),_(s?.slug??``),y(s?.logo??``)},disabled:!O||p,children:e(`organizations.general.reset`)}),(0,M.jsxs)(Z,{size:`sm`,onClick:async()=>{if(!s||!D||!O)return;let n=m.trim();if(!n){K({title:e(`organizations.general.nameRequired`),variant:`destructive`});return}try{await f(t,{name:n,slug:g.trim()||void 0,logo:v.trim()||void 0}),K({title:e(`organizations.general.updated`)})}catch(t){K({title:e(`organizations.general.updateFailed`),description:t.message,variant:`destructive`})}},disabled:!O||p,children:[(0,M.jsx)(cb,{className:`mr-2 h-4 w-4`}),e(p?`common.saving`:`organizations.general.save`)]})]})]}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(jN,{children:(0,M.jsx)(MN,{className:`text-base`,children:e(`organizations.general.overviewTitle`)})}),(0,M.jsxs)(PN,{className:`space-y-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`organizations.general.members`)}),(0,M.jsx)(`span`,{children:c.length})]}),(0,M.jsxs)(`div`,{className:`flex justify-between`,children:[(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e(`organizations.general.pendingInvitations`)}),(0,M.jsx)(`span`,{children:T.length})]})]})]}),D&&(0,M.jsxs)(Q,{className:`border-destructive/40`,children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base text-destructive`,children:e(`organizations.general.dangerTitle`)}),(0,M.jsx)(NN,{children:e(`organizations.general.dangerDescription`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(Z,{variant:`destructive`,size:`sm`,onClick:()=>x(!0),disabled:d,children:[(0,M.jsx)(hb,{className:`mr-2 h-4 w-4`}),e(`organizations.general.delete`)]})})]}),(0,M.jsx)(JP,{open:b,onOpenChange:e=>{x(e),e||C(``)},children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{className:`text-destructive`,children:e(`organizations.general.deleteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`organizations.general.deleteDialogDescription`,{name:s?.name??``})})]}),(0,M.jsx)(`div`,{className:`space-y-4 py-2`,children:(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`delete-confirm`,children:e(`organizations.general.deleteDialogLabel`,{name:s?.name??``})}),(0,M.jsx)(cS,{id:`delete-confirm`,value:S,onChange:e=>C(e.target.value),placeholder:s?.name??``,disabled:d})]})}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>x(!1),disabled:d,children:e(`common.cancel`)}),(0,M.jsx)(Z,{variant:`destructive`,onClick:async()=>{if(s){if(S!==s.name){K({title:e(`organizations.general.confirmationMismatch`),description:e(`organizations.general.confirmationHint`,{name:s.name}),variant:`destructive`});return}try{let r=await u(t),i=r?.warnings,a=r?.deletedProjects??0;K({title:e(`organizations.general.deleted`),description:i?.length?e(`organizations.general.deletedWithWarnings`,{deletedProjects:a,warning:i[0],extraCount:Math.max(i.length-1,0)}):e(`organizations.general.deletedDescription`,{name:s.name,deletedProjects:a}),variant:i?.length?`destructive`:void 0}),x(!1),C(``),n({to:`/organizations`})}catch(t){K({title:e(`organizations.general.deleteFailed`),description:t.message,variant:`destructive`})}}},disabled:d||!s||S!==s.name,children:e(d?`organizations.general.deleting`:`organizations.general.delete`)})]})]})})]})}var nL=la(`/account/oauth-applications/new`)({component:rL});function rL(){let{t:e}=vt(),t=Hi(),{register:n,registering:r}=jP(),[i,a]=(0,j.useState)(``),[o,s]=(0,j.useState)(``),[c,l]=(0,j.useState)(`client_secret_basic`),[u,d]=(0,j.useState)(``),[f,p]=(0,j.useState)(``),[m,h]=(0,j.useState)(null),g=async()=>{let t=i.trim(),r=o.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean);if(!t){K({title:e(`oauth.applications.form.nameRequired`),variant:`destructive`});return}if(r.length===0){K({title:e(`oauth.applications.form.redirectRequired`),variant:`destructive`});return}try{let i=await n({client_name:t,redirect_uris:r,token_endpoint_auth_method:c,...u.trim()?{client_uri:u.trim()}:{},...f.trim()?{logo_uri:f.trim()}:{}});h({client_id:i?.client_id??``,client_secret:i?.client_secret}),K({title:e(`oauth.applications.registered`)})}catch(t){K({title:e(`oauth.applications.registerFailed`),description:t.message,variant:`destructive`})}},_=(t,n)=>{navigator.clipboard.writeText(t).then(()=>K({title:e(`oauth.applications.copied`,{label:n})}),()=>K({title:e(`oauth.applications.copyFailed`,{label:n}),variant:`destructive`}))};return m?(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`oauth.applications.registeredTitle`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.registeredDescription`)})]}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{children:e(`oauth.applications.credentials`)}),(0,M.jsx)(NN,{children:e(`oauth.applications.credentialsDescription`)})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)($,{children:e(`oauth.applications.clientId`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`code`,{className:`flex-1 rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:m.client_id}),(0,M.jsx)(Z,{size:`icon`,variant:`outline`,onClick:()=>_(m.client_id,e(`oauth.applications.clientId`)),children:(0,M.jsx)(Wy,{className:`h-4 w-4`})})]})]}),m.client_secret&&(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)($,{children:e(`oauth.applications.clientSecret`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`code`,{className:`flex-1 break-all rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:m.client_secret}),(0,M.jsx)(Z,{size:`icon`,variant:`outline`,onClick:()=>_(m.client_secret,e(`oauth.applications.clientSecret`)),children:(0,M.jsx)(Wy,{className:`h-4 w-4`})})]}),(0,M.jsx)(`p`,{className:`text-xs text-destructive`,children:e(`oauth.applications.clientSecretWarning`)})]})]})]}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>t({to:`/account/oauth-applications`}),children:e(`oauth.applications.backToList`)}),(0,M.jsx)(Z,{onClick:()=>t({to:`/account/oauth-applications/$clientId`,params:{clientId:m.client_id}}),children:e(`oauth.applications.viewApplication`)})]})]}):(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`oauth.applications.form.title`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.form.description`)})]}),(0,M.jsxs)(Q,{children:[(0,M.jsx)(jN,{children:(0,M.jsxs)(MN,{className:`flex items-center gap-2 text-base`,children:[(0,M.jsx)(Xy,{className:`h-4 w-4`}),e(`oauth.applications.form.details`)]})}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`oauth-name`,children:e(`oauth.applications.form.name`)}),(0,M.jsx)(cS,{id:`oauth-name`,value:i,onChange:e=>a(e.target.value),placeholder:e(`oauth.applications.form.namePlaceholder`),disabled:r})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`oauth-redirect`,children:e(`oauth.applications.form.redirectUris`)}),(0,M.jsx)(ZI,{id:`oauth-redirect`,value:o,onChange:e=>s(e.target.value),placeholder:e(`oauth.applications.form.redirectPlaceholder`),rows:3,disabled:r}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`oauth.applications.form.redirectHint`)})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{children:e(`oauth.applications.form.authMethod`)}),(0,M.jsxs)(BI,{value:c,onValueChange:e=>l(e),disabled:r,children:[(0,M.jsx)(HI,{children:(0,M.jsx)(VI,{})}),(0,M.jsxs)(GI,{children:[(0,M.jsx)(qI,{value:`client_secret_basic`,children:e(`oauth.applications.form.authMethodBasic`)}),(0,M.jsx)(qI,{value:`client_secret_post`,children:e(`oauth.applications.form.authMethodPost`)}),(0,M.jsx)(qI,{value:`none`,children:e(`oauth.applications.form.authMethodNone`)})]})]})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`oauth-client-uri`,children:e(`oauth.applications.form.clientUri`)}),(0,M.jsx)(cS,{id:`oauth-client-uri`,value:u,onChange:e=>d(e.target.value),placeholder:e(`oauth.applications.form.clientUriPlaceholder`),disabled:r})]}),(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)($,{htmlFor:`oauth-logo`,children:e(`oauth.applications.form.logoUri`)}),(0,M.jsx)(cS,{id:`oauth-logo`,value:f,onChange:e=>p(e.target.value),placeholder:e(`oauth.applications.form.logoUriPlaceholder`),disabled:r}),(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`oauth.applications.form.logoHint`)})]})]})]}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,M.jsx)(Z,{variant:`ghost`,onClick:()=>t({to:`/account/oauth-applications`}),disabled:r,children:e(`common.cancel`)}),(0,M.jsx)(Z,{onClick:g,disabled:r,children:e(r?`oauth.applications.form.registering`:`oauth.applications.register`)})]})]})}var iL=la(`/account/oauth-applications/$clientId`)({component:aL});function aL(){let{t:e}=vt(),{clientId:t}=iL.useParams(),n=Hi(),{applications:r,loading:i,reload:a}=AP(),{remove:o,deleting:s}=MP(),c=o_(),l=r.find(e=>e.client_id===t),[u,d]=(0,j.useState)(null);(0,j.useEffect)(()=>{let e=!1;if(!l&&c?.oauth?.applications?.get)return c.oauth.applications.get(t).then(t=>{e||d(t?.data??t)},()=>{}),()=>{e=!0}},[c,t,l]);let f=l??u,[p,m]=(0,j.useState)(!1),h=(t,n)=>{navigator.clipboard.writeText(t).then(()=>K({title:e(`oauth.applications.copied`,{label:n})}),()=>K({title:e(`oauth.applications.copyFailed`,{label:n}),variant:`destructive`}))},g=async()=>{if(f)try{await o(f.client_id),K({title:e(`oauth.applications.deleted`)}),await a(),n({to:`/account/oauth-applications`})}catch(t){K({title:e(`oauth.applications.deleteFailed`),description:t.message,variant:`destructive`})}};if(i&&!f)return(0,M.jsx)(`div`,{className:`p-8 text-center text-sm text-muted-foreground`,children:e(`common.loading`)});if(!f)return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`oauth.applications.notFoundTitle`)}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.notFoundDescription`)}),(0,M.jsx)(Z,{onClick:()=>n({to:`/account/oauth-applications`}),children:e(`oauth.applications.backToList`)})]});let _=typeof f.redirect_urls==`string`?f.redirect_urls.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean):Array.isArray(f.redirect_urls)?f.redirect_urls:[];return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold`,children:f.name}),(0,M.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:f.client_id})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f.type&&(0,M.jsx)(gP,{variant:`outline`,className:`capitalize`,children:f.type}),f.disabled&&(0,M.jsx)(gP,{variant:`destructive`,children:e(`oauth.applications.disabled`)})]})]}),(0,M.jsxs)(Q,{children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{children:e(`oauth.applications.credentials`)}),(0,M.jsx)(NN,{children:e(`oauth.applications.credentialsDescriptionDetail`)})]}),(0,M.jsxs)(PN,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)($,{children:e(`oauth.applications.clientId`)}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`code`,{className:`flex-1 rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:f.client_id}),(0,M.jsx)(Z,{size:`icon`,variant:`outline`,onClick:()=>h(f.client_id,e(`oauth.applications.clientId`)),children:(0,M.jsx)(Wy,{className:`h-4 w-4`})})]})]}),(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)($,{children:e(`oauth.applications.redirectUris`)}),_.length===0?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`oauth.applications.noRedirectUris`)}):(0,M.jsx)(`ul`,{className:`space-y-1`,children:_.map((e,t)=>(0,M.jsx)(`li`,{className:`rounded-md border bg-muted px-3 py-2 font-mono text-xs`,children:e},t))})]})]})]}),(0,M.jsxs)(Q,{className:`border-destructive/40`,children:[(0,M.jsxs)(jN,{children:[(0,M.jsx)(MN,{className:`text-base text-destructive`,children:e(`oauth.applications.dangerTitle`)}),(0,M.jsx)(NN,{children:e(`oauth.applications.dangerDescription`)})]}),(0,M.jsx)(PN,{children:(0,M.jsxs)(Z,{variant:`destructive`,size:`sm`,onClick:()=>m(!0),disabled:s,children:[(0,M.jsx)(hb,{className:`mr-2 h-4 w-4`}),e(`oauth.applications.delete`)]})})]}),(0,M.jsx)(JP,{open:p,onOpenChange:m,children:(0,M.jsxs)(ZP,{children:[(0,M.jsxs)(QP,{children:[(0,M.jsx)(eF,{className:`text-destructive`,children:e(`oauth.applications.deleteDialogTitle`)}),(0,M.jsx)(tF,{children:e(`oauth.applications.deleteDialogDescription`,{name:f.name})})]}),(0,M.jsxs)($P,{children:[(0,M.jsx)(Z,{variant:`outline`,onClick:()=>m(!1),disabled:s,children:e(`common.cancel`)}),(0,M.jsx)(Z,{variant:`destructive`,onClick:g,disabled:s,children:e(s?`oauth.applications.deleting`:`common.delete`)})]})]})})]})}var oL=zN.update({id:`/verify-email-prompt`,path:`/verify-email-prompt`,getParentRoute:()=>AN}),sL=VN.update({id:`/verify-email`,path:`/verify-email`,getParentRoute:()=>AN}),cL=qN.update({id:`/setup`,path:`/setup`,getParentRoute:()=>AN}),lL=XN.update({id:`/reset-password`,path:`/reset-password`,getParentRoute:()=>AN}),uL=tP.update({id:`/register`,path:`/register`,getParentRoute:()=>AN}),dL=aP.update({id:`/login`,path:`/login`,getParentRoute:()=>AN}),fL=lP.update({id:`/forgot-password`,path:`/forgot-password`,getParentRoute:()=>AN}),pL=dP.update({id:`/account`,path:`/account`,getParentRoute:()=>AN}),mL=pP.update({id:`/`,path:`/`,getParentRoute:()=>AN}),hL=vP.update({id:`/organizations/`,path:`/organizations/`,getParentRoute:()=>AN}),gL=bP.update({id:`/`,path:`/`,getParentRoute:()=>pL}),_L=CP.update({id:`/organizations/new`,path:`/organizations/new`,getParentRoute:()=>AN}),vL=OP.update({id:`/organizations/$orgId`,path:`/organizations/$orgId`,getParentRoute:()=>AN}),yL=PP.update({id:`/oauth/consent`,path:`/oauth/consent`,getParentRoute:()=>AN}),bL=LP.update({id:`/auth/device`,path:`/auth/device`,getParentRoute:()=>AN}),xL=BP.update({id:`/two-factor`,path:`/two-factor`,getParentRoute:()=>pL}),SL=GP.update({id:`/sessions`,path:`/sessions`,getParentRoute:()=>pL}),CL=nF.update({id:`/security`,path:`/security`,getParentRoute:()=>pL}),wL=iF.update({id:`/profile`,path:`/profile`,getParentRoute:()=>pL}),TL=oF.update({id:`/linked-accounts`,path:`/linked-accounts`,getParentRoute:()=>pL}),EL=fF.update({id:`/invitations`,path:`/invitations`,getParentRoute:()=>pL}),DL=mF.update({id:`/accept-invitation/$invitationId`,path:`/accept-invitation/$invitationId`,getParentRoute:()=>AN}),OL=gF.update({id:`/`,path:`/`,getParentRoute:()=>vL}),kL=_F.update({id:`/oauth-applications/`,path:`/oauth-applications/`,getParentRoute:()=>pL}),AL=YI.update({id:`/teams`,path:`/teams`,getParentRoute:()=>vL}),jL=QI.update({id:`/members`,path:`/members`,getParentRoute:()=>vL}),ML=eL.update({id:`/general`,path:`/general`,getParentRoute:()=>vL}),NL=nL.update({id:`/oauth-applications/new`,path:`/oauth-applications/new`,getParentRoute:()=>pL}),PL={AccountInvitationsRoute:EL,AccountLinkedAccountsRoute:TL,AccountProfileRoute:wL,AccountSecurityRoute:CL,AccountSessionsRoute:SL,AccountTwoFactorRoute:xL,AccountIndexRoute:gL,AccountOauthApplicationsClientIdRoute:iL.update({id:`/oauth-applications/$clientId`,path:`/oauth-applications/$clientId`,getParentRoute:()=>pL}),AccountOauthApplicationsNewRoute:NL,AccountOauthApplicationsIndexRoute:kL},FL=pL._addFileChildren(PL),IL={OrganizationsOrgIdGeneralRoute:ML,OrganizationsOrgIdMembersRoute:jL,OrganizationsOrgIdTeamsRoute:AL,OrganizationsOrgIdIndexRoute:OL},LL={IndexRoute:mL,AccountRoute:FL,ForgotPasswordRoute:fL,LoginRoute:dL,RegisterRoute:uL,ResetPasswordRoute:lL,SetupRoute:cL,VerifyEmailRoute:sL,VerifyEmailPromptRoute:oL,AcceptInvitationInvitationIdRoute:DL,AuthDeviceRoute:bL,OauthConsentRoute:yL,OrganizationsOrgIdRoute:vL._addFileChildren(IL),OrganizationsNewRoute:_L,OrganizationsIndexRoute:hL},RL=AN._addFileChildren(LL)._addFileTypes();function zL(){let e=`/_account/`;return e.endsWith(`/`)?e.slice(0,-1):e}var BL=wa({routeTree:RL,basepath:zL()});function VL(){return(0,M.jsx)(Da,{router:BL})}var HL=typeof localStorage<`u`&&localStorage.getItem(`account.lang`)||typeof navigator<`u`&&navigator.language||`en`;function UL({children:e}){let{i18n:t,language:n}=yt(),[r,i]=j.useReducer(e=>e+1,0),[a,o]=j.useState(!1);return j.useEffect(()=>{let e=()=>i();t.on(`loaded`,e),t.on(`languageChanged`,e);let n=window.setTimeout(()=>o(!0),1500);return()=>{t.off(`loaded`,e),t.off(`languageChanged`,e),window.clearTimeout(n)}},[t]),a||t.isInitialized&&t.hasResourceBundle?.(n,`translation`)?(0,M.jsx)(M.Fragment,{children:e}):null}Jf.createRoot(document.getElementById(`root`)).render((0,M.jsx)(j.StrictMode,{children:(0,M.jsx)(_t,{config:{defaultLanguage:HL,fallbackLanguage:`en`},loadLanguage:DM,children:(0,M.jsx)(UL,{children:(0,M.jsx)(VL,{})})})}));
|