adminizer 5.2.0-build.34 → 5.2.0-build.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{abnfDiagram-VCTEODGH-BbJTXfTE.js → abnfDiagram-VCTEODGH-VlwaoUTb.js} +1 -1
- package/assets/{add-UCuYfqnA.js → add-CqSZIEWV.js} +1 -1
- package/assets/{add-group-Dqy51mK7.js → add-group-BOsQ0Q3j.js} +1 -1
- package/assets/{add-user-lHPqrZLh.js → add-user-L2wD_b_T.js} +1 -1
- package/assets/ai-assistant/agent.es.js +3345 -3328
- package/assets/{app-BKhgReUT.js → app-CWlMJiPe.js} +2 -2
- package/assets/{architectureDiagram-5GKGNRK7-DcRt--3g.js → architectureDiagram-5GKGNRK7-u57qIB-M.js} +1 -1
- package/assets/{blockDiagram-I7D4REHJ-8_cCt-vW.js → blockDiagram-I7D4REHJ-DV90TjcV.js} +1 -1
- package/assets/{c4Diagram-7LVT6UL2-Bsn2OlKb.js → c4Diagram-7LVT6UL2-t5nM_yE6.js} +1 -1
- package/assets/{catalog-DfYJNiry.js → catalog-D6aEgpu7.js} +1 -1
- package/assets/channel-BObXBllO.js +1 -0
- package/assets/{chunk-2Q5K7J3B-BzrtylLu.js → chunk-2Q5K7J3B-Bvean9Oy.js} +1 -1
- package/assets/{chunk-5VM5RSS4-D7pDUki8.js → chunk-5VM5RSS4-C4yczpcm.js} +1 -1
- package/assets/{chunk-F27PBJKO-Bw8mEYY6.js → chunk-F27PBJKO-CZQTtsTa.js} +1 -1
- package/assets/{chunk-IMKFNOWR-nZKNEeNv.js → chunk-IMKFNOWR-CvCLehQX.js} +1 -1
- package/assets/{chunk-JWPE2WC7-DxUX2M-J.js → chunk-JWPE2WC7-BEsqzX-T.js} +1 -1
- package/assets/{chunk-POPQ4Y6H-Bgt0Kaqd.js → chunk-POPQ4Y6H-BPKiJml-.js} +1 -1
- package/assets/{chunk-SVP7TREG-DLigtJWk.js → chunk-SVP7TREG-BVkc4_Yf.js} +1 -1
- package/assets/{chunk-TICWLB2K-B5WjdD1M.js → chunk-TICWLB2K-nbzNG2Lg.js} +1 -1
- package/assets/{chunk-XXDRQBXY-BJS0Ht92.js → chunk-XXDRQBXY-BAn4BRVo.js} +1 -1
- package/assets/classDiagram-ZZMXUADV-Dyvh9xeB.js +1 -0
- package/assets/classDiagram-v2-VYDZK3BY-Dyvh9xeB.js +1 -0
- package/assets/controls/jsoneditor.es.js +5 -6
- package/assets/controls/toast-ui.es.js +3570 -3571
- package/assets/{cose-bilkent-JH36ORCC-Be1z_i9Q.js → cose-bilkent-JH36ORCC-DjIWkId6.js} +1 -1
- package/assets/{cynefin-OW5HDTMX-na8kWeny.js → cynefin-OW5HDTMX-DA3WSPz5.js} +1 -1
- package/assets/{cynefinDiagram-5FMLGOSQ-ql71XTsQ.js → cynefinDiagram-5FMLGOSQ-CctOa4fE.js} +1 -1
- package/assets/cytoscape.esm-BHa1VTXv.js +321 -0
- package/assets/{dagre-GXQ25YYZ-BuKFYbmi.js → dagre-GXQ25YYZ-BeP3E0b5.js} +1 -1
- package/assets/{dashboard-Drm_gp-G.js → dashboard-C0pXUDqP.js} +1 -1
- package/assets/{diagram-S7CK7UJ4-znl5Fq0J.js → diagram-S7CK7UJ4-B85fwkaf.js} +1 -1
- package/assets/{diagram-UQ7AKVKN-CRFVfrL1.js → diagram-UQ7AKVKN-CqkEko9N.js} +1 -1
- package/assets/{diagram-VSXAHHWV-CIVgZDJa.js → diagram-VSXAHHWV-x-PrtWHy.js} +1 -1
- package/assets/{diagram-VX7I27RA-DIQB8SES.js → diagram-VX7I27RA-BYJBRYa8.js} +1 -1
- package/assets/{diagram-Z3DM3KII-DeY6yMBN.js → diagram-Z3DM3KII-DCiL-xro.js} +1 -1
- package/assets/{docs-B6LIpITJ.js → docs-Db-NexCf.js} +1 -1
- package/assets/{ebnfDiagram-PWID7BFC-Im7jHJ-6.js → ebnfDiagram-PWID7BFC-CwM3RllY.js} +1 -1
- package/assets/{erDiagram-RLTQ6QDP-CCvI6JHH.js → erDiagram-RLTQ6QDP-D_h8KziD.js} +1 -1
- package/assets/{flowDiagram-HODETNUW-DgdTOUM1.js → flowDiagram-HODETNUW-DGimFqFm.js} +1 -1
- package/assets/{ganttDiagram-EL5Y4UJY-BZ5DzFSb.js → ganttDiagram-EL5Y4UJY-CJpR4o0I.js} +1 -1
- package/assets/{gitGraphDiagram-WWUBYQGX-CQklLXfY.js → gitGraphDiagram-WWUBYQGX-Dg_f7BHs.js} +1 -1
- package/assets/{history-CbgCLusU.js → history-DXiUYmwU.js} +1 -1
- package/assets/{infoDiagram-27XIBGKW-inaVWWG7.js → infoDiagram-27XIBGKW-wV9lWzkf.js} +1 -1
- package/assets/{init-user-DmWRf1Jr.js → init-user-pCW_Q05s.js} +1 -1
- package/assets/{ishikawaDiagram-5VMMS53U-R9uOXdb9.js → ishikawaDiagram-5VMMS53U-BsTDr38x.js} +1 -1
- package/assets/{journeyDiagram-3NMN7TZE-YhsaQCHu.js → journeyDiagram-3NMN7TZE-CNHbwqwc.js} +1 -1
- package/assets/{kanban-definition-UXKFOSKX-SFHx0aHd.js → kanban-definition-UXKFOSKX-CVhJsHlN.js} +1 -1
- package/assets/{layout-CryHDwUP.js → layout-BfAIponG.js} +1 -1
- package/assets/{list-CMYKENzO.js → list-DUvMtSpV.js} +1 -1
- package/assets/{login-inT0h68O.js → login-E_Y7wut5.js} +1 -1
- package/assets/manifest.json +268 -268
- package/assets/{media-manager-DLwgt3w-.js → media-manager-SrUV61oz.js} +1 -1
- package/assets/{mermaid.core-BJx2V7Fx.js → mermaid.core-dItKH28w.js} +5 -5
- package/assets/{mindmap-definition-YA3MSWOX-DavgP5bX.js → mindmap-definition-YA3MSWOX-CeNd0CHT.js} +1 -1
- package/assets/{module-Cd8HVyqp.js → module-BLZcWhbK.js} +1 -1
- package/assets/{notification-NHcn4uVC.js → notification-Dud_cS95.js} +1 -1
- package/assets/{pegDiagram-XKGWAZYB-yFW3IMW-.js → pegDiagram-XKGWAZYB-XkpCeLx7.js} +1 -1
- package/assets/{pieDiagram-E7YTZNPT-CQTyXz50.js → pieDiagram-E7YTZNPT-IfctYNg6.js} +1 -1
- package/assets/{quadrantDiagram-AXDQQJYC-Cqjg5HSm.js → quadrantDiagram-AXDQQJYC-Dl71kVWH.js} +1 -1
- package/assets/{railroadDiagram-O6MQD6OU-DzL2XDLc.js → railroadDiagram-O6MQD6OU-DFZCwxEi.js} +1 -1
- package/assets/{register-BrZOgrIT.js → register-CLXNA3RH.js} +1 -1
- package/assets/{requirementDiagram-BXWQKSXE-CWcLe5E-.js → requirementDiagram-BXWQKSXE-gwMr2hhN.js} +1 -1
- package/assets/{ru-DqbXrFdY.js → ru-BuRkfrV3.js} +1 -1
- package/assets/{sankeyDiagram-P5KCCOFB-BzTZcPVf.js → sankeyDiagram-P5KCCOFB-D4m9TUBM.js} +1 -1
- package/assets/{sequenceDiagram-WJ2MYXX4-DM48lXLE.js → sequenceDiagram-WJ2MYXX4-JrZmoS_N.js} +1 -1
- package/assets/{sizeCapture-INFHLROL-D7cx9va2.js → sizeCapture-INFHLROL-Bi7VDSTt.js} +1 -1
- package/assets/{stateDiagram-D77RDMKH-CUReM6ha.js → stateDiagram-D77RDMKH-CoOTX1h8.js} +1 -1
- package/assets/stateDiagram-v2-MP3YSRHH-DSV0uD3M.js +1 -0
- package/assets/{swimlanes-42K2YHIH-DEqEyhLN.js → swimlanes-42K2YHIH-CgtKaw_1.js} +1 -1
- package/assets/swimlanesDiagram-VR7AAH4N-tGoQkrWA.js +8 -0
- package/assets/{timeline-definition-24CTP7MA-_OQxzNu9.js → timeline-definition-24CTP7MA-DrSuUziH.js} +1 -1
- package/assets/{use-appearance-BfSu2Tjm.js → use-appearance-CSP6Ml4F.js} +1 -1
- package/assets/{user-filters-list-LqHail28.js → user-filters-list-Cv2Z3Fwm.js} +1 -1
- package/assets/{vennDiagram-4TSXK5OY-wUfSnIxp.js → vennDiagram-4TSXK5OY-BIeLKAIy.js} +1 -1
- package/assets/{wardleyDiagram-VM6X3IG4-BPcd3HO7.js → wardleyDiagram-VM6X3IG4-CwmxxXr9.js} +1 -1
- package/assets/{welcome-XTbUvCzA.js → welcome-CXTRhMo9.js} +1 -1
- package/assets/{with-app-layout-CTv_hHug.js → with-app-layout-DVk7VpSG.js} +22 -22
- package/assets/{xychartDiagram-S5SC5T6Z-DBXGC8lX.js → xychartDiagram-S5SC5T6Z-DCx2Vin2.js} +1 -1
- package/interfaces/adminpanelConfig.d.ts +7 -0
- package/lib/app-manager/ContextHandler.d.ts +12 -1
- package/lib/app-manager/ContextHandler.js +9 -0
- package/package.json +1 -1
- package/system/bindInertia.js +5 -0
- package/translations/ru.json +1 -0
- package/assets/channel-0VXWsV6U.js +0 -1
- package/assets/classDiagram-ZZMXUADV-DgvmCbKR.js +0 -1
- package/assets/classDiagram-v2-VYDZK3BY-DgvmCbKR.js +0 -1
- package/assets/cytoscape.esm-BDkkwuE4.js +0 -321
- package/assets/stateDiagram-v2-MP3YSRHH-UNjCyT1j.js +0 -1
- package/assets/swimlanesDiagram-VR7AAH4N-Dh-s4bKd.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./media-manager-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./media-manager-SrUV61oz.js","./debounce-B3mXI_sx.js","./isObject-DL-BuaBl.js","./toNumber-DZb-r9sy.js","./media-manager-BZPjl98I.css","./add-group-BOsQ0Q3j.js","./with-app-layout-DVk7VpSG.js","./use-appearance-CSP6Ml4F.js","./add-user-L2wD_b_T.js","./add-CqSZIEWV.js","./catalog-D6aEgpu7.js","./catalog-D4n6dpGl.css","./dashboard-C0pXUDqP.js","./dashboard-BOltB2Hq.css","./docs-Db-NexCf.js","./history-DXiUYmwU.js","./ru-BuRkfrV3.js","./init-user-pCW_Q05s.js","./list-DUvMtSpV.js","./login-E_Y7wut5.js","./module-BLZcWhbK.js","./notification-Dud_cS95.js","./register-CLXNA3RH.js","./user-filters-list-Cv2Z3Fwm.js","./welcome-CXTRhMo9.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var PH=e=>{throw TypeError(e)};var RH=(e,t,a)=>t.has(e)||PH("Cannot "+a);var tn=(e,t,a)=>(RH(e,t,"read from private field"),a?a.call(e):t.get(e)),DH=(e,t,a)=>t.has(e)?PH("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),XP=(e,t,a,r)=>(RH(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a);function qK(e,t){for(var a=0;a<t.length;a++){const r=t[a];if(typeof r!="string"&&!Array.isArray(r)){for(const c in r)if(c!=="default"&&!(c in e)){const s=Object.getOwnPropertyDescriptor(r,c);s&&Object.defineProperty(e,c,s.get?s:{enumerable:!0,get:()=>r[c]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const zK="modulepreload",TK=function(e,t){return new URL(e,t).href},qH={},cn=function(t,a,r){let c=Promise.resolve();if(a&&a.length>0){let p=function(b){return Promise.all(b.map(k=>Promise.resolve(k).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const u=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),y=h?.nonce||h?.getAttribute("nonce");c=p(a.map(b=>{if(b=TK(b,r),b in qH)return;qH[b]=!0;const k=b.endsWith(".css"),x=k?'[rel="stylesheet"]':"";if(r)for(let _=u.length-1;_>=0;_--){const C=u[_];if(C.href===b&&(!k||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${x}`))return;const M=document.createElement("link");if(M.rel=k?"stylesheet":zK,k||(M.as="script"),M.crossOrigin="",M.href=b,y&&M.setAttribute("nonce",y),document.head.appendChild(M),k)return new Promise((_,C)=>{M.addEventListener("load",_),M.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${b}`)))})}))}function s(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return c.then(u=>{for(const h of u||[])h.status==="rejected"&&s(h.reason);return t().catch(s)})};var fDe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function UB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yDe(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var a=function r(){var c=!1;try{c=this instanceof r}catch{}return c?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,c.get?c:{enumerable:!0,get:function(){return e[r]}})}),a}var KP={exports:{}},gu={};var zH;function $K(){if(zH)return gu;zH=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(r,c,s){var u=null;if(s!==void 0&&(u=""+s),c.key!==void 0&&(u=""+c.key),"key"in c){s={};for(var h in c)h!=="key"&&(s[h]=c[h])}else s=c;return c=s.ref,{$$typeof:e,type:r,key:u,ref:c!==void 0?c:null,props:s}}return gu.Fragment=t,gu.jsx=a,gu.jsxs=a,gu}var TH;function OK(){return TH||(TH=1,KP.exports=$K()),KP.exports}var g=OK();const $H=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function HK(e,t,{signal:a,edges:r}={}){let c,s=null;const u=r!=null&&r.includes("leading"),h=r==null||r.includes("trailing"),y=()=>{s!==null&&(e.apply(c,s),c=void 0,s=null)},p=()=>{h&&y(),M()};let b=null;const k=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},t)},x=()=>{b!==null&&(clearTimeout(b),b=null)},M=()=>{x(),c=void 0,s=null},_=()=>{y()},C=function(...S){if(a?.aborted)return;c=this,s=S;const L=b==null;k(),u&&L&&y()};return C.schedule=k,C.cancel=M,C.flush=_,a?.addEventListener("abort",M,{once:!0}),C}function GB(){}function WA(e){return e==null||typeof e!="object"&&typeof e!="function"}function _D(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uu(e){return typeof $H.Buffer<"u"&&$H.Buffer.isBuffer(e)}function Gu(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Zu(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const SD="[object RegExp]",YA="[object String]",XA="[object Number]",KA="[object Boolean]",CD="[object Arguments]",LD="[object Symbol]",ND="[object Date]",ID="[object Map]",AD="[object Set]",jD="[object Array]",VK="[object Function]",ED="[object ArrayBuffer]",Eu="[object Object]",BK="[object Error]",PD="[object DataView]",RD="[object Uint8Array]",DD="[object Uint8ClampedArray]",qD="[object Uint16Array]",zD="[object Uint32Array]",FK="[object BigUint64Array]",TD="[object Int8Array]",$D="[object Int16Array]",OD="[object Int32Array]",UK="[object BigInt64Array]",HD="[object Float32Array]",VD="[object Float64Array]";function nd(e,t,a,r=new Map,c){if(WA(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const s=new Array(e.length);r.set(e,s);for(let u=0;u<e.length;u++)s[u]=nd(e[u],u,a,r);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;r.set(e,s);for(const[u,h]of e)s.set(u,nd(h,u,a,r));return s}if(e instanceof Set){const s=new Set;r.set(e,s);for(const u of e)s.add(nd(u,void 0,a,r));return s}if(Uu(e))return e.subarray();if(_D(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,s);for(let u=0;u<e.length;u++)s[u]=nd(e[u],u,a,r);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,s),lr(s,e,a,r),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return r.set(e,s),lr(s,e,a,r),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return r.set(e,s),lr(s,e,a,r),s}if(e instanceof Error){const s=structuredClone(e);return r.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,lr(s,e,a,r),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return r.set(e,s),lr(s,e,a,r),s}if(e instanceof Number){const s=new Number(e.valueOf());return r.set(e,s),lr(s,e,a,r),s}if(e instanceof String){const s=new String(e.valueOf());return r.set(e,s),lr(s,e,a,r),s}if(typeof e=="object"&&GK(e)){const s=Object.create(Object.getPrototypeOf(e));return r.set(e,s),lr(s,e,a,r),s}return e}function lr(e,t,a=e,r,c){const s=[...Object.keys(t),...Gu(t)];for(let u=0;u<s.length;u++){const h=s[u],y=Object.getOwnPropertyDescriptor(e,h);(y==null||y.writable)&&(e[h]=nd(t[h],h,a,r))}}function GK(e){switch(Zu(e)){case CD:case jD:case ED:case PD:case KA:case ND:case HD:case VD:case TD:case $D:case OD:case ID:case XA:case Eu:case SD:case AD:case YA:case LD:case RD:case DD:case qD:case zD:return!0;default:return!1}}function dt(e){return nd(e,void 0,e,new Map)}function OH(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function bA(e){return e==="__proto__"}function QP(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){var t;const r=e[Symbol.toStringTag];return r==null||!(!((t=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))===null||t===void 0)&&t.writable)?!1:e.toString()===`[object ${r}]`}let a=e;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(e)===a}function ZB(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ZK(e,t,a){return Nu(e,t,void 0,void 0,void 0,void 0,a)}function Nu(e,t,a,r,c,s,u){const h=u(e,t,a,r,c,s);if(h!==void 0)return h;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Pu(e,t,s,u)}return Pu(e,t,s,u)}function Pu(e,t,a,r){if(Object.is(e,t))return!0;let c=Zu(e),s=Zu(t);if(c==="[object Arguments]"&&(c=Eu),s==="[object Arguments]"&&(s=Eu),c!==s)return!1;switch(c){case YA:return e.toString()===t.toString();case XA:{const y=e.valueOf(),p=t.valueOf();return ZB(y,p)}case KA:case ND:case LD:return Object.is(e.valueOf(),t.valueOf());case SD:return e.source===t.source&&e.flags===t.flags;case VK:return e===t}a=a??new Map;const u=a.get(e),h=a.get(t);if(u!=null&&h!=null)return u===t;a.set(e,t),a.set(t,e);try{switch(c){case ID:if(e.size!==t.size)return!1;for(const[y,p]of e.entries())if(!t.has(y)||!Nu(p,t.get(y),y,e,t,a,r))return!1;return!0;case AD:{if(e.size!==t.size)return!1;const y=Array.from(e.values()),p=Array.from(t.values());for(let b=0;b<y.length;b++){const k=y[b],x=p.findIndex(M=>Nu(k,M,void 0,e,t,a,r));if(x===-1)return!1;p.splice(x,1)}return!0}case jD:case RD:case DD:case qD:case zD:case FK:case TD:case $D:case OD:case UK:case HD:case VD:if(Uu(e)!==Uu(t)||e.length!==t.length)return!1;for(let y=0;y<e.length;y++)if(!Nu(e[y],t[y],y,e,t,a,r))return!1;return!0;case ED:return e.byteLength!==t.byteLength?!1:Pu(new Uint8Array(e),new Uint8Array(t),a,r);case PD:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Pu(new Uint8Array(e),new Uint8Array(t),a,r);case BK:return e.name===t.name&&e.message===t.message;case Eu:{if(!(Pu(e.constructor,t.constructor,a,r)||OH(e)&&OH(t)))return!1;const y=[...Object.keys(e),...Gu(e)],p=[...Object.keys(t),...Gu(t)];if(y.length!==p.length)return!1;for(let b=0;b<y.length;b++){const k=y[b],x=e[k];if(!Object.hasOwn(t,k))return!1;const M=t[k];if(!Nu(x,M,k,e,t,a,r))return!1}return!0}default:return!1}}finally{a.delete(e),a.delete(t)}}function _a(e,t){return ZK(e,t,GB)}function WK(e){return Number.isSafeInteger(e)&&e>=0}const YK={"&":"&","<":"<",">":">",'"':""","'":"'"};function XK(e){return e.replace(/[&<>"']/g,t=>YK[t])}function KK(e){return e!=null&&typeof e!="function"&&WK(e.length)}function WB(e){return typeof e=="symbol"||e instanceof Symbol}function YB(e){if(typeof e=="string")return e;if(Array.isArray(e)){let a="";for(let r=0;r<e.length;r++)r>0&&(a+=","),a+=YB(e[r]);return a}if(WB(e))return e.toString();const t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function XB(e){return e==null?"":YB(e)}function QA(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is(e==null||(t=e.valueOf)===null||t===void 0?void 0:t.call(e),-0)?"-0":String(e)}function dd(e){if(Array.isArray(e))return e.map(QA);if(typeof e=="symbol")return[e];e=XB(e);const t=[],a=e.length;if(a===0)return t;let r=0,c="",s="",u=!1,h=!1;const y=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");r<a;){const p=e[r];if(s)p==="\\"&&r+1<a?(r++,c+=e[r]):p===s?s="":c+=p;else if(u)if(p==='"'||p==="'")s=p,h=!0;else if(p==="]"){if(u=!1,!h&&c.includes(".")&&!y.test(c)){const b=c.split(".");for(let k=0;k<b.length;k++)b[k]!==""&&t.push(b[k])}else t.push(c);c=""}else c+=p;else if(p==="[")u=!0,h=!1,c&&(t.push(c),c="");else if(p==="."){c&&(t.push(c),c="");const b=e[r+1];(b===void 0||b===".")&&t.push("")}else c+=p;r++}return c&&t.push(c),t}const QK=Object.prototype.hasOwnProperty;function ud(e,t){return QK.call(e,t)}const JK=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function KB(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:JK.test(e);default:return!1}}function at(e,t,a){if(e==null)return a;switch(typeof t){case"string":{if(bA(t))return a;const r=e[t];return r===void 0?KB(t)&&!ud(e,t)?at(e,dd(t),a):a:r}case"number":case"symbol":{typeof t=="number"&&(t=QA(t));const r=e[t];return r===void 0?a:r}default:{if(Array.isArray(t))return eQ(e,t,a);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),bA(t))return a;const r=e[t];return r===void 0?a:r}}}function eQ(e,t,a){if(t.length===0)return a;let r=e;for(let c=0;c<t.length;c++){if(r==null||bA(t[c]))return a;r=r[t[c]]}return r===void 0?a:r}function HH(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function tQ(e){return Uu(e)}function ch(e){return _D(e)}function nQ(e,t){return ad(e,void 0,e,new Map)}function ad(e,t,a,r,c){if(WA(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const u=new Array(e.length);r.set(e,u);for(let h=0;h<e.length;h++)u[h]=ad(e[h],h,a,r);return ud(e,"index")&&(u.index=e.index),ud(e,"input")&&(u.input=e.input),u}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const u=new RegExp(e.source,e.flags);return u.lastIndex=e.lastIndex,u}if(e instanceof Map){const u=new Map;return r.set(e,u),e.forEach((h,y)=>{u.set(y,ad(h,y,a,r))}),u}if(e instanceof Set){const u=new Set;return r.set(e,u),e.forEach(h=>{u.add(ad(h,void 0,a,r))}),u}if(tQ(e))return e.subarray();if(ch(e)){const u=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,u);for(let h=0;h<e.length;h++)u[h]=ad(e[h],h,a,r);return u}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const u=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,u),O1(u,e,a,r),u}if(typeof File<"u"&&e instanceof File){const u=new File([e],e.name,{type:e.type});return r.set(e,u),O1(u,e,a,r),u}if(typeof Blob<"u"&&e instanceof Blob){const u=new Blob([e],{type:e.type});return r.set(e,u),O1(u,e,a,r),u}const s=Zu(e);if(s==="[object Error]")return e===a?{}:e;switch(s){case XA:case YA:case KA:{const u=new e.constructor(e.valueOf());return r.set(e,u),O1(u,e,a,r),u}case CD:{const u={};return r.set(e,u),O1(u,e,a,r),u.length=e.length,u[Symbol.iterator]=e[Symbol.iterator],u}}if(typeof e=="object"&&aQ(s)){const u=s==="[object Object]"&&typeof e.constructor!="function"?{}:Object.create(Object.getPrototypeOf(e));return r.set(e,u),O1(u,e,a,r),u}return e}function O1(e,t,a,r,c){const s=[...Object.keys(t),...Gu(t)];for(let u=0;u<s.length;u++){const h=s[u],y=Object.getOwnPropertyDescriptor(e,h);(y==null||y.writable)&&(e[h]=ad(t[h],h,a,r))}}function aQ(e){switch(e){case CD:case jD:case ED:case PD:case KA:case ND:case HD:case VD:case TD:case $D:case OD:case ID:case XA:case Eu:case SD:case AD:case YA:case LD:case RD:case DD:case qD:case zD:return!0;default:return!1}}function VH(e){return nQ(e)}function TR(e){return e!==null&&typeof e=="object"&&Zu(e)==="[object Arguments]"}const oQ=/^(?:0|[1-9]\d*)$/;function QB(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return oQ.test(e)}}function $R(e,t){let a;if(Array.isArray(t)?a=t:typeof t=="string"&&KB(t)&&!(t in Object(e))?a=dd(t):a=[t],a.length===0)return!1;let r=e;for(let c=0;c<a.length;c++){const s=QA(a[c]);if((r==null||!ud(r,s))&&!((Array.isArray(r)||TR(r))&&QB(s)&&Number(s)<r.length))return!1;r=r[s]}return!0}function OR(e){return typeof e=="object"&&e!==null}function rQ(e){return OR(e)&&KK(e)}const iQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cQ=/^\w*$/;function sQ(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||WB(e)?!0:typeof e=="string"&&(cQ.test(e)||!iQ.test(e))||t!=null&&ud(t,e)}function lQ(e){return e==="__proto__"||e==="constructor"||e==="prototype"}const dQ=(e,t,a)=>{const r=e[t];(!(ud(e,t)&&ZB(r,a))||a===void 0&&!(t in e))&&(e[t]=a)};function uQ(e,t,a,r){if(e==null&&!HH(e))return e;let c;sQ(t,e)?c=[t]:Array.isArray(t)?c=t:c=dd(t);const s=a(at(e,c));let u=e;for(let h=0;h<c.length&&u!=null;h++){const y=QA(c[h]);if(lQ(y))return e;let p;if(h===c.length-1)p=s;else{const b=u[y],k=r?.(b,y,e);p=k!==void 0?k:HH(b)?b:QB(c[h+1])?[]:{}}dQ(u,y,p),u=u[y]}return e}function Tn(e,t,a){return uQ(e,t,()=>a,()=>{})}function hQ(e,t=0,a={}){typeof a!="object"&&(a={});const{leading:r=!1,trailing:c=!0,maxWait:s}=a,u=Array(2);r&&(u[0]="leading"),c&&(u[1]="trailing");let h,y=null;const p=HK(function(...x){h=e.apply(this,x),y=null},t,{edges:u}),b=function(...x){return s!=null&&(y===null&&(y=Date.now()),Date.now()-y>=s)?((r||c)&&(h=e.apply(this,x)),y=Date.now(),p.cancel(),p.schedule(),h):(p.apply(this,x),h)},k=()=>(p.flush(),h);return b.cancel=p.cancel,b.flush=k,b}function pQ(e){if(WA(e))return e;if(Array.isArray(e)||_D(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const a=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new a(e);if(e instanceof RegExp){const r=new a(e);return r.lastIndex=e.lastIndex,r}if(e instanceof DataView)return new a(e.buffer.slice(0));if(e instanceof Error){let r;return typeof AggregateError<"u"&&e instanceof AggregateError?r=new a(e.errors,e.message,{cause:e.cause}):r=new a(e.message,{cause:e.cause}),r.stack=e.stack,Object.assign(r,e),r}if(typeof File<"u"&&e instanceof File)return new a([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e=="object"){const r=Object.create(t);return Object.assign(r,e)}return e}function fQ(e,...t){const a=t.slice(0,-1),r=t[t.length-1];let c=e;for(let s=0;s<a.length;s++){const u=a[s];c=sh(c,u,r,new Map)}return c}function sh(e,t,a,r){if(WA(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(r.has(t))return pQ(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)s in t||(t[s]=void 0)}const c=[...Object.keys(t),...Gu(t)];for(let s=0;s<c.length;s++){const u=c[s];if(bA(u))continue;let h=t[u],y=e[u];if(TR(h)&&(h=Object.assign({},h)),TR(y)&&(y=Object.assign({},y)),Uu(h)&&(h=VH(h)),Array.isArray(h))if(Array.isArray(y)){const b=[],k=Reflect.ownKeys(y);for(let x=0;x<k.length;x++){const M=k[x];b[M]=y[M]}y=b}else if(rQ(y)){const b=[];for(let k=0;k<y.length;k++)b[k]=y[k];y=b}else y=[];const p=a(y,h,u,e,t,r);p!==void 0?e[u]=p:Array.isArray(h)||OR(y)&&OR(h)&&(QP(y)||QP(h)||ch(y)||ch(h))?e[u]=sh(y,h,a,r):y==null&&QP(h)?e[u]=sh({},h,a,r):y==null&&ch(h)?e[u]=VH(h):(y===void 0||h!==void 0)&&(e[u]=h)}return e}function xA(e,...t){return fQ(e,...t,GB)}function BH(e){return XK(XB(e))}const BD=e=>typeof File<"u"&&e instanceof File||e instanceof Blob||typeof FileList<"u"&&e instanceof FileList&&e.length>0,JA=e=>e instanceof FormData?!0:BD(e)||typeof e=="object"&&e!==null&&Object.values(e).some(t=>JA(t));let MA=class extends Error{response;constructor(t){super(`HTTP error ${t.status}`),this.name="HttpResponseError",this.response=t}},JB=class extends Error{constructor(t="Request was cancelled"){super(t),this.name="HttpCancelledError"}},yQ=class extends Error{constructor(t="Network error"){super(t),this.name="HttpNetworkError"}};function mQ(e){const t=new URLSearchParams;return Object.entries(e).forEach(([a,r])=>{r!=null&&(Array.isArray(r)?r.forEach(c=>t.append(`${a}[]`,String(c))):typeof r=="object"?t.append(a,JSON.stringify(r)):t.append(a,String(r)))}),t.toString()}function gQ(e,t,a){if(t&&!e.startsWith("http://")&&!e.startsWith("https://")&&(e=t.replace(/\/$/,"")+"/"+e.replace(/^\//,"")),a&&Object.keys(a).length>0){const r=mQ(a);r&&(e+=(e.includes("?")?"&":"?")+r)}return e}function kQ(){return typeof window>"u"?null:window.axios?.defaults?.headers?.common?.["X-Requested-With"]??null}function eF(e,t=new FormData,a=null){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&tF(t,a?`${a}[${r}]`:r,e[r]);return t}function tF(e,t,a){if(Array.isArray(a))return a.forEach((r,c)=>tF(e,`${t}[${c}]`,r));if(a instanceof Date)return e.append(t,a.toISOString());if(typeof File<"u"&&a instanceof File)return e.append(t,a,a.name);if(a instanceof Blob)return e.append(t,a);if(typeof a=="boolean")return e.append(t,a?"1":"0");if(typeof a=="string")return e.append(t,a);if(typeof a=="number")return e.append(t,`${a}`);if(typeof a=="bigint")return e.append(t,a.toString());if(a==null)return e.append(t,"");eF(a,e,t)}function vQ(e,t,a){if(e!=null)return e instanceof FormData?e:typeof e=="object"&&JA(e)?eF(e):typeof e=="object"||t["Content-Type"]?.includes("application/json")?a(e):String(e)}function bQ(e){const t={};return e.forEach((a,r)=>{t[r.toLowerCase()]=a}),t}function xQ(e={}){let t=e.xsrfCookieName??"XSRF-TOKEN",a=e.xsrfHeaderName??"X-XSRF-TOKEN",r=e.serializer??JSON.stringify;function c(){if(typeof document>"u")return null;const s=document.cookie.match(new RegExp("(^|;\\s*)"+t+"=([^;]*)"));return s?decodeURIComponent(s[2]):null}return{setXsrfCookieName(s){t=s},setXsrfHeaderName(s){a=s},setSerializer(s){r=s},async request(s){const u=gQ(s.url,s.baseURL,s.params),h=s.method.toUpperCase(),y={},p=kQ();p&&(y["X-Requested-With"]=p),s.data!==void 0&&!["GET","DELETE"].includes(h)&&!(s.data instanceof FormData)&&!JA(s.data)&&(y["Content-Type"]="application/json"),s.headers&&Object.entries(s.headers).forEach(([C,S])=>{S!==void 0&&(y[C]=String(S))});const b=c();b&&!["GET","HEAD","OPTIONS"].includes(h)&&(y[a]=b);let k=s.signal,x;const M=s.timeout??3e4;if(M>0&&!k){const C=new AbortController;k=C.signal,x=setTimeout(()=>C.abort(),M)}const _=["GET","DELETE"].includes(h)?void 0:vQ(s.data,y,r);_ instanceof FormData&&delete y["Content-Type"];try{const C=await fetch(u,{method:h,headers:y,body:_,signal:k,credentials:s.credentials??"same-origin"});x&&clearTimeout(x);let S;C.headers.get("content-type")?.includes("application/json")?S=await C.json():S=await C.text();const A={status:C.status,data:S,headers:bQ(C.headers)};if(!C.ok)throw new MA(A);return A}catch(C){throw x&&clearTimeout(x),C instanceof MA?C:C instanceof DOMException&&C.name==="AbortError"?new JB:C instanceof TypeError?new yQ(C.message):C}}}}const lh=xQ();let FD=lh,UD,nF,aF="same-origin",oF=e=>`${e.method}:${e.baseURL??UD??""}${e.url}`,rF=e=>e.status===204&&e.headers["precognition-success"]==="true";const wA={},Ut={get:(e,t={},a={})=>V1(H1("get",e,t,a)),post:(e,t={},a={})=>V1(H1("post",e,t,a)),patch:(e,t={},a={})=>V1(H1("patch",e,t,a)),put:(e,t={},a={})=>V1(H1("put",e,t,a)),delete:(e,t={},a={})=>V1(H1("delete",e,t,a)),query:(e,t={},a={})=>V1(H1("query",e,t,a)),useHttpClient(e){return FD=e,Ut},withBaseURL(e){return UD=e,Ut},withTimeout(e){return nF=e,Ut},withCredentials(e){return aF=typeof e=="string"?e:e?"include":"omit",Ut},fingerprintRequestsUsing(e){return oF=e===null?()=>null:e,Ut},determineSuccessUsing(e){return rF=e,Ut},withXsrfCookieName(e){return lh.setXsrfCookieName(e),Ut},withXsrfHeaderName(e){return lh.setXsrfHeaderName(e),Ut},withSerializer(e){return lh.setSerializer(e),Ut}},H1=(e,t,a,r)=>({url:t,method:e,...r,...["get","delete"].includes(e)?{params:xA({},a,r?.params)}:{data:xA({},a,r?.data)}}),V1=(e={})=>{const t=[MQ,_Q,SQ].reduce((a,r)=>r(a),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),FD.request({method:t.method,url:t.url,baseURL:t.baseURL??UD,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:aF}).then(async a=>{t.precognitive&&FH(a);const r=a.status;let c=a;return t.precognitive&&t.onPrecognitionSuccess&&rF(a)&&(c=await Promise.resolve(t.onPrecognitionSuccess(a)??c)),t.onSuccess&&wQ(r)&&(c=await Promise.resolve(t.onSuccess(c)??c)),(UH(t,r)??(u=>u))(c)??c},a=>{if(CQ(a))return Promise.reject(a);const r=a;return t.precognitive&&FH(r.response),(UH(t,r.response.status)??((s,u)=>Promise.reject(u)))(r.response,r)}).finally(t.onFinish??(()=>null)))},MQ=e=>{const t=e.only??e.validate;return{...e,timeout:e.timeout??nF,precognitive:e.precognitive!==!1,fingerprint:typeof e.fingerprint>"u"?oF(e,FD):e.fingerprint,headers:{...e.headers,Accept:"application/json","Content-Type":LQ(e),...e.precognitive!==!1?{Precognition:!0}:{},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},wQ=e=>e>=200&&e<300,_Q=e=>(typeof e.fingerprint!="string"||(wA[e.fingerprint]?.abort(),delete wA[e.fingerprint]),e),SQ=e=>typeof e.fingerprint!="string"||e.signal||!e.precognitive?e:(wA[e.fingerprint]=new AbortController,{...e,signal:wA[e.fingerprint].signal}),FH=e=>{if(e.headers?.precognition!=="true")throw Error("Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.")},CQ=e=>!(e instanceof MA)||typeof e.response?.status!="number",UH=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],LQ=e=>e.headers?.["Content-Type"]??e.headers?.["Content-type"]??e.headers?.["content-type"]??(JA(e.data)?"multipart/form-data":"application/json"),NQ=(e,t)=>{if(!e.includes("*"))return[e];const a=e.split(".");let r=[""];for(const c of a)if(c==="*"){const s=[];for(const u of r){const h=u?at(t,u):t;if(Array.isArray(h))for(let y=0;y<h.length;y++)s.push(u?`${u}.${y}`:String(y));else if(h!==null&&typeof h=="object")for(const y of Object.keys(h))s.push(u?`${u}.${y}`:y)}r=s}else r=r.map(s=>s?`${s}.${c}`:c);return r},IQ=(e,t)=>t.includes("*")?new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,"[^.]+")+"$").test(e):e===t,GH=(e,t)=>Object.fromEntries(Object.entries(e).filter(([a])=>!t.some(r=>IQ(a,r)))),AQ=(e,t={})=>{const a={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]};let r=!1,c=!1;const s=F=>F!==c?(c=F,a.validatingChanged):[];let u=[];const h=F=>{const G=[...new Set(F)];return u.length!==G.length||!G.every(X=>u.includes(X))?(u=G,a.validatedChanged):[]},y=()=>u.filter(F=>typeof k[F]>"u");let p=[];const b=F=>{const G=[...new Set(F)];return p.length!==G.length||!G.every(X=>p.includes(X))?(p=G,a.touchedChanged):[]};let k={};const x=F=>{const G=jQ(F);return _a(k,G)?[]:(k=G,a.errorsChanged)},M=F=>{const G={...k};return delete G[Ru(F)],x(G)},_=()=>Object.keys(k).length>0;let C=1500;const S=F=>{C=F,R.cancel(),R=T()};let L=t,A=null,N=[],j=null;const T=()=>hQ(F=>{e({get:(G,X={},ae={})=>Ut.get(G,ee(X),q(ae,F,X)),post:(G,X={},ae={})=>Ut.post(G,ee(X),q(ae,F,X)),patch:(G,X={},ae={})=>Ut.patch(G,ee(X),q(ae,F,X)),put:(G,X={},ae={})=>Ut.put(G,ee(X),q(ae,F,X)),delete:(G,X={},ae={})=>Ut.delete(G,ee(X),q(ae,F,X)),query:(G,X={},ae={})=>Ut.query(G,ee(X),q(ae,F,X))}).catch(G=>G instanceof JB||G instanceof MA&&G.response?.status===422?null:Promise.reject(G))},C,{leading:!0,trailing:!0});let R=T();const q=(F,G,X={})=>{const ae={...F,...G},he=Array.from(ae.only??ae.validate??p);return{...G,...xA({},F,G),only:he,timeout:ae.timeout??5e3,onValidationError:(P,E)=>([...h([...u,...he]),...x(xA(GH({...k},he),P.data.errors))].forEach(O=>O()),ae.onValidationError?ae.onValidationError(P,E):Promise.reject(E)),onSuccess:P=>(h([...u,...he]).forEach(E=>E()),ae.onSuccess?ae.onSuccess(P):P),onPrecognitionSuccess:P=>([...h([...u,...he]),...x(GH({...k},he))].forEach(E=>E()),ae.onPrecognitionSuccess?ae.onPrecognitionSuccess(P):P),onBefore:()=>{const P=p.some(Y=>Y.includes("*")),E=P?[...new Set(p.flatMap(Y=>NQ(Y,X)))]:p;return ae.onBeforeValidation&&ae.onBeforeValidation({data:X,touched:E},{data:L,touched:N})===!1||(ae.onBefore||(()=>!0))()===!1?!1:(P&&b(E).forEach(Y=>Y()),j=p,A=X,!0)},onStart:()=>{s(!0).forEach(P=>P()),(ae.onStart??(()=>null))()},onFinish:()=>{s(!1).forEach(P=>P()),N=j,L=A,j=A=null,(ae.onFinish??(()=>null))()}}},$=(F,G,X)=>{if(typeof F>"u"){const ae=Array.from(X?.only??X?.validate??[]);b([...p,...ae]).forEach(he=>he()),R(X??{});return}if(BD(G)&&!r){console.warn('Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.');return}F=Ru(F),(F.includes("*")||at(L,F)!==G)&&(b([F,...p]).forEach(ae=>ae()),R(X??{}))},ee=F=>r===!1?HR(F):F,re={touched:()=>p,validate(F,G,X){return typeof F=="object"&&!("target"in F)&&(X=F,F=G=void 0),$(F,G,X),re},touch(F){const G=Array.isArray(F)?F:[Ru(F)];return b([...p,...G]).forEach(X=>X()),re},validating:()=>c,valid:y,errors:()=>k,hasErrors:_,setErrors(F){return x(F).forEach(G=>G()),re},forgetError(F){return M(F).forEach(G=>G()),re},defaults(F){return t=F,L=F,re},reset(...F){if(F.length===0)b([]).forEach(G=>G());else{const G=[...p];F.forEach(X=>{G.includes(X)&&G.splice(G.indexOf(X),1),Tn(L,X,at(t,X))}),b(G).forEach(X=>X())}return re},setTimeout(F){return S(F),re},on(F,G){return a[F].push(G),re},validateFiles(){return r=!0,re},withoutFileValidation(){return r=!1,re}};return re},iF=e=>Object.keys(e).reduce((t,a)=>({...t,[a]:Array.isArray(e[a])?e[a][0]:e[a]}),{}),jQ=e=>Object.keys(e).reduce((t,a)=>({...t,[a]:typeof e[a]=="string"?[e[a]]:e[a]}),{}),Ru=e=>typeof e!="string"?e.target.name:e,HR=e=>{const t={...e};return Object.keys(t).forEach(a=>{const r=t[a];if(r!==null){if(BD(r)){delete t[a];return}if(Array.isArray(r)){t[a]=Object.values(HR({...r}));return}if(typeof r=="object"){t[a]=HR(t[a]);return}}}),t};var EQ=class{config={};defaults;constructor(e){this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return $R(this.config,e)?at(this.config,e):at(this.defaults,e)}set(e,t){typeof e=="string"?Tn(this.config,e,t):Object.entries(e).forEach(([a,r])=>{Tn(this.config,a,r)})}},br=new EQ({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function Wu(e,t){let a;const r=function(...c){clearTimeout(a),a=setTimeout(()=>e.apply(this,c),t)};return r.cancel=()=>clearTimeout(a),r}function ln(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var ZH=e=>ln("before",{cancelable:!0,detail:{visit:e}}),PQ=(e,{page:t,visitId:a}={})=>ln("error",{detail:{errors:e,page:t,visitId:a}}),RQ=e=>ln("networkError",{cancelable:!0,detail:{error:e}}),DQ=e=>ln("finish",{detail:{visit:e}}),WH=e=>ln("httpException",{cancelable:!0,detail:{response:e}}),qQ=e=>ln("beforeUpdate",{detail:{page:e}}),_A=(e,{type:t,cached:a=!1,visitId:r})=>ln("navigate",{detail:{page:e,type:t,cached:a,visitId:r}}),zQ=(e,{replace:t,visitId:a})=>ln("clientVisit",{detail:{page:e,replace:t,visitId:a}}),TQ=e=>ln("progress",{detail:{progress:e}}),$Q=e=>ln("start",{detail:{visit:e}}),OQ=(e,{visitId:t}={})=>ln("success",{detail:{page:e,visitId:t}}),HQ=(e,t)=>ln("prefetched",{detail:{fetchedAt:Date.now(),response:e,visit:t}}),VQ=e=>ln("prefetching",{detail:{visit:e}}),SA=e=>ln("flash",{detail:{flash:e}}),BQ=(e,t)=>ln("location",{cancelable:!0,detail:{url:e,versionChange:t}}),FQ=e=>ln("live",{cancelable:!0,detail:e}),CA="$bigint",UQ=(e,t)=>typeof t=="bigint"?{[CA]:t.toString()}:t,GQ=(e,t)=>typeof t=="bigint"?t.toString():t;function GD(e){const t=JSON.parse(e);return t?.preserveBigIntegers===!0&&e.includes(`"${CA}"`)&&cF(t),t}function cF(e){if(Array.isArray(e)){for(let t=0;t<e.length;t++)e[t]=YH(e[t]);return}for(const t of Object.keys(e))e[t]=YH(e[t])}function YH(e){return e===null||typeof e!="object"?e:typeof e[CA]=="string"?BigInt(e[CA]):(cF(e),e)}function sF(e){return dF(e,()=>({...e,preserveBigIntegers:!0}),UQ)}function lF(e){return dF(e,()=>e,GQ)}function dF(e,t,a){try{return JSON.stringify(e)}catch(r){try{return JSON.stringify(t(),a)}catch{throw r}}}function uF(e,t=new WeakSet){return typeof e=="bigint"?!0:e===null||typeof e!="object"||t.has(e)?!1:(t.add(e),(Array.isArray(e)?e:Object.values(e)).some(r=>uF(r,t)))}var gn=class{static locationVisitKey="inertiaLocationVisit";static set(e,t){typeof window<"u"&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<"u")return JSON.parse(window.sessionStorage.getItem(e)||"null")}static merge(e,t){const a=this.get(e);a===null?this.set(e,t):this.set(e,{...a,...t})}static remove(e){typeof window<"u"&&window.sessionStorage.removeItem(e)}static removeNested(e,t){const a=this.get(e);a!==null&&(delete a[t],this.set(e,a))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<"u"&&window.sessionStorage.clear()}},VR=12,ZQ=async e=>{if(typeof window>"u")throw new Error("Unable to encrypt history");gn.exists(Pl.iv)&&(gn.remove(Pl.key),gn.remove(Pl.iv));const t=await hF(),a=await JQ(t);if(!a)throw new Error("Unable to encrypt history");const r=window.crypto.getRandomValues(new Uint8Array(VR)),c=new Uint8Array(await YQ(r,a,e)),s=new Uint8Array(r.length+c.length);return s.set(r),s.set(c,r.length),s.buffer},Pl={key:"historyKey",iv:"historyIv"},WQ=async e=>{const t=await hF();if(!t)throw new Error("Unable to decrypt history");const a=new Uint8Array(e);return await XQ(a.subarray(0,VR),t,a.subarray(VR))},YQ=async(e,t,a)=>{if(typeof window>"u")throw new Error("Unable to encrypt history");if(typeof window.crypto.subtle>"u")return console.warn("Encryption is not supported in this environment. SSL is required."),Promise.resolve(a);const r=new TextEncoder,c=sF(a),s=new Uint8Array(c.length*3),u=r.encodeInto(c,s);return window.crypto.subtle.encrypt({name:"AES-GCM",iv:e},t,s.subarray(0,u.written))},XQ=async(e,t,a)=>{if(typeof window.crypto.subtle>"u")return console.warn("Decryption is not supported in this environment. SSL is required."),Promise.resolve(a);const r=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,a);return GD(new TextDecoder().decode(r))},KQ=async()=>typeof window.crypto.subtle>"u"?(console.warn("Encryption is not supported in this environment. SSL is required."),Promise.resolve(null)):window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),QQ=async e=>{if(typeof window.crypto.subtle>"u")return console.warn("Encryption is not supported in this environment. SSL is required."),Promise.resolve();const t=await window.crypto.subtle.exportKey("raw",e);gn.set(Pl.key,Array.from(new Uint8Array(t)))},JQ=async e=>{if(e)return e;const t=await KQ();return t?(await QQ(t),t):null},hF=async()=>{const e=gn.get(Pl.key);return e?await window.crypto.subtle.importKey("raw",new Uint8Array(e),{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]):null},ZD=class extends Error{code;url;constructor(e,t,a){super(a?`${e} (${a})`:e),this.name="HttpError",this.code=t,this.url=a}},Yu=class extends ZD{response;constructor(e,t,a){super(e,"ERR_HTTP_RESPONSE",a),this.name="HttpResponseError",this.response=t}},wo=class extends ZD{constructor(e="Request was cancelled",t){super(e,"ERR_CANCELLED",t),this.name="HttpCancelledError"}},XH=class extends ZD{cause;constructor(e,t,a){super(e,"ERR_NETWORK",t),this.name="HttpNetworkError",this.cause=a}},Mo=e=>e instanceof FormData;function WD(e,t=new FormData,a=null,r="brackets"){e=e||{};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&fF(t,pF(a,c,"indices"),e[c],r);return t}function pF(e,t,a){return e?a==="brackets"?`${e}[]`:`${e}[${t}]`:t}function fF(e,t,a,r){if(Array.isArray(a))return Array.from(a.keys()).forEach(c=>fF(e,pF(t,c.toString(),r),a[c],r));if(a instanceof Date)return e.append(t,a.toISOString());if(a instanceof File)return e.append(t,a,a.name);if(a instanceof Blob)return e.append(t,a);if(typeof a=="boolean")return e.append(t,a?"1":"0");if(typeof a=="string")return e.append(t,a);if(typeof a=="number")return e.append(t,`${a}`);if(typeof a=="bigint")return e.append(t,a.toString());if(a==null)return e.append(t,"");WD(a,e,t,r)}var KH=e=>{const t={};for(const a of Object.keys(e))e[a]!==void 0&&(t[a]=e[a]);return t},yF=(e,t,a)=>{if(e===t)return!0;for(const r in e)if(!a.includes(r)&&e[r]!==t[r]&&!tJ(e[r],t[r]))return!1;for(const r in t)if(!a.includes(r)&&!(r in e))return!1;return!0},eJ=(e,t)=>{const a=Array.from(e.entries()),r=Array.from(t.entries());return a.length===r.length&&a.every(([c,s],u)=>c===r[u][0]&&s===r[u][1])},tJ=(e,t)=>{if(Mo(e)||Mo(t))return Mo(e)&&Mo(t)&&eJ(e,t);if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(e===null||t===null||Array.isArray(e)!==Array.isArray(t))return e===t;switch(typeof e){case"object":return yF(e,t,[]);case"function":return e.toString()===t.toString();default:return e===t}},mF=(e,t,a)=>{const r=dd(t);if(r.length===0)return e;const c=(s,u)=>{if(u===r.length)return a;const h=r[u],y=Array.isArray(s)?[...s]:s&&typeof s=="object"?{...s}:/^(?:0|[1-9]\d*)$/.test(h)?[]:{};return y[h]=c(s?.[h],u+1),y};return c(e,0)},Xu=(e,t)=>e===t||e.startsWith(`${t}.`),gF=(e,t)=>{const{only:a,except:r}=e;return!(a.length===0&&r.length===0||a.length>0&&!a.some(c=>Xu(t,c))||r.length>0&&r.some(c=>Xu(t,c)))},nJ=(e,t)=>t.some(a=>gF(e,a)),QH=(e,t)=>{const a=e.only.concat(e.reset),{except:r}=e;return a.length===0&&r.length===0?!0:!(a.length>0&&!a.some(c=>aJ(t,c))||r.length>0&&r.some(c=>Xu(t,c)))},aJ=(e,t)=>Xu(e,t)||Xu(t,e),YD=e=>typeof File<"u"&&e instanceof File||e instanceof Blob||typeof FileList<"u"&&e instanceof FileList&&e.length>0;function LA(e){return YD(e)||e instanceof FormData&&Array.from(e.values()).some(t=>LA(t))||typeof e=="object"&&e!==null&&Object.values(e).some(t=>LA(t))}function oJ(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function rJ(e){if(!e||e==="?")return{};const t={};return e.replace(/^\?/,"").split("&").filter(Boolean).forEach(a=>{const[r,c]=cJ(a);sJ(t,JH(r),JH(c))}),t}function iJ(e,t){const a=[];return BR(e,"",a,t),a.length?"?"+a.join("&"):""}function cJ(e){const t=e.indexOf("=");return t===-1?[e,""]:[e.substring(0,t),e.substring(t+1)]}function JH(e){return decodeURIComponent(e.replace(/\+/g," "))}function sJ(e,t,a){const r=lJ(t);if(r.some(u=>u==="__proto__"))return;let c=e;for(;r.length>1;){const u=r.shift(),h=r[0]==="";(typeof c[u]!="object"||c[u]===null)&&(c[u]=h?[]:{}),c=c[u]}const s=r.shift();s===""&&Array.isArray(c)?c.push(a):c[s]=a}function lJ(e){const t=[],a=e.split("[")[0];a&&t.push(a);let r;const c=/\[([^\]]*)\]/g;for(;(r=c.exec(e))!==null;)t.push(r[1]);return t}function BR(e,t,a,r){if(e!==void 0){if(e===null){a.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((c,s)=>{const u=r==="indices"?`${t}[${s}]`:`${t}[]`;BR(c,u,a,r)});return}if(typeof e=="object"){Object.keys(e).forEach(c=>{BR(e[c],t?`${t}[${c}]`:c,a,r)});return}a.push(`${t}=${encodeURIComponent(String(e))}`)}}function Ot(e){return new URL(e.toString(),typeof window>"u"?void 0:window.location.toString())}var dJ=(e,t,a,r,c)=>{let s=typeof e=="string"?Ot(e):e;if((LA(t)||r)&&!Mo(t)&&(br.get("form.forceIndicesArrayFormatInFormData")&&(c="indices"),t=WD(t,new FormData,null,c)),Mo(t))return[s,t];const[u,h]=s2(a,s,t,c);return[Ot(u),h]};function s2(e,t,a,r="brackets"){const c=e==="get"&&!Mo(a)&&Object.keys(a).length>0,s=bF(t.toString()),u=s||t.toString().startsWith("/")||t.toString()==="",h=!u&&!t.toString().startsWith("#")&&!t.toString().startsWith("?"),y=/^[.]{1,2}([/]|$)/.test(t.toString()),p=t.toString().includes("?")||c,b=t.toString().includes("#"),k=typeof window>"u",x=new URL(t.toString(),k?"http://localhost":window.location.toString());if(c){const M=oJ(x)?"indices":r;x.search=iJ({...rJ(x.search),...a},M)}return[[s?`${x.protocol}//${x.host}`:"",u?x.pathname:"",h?x.pathname.substring(k&&!y?1:0):"",p?x.search:"",b?x.hash:""].join(""),c?{}:a]}function NA(e){return e=new URL(e.href),e.hash="",e}var eV=(e,t)=>{e.hash&&!t.hash&&NA(e).href===t.href&&(t.hash=e.hash)},jl=(e,t)=>NA(e).href===NA(t).href,Rl=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function Va(e){return e!==null&&typeof e=="object"&&e!==void 0&&"url"in e&&"method"in e}function kF(e){return e.component?typeof e.component!="string"?(console.error(`The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(", ")}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`),null):e.component:null}function vF(e){return new URL(e,window.location.href).origin===window.location.origin}function bF(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function uJ(e,t){const a=typeof e=="string"?Ot(e):e;return t?`${a.protocol}//${a.host}${a.pathname}${a.search}${a.hash}`:`${a.pathname}${a.search}${a.hash}`}var XD=new Map,FR=new Set,Ku=null,ej=()=>{FR.forEach(e=>e())},xF=e=>{typeof window>"u"||e.prefetch||Rl(e.url,window.location)&&(XD.set(e.id,{only:e.only,except:e.except,reset:e.reset}),ej())},hJ=(e,t)=>{if(typeof window>"u")return;const a=Object.values(t??{}).flat().filter(r=>at(e,r)===void 0);if(a.length===0){MF();return}Ku={only:a,except:[],reset:[]},ej()},MF=()=>{Ku!==null&&(Ku=null,ej())},IA=e=>{XD.delete(e.id)&&ej()},od={isRefreshing(e){for(const t of XD.values())if(QH(t,e))return!0;return Ku!==null&&QH(Ku,e)},onChange(e){return FR.add(e),()=>{FR.delete(e)}}},pJ={ms:1,s:1e3,m:1e3*60,h:1e3*60*60,d:1e3*60*60*24},tV=e=>{if(typeof e=="number")return e;for(const[t,a]of Object.entries(pJ))if(e.endsWith(t))return parseFloat(e)*a;return parseInt(e)},fJ=class{cached=[];inFlightRequests=[];removalTimers=[];currentUse=null;add(e,t,{cacheFor:a,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();const s=this.findCached(e);if(!e.fresh&&s&&s.staleTimestamp>Date.now())return Promise.resolve();const[u,h]=this.extractStaleValues(a);let y=!1;const p=new Promise((b,k)=>{t({...e,onCancel:()=>{y=!0,this.remove(e),this.removeFromInFlight(e.id),e.onCancel(),k(new wo)},onError:x=>{this.remove(e),e.onError(x),k(x)},onPrefetching(x){e.onPrefetching(x)},onPrefetched(x,M){e.onPrefetched(x,M)},onPrefetchResponse(x){b(x)},onPrefetchError:x=>{this.removeFromInFlight(e.id),k(x)}})}).then(b=>{if(!this.isInFlight(e.id))return b;this.remove(e);const k=b.getPageResponse();fe.mergeOncePropsIntoResponse(k),this.cached.push({params:{...e},staleTimestamp:Date.now()+u,expiresAt:Date.now()+h,response:p,singleUse:h===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});const x=this.getShortestOncePropTtl(k);return this.scheduleForRemoval(e,x?Math.min(h,x):h),this.removeFromInFlight(e.id),b.handlePrefetch(),b});return y||this.inFlightRequests.push({params:{...e},response:p,staleTimestamp:null,inFlight:!0}),p.catch(b=>{if(this.removeFromInFlight(e.id),!(b instanceof wo))throw b})}removeAll(){this.cached=[],this.inFlightRequests=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(a=>e.includes(a)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}isInFlight(e){return this.inFlightRequests.some(t=>t.params.id===e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>t.params.id!==e)}extractStaleValues(e){const[t,a]=this.cacheForToStaleAndExpires(e);return[tV(t),tV(a)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){const t=this.removalTimers.find(a=>this.paramsAreEqual(a.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(a=>a!==t))}scheduleForRemoval(e,t){if(!(typeof window>"u")&&(this.clearTimer(e),t>0)){const a=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:a})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){const a=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`,r={...t,cached:!0};return this.currentUse={id:a,async:t.async,params:r,response:null},xF(r),e.response.then(c=>{if(this.currentUse?.id===a)return c.mergeParams({...r,onPrefetched:()=>{}}),this.removeSingleUseItems(t),this.currentUse.response=c,c.handle().finally(()=>{this.currentUse?.id===a&&(this.currentUse=null)})},c=>{if(!(c instanceof wo))throw c;this.currentUse?.id===a&&(this.currentUse=null),this.cancelUse(r)}).finally(()=>IA(r))}interruptInFlight({async:e}){const t=this.currentUse;t?.async===e&&(this.currentUse=null,t.response?t.response.interrupt():this.cancelUse(t.params))}cancelUse(e){e.cancelled||(e.cancelled=!0,IA(e),e.onCancel(),e.onFinish(e))}removeSingleUseItems(e){this.cached=this.cached.filter(t=>this.paramsAreEqual(t.params,e)?!t.singleUse:!0)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){const t=dt(e);return t.headers.Purpose==="prefetch"&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return yF(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),["id","showProgress","replace","prefetch","preserveScroll","preserveState","onBefore","onBeforeUpdate","onStart","onProgress","onFinish","onCancel","onSuccess","onError","onHttpException","onNetworkError","onFlash","onPrefetched","onCancelToken","onPrefetching","async","viewTransition","optimistic","component","pageProps","cached"])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{const a=t.getPageResponse();fe.mergeOncePropsIntoResponse(a,{force:!0});for(const[u,h]of Object.entries(a.deferredProps??{})){const y=h.filter(p=>at(a.props,p)===void 0);y.length>0?a.deferredProps[u]=y:delete a.deferredProps[u]}const r=this.getShortestOncePropTtl(a);if(r===null)return;const c=e.expiresAt-Date.now(),s=Math.min(c,r);s>0?this.scheduleForRemoval(e.params,s):this.remove(e.params)})})}getShortestOncePropTtl(e){const t=Object.values(e.onceProps??{}).map(a=>a.expiresAt).filter(a=>!!a);return t.length===0?null:Math.min(...t)-Date.now()}},qn=new fJ,JP=e=>{if(e.offsetParent===null)return!1;const t=e.getBoundingClientRect(),a=t.top<window.innerHeight&&t.bottom>=0,r=t.left<window.innerWidth&&t.right>=0;return a&&r},yJ=e=>{const t=u=>{const h=window.getComputedStyle(u);return h.overflowY==="scroll"?!0:h.overflowY!=="auto"?!1:["visible","clip"].includes(h.overflowX)?!0:r(h.maxHeight,u.style.height)||c(u,"height")},a=u=>{const h=window.getComputedStyle(u);return h.overflowX==="scroll"?!0:h.overflowX!=="auto"?!1:["visible","clip"].includes(h.overflowY)?!0:r(h.maxWidth,u.style.width)||c(u,"width")},r=(u,h)=>!!(u&&u!=="none"&&u!=="0px"||h&&h!=="auto"&&h!=="0"),c=(u,h)=>{const y=u.parentElement;if(!y)return!1;const p=window.getComputedStyle(y);if(["flex","inline-flex"].includes(p.display)){const b=["column","column-reverse"].includes(p.flexDirection);return h==="height"?b:!b}return["grid","inline-grid"].includes(p.display)};let s=e?.parentElement;for(;s;){const u=t(s)||a(s);if(window.getComputedStyle(s).display!=="contents"&&u)return s;s=s.parentElement}return null},wF=(e,t)=>{if(!t)return e.filter(s=>JP(s));const a=e.indexOf(t),r=[],c=[];for(let s=a;s>=0;s--){const u=e[s];if(JP(u))r.push(u);else break}for(let s=a+1;s<e.length;s++){const u=e[s];if(JP(u))c.push(u);else break}return[...r.reverse(),...c]},Du=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?Du(e,t-1):e()})},mJ=e=>{if(typeof window>"u")return null;const t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?GD(t.textContent):null},Iu=typeof window>"u",gJ=!Iu&&/Firefox/i.test(window.navigator.userAgent),ga=class{static save(){Fe.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(t=>({top:t.scrollTop,left:t.scrollLeft}))}static regions(){return document.querySelectorAll("[scroll-region]")}static scrollToTop(){if(gJ&&getComputedStyle(document.documentElement).scrollBehavior==="smooth")return Du(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!Iu&&window.location.hash||this.scrollToTop(),this.regions().forEach(a=>{typeof a.scrollTo=="function"?a.scrollTo(0,0):(a.scrollTop=0,a.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){const t=Iu?null:window.location.hash;t&&setTimeout(()=>{const a=document.getElementById(t.slice(1));a?a.scrollIntoView():this.scrollToTop()})}static restore(t){Iu||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(t)})}static restoreScrollRegions(t){Iu||this.regions().forEach((a,r)=>{const c=t[r];c&&(typeof a.scrollTo=="function"?a.scrollTo(c.left,c.top):(a.scrollTop=c.top,a.scrollLeft=c.left))})}static restoreDocument(){const t=Fe.getDocumentScrollPosition();window.scrollTo(t.left,t.top)}static onScroll(t){const a=t.target;typeof a.hasAttribute=="function"&&a.hasAttribute("scroll-region")&&this.save()}static onWindowScroll(){Fe.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},kJ=class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;confirmedOptimisticId=0;init({initialPage:e,swapComponent:t,resolveComponent:a,onFlash:r}){return this.assignPage({...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},e.deferredProps),this.swapComponent=t,this.resolveComponent=a,this.onFlashCallback=r,zn.on("historyQuotaExceeded",()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:a=!1,preserveState:r=!1,viewTransition:c=!1,cached:s=!1,initialRender:u=!1,clientSide:h=!1,visitId:y,isCancelled:p=()=>!1,onCommit:b=()=>{}}={}){const k=this.pendingDeferredProps;!(h&&this.isTheSame(e)&&e.url===this.page.url)&&Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps));const M=this.pendingDeferredProps;this.componentId={};const _=this.componentId;return e.clearHistory&&(Fe.clear(),qn.removeAll()),this.resolve(e.component,e).then(C=>{if(_!==this.componentId||p()){p()&&this.pendingDeferredProps===M&&(this.pendingDeferredProps=k);return}b(),e.rememberedState??={};const S=typeof window>"u",L=S?new URL(e.url):window.location,A=!S&&a?ga.getScrollRegions():[];t=t||jl(Ot(e.url),L);const N={...e,flash:{}};return Fe.clearInitialState(Fe.rememberedState),new Promise(j=>t?Fe.replaceState(N,j):Fe.pushState(N,j)).then(()=>{const j=!this.isTheSame(e);if(!j&&Object.keys(e.props.errors||{}).length>0&&(c=!1),this.cleared=!1,this.assignPage(e,this.pendingDeferredPropsFor(e)),this.hasOnceProps()&&qn.updateCachedOncePropsFromCurrentPage(),j&&this.fireEventsFor("newComponent"),this.isFirstPageLoad&&this.fireEventsFor("firstLoad"),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:C,page:e,preserveState:r,viewTransition:c,initialRender:u}).then(()=>{a?window.requestAnimationFrame(()=>ga.restoreScrollRegions(A)):ga.reset();const T=this.pendingDeferredPropsFor(e);T&&zn.fireInternalEvent("loadDeferredProps",T),this.pendingDeferredProps=null,t||_A(e,{type:"visit",cached:s,visitId:y})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.componentId={},this.resolve(e.component,e).then(a=>(this.cleared=!1,this.assignPage(e),Fe.setCurrent(e),this.swap({component:a,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}assignPage(e,t){this.page=e,hJ(e.props,t),zn.fireInternalEvent("pageUpdated",e)}pendingDeferredPropsFor(e){const t=this.pendingDeferredProps;if(!(!t||t.component!==e.component||t.url!==e.url))return t.deferredProps}merge(e){this.page={...this.page,...e}}setPropsQuietly(e){return this.page={...this.page,props:e},this.resolve(this.page.component,this.page).then(t=>this.swap({component:t,page:this.page,preserveState:!0,viewTransition:!1}))}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:a,viewTransition:r,initialRender:c=!1}){const s=()=>this.swapComponent({component:e,page:t,preserveState:a,initialRender:c});if(!r||!document?.startViewTransition||document.visibilityState==="hidden")return s();const u=typeof r=="boolean"?()=>null:r,h=y=>{y.catch(p=>{if(!(p instanceof DOMException))throw p})};return new Promise(y=>{const p=document.startViewTransition(()=>s().then(y));h(p.ready),h(p.finished),h(p.updateCallbackDone),u(p)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}markOptimisticConfirmed(e){this.confirmedOptimisticId=Math.max(this.confirmedOptimisticId,e)}hasConfirmedOptimisticAfter(e){return this.confirmedOptimisticId>e}setBaseline(e,t){e in this.optimisticBaseline||(this.optimisticBaseline[e]=t)}updateBaseline(e,t){e in this.optimisticBaseline&&(this.optimisticBaseline[e]=t)}hasBaseline(e){return e in this.optimisticBaseline}registerOptimistic(e,t){this.pendingOptimistics.push({id:e,callback:t})}unregisterOptimistic(e){this.pendingOptimistics=this.pendingOptimistics.filter(t=>t.id!==e)}replayOptimistics(){const e=Object.keys(this.optimisticBaseline);if(e.length===0)return{};const t=dt(this.page.props);for(const r of e)t[r]=dt(this.optimisticBaseline[r]);for(const{callback:r}of this.pendingOptimistics){const c=r(dt(t));c&&Object.assign(t,c)}const a={};for(const r of e)a[r]=t[r];return a}pendingOptimisticCount(){return this.pendingOptimistics.length}clearOptimisticState(){this.optimisticBaseline={},this.pendingOptimistics=[],this.confirmedOptimisticId=0}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(a=>a.event!==e&&a.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>t.event===e).forEach(t=>t.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}).forEach(([a,r])=>{const c=this.page.onceProps?.[a];c!==void 0&&(t||at(e.props,r.prop)===void 0)&&(Tn(e.props,r.prop,at(this.page.props,c.prop)),e.onceProps[a].expiresAt=c.expiresAt)})}},fe=new kJ,tj=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().then(()=>{if(this.processingPromise=null,this.items.length>0)return this.process()},e=>{throw this.processingPromise=null,e}),this.processingPromise}processNext(){const e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},Y1=typeof window>"u",ku=new tj,nV=!Y1&&/CriOS/.test(window.navigator.userAgent),vJ=class{rememberedState="rememberedState";scrollRegions="scrollRegions";preserveUrl=!1;current={};initialState=null;remember(t,a){this.replaceState({...fe.getWithoutFlashData(),rememberedState:{...fe.get()?.rememberedState??{},[a]:t}})}restore(t){if(!Y1)return this.current[this.rememberedState]?.[t]!==void 0?this.current[this.rememberedState]?.[t]:this.initialState?.[this.rememberedState]?.[t]}pushState(t,a=null){if(!Y1){if(this.preserveUrl){a&&a();return}this.current=t,ku.add(()=>this.getPageData(t).then(r=>{const c=()=>this.doPushState({page:r},t.url).then(()=>a?.());return nV?new Promise(s=>{setTimeout(()=>c().then(s))}):c()}))}}clonePageProps(t){try{return structuredClone(t.props),t}catch{return{...t,props:dt(t.props)}}}getPageData(t){const a=this.clonePageProps(t);return new Promise(r=>t.encryptHistory?ZQ(a).then(r):r(a))}processQueue(){return ku.process()}decrypt(t=null){if(Y1)return Promise.resolve(t??fe.get());const a=t??window.history.state?.page;return this.decryptPageData(a).then(r=>{if(!r)throw new Error("Unable to decrypt history");return this.initialState===null?this.initialState=r??void 0:this.current=r??{},r})}decryptPageData(t){return t instanceof ArrayBuffer?WQ(t):Promise.resolve(t)}saveScrollPositions(t){ku.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!_a(this.getScrollRegions(),t))return this.doReplaceState({page:window.history.state.page,scrollRegions:t})}))}saveDocumentScrollPosition(t){ku.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!_a(this.getDocumentScrollPosition(),t))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:t})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(t,a=null){if(_a(this.current,t)){a&&a();return}const{flash:r,...c}=t;if(fe.merge(c),!Y1){if(this.preserveUrl){a&&a();return}this.current=t,ku.add(()=>this.getPageData(t).then(s=>{const u=()=>this.doReplaceState({page:s},t.url).then(()=>a?.());return nV?new Promise(h=>{setTimeout(()=>u().then(h))}):u()}))}}isHistoryThrottleError(t){return t instanceof Error&&t.name==="SecurityError"&&(t.message.includes("history.pushState")||t.message.includes("history.replaceState"))}isQuotaExceededError(t){return t instanceof Error&&t.name==="QuotaExceededError"}withThrottleProtection(t){return Promise.resolve().then(()=>{try{return t()}catch(a){if(!this.isHistoryThrottleError(a))throw a;console.error(a.message)}})}doReplaceState(t,a){return this.withThrottleProtection(()=>{try{window.history.replaceState({...t,scrollRegions:t.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:t.documentScrollPosition??window.history.state?.documentScrollPosition},"",a)}catch(r){if(!this.isQuotaExceededError(r))throw r;console.error(r.message)}})}doPushState(t,a){return this.withThrottleProtection(()=>{try{window.history.pushState(t,"",a)}catch(r){if(!this.isQuotaExceededError(r))throw r;zn.fireInternalEvent("historyQuotaExceeded",a)}})}getState(t,a){return this.current?.[t]??a}deleteState(t){this.current[t]!==void 0&&(delete this.current[t],this.replaceState(this.current))}clearInitialState(t){this.initialState&&this.initialState[t]!==void 0&&(this.initialState={...this.initialState,[t]:void 0})}browserHasHistoryEntry(){return!Y1&&!!window.history.state?.page}clear(){gn.remove(Pl.key),gn.remove(Pl.iv)}setCurrent(t){this.current=t}isValidState(t){return!!t.page}getAllState(){return this.current}};typeof window<"u"&&window.history.scrollRestoration&&(window.history.scrollRestoration="manual");var Fe=new vJ,bJ=class{internalListeners=[];onWindowScroll=Wu(()=>ga.onWindowScroll(),100);onScroll=Wu(e=>ga.onScroll(e),100);init(){typeof window<"u"&&(window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),window.addEventListener("pageshow",this.handlePageshowEvent.bind(this)),window.addEventListener("scroll",this.onWindowScroll,!0)),typeof document<"u"&&document.addEventListener("scroll",this.onScroll,!0)}onGlobalEvent(e,t){const a=(r=>{const c=t(r);r.cancelable&&!r.defaultPrevented&&c===!1&&r.preventDefault()});return this.registerListener(`inertia:${e}`,a)}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(a=>a.listener!==t)}}onMissingHistoryItem(){fe.clear(),this.fireInternalEvent("missingHistoryItem")}fireInternalEvent(e,...t){this.internalListeners.filter(a=>a.event===e).forEach(a=>a.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&Fe.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){this.onWindowScroll.cancel(),this.onScroll.cancel();const t=e.state||null;if(t===null){const a=Ot(fe.get().url);a.hash=window.location.hash,Fe.replaceState({...fe.getWithoutFlashData(),url:a.href}),ga.reset();return}if(!Fe.isValidState(t))return this.onMissingHistoryItem();Oe.cancelAll({prefetch:!1}),Fe.decrypt(t.page).then(a=>{if(fe.get().version!==a.version){this.onMissingHistoryItem();return}fe.setQuietly(a,{preserveState:!1}).then(()=>{ga.restore(Fe.getScrollRegions()),_A(fe.get(),{type:"history"});const r={},c=fe.get().props;for(const[s,u]of Object.entries(a.initialDeferredProps??a.deferredProps??{})){const h=u.filter(y=>at(c,y)===void 0);h.length>0&&(r[s]=h)}Object.keys(r).length>0&&this.fireInternalEvent("loadDeferredProps",r)})}).catch(()=>{this.onMissingHistoryItem()})}},zn=new bJ,xJ=class{type;constructor(){this.type=this.resolveType()}resolveType(){return typeof window>"u"?"navigate":window.performance?.getEntriesByType("navigation")[0]?.type??"navigate"}get(){return this.type}isBackForward(){return this.type==="back_forward"}isReload(){return this.type==="reload"}},eR=new xJ;function dh(){const e=typeof window<"u"?window.crypto:void 0;if(e?.randomUUID)return e.randomUUID();const t=()=>e?.getRandomValues?e.getRandomValues(new Uint8Array(1))[0]:Math.floor(Math.random()*256);return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^t()&15>>+a/4).toString(16))}var MJ=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(t=>t.bind(this)())}static clearRememberedStateOnReload(){eR.isReload()&&(Fe.deleteState(Fe.rememberedState),Fe.clearInitialState(Fe.rememberedState))}static handleBackForward(){if(!eR.isBackForward()||!Fe.browserHasHistoryEntry())return!1;const e=Fe.getScrollRegions();return Fe.decrypt().then(t=>{if(fe.get().version!==t.version){this.handleDefault();return}const a=dh();fe.set(t,{preserveScroll:!0,preserveState:!0,visitId:a}).then(()=>{ga.restore(e),_A(fe.get(),{type:"history",visitId:a})})}).catch(()=>{zn.onMissingHistoryItem()}),!0}static handleLocation(){if(!gn.exists(gn.locationVisitKey))return!1;const e=gn.get(gn.locationVisitKey)||{};return gn.remove(gn.locationVisitKey),typeof window<"u"&&fe.setUrlHash(window.location.hash),Fe.decrypt(fe.get()).then(()=>{const t=dh(),a=Fe.getState(Fe.rememberedState,{}),r=Fe.getScrollRegions();fe.remember(a),fe.set(fe.get(),{preserveScroll:e.preserveScroll,preserveState:!0,initialRender:!0,visitId:t}).then(()=>{e.preserveScroll&&ga.restore(r),this.fireInitialEvents(t)})}).catch(()=>{zn.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<"u"&&fe.setUrlHash(window.location.hash);const e=dh();fe.set(fe.get(),{preserveScroll:!0,preserveState:!0,initialRender:!0,visitId:e}).then(()=>{eR.isReload()?ga.restore(Fe.getScrollRegions()):ga.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){const t=fe.get();_A(t,{type:"initial",visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>SA(t.flash))}},wJ=class{intervalId=null;timeoutId=null;hidden=!1;background;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;lastPolledAt=0;constructor(e,t,a){this.background=a.background??(a.keepAlive?"continue":"throttle"),this.hidden=typeof document<"u"&&document.hidden,this.mode=a.mode??"overlap",this.cb=t,this.interval=e,(a.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.clearTimers()}start(){if(!(typeof window>"u")&&(this.stop(),this.stopped=!1,this.lastPolledAt=Date.now(),!this.isPaused())){if(this.mode==="rest"){this.scheduleNext();return}this.startInterval()}}isInBackground(e){e!==this.hidden&&(this.hidden=e,this.isThrottled()&&(this.cbCount=0),this.background==="pause"&&(e?this.clearTimers():this.resume()))}isThrottled(){return this.hidden&&this.background==="throttle"}isPaused(){return this.hidden&&this.background==="pause"}resume(){if(this.stopped||this.mode==="rest"&&this.inFlight)return;const e=this.interval-(Date.now()-this.lastPolledAt);if(e>0){this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.resume()},e);return}this.fire(),this.mode!=="rest"&&this.startInterval()}startInterval(){this.intervalId=window.setInterval(()=>this.tick(),this.interval)}clearTimers(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}scheduleNext(){this.stopped||this.isPaused()||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){const e=this.isThrottled();!e||this.cbCount%10===0?this.fire():this.mode==="rest"&&this.scheduleNext(),e&&this.cbCount++}fire(){this.inFlight&&this.mode==="cancel"&&this.currentCancel?.(),this.lastPolledAt=Date.now();const e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode==="rest"&&(this.lastPolledAt=Date.now(),this.scheduleNext()))}})}},UR=new Set,aV=!1,_J=()=>{aV||typeof document>"u"||(aV=!0,document.addEventListener("visibilitychange",()=>{UR.forEach(e=>e(document.hidden))},!1))},AA={isHidden(){return typeof document<"u"&&document.hidden},onChange(e){return _J(),UR.add(e),()=>{UR.delete(e)}}},SJ=class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,a){const r=new wJ(e,t,a);return r.isInBackground(AA.isHidden()),this.polls.push(r),{stop:()=>r.stop(),start:()=>r.start(),destroy:()=>{r.stop(),this.polls=this.polls.filter(c=>c!==r)}}}clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){AA.onChange(e=>{this.polls.forEach(t=>t.isInBackground(e))})}},oV=new SJ,CJ=class{requestHandlers=[];responseHandlers=[];errorHandlers=[];onRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}onError(e){return this.errorHandlers.push(e),()=>{this.errorHandlers=this.errorHandlers.filter(t=>t!==e)}}async processRequest(e){let t=e;for(const a of this.requestHandlers)t=await a(t);return t}async processResponse(e){let t=e;for(const a of this.responseHandlers)t=await a(t);return t}async processError(e){for(const t of this.errorHandlers)await t(e)}},pn=new CJ;function LJ(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null}function NJ(e){const t={};return e.getAllResponseHeaders().split(`\r
|
|
3
3
|
`).forEach(a=>{const r=a.indexOf(":");r>0&&(t[a.slice(0,r).toLowerCase().trim()]=a.slice(r+1).trim())}),t}function _F(e){return typeof FormData<"u"&&e instanceof FormData}function IJ(e){return typeof e=="string"||_F(e)||typeof Blob<"u"&&e instanceof Blob||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)||typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function AJ(e,t){if(!t.headers)return;const a=_F(t.data);Object.entries(t.headers).forEach(([r,c])=>{(r.toLowerCase()!=="content-type"||!a)&&e.setRequestHeader(r,String(c))})}function jJ(e,t){if(!t||Object.keys(t).length===0)return e;const[a]=s2("get",e,t);return a}var SF=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??"XSRF-TOKEN",this.xsrfHeaderName=e.xsrfHeaderName??"X-XSRF-TOKEN"}async request(e){const t=await pn.processRequest(e);try{const a=await this.doRequest(t);return await pn.processResponse(a)}catch(a){throw(a instanceof Yu||a instanceof XH||a instanceof wo)&&await pn.processError(a),a}}doRequest(e){return new Promise((t,a)=>{if(e.signal?.aborted){a(new wo("Request was cancelled",e.url));return}const r=new XMLHttpRequest,c=jJ(e.url,e.params);r.open(e.method.toUpperCase(),c,!0);const s=vF(c)?LJ(this.xsrfCookieName):null;s&&r.setRequestHeader(this.xsrfHeaderName,s),Object.keys(e.headers??{}).some(y=>y.toLowerCase()==="x-requested-with")||r.setRequestHeader("X-Requested-With","XMLHttpRequest");let h=null;e.data!==null&&e.data!==void 0&&(IJ(e.data)?h=e.data:typeof e.data=="object"?(h=JSON.stringify(e.data),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&r.setRequestHeader("Content-Type","application/json")):h=String(e.data)),AJ(r,e),e.onUploadProgress&&(r.upload.onprogress=y=>{const p=y.lengthComputable?y.loaded/y.total:void 0;e.onUploadProgress({progress:p,percentage:p?Math.round(p*100):0,loaded:y.loaded,total:y.lengthComputable?y.total:void 0})}),e.signal&&e.signal.addEventListener("abort",()=>r.abort()),r.onabort=()=>a(new wo("Request was cancelled",e.url)),r.onerror=()=>a(new XH("Network error",e.url)),r.onload=()=>{const y={status:r.status,data:r.responseText,headers:NJ(r)};r.status>=400?a(new Yu(`Request failed with status ${r.status}`,y,e.url)):t(y)},r.send(h)})}},EJ=new SF;Ut.withSerializer(lF);var tR=EJ;function PJ(e){return!("request"in e)}var kd={getClient(){return tR},setClient(e){if(!PJ(e)){tR=e;return}tR=new SF(e),e.xsrfCookieName&&Ut.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&Ut.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:pn.onRequest.bind(pn),onResponse:pn.onResponse.bind(pn),onError:pn.onError.bind(pn),processRequest:pn.processRequest.bind(pn),processResponse:pn.processResponse.bind(pn),processError:pn.processError.bind(pn)},RJ=class{requestHandlers=[];responseHandlers=[];onVisitRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onVisitResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}async processRequest(e,t){let a=t;for(const r of this.requestHandlers)a=await r(e,a);return a}async processResponse(e,t){let a=t;for(const r of this.responseHandlers)a=await r(e,a);return a}},KD=new RJ;function DJ(){typeof window>"u"||(window.__inertia_interceptors__=KD)}var uh=class hh{callbacks=[];params;constructor(t){if(!t.prefetch)this.params=t;else{const a={onBefore:this.wrapCallback(t,"onBefore"),onBeforeUpdate:this.wrapCallback(t,"onBeforeUpdate"),onStart:this.wrapCallback(t,"onStart"),onProgress:this.wrapCallback(t,"onProgress"),onFinish:this.wrapCallback(t,"onFinish"),onCancel:this.wrapCallback(t,"onCancel"),onSuccess:this.wrapCallback(t,"onSuccess"),onError:this.wrapCallback(t,"onError"),onHttpException:this.wrapCallback(t,"onHttpException"),onNetworkError:this.wrapCallback(t,"onNetworkError"),onFlash:this.wrapCallback(t,"onFlash"),onCancelToken:this.wrapCallback(t,"onCancelToken"),onPrefetched:this.wrapCallback(t,"onPrefetched"),onPrefetching:this.wrapCallback(t,"onPrefetching")};this.params={...t,...a,onPrefetchResponse:t.onPrefetchResponse||(()=>{}),onPrefetchError:t.onPrefetchError||(()=>{})}}}static create(t){return new hh(t)}data(){return this.params.method==="get"?null:this.params.data}queryParams(){return this.params.method==="get"?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}isPollRequest(){return this.params.poll===!0}isQueryMethodReload(){return this.params.queryMethodReload===!0}onCancelToken(t){this.params.onCancelToken({cancel:t})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:t=!0,interrupted:a=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=t,this.params.interrupted=a}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(t){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(t)}onPrefetchError(t){this.params.onPrefetchError&&this.params.onPrefetchError(t)}all(){return this.params}headers(){const t={...this.params.headers};this.isPartial()&&(t["X-Inertia-Partial-Component"]=fe.get().component);const a=this.params.only.concat(this.params.reset);return a.length>0&&(t["X-Inertia-Partial-Data"]=a.join(",")),this.params.except.length>0&&(t["X-Inertia-Partial-Except"]=this.params.except.join(",")),this.params.reset.length>0&&(t["X-Inertia-Reset"]=this.params.reset.join(",")),this.params.errorBag&&this.params.errorBag.length>0&&(t["X-Inertia-Error-Bag"]=this.params.errorBag),t}setPreserveOptions(t){this.params.preserveScroll=hh.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=hh.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:t,args:a})=>{this.params[t](...a)})}merge(t){this.params={...this.params,...t}}wrapCallback(t,a){return(...r)=>{this.recordCallback(a,r),t[a](...r)}}recordCallback(t,a){this.callbacks.push({name:t,args:a})}static resolvePreserveOption(t,a){return typeof t=="function"?t(a):t==="errors"?Object.keys(a.props.errors||{}).length>0:t}leavesPage(t,a){return this.params.async?!1:this.isPartial()?!Rl(a,t):this.params.method==="query"||!jl(a,t)}},qJ={createIframeAndPage(e){typeof e=="object"&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(e)}`);const t=document.createElement("html");t.innerHTML=e,t.querySelectorAll("a").forEach(r=>r.setAttribute("target","_top"));const a=document.createElement("iframe");return a.style.backgroundColor="white",a.style.borderRadius="5px",a.style.width="100%",a.style.height="100%",a.setAttribute("sandbox","allow-scripts"),{iframe:a,page:t}},show(e){const{iframe:t,page:a}=this.createIframeAndPage(e);t.style.boxSizing="border-box",t.style.display="block";const r=document.createElement("dialog");r.id="inertia-error-dialog",Object.assign(r.style,{width:"calc(100vw - 100px)",height:"calc(100vh - 100px)",padding:"0",margin:"auto",border:"none",backgroundColor:"transparent"});const c=document.createElement("style");c.textContent=`
|
|
4
4
|
dialog#inertia-error-dialog::backdrop {
|
|
@@ -135,4 +135,4 @@ Error generating stack: `+d.message+`
|
|
|
135
135
|
`)},tB=function(){var e=parseInt(document.body.getAttribute(sd)||"0",10);return isFinite(e)?e:0},FSe=function(){m.useEffect(function(){return document.body.setAttribute(sd,(tB()+1).toString()),function(){var e=tB()-1;e<=0?document.body.removeAttribute(sd):document.body.setAttribute(sd,e.toString())}},[])},USe=function(e){var t=e.noRelative,a=e.noImportant,r=e.gapMode,c=r===void 0?"margin":r;FSe();var s=m.useMemo(function(){return HSe(c)},[c]);return m.createElement(VSe,{styles:BSe(s,!t,c,a?"":"!important")})},lD=!1;if(typeof window<"u")try{var K0=Object.defineProperty({},"passive",{get:function(){return lD=!0,!0}});window.addEventListener("test",K0,K0),window.removeEventListener("test",K0,K0)}catch{lD=!1}var G1=lD?{passive:!1}:!1,GSe=function(e){return e.tagName==="TEXTAREA"},SG=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!GSe(e)&&a[t]==="visible")},ZSe=function(e){return SG(e,"overflowY")},WSe=function(e){return SG(e,"overflowX")},nB=function(e,t){var a=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var c=CG(e,r);if(c){var s=LG(e,r),u=s[1],h=s[2];if(u>h)return!0}r=r.parentNode}while(r&&r!==a.body);return!1},YSe=function(e){var t=e.scrollTop,a=e.scrollHeight,r=e.clientHeight;return[t,a,r]},XSe=function(e){var t=e.scrollLeft,a=e.scrollWidth,r=e.clientWidth;return[t,a,r]},CG=function(e,t){return e==="v"?ZSe(t):WSe(t)},LG=function(e,t){return e==="v"?YSe(t):XSe(t)},KSe=function(e,t){return e==="h"&&t==="rtl"?-1:1},QSe=function(e,t,a,r,c){var s=KSe(e,window.getComputedStyle(t).direction),u=s*r,h=a.target,y=t.contains(h),p=!1,b=u>0,k=0,x=0;do{if(!h)break;var M=LG(e,h),_=M[0],C=M[1],S=M[2],L=C-S-s*_;(_||L)&&CG(e,h)&&(k+=L,x+=_);var A=h.parentNode;h=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!y&&h!==document.body||y&&(t.contains(h)||t===h));return(b&&Math.abs(k)<1||!b&&Math.abs(x)<1)&&(p=!0),p},Q0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aB=function(e){return[e.deltaX,e.deltaY]},oB=function(e){return e&&"current"in e?e.current:e},JSe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eCe=function(e){return`
|
|
136
136
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
137
137
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
138
|
-
`)},tCe=0,Z1=[];function nCe(e){var t=m.useRef([]),a=m.useRef([0,0]),r=m.useRef(),c=m.useState(tCe++)[0],s=m.useState(_G)[0],u=m.useRef(e);m.useEffect(function(){u.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var C=wSe([e.lockRef.current],(e.shards||[]).map(oB),!0).filter(Boolean);return C.forEach(function(S){return S.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var h=m.useCallback(function(C,S){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var L=Q0(C),A=a.current,N="deltaX"in C?C.deltaX:A[0]-L[0],j="deltaY"in C?C.deltaY:A[1]-L[1],T,R=C.target,q=Math.abs(N)>Math.abs(j)?"h":"v";if("touches"in C&&q==="h"&&R.type==="range")return!1;var $=window.getSelection(),ee=$&&$.anchorNode,re=ee?ee===R||ee.contains(R):!1;if(re)return!1;var F=nB(q,R);if(!F)return!0;if(F?T=q:(T=q==="v"?"h":"v",F=nB(q,R)),!F)return!1;if(!r.current&&"changedTouches"in C&&(N||j)&&(r.current=T),!T)return!0;var G=r.current||T;return QSe(G,S,C,G==="h"?N:j)},[]),y=m.useCallback(function(C){var S=C;if(!(!Z1.length||Z1[Z1.length-1]!==s)){var L="deltaY"in S?aB(S):Q0(S),A=t.current.filter(function(T){return T.name===S.type&&(T.target===S.target||S.target===T.shadowParent)&&JSe(T.delta,L)})[0];if(A&&A.should){S.cancelable&&S.preventDefault();return}if(!A){var N=(u.current.shards||[]).map(oB).filter(Boolean).filter(function(T){return T.contains(S.target)}),j=N.length>0?h(S,N[0]):!u.current.noIsolation;j&&S.cancelable&&S.preventDefault()}}},[]),p=m.useCallback(function(C,S,L,A){var N={name:C,delta:S,target:L,should:A,shadowParent:aCe(L)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(j){return j!==N})},1)},[]),b=m.useCallback(function(C){a.current=Q0(C),r.current=void 0},[]),k=m.useCallback(function(C){p(C.type,aB(C),C.target,h(C,e.lockRef.current))},[]),x=m.useCallback(function(C){p(C.type,Q0(C),C.target,h(C,e.lockRef.current))},[]);m.useEffect(function(){return Z1.push(s),e.setCallbacks({onScrollCapture:k,onWheelCapture:k,onTouchMoveCapture:x}),document.addEventListener("wheel",y,G1),document.addEventListener("touchmove",y,G1),document.addEventListener("touchstart",b,G1),function(){Z1=Z1.filter(function(C){return C!==s}),document.removeEventListener("wheel",y,G1),document.removeEventListener("touchmove",y,G1),document.removeEventListener("touchstart",b,G1)}},[]);var M=e.removeScrollBar,_=e.inert;return m.createElement(m.Fragment,null,_?m.createElement(s,{styles:eCe(c)}):null,M?m.createElement(USe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aCe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oCe=ESe(wG,nCe);var k2=m.forwardRef(function(e,t){return m.createElement(dj,Oa({},e,{ref:t,sideCar:oCe}))});k2.classNames=dj.classNames;var rCe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},W1=new WeakMap,J0=new WeakMap,eh={},LR=0,NG=function(e){return e&&(e.host||NG(e.parentNode))},iCe=function(e,t){return t.map(function(a){if(e.contains(a))return a;var r=NG(a);return r&&e.contains(r)?r:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},cCe=function(e,t,a,r){var c=iCe(t,Array.isArray(e)?e:[e]);eh[a]||(eh[a]=new WeakMap);var s=eh[a],u=[],h=new Set,y=new Set(c),p=function(k){!k||h.has(k)||(h.add(k),p(k.parentNode))};c.forEach(p);var b=function(k){!k||y.has(k)||Array.prototype.forEach.call(k.children,function(x){if(h.has(x))b(x);else try{var M=x.getAttribute(r),_=M!==null&&M!=="false",C=(W1.get(x)||0)+1,S=(s.get(x)||0)+1;W1.set(x,C),s.set(x,S),u.push(x),C===1&&_&&J0.set(x,!0),S===1&&x.setAttribute(a,"true"),_||x.setAttribute(r,"true")}catch(L){console.error("aria-hidden: cannot operate on ",x,L)}})};return b(t),h.clear(),LR++,function(){u.forEach(function(k){var x=W1.get(k)-1,M=s.get(k)-1;W1.set(k,x),s.set(k,M),x||(J0.has(k)||k.removeAttribute(r),J0.delete(k)),M||k.removeAttribute(a)}),LR--,LR||(W1=new WeakMap,W1=new WeakMap,J0=new WeakMap,eh={})}},uj=function(e,t,a){a===void 0&&(a="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),c=rCe(e);return c?(r.push.apply(r,Array.from(c.querySelectorAll("[aria-live], script"))),cCe(r,c,a,"aria-hidden")):function(){return null}},sCe=Object.defineProperty,Vn=(e,t)=>sCe(e,"name",{value:t,configurable:!0}),Nq="Dialog",[IG,CDe]=Vt(Nq),[lCe,Ia]=IG(Nq),Iq=Vn(e=>{const{__scopeDialog:t,children:a,open:r,defaultOpen:c,onOpenChange:s,modal:u=!0}=e,h=m.useRef(null),y=m.useRef(null),{nodes:p,registry:b}=sj(),[k,x]=Wt({prop:r,defaultProp:c??!1,onChange:s,caller:Nq}),[M,_]=m.useState(0),[C,S]=m.useState(0);return g.jsx(lCe,{scope:t,triggerRef:h,contentRef:y,contentId:pt(),titleId:pt(),descriptionId:pt(),titlePresent:M>0,descriptionPresent:C>0,setTitleCount:_,setDescriptionCount:S,open:k,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(L=>!L),[x]),modal:u,branchNodes:p,branchRegistry:b,children:a})},"Dialog"),dCe="DialogTrigger",AG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia(dCe,r),u=Pe(a,s.triggerRef);return g.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":pj(s.open),...c,ref:u,onClick:ye(t.onClick,s.onOpenToggle)})},"DialogTrigger")),jG="DialogPortal",[uCe,EG]=IG(jG,{forceMount:void 0}),Aq=Vn(e=>{const{__scopeDialog:t,forceMount:a,children:r,container:c}=e,s=Ia(jG,t);return g.jsx(uCe,{scope:t,forceMount:a,children:m.Children.map(r,u=>g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),dD="DialogOverlay",jq=m.forwardRef(Vn(function(t,a){const r=EG(dD,t.__scopeDialog),{forceMount:c=r.forceMount,...s}=t,u=Ia(dD,t.__scopeDialog);return u.modal?g.jsx(bn,{present:c||u.open,children:g.jsx(pCe,{...s,ref:a})}):null},"DialogOverlay")),hCe=Ca("DialogOverlay.RemoveScroll"),pCe=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia(dD,r),u=uG(),h=Pe(a,u);return g.jsx(k2,{as:hCe,allowPinchZoom:!0,shards:m.useMemo(()=>[s.contentRef,...s.branchNodes.map(y=>({current:y}))],[s.contentRef,s.branchNodes]),children:g.jsx(we.div,{"data-state":pj(s.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),t2="DialogContent",Eq=m.forwardRef(Vn(function(t,a){const r=EG(t2,t.__scopeDialog),{forceMount:c=r.forceMount,...s}=t,u=Ia(t2,t.__scopeDialog);return g.jsx(bn,{present:c||u.open,children:u.modal?g.jsx(fCe,{...s,ref:a}):g.jsx(yCe,{...s,ref:a})})},"DialogContent")),fCe=m.forwardRef(Vn(function(t,a){const r=Ia(t2,t.__scopeDialog),c=m.useRef(null),s=Pe(a,r.contentRef,c);return m.useEffect(()=>{const u=c.current;if(u)return uj(u)},[]),g.jsx(PG,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ye(t.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,u=>{const h=u.detail.originalEvent,y=h.button===0&&h.ctrlKey===!0;(h.button===2||y)&&u.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),yCe=m.forwardRef(Vn(function(t,a){const r=Ia(t2,t.__scopeDialog),c=m.useRef(!1),s=m.useRef(!1);return g.jsx(PG,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||r.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,s.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})},"DialogContentNonModal")),PG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:u,"aria-describedby":h,children:y,...p}=t,b=Ia(t2,r);return xd(),g.jsx(cj,{registry:b.branchRegistry,children:g.jsx(ij,{asChild:!0,loop:!0,trapped:c,branches:b.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:u,children:g.jsx(g2,{role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?qG(h,b.descriptionId):h,"data-state":pj(b.open),...p,ref:a,deferPointerDownOutside:!0,onDismiss:()=>b.onOpenChange(!1),children:y})})})},"DialogContentImpl")),RG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia("DialogTitle",r),{setTitleCount:u}=s;return ht(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),g.jsx(we.h2,{id:s.titleId,...c,ref:a})},"DialogTitle")),DG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia("DialogDescription",r),{setDescriptionCount:u}=s;return ht(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),g.jsx(we.p,{id:s.descriptionId,...c,ref:a})},"DialogDescription")),mCe="DialogClose",hj=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia(mCe,r);return g.jsx(we.button,{type:"button",...c,ref:a,onClick:ye(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function qG(...e){const t=new Set;for(const a of e)if(typeof a=="string")for(const r of String(a).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Vn(qG,"concatAriaDescribedby");function pj(e){return e?"open":"closed"}Vn(pj,"getState");var _u='[cmdk-group=""]',NR='[cmdk-group-items=""]',gCe='[cmdk-group-heading=""]',zG='[cmdk-item=""]',rB=`${zG}:not([aria-disabled="true"])`,uD="cmdk-item-select",K1="data-value",kCe=(e,t,a)=>pSe(e,t,a),TG=m.createContext(void 0),v2=()=>m.useContext(TG),$G=m.createContext(void 0),Pq=()=>m.useContext($G),OG=m.createContext(void 0),HG=m.forwardRef((e,t)=>{let a=Q1(()=>{var z,J;return{search:"",value:(J=(z=e.value)!=null?z:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Q1(()=>new Set),c=Q1(()=>new Map),s=Q1(()=>new Map),u=Q1(()=>new Set),h=VG(e),{label:y,children:p,value:b,onValueChange:k,filter:x,shouldFilter:M,loop:_,disablePointerSelection:C=!1,vimBindings:S=!0,...L}=e,A=pt(),N=pt(),j=pt(),T=m.useRef(null),R=ICe();Ol(()=>{if(b!==void 0){let z=b.trim();a.current.value=z,q.emit()}},[b]),Ol(()=>{R(6,X)},[]);let q=m.useMemo(()=>({subscribe:z=>(u.current.add(z),()=>u.current.delete(z)),snapshot:()=>a.current,setState:(z,J,K)=>{var W,U,de,ke;if(!Object.is(a.current[z],J)){if(a.current[z]=J,z==="search")G(),re(),R(1,F);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(j);ie?ie.focus():(W=document.getElementById(A))==null||W.focus()}if(R(7,()=>{var ie;a.current.selectedItemId=(ie=ae())==null?void 0:ie.id,q.emit()}),K||R(5,X),((U=h.current)==null?void 0:U.value)!==void 0){let ie=J??"";(ke=(de=h.current).onValueChange)==null||ke.call(de,ie);return}}q.emit()}},emit:()=>{u.current.forEach(z=>z())}}),[]),$=m.useMemo(()=>({value:(z,J,K)=>{var W;J!==((W=s.current.get(z))==null?void 0:W.value)&&(s.current.set(z,{value:J,keywords:K}),a.current.filtered.items.set(z,ee(J,K)),R(2,()=>{re(),q.emit()}))},item:(z,J)=>(r.current.add(z),J&&(c.current.has(J)?c.current.get(J).add(z):c.current.set(J,new Set([z]))),R(3,()=>{G(),re(),a.current.value||F(),q.emit()}),()=>{s.current.delete(z),r.current.delete(z),a.current.filtered.items.delete(z);let K=ae();R(4,()=>{G(),K?.getAttribute("id")===z&&F(),q.emit()})}),group:z=>(c.current.has(z)||c.current.set(z,new Set),()=>{s.current.delete(z),c.current.delete(z)}),filter:()=>h.current.shouldFilter,label:y||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:A,inputId:j,labelId:N,listInnerRef:T}),[]);function ee(z,J){var K,W;let U=(W=(K=h.current)==null?void 0:K.filter)!=null?W:kCe;return z?U(z,a.current.search,J):0}function re(){if(!a.current.search||h.current.shouldFilter===!1)return;let z=a.current.filtered.items,J=[];a.current.filtered.groups.forEach(W=>{let U=c.current.get(W),de=0;U.forEach(ke=>{let ie=z.get(ke);de=Math.max(ie,de)}),J.push([W,de])});let K=T.current;he().sort((W,U)=>{var de,ke;let ie=W.getAttribute("id"),pe=U.getAttribute("id");return((de=z.get(pe))!=null?de:0)-((ke=z.get(ie))!=null?ke:0)}).forEach(W=>{let U=W.closest(NR);U?U.appendChild(W.parentElement===U?W:W.closest(`${NR} > *`)):K.appendChild(W.parentElement===K?W:W.closest(`${NR} > *`))}),J.sort((W,U)=>U[1]-W[1]).forEach(W=>{var U;let de=(U=T.current)==null?void 0:U.querySelector(`${_u}[${K1}="${encodeURIComponent(W[0])}"]`);de?.parentElement.appendChild(de)})}function F(){let z=he().find(K=>K.getAttribute("aria-disabled")!=="true"),J=z?.getAttribute(K1);q.setState("value",J||void 0)}function G(){var z,J,K,W;if(!a.current.search||h.current.shouldFilter===!1){a.current.filtered.count=r.current.size;return}a.current.filtered.groups=new Set;let U=0;for(let de of r.current){let ke=(J=(z=s.current.get(de))==null?void 0:z.value)!=null?J:"",ie=(W=(K=s.current.get(de))==null?void 0:K.keywords)!=null?W:[],pe=ee(ke,ie);a.current.filtered.items.set(de,pe),pe>0&&U++}for(let[de,ke]of c.current)for(let ie of ke)if(a.current.filtered.items.get(ie)>0){a.current.filtered.groups.add(de);break}a.current.filtered.count=U}function X(){var z,J,K;let W=ae();W&&(((z=W.parentElement)==null?void 0:z.firstChild)===W&&((K=(J=W.closest(_u))==null?void 0:J.querySelector(gCe))==null||K.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function ae(){var z;return(z=T.current)==null?void 0:z.querySelector(`${zG}[aria-selected="true"]`)}function he(){var z;return Array.from(((z=T.current)==null?void 0:z.querySelectorAll(rB))||[])}function P(z){let J=he()[z];J&&q.setState("value",J.getAttribute(K1))}function E(z){var J;let K=ae(),W=he(),U=W.findIndex(ke=>ke===K),de=W[U+z];(J=h.current)!=null&&J.loop&&(de=U+z<0?W[W.length-1]:U+z===W.length?W[0]:W[U+z]),de&&q.setState("value",de.getAttribute(K1))}function O(z){let J=ae(),K=J?.closest(_u),W;for(;K&&!W;)K=z>0?LCe(K,_u):NCe(K,_u),W=K?.querySelector(rB);W?q.setState("value",W.getAttribute(K1)):E(z)}let Y=()=>P(he().length-1),V=z=>{z.preventDefault(),z.metaKey?Y():z.altKey?O(1):E(1)},D=z=>{z.preventDefault(),z.metaKey?P(0):z.altKey?O(-1):E(-1)};return m.createElement(we.div,{ref:t,tabIndex:-1,...L,"cmdk-root":"",onKeyDown:z=>{var J;(J=L.onKeyDown)==null||J.call(L,z);let K=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||K))switch(z.key){case"n":case"j":{S&&z.ctrlKey&&V(z);break}case"ArrowDown":{V(z);break}case"p":case"k":{S&&z.ctrlKey&&D(z);break}case"ArrowUp":{D(z);break}case"Home":{z.preventDefault(),P(0);break}case"End":{z.preventDefault(),Y();break}case"Enter":{z.preventDefault();let W=ae();if(W){let U=new Event(uD);W.dispatchEvent(U)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:jCe},y),fj(e,z=>m.createElement($G.Provider,{value:q},m.createElement(TG.Provider,{value:$},z))))}),vCe=m.forwardRef((e,t)=>{var a,r;let c=pt(),s=m.useRef(null),u=m.useContext(OG),h=v2(),y=VG(e),p=(r=(a=y.current)==null?void 0:a.forceMount)!=null?r:u?.forceMount;Ol(()=>{if(!p)return h.item(c,u?.id)},[p]);let b=BG(c,s,[e.value,e.children,s],e.keywords),k=Pq(),x=Mr(R=>R.value&&R.value===b.current),M=Mr(R=>p||h.filter()===!1?!0:R.search?R.filtered.items.get(c)>0:!0);m.useEffect(()=>{let R=s.current;if(!(!R||e.disabled))return R.addEventListener(uD,_),()=>R.removeEventListener(uD,_)},[M,e.onSelect,e.disabled]);function _(){var R,q;C(),(q=(R=y.current).onSelect)==null||q.call(R,b.current)}function C(){k.setState("value",b.current,!0)}if(!M)return null;let{disabled:S,value:L,onSelect:A,forceMount:N,keywords:j,...T}=e;return m.createElement(we.div,{ref:Tl(s,t),...T,id:c,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!x,"data-disabled":!!S,"data-selected":!!x,onPointerMove:S||h.getDisablePointerSelection()?void 0:C,onClick:S?void 0:_},e.children)}),bCe=m.forwardRef((e,t)=>{let{heading:a,children:r,forceMount:c,...s}=e,u=pt(),h=m.useRef(null),y=m.useRef(null),p=pt(),b=v2(),k=Mr(M=>c||b.filter()===!1?!0:M.search?M.filtered.groups.has(u):!0);Ol(()=>b.group(u),[]),BG(u,h,[e.value,e.heading,y]);let x=m.useMemo(()=>({id:u,forceMount:c}),[c]);return m.createElement(we.div,{ref:Tl(h,t),...s,"cmdk-group":"",role:"presentation",hidden:k?void 0:!0},a&&m.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:p},a),fj(e,M=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?p:void 0},m.createElement(OG.Provider,{value:x},M))))}),xCe=m.forwardRef((e,t)=>{let{alwaysRender:a,...r}=e,c=m.useRef(null),s=Mr(u=>!u.search);return!a&&!s?null:m.createElement(we.div,{ref:Tl(c,t),...r,"cmdk-separator":"",role:"separator"})}),MCe=m.forwardRef((e,t)=>{let{onValueChange:a,...r}=e,c=e.value!=null,s=Pq(),u=Mr(p=>p.search),h=Mr(p=>p.selectedItemId),y=v2();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(we.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":h,id:y.inputId,type:"text",value:c?e.value:u,onChange:p=>{c||s.setState("search",p.target.value),a?.(p.target.value)}})}),wCe=m.forwardRef((e,t)=>{let{children:a,label:r="Suggestions",...c}=e,s=m.useRef(null),u=m.useRef(null),h=Mr(p=>p.selectedItemId),y=v2();return m.useEffect(()=>{if(u.current&&s.current){let p=u.current,b=s.current,k,x=new ResizeObserver(()=>{k=requestAnimationFrame(()=>{let M=p.offsetHeight;b.style.setProperty("--cmdk-list-height",M.toFixed(1)+"px")})});return x.observe(p),()=>{cancelAnimationFrame(k),x.unobserve(p)}}},[]),m.createElement(we.div,{ref:Tl(s,t),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":r,id:y.listId},fj(e,p=>m.createElement("div",{ref:Tl(u,y.listInnerRef),"cmdk-list-sizer":""},p)))}),_Ce=m.forwardRef((e,t)=>{let{open:a,onOpenChange:r,overlayClassName:c,contentClassName:s,container:u,...h}=e;return m.createElement(Iq,{open:a,onOpenChange:r},m.createElement(Aq,{container:u},m.createElement(jq,{"cmdk-overlay":"",className:c}),m.createElement(Eq,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement(HG,{ref:t,...h}))))}),SCe=m.forwardRef((e,t)=>Mr(a=>a.filtered.count===0)?m.createElement(we.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CCe=m.forwardRef((e,t)=>{let{progress:a,children:r,label:c="Loading...",...s}=e;return m.createElement(we.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},fj(e,u=>m.createElement("div",{"aria-hidden":!0},u)))}),Wl=Object.assign(HG,{List:wCe,Item:vCe,Input:MCe,Group:bCe,Separator:xCe,Dialog:_Ce,Empty:SCe,Loading:CCe});function LCe(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function NCe(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function VG(e){let t=m.useRef(e);return Ol(()=>{t.current=e}),t}var Ol=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Q1(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Mr(e){let t=Pq(),a=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,a,a)}function BG(e,t,a,r=[]){let c=m.useRef(),s=v2();return Ol(()=>{var u;let h=(()=>{var p;for(let b of a){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(p=b.current.textContent)==null?void 0:p.trim():c.current}})(),y=r.map(p=>p.trim());s.value(e,h,y),(u=t.current)==null||u.setAttribute(K1,h),c.current=h}),c}var ICe=()=>{let[e,t]=m.useState(),a=Q1(()=>new Map);return Ol(()=>{a.current.forEach(r=>r()),a.current=new Map},[e]),(r,c)=>{a.current.set(r,c),t({})}};function ACe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function fj({asChild:e,children:t},a){return e&&m.isValidElement(t)?m.cloneElement(ACe(t),{ref:t.ref},a(t.props.children)):a(t)}var jCe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function yj({...e}){return g.jsx(Iq,{"data-slot":"dialog",...e})}function FG({...e}){return g.jsx(AG,{"data-slot":"dialog-trigger",...e})}function UG({...e}){return g.jsx(Aq,{"data-slot":"dialog-portal",...e})}function hD({...e}){return g.jsx(hj,{"data-slot":"dialog-close",...e})}function GG({className:e,...t}){return g.jsx(jq,{"data-slot":"dialog-overlay",className:Q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1010] bg-black/50",e),...t})}function mj({className:e,children:t,...a}){return g.jsxs(UG,{"data-slot":"dialog-portal",children:[g.jsx(GG,{}),g.jsxs(Eq,{"data-slot":"dialog-content",className:Q("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...a,children:[t,g.jsxs(hj,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(vr,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gj({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Q("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ZG({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:Q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function kj({className:e,...t}){return g.jsx(RG,{"data-slot":"dialog-title",className:Q("text-lg leading-none font-semibold",e),...t})}function WG({className:e,...t}){return g.jsx(DG,{"data-slot":"dialog-description",className:Q("text-muted-foreground text-sm",e),...t})}function Rq({className:e,...t}){return g.jsx(Wl,{"data-slot":"command",className:Q("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function ECe({title:e="Command Palette",description:t="Search for a command to run...",shouldFilter:a,children:r,...c}){return g.jsxs(yj,{...c,children:[g.jsxs(gj,{className:"sr-only",children:[g.jsx(kj,{children:e}),g.jsx(WG,{children:t})]}),g.jsx(mj,{className:"overflow-hidden p-0 z-[1011]",children:g.jsx(Rq,{shouldFilter:a,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function YG({className:e,...t}){return g.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g.jsx(Vu,{className:"size-4 shrink-0 opacity-50"}),g.jsx(Wl.Input,{"data-slot":"command-input",className:Q("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function XG({className:e,...t}){return g.jsx(Wl.List,{"data-slot":"command-list",className:Q("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function KG({...e}){return g.jsx(Wl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function QG({className:e,...t}){return g.jsx(Wl.Group,{"data-slot":"command-group",className:Q("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function JG({className:e,...t}){return g.jsx(Wl.Separator,{"data-slot":"command-separator",className:Q("bg-border -mx-1 h-px",e),...t})}function eZ({className:e,...t}){return g.jsx(Wl.Item,{"data-slot":"command-item",className:Q("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function PCe({className:e,...t}){return g.jsx("span",{"data-slot":"command-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var RCe=Object.defineProperty,Ht=(e,t)=>RCe(e,"name",{value:t,configurable:!0});function Md(e){const t=e+"CollectionProvider",[a,r]=Vt(t),[c,s]=a(t,{collectionRef:{current:null},itemMap:new Map}),u=Ht(C=>{const{scope:S,children:L}=C,A=m.useRef(null),N=m.useRef(new Map).current;return g.jsx(c,{scope:S,itemMap:N,collectionRef:A,children:L})},"CollectionProvider");u.displayName=t;const h=e+"CollectionSlot",y=Ca(h),p=m.forwardRef((C,S)=>{const{scope:L,children:A}=C,N=s(h,L),j=Pe(S,N.collectionRef);return g.jsx(y,{ref:j,children:A})});p.displayName=h;const b=e+"CollectionItemSlot",k="data-radix-collection-item",x=Ca(b),M=m.forwardRef((C,S)=>{const{scope:L,children:A,...N}=C,j=m.useRef(null),T=Pe(S,j),R=s(b,L);return m.useEffect(()=>(R.itemMap.set(j,{ref:j,...N}),()=>{R.itemMap.delete(j)})),g.jsx(x,{[k]:"",ref:T,children:A})});M.displayName=b;function _(C){const S=s(e+"CollectionConsumer",C);return m.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${k}]`));return Array.from(S.itemMap.values()).sort((R,q)=>N.indexOf(R.ref.current)-N.indexOf(q.ref.current))},[S.collectionRef,S.itemMap])}return Ht(_,"useCollection"),[{Provider:u,Slot:p,ItemSlot:M},_,r]}Ht(Md,"createCollection");var iB=new WeakMap,St,Qn,th=(Qn=class extends Map{constructor(a){super(a);DH(this,St);XP(this,St,[...super.keys()]),iB.set(this,!0)}set(a,r){return iB.get(this)&&!this.has(a)&&tn(this,St).push(a),super.set(a,r),this}insert(a,r,c){const s=this.has(r),u=s?this.size:this.size+1,h=Dq(a),y=h>=0?Math.min(h,u-1):Math.max(u+h,0);if(s?tn(this,St).indexOf(r)===y:y===this.size)return this.set(r,c),this;const p=tn(this,St).filter(k=>k!==r);p.splice(y,0,r);const b=p.map(k=>[k,k===r?c:this.get(k)]);this.clear();for(const[k,x]of b)this.set(k,x);return this}with(a,r,c){const s=new Qn(this);return s.insert(a,r,c),s}before(a){const r=tn(this,St).indexOf(a)-1;if(!(r<0))return this.entryAt(r)}setBefore(a,r,c){const s=tn(this,St).indexOf(a);if(s===-1)return this;const u=tn(this,St).indexOf(r),h=u!==-1&&u<s?s-1:s;return this.insert(h,r,c)}after(a){let r=tn(this,St).indexOf(a);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(a,r,c){const s=tn(this,St).indexOf(a);if(s===-1)return this;const u=tn(this,St).indexOf(r),h=u!==-1&&u<=s?s:s+1;return this.insert(h,r,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return XP(this,St,[]),super.clear()}delete(a){const r=super.delete(a);return r&&tn(this,St).splice(tn(this,St).indexOf(a),1),r}deleteAt(a){const r=this.keyAt(a);return r!==void 0?this.delete(r):!1}at(a){const r=gA(tn(this,St),a);if(r!==void 0)return this.get(r)}entryAt(a){const r=gA(tn(this,St),a);if(r!==void 0)return[r,this.get(r)]}indexOf(a){return tn(this,St).indexOf(a)}keyAt(a){return gA(tn(this,St),a)}from(a,r){const c=this.indexOf(a);if(c===-1)return;let s=c+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(a,r){const c=this.indexOf(a);if(c===-1)return;let s=c+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(a,r){let c=0;for(const s of this){if(Reflect.apply(a,r,[s,c,this]))return s;c++}}findIndex(a,r){let c=0;for(const s of this){if(Reflect.apply(a,r,[s,c,this]))return c;c++}return-1}filter(a,r){const c=[];let s=0;for(const u of this)Reflect.apply(a,r,[u,s,this])&&c.push(u),s++;return new Qn(c)}map(a,r){const c=[];let s=0;for(const u of this)c.push([u[0],Reflect.apply(a,r,[u,s,this])]),s++;return new Qn(c)}reduce(...a){const[r,c]=a,s=a.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,h=c;for(const y of this)u===0&&!s?h=y:h=Reflect.apply(r,this,[h,y,u,this]),u++;return h}reduceRight(...a){const[r,c]=a,s=a.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let h=this.size-1;h>=0;h--){const y=this.entryAt(h);h===this.size-1&&!s?u=y:u=Reflect.apply(r,this,[u,y,h,this])}return u}sort(a){if(typeof a!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(a);this.clear();for(const[c,s]of r)this.set(c,s);return this}toSorted(a){if(typeof a!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(a);return new Qn(r)}toReversed(){const a=new Qn;for(let r=this.size-1;r>=0;r--){const c=this.keyAt(r),s=this.get(c);a.set(c,s)}return a}toSpliced(...a){const r=[...this.entries()];return r.splice(...a),new Qn(r)}slice(a,r){const c=new Qn;for(const s of tn(this,St).slice(a,r))c.set(s,this.get(s));return c}every(a,r){let c=0;for(const s of this){if(!Reflect.apply(a,r,[s,c,this]))return!1;c++}return!0}some(a,r){let c=0;for(const s of this){if(Reflect.apply(a,r,[s,c,this]))return!0;c++}return!1}},St=new WeakMap,Ht(Qn,"OrderedDict"),Qn);function gA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const a=tZ(e,t);return a===-1?void 0:e[a]}Ht(gA,"at");function tZ(e,t){const a=e.length,r=Dq(t),c=r>=0?r:a+r;return c<0||c>=a?-1:c}Ht(tZ,"toSafeIndex");function Dq(e){return e!==e||e===0?0:Math.trunc(e)}Ht(Dq,"toSafeInteger");function DCe(e){const t=e+"CollectionProvider",[a,r]=Vt(t),[c,s]=a(t);c.displayName=e+"CollectionStableContextProvider";const[u,h]=a(t);u.displayName=e+"CollectionStatefulContextProvider";const y=Ht(({state:R,...q})=>R?g.jsx(b,{...q,state:R}):g.jsx(p,{...q}),"CollectionProvider");y.displayName=t;const p=Ht(R=>{const q=A();return g.jsx(b,{...R,state:q})},"CollectionInit");p.displayName=e+"CollectionInit";const b=Ht(R=>{const{scope:q,children:$,state:ee}=R,re=m.useRef(null),[F,G]=m.useState(null),X=Pe(re,G),[ae,he]=ee,P=m.useRef(new th),E=m.useCallback(()=>{const O=P.current;return oZ(O)||O.sort(kA),O},[]);return m.useEffect(()=>{if(!F)return;const O=rZ(()=>{he(Y=>{const V=Y.toSorted(kA);return V.some(([z],J)=>Y.keyAt(J)!==z)?V:Y})});return O.observe(F,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[F,he]),g.jsx(c,{scope:q,collectionElementRef:X,collectionElementRefObject:re,getCollection:E,setCollection:he,registryRef:P,children:g.jsx(u,{scope:q,collectionElement:F,collection:ae,children:$})})},"CollectionProviderImpl");b.displayName=e+"CollectionProviderImpl";const k=e+"CollectionSlot",x=Ca(k),M=m.forwardRef((R,q)=>{const{scope:$,children:ee}=R,re=s(k,$),F=Pe(q,re.collectionElementRef);return g.jsx(x,{ref:F,children:ee})});M.displayName=k;const _=e+"CollectionItemSlot",C="data-radix-collection-item",S=Ca(_),L=m.forwardRef((R,q)=>{const{scope:$,children:ee,...re}=R,F=m.useRef(null),G=s(_,$),{setCollection:X,registryRef:ae}=G,he=m.useRef(re);nZ(he.current,re)||(he.current=re);const P=he.current,E=m.useCallback(V=>{const D=ae.current;V?D.set(V,{...he.current,element:V}):F.current&&D.delete(F.current)},[ae]),O=Pe(q,E,F);ht(()=>{const V=F.current,D=ae.current;V&&D.has(V)&&D.set(V,{...P,element:V})},[P,ae]);const Y=m.useRef(null);return m.useEffect(()=>{const V=F.current,D=Y.current;(D?.element??null)===V&&(!V||D?.itemData===P)||(Y.current=V?{element:V,itemData:P}:null,X(z=>{const J=new th(z);return D&&D.element!==V&&J.delete(D.element),V&&J.set(V,{...P,element:V}),J.sort(kA)}))}),m.useEffect(()=>()=>{const V=Y.current;Y.current=null,V&&X(D=>{if(!D.has(V.element))return D;const z=new th(D);return z.delete(V.element),z})},[X]),g.jsx(S,{[C]:"",ref:O,children:ee})});L.displayName=_;function A(){return m.useState(new th)}Ht(A,"useInitCollection");function N(R){const{collection:q}=h(e+"CollectionConsumer",R);return q}Ht(N,"useCollection");function j(R){const{getCollection:q}=s(e+"CollectionConsumer",R);return q}return Ht(j,"useGetCollection"),[{Provider:y,Slot:M,ItemSlot:L},{createCollectionScope:r,useCollection:N,useGetCollection:j,useInitCollection:A}]}Ht(DCe,"createCollection");function nZ(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(const c of a)if(!Object.prototype.hasOwnProperty.call(t,c)||e[c]!==t[c])return!1;return!0}Ht(nZ,"shallowEqual");function aZ(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ht(aZ,"isElementPreceding");function oZ(e){let t;for(const a of e.keys()){if(t){const r=t.compareDocumentPosition(a);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=a}return!0}Ht(oZ,"isInDocumentOrder");function kA(e,t){return!e[1].element||!t[1].element?0:aZ(e[1].element,t[1].element)?-1:1}Ht(kA,"sortByDocumentPosition");function rZ(e){return new MutationObserver(a=>{for(const r of a)if(r.type==="childList"){e();return}})}Ht(rZ,"getChildListObserver");var qCe=Object.defineProperty,zCe=(e,t)=>qCe(e,"name",{value:t,configurable:!0}),TCe={LTR:"ltr"},$Ce=m.createContext(void 0);function Yl(e){const t=m.useContext($Ce);return e||t||TCe.LTR}zCe(Yl,"useDirection");const OCe=["top","right","bottom","left"],wr=Math.min,So=Math.max,HA=Math.round,nh=Math.floor,Co=e=>({x:e,y:e}),HCe={left:"right",right:"left",bottom:"top",top:"bottom"};function iZ(e,t,a){return So(e,wr(t,a))}function Eo(e,t){return typeof e=="function"?e(t):e}function _r(e){return e.split("-")[0]}function wd(e){return e.split("-")[1]}function qq(e){return e==="x"?"y":"x"}function zq(e){return e==="y"?"height":"width"}function Fa(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tq(e){return qq(Fa(e))}function VCe(e,t,a){a===void 0&&(a=!1);const r=wd(e),c=Tq(e),s=zq(c);let u=c==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=VA(u)),[u,VA(u)]}function BCe(e){const t=VA(e);return[pD(e),t,pD(t)]}function pD(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cB=["left","right"],sB=["right","left"],FCe=["top","bottom"],UCe=["bottom","top"];function GCe(e,t,a){switch(e){case"top":case"bottom":return a?t?sB:cB:t?cB:sB;case"left":case"right":return t?FCe:UCe;default:return[]}}function ZCe(e,t,a,r){const c=wd(e);let s=GCe(_r(e),a==="start",r);return c&&(s=s.map(u=>u+"-"+c),t&&(s=s.concat(s.map(pD)))),s}function VA(e){const t=_r(e);return HCe[t]+e.slice(t.length)}function WCe(e){var t,a,r,c;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(r=e.bottom)!=null?r:0,left:(c=e.left)!=null?c:0}}function cZ(e){return typeof e!="number"?WCe(e):{top:e,right:e,bottom:e,left:e}}function BA(e){const{x:t,y:a,width:r,height:c}=e;return{width:r,height:c,top:a,left:t,right:t+r,bottom:a+c,x:t,y:a}}function lB(e,t,a){let{reference:r,floating:c}=e;const s=Fa(t),u=Tq(t),h=zq(u),y=_r(t),p=s==="y",b=r.x+r.width/2-c.width/2,k=r.y+r.height/2-c.height/2,x=r[h]/2-c[h]/2;let M;switch(y){case"top":M={x:b,y:r.y-c.height};break;case"bottom":M={x:b,y:r.y+r.height};break;case"right":M={x:r.x+r.width,y:k};break;case"left":M={x:r.x-c.width,y:k};break;default:M={x:r.x,y:r.y}}const _=wd(t);return _&&(M[u]+=x*(_==="end"?1:-1)*(a&&p?-1:1)),M}async function YCe(e,t){var a;t===void 0&&(t={});const{x:r,y:c,platform:s,rects:u,elements:h,strategy:y}=e,{boundary:p="clippingAncestors",rootBoundary:b="viewport",elementContext:k="floating",altBoundary:x=!1,padding:M=0}=Eo(t,e),_=cZ(M),S=h[x?k==="floating"?"reference":"floating":k],L=BA(await s.getClippingRect({element:(a=await(s.isElement==null?void 0:s.isElement(S)))==null||a?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(h.floating)),boundary:p,rootBoundary:b,strategy:y})),A=k==="floating"?{x:r,y:c,width:u.floating.width,height:u.floating.height}:u.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h.floating)),j=await(s.isElement==null?void 0:s.isElement(N))&&await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1},T=BA(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:N,strategy:y}):A);return{top:(L.top-T.top+_.top)/j.y,bottom:(T.bottom-L.bottom+_.bottom)/j.y,left:(L.left-T.left+_.left)/j.x,right:(T.right-L.right+_.right)/j.x}}const XCe=50,KCe=async(e,t,a)=>{const{placement:r="bottom",strategy:c="absolute",middleware:s=[],platform:u}=a,h=u.detectOverflow?u:{...u,detectOverflow:YCe},y=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:c}),{x:b,y:k}=lB(p,r,y),x=r,M=0;const _={};for(let C=0;C<s.length;C++){const S=s[C];if(!S)continue;const{name:L,fn:A}=S,{x:N,y:j,data:T,reset:R}=await A({x:b,y:k,initialPlacement:r,placement:x,strategy:c,middlewareData:_,rects:p,platform:h,elements:{reference:e,floating:t}});b=N??b,k=j??k,_[L]={..._[L],...T},R&&M<XCe&&(M++,typeof R=="object"&&(R.placement&&(x=R.placement),R.rects&&(p=R.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:c}):R.rects),{x:b,y:k}=lB(p,x,y)),C=-1)}return{x:b,y:k,placement:x,strategy:c,middlewareData:_}},QCe=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:r,placement:c,rects:s,platform:u,elements:h,middlewareData:y}=t,{element:p,padding:b=0}=Eo(e,t)||{};if(p==null)return{};const k=cZ(b),x={x:a,y:r},M=Tq(c),_=zq(M),C=await u.getDimensions(p),S=M==="y",L=S?"top":"left",A=S?"bottom":"right",N=S?"clientHeight":"clientWidth",j=s.reference[_]+s.reference[M]-x[M]-s.floating[_],T=x[M]-s.reference[M],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let q=R?R[N]:0;(!q||!await(u.isElement==null?void 0:u.isElement(R)))&&(q=h.floating[N]||s.floating[_]);const $=j/2-T/2,ee=q/2-C[_]/2-1,re=wr(k[L],ee),F=wr(k[A],ee),G=q-C[_]-F,X=q/2-C[_]/2+$,ae=iZ(re,X,G),he=!y.arrow&&wd(c)!=null&&X!==ae&&s.reference[_]/2-(X<re?re:F)-C[_]/2<0,P=he?X<re?X-re:X-G:0;return{[M]:x[M]+P,data:{[M]:ae,centerOffset:X-ae-P,...he&&{alignmentOffset:P}},reset:he}}}),JCe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,r;const{placement:c,middlewareData:s,rects:u,initialPlacement:h,platform:y,elements:p}=t,{mainAxis:b=!0,crossAxis:k=!0,fallbackPlacements:x,fallbackStrategy:M="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:C=!0,...S}=Eo(e,t);if((a=s.arrow)!=null&&a.alignmentOffset)return{};const L=_r(c),A=Fa(h),N=_r(h)===h,j=await(y.isRTL==null?void 0:y.isRTL(p.floating)),T=x||(N||!C?[VA(h)]:BCe(h)),R=_!=="none";!x&&R&&T.push(...ZCe(h,C,_,j));const q=[h,...T],$=await y.detectOverflow(t,S),ee=[];let re=((r=s.flip)==null?void 0:r.overflows)||[];if(b&&ee.push($[L]),k){const ae=VCe(c,u,j);ee.push($[ae[0]],$[ae[1]])}if(re=[...re,{placement:c,overflows:ee}],!ee.every(ae=>ae<=0)){var F,G;const ae=(((F=s.flip)==null?void 0:F.index)||0)+1,he=q[ae];if(he&&(!(k==="alignment"?A!==Fa(he):!1)||re.every(O=>Fa(O.placement)===A?O.overflows[0]>0:!0)))return{data:{index:ae,overflows:re},reset:{placement:he}};let P=(G=re.filter(E=>E.overflows[0]<=0).sort((E,O)=>E.overflows[1]-O.overflows[1])[0])==null?void 0:G.placement;if(!P)switch(M){case"bestFit":{var X;const E=(X=re.filter(O=>{if(R){const Y=Fa(O.placement);return Y===A||Y==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(Y=>Y>0).reduce((Y,V)=>Y+V,0)]).sort((O,Y)=>O[1]-Y[1])[0])==null?void 0:X[0];E&&(P=E);break}case"initialPlacement":P=h;break}if(c!==P)return{reset:{placement:P}}}return{}}}};function dB(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uB(e){return OCe.some(t=>e[t]>=0)}const eLe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:r}=t,{strategy:c="referenceHidden",...s}=Eo(e,t);switch(c){case"referenceHidden":{const u=await r.detectOverflow(t,{...s,elementContext:"reference"}),h=dB(u,a.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:uB(h)}}}case"escaped":{const u=await r.detectOverflow(t,{...s,altBoundary:!0}),h=dB(u,a.floating);return{data:{escapedOffsets:h,escaped:uB(h)}}}default:return{}}}}},sZ=new Set(["left","top"]);async function tLe(e,t){const{placement:a,platform:r,elements:c}=e,s=await(r.isRTL==null?void 0:r.isRTL(c.floating)),u=_r(a),h=wd(a),y=Fa(a)==="y",p=sZ.has(u)?-1:1,b=s&&y?-1:1,k=Eo(t,e);let{mainAxis:x,crossAxis:M,alignmentAxis:_}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:k.mainAxis||0,crossAxis:k.crossAxis||0,alignmentAxis:k.alignmentAxis};return h&&typeof _=="number"&&(M=h==="end"?_*-1:_),y?{x:M*b,y:x*p}:{x:x*p,y:M*b}}const nLe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,r;const{x:c,y:s,placement:u,middlewareData:h}=t,y=await tLe(t,e);return u===((a=h.offset)==null?void 0:a.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:c+y.x,y:s+y.y,data:{...y,placement:u}}}}},aLe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:r,placement:c,platform:s}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:y={fn:A=>{let{x:N,y:j}=A;return{x:N,y:j}}},...p}=Eo(e,t),b={x:a,y:r},k=await s.detectOverflow(t,p),x=Fa(c),M=qq(x);let _=b[M],C=b[x];const S=(A,N)=>iZ(N+k[A==="y"?"top":"left"],N,N-k[A==="y"?"bottom":"right"]);u&&(_=S(M,_)),h&&(C=S(x,C));const L=y.fn({...t,[M]:_,[x]:C});return{...L,data:{x:L.x-a,y:L.y-r,enabled:{[M]:u,[x]:h}}}}}},oLe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,r;const{x:c,y:s,placement:u,rects:h,middlewareData:y}=t,{offset:p=0,mainAxis:b=!0,crossAxis:k=!0}=Eo(e,t),x={x:c,y:s},M=Fa(u),_=qq(M);let C=x[_],S=x[M];const L=Eo(p,t),A=typeof L=="number"?{mainAxis:L,crossAxis:0}:{mainAxis:(a=L.mainAxis)!=null?a:0,crossAxis:(r=L.crossAxis)!=null?r:0};if(b){const T=_==="y"?"height":"width",R=h.reference[_]-h.floating[T]+A.mainAxis,q=h.reference[_]+h.reference[T]-A.mainAxis;C<R?C=R:C>q&&(C=q)}if(k){var N,j;const T=_==="y"?"width":"height",R=sZ.has(_r(u)),q=h.reference[M]-h.floating[T]+(R&&((N=y.offset)==null?void 0:N[M])||0)+(R?0:A.crossAxis),$=h.reference[M]+h.reference[T]+(R?0:((j=y.offset)==null?void 0:j[M])||0)-(R?A.crossAxis:0);S<q?S=q:S>$&&(S=$)}return{[_]:C,[M]:S}}}},rLe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:r,platform:c,elements:s}=t,{apply:u=()=>{},...h}=Eo(e,t),y=await c.detectOverflow(t,h),p=_r(a),b=wd(a),k=Fa(a)==="y",{width:x,height:M}=r.floating;let _,C;p==="top"||p==="bottom"?(_=p,C=b===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(C=p,_=b==="end"?"top":"bottom");const S=M-y.top-y.bottom,L=x-y.left-y.right,A=wr(M-y[_],S),N=wr(x-y[C],L),j=t.middlewareData.shift,T=!j;let R=A,q=N;j!=null&&j.enabled.x&&(q=L),j!=null&&j.enabled.y&&(R=S),T&&!b&&(k?q=x-2*So(y.left,y.right):R=M-2*So(y.top,y.bottom)),await u({...t,availableWidth:q,availableHeight:R});const $=await c.getDimensions(s.floating);return x!==$.width||M!==$.height?{reset:{rects:!0}}:{}}}};function vj(){return typeof window<"u"}function _d(e){return lZ(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Po(e){var t;return(t=(lZ(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lZ(e){return vj()?e instanceof Node||e instanceof Hn(e).Node:!1}function Wa(e){return vj()?e instanceof Element||e instanceof Hn(e).Element:!1}function Ir(e){return vj()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function hB(e){return!vj()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}function bj(e){const{overflow:t,overflowX:a,overflowY:r,display:c}=Ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+a)&&c!=="inline"&&c!=="contents"}function iLe(e){return/^(table|td|th)$/.test(_d(e))}function xj(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const cLe=/transform|translate|scale|rotate|perspective|filter/,sLe=/paint|layout|strict|content/,ti=e=>!!e&&e!=="none";let IR;function $q(e){const t=Wa(e)?Ya(e):e;return ti(t.transform)||ti(t.translate)||ti(t.scale)||ti(t.rotate)||ti(t.perspective)||!Oq()&&(ti(t.backdropFilter)||ti(t.filter))||cLe.test(t.willChange||"")||sLe.test(t.contain||"")}function lLe(e){let t=Hl(e);for(;Ir(t)&&!n2(t);){if($q(t))return t;if(xj(t))return null;t=Hl(t)}return null}function Oq(){return IR==null&&(IR=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),IR}function n2(e){return/^(html|body|#document)$/.test(_d(e))}function Ya(e){return Hn(e).getComputedStyle(e)}function Mj(e){return Wa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hl(e){if(_d(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hB(e)&&e.host||Po(e);return hB(t)?t.host:t}function dZ(e){const t=Hl(e);return n2(t)?(e.ownerDocument||e).body:Ir(t)&&bj(t)?t:dZ(t)}function a2(e,t,a){var r;t===void 0&&(t=[]),a===void 0&&(a=!0);const c=dZ(e),s=c===((r=e.ownerDocument)==null?void 0:r.body),u=Hn(c);if(s){const h=fD(u);return t.concat(u,u.visualViewport||[],bj(c)?c:[],h&&a?a2(h):[])}else return t.concat(c,a2(c,[],a))}function fD(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uZ(e){const t=Ya(e);let a=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const c=Ir(e),s=c?e.offsetWidth:a,u=c?e.offsetHeight:r,h=HA(a)!==s||HA(r)!==u;return h&&(a=s,r=u),{width:a,height:r,$:h}}function Hq(e){return Wa(e)?e:e.contextElement}function ld(e){const t=Hq(e);if(!Ir(t))return Co(1);const a=t.getBoundingClientRect(),{width:r,height:c,$:s}=uZ(t);let u=(s?HA(a.width):a.width)/r,h=(s?HA(a.height):a.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const dLe=Co(0);function hZ(e){const t=Hn(e);return!Oq()||!t.visualViewport?dLe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uLe(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Hn(e)}function Vl(e,t,a,r){t===void 0&&(t=!1),a===void 0&&(a=!1);const c=e.getBoundingClientRect(),s=Hq(e);let u=Co(1);t&&(r?Wa(r)&&(u=ld(r)):u=ld(e));const h=uLe(s,a,r)?hZ(s):Co(0);let y=(c.left+h.x)/u.x,p=(c.top+h.y)/u.y,b=c.width/u.x,k=c.height/u.y;if(s&&r){const x=Hn(s),M=Wa(r)?Hn(r):r;let _=x,C=fD(_);for(;C&&M!==_;){const S=ld(C),L=C.getBoundingClientRect(),A=Ya(C),N=L.left+(C.clientLeft+parseFloat(A.paddingLeft))*S.x,j=L.top+(C.clientTop+parseFloat(A.paddingTop))*S.y;y*=S.x,p*=S.y,b*=S.x,k*=S.y,y+=N,p+=j,_=Hn(C),C=fD(_)}}return BA({width:b,height:k,x:y,y:p})}function wj(e,t){const a=Mj(e).scrollLeft;return t?t.left+a:Vl(Po(e)).left+a}function pZ(e,t){const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-wj(e,a),c=a.top+t.scrollTop;return{x:r,y:c}}function hLe(e){let{elements:t,rect:a,offsetParent:r,strategy:c}=e;const s=c==="fixed",u=Po(r),h=t?xj(t.floating):!1;if(r===u||h&&s)return a;let y={scrollLeft:0,scrollTop:0},p=Co(1);const b=Co(0),k=Ir(r);if((k||!s)&&((_d(r)!=="body"||bj(u))&&(y=Mj(r)),k)){const M=Vl(r);p=ld(r),b.x=M.x+r.clientLeft,b.y=M.y+r.clientTop}const x=u&&!k&&!s?pZ(u,y):Co(0);return{width:a.width*p.x,height:a.height*p.y,x:a.x*p.x-y.scrollLeft*p.x+b.x+x.x,y:a.y*p.y-y.scrollTop*p.y+b.y+x.y}}function pLe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fLe(e){const t=Mj(e),a=e.ownerDocument.body,r=So(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),c=So(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let s=-t.scrollLeft+wj(e);const u=-t.scrollTop;return Ya(a).direction==="rtl"&&(s+=So(e.clientWidth,a.clientWidth)-r),{width:r,height:c,x:s,y:u}}const yLe=25;function mLe(e,t,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",c=Hn(e),s=Po(e),u=c.visualViewport;let h=s.clientWidth,y=s.clientHeight,p=0,b=0;if(u){const x=!Oq()||t==="fixed";r?x||(p=-u.offsetLeft,b=-u.offsetTop):(h=u.width,y=u.height,x&&(p=u.offsetLeft,b=u.offsetTop))}if(wj(s)<=0){const x=s.ownerDocument,M=x.body,_=getComputedStyle(M),C=x.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(s.clientWidth-M.clientWidth-C),L=getComputedStyle(s).scrollbarGutter==="stable both-edges"?S/2:S;L<=yLe&&(h-=L)}return{width:h,height:y,x:p,y:b}}function gLe(e,t){const a=Vl(e,!0,t==="fixed"),r=a.top+e.clientTop,c=a.left+e.clientLeft,s=ld(e),u=e.clientWidth*s.x,h=e.clientHeight*s.y,y=c*s.x,p=r*s.y;return{width:u,height:h,x:y,y:p}}function pB(e,t,a){let r;if(t==="viewport"||t==="layoutViewport")r=mLe(e,a,t);else if(t==="document")r=fLe(Po(e));else if(Wa(t))r=gLe(t,a);else{const c=hZ(e);r={x:t.x-c.x,y:t.y-c.y,width:t.width,height:t.height}}return BA(r)}function kLe(e,t){const a=t.get(e);if(a)return a;let r=a2(e,[],!1).filter(h=>Wa(h)&&_d(h)!=="body"),c=null;const s=Ya(e).position==="fixed";let u=s?Hl(e):e;for(;Wa(u)&&!n2(u);){const h=Ya(u),y=$q(u),p=c?c.position:s?"fixed":"";!y&&(p==="fixed"||p==="absolute"&&h.position==="static")?r=r.filter(k=>k!==u):c=h,u=Hl(u)}return t.set(e,r),r}function vLe(e){let{element:t,boundary:a,rootBoundary:r,strategy:c}=e;const u=[...a==="clippingAncestors"?xj(t)?[]:kLe(t,this._c):[].concat(a),r],h=pB(t,u[0],c);let y=h.top,p=h.right,b=h.bottom,k=h.left;for(let x=1;x<u.length;x++){const M=pB(t,u[x],c);y=So(M.top,y),p=wr(M.right,p),b=wr(M.bottom,b),k=So(M.left,k)}return{width:p-k,height:b-y,x:k,y}}function bLe(e){const{width:t,height:a}=uZ(e);return{width:t,height:a}}function xLe(e,t,a){const r=Ir(t),c=Po(t),s=a==="fixed",u=Vl(e,!0,s,t);let h={scrollLeft:0,scrollTop:0};const y=Co(0);if((r||!s)&&((_d(t)!=="body"||bj(c))&&(h=Mj(t)),r)){const x=Vl(t,!0,s,t);y.x=x.x+t.clientLeft,y.y=x.y+t.clientTop}!r&&c&&(y.x=wj(c));const p=c&&!r&&!s?pZ(c,h):Co(0),b=u.left+h.scrollLeft-y.x-p.x,k=u.top+h.scrollTop-y.y-p.y;return{x:b,y:k,width:u.width,height:u.height}}function AR(e){return Ya(e).position==="static"}function fB(e,t){if(!Ir(e)||Ya(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Po(e)===a&&(a=a.ownerDocument.body),a}function fZ(e,t){const a=Hn(e);if(xj(e))return a;if(!Ir(e)){let c=Hl(e);for(;c&&!n2(c);){if(Wa(c)&&!AR(c))return c;c=Hl(c)}return a}let r=fB(e,t);for(;r&&iLe(r)&&AR(r);)r=fB(r,t);return r&&n2(r)&&AR(r)&&!$q(r)?a:r||lLe(e)||a}const MLe=async function(e){const t=this.getOffsetParent||fZ,a=this.getDimensions,r=await a(e.floating);return{reference:xLe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wLe(e){return Ya(e).direction==="rtl"}const _Le={convertOffsetParentRelativeRectToViewportRelativeRect:hLe,getDocumentElement:Po,getClippingRect:vLe,getOffsetParent:fZ,getElementRects:MLe,getClientRects:pLe,getDimensions:bLe,getScale:ld,isElement:Wa,isRTL:wLe};function yZ(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SLe(e,t,a){let r=null,c;const s=Po(e);function u(){var b;clearTimeout(c),(b=r)==null||b.disconnect(),r=null}function h(b,k){b===void 0&&(b=!1),k===void 0&&(k=1),u();const x=e.getBoundingClientRect(),{left:M,top:_,width:C,height:S}=x;if(b||t(),!C||!S)return;const L=nh(_),A=nh(s.clientWidth-(M+C)),N=nh(s.clientHeight-(_+S)),j=nh(M),R={rootMargin:-L+"px "+-A+"px "+-N+"px "+-j+"px",threshold:So(0,wr(1,k))||1};let q=!0;function $(ee){const re=ee[0].intersectionRatio;if(!yZ(x,e.getBoundingClientRect()))return h();if(re!==k){if(!q)return h();re?h(!1,re):c=setTimeout(()=>{h(!1,1e-7)},1e3)}q=!1}try{r=new IntersectionObserver($,{...R,root:s.ownerDocument})}catch{r=new IntersectionObserver($,R)}r.observe(e)}const y=Hn(e),p=()=>h(a);return y.addEventListener("resize",p),h(!0),()=>{y.removeEventListener("resize",p),u()}}function CLe(e,t,a,r){r===void 0&&(r={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:y=!1}=r,p=Hq(e),b=c||s?[...p?a2(p):[],...t?a2(t):[]]:[];b.forEach(L=>{c&&L.addEventListener("scroll",a),s&&L.addEventListener("resize",a)});const k=p&&h?SLe(p,a,s):null;let x=-1,M=null;u&&(M=new ResizeObserver(L=>{let[A]=L;A&&A.target===p&&M&&t&&(M.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=M)==null||N.observe(t)})),a()}),p&&!y&&M.observe(p),t&&M.observe(t));let _,C=y?Vl(e):null;y&&S();function S(){const L=Vl(e);C&&!yZ(C,L)&&a(),C=L,_=requestAnimationFrame(S)}return a(),()=>{var L;b.forEach(A=>{c&&A.removeEventListener("scroll",a),s&&A.removeEventListener("resize",a)}),k?.(),(L=M)==null||L.disconnect(),M=null,y&&cancelAnimationFrame(_)}}const LLe=nLe,NLe=aLe,ILe=JCe,ALe=rLe,jLe=eLe,yB=QCe,ELe=oLe,PLe=(e,t,a)=>{const r=new Map,c=a??{},s={..._Le,...c.platform,_c:r};return KCe(e,t,{...c,platform:s})};var RLe=typeof document<"u",DLe=function(){},vA=RLe?m.useLayoutEffect:DLe;function FA(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 a,r,c;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(r=a;r--!==0;)if(!FA(e[r],t[r]))return!1;return!0}if(c=Object.keys(e),a=c.length,a!==Object.keys(t).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(t,c[r]))return!1;for(r=a;r--!==0;){const s=c[r];if(!(s==="_owner"&&e.$$typeof)&&!FA(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function mZ(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mB(e,t){const a=mZ(e);return Math.round(t*a)/a}function jR(e){const t=m.useRef(e);return vA(()=>{t.current=e}),t}function qLe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:r=[],platform:c,elements:{reference:s,floating:u}={},transform:h=!0,whileElementsMounted:y,open:p}=e,[b,k]=m.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[x,M]=m.useState(r);FA(x,r)||M(r);const[_,C]=m.useState(null),[S,L]=m.useState(null),A=m.useCallback(O=>{O!==R.current&&(R.current=O,C(O))},[]),N=m.useCallback(O=>{O!==q.current&&(q.current=O,L(O))},[]),j=s||_,T=u||S,R=m.useRef(null),q=m.useRef(null),$=m.useRef(b),ee=y!=null,re=jR(y),F=jR(c),G=jR(p),X=m.useCallback(()=>{if(!R.current||!q.current)return;const O={placement:t,strategy:a,middleware:x};F.current&&(O.platform=F.current),PLe(R.current,q.current,O).then(Y=>{const V={...Y,isPositioned:G.current!==!1};ae.current&&!FA($.current,V)&&($.current=V,No.flushSync(()=>{k(V)}))})},[x,t,a,F,G]);vA(()=>{p===!1&&$.current.isPositioned&&($.current.isPositioned=!1,k(O=>({...O,isPositioned:!1})))},[p]);const ae=m.useRef(!1);vA(()=>(ae.current=!0,()=>{ae.current=!1}),[]),vA(()=>{if(j&&(R.current=j),T&&(q.current=T),j&&T){if(re.current)return re.current(j,T,X);X()}},[j,T,X,re,ee]);const he=m.useMemo(()=>({reference:R,floating:q,setReference:A,setFloating:N}),[A,N]),P=m.useMemo(()=>({reference:j,floating:T}),[j,T]),E=m.useMemo(()=>{const O={position:a,left:0,top:0};if(!P.floating)return O;const Y=mB(P.floating,b.x),V=mB(P.floating,b.y);return h?{...O,transform:"translate("+Y+"px, "+V+"px)",...mZ(P.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Y,top:V}},[a,h,P.floating,b.x,b.y]);return m.useMemo(()=>({...b,update:X,refs:he,elements:P,floatingStyles:E}),[b,X,he,P,E])}const zLe=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:r,padding:c}=typeof e=="function"?e(a):e;return r&&t(r)?r.current!=null?yB({element:r.current,padding:c}).fn(a):{}:r?yB({element:r,padding:c}).fn(a):{}}}},TLe=(e,t)=>{const a=LLe(e);return{name:a.name,fn:a.fn,options:[e,t]}},$Le=(e,t)=>{const a=NLe(e);return{name:a.name,fn:a.fn,options:[e,t]}},OLe=(e,t)=>({fn:ELe(e).fn,options:[e,t]}),HLe=(e,t)=>{const a=ILe(e);return{name:a.name,fn:a.fn,options:[e,t]}},VLe=(e,t)=>{const a=ALe(e);return{name:a.name,fn:a.fn,options:[e,t]}},BLe=(e,t)=>{const a=jLe(e);return{name:a.name,fn:a.fn,options:[e,t]}},FLe=(e,t)=>{const a=zLe(e);return{name:a.name,fn:a.fn,options:[e,t]}};var ULe=Object.defineProperty,GLe=(e,t)=>ULe(e,"name",{value:t,configurable:!0}),ZLe=m.forwardRef(GLe(function(t,a){const{children:r,width:c=10,height:s=5,...u}=t;return g.jsx(we.svg,{...u,ref:a,width:c,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),WLe=Object.defineProperty,Lo=(e,t)=>WLe(e,"name",{value:t,configurable:!0}),gB={Partial:"partial"},kB={Optimized:"optimized",Always:"always"},gZ="Popper",[kZ,Ar]=Vt(gZ),[YLe,vZ]=kZ(gZ),b2=Lo(e=>{const{__scopePopper:t,children:a}=e,[r,c]=m.useState(null),[s,u]=m.useState(void 0);return g.jsx(YLe,{scope:t,anchor:r,onAnchorChange:c,placementState:s,setPlacementState:u,children:a})},"Popper"),XLe="PopperAnchor",x2=m.forwardRef(Lo(function(t,a){const{__scopePopper:r,virtualRef:c,...s}=t,u=vZ(XLe,r),h=m.useRef(null),y=u.onAnchorChange,p=m.useCallback(C=>{h.current=C,C&&y(C)},[y]),b=Pe(a,p),k=m.useRef(null);m.useEffect(()=>{if(!c)return;const C=k.current;k.current=c.current,C!==k.current&&y(k.current)});const x=u.placementState&&Sj(u.placementState),M=x?.[0],_=x?.[1];return c?null:g.jsx(we.div,{"data-radix-popper-side":M,"data-radix-popper-align":_,...s,ref:b})},"PopperAnchor")),bZ="PopperContent",[KLe,QLe]=kZ(bZ),_j=m.forwardRef(Lo(function(t,a){const{__scopePopper:r,side:c="bottom",sideOffset:s=0,align:u="center",alignOffset:h=0,arrowPadding:y=0,avoidCollisions:p=!0,collisionBoundary:b=[],collisionPadding:k=0,sticky:x=gB.Partial,hideWhenDetached:M=!1,updatePositionStrategy:_=kB.Optimized,onPlaced:C,...S}=t,L=vZ(bZ,r),[A,N]=m.useState(null),j=Pe(a,N),[T,R]=m.useState(null),q=y2(T),$=q?.width??0,ee=q?.height??0,re=c+(u!=="center"?"-"+u:""),F=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},G=Array.isArray(b)?b:[b],X=G.length>0,ae={padding:F,boundary:G.filter(xZ),altBoundary:X},{refs:he,floatingStyles:P,placement:E,isPositioned:O,middlewareData:Y}=qLe({strategy:"fixed",placement:re,whileElementsMounted:Lo((...ie)=>CLe(...ie,{animationFrame:_===kB.Always}),"whileElementsMounted"),elements:{reference:L.anchor},middleware:[TLe({mainAxis:s+ee,alignmentAxis:h}),p&&$Le({mainAxis:!0,crossAxis:!1,...x===gB.Partial?{limiter:OLe()}:{},...ae}),p&&HLe({...ae}),VLe({...ae,apply:Lo(({elements:ie,rects:pe,availableWidth:be,availableHeight:Ie})=>{const{width:_e,height:Me}=pe.reference,Ae=ie.floating.style;Ae.setProperty("--radix-popper-available-width",`${be}px`),Ae.setProperty("--radix-popper-available-height",`${Ie}px`),Ae.setProperty("--radix-popper-anchor-width",`${_e}px`),Ae.setProperty("--radix-popper-anchor-height",`${Me}px`)},"apply")}),T&&FLe({element:T,padding:y}),nNe({arrowWidth:$,arrowHeight:ee}),M&&BLe(X?{strategy:"referenceHidden",...ae}:{strategy:"referenceHidden",padding:ae.padding,altBoundary:ae.altBoundary})]}),V=L.setPlacementState;ht(()=>(V(E),()=>{V(void 0)}),[E,V]);const[D,z]=Sj(E),J=vn(C);ht(()=>{O&&J?.()},[O,J]);const K=Y.arrow?.x,W=Y.arrow?.y,U=Y.arrow?.centerOffset!==0,[de,ke]=m.useState();return ht(()=>{A&&ke(window.getComputedStyle(A).zIndex)},[A]),g.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:O?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(KLe,{scope:r,placedSide:D,placedAlign:z,onArrowChange:R,arrowX:K,arrowY:W,shouldHideArrow:U,children:g.jsx(we.div,{"data-side":D,"data-align":z,...S,ref:j,style:{...S.style,animation:O?S.style?.animation:"none"}})})})},"PopperContent")),JLe="PopperArrow",eNe={top:"bottom",right:"left",bottom:"top",left:"right"},tNe=m.forwardRef(Lo(function(t,a){const{__scopePopper:r,...c}=t,s=QLe(JLe,r),u=eNe[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(ZLe,{...c,ref:a,style:{...c.style,display:"block"}})})},"PopperArrow"));function xZ(e){return e!==null}Lo(xZ,"isNotNull");var nNe=Lo(e=>({name:"transformOrigin",options:e,fn(t){const{placement:a,rects:r,middlewareData:c}=t,u=c.arrow?.centerOffset!==0,h=u?0:e.arrowWidth,y=u?0:e.arrowHeight,[p,b]=Sj(a),k={start:"0%",center:"50%",end:"100%"}[b],x=(c.arrow?.x??0)+h/2,M=(c.arrow?.y??0)+y/2;let _="",C="";return p==="bottom"?(_=u?k:`${x}px`,C=`${-y}px`):p==="top"?(_=u?k:`${x}px`,C=`${r.floating.height+y}px`):p==="right"?(_=`${-y}px`,C=u?k:`${M}px`):p==="left"&&(_=`${r.floating.width+y}px`,C=u?k:`${M}px`),{data:{x:_,y:C}}}}),"transformOrigin");function Sj(e){const[t,a="center"]=e.split("-");return[t,a]}Lo(Sj,"getSideAndAlignFromPlacement");var aNe=Object.defineProperty,Vq=(e,t)=>aNe(e,"name",{value:t,configurable:!0}),ER=!1;function MZ(){const[e,t]=m.useState(ER);return m.useEffect(()=>{ER||(ER=!0,t(!0))},[]),e}Vq(MZ,"useIsHydrated");var wZ=Fl[" useSyncExternalStore ".trim().toString()];function _Z(){return()=>{}}Vq(_Z,"subscribe");function SZ(){return wZ(_Z,()=>!0,()=>!1)}Vq(SZ,"useIsHydratedModern");var oNe=typeof wZ=="function"?SZ:MZ,rNe=Object.defineProperty,Xl=(e,t)=>rNe(e,"name",{value:t,configurable:!0}),PR="rovingFocusGroup.onEntryFocus",iNe={bubbles:!1,cancelable:!0},Cj="RovingFocusGroup",[yD,CZ,cNe]=Md(Cj),[sNe,Sd]=Vt(Cj,[cNe]),vB={Vertical:"vertical",Horizontal:"horizontal"},lNe={RTL:"rtl"},[dNe,uNe]=sNe(Cj),Bq=m.forwardRef(Xl(function(t,a){return g.jsx(yD.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(yD.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(hNe,{...t,ref:a})})})},"RovingFocusGroup")),hNe=m.forwardRef(Xl(function(t,a){const{__scopeRovingFocusGroup:r,orientation:c,loop:s=!1,dir:u,currentTabStopId:h,defaultCurrentTabStopId:y,onCurrentTabStopIdChange:p,onEntryFocus:b,preventScrollOnEntryFocus:k=!1,...x}=t,M=m.useRef(null),_=Pe(a,M),C=Yl(u),[S,L]=Wt({prop:h,defaultProp:y??null,onChange:p,caller:Cj}),[A,N]=m.useState(!1),j=vn(b),T=CZ(r),R=m.useRef(!1),[q,$]=m.useState(0);return m.useEffect(()=>{const ee=M.current;if(ee)return ee.addEventListener(PR,j),()=>ee.removeEventListener(PR,j)},[j]),g.jsx(dNe,{scope:r,orientation:c,dir:C,loop:s,currentTabStopId:S,onItemFocus:m.useCallback(ee=>L(ee),[L]),onItemShiftTab:m.useCallback(()=>N(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(ee=>ee+1),[]),onFocusableItemRemove:m.useCallback(()=>$(ee=>ee-1),[]),children:g.jsx(we.div,{tabIndex:A||q===0?-1:0,"data-orientation":c,...x,ref:_,style:{outline:"none",...t.style},onMouseDown:ye(t.onMouseDown,()=>{R.current=!0}),onFocus:ye(t.onFocus,ee=>{const re=!R.current;if(ee.target===ee.currentTarget&&re&&!A){const F=new CustomEvent(PR,iNe);if(ee.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=T().filter(E=>E.focusable),X=G.find(E=>E.active),ae=G.find(E=>E.id===S),P=[X,ae,...G].filter(Boolean).map(E=>E.ref.current);Uq(P,k)}}R.current=!1}),onBlur:ye(t.onBlur,()=>N(!1))})})},"RovingFocusGroupImpl")),pNe="RovingFocusGroupItem",Fq=m.forwardRef(Xl(function(t,a){const{__scopeRovingFocusGroup:r,focusable:c=!0,active:s=!1,tabStopId:u,children:h,...y}=t,p=pt(),b=u||p,k=uNe(pNe,r),x=k.currentTabStopId===b,M=CZ(r),{onFocusableItemAdd:_,onFocusableItemRemove:C,currentTabStopId:S}=k,L=oNe();return ht(()=>{if(!(!L||!c))return _(),()=>C()},[L,c,_,C]),m.useEffect(()=>{if(!(L||!c))return _(),()=>C()},[L,c,_,C]),g.jsx(yD.ItemSlot,{scope:r,id:b,focusable:c,active:s,children:g.jsx(we.span,{tabIndex:x?0:-1,"data-orientation":k.orientation,...y,ref:a,onMouseDown:ye(t.onMouseDown,A=>{c?k.onItemFocus(b):A.preventDefault()}),onFocus:ye(t.onFocus,()=>k.onItemFocus(b)),onKeyDown:ye(t.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){k.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const N=NZ(A,k.orientation,k.dir);if(N!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let T=M().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")T.reverse();else if(N==="prev"||N==="next"){N==="prev"&&T.reverse();const R=T.indexOf(A.currentTarget);T=k.loop?IZ(T,R+1):T.slice(R+1)}setTimeout(()=>Uq(T))}}),children:typeof h=="function"?h({isCurrentTabStop:x,hasTabStop:S!=null}):h})})},"RovingFocusGroupItem")),fNe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LZ(e,t){return t!==lNe.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Xl(LZ,"getDirectionAwareKey");function NZ(e,t,a){const r=LZ(e.key,a);if(!(t===vB.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===vB.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return fNe[r]}Xl(NZ,"getFocusIntent");function Uq(e,t=!1){const a=document.activeElement;for(const r of e)if(r===a||(r.focus({preventScroll:t}),document.activeElement!==a))return}Xl(Uq,"focusFirst");function IZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Xl(IZ,"wrapArray");var yNe=Object.defineProperty,Xe=(e,t)=>yNe(e,"name",{value:t,configurable:!0}),mNe={RTL:"rtl"},mD=["Enter"," "],gNe=["ArrowDown","PageUp","Home"],AZ=["ArrowUp","PageDown","End"],kNe=[...gNe,...AZ],vNe={ltr:[...mD,"ArrowRight"],rtl:[...mD,"ArrowLeft"]},bNe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lj="Menu",[o2,xNe,MNe]=Md(Lj),[Kl,M2]=Vt(Lj,[MNe,Ar,Sd]),Nj=Ar(),jZ=Sd(),[EZ,jr]=Kl(Lj),[wNe,w2]=Kl(Lj),Gq=Xe(e=>{const{__scopeMenu:t,open:a=!1,children:r,dir:c,onOpenChange:s,modal:u=!0}=e,h=Nj(t),[y,p]=m.useState(null),b=m.useRef(!1),k=vn(s),x=Yl(c);return m.useEffect(()=>{const M=Xe(()=>{b.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=Xe(()=>b.current=!1,"handlePointer");return document.addEventListener("keydown",M,{capture:!0}),()=>{document.removeEventListener("keydown",M,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),m.useEffect(()=>{if(!a)return;const M=Xe(()=>k(!1),"handleBlur");return window.addEventListener("blur",M),()=>window.removeEventListener("blur",M)},[a,k]),g.jsx(b2,{...h,children:g.jsx(EZ,{scope:t,open:a,onOpenChange:k,content:y,onContentChange:p,children:g.jsx(wNe,{scope:t,onClose:m.useCallback(()=>k(!1),[k]),isUsingKeyboardRef:b,dir:x,modal:u,children:r})})})},"Menu"),Ij=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t,s=Nj(r);return g.jsx(x2,{...s,...c,ref:a})},"MenuAnchor")),PZ="MenuPortal",[_Ne,RZ]=Kl(PZ,{forceMount:void 0}),Zq=Xe(e=>{const{__scopeMenu:t,forceMount:a,children:r,container:c}=e,s=jr(PZ,t);return g.jsx(_Ne,{scope:t,forceMount:a,children:g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:r})})})},"MenuPortal"),Sa="MenuContent",[SNe,Wq]=Kl(Sa),Yq=m.forwardRef(Xe(function(t,a){const r=RZ(Sa,t.__scopeMenu),{forceMount:c=r.forceMount,...s}=t,u=jr(Sa,t.__scopeMenu),h=w2(Sa,t.__scopeMenu);return g.jsx(o2.Provider,{scope:t.__scopeMenu,children:g.jsx(bn,{present:c||u.open,children:g.jsx(o2.Slot,{scope:t.__scopeMenu,children:h.modal?g.jsx(CNe,{...s,ref:a}):g.jsx(LNe,{...s,ref:a})})})})},"MenuContent")),CNe=m.forwardRef(Xe(function(t,a){const r=jr(Sa,t.__scopeMenu),c=m.useRef(null),s=Pe(a,c);return m.useEffect(()=>{const u=c.current;if(u)return uj(u)},[]),g.jsx(Xq,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ye(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),LNe=m.forwardRef(Xe(function(t,a){const r=jr(Sa,t.__scopeMenu);return g.jsx(Xq,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),NNe=Ca("MenuContent.ScrollLock"),Xq=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,loop:c=!1,trapFocus:s,onOpenAutoFocus:u,onCloseAutoFocus:h,disableOutsidePointerEvents:y,onEntryFocus:p,onEscapeKeyDown:b,onPointerDownOutside:k,onFocusOutside:x,onInteractOutside:M,onDismiss:_,disableOutsideScroll:C,...S}=t,L=jr(Sa,r),A=w2(Sa,r),N=Nj(r),j=jZ(r),T=xNe(r),[R,q]=m.useState(null),$=m.useRef(null),[ee,re]=m.useState(null);lj(ee);const{nodes:F,registry:G}=sj(),X=!!(s||C),ae=Pe(a,$,L.onContentChange,re),he=m.useRef(0),P=m.useRef(""),E=m.useRef(0),O=m.useRef(null),Y=m.useRef("right"),V=m.useRef(0),D=m.useMemo(()=>C?[$,...F.map(U=>({current:U}))]:[],[$,F,C]),z=C?k2:m.Fragment,J=C?{as:NNe,allowPinchZoom:!0,shards:D}:void 0,K=Xe(U=>{const de=P.current+U,ke=T().filter(Ae=>!Ae.disabled),ie=document.activeElement,pe=ke.find(Ae=>Ae.ref.current===ie)?.textValue,be=ke.map(Ae=>Ae.textValue),Ie=VZ(be,de,pe),_e=ke.find(Ae=>Ae.textValue===Ie)?.ref.current;function Me(Ae){P.current=Ae,window.clearTimeout(he.current),Ae!==""&&(he.current=window.setTimeout(()=>Me(""),1e3))}Xe(Me,"updateSearch"),Me(de),_e&&setTimeout(()=>_e.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(he.current),[]),xd();const W=m.useCallback(U=>Y.current===O.current?.side&&FZ(U,O.current?.area),[]);return g.jsx(SNe,{scope:r,searchRef:P,onItemEnter:m.useCallback(U=>{W(U)&&U.preventDefault()},[W]),onItemLeave:m.useCallback(U=>{W(U)||($.current?.focus(),q(null))},[W]),onTriggerLeave:m.useCallback(U=>{W(U)&&U.preventDefault()},[W]),pointerGraceTimerRef:E,onPointerGraceIntentChange:m.useCallback(U=>{O.current=U},[]),children:g.jsx(cj,{registry:X?G:null,children:g.jsx(z,{...J,children:g.jsx(ij,{asChild:!0,trapped:s,branches:F,onMountAutoFocus:ye(u,U=>{U.preventDefault(),$.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:y,onEscapeKeyDown:b,onPointerDownOutside:k,onFocusOutside:x,onInteractOutside:M,onDismiss:_,children:g.jsx(Bq,{asChild:!0,...j,dir:A.dir,orientation:"vertical",loop:c,currentTabStopId:R,onCurrentTabStopIdChange:q,onEntryFocus:ye(p,U=>{A.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(_j,{role:"menu","aria-orientation":"vertical","data-state":iz(L.open),"data-radix-menu-content":"",dir:A.dir,...N,...S,ref:ae,style:{outline:"none",...S.style},onKeyDown:ye(S.onKeyDown,U=>{const ke=U.target.closest("[data-radix-menu-content]")===U.currentTarget,ie=U.ctrlKey||U.altKey||U.metaKey,pe=U.key.length===1;ke&&(U.key==="Tab"&&U.preventDefault(),!ie&&pe&&K(U.key));const be=$.current;if(U.target!==be||!kNe.includes(U.key))return;U.preventDefault();const _e=T().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);AZ.includes(U.key)&&_e.reverse(),OZ(_e)}),onBlur:ye(t.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(he.current),P.current="")}),onPointerMove:ye(t.onPointerMove,fd(U=>{const de=U.target,ke=V.current!==U.clientX;if(U.currentTarget.contains(de)&&ke){const ie=U.clientX>V.current?"right":"left";Y.current=ie,V.current=U.clientX}}))})})})})})})})},"MenuContentImpl")),Aj=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return g.jsx(we.div,{role:"group",...c,ref:a})},"MenuGroup")),Kq=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return g.jsx(we.div,{...c,ref:a})},"MenuLabel")),gD="MenuItem",bB="menu.itemSelect",_2=m.forwardRef(Xe(function(t,a){const{disabled:r=!1,onSelect:c,...s}=t,u=m.useRef(null),h=w2(gD,t.__scopeMenu),y=Wq(gD,t.__scopeMenu),p=Pe(a,u),b=m.useRef(!1),k=Xe(()=>{const x=u.current;if(!r&&x){const M=new CustomEvent(bB,{bubbles:!0,cancelable:!0});x.addEventListener(bB,_=>c?.(_),{once:!0}),rq(x,M),M.defaultPrevented?b.current=!1:h.onClose()}},"handleSelect");return g.jsx(DZ,{...s,ref:p,disabled:r,onClick:ye(t.onClick,k),onPointerDown:x=>{t.onPointerDown?.(x),b.current=!0},onPointerUp:ye(t.onPointerUp,x=>{b.current||x.currentTarget?.click()}),onKeyDown:ye(t.onKeyDown,x=>{r||x.target!==x.currentTarget||y.searchRef.current!==""&&x.key===" "||mD.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})},"MenuItem")),DZ=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,disabled:c=!1,textValue:s,...u}=t,h=Wq(gD,r),y=jZ(r),p=m.useRef(null),b=Pe(a,p),[k,x]=m.useState(!1),[M,_]=m.useState("");return m.useEffect(()=>{const C=p.current;C&&_((C.textContent??"").trim())},[u.children]),g.jsx(o2.ItemSlot,{scope:r,disabled:c,textValue:s??M,children:g.jsx(Fq,{asChild:!0,...y,focusable:!c,children:g.jsx(we.div,{role:"menuitem","data-highlighted":k?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:b,onPointerMove:ye(t.onPointerMove,fd(C=>{c?h.onItemLeave(C):(h.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(t.onPointerLeave,fd(C=>h.onItemLeave(C))),onFocus:ye(t.onFocus,()=>x(!0)),onBlur:ye(t.onBlur,()=>x(!1))})})})},"MenuItemImpl")),Qq=m.forwardRef(Xe(function(t,a){const{checked:r=!1,onCheckedChange:c,...s}=t;return g.jsx(zZ,{scope:t.__scopeMenu,checked:r,children:g.jsx(_2,{role:"menuitemcheckbox","aria-checked":r2(r)?"mixed":r,...s,ref:a,"data-state":jj(r),onSelect:ye(s.onSelect,()=>c?.(r2(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),INe="MenuRadioGroup",[ANe,jNe]=Kl(INe,{value:void 0,onValueChange:Xe(()=>{},"onValueChange")}),Jq=m.forwardRef(Xe(function(t,a){const{value:r,onValueChange:c,...s}=t,u=vn(c);return g.jsx(ANe,{scope:t.__scopeMenu,value:r,onValueChange:u,children:g.jsx(Aj,{...s,ref:a})})},"MenuRadioGroup")),ENe="MenuRadioItem",ez=m.forwardRef(Xe(function(t,a){const{value:r,...c}=t,s=jNe(ENe,t.__scopeMenu),u=r===s.value;return g.jsx(zZ,{scope:t.__scopeMenu,checked:u,children:g.jsx(_2,{role:"menuitemradio","aria-checked":u,...c,ref:a,"data-state":jj(u),onSelect:ye(c.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),qZ="MenuItemIndicator",[zZ,PNe]=Kl(qZ,{checked:!1}),tz=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,forceMount:c,...s}=t,u=PNe(qZ,r);return g.jsx(bn,{present:c||r2(u.checked)||u.checked===!0,children:g.jsx(we.span,{...s,ref:a,"data-state":jj(u.checked)})})},"MenuItemIndicator")),nz=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return g.jsx(we.div,{role:"separator","aria-orientation":"horizontal",...c,ref:a})},"MenuSeparator")),TZ="MenuSub",[RNe,$Z]=Kl(TZ),az=Xe(e=>{const{__scopeMenu:t,children:a,open:r=!1,onOpenChange:c}=e,s=jr(TZ,t),u=Nj(t),[h,y]=m.useState(null),[p,b]=m.useState(null),k=vn(c);return m.useEffect(()=>(s.open===!1&&k(!1),()=>k(!1)),[s.open,k]),g.jsx(b2,{...u,children:g.jsx(EZ,{scope:t,open:r,onOpenChange:k,content:p,onContentChange:b,children:g.jsx(RNe,{scope:t,contentId:pt(),triggerId:pt(),trigger:h,onTriggerChange:y,children:a})})})},"MenuSub"),ah="MenuSubTrigger",oz=m.forwardRef(Xe(function(t,a){const r=jr(ah,t.__scopeMenu),c=w2(ah,t.__scopeMenu),s=$Z(ah,t.__scopeMenu),u=Wq(ah,t.__scopeMenu),h=m.useRef(null),{pointerGraceTimerRef:y,onPointerGraceIntentChange:p}=u,b={__scopeMenu:t.__scopeMenu},k=m.useCallback(()=>{h.current&&window.clearTimeout(h.current),h.current=null},[]);m.useEffect(()=>k,[k]),m.useEffect(()=>{const M=y.current;return()=>{window.clearTimeout(M),p(null)}},[y,p]);const x=Pe(a,s.onTriggerChange);return g.jsx(Ij,{asChild:!0,...b,children:g.jsx(DZ,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":iz(r.open),...t,ref:x,onClick:M=>{t.onClick?.(M),!(t.disabled||M.defaultPrevented)&&(M.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ye(t.onPointerMove,fd(M=>{u.onItemEnter(M),!M.defaultPrevented&&!t.disabled&&!r.open&&!h.current&&(u.onPointerGraceIntentChange(null),h.current=window.setTimeout(()=>{r.onOpenChange(!0),k()},100))})),onPointerLeave:ye(t.onPointerLeave,fd(M=>{k();const _=r.content?.getBoundingClientRect();if(_){const C=r.content?.dataset.side,S=C==="right",L=S?-5:5,A=_[S?"left":"right"],N=_[S?"right":"left"];u.onPointerGraceIntentChange({area:[{x:M.clientX+L,y:M.clientY},{x:A,y:_.top},{x:N,y:_.top},{x:N,y:_.bottom},{x:A,y:_.bottom}],side:C}),window.clearTimeout(y.current),y.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(M),M.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:ye(t.onKeyDown,M=>{t.disabled||M.target!==M.currentTarget||u.searchRef.current!==""&&M.key===" "||vNe[c.dir].includes(M.key)&&(r.onOpenChange(!0),r.content?.focus(),M.preventDefault())})})})},"MenuSubTrigger")),DNe="MenuSubContent",rz=m.forwardRef(Xe(function(t,a){const r=RZ(Sa,t.__scopeMenu),{forceMount:c=r.forceMount,align:s="start",...u}=t,h=jr(Sa,t.__scopeMenu),y=w2(Sa,t.__scopeMenu),p=$Z(DNe,t.__scopeMenu),b=m.useRef(null),k=Pe(a,b);return g.jsx(o2.Provider,{scope:t.__scopeMenu,children:g.jsx(bn,{present:c||h.open,children:g.jsx(o2.Slot,{scope:t.__scopeMenu,children:g.jsx(Xq,{id:p.contentId,"aria-labelledby":p.triggerId,...u,ref:k,align:s,side:y.dir===mNe.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{y.isUsingKeyboardRef.current&&b.current?.focus(),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:ye(t.onFocusOutside,x=>{x.target!==p.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:ye(t.onEscapeKeyDown,x=>{y.onClose(),x.preventDefault()}),onKeyDown:ye(t.onKeyDown,x=>{const M=x.currentTarget.contains(x.target),_=bNe[y.dir].includes(x.key);M&&_&&(h.onOpenChange(!1),p.trigger?.focus(),x.preventDefault())})})})})})},"MenuSubContent"));function iz(e){return e?"open":"closed"}Xe(iz,"getOpenState");function r2(e){return e==="indeterminate"}Xe(r2,"isIndeterminate");function jj(e){return r2(e)?"indeterminate":e?"checked":"unchecked"}Xe(jj,"getCheckedState");function OZ(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}Xe(OZ,"focusFirst");function HZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Xe(HZ,"wrapArray");function VZ(e,t,a){const c=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=a?e.indexOf(a):-1;let u=HZ(e,Math.max(s,0));c.length===1&&(u=u.filter(p=>p!==a));const y=u.find(p=>p.toLowerCase().startsWith(c.toLowerCase()));return y!==a?y:void 0}Xe(VZ,"getNextMatch");function BZ(e,t){const{x:a,y:r}=e;let c=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const h=t[s],y=t[u],p=h.x,b=h.y,k=y.x,x=y.y;b>r!=x>r&&a<(k-p)*(r-b)/(x-b)+p&&(c=!c)}return c}Xe(BZ,"isPointInPolygon");function FZ(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return BZ(a,t)}Xe(FZ,"isPointerInGraceArea");function fd(e){return t=>t.pointerType==="mouse"?e(t):void 0}Xe(fd,"whenMouse");var qNe=Object.defineProperty,Zt=(e,t)=>qNe(e,"name",{value:t,configurable:!0}),cz="ContextMenu",[zNe,LDe]=Vt(cz,[M2]),xn=M2(),[TNe,UZ]=zNe(cz),$Ne=Zt(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,dir:s,modal:u=!0}=e,h=m.useRef(!1),[y,p]=Wt({prop:c,defaultProp:!1,onChange:r,caller:cz}),b=xn(t);return g.jsx(TNe,{scope:t,open:y,onOpenChange:p,modal:u,hasInteractedRef:h,children:g.jsx(Gq,{...b,dir:s,open:y,onOpenChange:p,modal:u,children:a})})},"ContextMenu"),ONe="ContextMenuTrigger",HNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,disabled:c=!1,...s}=t,u=UZ(ONe,r),h=xn(r),[y,p]=m.useState({x:0,y:0}),b=m.useMemo(()=>({current:{getBoundingClientRect:Zt(()=>DOMRect.fromRect({width:0,height:0,...y}),"getBoundingClientRect")}}),[y]),k=m.useRef(0),x=m.useCallback(()=>window.clearTimeout(k.current),[]),M=Zt(_=>{u.hasInteractedRef.current=!0,p({x:_.clientX,y:_.clientY}),u.onOpenChange(!0)},"handleOpen");return m.useEffect(()=>x,[x]),m.useEffect(()=>{c&&x()},[c,x]),g.jsxs(g.Fragment,{children:[g.jsx(Ij,{...h,virtualRef:b}),g.jsx(we.span,{"data-state":u.open?"open":"closed","data-disabled":c?"":void 0,...s,ref:a,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:c?t.onContextMenu:ye(t.onContextMenu,_=>{x(),M(_),_.preventDefault()}),onPointerDown:c?t.onPointerDown:ye(t.onPointerDown,Au(_=>{x(),u.open&&u.onOpenChange(!1),k.current=window.setTimeout(()=>M(_),700)})),onPointerMove:c?t.onPointerMove:ye(t.onPointerMove,Au(x)),onPointerCancel:c?t.onPointerCancel:ye(t.onPointerCancel,Au(x)),onPointerUp:c?t.onPointerUp:ye(t.onPointerUp,Au(x))})]})},"ContextMenuTrigger")),GZ=Zt(e=>{const{__scopeContextMenu:t,...a}=e,r=xn(t);return g.jsx(Zq,{...r,...a})},"ContextMenuPortal"),VNe="ContextMenuContent",BNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=UZ(VNe,r),u=xn(r),h=m.useRef(!1);return g.jsx(Yq,{...u,side:"right",sideOffset:2,align:"start",...c,ref:a,onCloseAutoFocus:y=>{t.onCloseAutoFocus?.(y),!y.defaultPrevented&&h.current&&y.preventDefault(),h.current=!1},onInteractOutside:y=>{t.onInteractOutside?.(y),!y.defaultPrevented&&!s.modal&&(h.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),FNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Aj,{...s,...c,ref:a})},"ContextMenuGroup")),UNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Kq,{...s,...c,ref:a})},"ContextMenuLabel")),GNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(_2,{...s,...c,ref:a})},"ContextMenuItem")),ZNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Qq,{...s,...c,ref:a})},"ContextMenuCheckboxItem")),WNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Jq,{...s,...c,ref:a})},"ContextMenuRadioGroup")),YNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(ez,{...s,...c,ref:a})},"ContextMenuRadioItem")),ZZ=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(tz,{...s,...c,ref:a})},"ContextMenuItemIndicator")),XNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(nz,{...s,...c,ref:a})},"ContextMenuSeparator")),KNe="ContextMenuSub",QNe=Zt(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,defaultOpen:s}=e,u=xn(t),[h,y]=Wt({prop:c,defaultProp:s??!1,onChange:r,caller:KNe});return g.jsx(az,{...u,open:h,onOpenChange:y,children:a})},"ContextMenuSub"),JNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(oz,{...s,...c,ref:a})},"ContextMenuSubTrigger")),eIe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(rz,{...s,...c,ref:a,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Au(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Zt(Au,"whenTouchOrPen");function tIe({...e}){return g.jsx($Ne,{"data-slot":"context-menu",...e})}function nIe({...e}){return g.jsx(HNe,{"data-slot":"context-menu-trigger",...e})}function aIe({...e}){return g.jsx(FNe,{"data-slot":"context-menu-group",...e})}function oIe({...e}){return g.jsx(GZ,{"data-slot":"context-menu-portal",...e})}function rIe({...e}){return g.jsx(QNe,{"data-slot":"context-menu-sub",...e})}function iIe({...e}){return g.jsx(WNe,{"data-slot":"context-menu-radio-group",...e})}function cIe({className:e,inset:t,children:a,...r}){return g.jsxs(JNe,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,g.jsx(Ga,{className:"ml-auto"})]})}function sIe({className:e,...t}){return g.jsx(eIe,{"data-slot":"context-menu-sub-content",className:Q("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function lIe({className:e,...t}){return g.jsx(GZ,{children:g.jsx(BNe,{"data-slot":"context-menu-content",className:Q("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function dIe({className:e,inset:t,variant:a="default",...r}){return g.jsx(GNe,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:Q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function uIe({className:e,children:t,checked:a,...r}){return g.jsxs(ZNe,{"data-slot":"context-menu-checkbox-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(ZZ,{children:g.jsx(Ua,{className:"size-4"})})}),t]})}function hIe({className:e,children:t,...a}){return g.jsxs(YNe,{"data-slot":"context-menu-radio-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(ZZ,{children:g.jsx(Dl,{className:"size-2 fill-current"})})}),t]})}function pIe({className:e,inset:t,...a}){return g.jsx(UNe,{"data-slot":"context-menu-label","data-inset":t,className:Q("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function fIe({className:e,...t}){return g.jsx(XNe,{"data-slot":"context-menu-separator",className:Q("bg-border -mx-1 my-1 h-px",e),...t})}function yIe({className:e,...t}){return g.jsx("span",{"data-slot":"context-menu-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const Sr=m.createContext({activeIndex:0,setActiveIndex:()=>{},totalDialogs:0,setTotalDialogs:()=>{},isOpen:!1,setIsOpen:()=>{},clickable:!1,shouldAnimate:!1,setShouldAnimate:()=>{},closeDialog:()=>{}}),Ej=m.forwardRef(({children:e,className:t,open:a=!1,onOpenChange:r,clickable:c=!1,...s},u)=>{const[h,y]=m.useState(0),[p,b]=m.useState(a),[k,x]=m.useState(!1),[M,_]=m.useState(0),C=S=>{S===h&&(h>0?y(L=>L-1):b(!1))};return m.useImperativeHandle(u,()=>({open:()=>{b(!0)},close:()=>{b(!1),y(0)},closeAll:()=>{b(!1),y(0)},next:()=>{y(S=>S+1)},prev:()=>{y(S=>S>0?S-1:0)},goTo:S=>{S>=0&&S<M&&y(S)},closeCurrent:()=>C(h),isOpen:p,activeIndex:h,totalDialogs:M}),[h,M,p]),m.useEffect(()=>{const S=document.documentElement;return p?(S.style.overflow="hidden",x(!0)):S.style.overflow="",r?.(p),()=>{S.style.overflow=""}},[p,r]),g.jsx(Sr.Provider,{value:{activeIndex:h,setActiveIndex:y,totalDialogs:M,setTotalDialogs:_,isOpen:p,setIsOpen:b,clickable:c,shouldAnimate:k,setShouldAnimate:x,closeDialog:C},children:g.jsx("div",{className:t,...s,children:e})})});Ej.displayName="DialogStack";const mIe=({children:e,className:t,onClick:a,asChild:r,...c})=>{const s=m.useContext(Sr);if(!s)throw new Error("DialogStackTrigger must be used within a DialogStack");const u=h=>{s.setIsOpen(!0),a?.(h)};return r&&m.isValidElement(e)?m.cloneElement(e,{onClick:u,className:Q(t,e.props.className),...c}):g.jsx("button",{onClick:u,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm","ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","bg-primary text-primary-foreground hover:bg-primary/90","h-10 px-4 py-2",t),...c,children:e})},sz=({className:e,...t})=>{const a=m.useContext(Sr);if(!a)throw new Error("DialogStackOverlay must be used within a DialogStack");return a.isOpen?g.jsx("div",{className:Q("fixed inset-0 z-[1001] bg-black/80 backdrop-blur-sm","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 slide-in-from-right-1/2 data-[state=open]:fade-in-0",e),onClick:()=>{a.activeIndex===0?a.setIsOpen(!1):a.setActiveIndex(a.activeIndex-1)},...t}):null},lz=({children:e,className:t,...a})=>{const r=m.useContext(Sr),c=m.Children.count(e),[s,u]=m.useState(c);if(m.useEffect(()=>{u(c)},[c]),!r)throw new Error("DialogStackBody must be used within a DialogStack");return r.isOpen?g.jsx(Sr.Provider,{value:{...r,totalDialogs:s,setTotalDialogs:u},children:g.jsx(Zl,{children:g.jsx("div",{className:Q("pointer-events-none fixed z-[1002] w-full max-w-full md:max-w-[67%] right-0 top-0 md:top-[1vh]",t),...a,children:m.Children.map(e,(h,y)=>m.isValidElement(h)?m.cloneElement(h,{index:y}):h)})})}):null},dz=({children:e,className:t,index:a=0,offset:r=20,...c})=>{const s=m.useContext(Sr),[u,h]=m.useState(!1),y=m.useRef(null),p=m.useRef(!1);if(!s)throw new Error("DialogStackContent must be used within a DialogStack");if(!s.isOpen)return null;const b=()=>{s.setIsOpen(!1),s.setActiveIndex(0)},k=()=>{if(p.current){p.current=!1;return}s.closeDialog(a)},x=()=>{p.current=!1,h(!0),y.current=setTimeout(()=>{p.current=!0,h(!1),b()},600)},M=()=>{y.current&&(clearTimeout(y.current),y.current=null),h(!1)},_=A=>{A.stopPropagation(),s.clickable&&s.activeIndex>a&&s.setActiveIndex(a??0)},C=a-s.activeIndex,S=C<0?`-${Math.abs(C)*r}px`:"0",L=a===0&&s.activeIndex===0&&s.shouldAnimate;return m.useEffect(()=>{if(L){const A=setTimeout(()=>{s.setShouldAnimate(!1)},200);return()=>clearTimeout(A)}},[L]),g.jsxs("div",{onClick:_,className:Q("h-[100vh] md:h-[98vh] w-full md:rounded-l-md border bg-background shadow-lg md:transition-all duration-200",L&&"animate-in slide-in-from-right-1/2",C<0&&"brightness-75 blur-[2px]",t),style:{top:0,marginLeft:`${S}`,marginTop:`${window.innerWidth>768?Math.abs(C)*10:0}px`,width:C<0?`calc(100% + ${Math.abs(C)*r}px)`:"100%",zIndex:C<0?50-Math.abs(s.activeIndex-(a??0)):1002,position:C?"absolute":"relative",opacity:C>0?0:1,pointerEvents:C>0?"none":"auto",cursor:s.clickable&&s.activeIndex>a?"pointer":"default"},...c,children:[g.jsx("div",{className:Q("h-full w-full overflow-y-auto p-6 transition-all duration-200",s.activeIndex!==a&&"pointer-events-none select-none"),children:e}),s.activeIndex===a&&g.jsx(Zl,{children:g.jsx(sn,{variant:"ghost",className:Q("fixed z-[1100] top-4 right-4 p-1 size-8 transition-all",u&&"bg-destructive/20 scale-110"),onClick:k,onPointerDown:x,onPointerUp:M,onPointerLeave:M,onPointerCancel:M,"aria-label":"Close",title:s.totalDialogs>1?"Click to close, hold to close all":"Close",children:g.jsx(vr,{})})})]})},gIe=({children:e,className:t,...a})=>g.jsx("h2",{className:Q("font-semibold text-lg leading-none tracking-tight",t),...a,children:e}),kIe=({children:e,className:t,...a})=>g.jsx("p",{className:Q("text-muted-foreground text-sm",t),...a,children:e}),vIe=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),bIe=({children:e,className:t,...a})=>g.jsx("div",{className:Q("flex items-center justify-end space-x-2 pt-4",t),...a,children:e}),xIe=({children:e,className:t,asChild:a,...r})=>{const c=m.useContext(Sr);if(!c)throw new Error("DialogStackNext must be used within a DialogStack");const s=()=>{c.activeIndex<c.totalDialogs-1&&c.setActiveIndex(c.activeIndex+1)};return a&&m.isValidElement(e)?m.cloneElement(e,{onClick:s,className:Q(t,e.props.className),...r}):g.jsx("button",{type:"button",onClick:s,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),disabled:c.activeIndex>=c.totalDialogs-1,...r,children:e||"Next"})},MIe=({children:e,className:t,asChild:a,...r})=>{const c=m.useContext(Sr);if(!c)throw new Error("DialogStackPrevious must be used within a DialogStack");const s=()=>{c.activeIndex>0&&c.setActiveIndex(c.activeIndex-1)};return a&&m.isValidElement(e)?m.cloneElement(e,{onClick:s,className:Q(t,e.props.className),...r}):g.jsx("button",{type:"button",onClick:s,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),disabled:c.activeIndex<=0,...r,children:e||"Previous"})};var wIe=Object.defineProperty,Mn=(e,t)=>wIe(e,"name",{value:t,configurable:!0}),uz="DropdownMenu",[_Ie,NDe]=Vt(uz,[M2]),wn=M2(),[SIe,WZ]=_Ie(uz),CIe=Mn(e=>{const{__scopeDropdownMenu:t,children:a,dir:r,open:c,defaultOpen:s,onOpenChange:u,modal:h=!0}=e,y=wn(t),p=m.useRef(null),[b,k]=Wt({prop:c,defaultProp:s??!1,onChange:u,caller:uz});return g.jsx(SIe,{scope:t,triggerId:pt(),triggerRef:p,contentId:pt(),open:b,onOpenChange:k,onOpenToggle:m.useCallback(()=>k(x=>!x),[k]),modal:h,children:g.jsx(Gq,{...y,open:b,onOpenChange:k,dir:r,modal:h,children:a})})},"DropdownMenu"),LIe="DropdownMenuTrigger",NIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,disabled:c=!1,...s}=t,u=WZ(LIe,r),h=wn(r),y=Pe(a,u.triggerRef);return g.jsx(Ij,{asChild:!0,...h,children:g.jsx(we.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...s,ref:y,onPointerDown:ye(t.onPointerDown,p=>{!c&&p.button===0&&p.ctrlKey===!1&&(u.onOpenToggle(),u.open||p.preventDefault())}),onKeyDown:ye(t.onKeyDown,p=>{c||(["Enter"," "].includes(p.key)&&u.onOpenToggle(),p.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})},"DropdownMenuTrigger")),YZ=Mn(e=>{const{__scopeDropdownMenu:t,...a}=e,r=wn(t);return g.jsx(Zq,{...r,...a})},"DropdownMenuPortal"),IIe="DropdownMenuContent",AIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=WZ(IIe,r),u=wn(r),h=m.useRef(!1);return g.jsx(Yq,{id:s.contentId,"aria-labelledby":s.triggerId,...u,...c,ref:a,onCloseAutoFocus:ye(t.onCloseAutoFocus,y=>{h.current||s.triggerRef.current?.focus(),h.current=!1,y.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,y=>{const p=y.detail.originalEvent,b=p.button===0&&p.ctrlKey===!0,k=p.button===2||b;(!s.modal||k)&&(h.current=!0)}),style:{...t.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)"}})},"DropdownMenuContent")),jIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Aj,{...s,...c,ref:a})},"DropdownMenuGroup")),EIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Kq,{...s,...c,ref:a})},"DropdownMenuLabel")),PIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(_2,{...s,...c,ref:a})},"DropdownMenuItem")),RIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Qq,{...s,...c,ref:a})},"DropdownMenuCheckboxItem")),DIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Jq,{...s,...c,ref:a})},"DropdownMenuRadioGroup")),qIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(ez,{...s,...c,ref:a})},"DropdownMenuRadioItem")),XZ=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(tz,{...s,...c,ref:a})},"DropdownMenuItemIndicator")),zIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(nz,{...s,...c,ref:a})},"DropdownMenuSeparator")),TIe=Mn(e=>{const{__scopeDropdownMenu:t,children:a,open:r,onOpenChange:c,defaultOpen:s}=e,u=wn(t),[h,y]=Wt({prop:r,defaultProp:s??!1,onChange:c,caller:"DropdownMenuSub"});return g.jsx(az,{...u,open:h,onOpenChange:y,children:a})},"DropdownMenuSub"),$Ie=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(oz,{...s,...c,ref:a})},"DropdownMenuSubTrigger")),OIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(rz,{...s,...c,ref:a,style:{...t.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)"}})},"DropdownMenuSubContent"));function HIe({...e}){return g.jsx(CIe,{"data-slot":"dropdown-menu",...e})}function VIe({...e}){return g.jsx(YZ,{"data-slot":"dropdown-menu-portal",...e})}function BIe({...e}){return g.jsx(NIe,{"data-slot":"dropdown-menu-trigger",...e})}function FIe({className:e,sideOffset:t=4,...a}){return g.jsx(YZ,{children:g.jsx(AIe,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Q("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...a})})}function UIe({...e}){return g.jsx(jIe,{"data-slot":"dropdown-menu-group",...e})}function GIe({className:e,inset:t,variant:a="default",...r}){return g.jsx(PIe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:Q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ZIe({className:e,children:t,checked:a,...r}){return g.jsxs(RIe,{"data-slot":"dropdown-menu-checkbox-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(XZ,{children:g.jsx(Ua,{className:"size-4"})})}),t]})}function WIe({...e}){return g.jsx(DIe,{"data-slot":"dropdown-menu-radio-group",...e})}function YIe({className:e,children:t,...a}){return g.jsxs(qIe,{"data-slot":"dropdown-menu-radio-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(XZ,{children:g.jsx(Dl,{className:"size-2 fill-current"})})}),t]})}function XIe({className:e,inset:t,...a}){return g.jsx(EIe,{"data-slot":"dropdown-menu-label","data-inset":t,className:Q("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function KIe({className:e,...t}){return g.jsx(zIe,{"data-slot":"dropdown-menu-separator",className:Q("bg-border -mx-1 my-1 h-px",e),...t})}function QIe({className:e,...t}){return g.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function JIe({...e}){return g.jsx(TIe,{"data-slot":"dropdown-menu-sub",...e})}function eAe({className:e,inset:t,children:a,...r}){return g.jsxs($Ie,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[a,g.jsx(Ga,{className:"ml-auto size-4"})]})}function tAe({className:e,...t}){return g.jsx(OIe,{"data-slot":"dropdown-menu-sub-content",className:Q("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function hz({className:e,type:t,...a}){return g.jsx("input",{type:t,"data-slot":"input",className:Q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:[&::-webkit-calendar-picker-indicator]:invert",e),...a})}var nAe=Object.defineProperty,aAe=(e,t)=>nAe(e,"name",{value:t,configurable:!0}),oAe=m.forwardRef(aAe(function(t,a){return g.jsx(we.label,{...t,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));function UA({className:e,...t}){return g.jsx(oAe,{"data-slot":"label",className:Q("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var rAe=Object.defineProperty,nn=(e,t)=>rAe(e,"name",{value:t,configurable:!0}),iAe={RTL:"rtl"},Pj="Menubar",[kD,cAe,sAe]=Md(Pj),[KZ,IDe]=Vt(Pj,[sAe,Sd]),_n=M2(),QZ=Sd(),[lAe,pz]=KZ(Pj),dAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,value:c,onValueChange:s,defaultValue:u,loop:h=!0,dir:y,...p}=t,b=Yl(y),k=QZ(r),[x,M]=Wt({prop:c,onChange:s,defaultProp:u??"",caller:Pj}),[_,C]=m.useState(null);return g.jsx(lAe,{scope:r,value:x,onMenuOpen:m.useCallback(S=>{M(S),C(S)},[M]),onMenuClose:m.useCallback(()=>M(""),[M]),onMenuToggle:m.useCallback(S=>{M(L=>L?"":S),C(S)},[M]),dir:b,loop:h,children:g.jsx(kD.Provider,{scope:r,children:g.jsx(kD.Slot,{scope:r,children:g.jsx(Bq,{asChild:!0,...k,orientation:"horizontal",loop:h,dir:b,currentTabStopId:_,onCurrentTabStopIdChange:C,children:g.jsx(we.div,{role:"menubar",...p,ref:a})})})})})},"Menubar")),JZ="MenubarMenu",[uAe,eW]=KZ(JZ),hAe=nn(e=>{const{__scopeMenubar:t,value:a,...r}=e,c=pt(),s=a||c||"LEGACY_REACT_AUTO_VALUE",u=pz(JZ,t),h=_n(t),y=m.useRef(null),p=m.useRef(!1),b=u.value===s;return m.useEffect(()=>{b||(p.current=!1)},[b]),g.jsx(uAe,{scope:t,value:s,triggerId:pt(),triggerRef:y,contentId:pt(),wasKeyboardTriggerOpenRef:p,children:g.jsx(Gq,{...h,open:b,onOpenChange:k=>{k||u.onMenuClose()},modal:!1,dir:u.dir,...r})})},"MenubarMenu"),xB="MenubarTrigger",pAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,disabled:c=!1,...s}=t,u=QZ(r),h=_n(r),y=pz(xB,r),p=eW(xB,r),b=m.useRef(null),k=Pe(a,b,p.triggerRef),[x,M]=m.useState(!1),_=y.value===p.value;return g.jsx(kD.ItemSlot,{scope:r,value:p.value,disabled:c,children:g.jsx(Fq,{asChild:!0,...u,focusable:!c,tabStopId:p.value,children:g.jsx(Ij,{asChild:!0,...h,children:g.jsx(we.button,{type:"button",role:"menuitem",id:p.triggerId,"aria-haspopup":"menu","aria-expanded":_,"aria-controls":_?p.contentId:void 0,"data-highlighted":x?"":void 0,"data-state":_?"open":"closed","data-disabled":c?"":void 0,disabled:c,...s,ref:k,onPointerDown:ye(t.onPointerDown,C=>{!c&&C.button===0&&C.ctrlKey===!1&&(y.onMenuOpen(p.value),_||C.preventDefault())}),onPointerEnter:ye(t.onPointerEnter,()=>{y.value&&!_&&(y.onMenuOpen(p.value),b.current?.focus())}),onKeyDown:ye(t.onKeyDown,C=>{c||(["Enter"," "].includes(C.key)&&y.onMenuToggle(p.value),C.key==="ArrowDown"&&y.onMenuOpen(p.value),["Enter"," ","ArrowDown"].includes(C.key)&&(p.wasKeyboardTriggerOpenRef.current=!0,C.preventDefault()))}),onFocus:ye(t.onFocus,()=>M(!0)),onBlur:ye(t.onBlur,()=>M(!1))})})})})},"MenubarTrigger")),fAe=nn(e=>{const{__scopeMenubar:t,...a}=e,r=_n(t);return g.jsx(Zq,{...r,...a})},"MenubarPortal"),MB="MenubarContent",yAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,align:c="start",...s}=t,u=_n(r),h=pz(MB,r),y=eW(MB,r),p=cAe(r),b=m.useRef(!1);return g.jsx(Yq,{id:y.contentId,"aria-labelledby":y.triggerId,"data-radix-menubar-content":"",...u,...s,ref:a,align:c,onCloseAutoFocus:ye(t.onCloseAutoFocus,k=>{!h.value&&!b.current&&y.triggerRef.current?.focus(),b.current=!1,k.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,k=>{const x=k.target;p().some(_=>_.ref.current?.contains(x))&&k.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,()=>{b.current=!0}),onEntryFocus:k=>{y.wasKeyboardTriggerOpenRef.current||k.preventDefault()},onKeyDown:ye(t.onKeyDown,k=>{if(["ArrowRight","ArrowLeft"].includes(k.key)){const x=k.target,M=x.hasAttribute("data-radix-menubar-subtrigger"),_=x.closest("[data-radix-menubar-content]")!==k.currentTarget,S=(h.dir===iAe.RTL?"ArrowRight":"ArrowLeft")===k.key;if(!S&&M||_&&S)return;let N=p().filter(R=>!R.disabled).map(R=>R.value);S&&N.reverse();const j=N.indexOf(y.value);N=h.loop?nW(N,j+1):N.slice(j+1);const[T]=N;T&&h.onMenuOpen(T)}},{checkForDefaultPrevented:!1}),style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})},"MenubarContent")),mAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Aj,{...s,...c,ref:a})},"MenubarGroup")),gAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Kq,{...s,...c,ref:a})},"MenubarLabel")),kAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(_2,{...s,...c,ref:a})},"MenubarItem")),vAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Qq,{...s,...c,ref:a})},"MenubarCheckboxItem")),bAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Jq,{...s,...c,ref:a})},"MenubarRadioGroup")),xAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(ez,{...s,...c,ref:a})},"MenubarRadioItem")),tW=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(tz,{...s,...c,ref:a})},"MenubarItemIndicator")),MAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(nz,{...s,...c,ref:a})},"MenubarSeparator")),wAe="MenubarSub",_Ae=nn(e=>{const{__scopeMenubar:t,children:a,open:r,onOpenChange:c,defaultOpen:s}=e,u=_n(t),[h,y]=Wt({prop:r,defaultProp:s??!1,onChange:c,caller:wAe});return g.jsx(az,{...u,open:h,onOpenChange:y,children:a})},"MenubarSub"),SAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(oz,{"data-radix-menubar-subtrigger":"",...s,...c,ref:a})},"MenubarSubTrigger")),CAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(rz,{...s,"data-radix-menubar-content":"",...c,ref:a,style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})},"MenubarSubContent"));function nW(e,t){return e.map((a,r)=>e[(t+r)%e.length])}nn(nW,"wrapArray");function LAe({className:e,...t}){return g.jsx(dAe,{"data-slot":"menubar",className:Q("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function NAe({...e}){return g.jsx(hAe,{"data-slot":"menubar-menu",...e})}function IAe({...e}){return g.jsx(mAe,{"data-slot":"menubar-group",...e})}function aW({...e}){return g.jsx(fAe,{"data-slot":"menubar-portal",...e})}function AAe({...e}){return g.jsx(bAe,{"data-slot":"menubar-radio-group",...e})}function jAe({className:e,...t}){return g.jsx(pAe,{"data-slot":"menubar-trigger",className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",e),...t})}function EAe({className:e,align:t="start",alignOffset:a=-4,sideOffset:r=8,...c}){return g.jsx(aW,{children:g.jsx(yAe,{"data-slot":"menubar-content",align:t,alignOffset:a,sideOffset:r,className:Q("bg-popover text-popover-foreground data-[state=open]:animate-in 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 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",e),...c})})}function PAe({className:e,inset:t,variant:a="default",...r}){return g.jsx(kAe,{"data-slot":"menubar-item","data-inset":t,"data-variant":a,className:Q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function RAe({className:e,children:t,checked:a,...r}){return g.jsxs(vAe,{"data-slot":"menubar-checkbox-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(tW,{children:g.jsx(Ua,{className:"size-4"})})}),t]})}function DAe({className:e,children:t,...a}){return g.jsxs(xAe,{"data-slot":"menubar-radio-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(tW,{children:g.jsx(Dl,{className:"size-2 fill-current"})})}),t]})}function qAe({className:e,inset:t,...a}){return g.jsx(gAe,{"data-slot":"menubar-label","data-inset":t,className:Q("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function zAe({className:e,...t}){return g.jsx(MAe,{"data-slot":"menubar-separator",className:Q("bg-border -mx-1 my-1 h-px",e),...t})}function TAe({className:e,...t}){return g.jsx("span",{"data-slot":"menubar-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function $Ae({...e}){return g.jsx(_Ae,{"data-slot":"menubar-sub",...e})}function OAe({className:e,inset:t,children:a,...r}){return g.jsxs(SAe,{"data-slot":"menubar-sub-trigger","data-inset":t,className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",e),...r,children:[a,g.jsx(Ga,{className:"ml-auto h-4 w-4"})]})}function HAe({className:e,...t}){return g.jsx(CAe,{"data-slot":"menubar-sub-content",className:Q("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function VAe({className:e,...t}){return g.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Q("mx-auto flex w-full justify-center",e),...t})}function BAe({className:e,...t}){return g.jsx("ul",{"data-slot":"pagination-content",className:Q("flex flex-row items-center gap-1",e),...t})}function FAe({...e}){return g.jsx("li",{"data-slot":"pagination-item",...e})}function fz({className:e,isActive:t,size:a="icon",...r}){return g.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Q(zA({variant:t?"outline":"ghost",size:a}),e),...r})}function UAe({className:e,label:t="Previous",...a}){return g.jsxs(fz,{"aria-label":t,size:"default",className:Q("gap-1 px-2.5 sm:pl-2.5",e),...a,children:[g.jsx(rd,{}),g.jsx("span",{className:"hidden sm:block",children:t})]})}function GAe({className:e,label:t="Next",...a}){return g.jsxs(fz,{"aria-label":t,size:"default",className:Q("gap-1 px-2.5 sm:pr-2.5",e),...a,children:[g.jsx("span",{className:"hidden sm:block",children:t}),g.jsx(Ga,{})]})}function ZAe({className:e,...t}){return g.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:Q("flex size-9 items-center justify-center",e),...t,children:[g.jsx(xo,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]})}var WAe=Object.defineProperty,Xa=(e,t)=>WAe(e,"name",{value:t,configurable:!0}),yz="Popover",[oW,ADe]=Vt(yz,[Ar]),Rj=Ar(),[YAe,Ql]=oW(yz),XAe=Xa(e=>{const{__scopePopover:t,children:a,open:r,defaultOpen:c,onOpenChange:s,modal:u=!1}=e,h=Rj(t),y=m.useRef(null),[p,b]=m.useState(!1),[k,x]=m.useState(0),[M,_]=m.useState(0),[C,S]=Wt({prop:r,defaultProp:c??!1,onChange:s,caller:yz});return g.jsx(b2,{...h,children:g.jsx(YAe,{scope:t,contentId:pt(),titleId:pt(),descriptionId:pt(),titlePresent:k>0,descriptionPresent:M>0,setTitleCount:x,setDescriptionCount:_,triggerRef:y,open:C,onOpenChange:S,onOpenToggle:m.useCallback(()=>S(L=>!L),[S]),hasCustomAnchor:p,onCustomAnchorAdd:m.useCallback(()=>b(!0),[]),onCustomAnchorRemove:m.useCallback(()=>b(!1),[]),modal:u,children:a})})},"Popover"),KAe="PopoverAnchor",QAe=m.forwardRef(Xa(function(t,a){const{__scopePopover:r,...c}=t,s=Ql(KAe,r),u=Rj(r),{onCustomAnchorAdd:h,onCustomAnchorRemove:y}=s;return m.useEffect(()=>(h(),()=>y()),[h,y]),g.jsx(x2,{...u,...c,ref:a})},"PopoverAnchor")),JAe="PopoverTrigger",eje=m.forwardRef(Xa(function(t,a){const{__scopePopover:r,...c}=t,s=Ql(JAe,r),u=Rj(r),h=Pe(a,s.triggerRef),y=g.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":mz(s.open),...c,ref:h,onClick:ye(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?y:g.jsx(x2,{asChild:!0,...u,children:y})},"PopoverTrigger")),rW="PopoverPortal",[tje,nje]=oW(rW,{forceMount:void 0}),aje=Xa(e=>{const{__scopePopover:t,forceMount:a,children:r,container:c}=e,s=Ql(rW,t);return g.jsx(tje,{scope:t,forceMount:a,children:g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:r})})})},"PopoverPortal"),i2="PopoverContent",oje=m.forwardRef(Xa(function(t,a){const r=nje(i2,t.__scopePopover),{forceMount:c=r.forceMount,...s}=t,u=Ql(i2,t.__scopePopover);return g.jsx(bn,{present:c||u.open,children:u.modal?g.jsx(ije,{...s,ref:a}):g.jsx(cje,{...s,ref:a})})},"PopoverContent")),rje=Ca("PopoverContent.RemoveScroll"),ije=m.forwardRef(Xa(function(t,a){const r=Ql(i2,t.__scopePopover),c=m.useRef(null),s=Pe(a,c),u=m.useRef(!1),{nodes:h,registry:y}=sj();return m.useEffect(()=>{const p=c.current;if(p)return uj(p)},[]),g.jsx(k2,{as:rje,allowPinchZoom:!0,shards:m.useMemo(()=>[c,...h.map(p=>({current:p}))],[c,h]),children:g.jsx(iW,{...t,ref:s,branchNodes:h,branchRegistry:y,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,p=>{p.preventDefault(),u.current||r.triggerRef.current?.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,p=>{const b=p.detail.originalEvent,k=b.button===0&&b.ctrlKey===!0,x=b.button===2||k;u.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:ye(t.onFocusOutside,p=>p.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),cje=m.forwardRef(Xa(function(t,a){const r=Ql(i2,t.__scopePopover),c=m.useRef(!1),s=m.useRef(!1);return g.jsx(iW,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||r.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,s.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})},"PopoverContentNonModal")),iW=m.forwardRef(Xa(function(t,a){const{__scopePopover:r,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEscapeKeyDown:y,onPointerDownOutside:p,onFocusOutside:b,onInteractOutside:k,"aria-describedby":x,branchNodes:M,branchRegistry:_,...C}=t,S=Ql(i2,r),L=Rj(r),[A,N]=m.useState(null),j=Pe(a,N);return lj(A),xd(),g.jsx(cj,{registry:_,children:g.jsx(ij,{asChild:!0,loop:!0,trapped:c,branches:M,onMountAutoFocus:s,onUnmountAutoFocus:u,children:g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:k,onEscapeKeyDown:y,onPointerDownOutside:p,onFocusOutside:b,onDismiss:()=>S.onOpenChange(!1),deferPointerDownOutside:!0,children:g.jsx(_j,{"data-state":mz(S.open),role:"dialog",id:S.contentId,"aria-labelledby":S.titlePresent?S.titleId:void 0,"aria-describedby":S.descriptionPresent?cW(x,S.descriptionId):x,...L,...C,ref:j,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function mz(e){return e?"open":"closed"}Xa(mz,"getState");function cW(...e){const t=new Set;for(const a of e)if(typeof a=="string")for(const r of String(a).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Xa(cW,"concatAriaDescribedby");function sW({...e}){return g.jsx(XAe,{"data-slot":"popover",...e})}function lW({...e}){return g.jsx(eje,{"data-slot":"popover-trigger",...e})}function dW({className:e,align:t="center",sideOffset:a=4,...r}){return g.jsx(aje,{children:g.jsx(oje,{"data-slot":"popover-content",align:t,sideOffset:a,className:Q("bg-popover text-popover-foreground 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 z-[1100] w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function sje({...e}){return g.jsx(QAe,{"data-slot":"popover-anchor",...e})}var lje=Object.defineProperty,dje=(e,t)=>lje(e,"name",{value:t,configurable:!0});function yd(e,[t,a]){return Math.min(a,Math.max(t,e))}dje(yd,"clamp");var uje=Object.defineProperty,hje=(e,t)=>uje(e,"name",{value:t,configurable:!0}),uW=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"}),pje=m.forwardRef(hje(function(t,a){return g.jsx(we.span,{...t,ref:a,style:{...uW,...t.style}})},"VisuallyHidden")),fje=Object.defineProperty,Ue=(e,t)=>fje(e,"name",{value:t,configurable:!0}),wB={ItemAligned:"item-aligned",Popper:"popper"},yje={RTL:"rtl"},mje=[" ","Enter","ArrowUp","ArrowDown"],gje=[" ","Enter"],md="Select",[Dj,qj,kje]=Md(md),[Jl,jDe]=Vt(md,[kje,Ar]),gz=Ar(),[vje,Er]=Jl(md),[bje,xje]=Jl(md);function hW(e){const{__scopeSelect:t,children:a,open:r,defaultOpen:c,onOpenChange:s,value:u,defaultValue:h,onValueChange:y,dir:p,name:b,autoComplete:k,disabled:x,required:M,form:_,internal_do_not_use_render:C}=e,S=gz(t),[L,A]=m.useState(null),[N,j]=m.useState(null),[T,R]=m.useState(!1),q=Yl(p),[$,ee]=Wt({prop:r,defaultProp:c??!1,onChange:s,caller:md}),[re,F]=Wt({prop:u,defaultProp:h,onChange:y,caller:md}),G=m.useRef(null),X=m.useRef(!1),[ae,he]=m.useState(null),P=Ue(U=>{he({value:U,hasConsumerStoppedPropagation:X.current}),F(U)},"handleUserSelect"),E=m.useRef(re);m.useEffect(()=>{const U=_?L?.ownerDocument.getElementById(_):L?.form;if(U instanceof HTMLFormElement){const de=Ue(()=>F(E.current),"reset");return U.addEventListener("reset",de),()=>U.removeEventListener("reset",de)}},[_,L,F]);const O=L?!!_||!!L.closest("form"):!0,[Y,V]=m.useState(new Set),D=pt(),z=Array.from(Y).map(U=>U.props.value).join(";"),J=m.useCallback(U=>{V(de=>new Set(de).add(U))},[]),K=m.useCallback(U=>{V(de=>{const ke=new Set(de);return ke.delete(U),ke})},[]),W={required:M,trigger:L,onTriggerChange:A,valueNode:N,onValueNodeChange:j,valueNodeHasChildren:T,onValueNodeHasChildrenChange:R,contentId:D,value:re,onValueChange:F,hasConsumerStoppedPropagationRef:X,userSelection:ae,onUserSelect:P,open:$,onOpenChange:ee,dir:q,triggerPointerDownPosRef:G,disabled:x,name:b,autoComplete:k,form:_,nativeOptions:Y,nativeSelectKey:z,isFormControl:O};return g.jsx(b2,{...S,children:g.jsx(vje,{scope:t,...W,children:g.jsx(Dj.Provider,{scope:t,children:g.jsx(bje,{scope:t,onNativeOptionAdd:J,onNativeOptionRemove:K,children:mW(C)?C(W):a})})})})}Ue(hW,"SelectProvider");var Mje=Ue(e=>{const{__scopeSelect:t,children:a,...r}=e;return g.jsx(hW,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:c})=>g.jsxs(g.Fragment,{children:[a,c?g.jsx(eEe,{__scopeSelect:t}):null]})})},"Select"),wje="SelectTrigger",_je=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,disabled:c=!1,...s}=t,u=gz(r),h=Er(wje,r),y=h.disabled||c,p=Pe(a,h.onTriggerChange),b=qj(r),k=m.useRef("touch"),[x,M,_]=vz(S=>{const L=b().filter(j=>!j.disabled),A=L.find(j=>j.value===h.value),N=bz(L,S,A);N!==void 0&&h.onUserSelect(N.value)}),C=Ue(S=>{y||(h.onOpenChange(!0),_()),S&&(h.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})},"handleOpen");return g.jsx(x2,{asChild:!0,...u,children:g.jsx(we.button,{type:"button",role:"combobox","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:y,"data-disabled":y?"":void 0,"data-placeholder":S2(h.value)?"":void 0,...s,ref:p,onClick:ye(s.onClick,S=>{S.currentTarget.focus(),k.current!=="mouse"&&C(S)}),onPointerDown:ye(s.onPointerDown,S=>{k.current=S.pointerType;const L=S.target;L.hasPointerCapture(S.pointerId)&&L.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:ye(s.onKeyDown,S=>{const L=x.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&(h.hasConsumerStoppedPropagationRef.current=S.isPropagationStopped(),M(S.key)),!(L&&S.key===" ")&&mje.includes(S.key)&&(C(),S.preventDefault())})})})},"SelectTrigger")),Sje="SelectValue",Cje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,className:c,style:s,children:u,placeholder:h="",...y}=t,p=Er(Sje,r),{onValueNodeHasChildrenChange:b}=p,k=u!==void 0,x=Pe(a,p.onValueNodeChange);ht(()=>{b(k)},[b,k]);const M=S2(p.value);return g.jsx(we.span,{...y,asChild:M?!1:y.asChild,ref:x,style:{pointerEvents:"none"},children:g.jsx(m.Fragment,{children:M?h:u},M?"placeholder":"value")})},"SelectValue")),Lje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,children:c,...s}=t;return g.jsx(we.span,{"aria-hidden":!0,...s,ref:a,children:c||"▼"})},"SelectIcon")),Nje="SelectPortal",[Ije,Aje]=Jl(Nje,{forceMount:void 0}),jje=Ue(e=>{const{__scopeSelect:t,forceMount:a,...r}=e;return g.jsx(Ije,{scope:e.__scopeSelect,forceMount:a,children:g.jsx(Zl,{asChild:!0,...r})})},"SelectPortal"),Bl="SelectContent",Eje=m.forwardRef(Ue(function(t,a){const r=Aje(Bl,t.__scopeSelect),{forceMount:c=r.forceMount,...s}=t,u=Er(Bl,t.__scopeSelect),[h,y]=m.useState();return ht(()=>{y(new DocumentFragment)},[]),g.jsx(bn,{present:c||u.open,children:({present:p})=>p?g.jsx(Dje,{...s,ref:a}):g.jsx(Pje,{...s,fragment:h})})},"SelectContent")),Pje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,children:c,fragment:s}=t;return s?No.createPortal(g.jsx(pW,{scope:r,children:g.jsx(Dj.Slot,{scope:r,children:g.jsx("div",{ref:a,children:c})})}),s):null},"SelectContentFragment")),Ma=10,[pW,e1]=Jl(Bl),Rje=Ca("SelectContent.RemoveScroll"),Dje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r}=t,{position:c=wB.ItemAligned,onCloseAutoFocus:s,onEscapeKeyDown:u,onPointerDownOutside:h,side:y,sideOffset:p,align:b,alignOffset:k,arrowPadding:x,collisionBoundary:M,collisionPadding:_,sticky:C,hideWhenDetached:S,avoidCollisions:L,...A}=t,N=Er(Bl,r),[j,T]=m.useState(null),[R,q]=m.useState(null),$=Pe(a,T),[ee,re]=m.useState(null),[F,G]=m.useState(null),X=qj(r),[ae,he]=m.useState(!1),P=m.useRef(!1),E=m.useRef(!1),O=m.useRef(!1);m.useEffect(()=>{if(j)return uj(j)},[j]),xd();const Y=m.useCallback(pe=>{const[be,...Ie]=X().map(Ae=>Ae.ref.current),[_e]=Ie.slice(-1),Me=document.activeElement;for(const Ae of pe)if(Ae===Me||(Ae?.scrollIntoView({block:"nearest"}),Ae===be&&R&&(R.scrollTop=0),Ae===_e&&R&&(R.scrollTop=R.scrollHeight),Ae?.focus(),document.activeElement!==Me))return},[X,R]),V=m.useCallback(()=>Y([ee,j]),[Y,ee,j]);m.useEffect(()=>{ae&&V()},[ae,V]);const{onOpenChange:D,triggerPointerDownPosRef:z}=N;m.useEffect(()=>{if(j){let pe={x:0,y:0};const be=Ue(_e=>{pe={x:Math.abs(Math.round(_e.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(_e.pageY)-(z.current?.y??0))}},"handlePointerMove"),Ie=Ue(_e=>{pe.x<=10&&pe.y<=10?_e.preventDefault():_e.composedPath().includes(j)||D(!1),document.removeEventListener("pointermove",be),z.current=null},"handlePointerUp");return z.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[j,D,z]),m.useEffect(()=>{const pe=Ue(()=>D(!1),"close");return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[D]);const[J,K]=vz(pe=>{const be=X().filter(Me=>!Me.disabled),Ie=be.find(Me=>Me.ref.current===document.activeElement),_e=bz(be,pe,Ie);_e&&setTimeout(()=>_e.ref.current?.focus())}),W=m.useCallback((pe,be,Ie)=>{const _e=!E.current;_e&&(E.current=!0);const Me=!P.current&&!Ie;N.value!==void 0&&N.value===be||Me?(re(pe),Me&&(P.current=!0)):_e&&re(pe)},[N.value]),U=m.useCallback(()=>j?.focus(),[j]),de=m.useCallback((pe,be,Ie)=>{if(!pe)return;const _e=!O.current;_e&&(O.current=!0);const Me=!P.current&&!Ie;(N.value!==void 0&&N.value===be||Me||_e)&&G(pe)},[N.value]),ke=c===wB.Popper?_B:qje,ie=ke===_B?{side:y,sideOffset:p,align:b,alignOffset:k,arrowPadding:x,collisionBoundary:M,collisionPadding:_,sticky:C,hideWhenDetached:S,avoidCollisions:L}:{};return g.jsx(pW,{scope:r,content:j,viewport:R,onViewportChange:q,itemRefCallback:W,selectedItem:ee,onItemLeave:U,itemTextRefCallback:de,focusSelectedItem:V,selectedItemText:F,position:c,isPositioned:ae,searchRef:J,children:g.jsx(k2,{as:Rje,allowPinchZoom:!0,children:g.jsx(ij,{asChild:!0,trapped:N.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:ye(s,pe=>{N.trigger?.focus({preventScroll:!0}),pe.preventDefault()}),children:g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:g.jsx(ke,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:pe=>pe.preventDefault(),...A,...ie,onPlaced:()=>he(!0),ref:$,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:ye(A.onKeyDown,pe=>{const be=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!be&&pe.key.length===1&&K(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let _e=X().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Me=pe.target,Ae=_e.indexOf(Me);_e=_e.slice(Ae+1)}setTimeout(()=>Y(_e)),pe.preventDefault()}})})})})})})},"SelectContentImpl")),qje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,onPlaced:c,...s}=t,u=Er(Bl,r),h=e1(Bl,r),[y,p]=m.useState(null),[b,k]=m.useState(null),x=Pe(a,k),M=qj(r),_=m.useRef(!1),C=m.useRef(!0),{viewport:S,selectedItem:L,selectedItemText:A,focusSelectedItem:N}=h,j=m.useCallback(()=>{if(u.trigger&&u.valueNode&&y&&b&&S&&L&&A){const $=u.trigger.getBoundingClientRect(),ee=b.getBoundingClientRect(),re=u.valueNode.getBoundingClientRect(),F=A.getBoundingClientRect();if(u.dir!==yje.RTL){const Ie=F.left-ee.left,_e=re.left-Ie,Me=$.left-_e,Ae=$.width+Me,Lt=Math.max(Ae,ee.width),vt=window.innerWidth-Ma,ve=yd(_e,[Ma,Math.max(Ma,vt-Lt)]);y.style.minWidth=Ae+"px",y.style.left=ve+"px"}else{const Ie=ee.right-F.right,_e=window.innerWidth-re.right-Ie,Me=window.innerWidth-$.right-_e,Ae=$.width+Me,Lt=Math.max(Ae,ee.width),vt=window.innerWidth-Ma,ve=yd(_e,[Ma,Math.max(Ma,vt-Lt)]);y.style.minWidth=Ae+"px",y.style.right=ve+"px"}const G=M(),X=window.innerHeight-Ma*2,ae=S.scrollHeight,he=window.getComputedStyle(b),P=parseInt(he.borderTopWidth,10),E=parseInt(he.paddingTop,10),O=parseInt(he.borderBottomWidth,10),Y=parseInt(he.paddingBottom,10),V=P+E+ae+Y+O,D=Math.min(L.offsetHeight*5,V),z=window.getComputedStyle(S),J=parseInt(z.paddingTop,10),K=parseInt(z.paddingBottom,10),W=$.top+$.height/2-Ma,U=X-W,de=L.offsetHeight/2,ke=L.offsetTop+de,ie=P+E+ke,pe=V-ie;if(ie<=W){const Ie=G.length>0&&L===G[G.length-1].ref.current;y.style.bottom="0px";const _e=b.clientHeight-S.offsetTop-S.offsetHeight,Me=Math.max(U,de+(Ie?K:0)+_e+O),Ae=ie+Me;y.style.height=Ae+"px"}else{const Ie=G.length>0&&L===G[0].ref.current;y.style.top="0px";const Me=Math.max(W,P+S.offsetTop+(Ie?J:0)+de)+pe;y.style.height=Me+"px",S.scrollTop=ie-W+S.offsetTop}y.style.margin=`${Ma}px 0`,y.style.minHeight=D+"px",y.style.maxHeight=X+"px",c?.(),requestAnimationFrame(()=>_.current=!0)}},[M,u.trigger,u.valueNode,y,b,S,L,A,u.dir,c]);ht(()=>j(),[j]);const[T,R]=m.useState();ht(()=>{b&&R(window.getComputedStyle(b).zIndex)},[b]);const q=m.useCallback($=>{$&&C.current===!0&&(j(),N?.(),C.current=!1)},[j,N]);return g.jsx(zje,{scope:r,contentWrapper:y,shouldExpandOnScrollRef:_,onScrollButtonChange:q,children:g.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:g.jsx(we.div,{...s,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),_B=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,align:c="start",collisionPadding:s=Ma,...u}=t,h=gz(r);return g.jsx(_j,{...h,...u,ref:a,align:c,collisionPadding:s,style:{boxSizing:"border-box",...u.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)"}})},"SelectPopperPosition")),[zje,kz]=Jl(Bl,{}),SB="SelectViewport",Tje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,nonce:c,...s}=t,u=e1(SB,r),h=kz(SB,r),y=Pe(a,u.onViewportChange),p=m.useRef(0);return g.jsxs(g.Fragment,{children:[g.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:c}),g.jsx(Dj.Slot,{scope:r,children:g.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:y,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ye(s.onScroll,b=>{const k=b.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:M}=h;if(M?.current&&x){const _=Math.abs(p.current-k.scrollTop);if(_>0){const C=window.innerHeight-Ma*2,S=parseFloat(x.style.minHeight),L=parseFloat(x.style.height),A=Math.max(S,L);if(A<C){const N=A+_,j=Math.min(C,N),T=N-j;x.style.height=j+"px",x.style.bottom==="0px"&&(k.scrollTop=T>0?T:0,x.style.justifyContent="flex-end")}}}p.current=k.scrollTop})})})]})},"SelectViewport")),$je="SelectGroup",[Oje,Hje]=Jl($je),Vje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t,s=pt();return g.jsx(Oje,{scope:r,id:s,children:g.jsx(we.div,{role:"group","aria-labelledby":s,...c,ref:a})})},"SelectGroup")),Bje="SelectLabel",Fje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t,s=Hje(Bje,r);return g.jsx(we.div,{id:s.id,...c,ref:a})},"SelectLabel")),vD="SelectItem",[Uje,fW]=Jl(vD),Gje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,value:c,disabled:s=!1,textValue:u,...h}=t,y=Er(vD,r),p=e1(vD,r),b=y.value===c,[k,x]=m.useState(u??""),[M,_]=m.useState(!1),C=vn(j=>p.itemRefCallback?.(j,c,s)),S=Pe(a,C),L=pt(),A=m.useRef("touch");function N(j){y.hasConsumerStoppedPropagationRef.current=j.isPropagationStopped(),y.onUserSelect(c),y.onOpenChange(!1)}return Ue(N,"handleSelect"),g.jsx(Uje,{scope:r,value:c,disabled:s,textId:L,isSelected:b,onItemTextChange:m.useCallback(j=>{x(T=>T||(j?.textContent??"").trim())},[]),children:g.jsx(Dj.ItemSlot,{scope:r,value:c,disabled:s,textValue:k,children:g.jsx(we.div,{role:"option","aria-labelledby":L,"data-highlighted":M?"":void 0,"aria-selected":b&&M,"data-state":b?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...h,ref:S,onFocus:ye(h.onFocus,()=>_(!0)),onBlur:ye(h.onBlur,()=>_(!1)),onClick:ye(h.onClick,j=>{s||A.current!=="mouse"&&N(j)}),onPointerUp:ye(h.onPointerUp,j=>{s||A.current==="mouse"&&N(j)}),onPointerDown:ye(h.onPointerDown,j=>{A.current=j.pointerType}),onPointerMove:ye(h.onPointerMove,j=>{A.current=j.pointerType,s?p.onItemLeave?.():A.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(h.onPointerLeave,j=>{j.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:ye(h.onKeyDown,j=>{s||j.target!==j.currentTarget||p.searchRef?.current!==""&&j.key===" "||(gje.includes(j.key)&&N(j),j.key===" "&&j.preventDefault())})})})})},"SelectItem")),oh="SelectItemText",Zje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,className:c,style:s,...u}=t,h=Er(oh,r),y=e1(oh,r),p=fW(oh,r),b=xje(oh,r),[k,x]=m.useState(null),M=vn(N=>y.itemTextRefCallback?.(N,p.value,p.disabled)),_=Pe(a,x,p.onItemTextChange,M),C=k?.textContent,S=m.useMemo(()=>g.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:L,onNativeOptionRemove:A}=b;return ht(()=>(L(S),()=>A(S)),[L,A,S]),g.jsxs(g.Fragment,{children:[g.jsx(we.span,{id:p.textId,...u,ref:_}),p.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!S2(h.value)?No.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),Wje="SelectItemIndicator",Yje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t;return fW(Wje,r).isSelected?g.jsx(we.span,{"aria-hidden":!0,...c,ref:a}):null},"SelectItemIndicator")),CB="SelectScrollUpButton",Xje=m.forwardRef(Ue(function(t,a){const r=e1(CB,t.__scopeSelect),c=kz(CB,t.__scopeSelect),[s,u]=m.useState(!1),h=Pe(a,c.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let y=function(){const b=p.scrollTop>0;u(b)};Ue(y,"handleScroll");const p=r.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[r.viewport,r.isPositioned]),s?g.jsx(yW,{...t,ref:h,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=r;y&&p&&(y.scrollTop=y.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),LB="SelectScrollDownButton",Kje=m.forwardRef(Ue(function(t,a){const r=e1(LB,t.__scopeSelect),c=kz(LB,t.__scopeSelect),[s,u]=m.useState(!1),h=Pe(a,c.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let y=function(){const b=p.scrollHeight-p.clientHeight,k=Math.ceil(p.scrollTop)<b;u(k)};Ue(y,"handleScroll");const p=r.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[r.viewport,r.isPositioned]),s?g.jsx(yW,{...t,ref:h,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=r;y&&p&&(y.scrollTop=y.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),yW=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,onAutoScroll:c,...s}=t,u=e1("SelectScrollButton",r),h=m.useRef(null),y=qj(r),p=m.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return m.useEffect(()=>()=>p(),[p]),ht(()=>{y().find(k=>k.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[y]),g.jsx(we.div,{"aria-hidden":!0,...s,ref:a,style:{flexShrink:0,...s.style},onPointerDown:ye(s.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(c,50))}),onPointerMove:ye(s.onPointerMove,()=>{u.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(c,50))}),onPointerLeave:ye(s.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),Qje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t;return g.jsx(we.div,{"aria-hidden":!0,...c,ref:a})},"SelectSeparator")),Jje="SelectBubbleInput",eEe=m.forwardRef(Ue(function({__scopeSelect:t,...a},r){const c=Er(Jje,t),{value:s,onValueChange:u,required:h,disabled:y,name:p,autoComplete:b,form:k,userSelection:x}=c,{nativeOptions:M,nativeSelectKey:_}=c,C=m.useRef(null),S=Pe(r,C),L=s??"",A=m.useRef(L),N=m.useRef(x),j=m.useRef(!1),T=Array.from(M).some(R=>(R.props.value??"")==="");return m.useEffect(()=>{const R=C.current;if(!R)return;const q=window.HTMLSelectElement.prototype,ee=Object.getOwnPropertyDescriptor(q,"value").set,re=x!==null&&x!==N.current;N.current=x;const F=A.current!==L;A.current=L;const G=re&&F;if(re&&!F&&x.value!==L&&!x.hasConsumerStoppedPropagation&&ee){j.current=!0;try{ee.call(R,x.value),R.dispatchEvent(new Event("change",{bubbles:!0}))}finally{j.current=!1,ee.call(R,L)}return}const X=G&&!x.hasConsumerStoppedPropagation;if(F&&ee){const ae=new Event("change",{bubbles:X});ee.call(R,L),R.dispatchEvent(ae)}},[L,x]),g.jsxs(we.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:p,autoComplete:b,disabled:y,form:k,onChange:R=>{j.current||u(R.target.value)},...a,style:{...uW,...a.style},ref:S,defaultValue:L,children:[S2(s)&&!T?g.jsx("option",{value:""}):null,Array.from(M)]},_)},"SelectBubbleInput"));function mW(e){return typeof e=="function"}Ue(mW,"isFunction");function S2(e){return e===""||e===void 0}Ue(S2,"shouldShowPlaceholder");function vz(e){const t=vn(e),a=m.useRef(""),r=m.useRef(0),c=m.useCallback(u=>{const h=a.current+u;t(h);function y(p){a.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>y(""),1e3))}Ue(y,"updateSearch"),y(h)},[t]),s=m.useCallback(()=>{a.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[a,c,s]}Ue(vz,"useTypeaheadSearch");function bz(e,t,a){const c=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=a?e.indexOf(a):-1;let u=gW(e,Math.max(s,0));c.length===1&&(u=u.filter(p=>p!==a));const y=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return y!==a?y:void 0}Ue(bz,"findNextItem");function gW(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Ue(gW,"wrapArray");function kW({...e}){return g.jsx(Mje,{"data-slot":"select",...e})}function tEe({...e}){return g.jsx(Vje,{"data-slot":"select-group",...e})}function vW({...e}){return g.jsx(Cje,{"data-slot":"select-value",...e})}function bW({className:e,size:t="default",children:a,...r}){return g.jsxs(_je,{"data-slot":"select-trigger","data-size":t,className:Q("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,g.jsx(Lje,{asChild:!0,children:g.jsx(kr,{className:"size-4 opacity-50"})})]})}function xW({className:e,children:t,position:a="popper",...r}){return g.jsx(jje,{children:g.jsxs(Eje,{"data-slot":"select-content",className:Q("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="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:a,...r,children:[g.jsx(wW,{}),g.jsx(Tje,{className:Q("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(_W,{})]})})}function nEe({className:e,...t}){return g.jsx(Fje,{"data-slot":"select-label",className:Q("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function MW({className:e,children:t,...a}){return g.jsxs(Gje,{"data-slot":"select-item",className:Q("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[g.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(Yje,{children:g.jsx(Ua,{className:"size-4"})})}),g.jsx(Zje,{children:t})]})}function aEe({className:e,...t}){return g.jsx(Qje,{"data-slot":"select-separator",className:Q("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function wW({className:e,...t}){return g.jsx(Xje,{"data-slot":"select-scroll-up-button",className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(zu,{className:"size-4"})})}function _W({className:e,...t}){return g.jsx(Kje,{"data-slot":"select-scroll-down-button",className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(kr,{className:"size-4"})})}var oEe=Object.defineProperty,SW=(e,t)=>oEe(e,"name",{value:t,configurable:!0}),xz={Horizontal:"horizontal",Vertical:"vertical"},NB=xz.Horizontal,rEe=Object.values(xz),iEe=m.forwardRef(SW(function(t,a){const{decorative:r,orientation:c=NB,...s}=t,u=CW(c)?c:NB,h=u===xz.Vertical?u:void 0,y=r?{role:"none"}:{"aria-orientation":h,role:"separator"};return g.jsx(we.div,{"data-orientation":u,...y,...s,ref:a})},"Separator"));function CW(e){return rEe.includes(e)}SW(CW,"isValidOrientation");function Mz({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return g.jsx(iEe,{"data-slot":"separator-root",decorative:a,orientation:t,className:Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function LW({...e}){return g.jsx(Iq,{"data-slot":"sheet",...e})}function cEe({...e}){return g.jsx(AG,{"data-slot":"sheet-trigger",...e})}function sEe({...e}){return g.jsx(hj,{"data-slot":"sheet-close",...e})}function lEe({...e}){return g.jsx(Aq,{"data-slot":"sheet-portal",...e})}function dEe({className:e,...t}){return g.jsx(jq,{"data-slot":"sheet-overlay",className:Q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1002] bg-black/50",e),...t})}function NW({className:e,children:t,side:a="right",...r}){return g.jsxs(lEe,{children:[g.jsx(dEe,{}),g.jsxs(Eq,{"data-slot":"sheet-content",className:Q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,g.jsxs(hj,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[g.jsx(vr,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function IW({className:e,...t}){return g.jsx("div",{"data-slot":"sheet-header",className:Q("flex flex-col gap-1.5 p-4",e),...t})}function uEe({className:e,...t}){return g.jsx("div",{"data-slot":"sheet-footer",className:Q("mt-auto flex flex-col gap-2 p-4",e),...t})}function AW({className:e,...t}){return g.jsx(RG,{"data-slot":"sheet-title",className:Q("text-foreground font-semibold",e),...t})}function jW({className:e,...t}){return g.jsx(DG,{"data-slot":"sheet-description",className:Q("text-muted-foreground text-sm",e),...t})}const RR=768;function hEe(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const a=window.matchMedia(`(max-width: ${RR-1}px)`),r=()=>{t(window.innerWidth<RR)};return a.addEventListener("change",r),t(window.innerWidth<RR),()=>a.removeEventListener("change",r)},[]),!!e}function GA({className:e,...t}){return g.jsx("div",{"data-slot":"skeleton",className:Q("bg-accent animate-pulse rounded-md",e),...t})}var pEe=Object.defineProperty,zt=(e,t)=>pEe(e,"name",{value:t,configurable:!0}),[wz,EDe]=Vt("Tooltip",[Ar]),zj=Ar(),fEe="TooltipProvider",yEe=700,bD="tooltip.open",[mEe,_z]=wz(fEe),gEe=zt(e=>{const{__scopeTooltip:t,delayDuration:a=yEe,skipDelayDuration:r=300,disableHoverableContent:c=!1,children:s}=e,u=m.useRef(!0),h=m.useRef(!1),y=m.useRef(0);return m.useEffect(()=>{const p=y.current;return()=>window.clearTimeout(p)},[]),g.jsx(mEe,{scope:t,isOpenDelayedRef:u,delayDuration:a,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(y.current),u.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(p=>{h.current=p},[]),disableHoverableContent:c,children:s})},"TooltipProvider"),xD="Tooltip",[kEe,C2]=wz(xD),vEe=zt(e=>{const{__scopeTooltip:t,children:a,open:r,defaultOpen:c,onOpenChange:s,disableHoverableContent:u,delayDuration:h}=e,y=_z(xD,e.__scopeTooltip),p=zj(t),[b,k]=m.useState(null),[x,M]=m.useState(void 0),_=pt(),C=m.useRef(0),S=u??y.disableHoverableContent,L=h??y.delayDuration,A=m.useRef(!1),[N,j]=Wt({prop:r,defaultProp:c??!1,onChange:zt(re=>{re?(y.onOpen(),document.dispatchEvent(new CustomEvent(bD))):y.onClose(),s?.(re)},"onChange"),caller:xD}),T=m.useMemo(()=>N?A.current?"delayed-open":"instant-open":"closed",[N]),R=m.useCallback(()=>{window.clearTimeout(C.current),C.current=0,A.current=!1,j(!0)},[j]),q=m.useCallback(()=>{window.clearTimeout(C.current),C.current=0,j(!1)},[j]),$=m.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{A.current=!0,j(!0),C.current=0},L)},[L,j]);m.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]);const ee=x??_;return g.jsx(b2,{...p,children:g.jsx(kEe,{scope:t,contentId:ee,setContentId:M,open:N,stateAttribute:T,trigger:b,onTriggerChange:k,onTriggerEnter:m.useCallback(()=>{y.isOpenDelayedRef.current?$():R()},[y.isOpenDelayedRef,$,R]),onTriggerLeave:m.useCallback(()=>{S?q():(window.clearTimeout(C.current),C.current=0)},[q,S]),onOpen:R,onClose:q,disableHoverableContent:S,children:a})})},"Tooltip"),IB="TooltipTrigger",bEe=m.forwardRef(zt(function(t,a){const{__scopeTooltip:r,"aria-describedby":c,...s}=t,u=C2(IB,r),h=_z(IB,r),y=zj(r),p=m.useRef(null),b=Pe(a,p,u.onTriggerChange),k=m.useRef(!1),x=m.useRef(!1),M=m.useCallback(()=>k.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",M),[M]),g.jsx(x2,{asChild:!0,...y,children:g.jsx(we.button,{"aria-describedby":u.open?OW(c,u.contentId):c,"data-state":u.stateAttribute,...s,ref:b,onPointerMove:ye(t.onPointerMove,_=>{_.pointerType!=="touch"&&!x.current&&!h.isPointerInTransitRef.current&&(u.onTriggerEnter(),x.current=!0)}),onPointerLeave:ye(t.onPointerLeave,()=>{u.onTriggerLeave(),x.current=!1}),onPointerDown:ye(t.onPointerDown,()=>{u.open&&u.onClose(),k.current=!0,document.addEventListener("pointerup",M,{once:!0})}),onFocus:ye(t.onFocus,()=>{k.current||u.onOpen()}),onBlur:ye(t.onBlur,u.onClose),onClick:ye(t.onClick,u.onClose)})})},"TooltipTrigger")),EW="TooltipPortal",[xEe,MEe]=wz(EW,{forceMount:void 0}),wEe=zt(e=>{const{__scopeTooltip:t,forceMount:a,children:r,container:c}=e,s=C2(EW,t);return g.jsx(xEe,{scope:t,forceMount:a,children:g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:r})})})},"TooltipPortal"),c2="TooltipContent",_Ee=m.forwardRef(zt(function(t,a){const r=MEe(c2,t.__scopeTooltip),{forceMount:c=r.forceMount,side:s="top",...u}=t,h=C2(c2,t.__scopeTooltip);return g.jsx(bn,{present:c||h.open,children:h.disableHoverableContent?g.jsx(PW,{side:s,...u,ref:a}):g.jsx(SEe,{side:s,...u,ref:a})})},"TooltipContent")),SEe=m.forwardRef(zt(function(t,a){const r=C2(c2,t.__scopeTooltip),c=_z(c2,t.__scopeTooltip),s=m.useRef(null),u=Pe(a,s),[h,y]=m.useState(null),{trigger:p,onClose:b}=r,k=s.current,{onPointerInTransitChange:x}=c,M=m.useCallback(()=>{y(null),x(!1)},[x]),_=m.useCallback((C,S)=>{const L=C.currentTarget,A={x:C.clientX,y:C.clientY},N=RW(A,L.getBoundingClientRect()),j=DW(A,N),T=qW(S.getBoundingClientRect()),R=TW([...j,...T]);y(R),x(!0)},[x]);return m.useEffect(()=>()=>M(),[M]),m.useEffect(()=>{if(p&&k){const C=zt(L=>_(L,k),"handleTriggerLeave"),S=zt(L=>_(L,p),"handleContentLeave");return p.addEventListener("pointerleave",C),k.addEventListener("pointerleave",S),()=>{p.removeEventListener("pointerleave",C),k.removeEventListener("pointerleave",S)}}},[p,k,_,M]),m.useEffect(()=>{if(h){const C=zt(S=>{const L=S.target,A={x:S.clientX,y:S.clientY},N=p?.contains(L)||k?.contains(L),j=!zW(A,h);N?M():j&&(M(),b())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,k,h,b,M]),g.jsx(PW,{...t,ref:u})},"TooltipContentHoverable")),CEe=nU("TooltipContent"),PW=m.forwardRef(zt(function(t,a){const{__scopeTooltip:r,children:c,"aria-label":s,id:u,onEscapeKeyDown:h,onPointerDownOutside:y,...p}=t,b=C2(c2,r),k=zj(r),{onClose:x}=b,[M,_]=m.useState(null),C=Pe(a,_);lj(M),m.useEffect(()=>(document.addEventListener(bD,x),()=>document.removeEventListener(bD,x)),[x]),m.useEffect(()=>{if(b.trigger){const L=zt(A=>{A.target instanceof Node&&A.target.contains(b.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",L,{capture:!0}),()=>window.removeEventListener("scroll",L,{capture:!0})}},[b.trigger,x]);const{setContentId:S}=b;return ht(()=>(S(u),()=>{S(void 0)}),[u,S]),g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:y,onFocusOutside:L=>L.preventDefault(),onDismiss:x,children:g.jsxs(_j,{"data-state":b.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:b.contentId,...k,...p,ref:C,style:{...p.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:[g.jsx(CEe,{children:c}),s?g.jsx(pje,{id:b.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),LEe=m.forwardRef(zt(function(t,a){const{__scopeTooltip:r,...c}=t,s=zj(r);return g.jsx(tNe,{...s,...c,ref:a})},"TooltipArrow"));function RW(e,t){const a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),c=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(a,r,c,s)){case s:return"left";case c:return"right";case a:return"top";case r:return"bottom";default:throw new Error("unreachable")}}zt(RW,"getExitSideFromRect");function DW(e,t,a=5){const r=[];switch(t){case"top":r.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":r.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":r.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":r.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return r}zt(DW,"getPaddedExitPoints");function qW(e){const{top:t,right:a,bottom:r,left:c}=e;return[{x:c,y:t},{x:a,y:t},{x:a,y:r},{x:c,y:r}]}zt(qW,"getPointsFromRect");function zW(e,t){const{x:a,y:r}=e;let c=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const h=t[s],y=t[u],p=h.x,b=h.y,k=y.x,x=y.y;b>r!=x>r&&a<(k-p)*(r-b)/(x-b)+p&&(c=!c)}return c}zt(zW,"isPointInPolygon");function TW(e){const t=e.slice();return t.sort((a,r)=>a.x<r.x?-1:a.x>r.x?1:a.y<r.y?-1:a.y>r.y?1:0),$W(t)}zt(TW,"getHull");function $W(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const c=e[r];for(;t.length>=2;){const s=t[t.length-1],u=t[t.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))t.pop();else break}t.push(c)}t.pop();const a=[];for(let r=e.length-1;r>=0;r--){const c=e[r];for(;a.length>=2;){const s=a[a.length-1],u=a[a.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))a.pop();else break}a.push(c)}return a.pop(),t.length===1&&a.length===1&&t[0].x===a[0].x&&t[0].y===a[0].y?t:t.concat(a)}zt($W,"getHullPresorted");function OW(...e){const t=new Set;for(const a of e)if(typeof a=="string")for(const r of String(a).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}zt(OW,"concatAriaDescribedby");function Tj({delayDuration:e=0,...t}){return g.jsx(gEe,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Sz({...e}){return g.jsx(Tj,{children:g.jsx(vEe,{"data-slot":"tooltip",...e})})}function Cz({...e}){return g.jsx(bEe,{"data-slot":"tooltip-trigger",...e})}function Lz({className:e,sideOffset:t=0,children:a,...r}){return g.jsx(wEe,{children:g.jsxs(_Ee,{"data-slot":"tooltip-content",sideOffset:t,className:Q("bg-primary text-primary-foreground 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[a,g.jsx(LEe,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const NEe="sidebar_state",IEe=3600*24*7,AEe="16rem",jEe="18rem",EEe="3rem",PEe="b",HW=m.createContext(null);function L2(){const e=m.useContext(HW);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function REe({defaultOpen:e=!0,open:t,onOpenChange:a,className:r,style:c,children:s,...u}){const h=hEe(),[y,p]=m.useState(!1),[b,k]=m.useState(e),x=t??b,M=m.useCallback(L=>{const A=typeof L=="function"?L(x):L;a?a(A):k(A),document.cookie=`${NEe}=${A}; path=/; max-age=${IEe}`},[a,x]),_=m.useCallback(()=>h?p(L=>!L):M(L=>!L),[h,M,p]);m.useEffect(()=>{const L=A=>{A.key===PEe&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),_())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[_]);const C=x?"expanded":"collapsed",S=m.useMemo(()=>({state:C,open:x,setOpen:M,isMobile:h,openMobile:y,setOpenMobile:p,toggleSidebar:_}),[C,x,M,h,y,p,_]);return g.jsx(HW.Provider,{value:S,children:g.jsx(Tj,{delayDuration:0,children:g.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":AEe,"--sidebar-width-icon":EEe,...c},className:Q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...u,children:s})})})}function DEe({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:c,...s}){const{isMobile:u,state:h,openMobile:y,setOpenMobile:p}=L2();return a==="none"?g.jsx("div",{"data-slot":"sidebar",className:Q("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...s,children:c}):u?g.jsx(LW,{open:y,onOpenChange:p,...s,children:g.jsxs(NW,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden z-[1002]",style:{"--sidebar-width":jEe},side:e,children:[g.jsxs(IW,{className:"sr-only",children:[g.jsx(AW,{children:"Sidebar"}),g.jsx(jW,{children:"Displays the mobile sidebar."})]}),g.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):g.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?a:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[g.jsx("div",{"data-slot":"sidebar-gap",className:Q("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),g.jsx("div",{"data-slot":"sidebar-container",className:Q("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:g.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:c})})]})}function qEe({className:e,onClick:t,...a}){const{toggleSidebar:r}=L2();return g.jsxs(sn,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:Q("size-7",e),onClick:c=>{t?.(c),r()},...a,children:[g.jsx(mr,{}),g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function zEe({className:e,...t}){const{toggleSidebar:a}=L2();return g.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:Q("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function TEe({className:e,...t}){return g.jsx("main",{"data-slot":"sidebar-inset",className:Q("bg-background relative flex min-h-0 w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function $Ee({className:e,...t}){return g.jsx(hz,{"data-slot":"sidebar-input","data-sidebar":"input",className:Q("bg-background h-8 w-full shadow-none",e),...t})}function OEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Q("flex flex-col gap-2 p-2",e),...t})}function HEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Q("flex flex-col gap-2 p-2",e),...t})}function VEe({className:e,...t}){return g.jsx(Mz,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:Q("bg-sidebar-border mx-2 w-auto",e),...t})}function BEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function FEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Q("relative flex w-full min-w-0 flex-col p-2",e),...t})}function UEe({className:e,asChild:t=!1,...a}){const r=t?Lr:"div";return g.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:Q("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function GEe({className:e,asChild:t=!1,...a}){const r=t?Lr:"button";return g.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...a})}function ZEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:Q("w-full text-sm",e),...t})}function WEe({className:e,...t}){return g.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Q("flex w-full min-w-0 flex-col gap-1",e),...t})}function YEe({className:e,...t}){return g.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Q("group/menu-item relative",e),...t})}const XEe=aj("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden 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"}});function KEe({asChild:e=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:c,className:s,...u}){const h=e?Lr:"button",{isMobile:y,state:p}=L2(),b=g.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:Q(XEe({variant:a,size:r}),s),...u});return c?(typeof c=="string"&&(c={children:c}),g.jsxs(Sz,{children:[g.jsx(Cz,{asChild:!0,children:b}),g.jsx(Lz,{side:"right",align:"center",hidden:p!=="collapsed"||y,...c})]})):b}function QEe({className:e,asChild:t=!1,showOnHover:a=!1,...r}){const c=t?Lr:"button";return g.jsx(c,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after: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",a&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function JEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:Q("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})}function ePe({className:e,showIcon:t=!1,...a}){const r=m.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return g.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:Q("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[t&&g.jsx(GA,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),g.jsx(GA,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function tPe({className:e,...t}){return g.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Q("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function nPe({className:e,...t}){return g.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Q("group/menu-sub-item relative",e),...t})}function aPe({asChild:e=!1,size:t="md",isActive:a=!1,className:r,...c}){const s=e?Lr:"a";return g.jsx(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 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","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...c})}var oPe=Object.defineProperty,Ke=(e,t)=>oPe(e,"name",{value:t,configurable:!0}),AB={Horizontal:"horizontal"},rPe={LTR:"ltr"},VW=["PageUp","PageDown"],BW=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],FW={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},N2="Slider",[MD,iPe,cPe]=Md(N2),[Nz,PDe]=Vt(N2,[cPe]),[sPe,Cd]=Nz(N2),lPe=m.forwardRef(Ke(function(t,a){const{name:r,min:c=0,max:s=100,step:u=1,orientation:h=AB.Horizontal,disabled:y=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:b=!1,defaultValue:k=[c],value:x,onValueChange:M=Ke(()=>{},"onValueChange"),onValueCommit:_=Ke(()=>{},"onValueCommit"),inverted:C=!1,form:S,...L}=t,A=m.useRef(new Set),N=m.useRef(0),j=m.useRef(!1),[T,R]=m.useState(null),$=h===AB.Horizontal?dPe:uPe,[ee,re]=m.useState(null),F=Pe(a,re),[G=[],X]=Wt({prop:x,defaultProp:k,onChange:Ke(V=>{[...A.current][N.current]?.focus({preventScroll:!0,focusVisible:j.current}),j.current=!1,M(V)},"onChange")}),ae=m.useRef(G),he=m.useRef(G);m.useEffect(()=>{const V=S?ee?.ownerDocument.getElementById(S):ee?.closest("form");if(V instanceof HTMLFormElement){const D=Ke(()=>X(he.current),"reset");return V.addEventListener("reset",D),()=>V.removeEventListener("reset",D)}},[ee,S,X]);function P(V){const D=QW(G,V);Y(V,D)}Ke(P,"handleSlideStart");function E(V){Y(V,N.current)}Ke(E,"handleSlideMove");function O(){String(G)!==String(ae.current)&&_(G)}Ke(O,"handleSlideEnd");function Y(V,D,{commit:z}={commit:!1}){const J=Az(u),K=Fu(Math.round((V-c)/u)*u+c,J),W=yd(K,[c,s]),U=p*u;function de(ie){const pe=b?yd(W,[ie[D-1]===void 0?c:ie[D-1]+U,ie[D+1]===void 0?s:ie[D+1]-U]):W,be=XW(ie,pe,D);return tY(be,U)?{nextValues:be,changedIndex:b?D:be.indexOf(pe),hasChanged:String(be)!==String(ie)}:null}Ke(de,"getNextValues");const ke=de(G);ke?.hasChanged&&R(ke.nextValues),X((ie=[])=>{const pe=de(ie);return pe?(N.current=pe.changedIndex,pe.hasChanged&&z&&_(pe.nextValues),pe.hasChanged?pe.nextValues:ie):ie})}return Ke(Y,"updateValues"),g.jsx(sPe,{scope:t.__scopeSlider,name:r,disabled:y,min:c,max:s,valueIndexToChangeRef:N,thumbs:A.current,values:G,orientation:h,form:S,userRequestedValues:T,children:g.jsx(MD.Provider,{scope:t.__scopeSlider,children:g.jsx(MD.Slot,{scope:t.__scopeSlider,children:g.jsx($,{"aria-disabled":y,"data-disabled":y?"":void 0,...L,ref:F,onPointerDown:ye(L.onPointerDown,()=>{y||(ae.current=G,j.current=!1)}),min:c,max:s,inverted:C,onSlideStart:y?void 0:P,onSlideMove:y?void 0:E,onSlideEnd:y?void 0:O,onHomeKeyDown:()=>{y||(j.current=!0,Y(c,0,{commit:!0}))},onEndKeyDown:()=>{y||(j.current=!0,Y(s,G.length-1,{commit:!0}))},onStepKeyDown:({event:V,direction:D})=>{if(!y){j.current=!0;const K=VW.includes(V.key)||V.shiftKey&&BW.includes(V.key)?10:1,W=N.current,U=G[W],de=nY(U,{min:c,step:u,direction:D,multiplier:K});Y(de,W,{commit:!0})}}})})})})},"Slider")),[UW,GW]=Nz(N2,{startEdge:"left",endEdge:"right",size:"width",direction:1}),dPe=m.forwardRef(Ke(function(t,a){const{min:r,max:c,dir:s,inverted:u,onSlideStart:h,onSlideMove:y,onSlideEnd:p,onStepKeyDown:b,...k}=t,[x,M]=m.useState(null),_=Pe(a,M),C=m.useRef(void 0),S=Yl(s),L=S===rPe.LTR,A=L&&!u||!L&&u;function N(j){const T=C.current||x.getBoundingClientRect(),R=[0,T.width],$=$j(R,A?[r,c]:[c,r]);return C.current=T,$(j-T.left)}return Ke(N,"getValueFromPointer"),g.jsx(UW,{scope:t.__scopeSlider,startEdge:A?"left":"right",endEdge:A?"right":"left",direction:A?1:-1,size:"width",children:g.jsx(ZW,{dir:S,"data-orientation":"horizontal",...k,ref:_,style:{...k.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const T=N(j.clientX);h?.(T)},onSlideMove:j=>{const T=N(j.clientX);y?.(T)},onSlideEnd:()=>{C.current=void 0,p?.()},onStepKeyDown:j=>{const R=FW[A?"from-left":"from-right"].includes(j.key);b?.({event:j,direction:R?-1:1})}})})},"SliderHorizontal")),uPe=m.forwardRef(Ke(function(t,a){const{min:r,max:c,inverted:s,onSlideStart:u,onSlideMove:h,onSlideEnd:y,onStepKeyDown:p,...b}=t,k=m.useRef(null),x=Pe(a,k),M=m.useRef(void 0),_=!s;function C(S){const L=M.current||k.current.getBoundingClientRect(),A=[0,L.height],j=$j(A,_?[c,r]:[r,c]);return M.current=L,j(S-L.top)}return Ke(C,"getValueFromPointer"),g.jsx(UW,{scope:t.__scopeSlider,startEdge:_?"bottom":"top",endEdge:_?"top":"bottom",size:"height",direction:_?1:-1,children:g.jsx(ZW,{"data-orientation":"vertical",...b,ref:x,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const L=C(S.clientY);u?.(L)},onSlideMove:S=>{const L=C(S.clientY);h?.(L)},onSlideEnd:()=>{M.current=void 0,y?.()},onStepKeyDown:S=>{const A=FW[_?"from-bottom":"from-top"].includes(S.key);p?.({event:S,direction:A?-1:1})}})})},"SliderVertical")),ZW=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,onSlideStart:c,onSlideMove:s,onSlideEnd:u,onHomeKeyDown:h,onEndKeyDown:y,onStepKeyDown:p,...b}=t,k=Cd(N2,r);return g.jsx(we.span,{...b,ref:a,onKeyDown:ye(t.onKeyDown,x=>{x.key==="Home"?(h(x),x.preventDefault()):x.key==="End"?(y(x),x.preventDefault()):VW.concat(BW).includes(x.key)&&(p(x),x.preventDefault())}),onPointerDown:ye(t.onPointerDown,x=>{const M=x.target;M.setPointerCapture(x.pointerId),x.preventDefault(),k.thumbs.has(M)?M.focus({preventScroll:!0,focusVisible:!1}):c(x)}),onPointerMove:ye(t.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&s(x)}),onPointerUp:ye(t.onPointerUp,x=>{const M=x.target;M.hasPointerCapture(x.pointerId)&&(M.releasePointerCapture(x.pointerId),u(x))})})},"SliderImpl")),hPe="SliderTrack",pPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,...c}=t,s=Cd(hPe,r);return g.jsx(we.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...c,ref:a})},"SliderTrack")),jB="SliderRange",fPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,...c}=t,s=Cd(jB,r),u=GW(jB,r),h=m.useRef(null),y=Pe(a,h),p=s.values.length,b=s.values.map(M=>Iz(M,s.min,s.max)),k=p>1?Math.min(...b):0,x=100-Math.max(...b);return g.jsx(we.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...c,ref:y,style:{...t.style,[u.startEdge]:k+"%",[u.endEdge]:x+"%"}})},"SliderRange")),yPe="SliderThumb",[mPe,WW]=Nz(yPe),gPe="SliderThumbProvider";function YW(e){const{__scopeSlider:t,name:a,children:r,internal_do_not_use_render:c}=e,s=Cd(gPe,t),u=iPe(t),[h,y]=m.useState(null),p=m.useMemo(()=>h?u().findIndex(S=>S.ref.current===h):-1,[u,h]),b=y2(h),k=h?!!s.form||!!h.closest("form"):!0,x=s.values[p],M=a??(s.name?s.name+(s.values.length>1?"[]":""):void 0),_=x===void 0?0:Iz(x,s.min,s.max);m.useEffect(()=>{if(h)return s.thumbs.add(h),()=>{s.thumbs.delete(h)}},[h,s.thumbs]);const C={value:x,name:M,form:s.form,isFormControl:k,index:p,thumb:h,onThumbChange:y,percent:_,size:b};return g.jsx(mPe,{scope:t,...C,children:aY(c)?c(C):r})}Ke(YW,"SliderThumbProvider");var DR="SliderThumbTrigger",kPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,...c}=t,s=Cd(DR,r),u=GW(DR,r),{index:h,value:y,percent:p,size:b,onThumbChange:k}=WW(DR,r),x=Pe(a,k),M=KW(h,s.values.length),_=b?.[u.size],C=_?JW(_,p,u.direction):0;return g.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${C}px)`},children:g.jsx(MD.ItemSlot,{scope:r,children:g.jsx(we.span,{role:"slider","aria-label":t["aria-label"]||M,"aria-valuemin":s.min,"aria-valuenow":y,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...c,ref:x,style:y===void 0?{display:"none"}:t.style,onFocus:ye(t.onFocus,()=>{s.valueIndexToChangeRef.current=h})})})})},"SliderThumbTrigger")),vPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,name:c,...s}=t;return g.jsx(YW,{__scopeSlider:r,name:c,internal_do_not_use_render:({index:u,isFormControl:h})=>g.jsxs(g.Fragment,{children:[g.jsx(kPe,{...s,ref:a,__scopeSlider:r}),h?g.jsx(bPe,{__scopeSlider:r},u):null]})})},"SliderThumb")),EB="SliderBubbleInput",bPe=m.forwardRef(Ke(function({__scopeSlider:t,onInput:a,...r},c){const{index:s,value:u,name:h,form:y}=WW(EB,t),{userRequestedValues:p}=Cd(EB,t),b=m.useRef(null),k=Pe(b,c),x=m.useRef(!1),M=m.useRef(u),_=m.useRef(p),C=m.useRef(p);return m.useEffect(()=>{const S=b.current;if(!S)return;const L=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(L,"value").set,j=M.current,T=j!==u;M.current=u;const R=p!==C.current;if(C.current=p,T&&N){const q=p!==_.current;_.current=p;const $=p?.[s],ee=q&&(R&&$!==j||$===u);x.current=!ee;const re=new Event("input",{bubbles:!0});N.call(S,u),S.dispatchEvent(re),x.current=!1}},[s,u,p]),g.jsx(we.input,{style:{display:"none"},name:h,form:y,...r,ref:k,defaultValue:u,onInput:ye(a,S=>{x.current&&S.stopPropagation()})})},"SliderBubbleInput"));function XW(e=[],t,a){const r=[...e];return r[a]=t,r.sort((c,s)=>c-s)}Ke(XW,"getNextSortedValues");function Iz(e,t,a){const s=100/(a-t)*(e-t);return yd(s,[0,100])}Ke(Iz,"convertValueToPercentage");function KW(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}Ke(KW,"getLabel");function QW(e,t){if(e.length===1)return 0;const a=e.map(c=>Math.abs(c-t)),r=Math.min(...a);return a.indexOf(r)}Ke(QW,"getClosestValueIndex");function JW(e,t,a){const r=e/2,s=$j([0,50],[0,r]);return(r-s(t)*a)*a}Ke(JW,"getThumbInBoundsOffset");function eY(e){return e.slice(0,-1).map((t,a)=>e[a+1]-t)}Ke(eY,"getStepsBetweenValues");function tY(e,t){if(t>0){const a=eY(e);return Math.min(...a)>=t}return!0}Ke(tY,"hasMinStepsBetweenValues");function $j(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}Ke($j,"linearScale");function Az(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[r,c]=t.split("e"),s=r.split(".")[1]||"",u=Number(c);return Math.max(0,s.length-u)}const a=t.split(".")[1];return a?a.length:0}Ke(Az,"getDecimalCount");function Fu(e,t){const a=Math.pow(10,t);return Math.round(e*a)/a}Ke(Fu,"roundValue");function nY(e,{min:t,step:a,direction:r,multiplier:c}){const s=Az(a),u=(e-t)/a,h=Math.round(u),y=Fu(h*a+t,s)===Fu(e,s);let p;return y?p=h+c*r:r>0?p=Math.ceil(u):p=Math.floor(u),Fu(p*a+t,s)}Ke(nY,"getNextStepValue");function aY(e){return typeof e=="function"}Ke(aY,"isFunction");function oY({className:e,defaultValue:t,value:a,min:r=0,max:c=100,id:s,...u}){const h=m.useMemo(()=>Array.isArray(a)?a:Array.isArray(t)?t:[r,c],[a,t,r,c]);return g.jsxs(lPe,{"data-slot":"slider",defaultValue:t,value:a,min:r,max:c,id:s,className:Q("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...u,children:[g.jsx(pPe,{"data-slot":"slider-track",className:Q("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:g.jsx(fPe,{"data-slot":"slider-range",className:Q("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:h.length},(y,p)=>g.jsx(vPe,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}var xPe=(e,t,a,r,c,s,u,h)=>{let y=document.documentElement,p=["light","dark"];function b(M){(Array.isArray(e)?e:[e]).forEach(_=>{let C=_==="class",S=C&&s?c.map(L=>s[L]||L):c;C?(y.classList.remove(...S),y.classList.add(s&&s[M]?s[M]:M)):y.setAttribute(_,M)}),k(M)}function k(M){h&&p.includes(M)&&(y.style.colorScheme=M)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)b(r);else try{let M=localStorage.getItem(t)||a,_=u&&M==="system"?x():M;b(_)}catch{}},MPe=m.createContext(void 0),wPe={setTheme:e=>{},themes:[]},_Pe=()=>{var e;return(e=m.useContext(MPe))!=null?e:wPe};m.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:r,enableColorScheme:c,defaultTheme:s,value:u,themes:h,nonce:y,scriptProps:p})=>{let b=JSON.stringify([a,t,s,e,h,u,r,c]).slice(1,-1);return m.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?y:"",dangerouslySetInnerHTML:{__html:`(${xPe.toString()})(${b})`}})});function SPe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const CPe=e=>{switch(e){case"success":return IPe;case"info":return jPe;case"warning":return APe;case"error":return EPe;default:return null}},LPe=Array(12).fill(0),NPe=({visible:e,className:t})=>me.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},LPe.map((a,r)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),IPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),APe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),jPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),EPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),PPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RPe=()=>{const[e,t]=me.useState(document.hidden);return me.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e};let DPe=1;const qPe=100,PB=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:DPe++};class zPe{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(a=>t(a)),()=>{const a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-qPe;t<=0||(this.toasts=this.toasts.filter(a=>t>0&&this.dismissedToasts.has(a.id)?(this.dismissedToasts.delete(a.id),t--,!1):!0))},this.create=t=>{const{message:a,...r}=t,c=PB(t),s=this.pendingDismissals.get(c);s!==void 0&&(cancelAnimationFrame(s),this.pendingDismissals.delete(c),this.dismissedToasts.delete(c));const u=this.dismissedToasts.has(c),h=t.dismissible===void 0?!0:t.dismissible;return u&&(this.dismissedToasts.delete(c),this.toasts=this.toasts.filter(p=>p.id!==c)),(u?void 0:this.toasts.find(p=>p.id===c))?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...t,id:c,title:a}),{...p,...t,id:c,dismissible:h,title:a}):p):this.addToast({title:a,...r,dismissible:h,id:c}),c},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(c=>c({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const a=this.pendingDismissals.get(t);return a!==void 0&&cancelAnimationFrame(a),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,a)=>this.create({...a,message:t,type:void 0}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let r;a.loading!==void 0&&(r=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,u;const h=c.then(async p=>{if(u=["resolve",p],me.isValidElement(p))s=!1,this.create({id:r,type:"default",message:p});else if($Pe(p)&&!p.ok){s=!1;const k=typeof a.error=="function"?await a.error(`HTTP error! status: ${p.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${p.status}`):a.description,_=typeof k=="object"&&!me.isValidElement(k)?k:{message:k};this.create({id:r,type:"error",description:x,..._})}else if(p instanceof Error){s=!1;const k=typeof a.error=="function"?await a.error(p):a.error,x=typeof a.description=="function"?await a.description(p):a.description,_=typeof k=="object"&&!me.isValidElement(k)?k:{message:k};this.create({id:r,type:"error",description:x,..._})}else if(a.success!==void 0){s=!1;const k=typeof a.success=="function"?await a.success(p):a.success,x=typeof a.description=="function"?await a.description(p):a.description,_=typeof k=="object"&&!me.isValidElement(k)?k:{message:k};this.create({id:r,type:"success",description:x,..._})}}).catch(async p=>{if(u=["reject",p],a.error!==void 0){s=!1;const b=typeof a.error=="function"?await a.error(p):a.error,k=typeof a.description=="function"?await a.description(p):a.description,M=typeof b=="object"&&!me.isValidElement(b)?b:{message:b};this.create({id:r,type:"error",description:k,...M})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),a.finally==null||a.finally.call(a)}),y=()=>new Promise((p,b)=>h.then(()=>u[0]==="reject"?b(u[1]):p(u[1])).catch(b));return typeof r!="string"&&typeof r!="number"?{unwrap:y}:Object.assign(r,{unwrap:y})},this.custom=(t,a)=>{const r=PB(a);return this.create({...a,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const yn=new zPe,TPe=(e,t)=>yn.message(e,t),$Pe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",OPe=TPe,HPe=()=>yn.toasts,VPe=()=>yn.getActiveToasts(),rY=Object.assign(OPe,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:HPe,getToasts:VPe});SPe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function rh(e){return e.label!==void 0}const BPe=3,FPe="24px",UPe="16px",RB=4e3,GPe=356,ZPe=14,WPe=45,YPe=200;function za(...e){return e.filter(Boolean).join(" ")}function XPe(e){const[t,a]=e.split("-"),r=[];return t&&r.push(t),a&&r.push(a),r}const KPe=e=>{var t,a,r,c,s,u,h,y,p;const{invert:b,toast:k,unstyled:x,interacting:M,setHeights:_,visibleToasts:C,heights:S,index:L,toasts:A,expanded:N,removeToast:j,defaultRichColors:T,closeButton:R,style:q,cancelButtonStyle:$,actionButtonStyle:ee,className:re="",descriptionClassName:F="",duration:G,position:X,gap:ae,expandByDefault:he,classNames:P,icons:E,closeButtonAriaLabel:O="Close toast"}=e,[Y,V]=me.useState(null),[D,z]=me.useState(null),[J,K]=me.useState(!1),[W,U]=me.useState(!1),[de,ke]=me.useState(!1),[ie,pe]=me.useState(!1),[be,Ie]=me.useState(!1),[_e,Me]=me.useState(0),[Ae,Lt]=me.useState(0),vt=me.useRef(k.duration||G||RB),ve=me.useRef(null),xe=me.useRef(null),ge=L===0,He=L+1<=C,We=k.type,an=We??"default",tt=k.dismissible!==!1,Yt=k.className||"",gt=k.descriptionClassName||"",Sn=me.useMemo(()=>S.findIndex(De=>De.toastId===k.id)||0,[S,k.id]),Ro=me.useMemo(()=>{var De;return(De=k.closeButton)!=null?De:R},[k.closeButton,R]),Do=me.useMemo(()=>k.duration||G||RB,[k.duration,G]),Aa=me.useRef(0),qo=me.useRef(0),A2=me.useRef(0),na=me.useRef(null),[dn,ja]=X.split("-"),on=me.useMemo(()=>S.reduce((De,Mt,Nt)=>Nt>=Sn?De:De+Mt.height,0),[S,Sn]),j2=RPe(),aa=me.useMemo(()=>{var De;return(De=e.swipeDirections)!=null?De:XPe(X)},[e.swipeDirections,X]),Oj=k.invert||b,zo=We==="loading";qo.current=me.useMemo(()=>Sn*ae+on,[Sn,on]),me.useEffect(()=>{vt.current=Do},[Do]),me.useEffect(()=>{K(!0)},[]),me.useEffect(()=>{const De=xe.current;if(De){const Mt=De.getBoundingClientRect().height;return Lt(Mt),_(Nt=>[{toastId:k.id,height:Mt,position:k.position},...Nt]),()=>_(Nt=>Nt.filter(It=>It.toastId!==k.id))}},[_,k.id]),me.useLayoutEffect(()=>{if(!J)return;const De=xe.current,Mt=De.style.height;De.style.height="auto";const Nt=De.getBoundingClientRect().height;De.style.height=Mt,Lt(Nt),_(It=>It.find(At=>At.toastId===k.id)?It.map(At=>At.toastId===k.id?{...At,height:Nt}:At):[{toastId:k.id,height:Nt,position:k.position},...It])},[J,k.title,k.description,_,k.id,k.jsx,k.action,k.cancel]);const Bn=me.useCallback(()=>{U(!0),Me(qo.current),_(De=>De.filter(Mt=>Mt.toastId!==k.id)),setTimeout(()=>{j(k)},YPe)},[k,j,_,qo]);me.useEffect(()=>{if(k.promise&&We==="loading"||k.duration===1/0||k.type==="loading")return;let De;return N||M||j2?(()=>{if(A2.current<Aa.current){const It=new Date().getTime()-Aa.current;vt.current=vt.current-It}A2.current=new Date().getTime()})():vt.current!==1/0&&(Aa.current=new Date().getTime(),De=setTimeout(()=>{k.onAutoClose==null||k.onAutoClose.call(k,k),Bn()},vt.current)),()=>clearTimeout(De)},[N,M,k,We,j2,Bn]),me.useEffect(()=>{k.delete&&(Bn(),k.onDismiss==null||k.onDismiss.call(k,k))},[Bn,k.delete]);function Pr(){var De;if(E?.loading){var Mt;return me.createElement("div",{className:za(P?.loader,k==null||(Mt=k.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":We==="loading"},E.loading)}return me.createElement(NPe,{className:za(P?.loader,k==null||(De=k.classNames)==null?void 0:De.loader),visible:We==="loading"})}const Ka=k.icon||E?.[We]||CPe(We);var Rr,To;return me.createElement("li",{tabIndex:0,ref:xe,className:za(re,Yt,P?.toast,k==null||(t=k.classNames)==null?void 0:t.toast,P?.[an],k==null||(a=k.classNames)==null?void 0:a[an]),"data-sonner-toast":"","data-rich-colors":(Rr=k.richColors)!=null?Rr:T,"data-styled":!(k.jsx||k.unstyled||x),"data-mounted":J,"data-promise":!!k.promise,"data-swiped":be,"data-removed":W,"data-visible":He,"data-y-position":dn,"data-x-position":ja,"data-index":L,"data-front":ge,"data-swiping":de,"data-dismissible":tt,"data-type":We,"data-invert":Oj,"data-swipe-out":ie,"data-swipe-direction":D,"data-expanded":!!(N||he&&J),"data-testid":k.testId,style:{"--index":L,"--toasts-before":L,"--z-index":A.length-L,"--offset":`${W?_e:qo.current}px`,"--initial-height":he?"auto":`${Ae}px`,...q,...k.style},onDragEnd:()=>{ke(!1),V(null),na.current=null},onPointerDown:De=>{De.button!==2&&(zo||!tt||(ve.current=new Date,Me(qo.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(ke(!0),na.current={x:De.clientX,y:De.clientY})))},onPointerUp:()=>{var De,Mt,Nt;if(ie||!tt)return;na.current=null;const It=Number(((De=xe.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dr=Number(((Mt=xe.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),At=new Date().getTime()-((Nt=ve.current)==null?void 0:Nt.getTime()),un=Y==="x"?It:Dr,Fn=Math.abs(un)/At;if((Y==="x"?aa.includes(It>0?"right":"left"):aa.includes(Dr>0?"bottom":"top"))&&(Math.abs(un)>=WPe||Fn>.11)){Me(qo.current),k.onDismiss==null||k.onDismiss.call(k,k),z(Y==="x"?It>0?"right":"left":Dr>0?"down":"up"),Bn(),pe(!0);return}else{var Cn,t1;(Cn=xe.current)==null||Cn.style.setProperty("--swipe-amount-x","0px"),(t1=xe.current)==null||t1.style.setProperty("--swipe-amount-y","0px")}Ie(!1),ke(!1),V(null)},onPointerMove:De=>{var Mt,Nt,It;if(!na.current||!tt||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const At=De.clientY-na.current.y,un=De.clientX-na.current.x;!Y&&(Math.abs(un)>1||Math.abs(At)>1)&&V(Math.abs(un)>Math.abs(At)?"x":"y");let Fn={x:0,y:0};const qr=Cn=>1/(1.5+Math.abs(Cn)/20);if(Y==="y"){if(aa.includes("top")||aa.includes("bottom"))if(aa.includes("top")&&At<0||aa.includes("bottom")&&At>0)Fn.y=At;else{const Cn=At*qr(At);Fn.y=Math.abs(Cn)<Math.abs(At)?Cn:At}}else if(Y==="x"&&(aa.includes("left")||aa.includes("right")))if(aa.includes("left")&&un<0||aa.includes("right")&&un>0)Fn.x=un;else{const Cn=un*qr(un);Fn.x=Math.abs(Cn)<Math.abs(un)?Cn:un}(Math.abs(Fn.x)>0||Math.abs(Fn.y)>0)&&Ie(!0),(Nt=xe.current)==null||Nt.style.setProperty("--swipe-amount-x",`${Fn.x}px`),(It=xe.current)==null||It.style.setProperty("--swipe-amount-y",`${Fn.y}px`)}},Ro&&!k.jsx&&We!=="loading"?me.createElement("button",{"aria-label":O,"data-disabled":zo,"data-close-button":!0,onClick:zo||!tt?()=>{}:()=>{Bn(),k.onDismiss==null||k.onDismiss.call(k,k)},className:za(P?.closeButton,k==null||(r=k.classNames)==null?void 0:r.closeButton)},(To=E?.close)!=null?To:PPe):null,(We||k.icon||k.promise)&&k.icon!==null&&(E?.[We]!==null||k.icon)?me.createElement("div",{"data-icon":"",className:za(P?.icon,k==null||(c=k.classNames)==null?void 0:c.icon)},We==="loading"?k.icon||Pr():k.promise?Pr():null,We!=="loading"?Ka:null):null,me.createElement("div",{"data-content":"",className:za(P?.content,k==null||(s=k.classNames)==null?void 0:s.content)},me.createElement("div",{"data-title":"",className:za(P?.title,k==null||(u=k.classNames)==null?void 0:u.title)},k.jsx?k.jsx:typeof k.title=="function"?k.title():k.title),k.description?me.createElement("div",{"data-description":"",className:za(F,gt,P?.description,k==null||(h=k.classNames)==null?void 0:h.description)},typeof k.description=="function"?k.description():k.description):null),me.isValidElement(k.cancel)?k.cancel:k.cancel&&rh(k.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:k.cancelButtonStyle||$,onClick:De=>{rh(k.cancel)&&tt&&(k.cancel.onClick==null||k.cancel.onClick.call(k.cancel,De),Bn())},className:za(P?.cancelButton,k==null||(y=k.classNames)==null?void 0:y.cancelButton)},k.cancel.label):null,me.isValidElement(k.action)?k.action:k.action&&rh(k.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:k.actionButtonStyle||ee,onClick:De=>{rh(k.action)&&(k.action.onClick==null||k.action.onClick.call(k.action,De),!De.defaultPrevented&&Bn())},className:za(P?.actionButton,k==null||(p=k.classNames)==null?void 0:p.actionButton)},k.action.label):null)};function DB(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function QPe(e,t){const a={};return[e,t].forEach((r,c)=>{const s=c===1,u=s?"--mobile-offset":"--offset",h=s?UPe:FPe;function y(p){["top","right","bottom","left"].forEach(b=>{a[`${u}-${b}`]=typeof p=="number"?`${p}px`:p})}typeof r=="number"||typeof r=="string"?y(r):typeof r=="object"?["top","right","bottom","left"].forEach(p=>{r[p]===void 0?a[`${u}-${p}`]=h:a[`${u}-${p}`]=typeof r[p]=="number"?`${r[p]}px`:r[p]}):y(h)}),a}function JPe(){const[e,t]=me.useState([]);return me.useEffect(()=>yn.subscribe(a=>{if(a.dismiss){setTimeout(()=>{PA.flushSync(()=>{t(r=>r.filter(c=>c.id!==a.id))})});return}setTimeout(()=>{PA.flushSync(()=>{t(r=>{const c=r.findIndex(s=>s.id===a.id);return c!==-1?[...r.slice(0,c),{...r[c],...a},...r.slice(c+1)]:[a,...r]})})})}),[]),{toasts:e}}const iY=me.forwardRef(function(t,a){const{id:r,invert:c,position:s="bottom-right",hotkey:u=["altKey","KeyT"],expand:h,closeButton:y,className:p,offset:b,mobileOffset:k,theme:x="light",richColors:M,duration:_,style:C,visibleToasts:S=BPe,toastOptions:L,dir:A=DB(),gap:N=ZPe,icons:j,customAriaLabel:T,containerAriaLabel:R="Notifications"}=t,[q,$]=me.useState([]),ee=me.useMemo(()=>r?q.filter(K=>K.toasterId===r):q.filter(K=>!K.toasterId),[q,r]),re=me.useMemo(()=>Array.from(new Set([s].concat(ee.filter(K=>K.position).map(K=>K.position)))),[ee,s]),[F,G]=me.useState([]),[X,ae]=me.useState(!1),[he,P]=me.useState(!1),[E,O]=me.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=me.useRef(null),V=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=me.useRef(null),z=me.useRef(!1),J=me.useCallback(K=>{$(W=>{var U;return(U=W.find(de=>de.id===K.id))!=null&&U.delete||yn.dismiss(K.id),W.filter(({id:de})=>de!==K.id)})},[]);return me.useEffect(()=>yn.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{$(W=>W.map(U=>U.id===K.id?{...U,delete:!0}:U))});return}setTimeout(()=>{PA.flushSync(()=>{$(W=>{const U=W.findIndex(de=>de.id===K.id);return U!==-1?[...W.slice(0,U),{...W[U],...K},...W.slice(U+1)]:[K,...W]})})})}),[]),me.useEffect(()=>{if(x!=="system"){O(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:W})=>{O(W?"dark":"light")})}catch{K.addListener(({matches:U})=>{try{O(U?"dark":"light")}catch(de){console.error(de)}})}},[x]),me.useEffect(()=>{q.length<=1&&ae(!1)},[q]),me.useEffect(()=>{const K=W=>{var U;if(u.length>0&&u.every(ie=>W[ie]||W.code===ie)){var ke;ae(!0),(ke=Y.current)==null||ke.focus()}W.code==="Escape"&&(document.activeElement===Y.current||(U=Y.current)!=null&&U.contains(document.activeElement))&&ae(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[u]),me.useEffect(()=>{if(Y.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,z.current=!1)}},[Y.current]),me.createElement("section",{ref:a,"aria-label":T??`${R} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},re.map((K,W)=>{var U;const[de,ke]=K.split("-");return ee.length?me.createElement("ol",{key:K,dir:A==="auto"?DB():A,tabIndex:-1,ref:Y,className:p,"data-sonner-toaster":!0,"data-sonner-theme":E,"data-y-position":de,"data-x-position":ke,style:{"--front-toast-height":`${((U=F[0])==null?void 0:U.height)||0}px`,"--width":`${GPe}px`,"--gap":`${N}px`,...C,...QPe(b,k)},onBlur:ie=>{z.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(z.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||z.current||(z.current=!0,D.current=ie.relatedTarget)},onMouseEnter:()=>ae(!0),onMouseMove:()=>ae(!0),onMouseLeave:()=>{he||ae(!1)},onDragEnd:()=>ae(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||P(!0)},onPointerUp:()=>P(!1)},ee.filter(ie=>!ie.position&&W===0||ie.position===K).map((ie,pe)=>{var be,Ie;return me.createElement(KPe,{key:ie.id,icons:j,index:pe,toast:ie,defaultRichColors:M,duration:(be=L?.duration)!=null?be:_,className:L?.className,descriptionClassName:L?.descriptionClassName,invert:c,visibleToasts:S,closeButton:(Ie=L?.closeButton)!=null?Ie:y,interacting:he,position:K,style:L?.style,unstyled:L?.unstyled,classNames:L?.classNames,cancelButtonStyle:L?.cancelButtonStyle,actionButtonStyle:L?.actionButtonStyle,closeButtonAriaLabel:L?.closeButtonAriaLabel,removeToast:J,toasts:ee.filter(_e=>_e.position==ie.position),heights:F.filter(_e=>_e.position==ie.position),setHeights:G,expandByDefault:h,gap:N,expanded:X,swipeDirections:t.swipeDirections})})):null}))}),eRe=Object.freeze(Object.defineProperty({__proto__:null,Toaster:iY,toast:rY,useSonner:JPe},Symbol.toStringTag,{value:"Module"})),tRe=({...e})=>{const{theme:t="system"}=_Pe();return g.jsx(iY,{theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})};var nRe=Object.defineProperty,Cr=(e,t)=>nRe(e,"name",{value:t,configurable:!0}),jz="Switch",[aRe,RDe]=Vt(jz),[oRe,Ez]=aRe(jz);function cY(e){const{__scopeSwitch:t,checked:a,children:r,defaultChecked:c,disabled:s,form:u,name:h,onCheckedChange:y,required:p,value:b="on",internal_do_not_use_render:k}=e,[x,M]=Wt({prop:a,defaultProp:c??!1,onChange:y,caller:jz}),[_,C]=m.useState(null),[S,L]=m.useState(null),[A,N]=m.useState(null),j=_?!!u||!!_.closest("form"):!0,T={checked:x,setChecked:M,disabled:s,control:_,setControl:C,name:h,form:u,value:b,userClick:A,onUserClick:N,required:p,defaultChecked:c,isFormControl:j,bubbleInput:S,setBubbleInput:L};return g.jsx(oRe,{scope:t,...T,children:sY(k)?k(T):r})}Cr(cY,"SwitchProvider");var rRe="SwitchTrigger",iRe=m.forwardRef(Cr(function({__scopeSwitch:t,onClick:a,...r},c){const{control:s,form:u,value:h,disabled:y,checked:p,required:b,setControl:k,setChecked:x,onUserClick:M,isFormControl:_,bubbleInput:C}=Ez(rRe,t),S=Pe(c,k),L=m.useRef(p);return m.useEffect(()=>{const A=u?s?.ownerDocument.getElementById(u):s?.form;if(A instanceof HTMLFormElement){const N=Cr(()=>x(L.current),"reset");return A.addEventListener("reset",N),()=>A.removeEventListener("reset",N)}},[s,u,x]),g.jsx(we.button,{type:"button",role:"switch","aria-checked":p,"aria-required":b,"data-state":Pz(p),"data-disabled":y?"":void 0,disabled:y,value:h,...r,ref:S,onClick:ye(a,A=>{const N=A.isPropagationStopped();M({requestedChecked:!p,hasConsumerStoppedPropagation:N}),x(j=>!j),C&&_&&(N||A.stopPropagation())})})},"SwitchTrigger")),cRe=m.forwardRef(Cr(function(t,a){const{__scopeSwitch:r,name:c,checked:s,defaultChecked:u,required:h,disabled:y,value:p,onCheckedChange:b,form:k,...x}=t;return g.jsx(cY,{__scopeSwitch:r,checked:s,defaultChecked:u,disabled:y,required:h,onCheckedChange:b,name:c,form:k,value:p,internal_do_not_use_render:({isFormControl:M})=>g.jsxs(g.Fragment,{children:[g.jsx(iRe,{...x,ref:a,__scopeSwitch:r}),M&&g.jsx(uRe,{__scopeSwitch:r})]})})},"Switch")),sRe="SwitchThumb",lRe=m.forwardRef(Cr(function(t,a){const{__scopeSwitch:r,...c}=t,s=Ez(sRe,r);return g.jsx(we.span,{"data-state":Pz(s.checked),"data-disabled":s.disabled?"":void 0,...c,ref:a})},"SwitchThumb")),dRe="SwitchBubbleInput",uRe=m.forwardRef(Cr(function({__scopeSwitch:t,onClick:a,...r},c){const{control:s,userClick:u,checked:h,defaultChecked:y,required:p,disabled:b,name:k,value:x,form:M,bubbleInput:_,setBubbleInput:C}=Ez(dRe,t),S=Pe(c,C),L=y2(s),A=m.useRef(!1),N=m.useRef(h),j=m.useRef(u),T=m.useRef(null);m.useEffect(()=>{const q=_;if(!q)return;const $=window.HTMLInputElement.prototype,re=Object.getOwnPropertyDescriptor($,"checked").set;if(!re)return;const F=N.current!==h;N.current=h;const G=u!==null&&u!==j.current;if(j.current=u,G)T.current=F?null:u,F&&re.call(q,h),q.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(F){const X=T.current;T.current=null;const ae=X?.requestedChecked===h;A.current=!0,re.call(q,h),q.dispatchEvent(new Event("click",{bubbles:!(ae&&X.hasConsumerStoppedPropagation)})),A.current=!1}},[_,h,u]);const R=m.useRef(h);return g.jsx(we.input,{type:"checkbox","aria-hidden":!0,defaultChecked:y??R.current,required:p,disabled:b,name:k,value:x,form:M,...r,tabIndex:-1,ref:S,onClick:ye(a,q=>{A.current&&q.stopPropagation()}),style:{...r.style,...L,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function sY(e){return typeof e=="function"}Cr(sY,"isFunction");function Pz(e){return e?"checked":"unchecked"}Cr(Pz,"getState");function hRe({className:e,...t}){return g.jsx(cRe,{"data-slot":"switch",className:Q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(lRe,{"data-slot":"switch-thumb",className:Q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var pRe=Object.defineProperty,Ld=(e,t)=>pRe(e,"name",{value:t,configurable:!0}),lY={Automatic:"automatic",Manual:"manual"},Rz="Tabs",[fRe,DDe]=Vt(Rz,[Sd]),dY=Sd(),[yRe,Dz]=fRe(Rz),mRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,value:c,onValueChange:s,defaultValue:u,orientation:h="horizontal",dir:y,activationMode:p=lY.Automatic,...b}=t,k=Yl(y),[x,M]=Wt({prop:c,onChange:s,defaultProp:u??"",caller:Rz});return g.jsx(yRe,{scope:r,baseId:pt(),value:x,onValueChange:M,orientation:h,dir:k,activationMode:p,children:g.jsx(we.div,{dir:k,"data-orientation":h,...b,ref:a})})},"Tabs")),gRe="TabsList",kRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,loop:c=!0,...s}=t,u=Dz(gRe,r),h=dY(r);return g.jsx(Bq,{asChild:!0,...h,orientation:u.orientation,dir:u.dir,loop:c,children:g.jsx(we.div,{role:"tablist","aria-orientation":u.orientation,...s,ref:a})})},"TabsList")),vRe="TabsTrigger",bRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,value:c,disabled:s=!1,...u}=t,h=Dz(vRe,r),y=dY(r),p=qz(h.baseId,c),b=zz(h.baseId,c),k=c===h.value;return g.jsx(Fq,{asChild:!0,...y,focusable:!s,active:k,children:g.jsx(we.button,{type:"button",role:"tab","aria-selected":k,"aria-controls":b,"data-state":k?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:p,...u,ref:a,onMouseDown:ye(t.onMouseDown,x=>{!s&&x.button===0&&x.ctrlKey===!1?(x.currentTarget.focus(),h.onValueChange(c)):x.preventDefault()}),onKeyDown:ye(t.onKeyDown,x=>{s||x.target!==x.currentTarget||[" ","Enter"].includes(x.key)&&h.onValueChange(c)}),onFocus:ye(t.onFocus,()=>{const x=h.activationMode!==lY.Manual;!k&&!s&&x&&h.onValueChange(c)})})})},"TabsTrigger")),xRe="TabsContent",MRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,value:c,forceMount:s,children:u,...h}=t,y=Dz(xRe,r),p=qz(y.baseId,c),b=zz(y.baseId,c),k=c===y.value,x=m.useRef(k);return m.useEffect(()=>{const M=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(M)},[]),g.jsx(bn,{present:s||k,children:({present:M})=>g.jsx(we.div,{"data-state":k?"active":"inactive","data-orientation":y.orientation,role:"tabpanel","aria-labelledby":p,hidden:!M,id:b,tabIndex:0,...h,ref:a,style:{...t.style,animationDuration:x.current?"0s":void 0},children:M&&u})})},"TabsContent"));function qz(e,t){return`${e}-trigger-${t}`}Ld(qz,"makeTriggerId");function zz(e,t){return`${e}-content-${t}`}Ld(zz,"makeContentId");function wRe({className:e,...t}){return g.jsx(mRe,{"data-slot":"tabs",className:Q("flex flex-col gap-2",e),...t})}function _Re({className:e,...t}){return g.jsx(kRe,{"data-slot":"tabs-list",className:Q("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function SRe({className:e,...t}){return g.jsx(bRe,{"data-slot":"tabs-trigger",className:Q("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",e),...t})}function CRe({className:e,...t}){return g.jsx(MRe,{"data-slot":"tabs-content",className:Q("flex-1 outline-none",e),...t})}function uY({className:e,wrapperHeight:t,ref:a,...r}){return g.jsx("div",{"data-slot":"table-container",ref:a,className:Q("relative w-full overflow-x-auto",t),children:g.jsx("table",{"data-slot":"table",className:Q("w-full caption-bottom text-sm",e),...r})})}function hY({className:e,...t}){return g.jsx("thead",{"data-slot":"table-header",className:Q("[&_tr]:border-b",e),...t})}function pY({className:e,...t}){return g.jsx("tbody",{"data-slot":"table-body",className:Q("[&_tr:last-child]:border-0",e),...t})}function LRe({className:e,...t}){return g.jsx("tfoot",{"data-slot":"table-footer",className:Q("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ju({className:e,...t}){return g.jsx("tr",{"data-slot":"table-row",className:Q("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function J1({className:e,...t}){return g.jsx("th",{"data-slot":"table-head",className:Q("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function fr({className:e,...t}){return g.jsx("td",{"data-slot":"table-cell",className:Q("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function NRe({className:e,...t}){return g.jsx("caption",{"data-slot":"table-caption",className:Q("text-muted-foreground mt-4 text-sm",e),...t})}function fY({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:Q("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const qR=new Map;function IRe(e){if(!e)return Promise.resolve();const t=new URL(e,window.location.href).href;if(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(s=>s.href===t))return Promise.resolve();const r=qR.get(t);if(r)return r;const c=new Promise((s,u)=>{const h=document.createElement("link");h.rel="stylesheet",h.href=t,h.onload=()=>s(),h.onerror=()=>{qR.delete(t),u(new Error(`Failed to load control stylesheet: ${t}`))},document.head.appendChild(h)});return qR.set(t,c),c}async function yY(e,t){const a=IRe(t).catch(c=>{console.error(c)}),r=await import(e);return await a,r}function Tz(e,t,a="default"){return function(c){const[s,u]=m.useState(null);return m.useEffect(()=>{let h=!0;return yY(e(),t()).then(y=>{const p=a==="Component"?y.Component:y.default;if(!p)throw new Error(`Control module does not export "${a}"`);h&&u(()=>p)}),()=>{h=!1}},[]),s?m.createElement(s,c):null}}const mY=()=>window.adminizerVersion??"",ARe=e=>`${window.routePrefix}/assets/controls/${e}.es.js?v=${mY()}`,jRe=e=>`${window.routePrefix}/assets/controls/${e}.css?v=${mY()}`;function gd(e){return{modulePath:ARe(e),cssPath:jRe(e)}}const qB=Tz(()=>gd("jsoneditor").modulePath,()=>gd("jsoneditor").cssPath,"Component"),ERe=Tz(()=>gd("handsontable").modulePath,()=>gd("handsontable").cssPath,"Component"),PRe=Tz(()=>gd("monaco").modulePath,()=>gd("monaco").cssPath,"Component");function I2(e){const a=vd().props,r=a.i18n?.common||{},c=e?.page||a.i18n?.page||a.i18nPage||{};return{t:(u,h)=>c[u]||r[u]||h||u,locale:a.i18n?.locale}}const zR=aj("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),$z=m.forwardRef(({options:e,onValueChange:t,variant:a,processing:r,disabled:c,defaultValue:s=[],placeholder:u="",notFound:h="",search:y="",animation:p=0,maxCount:b=3,modalPopover:k=!1,asChild:x=!1,className:M,mode:_="multiple",onOpenItem:C,onAddNew:S,...L},A)=>{const{t:N}=I2(),[j,T]=m.useState(s),[R,q]=m.useState(!1),[$,ee]=m.useState(!1);m.useEffect(()=>{s&&T(s)},[s]);const re=P=>{if(P.key==="Enter")q(!0);else if(P.key==="Backspace"&&!P.currentTarget.value){const E=[...j];E.pop(),T(E),t(E)}},F=P=>{let E;_==="single"?E=j.includes(P)?[]:[P]:E=j.includes(P)?j.filter(O=>O!==P):[...j,P],T(E),t(E),_==="single"&&q(!1)},G=()=>{T([]),t([])},X=()=>{q(P=>!P)},ae=()=>{const P=j.slice(0,b);T(P),t(P)},he=()=>S?g.jsxs("div",{role:"button",className:Q("m-1 cursor-pointer",$?"animate-bounce":"",zR({variant:a})),style:{animationDuration:`${p}s`},onClick:P=>{P.stopPropagation(),S()},children:[g.jsx(cd,{className:"mr-1 h-3.5 w-3.5"}),g.jsx("span",{children:N("Add")})]}):null;return g.jsxs(sW,{open:R,onOpenChange:q,modal:k,children:[g.jsx(lW,{asChild:!0,children:g.jsx(sn,{ref:A,...L,onClick:X,disabled:c,className:Q("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",M),children:j.length>0?g.jsxs("div",{className:"flex justify-between items-center w-full",children:[g.jsxs("div",{className:"flex flex-wrap items-center",children:[j.slice(0,b).map(P=>{const E=e.find(Y=>Y.value===P),O=E?.icon;return g.jsxs("div",{className:Q($?"animate-bounce":"",zR({variant:a})),style:{animationDuration:`${p}s`},children:[O&&g.jsx(O,{className:"h-4 w-4 mr-2"}),E?.label,C&&g.jsx(Tu,{className:"ml-2 h-4 w-4 cursor-pointer text-muted-foreground hover:text-foreground",onClick:Y=>{Y.stopPropagation(),C(P)}}),g.jsx(bo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:Y=>{Y.stopPropagation(),r||F(P)}})]},P)}),_==="multiple"&&j.length>b&&g.jsxs("div",{className:Q("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",$?"animate-bounce":"",zR({variant:a})),style:{animationDuration:`${p}s`},children:[`+ ${j.length-b} more`,g.jsx(bo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:P=>{P.stopPropagation(),ae()}})]}),he()]}),g.jsxs("div",{className:"flex items-center justify-between",children:[j.length>0&&g.jsxs(g.Fragment,{children:[g.jsx(vr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:P=>{P.stopPropagation(),G()}}),g.jsx(Mz,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),g.jsx(kr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):g.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[g.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:u}),g.jsxs("div",{className:"flex items-center",children:[he(),g.jsx(kr,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})]})})}),g.jsx(dW,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>q(!1),children:g.jsxs(Rq,{children:[g.jsx(YG,{placeholder:y,onKeyDown:re}),g.jsxs(XG,{children:[g.jsx(KG,{children:h}),g.jsx(QG,{children:e.map(P=>{const E=j.includes(P.value);return g.jsxs(eZ,{onSelect:()=>F(P.value),className:"cursor-pointer",children:[g.jsx("div",{className:Q("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",E?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:g.jsx(Ua,{className:"h-4 w-4 text-primary-foreground"})}),P.icon&&g.jsx(P.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),g.jsx("span",{children:P.label})]},P.value)})}),g.jsx(JG,{})]})]})}),p>0&&j.length>0&&_==="multiple"&&g.jsx(gr,{className:Q("cursor-pointer my-2 text-foreground bg-background w-3 h-3",$?"":"text-muted-foreground"),onClick:()=>ee(!$)})]})});$z.displayName="MultiSelect";const gY={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},kY=e=>({...e??{},_ts:Date.now()}),RRe=e=>{if(e==="")return"";try{return JSON.parse(e)}catch{return e}},zB=e=>{if(typeof e!="string")return!1;const t=e.trim().toLowerCase();return t.startsWith("<!doctype html")||t.startsWith("<html")||t.startsWith("<")},DRe=e=>{const t={};return e.forEach((a,r)=>{t[r.toLowerCase()]=a}),t},qRe=e=>{if(typeof document>"u")return;const t=document.cookie.split("; ").find(a=>a.startsWith(`${encodeURIComponent(e)}=`));return t?decodeURIComponent(t.split("=").slice(1).join("=")):void 0},zRe=(e,t)=>{const a=new URL(e,window.location.origin);return Object.entries(kY(t)).forEach(([r,c])=>{if(c!=null){if(Array.isArray(c)){c.forEach(s=>a.searchParams.append(r,String(s)));return}a.searchParams.set(r,String(c))}}),`${a.pathname}${a.search}${a.hash}`},TRe=async(e,t,a,r)=>{const c=qRe("XSRF-TOKEN"),s=new Headers(gY);s.set("X-Requested-With","XMLHttpRequest"),c&&s.set("x-xsrf-token",c),Object.entries(r?.headers??{}).forEach(([k,x])=>{x!=null&&s.set(k,String(x))});let u;a instanceof FormData?u=a:a!=null&&(u=typeof a=="string"?a:JSON.stringify(a),s.has("Content-Type")||s.set("Content-Type","application/json"));const h=await fetch(zRe(t,r?.params),{method:e.toUpperCase(),body:u,headers:s,credentials:"same-origin",signal:r?.signal}),y=DRe(h.headers);let p;switch(r?.responseType){case"arraybuffer":p=await h.arrayBuffer();break;case"document":{const k=await h.text(),x=new DOMParser,M=y["content-type"]?.includes("xml")?"application/xml":"text/html";p=x.parseFromString(k,M);break}default:p=await h.blob();break}const b={data:p,status:h.status,headers:y};if(!h.ok){const k=new Error(`Request failed with status ${h.status}`);throw k.response=b,k}return b},ed=async(e,t,a,r)=>{if(r?.responseType&&r.responseType!=="json"&&r.responseType!=="text")return TRe(e,t,a,r);const c=await kd.getClient().request({method:e,url:t,data:a,params:kY(r?.params),headers:{...gY,...r?.headers??{}},signal:r?.signal});return{data:RRe(c.data),status:c.status,headers:c.headers}},Su=async(e,t,a,r)=>{try{const c=await ed(e,t,a,r),s=String(c.headers?.["content-type"]??"").toLowerCase();if(s&&!s.includes("application/json")||zB(c.data))throw new Error(`Expected JSON response from "${t}", but received "${s||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return c}catch(c){const s=c,u=String(s.response?.headers?.["content-type"]??"").toLowerCase();throw zB(s.response?.data)||u.includes("text/html")?new Error("Server returned HTML instead of JSON. Most likely auth session expired. Please reload the page and log in again."):c}},Ha={get:(e,t)=>ed("get",e,void 0,t),post:(e,t,a)=>ed("post",e,t,a),put:(e,t,a)=>ed("put",e,t,a),patch:(e,t,a)=>ed("patch",e,t,a),delete:(e,t,a)=>ed("delete",e,t,a),getJson:(e,t)=>Su("get",e,void 0,t),postJson:(e,t,a)=>Su("post",e,t,a),putJson:(e,t,a)=>Su("put",e,t,a),patchJson:(e,t,a)=>Su("patch",e,t,a),deleteJson:(e,t,a)=>Su("delete",e,t,a)},$Re="axios-compat is a legacy compatibility API. Please use adminApi from @/lib/admin-api instead.",td=()=>{console.log($Re)};td();const Cu=e=>{if(typeof e=="object"&&e!==null&&"isAxiosError"in e)return e;const t=e instanceof Error?e.message:"Request failed",a=new Error(t);a.isAxiosError=!0;const r=e.response;return r&&(a.response=r),a},ORe={async get(e,t){td();try{return await Ha.get(e,t)}catch(a){throw Cu(a)}},async post(e,t,a){td();try{return await Ha.post(e,t,a)}catch(r){throw Cu(r)}},async put(e,t,a){td();try{return await Ha.put(e,t,a)}catch(r){throw Cu(r)}},async patch(e,t,a){td();try{return await Ha.patch(e,t,a)}catch(r){throw Cu(r)}},async delete(e,t){td();try{return await Ha.delete(e,t?.data,t)}catch(a){throw Cu(a)}},isAxiosError(e){return!!(e&&typeof e=="object"&&"isAxiosError"in e)}};function ZA({iconNode:e,className:t,...a}){return g.jsx(e,{className:Q("h-4 w-4",t),...a})}const vY=m.forwardRef(({btnTitle:e,link:t,delModal:a,handleDelete:r,variant:c,btnCLass:s,isLink:u=!0},h)=>{const{t:y}=I2();return g.jsxs(yj,{children:[g.jsx(FG,{asChild:!0,children:g.jsxs(sn,{ref:h,size:"list",variant:c??"ghost",className:Q("cursor-pointer",s),children:[g.jsx(ZA,{iconNode:Bu}),e]})}),g.jsxs(mj,{className:"sm:max-w-[425px] z-[1011]",children:[g.jsxs(gj,{children:[g.jsx(kj,{children:y("Delete")}),g.jsx("div",{className:"mt-2 text-base",children:a.text})]}),g.jsxs(ZG,{children:[g.jsx(hD,{asChild:!0,children:u?g.jsx(sn,{variant:"destructive",asChild:!0,children:g.jsx(RA,{href:t??"#",children:a.yes})}):g.jsx(sn,{variant:"destructive",asChild:!0,onClick:r,children:g.jsx("span",{children:a.yes})})}),g.jsx(hD,{asChild:!0,children:g.jsx(sn,{type:"button",variant:"secondary",children:a.no})})]})]})]})});vY.displayName="DeleteModal";function Lu({moduleComponent:e,cssPath:t,options:a,initialValue:r,onChange:c,name:s,disabled:u}){const[h,y]=m.useState(null);return m.useEffect(()=>{let p=!0;const b=async()=>{const k=await yY(e,t);p&&y(()=>k.default)};return y(null),b(),()=>{p=!1}},[e,t]),h?g.jsx(h,{initialValue:r,options:a,onChange:c,name:s,disabled:u}):null}const HRe=g.jsx("svg",{width:"10",height:"10",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",children:g.jsx("path",{d:"M2.99998 -0.000206962C2.7441 -0.000206962 2.48794 0.0972617 2.29294 0.292762L0.292945 2.29276C-0.0980552 2.68376 -0.0980552 3.31682 0.292945 3.70682L7.58591 10.9998L0.292945 18.2928C-0.0980552 18.6838 -0.0980552 19.3168 0.292945 19.7068L2.29294 21.7068C2.68394 22.0978 3.31701 22.0978 3.70701 21.7068L11 14.4139L18.2929 21.7068C18.6829 22.0978 19.317 22.0978 19.707 21.7068L21.707 19.7068C22.098 19.3158 22.098 18.6828 21.707 18.2928L14.414 10.9998L21.707 3.70682C22.098 3.31682 22.098 2.68276 21.707 2.29276L19.707 0.292762C19.316 -0.0982383 18.6829 -0.0982383 18.2929 0.292762L11 7.58573L3.70701 0.292762C3.51151 0.0972617 3.25585 -0.000206962 2.99998 -0.000206962Z"})}),VRe="_Wrapper_18nsw_1",BRe="_active_18nsw_7",FRe="_Page_18nsw_8",URe="_clone_18nsw_18",GRe="_Remove_18nsw_29",ZRe="_insertBefore_18nsw_35",WRe="_insertAfter_18nsw_36",YRe="_vertical_18nsw_44",pr={Wrapper:VRe,active:BRe,Page:FRe,clone:URe,Remove:GRe,insertBefore:ZRe,insertAfter:WRe,vertical:YRe};var XRe=(e=>(e[e.Before=-1]="Before",e[e.After=1]="After",e))(XRe||{}),bY=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e.Grid="grid",e))(bY||{});const qDe=m.forwardRef(function({id:t,index:a,active:r,clone:c,insertPosition:s,layout:u,onRemove:h,style:y,url:p,mimeType:b,fileName:k,...x},M){const _=b?.startsWith("image/");return g.jsxs("li",{className:Q(pr.Wrapper,r&&pr.active,c&&pr.clone,s===-1&&pr.insertBefore,s===1&&pr.insertAfter,u==="vertical"&&pr.vertical),style:y,ref:M,children:[g.jsxs("button",{className:`${pr.Page} after:bg-black dark:after:bg-gray-300`,"data-id":t.toString(),...x,children:[g.jsx("img",{src:p,alt:"",className:"absolute top-0 left-0 w-full h-full object-cover overflow-hidden rounded-[5px]"}),!_&&g.jsx("div",{className:"absolute inset-x-0 bottom-0 break-words text-white text-sm font-medium bg-black/75 h-[40%] rounded-b-[5px] p-2",children:k})]}),!r&&h?g.jsx("button",{className:pr.Remove,onClick:h,children:HRe}):null]})}),xY=m.createContext(null),KRe=()=>m.useContext(xY),QRe=({entry:e,onSaved:t})=>e.loading||!e.props?g.jsx("div",{className:"flex items-center justify-center h-full w-full",children:g.jsx(wa,{className:"h-6 w-6 animate-spin"})}):e.error?g.jsx("div",{className:"p-4 text-red-500",children:e.error}):g.jsx("div",{className:"h-full",children:g.jsx(wY,{page:{props:e.props},catalog:!0,callback:()=>t()})}),zDe=({children:e})=>{const t=m.useRef(null),[a,r]=m.useState([]),c=m.useRef(0),s=m.useCallback(async(k,x,M)=>{try{const _=M===null?`${window.routePrefix}/model/${x}/add?without_layout=true`:`${window.routePrefix}/model/${x}/edit/${M}?without_layout=true`,C=await Ha.get(_),S=C.data?.props??C.data;r(L=>{const A=[...L];return A[k]&&A[k].model===x&&A[k].id===M&&(A[k]={...A[k],loading:!1,props:S}),A})}catch(_){r(C=>{const S=[...C];return S[k]&&S[k].model===x&&S[k].id===M&&(S[k]={...S[k],loading:!1,error:_?.message||"Error"}),S})}},[]),u=m.useCallback((k,x)=>{r(M=>{const _=M.length,C={model:k,id:x,props:null,loading:!0};return s(_,k,x),[...M,C]})},[s]),h=m.useCallback(k=>{r(x=>{const M=x.length,_={model:k,id:null,props:null,loading:!0};return s(M,k,null),[...x,_]})},[s]);m.useEffect(()=>{const k=c.current,x=a.length;if(x>k)if(k===0)t.current?.open();else for(let M=0;M<x-k;M++)t.current?.next();c.current=x},[a.length]);const y=m.useCallback(k=>{k||(r([]),c.current=0)},[]),p=m.useCallback(()=>{r(k=>k.length<=1?(t.current?.close(),c.current=0,[]):(t.current?.prev(),c.current=k.length-1,k.slice(0,-1)))},[]),b=m.useMemo(()=>({open:u,openCreate:h}),[u,h]);return g.jsxs(xY.Provider,{value:b,children:[e,g.jsxs(Ej,{ref:t,onOpenChange:y,children:[g.jsx(sz,{}),a.length>0&&g.jsx(lz,{children:a.map((k,x)=>g.jsx(dz,{children:g.jsx(QRe,{entry:k,onSaved:p})},`${k.model}-${k.id}-${x}`))})]})]})},JRe=m.lazy(()=>cn(()=>import("./media-manager-DLwgt3w-.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),MY=m.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:s})=>{const u=KRe(),h=m.useCallback(N=>{a(e.name,N.target.value)},[a,e.name]),y=m.useCallback(N=>{a(e.name,N[0])},[a,e.name]),p=m.useCallback(N=>{a(e.name,N)},[a,e.name]),b=m.useCallback(N=>{a(e.name,N)},[a,e.name]),k=m.useCallback(N=>{a(e.name,N)},[a,e.name]),x=m.useCallback(N=>{a(e.name,N)},[a,e.name]),M=m.useCallback(N=>{a(e.name,N.json)},[a,e.name]),_=m.useCallback(N=>{a(e.name,N)},[a,e.name]),C=m.useCallback(N=>{a(e.name,N)},[a,e.name]),S=m.useCallback(N=>{a(e.name,N)},[a,e.name]),L=m.useCallback(N=>{const j=N.map(T=>({id:T.id,url:T.url,mimeType:T.mimeType,filename:T.filename}));a(e.name,j)},[a,e.name]),A=m.useMemo(()=>e.type==="color"?"max-w-[40px] p-px h-[40px] border-transparent":["date","datetime-local","time","month","week"].includes(e.type)?"w-fit":"",[]);switch(e.type){case"checkbox":return g.jsx(OA,{id:`${e.type}-${e.name}`,disabled:r||e.disabled,tabIndex:1,required:e.required,className:"cursor-pointer size-5 scroll-pt-30 scroll-mt-30",checked:t??!1,onCheckedChange:p});case"textarea":return g.jsx(fY,{id:`${e.type}-${e.name}`,tabIndex:1,disabled:r||e.disabled,value:t??"",required:e.required,onChange:h,placeholder:e.label,className:"scroll-pt-30 scroll-mt-30"});case"range":return g.jsxs(g.Fragment,{children:[g.jsx("output",{children:t}),g.jsx(oY,{defaultValue:[Number(e.value)||0],value:[Number(t)||0],max:e.options?.max?Number(e.options.max):100,min:e.options?.min?Number(e.options.min):0,step:1,id:`${e.type}-${e.name}`,onValueChange:y,disabled:r||e.disabled})]});case"select":return g.jsxs(kW,{onValueChange:b,value:t??"",disabled:r||e.disabled,required:e.required,children:[g.jsx(bW,{className:"w-full cursor-pointer min-h-10 scroll-pt-30 scroll-mt-30",id:e.name,children:g.jsx(vW,{placeholder:""})}),g.jsx(xW,{className:"z-[9999999]",children:(Array.isArray(e.isIn)?e.isIn.map(N=>[N,N]):Object.entries(e.isIn)).map(([N,j])=>g.jsx(MW,{value:String(N),children:String(j)},String(N)))})]});case"association":case"association-many":case"select-many":{const j=(e.type==="association"||e.type==="association-many")&&!!e.relatedModel&&!!u,T=j?q=>u.open(e.relatedModel,q):void 0,R=j&&e.canCreateRelated?()=>u.openCreate(e.relatedModel):void 0;return g.jsx($z,{options:e.options,onValueChange:S,defaultValue:t??[],variant:"secondary",notFound:c,search:s,disabled:r||e.disabled,mode:e.type==="association"?"single":"multiple",maxCount:10,onOpenItem:T,onAddNew:R,className:`${r?"pointer-events-none":""} scroll-pt-30 scroll-mt-30`})}case"wysiwyg":case"markdown":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??"",name:`${e.type}-${e.name}`,onChange:k,disabled:r||e.disabled});case"table":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:x,disabled:r||e.disabled});case"jsonEditor":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t,name:`${e.type}-${e.name}`,onChange:M,disabled:r||e.disabled});case"codeEditor":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??"",name:`${e.type}-${e.name}`,onChange:_,disabled:r||e.disabled});case"geoJson":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:C,disabled:r||e.disabled});case"mediamanager":case"single-file":return g.jsx(JRe,{layout:bY.Grid,value:t,onChange:L,config:{...e.options},type:e.type,name:e.name});default:return g.jsx(hz,{id:e.name,type:e.type,className:`${A} min-h-10 scroll-pt-30 scroll-mt-30`,required:e.required,tabIndex:1,value:t??"",onChange:h,disabled:r||e.disabled,placeholder:e.label})}});var wD=new Map,ih=new WeakMap,TB=0,eDe=void 0;function tDe(e){return e?(ih.has(e)||(TB+=1,ih.set(e,TB.toString())),ih.get(e)):"0"}function nDe(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?tDe(e.root):e[t]}`).toString()}function aDe(e){const t=nDe(e);let a=wD.get(t);if(!a){const r=new Map;let c;const s=new IntersectionObserver(u=>{u.forEach(h=>{var y;const p=h.isIntersecting&&c.some(b=>h.intersectionRatio>=b);e.trackVisibility&&typeof h.isVisible>"u"&&(h.isVisible=p),(y=r.get(h.target))==null||y.forEach(b=>{b(p,h)})})},e);c=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:s,elements:r},wD.set(t,a)}return a}function oDe(e,t,a={},r=eDe){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const y=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:y,intersectionRect:y,rootBounds:y}),()=>{}}const{id:c,observer:s,elements:u}=aDe(a),h=u.get(e)||[];return u.has(e)||u.set(e,h),h.push(t),s.observe(e),function(){h.splice(h.indexOf(t),1),h.length===0&&(u.delete(e),s.unobserve(e)),u.size===0&&(s.disconnect(),wD.delete(c))}}function rDe({threshold:e,delay:t,trackVisibility:a,rootMargin:r,root:c,triggerOnce:s,skip:u,initialInView:h,fallbackInView:y,onChange:p}={}){var b;const[k,x]=m.useState(null),M=m.useRef(p),[_,C]=m.useState({inView:!!h,entry:void 0});M.current=p,m.useEffect(()=>{if(u||!k)return;let N;return N=oDe(k,(j,T)=>{C({inView:j,entry:T}),M.current&&M.current(j,T),T.isIntersecting&&s&&N&&(N(),N=void 0)},{root:c,rootMargin:r,threshold:e,trackVisibility:a,delay:t},y),()=>{N&&N()}},[Array.isArray(e)?e.toString():e,k,c,r,s,u,a,y,t]);const S=(b=_.entry)==null?void 0:b.target,L=m.useRef(void 0);!k&&S&&!s&&!u&&L.current!==S&&(L.current=S,C({inView:!!h,entry:void 0}));const A=[x,_.inView,_.entry];return A.ref=A[0],A.inView=A[1],A.entry=A[2],A}const iDe={errors:{}},Oz=new Proxy(iDe,{set(e,t,a){return t==="errors"&&(Object.keys(a).length===0?e.errors={}:e.errors={...e.errors,...a}),!0}}),$B=e=>Oz.errors[e]?.message,OB=()=>Object.values(Oz.errors).some(e=>e.hasError),HB=()=>{Oz.errors={}};function VB({message:e,className:t="",...a}){return e?g.jsx("p",{...a,className:Q("text-sm text-red-600 dark:text-red-400",t),children:e}):null}const cDe=({changes:e,title:t="Changes",className:a="",messages:r={}})=>{const{t:c}=I2({page:r}),s=(y,p)=>c(y,p);if(!e||e.length===0)return g.jsx("div",{className:Q("bg-muted border border-border rounded-lg p-4",a),children:g.jsxs("div",{className:"flex items-center text-muted-foreground",children:[g.jsx($u,{className:"w-5 h-5 mr-2"}),g.jsx("span",{children:s("Changes not found","Changes not found")})]})});const u=y=>y===null?"null":y===void 0?"—":typeof y=="boolean"?y?s("Yes","Yes"):s("No","No"):typeof y=="object"?JSON.stringify(y):String(y),h=y=>y.oldValue===void 0?"added":y.newValue===void 0?"removed":"modified";return g.jsxs("div",{className:Q("bg-card border border-border rounded-lg shadow-sm",a),children:[g.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted",children:g.jsxs("h3",{className:"text-lg font-semibold text-card-foreground flex items-center",children:[g.jsx(fn,{className:"w-5 h-5 mr-2"}),t," (",e.length,")"]})}),g.jsx("div",{className:"divide-y divide-border",children:e.map((y,p)=>{const b=h(y),k=b==="added"?cd:b==="removed"?Hu:fn,x=Q("text-xs px-2 py-1 rounded-full bg-opacity-10",b==="added"&&"text-green-600 bg-green-100",b==="removed"&&"text-destructive bg-destructive/20",b==="modified"&&"text-primary bg-primary/20"),M=b==="added"?"text-green-600":b==="removed"?"text-destructive":"text-primary";return g.jsxs("div",{className:"p-4 hover:bg-muted/50 transition-colors",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center",children:[me.createElement(k,{className:Q("w-4 h-4 mr-2",M)}),g.jsx("span",{className:"font-medium text-card-foreground",children:y.field})]}),g.jsx("span",{className:x,children:b==="added"?s("Added","Added"):b==="removed"?s("Removed","Removed"):s("Updated","Updated")})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[b!=="added"&&g.jsxs("div",{className:"p-2 bg-destructive/10 border border-destructive/20 rounded",children:[g.jsxs("div",{className:"text-xs text-destructive font-medium mb-1",children:[s("Old","Old"),":"]}),g.jsx("div",{className:"text-destructive-foreground font-mono break-words",children:u(y.oldValue)})]}),b!=="removed"&&g.jsxs("div",{className:"p-2 bg-green-50 border border-green-100 rounded",children:[g.jsxs("div",{className:"text-xs text-green-600 font-medium mb-1",children:[s("New","New"),":"]}),g.jsx("div",{className:"text-green-800 font-mono break-words",children:u(y.newValue)})]})]}),b==="modified"&&g.jsxs("div",{className:"mt-2 flex items-center text-xs text-muted-foreground",children:[g.jsx(qu,{className:"w-3 h-3 mr-1"}),s("changed type","changed type"),": ",y.type]})]},p)})})]})},sDe=({modelName:e,modelId:t,handleWatchHistory:a})=>{const[r,c]=m.useState([]),[s,u]=m.useState(!1),[h,y]=m.useState(null),[p,b]=m.useState(!0),k="currentHistoryView",{t:x}=I2(),M=x("Diff");m.useEffect(()=>{(async()=>{b(!0);try{const L=await Ha.post(`${window.routePrefix}/history/get-model-history`,{modelName:e,modelId:t});L.data.data&&c(L.data.data)}catch(L){console.log(L)}finally{b(!1)}})()},[e,t]);const _=async S=>{try{const L=await Ha.post(`${window.routePrefix}/history/get-model-fields`,{historyId:S});L.data.data&&(localStorage.setItem(k,S.toString()),a(L.data.data))}catch(L){console.log(L)}},C=S=>{const L=localStorage.getItem(k);return L?L===S.id.toString():S.isCurrent};return g.jsx("div",{className:"relative h-full",children:g.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[g.jsxs(uY,{wrapperHeight:"max-h-full",children:[g.jsx(hY,{className:"sticky top-0 bg-background shadow",children:g.jsxs(ju,{children:[g.jsx(J1,{className:"p-2 text-left",children:x("Date")}),g.jsx(J1,{className:"p-2 text-left",children:x("Event")}),g.jsx(J1,{className:"p-2 text-left",children:x("User")}),g.jsx(J1,{className:"p-2 text-left",children:M}),g.jsx(J1,{className:"p-2 text-left"})]})}),g.jsx(pY,{children:p?g.jsx(ju,{children:g.jsx(fr,{colSpan:5,className:"p-10 text-center",children:g.jsx(wa,{className:"mx-auto size-8 animate-spin"})})}):r.length>0?r.map(S=>g.jsxs(ju,{children:[g.jsx(fr,{className:"p-2 self-start pt-2.5",children:new Date(S.createdAt).toLocaleString()}),g.jsx(fr,{className:"p-2 self-start pt-2.5 capitalize",children:S.action}),g.jsx(fr,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:g.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:S.user.login})}),g.jsx(fr,{className:"p-2 align-middle",children:g.jsx(sn,{variant:"green",size:"sm",onClick:()=>{y(S.diff),u(!0)},children:g.jsx(yr,{})})}),g.jsx(fr,{className:"p-2 align-middle text-center",children:C(S)?g.jsx("span",{className:"font-medium",children:x("Current")}):g.jsx(sn,{variant:"outline",size:"sm",onClick:()=>_(S.id),children:x("Watch")})})]},S.id)):g.jsx(ju,{children:g.jsx(fr,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:x("There is no history")})})})]}),g.jsx(yj,{open:s,onOpenChange:S=>{u(S),S||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:g.jsxs(mj,{className:"z-[1022] sm:max-w-[60vw]",children:[g.jsx(gj,{children:g.jsx(kj,{children:M})}),g.jsx(cDe,{changes:h,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},lDe=({dialogRef:e,modelId:t,modelName:a,callback:r})=>g.jsxs(Ej,{ref:e,children:[g.jsx(sz,{}),g.jsx(lz,{children:g.jsx(dz,{children:g.jsx(sDe,{modelId:t,modelName:a,handleWatchHistory:r})})})]}),BB=m.memo(({field:e})=>!e||typeof e!="object"||!e.label?(console.error("Invalid field for LabelRenderer:",e),null):g.jsxs("div",{className:"flex gap-3",children:[g.jsx(UA,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&g.jsx(Tj,{children:g.jsxs(Sz,{children:[g.jsx(Cz,{onClick:t=>t.preventDefault(),children:g.jsx(ZA,{iconNode:Ou,className:"text-primary w-5 h-5 cursor-pointer"})}),g.jsx(Lz,{align:"center",side:"top",className:"z-1002",children:g.jsx("p",{children:e.tooltip})})]})})]})),dDe=m.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:s,invalidFieldMessage:u})=>{if(!e||typeof e!="object"||!e.name||!e.type)return console.error("Invalid field for LazyField:",e),g.jsx("div",{className:"text-red-500",children:u||"Error: Invalid field data"});const[h,y]=rDe({triggerOnce:!0,rootMargin:"100px 0px"});return g.jsx("div",{ref:h,className:"grid gap-4 w-full",children:y?g.jsx(MY,{field:e,value:t,onChange:a,notFound:c,search:s,processing:r}):g.jsx(GA,{className:"w-full h-[250px] rounded-sm"})})}),wY=({page:e,catalog:t,callback:a,openNewWindow:r,openNewWindowLabel:c,isNavigation:s,DnavVisible:u,visibleLable:h})=>{const{btnBack:y,btnHistory:p,view:b,edit:k,history:x,notFound:M,model:_,fields:C}=e.props,{t:S}=I2(),{data:L,setData:A,post:N,processing:j,transform:T,errors:R}=nq({...Object.fromEntries((C||[]).map(E=>[E.name,E.value??void 0])),jsonPopupCatalog:t}),[q,$]=m.useState(!1),[ee,re]=m.useState(r??!1),[F,G]=m.useState(u??!1),X=m.useRef(null);m.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),m.useEffect(()=>(re(r??!1),HB(),A({...Object.fromEntries((C||[]).map(E=>[E.name,(E.type==="mediamanager"||E.type==="single-file")&&(E.value===null||E.value===void 0)?[]:E.value])),jsonPopupCatalog:t}),()=>HB()),[C,t,r,A]);const ae=m.useCallback((E,O)=>{A(E,O)},[A]);if(!Array.isArray(C))return console.error("Fields is not an array:",C),g.jsx("div",{className:"p-4 text-red-500",children:S("Error: Fields data is invalid")});if(C.length===0)return console.warn("Fields array is empty"),g.jsx("div",{className:"p-4 text-gray-500",children:S("No fields to display")});const he=C.filter(E=>!E||typeof E!="object"||!E.name||!E.type||!E.label);if(he.length>0)return console.error("Invalid fields found:",he),g.jsx("div",{className:"p-4 text-red-500",children:S("Error: Some fields are missing required properties (name, type, label)")});const P=async E=>{if(E.preventDefault(),t){$(!0);try{const O=await Ha.post(e.props.postLink,L);O.status===200&&a&&(s?a(O.data.record,ee,F):a(O.data.record))}catch(O){const Y=O?.response;rY.error(Y?.data?.error??S("Error: Invalid field data"))}finally{$(!1)}}else{const O=localStorage.getItem("backUrl");T(Y=>({...Y,redirectUrl:O??""})),N(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return g.jsxs("div",{className:"w-full min-w-0",children:[g.jsx("div",{className:"w-full sticky z-[1001] top-0 bg-background shadow-md lg:hidden",children:g.jsxs("div",{className:"p-4 flex gap-4",children:[!t&&g.jsx(sn,{className:"w-fit",asChild:!0,children:g.jsxs(RA,{href:y.link,preserveScroll:!0,children:[g.jsx(ZA,{iconNode:id}),y.title]})}),g.jsxs(sn,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:q||j||e.props.view||OB(),children:[q||j&&g.jsx(wa,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]}),x&&(k||b)&&g.jsx("div",{className:"flex gap-2 justify-start",children:g.jsx(sn,{variant:"outline",className:"w-fit",onClick:E=>{E.preventDefault(),X.current?.open()},children:p.title})})]})}),g.jsxs("div",{className:"p-4 w-full mt-6",children:[g.jsx("form",{id:"addUserForm",onSubmit:P,className:b?"cursor-not-allowed":"",children:g.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[g.jsx("div",{className:"flex flex-col gap-10",children:C.map(E=>g.jsx("div",{className:`grid gap-4 w-full ${b?"pointer-events-none":""}`,children:E.type==="markdown"||E.type==="table"||E.type==="jsonEditor"||E.type==="codeEditor"||E.type==="geoJson"?g.jsxs(g.Fragment,{children:[g.jsx(BB,{field:E}),g.jsx(VB,{message:R[E.name]??$B(`${E.type}-${E.name}`)}),g.jsx(dDe,{field:E,value:L[E.name],onChange:ae,processing:q||j||b,notFound:M,search:e.props.search,invalidFieldMessage:S("Error: Invalid field data")})]}):g.jsxs(g.Fragment,{children:[g.jsx(BB,{field:E}),g.jsx(VB,{message:R[E.name]??$B(`${E.type}-${E.name}`)}),g.jsx(MY,{field:E,value:L[E.name],onChange:ae,processing:q||j||b,notFound:M,search:e.props.search})]})},E.name))}),g.jsxs("div",{className:"p-4 rounded-md h-fit sticky top-[54px] hidden lg:grid gap-4 shadow",children:[g.jsxs("div",{className:"flex gap-4",children:[!t&&g.jsx(sn,{className:"w-fit",asChild:!0,children:g.jsxs(RA,{href:y.link,preserveScroll:!0,children:[g.jsx(ZA,{iconNode:id}),y.title]})}),g.jsxs(sn,{variant:"green",type:"submit",className:"w-fit",disabled:q||j||e.props.view||OB(),children:[(q||j)&&g.jsx(wa,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-4 items-center",children:[g.jsx(OA,{id:"targetBlank",checked:ee,onCheckedChange:E=>re(!!E),className:"cursor-pointer size-5"}),g.jsx(UA,{htmlFor:"targetBlank",children:c})]}),g.jsxs("div",{className:"flex gap-4 items-center",children:[g.jsx(OA,{id:"visible",checked:F,onCheckedChange:E=>G(!!E),className:"cursor-pointer size-5"}),g.jsx(UA,{htmlFor:"visible",children:h})]})]}),x&&(k||b)&&g.jsx("div",{className:"flex gap-2 justify-start",children:g.jsx(sn,{variant:"outline",className:"w-fit",onClick:E=>{E.preventDefault(),X.current?.open()},children:p.title})})]})]})}),x&&(k||b)&&g.jsx(lDe,{dialogRef:X,modelName:_,modelId:C.find(E=>E.name==="id")?.value,callback:E=>{for(const O of Object.keys(E))A(O,E[O]);X.current?.close()}})]})]})};function uDe(){window.UIComponents??={},window.JSComponents??={},window.sonner=eRe,window.axios=ORe,window.cn=Q,Object.assign(window.UIComponents,{Avatar:gne,AvatarImage:kne,AvatarFallback:vne,Badge:xne,Breadcrumb:w7e,BreadcrumbList:_7e,BreadcrumbItem:S7e,BreadcrumbLink:C7e,BreadcrumbPage:L7e,BreadcrumbSeparator:N7e,BreadcrumbEllipsis:I7e,Button:sn,Calendar:m_e,Card:g_e,CardHeader:k_e,CardFooter:w_e,CardTitle:v_e,CardAction:x_e,CardDescription:b_e,CardContent:M_e,Checkbox:OA,Collapsible:nSe,CollapsibleTrigger:aSe,CollapsibleContent:oSe,Command:Rq,CommandDialog:ECe,CommandInput:YG,CommandList:XG,CommandEmpty:KG,CommandGroup:QG,CommandItem:eZ,CommandShortcut:PCe,CommandSeparator:JG,ContextMenu:tIe,ContextMenuTrigger:nIe,ContextMenuContent:lIe,ContextMenuItem:dIe,ContextMenuCheckboxItem:uIe,ContextMenuRadioItem:hIe,ContextMenuLabel:pIe,ContextMenuSeparator:fIe,ContextMenuShortcut:yIe,ContextMenuGroup:aIe,ContextMenuPortal:oIe,ContextMenuSub:rIe,ContextMenuSubContent:sIe,ContextMenuSubTrigger:cIe,ContextMenuRadioGroup:iIe,Dialog:yj,DialogClose:hD,DialogContent:mj,DialogDescription:WG,DialogFooter:ZG,DialogHeader:gj,DialogOverlay:GG,DialogPortal:UG,DialogTitle:kj,DialogTrigger:FG,DialogStack:Ej,DialogStackTrigger:mIe,DialogStackOverlay:sz,DialogStackBody:lz,DialogStackContent:dz,DialogStackTitle:gIe,DialogStackDescription:kIe,DialogStackHeader:vIe,DialogStackFooter:bIe,DialogStackNext:xIe,DialogStackPrevious:MIe,DropdownMenu:HIe,DropdownMenuPortal:VIe,DropdownMenuTrigger:BIe,DropdownMenuContent:FIe,DropdownMenuGroup:UIe,DropdownMenuLabel:XIe,DropdownMenuItem:GIe,DropdownMenuCheckboxItem:ZIe,DropdownMenuRadioGroup:WIe,DropdownMenuRadioItem:YIe,DropdownMenuSeparator:KIe,DropdownMenuShortcut:QIe,DropdownMenuSub:JIe,DropdownMenuSubTrigger:eAe,DropdownMenuSubContent:tAe,Input:hz,Label:UA,Menubar:LAe,MenubarPortal:aW,MenubarMenu:NAe,MenubarTrigger:jAe,MenubarContent:EAe,MenubarGroup:IAe,MenubarSeparator:zAe,MenubarLabel:qAe,MenubarItem:PAe,MenubarShortcut:TAe,MenubarCheckboxItem:RAe,MenubarRadioGroup:AAe,MenubarRadioItem:DAe,MenubarSub:$Ae,MenubarSubTrigger:OAe,MenubarSubContent:HAe,Pagination:VAe,PaginationContent:BAe,PaginationLink:fz,PaginationItem:FAe,PaginationPrevious:UAe,PaginationNext:GAe,PaginationEllipsis:ZAe,Popover:sW,PopoverTrigger:lW,PopoverContent:dW,PopoverAnchor:sje,Select:kW,SelectContent:xW,SelectGroup:tEe,SelectItem:MW,SelectLabel:nEe,SelectScrollDownButton:_W,SelectScrollUpButton:wW,SelectSeparator:aEe,SelectTrigger:bW,SelectValue:vW,Separator:Mz,Sheet:LW,SheetTrigger:cEe,SheetClose:sEe,SheetContent:NW,SheetHeader:IW,SheetFooter:uEe,SheetTitle:AW,SheetDescription:jW,Sidebar:DEe,SidebarContent:BEe,SidebarFooter:HEe,SidebarGroup:FEe,SidebarGroupAction:GEe,SidebarGroupContent:ZEe,SidebarGroupLabel:UEe,SidebarHeader:OEe,SidebarInput:$Ee,SidebarInset:TEe,SidebarMenu:WEe,SidebarMenuAction:QEe,SidebarMenuBadge:JEe,SidebarMenuButton:KEe,SidebarMenuItem:YEe,SidebarMenuSkeleton:ePe,SidebarMenuSub:tPe,SidebarMenuSubButton:aPe,SidebarMenuSubItem:nPe,SidebarProvider:REe,SidebarRail:zEe,SidebarSeparator:VEe,SidebarTrigger:qEe,useSidebar:L2,Skeleton:GA,Slider:oY,Toaster:tRe,Switch:hRe,Tabs:wRe,TabsList:_Re,TabsTrigger:SRe,TabsContent:CRe,Table:uY,TableHeader:hY,TableBody:pY,TableFooter:LRe,TableHead:J1,TableRow:ju,TableCell:fr,TableCaption:NRe,Textarea:fY,Tooltip:Sz,TooltipTrigger:Cz,TooltipContent:Lz,TooltipProvider:Tj,VanillaJSONEditor:qB}),Object.assign(window.JSComponents,{VanillaJSONEditor:qB,HandsonTable:ERe,MonacoEditor:PRe,MultiSelect:$z,DeleteModal:vY,AddForm:wY,adminApi:Ha})}const{createInertiaApp:hDe,router:_Y}=JF;window.React=me;window.ReactDOM=PA;window.InertiajsReact=JF;window.LucideReact=M7e;uDe();let Hz=!1;_Y.on("navigate",e=>{Hz=!0});_Y.on("finish",e=>{Hz=!1});const FB=document.createElement.bind(document);document.createElement=function(e,t){const a=FB(e,t);return e.toLowerCase()==="iframe"&&Hz?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),FB("div")):a};hDe({title:e=>`${e}`,resolve:async e=>(await Object.assign({"./pages/add-group.tsx":()=>cn(()=>import("./add-group-Dqy51mK7.js"),__vite__mapDeps([5,6,7]),import.meta.url),"./pages/add-user.tsx":()=>cn(()=>import("./add-user-lHPqrZLh.js"),__vite__mapDeps([8,6,7]),import.meta.url),"./pages/add.tsx":()=>cn(()=>import("./add-UCuYfqnA.js"),__vite__mapDeps([9,6,7]),import.meta.url),"./pages/catalog.tsx":()=>cn(()=>import("./catalog-DfYJNiry.js"),__vite__mapDeps([10,6,7,1,2,3,11]),import.meta.url),"./pages/dashboard.tsx":()=>cn(()=>import("./dashboard-Drm_gp-G.js"),__vite__mapDeps([12,6,7,13]),import.meta.url),"./pages/docs.tsx":()=>cn(()=>import("./docs-B6LIpITJ.js"),__vite__mapDeps([14,6,7]),import.meta.url),"./pages/history.tsx":()=>cn(()=>import("./history-CbgCLusU.js"),__vite__mapDeps([15,16,6,7]),import.meta.url),"./pages/init-user.tsx":()=>cn(()=>import("./init-user-DmWRf1Jr.js"),__vite__mapDeps([17,7]),import.meta.url),"./pages/list.tsx":()=>cn(()=>import("./list-CMYKENzO.js"),__vite__mapDeps([18,6,7,16]),import.meta.url),"./pages/login.tsx":()=>cn(()=>import("./login-inT0h68O.js"),__vite__mapDeps([19,7]),import.meta.url),"./pages/module.tsx":()=>cn(()=>import("./module-Cd8HVyqp.js"),__vite__mapDeps([20,6,7]),import.meta.url),"./pages/notification.tsx":()=>cn(()=>import("./notification-NHcn4uVC.js"),__vite__mapDeps([21,6,7,1,2,3]),import.meta.url),"./pages/register.tsx":()=>cn(()=>import("./register-BrZOgrIT.js"),__vite__mapDeps([22,7]),import.meta.url),"./pages/user-filters-list.tsx":()=>cn(()=>import("./user-filters-list-LqHail28.js"),__vite__mapDeps([23,6,7]),import.meta.url),"./pages/welcome.tsx":()=>cn(()=>import("./welcome-XTbUvCzA.js"),__vite__mapDeps([24,6,7]),import.meta.url)})[`./pages/${e}.tsx`]()).default,setup({el:e,App:t,props:a}){ZR.createRoot(e).render(g.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{WA as $,wY as A,qy as B,rd as C,xne as D,hx as E,D5 as F,q6 as G,ZA as H,hz as I,OA as J,Tj as K,UA as L,id as M,Sz as N,Cz as O,Ou as P,Lz as Q,sW as R,Vu as S,tRe as T,uI as U,lW as V,dW as W,vr as X,ob as Y,yk as Z,a_ as _,I2 as a,KG as a$,Zu as a0,ud as a1,ch as a2,zD as a3,qD as a4,DD as a5,RD as a6,LD as a7,YA as a8,AD as a9,UB as aA,HIe as aB,BIe as aC,hc as aD,FIe as aE,XIe as aF,KIe as aG,ZIe as aH,VAe as aI,BAe as aJ,FAe as aK,fz as aL,UAe as aM,GAe as aN,wDe as aO,Xp as aP,Pp as aQ,Fp as aR,Nc as aS,o9 as aT,mS as aU,vY as aV,Gl as aW,m_e as aX,Rq as aY,YG as aZ,XG as a_,SD as aa,Eu as ab,XA as ac,ID as ad,OD as ae,$D as af,TD as ag,VD as ah,HD as ai,ND as aj,KA as ak,PD as al,ED as am,jD as an,CD as ao,Za as ap,pR as aq,Mu as ar,wu as as,nwe as at,fDe as au,$u as av,wRe as aw,_Re as ax,SRe as ay,CRe as az,Oe as b,xA as b$,QG as b0,eZ as b1,Ej as b2,sz as b3,lz as b4,dz as b5,vIe as b6,gIe as b7,kIe as b8,cd as b9,hD as bA,zp as bB,qu as bC,FG as bD,jc as bE,qDe as bF,XRe as bG,pr as bH,Um as bI,yr as bJ,cDe as bK,RU as bL,cn as bM,dI as bN,Vv as bO,tq as bP,HF as bQ,yDe as bR,g_e as bS,k_e as bT,v_e as bU,w_e as bV,GA as bW,mIe as bX,KK as bY,Uu as bZ,TR as b_,z_ as ba,Bu as bb,zu as bc,kr as bd,bIe as be,fY as bf,hRe as bg,nl as bh,e_ as bi,gv as bj,UIe as bk,GIe as bl,pi as bm,Nw as bn,me as bo,No as bp,gl as bq,tIe as br,nIe as bs,lIe as bt,dIe as bu,yj as bv,mj as bw,gj as bx,kj as by,ZG as bz,Q as c,TEe as c$,fU as c0,zDe as c1,REe as c2,L2 as c3,FEe as c4,UEe as c5,ZEe as c6,WEe as c7,YEe as c8,KEe as c9,HAe as cA,PAe as cB,K_e as cC,eSe as cD,w7e as cE,_7e as cF,S7e as cG,L7e as cH,C7e as cI,N7e as cJ,gne as cK,kne as cL,vne as cM,fx as cN,JC as cO,e7 as cP,tL as cQ,ty as cR,ECe as cS,LW as cT,NW as cU,IW as cV,AW as cW,jW as cX,qEe as cY,S8 as cZ,Gee as c_,JIe as ca,eAe as cb,tAe as cc,nSe as cd,aSe as ce,oSe as cf,tPe as cg,nPe as ch,aPe as ci,JEe as cj,xM as ck,Oi as cl,mw as cm,hEe as cn,Rg as co,Ua as cp,DEe as cq,OEe as cr,BEe as cs,HEe as ct,LAe as cu,NAe as cv,jAe as cw,EAe as cx,$Ae as cy,OAe as cz,sn as d,Sf as d0,CIe as d1,fs as e,Ga as f,nq as g,VB as h,kW as i,g as j,bW as k,vW as l,xW as m,MW as n,wa as o,RA as p,Ha as q,m as r,uY as s,rY as t,vd as u,hY as v,ju as w,J1 as x,pY as y,fr as z};
|
|
138
|
+
`)},tCe=0,Z1=[];function nCe(e){var t=m.useRef([]),a=m.useRef([0,0]),r=m.useRef(),c=m.useState(tCe++)[0],s=m.useState(_G)[0],u=m.useRef(e);m.useEffect(function(){u.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var C=wSe([e.lockRef.current],(e.shards||[]).map(oB),!0).filter(Boolean);return C.forEach(function(S){return S.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var h=m.useCallback(function(C,S){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var L=Q0(C),A=a.current,N="deltaX"in C?C.deltaX:A[0]-L[0],j="deltaY"in C?C.deltaY:A[1]-L[1],T,R=C.target,q=Math.abs(N)>Math.abs(j)?"h":"v";if("touches"in C&&q==="h"&&R.type==="range")return!1;var $=window.getSelection(),ee=$&&$.anchorNode,re=ee?ee===R||ee.contains(R):!1;if(re)return!1;var F=nB(q,R);if(!F)return!0;if(F?T=q:(T=q==="v"?"h":"v",F=nB(q,R)),!F)return!1;if(!r.current&&"changedTouches"in C&&(N||j)&&(r.current=T),!T)return!0;var G=r.current||T;return QSe(G,S,C,G==="h"?N:j)},[]),y=m.useCallback(function(C){var S=C;if(!(!Z1.length||Z1[Z1.length-1]!==s)){var L="deltaY"in S?aB(S):Q0(S),A=t.current.filter(function(T){return T.name===S.type&&(T.target===S.target||S.target===T.shadowParent)&&JSe(T.delta,L)})[0];if(A&&A.should){S.cancelable&&S.preventDefault();return}if(!A){var N=(u.current.shards||[]).map(oB).filter(Boolean).filter(function(T){return T.contains(S.target)}),j=N.length>0?h(S,N[0]):!u.current.noIsolation;j&&S.cancelable&&S.preventDefault()}}},[]),p=m.useCallback(function(C,S,L,A){var N={name:C,delta:S,target:L,should:A,shadowParent:aCe(L)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(j){return j!==N})},1)},[]),b=m.useCallback(function(C){a.current=Q0(C),r.current=void 0},[]),k=m.useCallback(function(C){p(C.type,aB(C),C.target,h(C,e.lockRef.current))},[]),x=m.useCallback(function(C){p(C.type,Q0(C),C.target,h(C,e.lockRef.current))},[]);m.useEffect(function(){return Z1.push(s),e.setCallbacks({onScrollCapture:k,onWheelCapture:k,onTouchMoveCapture:x}),document.addEventListener("wheel",y,G1),document.addEventListener("touchmove",y,G1),document.addEventListener("touchstart",b,G1),function(){Z1=Z1.filter(function(C){return C!==s}),document.removeEventListener("wheel",y,G1),document.removeEventListener("touchmove",y,G1),document.removeEventListener("touchstart",b,G1)}},[]);var M=e.removeScrollBar,_=e.inert;return m.createElement(m.Fragment,null,_?m.createElement(s,{styles:eCe(c)}):null,M?m.createElement(USe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aCe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oCe=ESe(wG,nCe);var k2=m.forwardRef(function(e,t){return m.createElement(dj,Oa({},e,{ref:t,sideCar:oCe}))});k2.classNames=dj.classNames;var rCe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},W1=new WeakMap,J0=new WeakMap,eh={},LR=0,NG=function(e){return e&&(e.host||NG(e.parentNode))},iCe=function(e,t){return t.map(function(a){if(e.contains(a))return a;var r=NG(a);return r&&e.contains(r)?r:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},cCe=function(e,t,a,r){var c=iCe(t,Array.isArray(e)?e:[e]);eh[a]||(eh[a]=new WeakMap);var s=eh[a],u=[],h=new Set,y=new Set(c),p=function(k){!k||h.has(k)||(h.add(k),p(k.parentNode))};c.forEach(p);var b=function(k){!k||y.has(k)||Array.prototype.forEach.call(k.children,function(x){if(h.has(x))b(x);else try{var M=x.getAttribute(r),_=M!==null&&M!=="false",C=(W1.get(x)||0)+1,S=(s.get(x)||0)+1;W1.set(x,C),s.set(x,S),u.push(x),C===1&&_&&J0.set(x,!0),S===1&&x.setAttribute(a,"true"),_||x.setAttribute(r,"true")}catch(L){console.error("aria-hidden: cannot operate on ",x,L)}})};return b(t),h.clear(),LR++,function(){u.forEach(function(k){var x=W1.get(k)-1,M=s.get(k)-1;W1.set(k,x),s.set(k,M),x||(J0.has(k)||k.removeAttribute(r),J0.delete(k)),M||k.removeAttribute(a)}),LR--,LR||(W1=new WeakMap,W1=new WeakMap,J0=new WeakMap,eh={})}},uj=function(e,t,a){a===void 0&&(a="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),c=rCe(e);return c?(r.push.apply(r,Array.from(c.querySelectorAll("[aria-live], script"))),cCe(r,c,a,"aria-hidden")):function(){return null}},sCe=Object.defineProperty,Vn=(e,t)=>sCe(e,"name",{value:t,configurable:!0}),Nq="Dialog",[IG,CDe]=Vt(Nq),[lCe,Ia]=IG(Nq),Iq=Vn(e=>{const{__scopeDialog:t,children:a,open:r,defaultOpen:c,onOpenChange:s,modal:u=!0}=e,h=m.useRef(null),y=m.useRef(null),{nodes:p,registry:b}=sj(),[k,x]=Wt({prop:r,defaultProp:c??!1,onChange:s,caller:Nq}),[M,_]=m.useState(0),[C,S]=m.useState(0);return g.jsx(lCe,{scope:t,triggerRef:h,contentRef:y,contentId:pt(),titleId:pt(),descriptionId:pt(),titlePresent:M>0,descriptionPresent:C>0,setTitleCount:_,setDescriptionCount:S,open:k,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(L=>!L),[x]),modal:u,branchNodes:p,branchRegistry:b,children:a})},"Dialog"),dCe="DialogTrigger",AG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia(dCe,r),u=Pe(a,s.triggerRef);return g.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":pj(s.open),...c,ref:u,onClick:ye(t.onClick,s.onOpenToggle)})},"DialogTrigger")),jG="DialogPortal",[uCe,EG]=IG(jG,{forceMount:void 0}),Aq=Vn(e=>{const{__scopeDialog:t,forceMount:a,children:r,container:c}=e,s=Ia(jG,t);return g.jsx(uCe,{scope:t,forceMount:a,children:m.Children.map(r,u=>g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),dD="DialogOverlay",jq=m.forwardRef(Vn(function(t,a){const r=EG(dD,t.__scopeDialog),{forceMount:c=r.forceMount,...s}=t,u=Ia(dD,t.__scopeDialog);return u.modal?g.jsx(bn,{present:c||u.open,children:g.jsx(pCe,{...s,ref:a})}):null},"DialogOverlay")),hCe=Ca("DialogOverlay.RemoveScroll"),pCe=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia(dD,r),u=uG(),h=Pe(a,u);return g.jsx(k2,{as:hCe,allowPinchZoom:!0,shards:m.useMemo(()=>[s.contentRef,...s.branchNodes.map(y=>({current:y}))],[s.contentRef,s.branchNodes]),children:g.jsx(we.div,{"data-state":pj(s.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),t2="DialogContent",Eq=m.forwardRef(Vn(function(t,a){const r=EG(t2,t.__scopeDialog),{forceMount:c=r.forceMount,...s}=t,u=Ia(t2,t.__scopeDialog);return g.jsx(bn,{present:c||u.open,children:u.modal?g.jsx(fCe,{...s,ref:a}):g.jsx(yCe,{...s,ref:a})})},"DialogContent")),fCe=m.forwardRef(Vn(function(t,a){const r=Ia(t2,t.__scopeDialog),c=m.useRef(null),s=Pe(a,r.contentRef,c);return m.useEffect(()=>{const u=c.current;if(u)return uj(u)},[]),g.jsx(PG,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ye(t.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,u=>{const h=u.detail.originalEvent,y=h.button===0&&h.ctrlKey===!0;(h.button===2||y)&&u.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),yCe=m.forwardRef(Vn(function(t,a){const r=Ia(t2,t.__scopeDialog),c=m.useRef(!1),s=m.useRef(!1);return g.jsx(PG,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||r.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,s.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})},"DialogContentNonModal")),PG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:u,"aria-describedby":h,children:y,...p}=t,b=Ia(t2,r);return xd(),g.jsx(cj,{registry:b.branchRegistry,children:g.jsx(ij,{asChild:!0,loop:!0,trapped:c,branches:b.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:u,children:g.jsx(g2,{role:"dialog",id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?qG(h,b.descriptionId):h,"data-state":pj(b.open),...p,ref:a,deferPointerDownOutside:!0,onDismiss:()=>b.onOpenChange(!1),children:y})})})},"DialogContentImpl")),RG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia("DialogTitle",r),{setTitleCount:u}=s;return ht(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),g.jsx(we.h2,{id:s.titleId,...c,ref:a})},"DialogTitle")),DG=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia("DialogDescription",r),{setDescriptionCount:u}=s;return ht(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),g.jsx(we.p,{id:s.descriptionId,...c,ref:a})},"DialogDescription")),mCe="DialogClose",hj=m.forwardRef(Vn(function(t,a){const{__scopeDialog:r,...c}=t,s=Ia(mCe,r);return g.jsx(we.button,{type:"button",...c,ref:a,onClick:ye(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function qG(...e){const t=new Set;for(const a of e)if(typeof a=="string")for(const r of String(a).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Vn(qG,"concatAriaDescribedby");function pj(e){return e?"open":"closed"}Vn(pj,"getState");var _u='[cmdk-group=""]',NR='[cmdk-group-items=""]',gCe='[cmdk-group-heading=""]',zG='[cmdk-item=""]',rB=`${zG}:not([aria-disabled="true"])`,uD="cmdk-item-select",K1="data-value",kCe=(e,t,a)=>pSe(e,t,a),TG=m.createContext(void 0),v2=()=>m.useContext(TG),$G=m.createContext(void 0),Pq=()=>m.useContext($G),OG=m.createContext(void 0),HG=m.forwardRef((e,t)=>{let a=Q1(()=>{var z,J;return{search:"",value:(J=(z=e.value)!=null?z:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Q1(()=>new Set),c=Q1(()=>new Map),s=Q1(()=>new Map),u=Q1(()=>new Set),h=VG(e),{label:y,children:p,value:b,onValueChange:k,filter:x,shouldFilter:M,loop:_,disablePointerSelection:C=!1,vimBindings:S=!0,...L}=e,A=pt(),N=pt(),j=pt(),T=m.useRef(null),R=ICe();Ol(()=>{if(b!==void 0){let z=b.trim();a.current.value=z,q.emit()}},[b]),Ol(()=>{R(6,X)},[]);let q=m.useMemo(()=>({subscribe:z=>(u.current.add(z),()=>u.current.delete(z)),snapshot:()=>a.current,setState:(z,J,K)=>{var W,U,de,ke;if(!Object.is(a.current[z],J)){if(a.current[z]=J,z==="search")G(),re(),R(1,F);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(j);ie?ie.focus():(W=document.getElementById(A))==null||W.focus()}if(R(7,()=>{var ie;a.current.selectedItemId=(ie=ae())==null?void 0:ie.id,q.emit()}),K||R(5,X),((U=h.current)==null?void 0:U.value)!==void 0){let ie=J??"";(ke=(de=h.current).onValueChange)==null||ke.call(de,ie);return}}q.emit()}},emit:()=>{u.current.forEach(z=>z())}}),[]),$=m.useMemo(()=>({value:(z,J,K)=>{var W;J!==((W=s.current.get(z))==null?void 0:W.value)&&(s.current.set(z,{value:J,keywords:K}),a.current.filtered.items.set(z,ee(J,K)),R(2,()=>{re(),q.emit()}))},item:(z,J)=>(r.current.add(z),J&&(c.current.has(J)?c.current.get(J).add(z):c.current.set(J,new Set([z]))),R(3,()=>{G(),re(),a.current.value||F(),q.emit()}),()=>{s.current.delete(z),r.current.delete(z),a.current.filtered.items.delete(z);let K=ae();R(4,()=>{G(),K?.getAttribute("id")===z&&F(),q.emit()})}),group:z=>(c.current.has(z)||c.current.set(z,new Set),()=>{s.current.delete(z),c.current.delete(z)}),filter:()=>h.current.shouldFilter,label:y||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:A,inputId:j,labelId:N,listInnerRef:T}),[]);function ee(z,J){var K,W;let U=(W=(K=h.current)==null?void 0:K.filter)!=null?W:kCe;return z?U(z,a.current.search,J):0}function re(){if(!a.current.search||h.current.shouldFilter===!1)return;let z=a.current.filtered.items,J=[];a.current.filtered.groups.forEach(W=>{let U=c.current.get(W),de=0;U.forEach(ke=>{let ie=z.get(ke);de=Math.max(ie,de)}),J.push([W,de])});let K=T.current;he().sort((W,U)=>{var de,ke;let ie=W.getAttribute("id"),pe=U.getAttribute("id");return((de=z.get(pe))!=null?de:0)-((ke=z.get(ie))!=null?ke:0)}).forEach(W=>{let U=W.closest(NR);U?U.appendChild(W.parentElement===U?W:W.closest(`${NR} > *`)):K.appendChild(W.parentElement===K?W:W.closest(`${NR} > *`))}),J.sort((W,U)=>U[1]-W[1]).forEach(W=>{var U;let de=(U=T.current)==null?void 0:U.querySelector(`${_u}[${K1}="${encodeURIComponent(W[0])}"]`);de?.parentElement.appendChild(de)})}function F(){let z=he().find(K=>K.getAttribute("aria-disabled")!=="true"),J=z?.getAttribute(K1);q.setState("value",J||void 0)}function G(){var z,J,K,W;if(!a.current.search||h.current.shouldFilter===!1){a.current.filtered.count=r.current.size;return}a.current.filtered.groups=new Set;let U=0;for(let de of r.current){let ke=(J=(z=s.current.get(de))==null?void 0:z.value)!=null?J:"",ie=(W=(K=s.current.get(de))==null?void 0:K.keywords)!=null?W:[],pe=ee(ke,ie);a.current.filtered.items.set(de,pe),pe>0&&U++}for(let[de,ke]of c.current)for(let ie of ke)if(a.current.filtered.items.get(ie)>0){a.current.filtered.groups.add(de);break}a.current.filtered.count=U}function X(){var z,J,K;let W=ae();W&&(((z=W.parentElement)==null?void 0:z.firstChild)===W&&((K=(J=W.closest(_u))==null?void 0:J.querySelector(gCe))==null||K.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function ae(){var z;return(z=T.current)==null?void 0:z.querySelector(`${zG}[aria-selected="true"]`)}function he(){var z;return Array.from(((z=T.current)==null?void 0:z.querySelectorAll(rB))||[])}function P(z){let J=he()[z];J&&q.setState("value",J.getAttribute(K1))}function E(z){var J;let K=ae(),W=he(),U=W.findIndex(ke=>ke===K),de=W[U+z];(J=h.current)!=null&&J.loop&&(de=U+z<0?W[W.length-1]:U+z===W.length?W[0]:W[U+z]),de&&q.setState("value",de.getAttribute(K1))}function O(z){let J=ae(),K=J?.closest(_u),W;for(;K&&!W;)K=z>0?LCe(K,_u):NCe(K,_u),W=K?.querySelector(rB);W?q.setState("value",W.getAttribute(K1)):E(z)}let Y=()=>P(he().length-1),V=z=>{z.preventDefault(),z.metaKey?Y():z.altKey?O(1):E(1)},D=z=>{z.preventDefault(),z.metaKey?P(0):z.altKey?O(-1):E(-1)};return m.createElement(we.div,{ref:t,tabIndex:-1,...L,"cmdk-root":"",onKeyDown:z=>{var J;(J=L.onKeyDown)==null||J.call(L,z);let K=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||K))switch(z.key){case"n":case"j":{S&&z.ctrlKey&&V(z);break}case"ArrowDown":{V(z);break}case"p":case"k":{S&&z.ctrlKey&&D(z);break}case"ArrowUp":{D(z);break}case"Home":{z.preventDefault(),P(0);break}case"End":{z.preventDefault(),Y();break}case"Enter":{z.preventDefault();let W=ae();if(W){let U=new Event(uD);W.dispatchEvent(U)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:jCe},y),fj(e,z=>m.createElement($G.Provider,{value:q},m.createElement(TG.Provider,{value:$},z))))}),vCe=m.forwardRef((e,t)=>{var a,r;let c=pt(),s=m.useRef(null),u=m.useContext(OG),h=v2(),y=VG(e),p=(r=(a=y.current)==null?void 0:a.forceMount)!=null?r:u?.forceMount;Ol(()=>{if(!p)return h.item(c,u?.id)},[p]);let b=BG(c,s,[e.value,e.children,s],e.keywords),k=Pq(),x=Mr(R=>R.value&&R.value===b.current),M=Mr(R=>p||h.filter()===!1?!0:R.search?R.filtered.items.get(c)>0:!0);m.useEffect(()=>{let R=s.current;if(!(!R||e.disabled))return R.addEventListener(uD,_),()=>R.removeEventListener(uD,_)},[M,e.onSelect,e.disabled]);function _(){var R,q;C(),(q=(R=y.current).onSelect)==null||q.call(R,b.current)}function C(){k.setState("value",b.current,!0)}if(!M)return null;let{disabled:S,value:L,onSelect:A,forceMount:N,keywords:j,...T}=e;return m.createElement(we.div,{ref:Tl(s,t),...T,id:c,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!x,"data-disabled":!!S,"data-selected":!!x,onPointerMove:S||h.getDisablePointerSelection()?void 0:C,onClick:S?void 0:_},e.children)}),bCe=m.forwardRef((e,t)=>{let{heading:a,children:r,forceMount:c,...s}=e,u=pt(),h=m.useRef(null),y=m.useRef(null),p=pt(),b=v2(),k=Mr(M=>c||b.filter()===!1?!0:M.search?M.filtered.groups.has(u):!0);Ol(()=>b.group(u),[]),BG(u,h,[e.value,e.heading,y]);let x=m.useMemo(()=>({id:u,forceMount:c}),[c]);return m.createElement(we.div,{ref:Tl(h,t),...s,"cmdk-group":"",role:"presentation",hidden:k?void 0:!0},a&&m.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:p},a),fj(e,M=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?p:void 0},m.createElement(OG.Provider,{value:x},M))))}),xCe=m.forwardRef((e,t)=>{let{alwaysRender:a,...r}=e,c=m.useRef(null),s=Mr(u=>!u.search);return!a&&!s?null:m.createElement(we.div,{ref:Tl(c,t),...r,"cmdk-separator":"",role:"separator"})}),MCe=m.forwardRef((e,t)=>{let{onValueChange:a,...r}=e,c=e.value!=null,s=Pq(),u=Mr(p=>p.search),h=Mr(p=>p.selectedItemId),y=v2();return m.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),m.createElement(we.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":h,id:y.inputId,type:"text",value:c?e.value:u,onChange:p=>{c||s.setState("search",p.target.value),a?.(p.target.value)}})}),wCe=m.forwardRef((e,t)=>{let{children:a,label:r="Suggestions",...c}=e,s=m.useRef(null),u=m.useRef(null),h=Mr(p=>p.selectedItemId),y=v2();return m.useEffect(()=>{if(u.current&&s.current){let p=u.current,b=s.current,k,x=new ResizeObserver(()=>{k=requestAnimationFrame(()=>{let M=p.offsetHeight;b.style.setProperty("--cmdk-list-height",M.toFixed(1)+"px")})});return x.observe(p),()=>{cancelAnimationFrame(k),x.unobserve(p)}}},[]),m.createElement(we.div,{ref:Tl(s,t),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":r,id:y.listId},fj(e,p=>m.createElement("div",{ref:Tl(u,y.listInnerRef),"cmdk-list-sizer":""},p)))}),_Ce=m.forwardRef((e,t)=>{let{open:a,onOpenChange:r,overlayClassName:c,contentClassName:s,container:u,...h}=e;return m.createElement(Iq,{open:a,onOpenChange:r},m.createElement(Aq,{container:u},m.createElement(jq,{"cmdk-overlay":"",className:c}),m.createElement(Eq,{"aria-label":e.label,"cmdk-dialog":"",className:s},m.createElement(HG,{ref:t,...h}))))}),SCe=m.forwardRef((e,t)=>Mr(a=>a.filtered.count===0)?m.createElement(we.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CCe=m.forwardRef((e,t)=>{let{progress:a,children:r,label:c="Loading...",...s}=e;return m.createElement(we.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},fj(e,u=>m.createElement("div",{"aria-hidden":!0},u)))}),Wl=Object.assign(HG,{List:wCe,Item:vCe,Input:MCe,Group:bCe,Separator:xCe,Dialog:_Ce,Empty:SCe,Loading:CCe});function LCe(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function NCe(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function VG(e){let t=m.useRef(e);return Ol(()=>{t.current=e}),t}var Ol=typeof window>"u"?m.useEffect:m.useLayoutEffect;function Q1(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Mr(e){let t=Pq(),a=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,a,a)}function BG(e,t,a,r=[]){let c=m.useRef(),s=v2();return Ol(()=>{var u;let h=(()=>{var p;for(let b of a){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(p=b.current.textContent)==null?void 0:p.trim():c.current}})(),y=r.map(p=>p.trim());s.value(e,h,y),(u=t.current)==null||u.setAttribute(K1,h),c.current=h}),c}var ICe=()=>{let[e,t]=m.useState(),a=Q1(()=>new Map);return Ol(()=>{a.current.forEach(r=>r()),a.current=new Map},[e]),(r,c)=>{a.current.set(r,c),t({})}};function ACe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function fj({asChild:e,children:t},a){return e&&m.isValidElement(t)?m.cloneElement(ACe(t),{ref:t.ref},a(t.props.children)):a(t)}var jCe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function yj({...e}){return g.jsx(Iq,{"data-slot":"dialog",...e})}function FG({...e}){return g.jsx(AG,{"data-slot":"dialog-trigger",...e})}function UG({...e}){return g.jsx(Aq,{"data-slot":"dialog-portal",...e})}function hD({...e}){return g.jsx(hj,{"data-slot":"dialog-close",...e})}function GG({className:e,...t}){return g.jsx(jq,{"data-slot":"dialog-overlay",className:Q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1010] bg-black/50",e),...t})}function mj({className:e,children:t,...a}){return g.jsxs(UG,{"data-slot":"dialog-portal",children:[g.jsx(GG,{}),g.jsxs(Eq,{"data-slot":"dialog-content",className:Q("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...a,children:[t,g.jsxs(hj,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(vr,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gj({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Q("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ZG({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:Q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function kj({className:e,...t}){return g.jsx(RG,{"data-slot":"dialog-title",className:Q("text-lg leading-none font-semibold",e),...t})}function WG({className:e,...t}){return g.jsx(DG,{"data-slot":"dialog-description",className:Q("text-muted-foreground text-sm",e),...t})}function Rq({className:e,...t}){return g.jsx(Wl,{"data-slot":"command",className:Q("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function ECe({title:e="Command Palette",description:t="Search for a command to run...",shouldFilter:a,children:r,...c}){return g.jsxs(yj,{...c,children:[g.jsxs(gj,{className:"sr-only",children:[g.jsx(kj,{children:e}),g.jsx(WG,{children:t})]}),g.jsx(mj,{className:"overflow-hidden p-0 z-[1011]",children:g.jsx(Rq,{shouldFilter:a,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function YG({className:e,...t}){return g.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g.jsx(Vu,{className:"size-4 shrink-0 opacity-50"}),g.jsx(Wl.Input,{"data-slot":"command-input",className:Q("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function XG({className:e,...t}){return g.jsx(Wl.List,{"data-slot":"command-list",className:Q("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function KG({...e}){return g.jsx(Wl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function QG({className:e,...t}){return g.jsx(Wl.Group,{"data-slot":"command-group",className:Q("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function JG({className:e,...t}){return g.jsx(Wl.Separator,{"data-slot":"command-separator",className:Q("bg-border -mx-1 h-px",e),...t})}function eZ({className:e,...t}){return g.jsx(Wl.Item,{"data-slot":"command-item",className:Q("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function PCe({className:e,...t}){return g.jsx("span",{"data-slot":"command-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var RCe=Object.defineProperty,Ht=(e,t)=>RCe(e,"name",{value:t,configurable:!0});function Md(e){const t=e+"CollectionProvider",[a,r]=Vt(t),[c,s]=a(t,{collectionRef:{current:null},itemMap:new Map}),u=Ht(C=>{const{scope:S,children:L}=C,A=m.useRef(null),N=m.useRef(new Map).current;return g.jsx(c,{scope:S,itemMap:N,collectionRef:A,children:L})},"CollectionProvider");u.displayName=t;const h=e+"CollectionSlot",y=Ca(h),p=m.forwardRef((C,S)=>{const{scope:L,children:A}=C,N=s(h,L),j=Pe(S,N.collectionRef);return g.jsx(y,{ref:j,children:A})});p.displayName=h;const b=e+"CollectionItemSlot",k="data-radix-collection-item",x=Ca(b),M=m.forwardRef((C,S)=>{const{scope:L,children:A,...N}=C,j=m.useRef(null),T=Pe(S,j),R=s(b,L);return m.useEffect(()=>(R.itemMap.set(j,{ref:j,...N}),()=>{R.itemMap.delete(j)})),g.jsx(x,{[k]:"",ref:T,children:A})});M.displayName=b;function _(C){const S=s(e+"CollectionConsumer",C);return m.useCallback(()=>{const A=S.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${k}]`));return Array.from(S.itemMap.values()).sort((R,q)=>N.indexOf(R.ref.current)-N.indexOf(q.ref.current))},[S.collectionRef,S.itemMap])}return Ht(_,"useCollection"),[{Provider:u,Slot:p,ItemSlot:M},_,r]}Ht(Md,"createCollection");var iB=new WeakMap,St,Qn,th=(Qn=class extends Map{constructor(a){super(a);DH(this,St);XP(this,St,[...super.keys()]),iB.set(this,!0)}set(a,r){return iB.get(this)&&!this.has(a)&&tn(this,St).push(a),super.set(a,r),this}insert(a,r,c){const s=this.has(r),u=s?this.size:this.size+1,h=Dq(a),y=h>=0?Math.min(h,u-1):Math.max(u+h,0);if(s?tn(this,St).indexOf(r)===y:y===this.size)return this.set(r,c),this;const p=tn(this,St).filter(k=>k!==r);p.splice(y,0,r);const b=p.map(k=>[k,k===r?c:this.get(k)]);this.clear();for(const[k,x]of b)this.set(k,x);return this}with(a,r,c){const s=new Qn(this);return s.insert(a,r,c),s}before(a){const r=tn(this,St).indexOf(a)-1;if(!(r<0))return this.entryAt(r)}setBefore(a,r,c){const s=tn(this,St).indexOf(a);if(s===-1)return this;const u=tn(this,St).indexOf(r),h=u!==-1&&u<s?s-1:s;return this.insert(h,r,c)}after(a){let r=tn(this,St).indexOf(a);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(a,r,c){const s=tn(this,St).indexOf(a);if(s===-1)return this;const u=tn(this,St).indexOf(r),h=u!==-1&&u<=s?s:s+1;return this.insert(h,r,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return XP(this,St,[]),super.clear()}delete(a){const r=super.delete(a);return r&&tn(this,St).splice(tn(this,St).indexOf(a),1),r}deleteAt(a){const r=this.keyAt(a);return r!==void 0?this.delete(r):!1}at(a){const r=gA(tn(this,St),a);if(r!==void 0)return this.get(r)}entryAt(a){const r=gA(tn(this,St),a);if(r!==void 0)return[r,this.get(r)]}indexOf(a){return tn(this,St).indexOf(a)}keyAt(a){return gA(tn(this,St),a)}from(a,r){const c=this.indexOf(a);if(c===-1)return;let s=c+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(a,r){const c=this.indexOf(a);if(c===-1)return;let s=c+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(a,r){let c=0;for(const s of this){if(Reflect.apply(a,r,[s,c,this]))return s;c++}}findIndex(a,r){let c=0;for(const s of this){if(Reflect.apply(a,r,[s,c,this]))return c;c++}return-1}filter(a,r){const c=[];let s=0;for(const u of this)Reflect.apply(a,r,[u,s,this])&&c.push(u),s++;return new Qn(c)}map(a,r){const c=[];let s=0;for(const u of this)c.push([u[0],Reflect.apply(a,r,[u,s,this])]),s++;return new Qn(c)}reduce(...a){const[r,c]=a,s=a.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=0,h=c;for(const y of this)u===0&&!s?h=y:h=Reflect.apply(r,this,[h,y,u,this]),u++;return h}reduceRight(...a){const[r,c]=a,s=a.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let u=c;for(let h=this.size-1;h>=0;h--){const y=this.entryAt(h);h===this.size-1&&!s?u=y:u=Reflect.apply(r,this,[u,y,h,this])}return u}sort(a){if(typeof a!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(a);this.clear();for(const[c,s]of r)this.set(c,s);return this}toSorted(a){if(typeof a!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(a);return new Qn(r)}toReversed(){const a=new Qn;for(let r=this.size-1;r>=0;r--){const c=this.keyAt(r),s=this.get(c);a.set(c,s)}return a}toSpliced(...a){const r=[...this.entries()];return r.splice(...a),new Qn(r)}slice(a,r){const c=new Qn;for(const s of tn(this,St).slice(a,r))c.set(s,this.get(s));return c}every(a,r){let c=0;for(const s of this){if(!Reflect.apply(a,r,[s,c,this]))return!1;c++}return!0}some(a,r){let c=0;for(const s of this){if(Reflect.apply(a,r,[s,c,this]))return!0;c++}return!1}},St=new WeakMap,Ht(Qn,"OrderedDict"),Qn);function gA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const a=tZ(e,t);return a===-1?void 0:e[a]}Ht(gA,"at");function tZ(e,t){const a=e.length,r=Dq(t),c=r>=0?r:a+r;return c<0||c>=a?-1:c}Ht(tZ,"toSafeIndex");function Dq(e){return e!==e||e===0?0:Math.trunc(e)}Ht(Dq,"toSafeInteger");function DCe(e){const t=e+"CollectionProvider",[a,r]=Vt(t),[c,s]=a(t);c.displayName=e+"CollectionStableContextProvider";const[u,h]=a(t);u.displayName=e+"CollectionStatefulContextProvider";const y=Ht(({state:R,...q})=>R?g.jsx(b,{...q,state:R}):g.jsx(p,{...q}),"CollectionProvider");y.displayName=t;const p=Ht(R=>{const q=A();return g.jsx(b,{...R,state:q})},"CollectionInit");p.displayName=e+"CollectionInit";const b=Ht(R=>{const{scope:q,children:$,state:ee}=R,re=m.useRef(null),[F,G]=m.useState(null),X=Pe(re,G),[ae,he]=ee,P=m.useRef(new th),E=m.useCallback(()=>{const O=P.current;return oZ(O)||O.sort(kA),O},[]);return m.useEffect(()=>{if(!F)return;const O=rZ(()=>{he(Y=>{const V=Y.toSorted(kA);return V.some(([z],J)=>Y.keyAt(J)!==z)?V:Y})});return O.observe(F,{childList:!0,subtree:!0}),()=>{O.disconnect()}},[F,he]),g.jsx(c,{scope:q,collectionElementRef:X,collectionElementRefObject:re,getCollection:E,setCollection:he,registryRef:P,children:g.jsx(u,{scope:q,collectionElement:F,collection:ae,children:$})})},"CollectionProviderImpl");b.displayName=e+"CollectionProviderImpl";const k=e+"CollectionSlot",x=Ca(k),M=m.forwardRef((R,q)=>{const{scope:$,children:ee}=R,re=s(k,$),F=Pe(q,re.collectionElementRef);return g.jsx(x,{ref:F,children:ee})});M.displayName=k;const _=e+"CollectionItemSlot",C="data-radix-collection-item",S=Ca(_),L=m.forwardRef((R,q)=>{const{scope:$,children:ee,...re}=R,F=m.useRef(null),G=s(_,$),{setCollection:X,registryRef:ae}=G,he=m.useRef(re);nZ(he.current,re)||(he.current=re);const P=he.current,E=m.useCallback(V=>{const D=ae.current;V?D.set(V,{...he.current,element:V}):F.current&&D.delete(F.current)},[ae]),O=Pe(q,E,F);ht(()=>{const V=F.current,D=ae.current;V&&D.has(V)&&D.set(V,{...P,element:V})},[P,ae]);const Y=m.useRef(null);return m.useEffect(()=>{const V=F.current,D=Y.current;(D?.element??null)===V&&(!V||D?.itemData===P)||(Y.current=V?{element:V,itemData:P}:null,X(z=>{const J=new th(z);return D&&D.element!==V&&J.delete(D.element),V&&J.set(V,{...P,element:V}),J.sort(kA)}))}),m.useEffect(()=>()=>{const V=Y.current;Y.current=null,V&&X(D=>{if(!D.has(V.element))return D;const z=new th(D);return z.delete(V.element),z})},[X]),g.jsx(S,{[C]:"",ref:O,children:ee})});L.displayName=_;function A(){return m.useState(new th)}Ht(A,"useInitCollection");function N(R){const{collection:q}=h(e+"CollectionConsumer",R);return q}Ht(N,"useCollection");function j(R){const{getCollection:q}=s(e+"CollectionConsumer",R);return q}return Ht(j,"useGetCollection"),[{Provider:y,Slot:M,ItemSlot:L},{createCollectionScope:r,useCollection:N,useGetCollection:j,useInitCollection:A}]}Ht(DCe,"createCollection");function nZ(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(const c of a)if(!Object.prototype.hasOwnProperty.call(t,c)||e[c]!==t[c])return!1;return!0}Ht(nZ,"shallowEqual");function aZ(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ht(aZ,"isElementPreceding");function oZ(e){let t;for(const a of e.keys()){if(t){const r=t.compareDocumentPosition(a);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=a}return!0}Ht(oZ,"isInDocumentOrder");function kA(e,t){return!e[1].element||!t[1].element?0:aZ(e[1].element,t[1].element)?-1:1}Ht(kA,"sortByDocumentPosition");function rZ(e){return new MutationObserver(a=>{for(const r of a)if(r.type==="childList"){e();return}})}Ht(rZ,"getChildListObserver");var qCe=Object.defineProperty,zCe=(e,t)=>qCe(e,"name",{value:t,configurable:!0}),TCe={LTR:"ltr"},$Ce=m.createContext(void 0);function Yl(e){const t=m.useContext($Ce);return e||t||TCe.LTR}zCe(Yl,"useDirection");const OCe=["top","right","bottom","left"],wr=Math.min,So=Math.max,HA=Math.round,nh=Math.floor,Co=e=>({x:e,y:e}),HCe={left:"right",right:"left",bottom:"top",top:"bottom"};function iZ(e,t,a){return So(e,wr(t,a))}function Eo(e,t){return typeof e=="function"?e(t):e}function _r(e){return e.split("-")[0]}function wd(e){return e.split("-")[1]}function qq(e){return e==="x"?"y":"x"}function zq(e){return e==="y"?"height":"width"}function Fa(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tq(e){return qq(Fa(e))}function VCe(e,t,a){a===void 0&&(a=!1);const r=wd(e),c=Tq(e),s=zq(c);let u=c==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(u=VA(u)),[u,VA(u)]}function BCe(e){const t=VA(e);return[pD(e),t,pD(t)]}function pD(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const cB=["left","right"],sB=["right","left"],FCe=["top","bottom"],UCe=["bottom","top"];function GCe(e,t,a){switch(e){case"top":case"bottom":return a?t?sB:cB:t?cB:sB;case"left":case"right":return t?FCe:UCe;default:return[]}}function ZCe(e,t,a,r){const c=wd(e);let s=GCe(_r(e),a==="start",r);return c&&(s=s.map(u=>u+"-"+c),t&&(s=s.concat(s.map(pD)))),s}function VA(e){const t=_r(e);return HCe[t]+e.slice(t.length)}function WCe(e){var t,a,r,c;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(r=e.bottom)!=null?r:0,left:(c=e.left)!=null?c:0}}function cZ(e){return typeof e!="number"?WCe(e):{top:e,right:e,bottom:e,left:e}}function BA(e){const{x:t,y:a,width:r,height:c}=e;return{width:r,height:c,top:a,left:t,right:t+r,bottom:a+c,x:t,y:a}}function lB(e,t,a){let{reference:r,floating:c}=e;const s=Fa(t),u=Tq(t),h=zq(u),y=_r(t),p=s==="y",b=r.x+r.width/2-c.width/2,k=r.y+r.height/2-c.height/2,x=r[h]/2-c[h]/2;let M;switch(y){case"top":M={x:b,y:r.y-c.height};break;case"bottom":M={x:b,y:r.y+r.height};break;case"right":M={x:r.x+r.width,y:k};break;case"left":M={x:r.x-c.width,y:k};break;default:M={x:r.x,y:r.y}}const _=wd(t);return _&&(M[u]+=x*(_==="end"?1:-1)*(a&&p?-1:1)),M}async function YCe(e,t){var a;t===void 0&&(t={});const{x:r,y:c,platform:s,rects:u,elements:h,strategy:y}=e,{boundary:p="clippingAncestors",rootBoundary:b="viewport",elementContext:k="floating",altBoundary:x=!1,padding:M=0}=Eo(t,e),_=cZ(M),S=h[x?k==="floating"?"reference":"floating":k],L=BA(await s.getClippingRect({element:(a=await(s.isElement==null?void 0:s.isElement(S)))==null||a?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(h.floating)),boundary:p,rootBoundary:b,strategy:y})),A=k==="floating"?{x:r,y:c,width:u.floating.width,height:u.floating.height}:u.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h.floating)),j=await(s.isElement==null?void 0:s.isElement(N))&&await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1},T=BA(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:N,strategy:y}):A);return{top:(L.top-T.top+_.top)/j.y,bottom:(T.bottom-L.bottom+_.bottom)/j.y,left:(L.left-T.left+_.left)/j.x,right:(T.right-L.right+_.right)/j.x}}const XCe=50,KCe=async(e,t,a)=>{const{placement:r="bottom",strategy:c="absolute",middleware:s=[],platform:u}=a,h=u.detectOverflow?u:{...u,detectOverflow:YCe},y=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:c}),{x:b,y:k}=lB(p,r,y),x=r,M=0;const _={};for(let C=0;C<s.length;C++){const S=s[C];if(!S)continue;const{name:L,fn:A}=S,{x:N,y:j,data:T,reset:R}=await A({x:b,y:k,initialPlacement:r,placement:x,strategy:c,middlewareData:_,rects:p,platform:h,elements:{reference:e,floating:t}});b=N??b,k=j??k,_[L]={..._[L],...T},R&&M<XCe&&(M++,typeof R=="object"&&(R.placement&&(x=R.placement),R.rects&&(p=R.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:c}):R.rects),{x:b,y:k}=lB(p,x,y)),C=-1)}return{x:b,y:k,placement:x,strategy:c,middlewareData:_}},QCe=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:r,placement:c,rects:s,platform:u,elements:h,middlewareData:y}=t,{element:p,padding:b=0}=Eo(e,t)||{};if(p==null)return{};const k=cZ(b),x={x:a,y:r},M=Tq(c),_=zq(M),C=await u.getDimensions(p),S=M==="y",L=S?"top":"left",A=S?"bottom":"right",N=S?"clientHeight":"clientWidth",j=s.reference[_]+s.reference[M]-x[M]-s.floating[_],T=x[M]-s.reference[M],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let q=R?R[N]:0;(!q||!await(u.isElement==null?void 0:u.isElement(R)))&&(q=h.floating[N]||s.floating[_]);const $=j/2-T/2,ee=q/2-C[_]/2-1,re=wr(k[L],ee),F=wr(k[A],ee),G=q-C[_]-F,X=q/2-C[_]/2+$,ae=iZ(re,X,G),he=!y.arrow&&wd(c)!=null&&X!==ae&&s.reference[_]/2-(X<re?re:F)-C[_]/2<0,P=he?X<re?X-re:X-G:0;return{[M]:x[M]+P,data:{[M]:ae,centerOffset:X-ae-P,...he&&{alignmentOffset:P}},reset:he}}}),JCe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,r;const{placement:c,middlewareData:s,rects:u,initialPlacement:h,platform:y,elements:p}=t,{mainAxis:b=!0,crossAxis:k=!0,fallbackPlacements:x,fallbackStrategy:M="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:C=!0,...S}=Eo(e,t);if((a=s.arrow)!=null&&a.alignmentOffset)return{};const L=_r(c),A=Fa(h),N=_r(h)===h,j=await(y.isRTL==null?void 0:y.isRTL(p.floating)),T=x||(N||!C?[VA(h)]:BCe(h)),R=_!=="none";!x&&R&&T.push(...ZCe(h,C,_,j));const q=[h,...T],$=await y.detectOverflow(t,S),ee=[];let re=((r=s.flip)==null?void 0:r.overflows)||[];if(b&&ee.push($[L]),k){const ae=VCe(c,u,j);ee.push($[ae[0]],$[ae[1]])}if(re=[...re,{placement:c,overflows:ee}],!ee.every(ae=>ae<=0)){var F,G;const ae=(((F=s.flip)==null?void 0:F.index)||0)+1,he=q[ae];if(he&&(!(k==="alignment"?A!==Fa(he):!1)||re.every(O=>Fa(O.placement)===A?O.overflows[0]>0:!0)))return{data:{index:ae,overflows:re},reset:{placement:he}};let P=(G=re.filter(E=>E.overflows[0]<=0).sort((E,O)=>E.overflows[1]-O.overflows[1])[0])==null?void 0:G.placement;if(!P)switch(M){case"bestFit":{var X;const E=(X=re.filter(O=>{if(R){const Y=Fa(O.placement);return Y===A||Y==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(Y=>Y>0).reduce((Y,V)=>Y+V,0)]).sort((O,Y)=>O[1]-Y[1])[0])==null?void 0:X[0];E&&(P=E);break}case"initialPlacement":P=h;break}if(c!==P)return{reset:{placement:P}}}return{}}}};function dB(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uB(e){return OCe.some(t=>e[t]>=0)}const eLe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:r}=t,{strategy:c="referenceHidden",...s}=Eo(e,t);switch(c){case"referenceHidden":{const u=await r.detectOverflow(t,{...s,elementContext:"reference"}),h=dB(u,a.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:uB(h)}}}case"escaped":{const u=await r.detectOverflow(t,{...s,altBoundary:!0}),h=dB(u,a.floating);return{data:{escapedOffsets:h,escaped:uB(h)}}}default:return{}}}}},sZ=new Set(["left","top"]);async function tLe(e,t){const{placement:a,platform:r,elements:c}=e,s=await(r.isRTL==null?void 0:r.isRTL(c.floating)),u=_r(a),h=wd(a),y=Fa(a)==="y",p=sZ.has(u)?-1:1,b=s&&y?-1:1,k=Eo(t,e);let{mainAxis:x,crossAxis:M,alignmentAxis:_}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:k.mainAxis||0,crossAxis:k.crossAxis||0,alignmentAxis:k.alignmentAxis};return h&&typeof _=="number"&&(M=h==="end"?_*-1:_),y?{x:M*b,y:x*p}:{x:x*p,y:M*b}}const nLe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,r;const{x:c,y:s,placement:u,middlewareData:h}=t,y=await tLe(t,e);return u===((a=h.offset)==null?void 0:a.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:c+y.x,y:s+y.y,data:{...y,placement:u}}}}},aLe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:r,placement:c,platform:s}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:y={fn:A=>{let{x:N,y:j}=A;return{x:N,y:j}}},...p}=Eo(e,t),b={x:a,y:r},k=await s.detectOverflow(t,p),x=Fa(c),M=qq(x);let _=b[M],C=b[x];const S=(A,N)=>iZ(N+k[A==="y"?"top":"left"],N,N-k[A==="y"?"bottom":"right"]);u&&(_=S(M,_)),h&&(C=S(x,C));const L=y.fn({...t,[M]:_,[x]:C});return{...L,data:{x:L.x-a,y:L.y-r,enabled:{[M]:u,[x]:h}}}}}},oLe=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,r;const{x:c,y:s,placement:u,rects:h,middlewareData:y}=t,{offset:p=0,mainAxis:b=!0,crossAxis:k=!0}=Eo(e,t),x={x:c,y:s},M=Fa(u),_=qq(M);let C=x[_],S=x[M];const L=Eo(p,t),A=typeof L=="number"?{mainAxis:L,crossAxis:0}:{mainAxis:(a=L.mainAxis)!=null?a:0,crossAxis:(r=L.crossAxis)!=null?r:0};if(b){const T=_==="y"?"height":"width",R=h.reference[_]-h.floating[T]+A.mainAxis,q=h.reference[_]+h.reference[T]-A.mainAxis;C<R?C=R:C>q&&(C=q)}if(k){var N,j;const T=_==="y"?"width":"height",R=sZ.has(_r(u)),q=h.reference[M]-h.floating[T]+(R&&((N=y.offset)==null?void 0:N[M])||0)+(R?0:A.crossAxis),$=h.reference[M]+h.reference[T]+(R?0:((j=y.offset)==null?void 0:j[M])||0)-(R?A.crossAxis:0);S<q?S=q:S>$&&(S=$)}return{[_]:C,[M]:S}}}},rLe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:r,platform:c,elements:s}=t,{apply:u=()=>{},...h}=Eo(e,t),y=await c.detectOverflow(t,h),p=_r(a),b=wd(a),k=Fa(a)==="y",{width:x,height:M}=r.floating;let _,C;p==="top"||p==="bottom"?(_=p,C=b===(await(c.isRTL==null?void 0:c.isRTL(s.floating))?"start":"end")?"left":"right"):(C=p,_=b==="end"?"top":"bottom");const S=M-y.top-y.bottom,L=x-y.left-y.right,A=wr(M-y[_],S),N=wr(x-y[C],L),j=t.middlewareData.shift,T=!j;let R=A,q=N;j!=null&&j.enabled.x&&(q=L),j!=null&&j.enabled.y&&(R=S),T&&!b&&(k?q=x-2*So(y.left,y.right):R=M-2*So(y.top,y.bottom)),await u({...t,availableWidth:q,availableHeight:R});const $=await c.getDimensions(s.floating);return x!==$.width||M!==$.height?{reset:{rects:!0}}:{}}}};function vj(){return typeof window<"u"}function _d(e){return lZ(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Po(e){var t;return(t=(lZ(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lZ(e){return vj()?e instanceof Node||e instanceof Hn(e).Node:!1}function Wa(e){return vj()?e instanceof Element||e instanceof Hn(e).Element:!1}function Ir(e){return vj()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function hB(e){return!vj()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}function bj(e){const{overflow:t,overflowX:a,overflowY:r,display:c}=Ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+a)&&c!=="inline"&&c!=="contents"}function iLe(e){return/^(table|td|th)$/.test(_d(e))}function xj(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const cLe=/transform|translate|scale|rotate|perspective|filter/,sLe=/paint|layout|strict|content/,ti=e=>!!e&&e!=="none";let IR;function $q(e){const t=Wa(e)?Ya(e):e;return ti(t.transform)||ti(t.translate)||ti(t.scale)||ti(t.rotate)||ti(t.perspective)||!Oq()&&(ti(t.backdropFilter)||ti(t.filter))||cLe.test(t.willChange||"")||sLe.test(t.contain||"")}function lLe(e){let t=Hl(e);for(;Ir(t)&&!n2(t);){if($q(t))return t;if(xj(t))return null;t=Hl(t)}return null}function Oq(){return IR==null&&(IR=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),IR}function n2(e){return/^(html|body|#document)$/.test(_d(e))}function Ya(e){return Hn(e).getComputedStyle(e)}function Mj(e){return Wa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hl(e){if(_d(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hB(e)&&e.host||Po(e);return hB(t)?t.host:t}function dZ(e){const t=Hl(e);return n2(t)?(e.ownerDocument||e).body:Ir(t)&&bj(t)?t:dZ(t)}function a2(e,t,a){var r;t===void 0&&(t=[]),a===void 0&&(a=!0);const c=dZ(e),s=c===((r=e.ownerDocument)==null?void 0:r.body),u=Hn(c);if(s){const h=fD(u);return t.concat(u,u.visualViewport||[],bj(c)?c:[],h&&a?a2(h):[])}else return t.concat(c,a2(c,[],a))}function fD(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uZ(e){const t=Ya(e);let a=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const c=Ir(e),s=c?e.offsetWidth:a,u=c?e.offsetHeight:r,h=HA(a)!==s||HA(r)!==u;return h&&(a=s,r=u),{width:a,height:r,$:h}}function Hq(e){return Wa(e)?e:e.contextElement}function ld(e){const t=Hq(e);if(!Ir(t))return Co(1);const a=t.getBoundingClientRect(),{width:r,height:c,$:s}=uZ(t);let u=(s?HA(a.width):a.width)/r,h=(s?HA(a.height):a.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const dLe=Co(0);function hZ(e){const t=Hn(e);return!Oq()||!t.visualViewport?dLe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uLe(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Hn(e)}function Vl(e,t,a,r){t===void 0&&(t=!1),a===void 0&&(a=!1);const c=e.getBoundingClientRect(),s=Hq(e);let u=Co(1);t&&(r?Wa(r)&&(u=ld(r)):u=ld(e));const h=uLe(s,a,r)?hZ(s):Co(0);let y=(c.left+h.x)/u.x,p=(c.top+h.y)/u.y,b=c.width/u.x,k=c.height/u.y;if(s&&r){const x=Hn(s),M=Wa(r)?Hn(r):r;let _=x,C=fD(_);for(;C&&M!==_;){const S=ld(C),L=C.getBoundingClientRect(),A=Ya(C),N=L.left+(C.clientLeft+parseFloat(A.paddingLeft))*S.x,j=L.top+(C.clientTop+parseFloat(A.paddingTop))*S.y;y*=S.x,p*=S.y,b*=S.x,k*=S.y,y+=N,p+=j,_=Hn(C),C=fD(_)}}return BA({width:b,height:k,x:y,y:p})}function wj(e,t){const a=Mj(e).scrollLeft;return t?t.left+a:Vl(Po(e)).left+a}function pZ(e,t){const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-wj(e,a),c=a.top+t.scrollTop;return{x:r,y:c}}function hLe(e){let{elements:t,rect:a,offsetParent:r,strategy:c}=e;const s=c==="fixed",u=Po(r),h=t?xj(t.floating):!1;if(r===u||h&&s)return a;let y={scrollLeft:0,scrollTop:0},p=Co(1);const b=Co(0),k=Ir(r);if((k||!s)&&((_d(r)!=="body"||bj(u))&&(y=Mj(r)),k)){const M=Vl(r);p=ld(r),b.x=M.x+r.clientLeft,b.y=M.y+r.clientTop}const x=u&&!k&&!s?pZ(u,y):Co(0);return{width:a.width*p.x,height:a.height*p.y,x:a.x*p.x-y.scrollLeft*p.x+b.x+x.x,y:a.y*p.y-y.scrollTop*p.y+b.y+x.y}}function pLe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fLe(e){const t=Mj(e),a=e.ownerDocument.body,r=So(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),c=So(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let s=-t.scrollLeft+wj(e);const u=-t.scrollTop;return Ya(a).direction==="rtl"&&(s+=So(e.clientWidth,a.clientWidth)-r),{width:r,height:c,x:s,y:u}}const yLe=25;function mLe(e,t,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",c=Hn(e),s=Po(e),u=c.visualViewport;let h=s.clientWidth,y=s.clientHeight,p=0,b=0;if(u){const x=!Oq()||t==="fixed";r?x||(p=-u.offsetLeft,b=-u.offsetTop):(h=u.width,y=u.height,x&&(p=u.offsetLeft,b=u.offsetTop))}if(wj(s)<=0){const x=s.ownerDocument,M=x.body,_=getComputedStyle(M),C=x.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(s.clientWidth-M.clientWidth-C),L=getComputedStyle(s).scrollbarGutter==="stable both-edges"?S/2:S;L<=yLe&&(h-=L)}return{width:h,height:y,x:p,y:b}}function gLe(e,t){const a=Vl(e,!0,t==="fixed"),r=a.top+e.clientTop,c=a.left+e.clientLeft,s=ld(e),u=e.clientWidth*s.x,h=e.clientHeight*s.y,y=c*s.x,p=r*s.y;return{width:u,height:h,x:y,y:p}}function pB(e,t,a){let r;if(t==="viewport"||t==="layoutViewport")r=mLe(e,a,t);else if(t==="document")r=fLe(Po(e));else if(Wa(t))r=gLe(t,a);else{const c=hZ(e);r={x:t.x-c.x,y:t.y-c.y,width:t.width,height:t.height}}return BA(r)}function kLe(e,t){const a=t.get(e);if(a)return a;let r=a2(e,[],!1).filter(h=>Wa(h)&&_d(h)!=="body"),c=null;const s=Ya(e).position==="fixed";let u=s?Hl(e):e;for(;Wa(u)&&!n2(u);){const h=Ya(u),y=$q(u),p=c?c.position:s?"fixed":"";!y&&(p==="fixed"||p==="absolute"&&h.position==="static")?r=r.filter(k=>k!==u):c=h,u=Hl(u)}return t.set(e,r),r}function vLe(e){let{element:t,boundary:a,rootBoundary:r,strategy:c}=e;const u=[...a==="clippingAncestors"?xj(t)?[]:kLe(t,this._c):[].concat(a),r],h=pB(t,u[0],c);let y=h.top,p=h.right,b=h.bottom,k=h.left;for(let x=1;x<u.length;x++){const M=pB(t,u[x],c);y=So(M.top,y),p=wr(M.right,p),b=wr(M.bottom,b),k=So(M.left,k)}return{width:p-k,height:b-y,x:k,y}}function bLe(e){const{width:t,height:a}=uZ(e);return{width:t,height:a}}function xLe(e,t,a){const r=Ir(t),c=Po(t),s=a==="fixed",u=Vl(e,!0,s,t);let h={scrollLeft:0,scrollTop:0};const y=Co(0);if((r||!s)&&((_d(t)!=="body"||bj(c))&&(h=Mj(t)),r)){const x=Vl(t,!0,s,t);y.x=x.x+t.clientLeft,y.y=x.y+t.clientTop}!r&&c&&(y.x=wj(c));const p=c&&!r&&!s?pZ(c,h):Co(0),b=u.left+h.scrollLeft-y.x-p.x,k=u.top+h.scrollTop-y.y-p.y;return{x:b,y:k,width:u.width,height:u.height}}function AR(e){return Ya(e).position==="static"}function fB(e,t){if(!Ir(e)||Ya(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Po(e)===a&&(a=a.ownerDocument.body),a}function fZ(e,t){const a=Hn(e);if(xj(e))return a;if(!Ir(e)){let c=Hl(e);for(;c&&!n2(c);){if(Wa(c)&&!AR(c))return c;c=Hl(c)}return a}let r=fB(e,t);for(;r&&iLe(r)&&AR(r);)r=fB(r,t);return r&&n2(r)&&AR(r)&&!$q(r)?a:r||lLe(e)||a}const MLe=async function(e){const t=this.getOffsetParent||fZ,a=this.getDimensions,r=await a(e.floating);return{reference:xLe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wLe(e){return Ya(e).direction==="rtl"}const _Le={convertOffsetParentRelativeRectToViewportRelativeRect:hLe,getDocumentElement:Po,getClippingRect:vLe,getOffsetParent:fZ,getElementRects:MLe,getClientRects:pLe,getDimensions:bLe,getScale:ld,isElement:Wa,isRTL:wLe};function yZ(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SLe(e,t,a){let r=null,c;const s=Po(e);function u(){var b;clearTimeout(c),(b=r)==null||b.disconnect(),r=null}function h(b,k){b===void 0&&(b=!1),k===void 0&&(k=1),u();const x=e.getBoundingClientRect(),{left:M,top:_,width:C,height:S}=x;if(b||t(),!C||!S)return;const L=nh(_),A=nh(s.clientWidth-(M+C)),N=nh(s.clientHeight-(_+S)),j=nh(M),R={rootMargin:-L+"px "+-A+"px "+-N+"px "+-j+"px",threshold:So(0,wr(1,k))||1};let q=!0;function $(ee){const re=ee[0].intersectionRatio;if(!yZ(x,e.getBoundingClientRect()))return h();if(re!==k){if(!q)return h();re?h(!1,re):c=setTimeout(()=>{h(!1,1e-7)},1e3)}q=!1}try{r=new IntersectionObserver($,{...R,root:s.ownerDocument})}catch{r=new IntersectionObserver($,R)}r.observe(e)}const y=Hn(e),p=()=>h(a);return y.addEventListener("resize",p),h(!0),()=>{y.removeEventListener("resize",p),u()}}function CLe(e,t,a,r){r===void 0&&(r={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:y=!1}=r,p=Hq(e),b=c||s?[...p?a2(p):[],...t?a2(t):[]]:[];b.forEach(L=>{c&&L.addEventListener("scroll",a),s&&L.addEventListener("resize",a)});const k=p&&h?SLe(p,a,s):null;let x=-1,M=null;u&&(M=new ResizeObserver(L=>{let[A]=L;A&&A.target===p&&M&&t&&(M.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=M)==null||N.observe(t)})),a()}),p&&!y&&M.observe(p),t&&M.observe(t));let _,C=y?Vl(e):null;y&&S();function S(){const L=Vl(e);C&&!yZ(C,L)&&a(),C=L,_=requestAnimationFrame(S)}return a(),()=>{var L;b.forEach(A=>{c&&A.removeEventListener("scroll",a),s&&A.removeEventListener("resize",a)}),k?.(),(L=M)==null||L.disconnect(),M=null,y&&cancelAnimationFrame(_)}}const LLe=nLe,NLe=aLe,ILe=JCe,ALe=rLe,jLe=eLe,yB=QCe,ELe=oLe,PLe=(e,t,a)=>{const r=new Map,c=a??{},s={..._Le,...c.platform,_c:r};return KCe(e,t,{...c,platform:s})};var RLe=typeof document<"u",DLe=function(){},vA=RLe?m.useLayoutEffect:DLe;function FA(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 a,r,c;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(r=a;r--!==0;)if(!FA(e[r],t[r]))return!1;return!0}if(c=Object.keys(e),a=c.length,a!==Object.keys(t).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(t,c[r]))return!1;for(r=a;r--!==0;){const s=c[r];if(!(s==="_owner"&&e.$$typeof)&&!FA(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function mZ(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mB(e,t){const a=mZ(e);return Math.round(t*a)/a}function jR(e){const t=m.useRef(e);return vA(()=>{t.current=e}),t}function qLe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:r=[],platform:c,elements:{reference:s,floating:u}={},transform:h=!0,whileElementsMounted:y,open:p}=e,[b,k]=m.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[x,M]=m.useState(r);FA(x,r)||M(r);const[_,C]=m.useState(null),[S,L]=m.useState(null),A=m.useCallback(O=>{O!==R.current&&(R.current=O,C(O))},[]),N=m.useCallback(O=>{O!==q.current&&(q.current=O,L(O))},[]),j=s||_,T=u||S,R=m.useRef(null),q=m.useRef(null),$=m.useRef(b),ee=y!=null,re=jR(y),F=jR(c),G=jR(p),X=m.useCallback(()=>{if(!R.current||!q.current)return;const O={placement:t,strategy:a,middleware:x};F.current&&(O.platform=F.current),PLe(R.current,q.current,O).then(Y=>{const V={...Y,isPositioned:G.current!==!1};ae.current&&!FA($.current,V)&&($.current=V,No.flushSync(()=>{k(V)}))})},[x,t,a,F,G]);vA(()=>{p===!1&&$.current.isPositioned&&($.current.isPositioned=!1,k(O=>({...O,isPositioned:!1})))},[p]);const ae=m.useRef(!1);vA(()=>(ae.current=!0,()=>{ae.current=!1}),[]),vA(()=>{if(j&&(R.current=j),T&&(q.current=T),j&&T){if(re.current)return re.current(j,T,X);X()}},[j,T,X,re,ee]);const he=m.useMemo(()=>({reference:R,floating:q,setReference:A,setFloating:N}),[A,N]),P=m.useMemo(()=>({reference:j,floating:T}),[j,T]),E=m.useMemo(()=>{const O={position:a,left:0,top:0};if(!P.floating)return O;const Y=mB(P.floating,b.x),V=mB(P.floating,b.y);return h?{...O,transform:"translate("+Y+"px, "+V+"px)",...mZ(P.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Y,top:V}},[a,h,P.floating,b.x,b.y]);return m.useMemo(()=>({...b,update:X,refs:he,elements:P,floatingStyles:E}),[b,X,he,P,E])}const zLe=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:r,padding:c}=typeof e=="function"?e(a):e;return r&&t(r)?r.current!=null?yB({element:r.current,padding:c}).fn(a):{}:r?yB({element:r,padding:c}).fn(a):{}}}},TLe=(e,t)=>{const a=LLe(e);return{name:a.name,fn:a.fn,options:[e,t]}},$Le=(e,t)=>{const a=NLe(e);return{name:a.name,fn:a.fn,options:[e,t]}},OLe=(e,t)=>({fn:ELe(e).fn,options:[e,t]}),HLe=(e,t)=>{const a=ILe(e);return{name:a.name,fn:a.fn,options:[e,t]}},VLe=(e,t)=>{const a=ALe(e);return{name:a.name,fn:a.fn,options:[e,t]}},BLe=(e,t)=>{const a=jLe(e);return{name:a.name,fn:a.fn,options:[e,t]}},FLe=(e,t)=>{const a=zLe(e);return{name:a.name,fn:a.fn,options:[e,t]}};var ULe=Object.defineProperty,GLe=(e,t)=>ULe(e,"name",{value:t,configurable:!0}),ZLe=m.forwardRef(GLe(function(t,a){const{children:r,width:c=10,height:s=5,...u}=t;return g.jsx(we.svg,{...u,ref:a,width:c,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),WLe=Object.defineProperty,Lo=(e,t)=>WLe(e,"name",{value:t,configurable:!0}),gB={Partial:"partial"},kB={Optimized:"optimized",Always:"always"},gZ="Popper",[kZ,Ar]=Vt(gZ),[YLe,vZ]=kZ(gZ),b2=Lo(e=>{const{__scopePopper:t,children:a}=e,[r,c]=m.useState(null),[s,u]=m.useState(void 0);return g.jsx(YLe,{scope:t,anchor:r,onAnchorChange:c,placementState:s,setPlacementState:u,children:a})},"Popper"),XLe="PopperAnchor",x2=m.forwardRef(Lo(function(t,a){const{__scopePopper:r,virtualRef:c,...s}=t,u=vZ(XLe,r),h=m.useRef(null),y=u.onAnchorChange,p=m.useCallback(C=>{h.current=C,C&&y(C)},[y]),b=Pe(a,p),k=m.useRef(null);m.useEffect(()=>{if(!c)return;const C=k.current;k.current=c.current,C!==k.current&&y(k.current)});const x=u.placementState&&Sj(u.placementState),M=x?.[0],_=x?.[1];return c?null:g.jsx(we.div,{"data-radix-popper-side":M,"data-radix-popper-align":_,...s,ref:b})},"PopperAnchor")),bZ="PopperContent",[KLe,QLe]=kZ(bZ),_j=m.forwardRef(Lo(function(t,a){const{__scopePopper:r,side:c="bottom",sideOffset:s=0,align:u="center",alignOffset:h=0,arrowPadding:y=0,avoidCollisions:p=!0,collisionBoundary:b=[],collisionPadding:k=0,sticky:x=gB.Partial,hideWhenDetached:M=!1,updatePositionStrategy:_=kB.Optimized,onPlaced:C,...S}=t,L=vZ(bZ,r),[A,N]=m.useState(null),j=Pe(a,N),[T,R]=m.useState(null),q=y2(T),$=q?.width??0,ee=q?.height??0,re=c+(u!=="center"?"-"+u:""),F=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},G=Array.isArray(b)?b:[b],X=G.length>0,ae={padding:F,boundary:G.filter(xZ),altBoundary:X},{refs:he,floatingStyles:P,placement:E,isPositioned:O,middlewareData:Y}=qLe({strategy:"fixed",placement:re,whileElementsMounted:Lo((...ie)=>CLe(...ie,{animationFrame:_===kB.Always}),"whileElementsMounted"),elements:{reference:L.anchor},middleware:[TLe({mainAxis:s+ee,alignmentAxis:h}),p&&$Le({mainAxis:!0,crossAxis:!1,...x===gB.Partial?{limiter:OLe()}:{},...ae}),p&&HLe({...ae}),VLe({...ae,apply:Lo(({elements:ie,rects:pe,availableWidth:be,availableHeight:Ie})=>{const{width:_e,height:Me}=pe.reference,Ae=ie.floating.style;Ae.setProperty("--radix-popper-available-width",`${be}px`),Ae.setProperty("--radix-popper-available-height",`${Ie}px`),Ae.setProperty("--radix-popper-anchor-width",`${_e}px`),Ae.setProperty("--radix-popper-anchor-height",`${Me}px`)},"apply")}),T&&FLe({element:T,padding:y}),nNe({arrowWidth:$,arrowHeight:ee}),M&&BLe(X?{strategy:"referenceHidden",...ae}:{strategy:"referenceHidden",padding:ae.padding,altBoundary:ae.altBoundary})]}),V=L.setPlacementState;ht(()=>(V(E),()=>{V(void 0)}),[E,V]);const[D,z]=Sj(E),J=vn(C);ht(()=>{O&&J?.()},[O,J]);const K=Y.arrow?.x,W=Y.arrow?.y,U=Y.arrow?.centerOffset!==0,[de,ke]=m.useState();return ht(()=>{A&&ke(window.getComputedStyle(A).zIndex)},[A]),g.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:O?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(KLe,{scope:r,placedSide:D,placedAlign:z,onArrowChange:R,arrowX:K,arrowY:W,shouldHideArrow:U,children:g.jsx(we.div,{"data-side":D,"data-align":z,...S,ref:j,style:{...S.style,animation:O?S.style?.animation:"none"}})})})},"PopperContent")),JLe="PopperArrow",eNe={top:"bottom",right:"left",bottom:"top",left:"right"},tNe=m.forwardRef(Lo(function(t,a){const{__scopePopper:r,...c}=t,s=QLe(JLe,r),u=eNe[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(ZLe,{...c,ref:a,style:{...c.style,display:"block"}})})},"PopperArrow"));function xZ(e){return e!==null}Lo(xZ,"isNotNull");var nNe=Lo(e=>({name:"transformOrigin",options:e,fn(t){const{placement:a,rects:r,middlewareData:c}=t,u=c.arrow?.centerOffset!==0,h=u?0:e.arrowWidth,y=u?0:e.arrowHeight,[p,b]=Sj(a),k={start:"0%",center:"50%",end:"100%"}[b],x=(c.arrow?.x??0)+h/2,M=(c.arrow?.y??0)+y/2;let _="",C="";return p==="bottom"?(_=u?k:`${x}px`,C=`${-y}px`):p==="top"?(_=u?k:`${x}px`,C=`${r.floating.height+y}px`):p==="right"?(_=`${-y}px`,C=u?k:`${M}px`):p==="left"&&(_=`${r.floating.width+y}px`,C=u?k:`${M}px`),{data:{x:_,y:C}}}}),"transformOrigin");function Sj(e){const[t,a="center"]=e.split("-");return[t,a]}Lo(Sj,"getSideAndAlignFromPlacement");var aNe=Object.defineProperty,Vq=(e,t)=>aNe(e,"name",{value:t,configurable:!0}),ER=!1;function MZ(){const[e,t]=m.useState(ER);return m.useEffect(()=>{ER||(ER=!0,t(!0))},[]),e}Vq(MZ,"useIsHydrated");var wZ=Fl[" useSyncExternalStore ".trim().toString()];function _Z(){return()=>{}}Vq(_Z,"subscribe");function SZ(){return wZ(_Z,()=>!0,()=>!1)}Vq(SZ,"useIsHydratedModern");var oNe=typeof wZ=="function"?SZ:MZ,rNe=Object.defineProperty,Xl=(e,t)=>rNe(e,"name",{value:t,configurable:!0}),PR="rovingFocusGroup.onEntryFocus",iNe={bubbles:!1,cancelable:!0},Cj="RovingFocusGroup",[yD,CZ,cNe]=Md(Cj),[sNe,Sd]=Vt(Cj,[cNe]),vB={Vertical:"vertical",Horizontal:"horizontal"},lNe={RTL:"rtl"},[dNe,uNe]=sNe(Cj),Bq=m.forwardRef(Xl(function(t,a){return g.jsx(yD.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(yD.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(hNe,{...t,ref:a})})})},"RovingFocusGroup")),hNe=m.forwardRef(Xl(function(t,a){const{__scopeRovingFocusGroup:r,orientation:c,loop:s=!1,dir:u,currentTabStopId:h,defaultCurrentTabStopId:y,onCurrentTabStopIdChange:p,onEntryFocus:b,preventScrollOnEntryFocus:k=!1,...x}=t,M=m.useRef(null),_=Pe(a,M),C=Yl(u),[S,L]=Wt({prop:h,defaultProp:y??null,onChange:p,caller:Cj}),[A,N]=m.useState(!1),j=vn(b),T=CZ(r),R=m.useRef(!1),[q,$]=m.useState(0);return m.useEffect(()=>{const ee=M.current;if(ee)return ee.addEventListener(PR,j),()=>ee.removeEventListener(PR,j)},[j]),g.jsx(dNe,{scope:r,orientation:c,dir:C,loop:s,currentTabStopId:S,onItemFocus:m.useCallback(ee=>L(ee),[L]),onItemShiftTab:m.useCallback(()=>N(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(ee=>ee+1),[]),onFocusableItemRemove:m.useCallback(()=>$(ee=>ee-1),[]),children:g.jsx(we.div,{tabIndex:A||q===0?-1:0,"data-orientation":c,...x,ref:_,style:{outline:"none",...t.style},onMouseDown:ye(t.onMouseDown,()=>{R.current=!0}),onFocus:ye(t.onFocus,ee=>{const re=!R.current;if(ee.target===ee.currentTarget&&re&&!A){const F=new CustomEvent(PR,iNe);if(ee.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=T().filter(E=>E.focusable),X=G.find(E=>E.active),ae=G.find(E=>E.id===S),P=[X,ae,...G].filter(Boolean).map(E=>E.ref.current);Uq(P,k)}}R.current=!1}),onBlur:ye(t.onBlur,()=>N(!1))})})},"RovingFocusGroupImpl")),pNe="RovingFocusGroupItem",Fq=m.forwardRef(Xl(function(t,a){const{__scopeRovingFocusGroup:r,focusable:c=!0,active:s=!1,tabStopId:u,children:h,...y}=t,p=pt(),b=u||p,k=uNe(pNe,r),x=k.currentTabStopId===b,M=CZ(r),{onFocusableItemAdd:_,onFocusableItemRemove:C,currentTabStopId:S}=k,L=oNe();return ht(()=>{if(!(!L||!c))return _(),()=>C()},[L,c,_,C]),m.useEffect(()=>{if(!(L||!c))return _(),()=>C()},[L,c,_,C]),g.jsx(yD.ItemSlot,{scope:r,id:b,focusable:c,active:s,children:g.jsx(we.span,{tabIndex:x?0:-1,"data-orientation":k.orientation,...y,ref:a,onMouseDown:ye(t.onMouseDown,A=>{c?k.onItemFocus(b):A.preventDefault()}),onFocus:ye(t.onFocus,()=>k.onItemFocus(b)),onKeyDown:ye(t.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){k.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const N=NZ(A,k.orientation,k.dir);if(N!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let T=M().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")T.reverse();else if(N==="prev"||N==="next"){N==="prev"&&T.reverse();const R=T.indexOf(A.currentTarget);T=k.loop?IZ(T,R+1):T.slice(R+1)}setTimeout(()=>Uq(T))}}),children:typeof h=="function"?h({isCurrentTabStop:x,hasTabStop:S!=null}):h})})},"RovingFocusGroupItem")),fNe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LZ(e,t){return t!==lNe.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Xl(LZ,"getDirectionAwareKey");function NZ(e,t,a){const r=LZ(e.key,a);if(!(t===vB.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===vB.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return fNe[r]}Xl(NZ,"getFocusIntent");function Uq(e,t=!1){const a=document.activeElement;for(const r of e)if(r===a||(r.focus({preventScroll:t}),document.activeElement!==a))return}Xl(Uq,"focusFirst");function IZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Xl(IZ,"wrapArray");var yNe=Object.defineProperty,Xe=(e,t)=>yNe(e,"name",{value:t,configurable:!0}),mNe={RTL:"rtl"},mD=["Enter"," "],gNe=["ArrowDown","PageUp","Home"],AZ=["ArrowUp","PageDown","End"],kNe=[...gNe,...AZ],vNe={ltr:[...mD,"ArrowRight"],rtl:[...mD,"ArrowLeft"]},bNe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lj="Menu",[o2,xNe,MNe]=Md(Lj),[Kl,M2]=Vt(Lj,[MNe,Ar,Sd]),Nj=Ar(),jZ=Sd(),[EZ,jr]=Kl(Lj),[wNe,w2]=Kl(Lj),Gq=Xe(e=>{const{__scopeMenu:t,open:a=!1,children:r,dir:c,onOpenChange:s,modal:u=!0}=e,h=Nj(t),[y,p]=m.useState(null),b=m.useRef(!1),k=vn(s),x=Yl(c);return m.useEffect(()=>{const M=Xe(()=>{b.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=Xe(()=>b.current=!1,"handlePointer");return document.addEventListener("keydown",M,{capture:!0}),()=>{document.removeEventListener("keydown",M,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),m.useEffect(()=>{if(!a)return;const M=Xe(()=>k(!1),"handleBlur");return window.addEventListener("blur",M),()=>window.removeEventListener("blur",M)},[a,k]),g.jsx(b2,{...h,children:g.jsx(EZ,{scope:t,open:a,onOpenChange:k,content:y,onContentChange:p,children:g.jsx(wNe,{scope:t,onClose:m.useCallback(()=>k(!1),[k]),isUsingKeyboardRef:b,dir:x,modal:u,children:r})})})},"Menu"),Ij=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t,s=Nj(r);return g.jsx(x2,{...s,...c,ref:a})},"MenuAnchor")),PZ="MenuPortal",[_Ne,RZ]=Kl(PZ,{forceMount:void 0}),Zq=Xe(e=>{const{__scopeMenu:t,forceMount:a,children:r,container:c}=e,s=jr(PZ,t);return g.jsx(_Ne,{scope:t,forceMount:a,children:g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:r})})})},"MenuPortal"),Sa="MenuContent",[SNe,Wq]=Kl(Sa),Yq=m.forwardRef(Xe(function(t,a){const r=RZ(Sa,t.__scopeMenu),{forceMount:c=r.forceMount,...s}=t,u=jr(Sa,t.__scopeMenu),h=w2(Sa,t.__scopeMenu);return g.jsx(o2.Provider,{scope:t.__scopeMenu,children:g.jsx(bn,{present:c||u.open,children:g.jsx(o2.Slot,{scope:t.__scopeMenu,children:h.modal?g.jsx(CNe,{...s,ref:a}):g.jsx(LNe,{...s,ref:a})})})})},"MenuContent")),CNe=m.forwardRef(Xe(function(t,a){const r=jr(Sa,t.__scopeMenu),c=m.useRef(null),s=Pe(a,c);return m.useEffect(()=>{const u=c.current;if(u)return uj(u)},[]),g.jsx(Xq,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ye(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),LNe=m.forwardRef(Xe(function(t,a){const r=jr(Sa,t.__scopeMenu);return g.jsx(Xq,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),NNe=Ca("MenuContent.ScrollLock"),Xq=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,loop:c=!1,trapFocus:s,onOpenAutoFocus:u,onCloseAutoFocus:h,disableOutsidePointerEvents:y,onEntryFocus:p,onEscapeKeyDown:b,onPointerDownOutside:k,onFocusOutside:x,onInteractOutside:M,onDismiss:_,disableOutsideScroll:C,...S}=t,L=jr(Sa,r),A=w2(Sa,r),N=Nj(r),j=jZ(r),T=xNe(r),[R,q]=m.useState(null),$=m.useRef(null),[ee,re]=m.useState(null);lj(ee);const{nodes:F,registry:G}=sj(),X=!!(s||C),ae=Pe(a,$,L.onContentChange,re),he=m.useRef(0),P=m.useRef(""),E=m.useRef(0),O=m.useRef(null),Y=m.useRef("right"),V=m.useRef(0),D=m.useMemo(()=>C?[$,...F.map(U=>({current:U}))]:[],[$,F,C]),z=C?k2:m.Fragment,J=C?{as:NNe,allowPinchZoom:!0,shards:D}:void 0,K=Xe(U=>{const de=P.current+U,ke=T().filter(Ae=>!Ae.disabled),ie=document.activeElement,pe=ke.find(Ae=>Ae.ref.current===ie)?.textValue,be=ke.map(Ae=>Ae.textValue),Ie=VZ(be,de,pe),_e=ke.find(Ae=>Ae.textValue===Ie)?.ref.current;function Me(Ae){P.current=Ae,window.clearTimeout(he.current),Ae!==""&&(he.current=window.setTimeout(()=>Me(""),1e3))}Xe(Me,"updateSearch"),Me(de),_e&&setTimeout(()=>_e.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(he.current),[]),xd();const W=m.useCallback(U=>Y.current===O.current?.side&&FZ(U,O.current?.area),[]);return g.jsx(SNe,{scope:r,searchRef:P,onItemEnter:m.useCallback(U=>{W(U)&&U.preventDefault()},[W]),onItemLeave:m.useCallback(U=>{W(U)||($.current?.focus(),q(null))},[W]),onTriggerLeave:m.useCallback(U=>{W(U)&&U.preventDefault()},[W]),pointerGraceTimerRef:E,onPointerGraceIntentChange:m.useCallback(U=>{O.current=U},[]),children:g.jsx(cj,{registry:X?G:null,children:g.jsx(z,{...J,children:g.jsx(ij,{asChild:!0,trapped:s,branches:F,onMountAutoFocus:ye(u,U=>{U.preventDefault(),$.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:y,onEscapeKeyDown:b,onPointerDownOutside:k,onFocusOutside:x,onInteractOutside:M,onDismiss:_,children:g.jsx(Bq,{asChild:!0,...j,dir:A.dir,orientation:"vertical",loop:c,currentTabStopId:R,onCurrentTabStopIdChange:q,onEntryFocus:ye(p,U=>{A.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(_j,{role:"menu","aria-orientation":"vertical","data-state":iz(L.open),"data-radix-menu-content":"",dir:A.dir,...N,...S,ref:ae,style:{outline:"none",...S.style},onKeyDown:ye(S.onKeyDown,U=>{const ke=U.target.closest("[data-radix-menu-content]")===U.currentTarget,ie=U.ctrlKey||U.altKey||U.metaKey,pe=U.key.length===1;ke&&(U.key==="Tab"&&U.preventDefault(),!ie&&pe&&K(U.key));const be=$.current;if(U.target!==be||!kNe.includes(U.key))return;U.preventDefault();const _e=T().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);AZ.includes(U.key)&&_e.reverse(),OZ(_e)}),onBlur:ye(t.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(he.current),P.current="")}),onPointerMove:ye(t.onPointerMove,fd(U=>{const de=U.target,ke=V.current!==U.clientX;if(U.currentTarget.contains(de)&&ke){const ie=U.clientX>V.current?"right":"left";Y.current=ie,V.current=U.clientX}}))})})})})})})})},"MenuContentImpl")),Aj=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return g.jsx(we.div,{role:"group",...c,ref:a})},"MenuGroup")),Kq=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return g.jsx(we.div,{...c,ref:a})},"MenuLabel")),gD="MenuItem",bB="menu.itemSelect",_2=m.forwardRef(Xe(function(t,a){const{disabled:r=!1,onSelect:c,...s}=t,u=m.useRef(null),h=w2(gD,t.__scopeMenu),y=Wq(gD,t.__scopeMenu),p=Pe(a,u),b=m.useRef(!1),k=Xe(()=>{const x=u.current;if(!r&&x){const M=new CustomEvent(bB,{bubbles:!0,cancelable:!0});x.addEventListener(bB,_=>c?.(_),{once:!0}),rq(x,M),M.defaultPrevented?b.current=!1:h.onClose()}},"handleSelect");return g.jsx(DZ,{...s,ref:p,disabled:r,onClick:ye(t.onClick,k),onPointerDown:x=>{t.onPointerDown?.(x),b.current=!0},onPointerUp:ye(t.onPointerUp,x=>{b.current||x.currentTarget?.click()}),onKeyDown:ye(t.onKeyDown,x=>{r||x.target!==x.currentTarget||y.searchRef.current!==""&&x.key===" "||mD.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})},"MenuItem")),DZ=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,disabled:c=!1,textValue:s,...u}=t,h=Wq(gD,r),y=jZ(r),p=m.useRef(null),b=Pe(a,p),[k,x]=m.useState(!1),[M,_]=m.useState("");return m.useEffect(()=>{const C=p.current;C&&_((C.textContent??"").trim())},[u.children]),g.jsx(o2.ItemSlot,{scope:r,disabled:c,textValue:s??M,children:g.jsx(Fq,{asChild:!0,...y,focusable:!c,children:g.jsx(we.div,{role:"menuitem","data-highlighted":k?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:b,onPointerMove:ye(t.onPointerMove,fd(C=>{c?h.onItemLeave(C):(h.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(t.onPointerLeave,fd(C=>h.onItemLeave(C))),onFocus:ye(t.onFocus,()=>x(!0)),onBlur:ye(t.onBlur,()=>x(!1))})})})},"MenuItemImpl")),Qq=m.forwardRef(Xe(function(t,a){const{checked:r=!1,onCheckedChange:c,...s}=t;return g.jsx(zZ,{scope:t.__scopeMenu,checked:r,children:g.jsx(_2,{role:"menuitemcheckbox","aria-checked":r2(r)?"mixed":r,...s,ref:a,"data-state":jj(r),onSelect:ye(s.onSelect,()=>c?.(r2(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),INe="MenuRadioGroup",[ANe,jNe]=Kl(INe,{value:void 0,onValueChange:Xe(()=>{},"onValueChange")}),Jq=m.forwardRef(Xe(function(t,a){const{value:r,onValueChange:c,...s}=t,u=vn(c);return g.jsx(ANe,{scope:t.__scopeMenu,value:r,onValueChange:u,children:g.jsx(Aj,{...s,ref:a})})},"MenuRadioGroup")),ENe="MenuRadioItem",ez=m.forwardRef(Xe(function(t,a){const{value:r,...c}=t,s=jNe(ENe,t.__scopeMenu),u=r===s.value;return g.jsx(zZ,{scope:t.__scopeMenu,checked:u,children:g.jsx(_2,{role:"menuitemradio","aria-checked":u,...c,ref:a,"data-state":jj(u),onSelect:ye(c.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),qZ="MenuItemIndicator",[zZ,PNe]=Kl(qZ,{checked:!1}),tz=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,forceMount:c,...s}=t,u=PNe(qZ,r);return g.jsx(bn,{present:c||r2(u.checked)||u.checked===!0,children:g.jsx(we.span,{...s,ref:a,"data-state":jj(u.checked)})})},"MenuItemIndicator")),nz=m.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return g.jsx(we.div,{role:"separator","aria-orientation":"horizontal",...c,ref:a})},"MenuSeparator")),TZ="MenuSub",[RNe,$Z]=Kl(TZ),az=Xe(e=>{const{__scopeMenu:t,children:a,open:r=!1,onOpenChange:c}=e,s=jr(TZ,t),u=Nj(t),[h,y]=m.useState(null),[p,b]=m.useState(null),k=vn(c);return m.useEffect(()=>(s.open===!1&&k(!1),()=>k(!1)),[s.open,k]),g.jsx(b2,{...u,children:g.jsx(EZ,{scope:t,open:r,onOpenChange:k,content:p,onContentChange:b,children:g.jsx(RNe,{scope:t,contentId:pt(),triggerId:pt(),trigger:h,onTriggerChange:y,children:a})})})},"MenuSub"),ah="MenuSubTrigger",oz=m.forwardRef(Xe(function(t,a){const r=jr(ah,t.__scopeMenu),c=w2(ah,t.__scopeMenu),s=$Z(ah,t.__scopeMenu),u=Wq(ah,t.__scopeMenu),h=m.useRef(null),{pointerGraceTimerRef:y,onPointerGraceIntentChange:p}=u,b={__scopeMenu:t.__scopeMenu},k=m.useCallback(()=>{h.current&&window.clearTimeout(h.current),h.current=null},[]);m.useEffect(()=>k,[k]),m.useEffect(()=>{const M=y.current;return()=>{window.clearTimeout(M),p(null)}},[y,p]);const x=Pe(a,s.onTriggerChange);return g.jsx(Ij,{asChild:!0,...b,children:g.jsx(DZ,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":iz(r.open),...t,ref:x,onClick:M=>{t.onClick?.(M),!(t.disabled||M.defaultPrevented)&&(M.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ye(t.onPointerMove,fd(M=>{u.onItemEnter(M),!M.defaultPrevented&&!t.disabled&&!r.open&&!h.current&&(u.onPointerGraceIntentChange(null),h.current=window.setTimeout(()=>{r.onOpenChange(!0),k()},100))})),onPointerLeave:ye(t.onPointerLeave,fd(M=>{k();const _=r.content?.getBoundingClientRect();if(_){const C=r.content?.dataset.side,S=C==="right",L=S?-5:5,A=_[S?"left":"right"],N=_[S?"right":"left"];u.onPointerGraceIntentChange({area:[{x:M.clientX+L,y:M.clientY},{x:A,y:_.top},{x:N,y:_.top},{x:N,y:_.bottom},{x:A,y:_.bottom}],side:C}),window.clearTimeout(y.current),y.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(M),M.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:ye(t.onKeyDown,M=>{t.disabled||M.target!==M.currentTarget||u.searchRef.current!==""&&M.key===" "||vNe[c.dir].includes(M.key)&&(r.onOpenChange(!0),r.content?.focus(),M.preventDefault())})})})},"MenuSubTrigger")),DNe="MenuSubContent",rz=m.forwardRef(Xe(function(t,a){const r=RZ(Sa,t.__scopeMenu),{forceMount:c=r.forceMount,align:s="start",...u}=t,h=jr(Sa,t.__scopeMenu),y=w2(Sa,t.__scopeMenu),p=$Z(DNe,t.__scopeMenu),b=m.useRef(null),k=Pe(a,b);return g.jsx(o2.Provider,{scope:t.__scopeMenu,children:g.jsx(bn,{present:c||h.open,children:g.jsx(o2.Slot,{scope:t.__scopeMenu,children:g.jsx(Xq,{id:p.contentId,"aria-labelledby":p.triggerId,...u,ref:k,align:s,side:y.dir===mNe.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{y.isUsingKeyboardRef.current&&b.current?.focus(),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:ye(t.onFocusOutside,x=>{x.target!==p.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:ye(t.onEscapeKeyDown,x=>{y.onClose(),x.preventDefault()}),onKeyDown:ye(t.onKeyDown,x=>{const M=x.currentTarget.contains(x.target),_=bNe[y.dir].includes(x.key);M&&_&&(h.onOpenChange(!1),p.trigger?.focus(),x.preventDefault())})})})})})},"MenuSubContent"));function iz(e){return e?"open":"closed"}Xe(iz,"getOpenState");function r2(e){return e==="indeterminate"}Xe(r2,"isIndeterminate");function jj(e){return r2(e)?"indeterminate":e?"checked":"unchecked"}Xe(jj,"getCheckedState");function OZ(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}Xe(OZ,"focusFirst");function HZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Xe(HZ,"wrapArray");function VZ(e,t,a){const c=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=a?e.indexOf(a):-1;let u=HZ(e,Math.max(s,0));c.length===1&&(u=u.filter(p=>p!==a));const y=u.find(p=>p.toLowerCase().startsWith(c.toLowerCase()));return y!==a?y:void 0}Xe(VZ,"getNextMatch");function BZ(e,t){const{x:a,y:r}=e;let c=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const h=t[s],y=t[u],p=h.x,b=h.y,k=y.x,x=y.y;b>r!=x>r&&a<(k-p)*(r-b)/(x-b)+p&&(c=!c)}return c}Xe(BZ,"isPointInPolygon");function FZ(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return BZ(a,t)}Xe(FZ,"isPointerInGraceArea");function fd(e){return t=>t.pointerType==="mouse"?e(t):void 0}Xe(fd,"whenMouse");var qNe=Object.defineProperty,Zt=(e,t)=>qNe(e,"name",{value:t,configurable:!0}),cz="ContextMenu",[zNe,LDe]=Vt(cz,[M2]),xn=M2(),[TNe,UZ]=zNe(cz),$Ne=Zt(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,dir:s,modal:u=!0}=e,h=m.useRef(!1),[y,p]=Wt({prop:c,defaultProp:!1,onChange:r,caller:cz}),b=xn(t);return g.jsx(TNe,{scope:t,open:y,onOpenChange:p,modal:u,hasInteractedRef:h,children:g.jsx(Gq,{...b,dir:s,open:y,onOpenChange:p,modal:u,children:a})})},"ContextMenu"),ONe="ContextMenuTrigger",HNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,disabled:c=!1,...s}=t,u=UZ(ONe,r),h=xn(r),[y,p]=m.useState({x:0,y:0}),b=m.useMemo(()=>({current:{getBoundingClientRect:Zt(()=>DOMRect.fromRect({width:0,height:0,...y}),"getBoundingClientRect")}}),[y]),k=m.useRef(0),x=m.useCallback(()=>window.clearTimeout(k.current),[]),M=Zt(_=>{u.hasInteractedRef.current=!0,p({x:_.clientX,y:_.clientY}),u.onOpenChange(!0)},"handleOpen");return m.useEffect(()=>x,[x]),m.useEffect(()=>{c&&x()},[c,x]),g.jsxs(g.Fragment,{children:[g.jsx(Ij,{...h,virtualRef:b}),g.jsx(we.span,{"data-state":u.open?"open":"closed","data-disabled":c?"":void 0,...s,ref:a,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:c?t.onContextMenu:ye(t.onContextMenu,_=>{x(),M(_),_.preventDefault()}),onPointerDown:c?t.onPointerDown:ye(t.onPointerDown,Au(_=>{x(),u.open&&u.onOpenChange(!1),k.current=window.setTimeout(()=>M(_),700)})),onPointerMove:c?t.onPointerMove:ye(t.onPointerMove,Au(x)),onPointerCancel:c?t.onPointerCancel:ye(t.onPointerCancel,Au(x)),onPointerUp:c?t.onPointerUp:ye(t.onPointerUp,Au(x))})]})},"ContextMenuTrigger")),GZ=Zt(e=>{const{__scopeContextMenu:t,...a}=e,r=xn(t);return g.jsx(Zq,{...r,...a})},"ContextMenuPortal"),VNe="ContextMenuContent",BNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=UZ(VNe,r),u=xn(r),h=m.useRef(!1);return g.jsx(Yq,{...u,side:"right",sideOffset:2,align:"start",...c,ref:a,onCloseAutoFocus:y=>{t.onCloseAutoFocus?.(y),!y.defaultPrevented&&h.current&&y.preventDefault(),h.current=!1},onInteractOutside:y=>{t.onInteractOutside?.(y),!y.defaultPrevented&&!s.modal&&(h.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),FNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Aj,{...s,...c,ref:a})},"ContextMenuGroup")),UNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Kq,{...s,...c,ref:a})},"ContextMenuLabel")),GNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(_2,{...s,...c,ref:a})},"ContextMenuItem")),ZNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Qq,{...s,...c,ref:a})},"ContextMenuCheckboxItem")),WNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(Jq,{...s,...c,ref:a})},"ContextMenuRadioGroup")),YNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(ez,{...s,...c,ref:a})},"ContextMenuRadioItem")),ZZ=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(tz,{...s,...c,ref:a})},"ContextMenuItemIndicator")),XNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(nz,{...s,...c,ref:a})},"ContextMenuSeparator")),KNe="ContextMenuSub",QNe=Zt(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,defaultOpen:s}=e,u=xn(t),[h,y]=Wt({prop:c,defaultProp:s??!1,onChange:r,caller:KNe});return g.jsx(az,{...u,open:h,onOpenChange:y,children:a})},"ContextMenuSub"),JNe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(oz,{...s,...c,ref:a})},"ContextMenuSubTrigger")),eIe=m.forwardRef(Zt(function(t,a){const{__scopeContextMenu:r,...c}=t,s=xn(r);return g.jsx(rz,{...s,...c,ref:a,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Au(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Zt(Au,"whenTouchOrPen");function tIe({...e}){return g.jsx($Ne,{"data-slot":"context-menu",...e})}function nIe({...e}){return g.jsx(HNe,{"data-slot":"context-menu-trigger",...e})}function aIe({...e}){return g.jsx(FNe,{"data-slot":"context-menu-group",...e})}function oIe({...e}){return g.jsx(GZ,{"data-slot":"context-menu-portal",...e})}function rIe({...e}){return g.jsx(QNe,{"data-slot":"context-menu-sub",...e})}function iIe({...e}){return g.jsx(WNe,{"data-slot":"context-menu-radio-group",...e})}function cIe({className:e,inset:t,children:a,...r}){return g.jsxs(JNe,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,g.jsx(Ga,{className:"ml-auto"})]})}function sIe({className:e,...t}){return g.jsx(eIe,{"data-slot":"context-menu-sub-content",className:Q("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function lIe({className:e,...t}){return g.jsx(GZ,{children:g.jsx(BNe,{"data-slot":"context-menu-content",className:Q("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function dIe({className:e,inset:t,variant:a="default",...r}){return g.jsx(GNe,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:Q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function uIe({className:e,children:t,checked:a,...r}){return g.jsxs(ZNe,{"data-slot":"context-menu-checkbox-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(ZZ,{children:g.jsx(Ua,{className:"size-4"})})}),t]})}function hIe({className:e,children:t,...a}){return g.jsxs(YNe,{"data-slot":"context-menu-radio-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(ZZ,{children:g.jsx(Dl,{className:"size-2 fill-current"})})}),t]})}function pIe({className:e,inset:t,...a}){return g.jsx(UNe,{"data-slot":"context-menu-label","data-inset":t,className:Q("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function fIe({className:e,...t}){return g.jsx(XNe,{"data-slot":"context-menu-separator",className:Q("bg-border -mx-1 my-1 h-px",e),...t})}function yIe({className:e,...t}){return g.jsx("span",{"data-slot":"context-menu-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const Sr=m.createContext({activeIndex:0,setActiveIndex:()=>{},totalDialogs:0,setTotalDialogs:()=>{},isOpen:!1,setIsOpen:()=>{},clickable:!1,shouldAnimate:!1,setShouldAnimate:()=>{},closeDialog:()=>{}}),Ej=m.forwardRef(({children:e,className:t,open:a=!1,onOpenChange:r,clickable:c=!1,...s},u)=>{const[h,y]=m.useState(0),[p,b]=m.useState(a),[k,x]=m.useState(!1),[M,_]=m.useState(0),C=S=>{S===h&&(h>0?y(L=>L-1):b(!1))};return m.useImperativeHandle(u,()=>({open:()=>{b(!0)},close:()=>{b(!1),y(0)},closeAll:()=>{b(!1),y(0)},next:()=>{y(S=>S+1)},prev:()=>{y(S=>S>0?S-1:0)},goTo:S=>{S>=0&&S<M&&y(S)},closeCurrent:()=>C(h),isOpen:p,activeIndex:h,totalDialogs:M}),[h,M,p]),m.useEffect(()=>{const S=document.documentElement;return p?(S.style.overflow="hidden",x(!0)):S.style.overflow="",r?.(p),()=>{S.style.overflow=""}},[p,r]),g.jsx(Sr.Provider,{value:{activeIndex:h,setActiveIndex:y,totalDialogs:M,setTotalDialogs:_,isOpen:p,setIsOpen:b,clickable:c,shouldAnimate:k,setShouldAnimate:x,closeDialog:C},children:g.jsx("div",{className:t,...s,children:e})})});Ej.displayName="DialogStack";const mIe=({children:e,className:t,onClick:a,asChild:r,...c})=>{const s=m.useContext(Sr);if(!s)throw new Error("DialogStackTrigger must be used within a DialogStack");const u=h=>{s.setIsOpen(!0),a?.(h)};return r&&m.isValidElement(e)?m.cloneElement(e,{onClick:u,className:Q(t,e.props.className),...c}):g.jsx("button",{onClick:u,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm","ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","bg-primary text-primary-foreground hover:bg-primary/90","h-10 px-4 py-2",t),...c,children:e})},sz=({className:e,...t})=>{const a=m.useContext(Sr);if(!a)throw new Error("DialogStackOverlay must be used within a DialogStack");return a.isOpen?g.jsx("div",{className:Q("fixed inset-0 z-[1001] bg-black/80 backdrop-blur-sm","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 slide-in-from-right-1/2 data-[state=open]:fade-in-0",e),onClick:()=>{a.activeIndex===0?a.setIsOpen(!1):a.setActiveIndex(a.activeIndex-1)},...t}):null},lz=({children:e,className:t,...a})=>{const r=m.useContext(Sr),c=m.Children.count(e),[s,u]=m.useState(c);if(m.useEffect(()=>{u(c)},[c]),!r)throw new Error("DialogStackBody must be used within a DialogStack");return r.isOpen?g.jsx(Sr.Provider,{value:{...r,totalDialogs:s,setTotalDialogs:u},children:g.jsx(Zl,{children:g.jsx("div",{className:Q("pointer-events-none fixed z-[1002] w-full max-w-full md:max-w-[67%] right-0 top-0 md:top-[1vh]",t),...a,children:m.Children.map(e,(h,y)=>m.isValidElement(h)?m.cloneElement(h,{index:y}):h)})})}):null},dz=({children:e,className:t,index:a=0,offset:r=20,...c})=>{const s=m.useContext(Sr),[u,h]=m.useState(!1),y=m.useRef(null),p=m.useRef(!1);if(!s)throw new Error("DialogStackContent must be used within a DialogStack");if(!s.isOpen)return null;const b=()=>{s.setIsOpen(!1),s.setActiveIndex(0)},k=()=>{if(p.current){p.current=!1;return}s.closeDialog(a)},x=()=>{p.current=!1,h(!0),y.current=setTimeout(()=>{p.current=!0,h(!1),b()},600)},M=()=>{y.current&&(clearTimeout(y.current),y.current=null),h(!1)},_=A=>{A.stopPropagation(),s.clickable&&s.activeIndex>a&&s.setActiveIndex(a??0)},C=a-s.activeIndex,S=C<0?`-${Math.abs(C)*r}px`:"0",L=a===0&&s.activeIndex===0&&s.shouldAnimate;return m.useEffect(()=>{if(L){const A=setTimeout(()=>{s.setShouldAnimate(!1)},200);return()=>clearTimeout(A)}},[L]),g.jsxs("div",{onClick:_,className:Q("h-[100vh] md:h-[98vh] w-full md:rounded-l-md border bg-background shadow-lg md:transition-all duration-200",L&&"animate-in slide-in-from-right-1/2",C<0&&"brightness-75 blur-[2px]",t),style:{top:0,marginLeft:`${S}`,marginTop:`${window.innerWidth>768?Math.abs(C)*10:0}px`,width:C<0?`calc(100% + ${Math.abs(C)*r}px)`:"100%",zIndex:C<0?50-Math.abs(s.activeIndex-(a??0)):1002,position:C?"absolute":"relative",opacity:C>0?0:1,pointerEvents:C>0?"none":"auto",cursor:s.clickable&&s.activeIndex>a?"pointer":"default"},...c,children:[g.jsx("div",{className:Q("h-full w-full overflow-y-auto p-6 transition-all duration-200",s.activeIndex!==a&&"pointer-events-none select-none"),children:e}),s.activeIndex===a&&g.jsx(Zl,{children:g.jsx(sn,{variant:"ghost",className:Q("fixed z-[1100] top-4 right-4 p-1 size-8 transition-all",u&&"bg-destructive/20 scale-110"),onClick:k,onPointerDown:x,onPointerUp:M,onPointerLeave:M,onPointerCancel:M,"aria-label":"Close",title:s.totalDialogs>1?"Click to close, hold to close all":"Close",children:g.jsx(vr,{})})})]})},gIe=({children:e,className:t,...a})=>g.jsx("h2",{className:Q("font-semibold text-lg leading-none tracking-tight",t),...a,children:e}),kIe=({children:e,className:t,...a})=>g.jsx("p",{className:Q("text-muted-foreground text-sm",t),...a,children:e}),vIe=({className:e,...t})=>g.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),bIe=({children:e,className:t,...a})=>g.jsx("div",{className:Q("flex items-center justify-end space-x-2 pt-4",t),...a,children:e}),xIe=({children:e,className:t,asChild:a,...r})=>{const c=m.useContext(Sr);if(!c)throw new Error("DialogStackNext must be used within a DialogStack");const s=()=>{c.activeIndex<c.totalDialogs-1&&c.setActiveIndex(c.activeIndex+1)};return a&&m.isValidElement(e)?m.cloneElement(e,{onClick:s,className:Q(t,e.props.className),...r}):g.jsx("button",{type:"button",onClick:s,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),disabled:c.activeIndex>=c.totalDialogs-1,...r,children:e||"Next"})},MIe=({children:e,className:t,asChild:a,...r})=>{const c=m.useContext(Sr);if(!c)throw new Error("DialogStackPrevious must be used within a DialogStack");const s=()=>{c.activeIndex>0&&c.setActiveIndex(c.activeIndex-1)};return a&&m.isValidElement(e)?m.cloneElement(e,{onClick:s,className:Q(t,e.props.className),...r}):g.jsx("button",{type:"button",onClick:s,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),disabled:c.activeIndex<=0,...r,children:e||"Previous"})};var wIe=Object.defineProperty,Mn=(e,t)=>wIe(e,"name",{value:t,configurable:!0}),uz="DropdownMenu",[_Ie,NDe]=Vt(uz,[M2]),wn=M2(),[SIe,WZ]=_Ie(uz),CIe=Mn(e=>{const{__scopeDropdownMenu:t,children:a,dir:r,open:c,defaultOpen:s,onOpenChange:u,modal:h=!0}=e,y=wn(t),p=m.useRef(null),[b,k]=Wt({prop:c,defaultProp:s??!1,onChange:u,caller:uz});return g.jsx(SIe,{scope:t,triggerId:pt(),triggerRef:p,contentId:pt(),open:b,onOpenChange:k,onOpenToggle:m.useCallback(()=>k(x=>!x),[k]),modal:h,children:g.jsx(Gq,{...y,open:b,onOpenChange:k,dir:r,modal:h,children:a})})},"DropdownMenu"),LIe="DropdownMenuTrigger",NIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,disabled:c=!1,...s}=t,u=WZ(LIe,r),h=wn(r),y=Pe(a,u.triggerRef);return g.jsx(Ij,{asChild:!0,...h,children:g.jsx(we.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...s,ref:y,onPointerDown:ye(t.onPointerDown,p=>{!c&&p.button===0&&p.ctrlKey===!1&&(u.onOpenToggle(),u.open||p.preventDefault())}),onKeyDown:ye(t.onKeyDown,p=>{c||(["Enter"," "].includes(p.key)&&u.onOpenToggle(),p.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})},"DropdownMenuTrigger")),YZ=Mn(e=>{const{__scopeDropdownMenu:t,...a}=e,r=wn(t);return g.jsx(Zq,{...r,...a})},"DropdownMenuPortal"),IIe="DropdownMenuContent",AIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=WZ(IIe,r),u=wn(r),h=m.useRef(!1);return g.jsx(Yq,{id:s.contentId,"aria-labelledby":s.triggerId,...u,...c,ref:a,onCloseAutoFocus:ye(t.onCloseAutoFocus,y=>{h.current||s.triggerRef.current?.focus(),h.current=!1,y.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,y=>{const p=y.detail.originalEvent,b=p.button===0&&p.ctrlKey===!0,k=p.button===2||b;(!s.modal||k)&&(h.current=!0)}),style:{...t.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)"}})},"DropdownMenuContent")),jIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Aj,{...s,...c,ref:a})},"DropdownMenuGroup")),EIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Kq,{...s,...c,ref:a})},"DropdownMenuLabel")),PIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(_2,{...s,...c,ref:a})},"DropdownMenuItem")),RIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Qq,{...s,...c,ref:a})},"DropdownMenuCheckboxItem")),DIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(Jq,{...s,...c,ref:a})},"DropdownMenuRadioGroup")),qIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(ez,{...s,...c,ref:a})},"DropdownMenuRadioItem")),XZ=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(tz,{...s,...c,ref:a})},"DropdownMenuItemIndicator")),zIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(nz,{...s,...c,ref:a})},"DropdownMenuSeparator")),TIe=Mn(e=>{const{__scopeDropdownMenu:t,children:a,open:r,onOpenChange:c,defaultOpen:s}=e,u=wn(t),[h,y]=Wt({prop:r,defaultProp:s??!1,onChange:c,caller:"DropdownMenuSub"});return g.jsx(az,{...u,open:h,onOpenChange:y,children:a})},"DropdownMenuSub"),$Ie=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(oz,{...s,...c,ref:a})},"DropdownMenuSubTrigger")),OIe=m.forwardRef(Mn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,s=wn(r);return g.jsx(rz,{...s,...c,ref:a,style:{...t.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)"}})},"DropdownMenuSubContent"));function HIe({...e}){return g.jsx(CIe,{"data-slot":"dropdown-menu",...e})}function VIe({...e}){return g.jsx(YZ,{"data-slot":"dropdown-menu-portal",...e})}function BIe({...e}){return g.jsx(NIe,{"data-slot":"dropdown-menu-trigger",...e})}function FIe({className:e,sideOffset:t=4,...a}){return g.jsx(YZ,{children:g.jsx(AIe,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Q("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...a})})}function UIe({...e}){return g.jsx(jIe,{"data-slot":"dropdown-menu-group",...e})}function GIe({className:e,inset:t,variant:a="default",...r}){return g.jsx(PIe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:Q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ZIe({className:e,children:t,checked:a,...r}){return g.jsxs(RIe,{"data-slot":"dropdown-menu-checkbox-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(XZ,{children:g.jsx(Ua,{className:"size-4"})})}),t]})}function WIe({...e}){return g.jsx(DIe,{"data-slot":"dropdown-menu-radio-group",...e})}function YIe({className:e,children:t,...a}){return g.jsxs(qIe,{"data-slot":"dropdown-menu-radio-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(XZ,{children:g.jsx(Dl,{className:"size-2 fill-current"})})}),t]})}function XIe({className:e,inset:t,...a}){return g.jsx(EIe,{"data-slot":"dropdown-menu-label","data-inset":t,className:Q("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function KIe({className:e,...t}){return g.jsx(zIe,{"data-slot":"dropdown-menu-separator",className:Q("bg-border -mx-1 my-1 h-px",e),...t})}function QIe({className:e,...t}){return g.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function JIe({...e}){return g.jsx(TIe,{"data-slot":"dropdown-menu-sub",...e})}function eAe({className:e,inset:t,children:a,...r}){return g.jsxs($Ie,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[a,g.jsx(Ga,{className:"ml-auto size-4"})]})}function tAe({className:e,...t}){return g.jsx(OIe,{"data-slot":"dropdown-menu-sub-content",className:Q("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function hz({className:e,type:t,...a}){return g.jsx("input",{type:t,"data-slot":"input",className:Q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:[&::-webkit-calendar-picker-indicator]:invert",e),...a})}var nAe=Object.defineProperty,aAe=(e,t)=>nAe(e,"name",{value:t,configurable:!0}),oAe=m.forwardRef(aAe(function(t,a){return g.jsx(we.label,{...t,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));function UA({className:e,...t}){return g.jsx(oAe,{"data-slot":"label",className:Q("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var rAe=Object.defineProperty,nn=(e,t)=>rAe(e,"name",{value:t,configurable:!0}),iAe={RTL:"rtl"},Pj="Menubar",[kD,cAe,sAe]=Md(Pj),[KZ,IDe]=Vt(Pj,[sAe,Sd]),_n=M2(),QZ=Sd(),[lAe,pz]=KZ(Pj),dAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,value:c,onValueChange:s,defaultValue:u,loop:h=!0,dir:y,...p}=t,b=Yl(y),k=QZ(r),[x,M]=Wt({prop:c,onChange:s,defaultProp:u??"",caller:Pj}),[_,C]=m.useState(null);return g.jsx(lAe,{scope:r,value:x,onMenuOpen:m.useCallback(S=>{M(S),C(S)},[M]),onMenuClose:m.useCallback(()=>M(""),[M]),onMenuToggle:m.useCallback(S=>{M(L=>L?"":S),C(S)},[M]),dir:b,loop:h,children:g.jsx(kD.Provider,{scope:r,children:g.jsx(kD.Slot,{scope:r,children:g.jsx(Bq,{asChild:!0,...k,orientation:"horizontal",loop:h,dir:b,currentTabStopId:_,onCurrentTabStopIdChange:C,children:g.jsx(we.div,{role:"menubar",...p,ref:a})})})})})},"Menubar")),JZ="MenubarMenu",[uAe,eW]=KZ(JZ),hAe=nn(e=>{const{__scopeMenubar:t,value:a,...r}=e,c=pt(),s=a||c||"LEGACY_REACT_AUTO_VALUE",u=pz(JZ,t),h=_n(t),y=m.useRef(null),p=m.useRef(!1),b=u.value===s;return m.useEffect(()=>{b||(p.current=!1)},[b]),g.jsx(uAe,{scope:t,value:s,triggerId:pt(),triggerRef:y,contentId:pt(),wasKeyboardTriggerOpenRef:p,children:g.jsx(Gq,{...h,open:b,onOpenChange:k=>{k||u.onMenuClose()},modal:!1,dir:u.dir,...r})})},"MenubarMenu"),xB="MenubarTrigger",pAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,disabled:c=!1,...s}=t,u=QZ(r),h=_n(r),y=pz(xB,r),p=eW(xB,r),b=m.useRef(null),k=Pe(a,b,p.triggerRef),[x,M]=m.useState(!1),_=y.value===p.value;return g.jsx(kD.ItemSlot,{scope:r,value:p.value,disabled:c,children:g.jsx(Fq,{asChild:!0,...u,focusable:!c,tabStopId:p.value,children:g.jsx(Ij,{asChild:!0,...h,children:g.jsx(we.button,{type:"button",role:"menuitem",id:p.triggerId,"aria-haspopup":"menu","aria-expanded":_,"aria-controls":_?p.contentId:void 0,"data-highlighted":x?"":void 0,"data-state":_?"open":"closed","data-disabled":c?"":void 0,disabled:c,...s,ref:k,onPointerDown:ye(t.onPointerDown,C=>{!c&&C.button===0&&C.ctrlKey===!1&&(y.onMenuOpen(p.value),_||C.preventDefault())}),onPointerEnter:ye(t.onPointerEnter,()=>{y.value&&!_&&(y.onMenuOpen(p.value),b.current?.focus())}),onKeyDown:ye(t.onKeyDown,C=>{c||(["Enter"," "].includes(C.key)&&y.onMenuToggle(p.value),C.key==="ArrowDown"&&y.onMenuOpen(p.value),["Enter"," ","ArrowDown"].includes(C.key)&&(p.wasKeyboardTriggerOpenRef.current=!0,C.preventDefault()))}),onFocus:ye(t.onFocus,()=>M(!0)),onBlur:ye(t.onBlur,()=>M(!1))})})})})},"MenubarTrigger")),fAe=nn(e=>{const{__scopeMenubar:t,...a}=e,r=_n(t);return g.jsx(Zq,{...r,...a})},"MenubarPortal"),MB="MenubarContent",yAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,align:c="start",...s}=t,u=_n(r),h=pz(MB,r),y=eW(MB,r),p=cAe(r),b=m.useRef(!1);return g.jsx(Yq,{id:y.contentId,"aria-labelledby":y.triggerId,"data-radix-menubar-content":"",...u,...s,ref:a,align:c,onCloseAutoFocus:ye(t.onCloseAutoFocus,k=>{!h.value&&!b.current&&y.triggerRef.current?.focus(),b.current=!1,k.preventDefault()}),onFocusOutside:ye(t.onFocusOutside,k=>{const x=k.target;p().some(_=>_.ref.current?.contains(x))&&k.preventDefault()}),onInteractOutside:ye(t.onInteractOutside,()=>{b.current=!0}),onEntryFocus:k=>{y.wasKeyboardTriggerOpenRef.current||k.preventDefault()},onKeyDown:ye(t.onKeyDown,k=>{if(["ArrowRight","ArrowLeft"].includes(k.key)){const x=k.target,M=x.hasAttribute("data-radix-menubar-subtrigger"),_=x.closest("[data-radix-menubar-content]")!==k.currentTarget,S=(h.dir===iAe.RTL?"ArrowRight":"ArrowLeft")===k.key;if(!S&&M||_&&S)return;let N=p().filter(R=>!R.disabled).map(R=>R.value);S&&N.reverse();const j=N.indexOf(y.value);N=h.loop?nW(N,j+1):N.slice(j+1);const[T]=N;T&&h.onMenuOpen(T)}},{checkForDefaultPrevented:!1}),style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})},"MenubarContent")),mAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Aj,{...s,...c,ref:a})},"MenubarGroup")),gAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Kq,{...s,...c,ref:a})},"MenubarLabel")),kAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(_2,{...s,...c,ref:a})},"MenubarItem")),vAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Qq,{...s,...c,ref:a})},"MenubarCheckboxItem")),bAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(Jq,{...s,...c,ref:a})},"MenubarRadioGroup")),xAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(ez,{...s,...c,ref:a})},"MenubarRadioItem")),tW=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(tz,{...s,...c,ref:a})},"MenubarItemIndicator")),MAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(nz,{...s,...c,ref:a})},"MenubarSeparator")),wAe="MenubarSub",_Ae=nn(e=>{const{__scopeMenubar:t,children:a,open:r,onOpenChange:c,defaultOpen:s}=e,u=_n(t),[h,y]=Wt({prop:r,defaultProp:s??!1,onChange:c,caller:wAe});return g.jsx(az,{...u,open:h,onOpenChange:y,children:a})},"MenubarSub"),SAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(oz,{"data-radix-menubar-subtrigger":"",...s,...c,ref:a})},"MenubarSubTrigger")),CAe=m.forwardRef(nn(function(t,a){const{__scopeMenubar:r,...c}=t,s=_n(r);return g.jsx(rz,{...s,"data-radix-menubar-content":"",...c,ref:a,style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})},"MenubarSubContent"));function nW(e,t){return e.map((a,r)=>e[(t+r)%e.length])}nn(nW,"wrapArray");function LAe({className:e,...t}){return g.jsx(dAe,{"data-slot":"menubar",className:Q("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function NAe({...e}){return g.jsx(hAe,{"data-slot":"menubar-menu",...e})}function IAe({...e}){return g.jsx(mAe,{"data-slot":"menubar-group",...e})}function aW({...e}){return g.jsx(fAe,{"data-slot":"menubar-portal",...e})}function AAe({...e}){return g.jsx(bAe,{"data-slot":"menubar-radio-group",...e})}function jAe({className:e,...t}){return g.jsx(pAe,{"data-slot":"menubar-trigger",className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",e),...t})}function EAe({className:e,align:t="start",alignOffset:a=-4,sideOffset:r=8,...c}){return g.jsx(aW,{children:g.jsx(yAe,{"data-slot":"menubar-content",align:t,alignOffset:a,sideOffset:r,className:Q("bg-popover text-popover-foreground data-[state=open]:animate-in 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 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",e),...c})})}function PAe({className:e,inset:t,variant:a="default",...r}){return g.jsx(kAe,{"data-slot":"menubar-item","data-inset":t,"data-variant":a,className:Q("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function RAe({className:e,children:t,checked:a,...r}){return g.jsxs(vAe,{"data-slot":"menubar-checkbox-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(tW,{children:g.jsx(Ua,{className:"size-4"})})}),t]})}function DAe({className:e,children:t,...a}){return g.jsxs(xAe,{"data-slot":"menubar-radio-item",className:Q("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(tW,{children:g.jsx(Dl,{className:"size-2 fill-current"})})}),t]})}function qAe({className:e,inset:t,...a}){return g.jsx(gAe,{"data-slot":"menubar-label","data-inset":t,className:Q("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function zAe({className:e,...t}){return g.jsx(MAe,{"data-slot":"menubar-separator",className:Q("bg-border -mx-1 my-1 h-px",e),...t})}function TAe({className:e,...t}){return g.jsx("span",{"data-slot":"menubar-shortcut",className:Q("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function $Ae({...e}){return g.jsx(_Ae,{"data-slot":"menubar-sub",...e})}function OAe({className:e,inset:t,children:a,...r}){return g.jsxs(SAe,{"data-slot":"menubar-sub-trigger","data-inset":t,className:Q("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",e),...r,children:[a,g.jsx(Ga,{className:"ml-auto h-4 w-4"})]})}function HAe({className:e,...t}){return g.jsx(CAe,{"data-slot":"menubar-sub-content",className:Q("bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function VAe({className:e,...t}){return g.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Q("mx-auto flex w-full justify-center",e),...t})}function BAe({className:e,...t}){return g.jsx("ul",{"data-slot":"pagination-content",className:Q("flex flex-row items-center gap-1",e),...t})}function FAe({...e}){return g.jsx("li",{"data-slot":"pagination-item",...e})}function fz({className:e,isActive:t,size:a="icon",...r}){return g.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Q(zA({variant:t?"outline":"ghost",size:a}),e),...r})}function UAe({className:e,label:t="Previous",...a}){return g.jsxs(fz,{"aria-label":t,size:"default",className:Q("gap-1 px-2.5 sm:pl-2.5",e),...a,children:[g.jsx(rd,{}),g.jsx("span",{className:"hidden sm:block",children:t})]})}function GAe({className:e,label:t="Next",...a}){return g.jsxs(fz,{"aria-label":t,size:"default",className:Q("gap-1 px-2.5 sm:pr-2.5",e),...a,children:[g.jsx("span",{className:"hidden sm:block",children:t}),g.jsx(Ga,{})]})}function ZAe({className:e,...t}){return g.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:Q("flex size-9 items-center justify-center",e),...t,children:[g.jsx(xo,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]})}var WAe=Object.defineProperty,Xa=(e,t)=>WAe(e,"name",{value:t,configurable:!0}),yz="Popover",[oW,ADe]=Vt(yz,[Ar]),Rj=Ar(),[YAe,Ql]=oW(yz),XAe=Xa(e=>{const{__scopePopover:t,children:a,open:r,defaultOpen:c,onOpenChange:s,modal:u=!1}=e,h=Rj(t),y=m.useRef(null),[p,b]=m.useState(!1),[k,x]=m.useState(0),[M,_]=m.useState(0),[C,S]=Wt({prop:r,defaultProp:c??!1,onChange:s,caller:yz});return g.jsx(b2,{...h,children:g.jsx(YAe,{scope:t,contentId:pt(),titleId:pt(),descriptionId:pt(),titlePresent:k>0,descriptionPresent:M>0,setTitleCount:x,setDescriptionCount:_,triggerRef:y,open:C,onOpenChange:S,onOpenToggle:m.useCallback(()=>S(L=>!L),[S]),hasCustomAnchor:p,onCustomAnchorAdd:m.useCallback(()=>b(!0),[]),onCustomAnchorRemove:m.useCallback(()=>b(!1),[]),modal:u,children:a})})},"Popover"),KAe="PopoverAnchor",QAe=m.forwardRef(Xa(function(t,a){const{__scopePopover:r,...c}=t,s=Ql(KAe,r),u=Rj(r),{onCustomAnchorAdd:h,onCustomAnchorRemove:y}=s;return m.useEffect(()=>(h(),()=>y()),[h,y]),g.jsx(x2,{...u,...c,ref:a})},"PopoverAnchor")),JAe="PopoverTrigger",eje=m.forwardRef(Xa(function(t,a){const{__scopePopover:r,...c}=t,s=Ql(JAe,r),u=Rj(r),h=Pe(a,s.triggerRef),y=g.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":mz(s.open),...c,ref:h,onClick:ye(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?y:g.jsx(x2,{asChild:!0,...u,children:y})},"PopoverTrigger")),rW="PopoverPortal",[tje,nje]=oW(rW,{forceMount:void 0}),aje=Xa(e=>{const{__scopePopover:t,forceMount:a,children:r,container:c}=e,s=Ql(rW,t);return g.jsx(tje,{scope:t,forceMount:a,children:g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:r})})})},"PopoverPortal"),i2="PopoverContent",oje=m.forwardRef(Xa(function(t,a){const r=nje(i2,t.__scopePopover),{forceMount:c=r.forceMount,...s}=t,u=Ql(i2,t.__scopePopover);return g.jsx(bn,{present:c||u.open,children:u.modal?g.jsx(ije,{...s,ref:a}):g.jsx(cje,{...s,ref:a})})},"PopoverContent")),rje=Ca("PopoverContent.RemoveScroll"),ije=m.forwardRef(Xa(function(t,a){const r=Ql(i2,t.__scopePopover),c=m.useRef(null),s=Pe(a,c),u=m.useRef(!1),{nodes:h,registry:y}=sj();return m.useEffect(()=>{const p=c.current;if(p)return uj(p)},[]),g.jsx(k2,{as:rje,allowPinchZoom:!0,shards:m.useMemo(()=>[c,...h.map(p=>({current:p}))],[c,h]),children:g.jsx(iW,{...t,ref:s,branchNodes:h,branchRegistry:y,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(t.onCloseAutoFocus,p=>{p.preventDefault(),u.current||r.triggerRef.current?.focus()}),onPointerDownOutside:ye(t.onPointerDownOutside,p=>{const b=p.detail.originalEvent,k=b.button===0&&b.ctrlKey===!0,x=b.button===2||k;u.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:ye(t.onFocusOutside,p=>p.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),cje=m.forwardRef(Xa(function(t,a){const r=Ql(i2,t.__scopePopover),c=m.useRef(!1),s=m.useRef(!1);return g.jsx(iW,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{t.onCloseAutoFocus?.(u),u.defaultPrevented||(c.current||r.triggerRef.current?.focus(),u.preventDefault()),c.current=!1,s.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&s.current&&u.preventDefault()}})},"PopoverContentNonModal")),iW=m.forwardRef(Xa(function(t,a){const{__scopePopover:r,trapFocus:c,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEscapeKeyDown:y,onPointerDownOutside:p,onFocusOutside:b,onInteractOutside:k,"aria-describedby":x,branchNodes:M,branchRegistry:_,...C}=t,S=Ql(i2,r),L=Rj(r),[A,N]=m.useState(null),j=Pe(a,N);return lj(A),xd(),g.jsx(cj,{registry:_,children:g.jsx(ij,{asChild:!0,loop:!0,trapped:c,branches:M,onMountAutoFocus:s,onUnmountAutoFocus:u,children:g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:k,onEscapeKeyDown:y,onPointerDownOutside:p,onFocusOutside:b,onDismiss:()=>S.onOpenChange(!1),deferPointerDownOutside:!0,children:g.jsx(_j,{"data-state":mz(S.open),role:"dialog",id:S.contentId,"aria-labelledby":S.titlePresent?S.titleId:void 0,"aria-describedby":S.descriptionPresent?cW(x,S.descriptionId):x,...L,...C,ref:j,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function mz(e){return e?"open":"closed"}Xa(mz,"getState");function cW(...e){const t=new Set;for(const a of e)if(typeof a=="string")for(const r of String(a).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Xa(cW,"concatAriaDescribedby");function sW({...e}){return g.jsx(XAe,{"data-slot":"popover",...e})}function lW({...e}){return g.jsx(eje,{"data-slot":"popover-trigger",...e})}function dW({className:e,align:t="center",sideOffset:a=4,...r}){return g.jsx(aje,{children:g.jsx(oje,{"data-slot":"popover-content",align:t,sideOffset:a,className:Q("bg-popover text-popover-foreground 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 z-[1100] w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function sje({...e}){return g.jsx(QAe,{"data-slot":"popover-anchor",...e})}var lje=Object.defineProperty,dje=(e,t)=>lje(e,"name",{value:t,configurable:!0});function yd(e,[t,a]){return Math.min(a,Math.max(t,e))}dje(yd,"clamp");var uje=Object.defineProperty,hje=(e,t)=>uje(e,"name",{value:t,configurable:!0}),uW=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"}),pje=m.forwardRef(hje(function(t,a){return g.jsx(we.span,{...t,ref:a,style:{...uW,...t.style}})},"VisuallyHidden")),fje=Object.defineProperty,Ue=(e,t)=>fje(e,"name",{value:t,configurable:!0}),wB={ItemAligned:"item-aligned",Popper:"popper"},yje={RTL:"rtl"},mje=[" ","Enter","ArrowUp","ArrowDown"],gje=[" ","Enter"],md="Select",[Dj,qj,kje]=Md(md),[Jl,jDe]=Vt(md,[kje,Ar]),gz=Ar(),[vje,Er]=Jl(md),[bje,xje]=Jl(md);function hW(e){const{__scopeSelect:t,children:a,open:r,defaultOpen:c,onOpenChange:s,value:u,defaultValue:h,onValueChange:y,dir:p,name:b,autoComplete:k,disabled:x,required:M,form:_,internal_do_not_use_render:C}=e,S=gz(t),[L,A]=m.useState(null),[N,j]=m.useState(null),[T,R]=m.useState(!1),q=Yl(p),[$,ee]=Wt({prop:r,defaultProp:c??!1,onChange:s,caller:md}),[re,F]=Wt({prop:u,defaultProp:h,onChange:y,caller:md}),G=m.useRef(null),X=m.useRef(!1),[ae,he]=m.useState(null),P=Ue(U=>{he({value:U,hasConsumerStoppedPropagation:X.current}),F(U)},"handleUserSelect"),E=m.useRef(re);m.useEffect(()=>{const U=_?L?.ownerDocument.getElementById(_):L?.form;if(U instanceof HTMLFormElement){const de=Ue(()=>F(E.current),"reset");return U.addEventListener("reset",de),()=>U.removeEventListener("reset",de)}},[_,L,F]);const O=L?!!_||!!L.closest("form"):!0,[Y,V]=m.useState(new Set),D=pt(),z=Array.from(Y).map(U=>U.props.value).join(";"),J=m.useCallback(U=>{V(de=>new Set(de).add(U))},[]),K=m.useCallback(U=>{V(de=>{const ke=new Set(de);return ke.delete(U),ke})},[]),W={required:M,trigger:L,onTriggerChange:A,valueNode:N,onValueNodeChange:j,valueNodeHasChildren:T,onValueNodeHasChildrenChange:R,contentId:D,value:re,onValueChange:F,hasConsumerStoppedPropagationRef:X,userSelection:ae,onUserSelect:P,open:$,onOpenChange:ee,dir:q,triggerPointerDownPosRef:G,disabled:x,name:b,autoComplete:k,form:_,nativeOptions:Y,nativeSelectKey:z,isFormControl:O};return g.jsx(b2,{...S,children:g.jsx(vje,{scope:t,...W,children:g.jsx(Dj.Provider,{scope:t,children:g.jsx(bje,{scope:t,onNativeOptionAdd:J,onNativeOptionRemove:K,children:mW(C)?C(W):a})})})})}Ue(hW,"SelectProvider");var Mje=Ue(e=>{const{__scopeSelect:t,children:a,...r}=e;return g.jsx(hW,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:c})=>g.jsxs(g.Fragment,{children:[a,c?g.jsx(eEe,{__scopeSelect:t}):null]})})},"Select"),wje="SelectTrigger",_je=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,disabled:c=!1,...s}=t,u=gz(r),h=Er(wje,r),y=h.disabled||c,p=Pe(a,h.onTriggerChange),b=qj(r),k=m.useRef("touch"),[x,M,_]=vz(S=>{const L=b().filter(j=>!j.disabled),A=L.find(j=>j.value===h.value),N=bz(L,S,A);N!==void 0&&h.onUserSelect(N.value)}),C=Ue(S=>{y||(h.onOpenChange(!0),_()),S&&(h.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})},"handleOpen");return g.jsx(x2,{asChild:!0,...u,children:g.jsx(we.button,{type:"button",role:"combobox","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:y,"data-disabled":y?"":void 0,"data-placeholder":S2(h.value)?"":void 0,...s,ref:p,onClick:ye(s.onClick,S=>{S.currentTarget.focus(),k.current!=="mouse"&&C(S)}),onPointerDown:ye(s.onPointerDown,S=>{k.current=S.pointerType;const L=S.target;L.hasPointerCapture(S.pointerId)&&L.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:ye(s.onKeyDown,S=>{const L=x.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&(h.hasConsumerStoppedPropagationRef.current=S.isPropagationStopped(),M(S.key)),!(L&&S.key===" ")&&mje.includes(S.key)&&(C(),S.preventDefault())})})})},"SelectTrigger")),Sje="SelectValue",Cje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,className:c,style:s,children:u,placeholder:h="",...y}=t,p=Er(Sje,r),{onValueNodeHasChildrenChange:b}=p,k=u!==void 0,x=Pe(a,p.onValueNodeChange);ht(()=>{b(k)},[b,k]);const M=S2(p.value);return g.jsx(we.span,{...y,asChild:M?!1:y.asChild,ref:x,style:{pointerEvents:"none"},children:g.jsx(m.Fragment,{children:M?h:u},M?"placeholder":"value")})},"SelectValue")),Lje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,children:c,...s}=t;return g.jsx(we.span,{"aria-hidden":!0,...s,ref:a,children:c||"▼"})},"SelectIcon")),Nje="SelectPortal",[Ije,Aje]=Jl(Nje,{forceMount:void 0}),jje=Ue(e=>{const{__scopeSelect:t,forceMount:a,...r}=e;return g.jsx(Ije,{scope:e.__scopeSelect,forceMount:a,children:g.jsx(Zl,{asChild:!0,...r})})},"SelectPortal"),Bl="SelectContent",Eje=m.forwardRef(Ue(function(t,a){const r=Aje(Bl,t.__scopeSelect),{forceMount:c=r.forceMount,...s}=t,u=Er(Bl,t.__scopeSelect),[h,y]=m.useState();return ht(()=>{y(new DocumentFragment)},[]),g.jsx(bn,{present:c||u.open,children:({present:p})=>p?g.jsx(Dje,{...s,ref:a}):g.jsx(Pje,{...s,fragment:h})})},"SelectContent")),Pje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,children:c,fragment:s}=t;return s?No.createPortal(g.jsx(pW,{scope:r,children:g.jsx(Dj.Slot,{scope:r,children:g.jsx("div",{ref:a,children:c})})}),s):null},"SelectContentFragment")),Ma=10,[pW,e1]=Jl(Bl),Rje=Ca("SelectContent.RemoveScroll"),Dje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r}=t,{position:c=wB.ItemAligned,onCloseAutoFocus:s,onEscapeKeyDown:u,onPointerDownOutside:h,side:y,sideOffset:p,align:b,alignOffset:k,arrowPadding:x,collisionBoundary:M,collisionPadding:_,sticky:C,hideWhenDetached:S,avoidCollisions:L,...A}=t,N=Er(Bl,r),[j,T]=m.useState(null),[R,q]=m.useState(null),$=Pe(a,T),[ee,re]=m.useState(null),[F,G]=m.useState(null),X=qj(r),[ae,he]=m.useState(!1),P=m.useRef(!1),E=m.useRef(!1),O=m.useRef(!1);m.useEffect(()=>{if(j)return uj(j)},[j]),xd();const Y=m.useCallback(pe=>{const[be,...Ie]=X().map(Ae=>Ae.ref.current),[_e]=Ie.slice(-1),Me=document.activeElement;for(const Ae of pe)if(Ae===Me||(Ae?.scrollIntoView({block:"nearest"}),Ae===be&&R&&(R.scrollTop=0),Ae===_e&&R&&(R.scrollTop=R.scrollHeight),Ae?.focus(),document.activeElement!==Me))return},[X,R]),V=m.useCallback(()=>Y([ee,j]),[Y,ee,j]);m.useEffect(()=>{ae&&V()},[ae,V]);const{onOpenChange:D,triggerPointerDownPosRef:z}=N;m.useEffect(()=>{if(j){let pe={x:0,y:0};const be=Ue(_e=>{pe={x:Math.abs(Math.round(_e.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(_e.pageY)-(z.current?.y??0))}},"handlePointerMove"),Ie=Ue(_e=>{pe.x<=10&&pe.y<=10?_e.preventDefault():_e.composedPath().includes(j)||D(!1),document.removeEventListener("pointermove",be),z.current=null},"handlePointerUp");return z.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[j,D,z]),m.useEffect(()=>{const pe=Ue(()=>D(!1),"close");return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[D]);const[J,K]=vz(pe=>{const be=X().filter(Me=>!Me.disabled),Ie=be.find(Me=>Me.ref.current===document.activeElement),_e=bz(be,pe,Ie);_e&&setTimeout(()=>_e.ref.current?.focus())}),W=m.useCallback((pe,be,Ie)=>{const _e=!E.current;_e&&(E.current=!0);const Me=!P.current&&!Ie;N.value!==void 0&&N.value===be||Me?(re(pe),Me&&(P.current=!0)):_e&&re(pe)},[N.value]),U=m.useCallback(()=>j?.focus(),[j]),de=m.useCallback((pe,be,Ie)=>{if(!pe)return;const _e=!O.current;_e&&(O.current=!0);const Me=!P.current&&!Ie;(N.value!==void 0&&N.value===be||Me||_e)&&G(pe)},[N.value]),ke=c===wB.Popper?_B:qje,ie=ke===_B?{side:y,sideOffset:p,align:b,alignOffset:k,arrowPadding:x,collisionBoundary:M,collisionPadding:_,sticky:C,hideWhenDetached:S,avoidCollisions:L}:{};return g.jsx(pW,{scope:r,content:j,viewport:R,onViewportChange:q,itemRefCallback:W,selectedItem:ee,onItemLeave:U,itemTextRefCallback:de,focusSelectedItem:V,selectedItemText:F,position:c,isPositioned:ae,searchRef:J,children:g.jsx(k2,{as:Rje,allowPinchZoom:!0,children:g.jsx(ij,{asChild:!0,trapped:N.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:ye(s,pe=>{N.trigger?.focus({preventScroll:!0}),pe.preventDefault()}),children:g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:g.jsx(ke,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:pe=>pe.preventDefault(),...A,...ie,onPlaced:()=>he(!0),ref:$,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:ye(A.onKeyDown,pe=>{const be=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!be&&pe.key.length===1&&K(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let _e=X().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const Me=pe.target,Ae=_e.indexOf(Me);_e=_e.slice(Ae+1)}setTimeout(()=>Y(_e)),pe.preventDefault()}})})})})})})},"SelectContentImpl")),qje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,onPlaced:c,...s}=t,u=Er(Bl,r),h=e1(Bl,r),[y,p]=m.useState(null),[b,k]=m.useState(null),x=Pe(a,k),M=qj(r),_=m.useRef(!1),C=m.useRef(!0),{viewport:S,selectedItem:L,selectedItemText:A,focusSelectedItem:N}=h,j=m.useCallback(()=>{if(u.trigger&&u.valueNode&&y&&b&&S&&L&&A){const $=u.trigger.getBoundingClientRect(),ee=b.getBoundingClientRect(),re=u.valueNode.getBoundingClientRect(),F=A.getBoundingClientRect();if(u.dir!==yje.RTL){const Ie=F.left-ee.left,_e=re.left-Ie,Me=$.left-_e,Ae=$.width+Me,Lt=Math.max(Ae,ee.width),vt=window.innerWidth-Ma,ve=yd(_e,[Ma,Math.max(Ma,vt-Lt)]);y.style.minWidth=Ae+"px",y.style.left=ve+"px"}else{const Ie=ee.right-F.right,_e=window.innerWidth-re.right-Ie,Me=window.innerWidth-$.right-_e,Ae=$.width+Me,Lt=Math.max(Ae,ee.width),vt=window.innerWidth-Ma,ve=yd(_e,[Ma,Math.max(Ma,vt-Lt)]);y.style.minWidth=Ae+"px",y.style.right=ve+"px"}const G=M(),X=window.innerHeight-Ma*2,ae=S.scrollHeight,he=window.getComputedStyle(b),P=parseInt(he.borderTopWidth,10),E=parseInt(he.paddingTop,10),O=parseInt(he.borderBottomWidth,10),Y=parseInt(he.paddingBottom,10),V=P+E+ae+Y+O,D=Math.min(L.offsetHeight*5,V),z=window.getComputedStyle(S),J=parseInt(z.paddingTop,10),K=parseInt(z.paddingBottom,10),W=$.top+$.height/2-Ma,U=X-W,de=L.offsetHeight/2,ke=L.offsetTop+de,ie=P+E+ke,pe=V-ie;if(ie<=W){const Ie=G.length>0&&L===G[G.length-1].ref.current;y.style.bottom="0px";const _e=b.clientHeight-S.offsetTop-S.offsetHeight,Me=Math.max(U,de+(Ie?K:0)+_e+O),Ae=ie+Me;y.style.height=Ae+"px"}else{const Ie=G.length>0&&L===G[0].ref.current;y.style.top="0px";const Me=Math.max(W,P+S.offsetTop+(Ie?J:0)+de)+pe;y.style.height=Me+"px",S.scrollTop=ie-W+S.offsetTop}y.style.margin=`${Ma}px 0`,y.style.minHeight=D+"px",y.style.maxHeight=X+"px",c?.(),requestAnimationFrame(()=>_.current=!0)}},[M,u.trigger,u.valueNode,y,b,S,L,A,u.dir,c]);ht(()=>j(),[j]);const[T,R]=m.useState();ht(()=>{b&&R(window.getComputedStyle(b).zIndex)},[b]);const q=m.useCallback($=>{$&&C.current===!0&&(j(),N?.(),C.current=!1)},[j,N]);return g.jsx(zje,{scope:r,contentWrapper:y,shouldExpandOnScrollRef:_,onScrollButtonChange:q,children:g.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:g.jsx(we.div,{...s,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),_B=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,align:c="start",collisionPadding:s=Ma,...u}=t,h=gz(r);return g.jsx(_j,{...h,...u,ref:a,align:c,collisionPadding:s,style:{boxSizing:"border-box",...u.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)"}})},"SelectPopperPosition")),[zje,kz]=Jl(Bl,{}),SB="SelectViewport",Tje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,nonce:c,...s}=t,u=e1(SB,r),h=kz(SB,r),y=Pe(a,u.onViewportChange),p=m.useRef(0);return g.jsxs(g.Fragment,{children:[g.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:c}),g.jsx(Dj.Slot,{scope:r,children:g.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:y,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ye(s.onScroll,b=>{const k=b.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:M}=h;if(M?.current&&x){const _=Math.abs(p.current-k.scrollTop);if(_>0){const C=window.innerHeight-Ma*2,S=parseFloat(x.style.minHeight),L=parseFloat(x.style.height),A=Math.max(S,L);if(A<C){const N=A+_,j=Math.min(C,N),T=N-j;x.style.height=j+"px",x.style.bottom==="0px"&&(k.scrollTop=T>0?T:0,x.style.justifyContent="flex-end")}}}p.current=k.scrollTop})})})]})},"SelectViewport")),$je="SelectGroup",[Oje,Hje]=Jl($je),Vje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t,s=pt();return g.jsx(Oje,{scope:r,id:s,children:g.jsx(we.div,{role:"group","aria-labelledby":s,...c,ref:a})})},"SelectGroup")),Bje="SelectLabel",Fje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t,s=Hje(Bje,r);return g.jsx(we.div,{id:s.id,...c,ref:a})},"SelectLabel")),vD="SelectItem",[Uje,fW]=Jl(vD),Gje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,value:c,disabled:s=!1,textValue:u,...h}=t,y=Er(vD,r),p=e1(vD,r),b=y.value===c,[k,x]=m.useState(u??""),[M,_]=m.useState(!1),C=vn(j=>p.itemRefCallback?.(j,c,s)),S=Pe(a,C),L=pt(),A=m.useRef("touch");function N(j){y.hasConsumerStoppedPropagationRef.current=j.isPropagationStopped(),y.onUserSelect(c),y.onOpenChange(!1)}return Ue(N,"handleSelect"),g.jsx(Uje,{scope:r,value:c,disabled:s,textId:L,isSelected:b,onItemTextChange:m.useCallback(j=>{x(T=>T||(j?.textContent??"").trim())},[]),children:g.jsx(Dj.ItemSlot,{scope:r,value:c,disabled:s,textValue:k,children:g.jsx(we.div,{role:"option","aria-labelledby":L,"data-highlighted":M?"":void 0,"aria-selected":b&&M,"data-state":b?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...h,ref:S,onFocus:ye(h.onFocus,()=>_(!0)),onBlur:ye(h.onBlur,()=>_(!1)),onClick:ye(h.onClick,j=>{s||A.current!=="mouse"&&N(j)}),onPointerUp:ye(h.onPointerUp,j=>{s||A.current==="mouse"&&N(j)}),onPointerDown:ye(h.onPointerDown,j=>{A.current=j.pointerType}),onPointerMove:ye(h.onPointerMove,j=>{A.current=j.pointerType,s?p.onItemLeave?.():A.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(h.onPointerLeave,j=>{j.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:ye(h.onKeyDown,j=>{s||j.target!==j.currentTarget||p.searchRef?.current!==""&&j.key===" "||(gje.includes(j.key)&&N(j),j.key===" "&&j.preventDefault())})})})})},"SelectItem")),oh="SelectItemText",Zje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,className:c,style:s,...u}=t,h=Er(oh,r),y=e1(oh,r),p=fW(oh,r),b=xje(oh,r),[k,x]=m.useState(null),M=vn(N=>y.itemTextRefCallback?.(N,p.value,p.disabled)),_=Pe(a,x,p.onItemTextChange,M),C=k?.textContent,S=m.useMemo(()=>g.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:L,onNativeOptionRemove:A}=b;return ht(()=>(L(S),()=>A(S)),[L,A,S]),g.jsxs(g.Fragment,{children:[g.jsx(we.span,{id:p.textId,...u,ref:_}),p.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!S2(h.value)?No.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),Wje="SelectItemIndicator",Yje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t;return fW(Wje,r).isSelected?g.jsx(we.span,{"aria-hidden":!0,...c,ref:a}):null},"SelectItemIndicator")),CB="SelectScrollUpButton",Xje=m.forwardRef(Ue(function(t,a){const r=e1(CB,t.__scopeSelect),c=kz(CB,t.__scopeSelect),[s,u]=m.useState(!1),h=Pe(a,c.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let y=function(){const b=p.scrollTop>0;u(b)};Ue(y,"handleScroll");const p=r.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[r.viewport,r.isPositioned]),s?g.jsx(yW,{...t,ref:h,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=r;y&&p&&(y.scrollTop=y.scrollTop-p.offsetHeight)}}):null},"SelectScrollUpButton")),LB="SelectScrollDownButton",Kje=m.forwardRef(Ue(function(t,a){const r=e1(LB,t.__scopeSelect),c=kz(LB,t.__scopeSelect),[s,u]=m.useState(!1),h=Pe(a,c.onScrollButtonChange);return ht(()=>{if(r.viewport&&r.isPositioned){let y=function(){const b=p.scrollHeight-p.clientHeight,k=Math.ceil(p.scrollTop)<b;u(k)};Ue(y,"handleScroll");const p=r.viewport;return y(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[r.viewport,r.isPositioned]),s?g.jsx(yW,{...t,ref:h,onAutoScroll:()=>{const{viewport:y,selectedItem:p}=r;y&&p&&(y.scrollTop=y.scrollTop+p.offsetHeight)}}):null},"SelectScrollDownButton")),yW=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,onAutoScroll:c,...s}=t,u=e1("SelectScrollButton",r),h=m.useRef(null),y=qj(r),p=m.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return m.useEffect(()=>()=>p(),[p]),ht(()=>{y().find(k=>k.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[y]),g.jsx(we.div,{"aria-hidden":!0,...s,ref:a,style:{flexShrink:0,...s.style},onPointerDown:ye(s.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(c,50))}),onPointerMove:ye(s.onPointerMove,()=>{u.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(c,50))}),onPointerLeave:ye(s.onPointerLeave,()=>{p()})})},"SelectScrollButtonImpl")),Qje=m.forwardRef(Ue(function(t,a){const{__scopeSelect:r,...c}=t;return g.jsx(we.div,{"aria-hidden":!0,...c,ref:a})},"SelectSeparator")),Jje="SelectBubbleInput",eEe=m.forwardRef(Ue(function({__scopeSelect:t,...a},r){const c=Er(Jje,t),{value:s,onValueChange:u,required:h,disabled:y,name:p,autoComplete:b,form:k,userSelection:x}=c,{nativeOptions:M,nativeSelectKey:_}=c,C=m.useRef(null),S=Pe(r,C),L=s??"",A=m.useRef(L),N=m.useRef(x),j=m.useRef(!1),T=Array.from(M).some(R=>(R.props.value??"")==="");return m.useEffect(()=>{const R=C.current;if(!R)return;const q=window.HTMLSelectElement.prototype,ee=Object.getOwnPropertyDescriptor(q,"value").set,re=x!==null&&x!==N.current;N.current=x;const F=A.current!==L;A.current=L;const G=re&&F;if(re&&!F&&x.value!==L&&!x.hasConsumerStoppedPropagation&&ee){j.current=!0;try{ee.call(R,x.value),R.dispatchEvent(new Event("change",{bubbles:!0}))}finally{j.current=!1,ee.call(R,L)}return}const X=G&&!x.hasConsumerStoppedPropagation;if(F&&ee){const ae=new Event("change",{bubbles:X});ee.call(R,L),R.dispatchEvent(ae)}},[L,x]),g.jsxs(we.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:p,autoComplete:b,disabled:y,form:k,onChange:R=>{j.current||u(R.target.value)},...a,style:{...uW,...a.style},ref:S,defaultValue:L,children:[S2(s)&&!T?g.jsx("option",{value:""}):null,Array.from(M)]},_)},"SelectBubbleInput"));function mW(e){return typeof e=="function"}Ue(mW,"isFunction");function S2(e){return e===""||e===void 0}Ue(S2,"shouldShowPlaceholder");function vz(e){const t=vn(e),a=m.useRef(""),r=m.useRef(0),c=m.useCallback(u=>{const h=a.current+u;t(h);function y(p){a.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>y(""),1e3))}Ue(y,"updateSearch"),y(h)},[t]),s=m.useCallback(()=>{a.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[a,c,s]}Ue(vz,"useTypeaheadSearch");function bz(e,t,a){const c=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=a?e.indexOf(a):-1;let u=gW(e,Math.max(s,0));c.length===1&&(u=u.filter(p=>p!==a));const y=u.find(p=>p.textValue.toLowerCase().startsWith(c.toLowerCase()));return y!==a?y:void 0}Ue(bz,"findNextItem");function gW(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Ue(gW,"wrapArray");function kW({...e}){return g.jsx(Mje,{"data-slot":"select",...e})}function tEe({...e}){return g.jsx(Vje,{"data-slot":"select-group",...e})}function vW({...e}){return g.jsx(Cje,{"data-slot":"select-value",...e})}function bW({className:e,size:t="default",children:a,...r}){return g.jsxs(_je,{"data-slot":"select-trigger","data-size":t,className:Q("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,g.jsx(Lje,{asChild:!0,children:g.jsx(kr,{className:"size-4 opacity-50"})})]})}function xW({className:e,children:t,position:a="popper",...r}){return g.jsx(jje,{children:g.jsxs(Eje,{"data-slot":"select-content",className:Q("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="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:a,...r,children:[g.jsx(wW,{}),g.jsx(Tje,{className:Q("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(_W,{})]})})}function nEe({className:e,...t}){return g.jsx(Fje,{"data-slot":"select-label",className:Q("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function MW({className:e,children:t,...a}){return g.jsxs(Gje,{"data-slot":"select-item",className:Q("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[g.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(Yje,{children:g.jsx(Ua,{className:"size-4"})})}),g.jsx(Zje,{children:t})]})}function aEe({className:e,...t}){return g.jsx(Qje,{"data-slot":"select-separator",className:Q("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function wW({className:e,...t}){return g.jsx(Xje,{"data-slot":"select-scroll-up-button",className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(zu,{className:"size-4"})})}function _W({className:e,...t}){return g.jsx(Kje,{"data-slot":"select-scroll-down-button",className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(kr,{className:"size-4"})})}var oEe=Object.defineProperty,SW=(e,t)=>oEe(e,"name",{value:t,configurable:!0}),xz={Horizontal:"horizontal",Vertical:"vertical"},NB=xz.Horizontal,rEe=Object.values(xz),iEe=m.forwardRef(SW(function(t,a){const{decorative:r,orientation:c=NB,...s}=t,u=CW(c)?c:NB,h=u===xz.Vertical?u:void 0,y=r?{role:"none"}:{"aria-orientation":h,role:"separator"};return g.jsx(we.div,{"data-orientation":u,...y,...s,ref:a})},"Separator"));function CW(e){return rEe.includes(e)}SW(CW,"isValidOrientation");function Mz({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return g.jsx(iEe,{"data-slot":"separator-root",decorative:a,orientation:t,className:Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function LW({...e}){return g.jsx(Iq,{"data-slot":"sheet",...e})}function cEe({...e}){return g.jsx(AG,{"data-slot":"sheet-trigger",...e})}function sEe({...e}){return g.jsx(hj,{"data-slot":"sheet-close",...e})}function lEe({...e}){return g.jsx(Aq,{"data-slot":"sheet-portal",...e})}function dEe({className:e,...t}){return g.jsx(jq,{"data-slot":"sheet-overlay",className:Q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1002] bg-black/50",e),...t})}function NW({className:e,children:t,side:a="right",...r}){return g.jsxs(lEe,{children:[g.jsx(dEe,{}),g.jsxs(Eq,{"data-slot":"sheet-content",className:Q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,g.jsxs(hj,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[g.jsx(vr,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function IW({className:e,...t}){return g.jsx("div",{"data-slot":"sheet-header",className:Q("flex flex-col gap-1.5 p-4",e),...t})}function uEe({className:e,...t}){return g.jsx("div",{"data-slot":"sheet-footer",className:Q("mt-auto flex flex-col gap-2 p-4",e),...t})}function AW({className:e,...t}){return g.jsx(RG,{"data-slot":"sheet-title",className:Q("text-foreground font-semibold",e),...t})}function jW({className:e,...t}){return g.jsx(DG,{"data-slot":"sheet-description",className:Q("text-muted-foreground text-sm",e),...t})}const RR=768;function hEe(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const a=window.matchMedia(`(max-width: ${RR-1}px)`),r=()=>{t(window.innerWidth<RR)};return a.addEventListener("change",r),t(window.innerWidth<RR),()=>a.removeEventListener("change",r)},[]),!!e}function GA({className:e,...t}){return g.jsx("div",{"data-slot":"skeleton",className:Q("bg-accent animate-pulse rounded-md",e),...t})}var pEe=Object.defineProperty,zt=(e,t)=>pEe(e,"name",{value:t,configurable:!0}),[wz,EDe]=Vt("Tooltip",[Ar]),zj=Ar(),fEe="TooltipProvider",yEe=700,bD="tooltip.open",[mEe,_z]=wz(fEe),gEe=zt(e=>{const{__scopeTooltip:t,delayDuration:a=yEe,skipDelayDuration:r=300,disableHoverableContent:c=!1,children:s}=e,u=m.useRef(!0),h=m.useRef(!1),y=m.useRef(0);return m.useEffect(()=>{const p=y.current;return()=>window.clearTimeout(p)},[]),g.jsx(mEe,{scope:t,isOpenDelayedRef:u,delayDuration:a,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(y.current),u.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(p=>{h.current=p},[]),disableHoverableContent:c,children:s})},"TooltipProvider"),xD="Tooltip",[kEe,C2]=wz(xD),vEe=zt(e=>{const{__scopeTooltip:t,children:a,open:r,defaultOpen:c,onOpenChange:s,disableHoverableContent:u,delayDuration:h}=e,y=_z(xD,e.__scopeTooltip),p=zj(t),[b,k]=m.useState(null),[x,M]=m.useState(void 0),_=pt(),C=m.useRef(0),S=u??y.disableHoverableContent,L=h??y.delayDuration,A=m.useRef(!1),[N,j]=Wt({prop:r,defaultProp:c??!1,onChange:zt(re=>{re?(y.onOpen(),document.dispatchEvent(new CustomEvent(bD))):y.onClose(),s?.(re)},"onChange"),caller:xD}),T=m.useMemo(()=>N?A.current?"delayed-open":"instant-open":"closed",[N]),R=m.useCallback(()=>{window.clearTimeout(C.current),C.current=0,A.current=!1,j(!0)},[j]),q=m.useCallback(()=>{window.clearTimeout(C.current),C.current=0,j(!1)},[j]),$=m.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{A.current=!0,j(!0),C.current=0},L)},[L,j]);m.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]);const ee=x??_;return g.jsx(b2,{...p,children:g.jsx(kEe,{scope:t,contentId:ee,setContentId:M,open:N,stateAttribute:T,trigger:b,onTriggerChange:k,onTriggerEnter:m.useCallback(()=>{y.isOpenDelayedRef.current?$():R()},[y.isOpenDelayedRef,$,R]),onTriggerLeave:m.useCallback(()=>{S?q():(window.clearTimeout(C.current),C.current=0)},[q,S]),onOpen:R,onClose:q,disableHoverableContent:S,children:a})})},"Tooltip"),IB="TooltipTrigger",bEe=m.forwardRef(zt(function(t,a){const{__scopeTooltip:r,"aria-describedby":c,...s}=t,u=C2(IB,r),h=_z(IB,r),y=zj(r),p=m.useRef(null),b=Pe(a,p,u.onTriggerChange),k=m.useRef(!1),x=m.useRef(!1),M=m.useCallback(()=>k.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",M),[M]),g.jsx(x2,{asChild:!0,...y,children:g.jsx(we.button,{"aria-describedby":u.open?OW(c,u.contentId):c,"data-state":u.stateAttribute,...s,ref:b,onPointerMove:ye(t.onPointerMove,_=>{_.pointerType!=="touch"&&!x.current&&!h.isPointerInTransitRef.current&&(u.onTriggerEnter(),x.current=!0)}),onPointerLeave:ye(t.onPointerLeave,()=>{u.onTriggerLeave(),x.current=!1}),onPointerDown:ye(t.onPointerDown,()=>{u.open&&u.onClose(),k.current=!0,document.addEventListener("pointerup",M,{once:!0})}),onFocus:ye(t.onFocus,()=>{k.current||u.onOpen()}),onBlur:ye(t.onBlur,u.onClose),onClick:ye(t.onClick,u.onClose)})})},"TooltipTrigger")),EW="TooltipPortal",[xEe,MEe]=wz(EW,{forceMount:void 0}),wEe=zt(e=>{const{__scopeTooltip:t,forceMount:a,children:r,container:c}=e,s=C2(EW,t);return g.jsx(xEe,{scope:t,forceMount:a,children:g.jsx(bn,{present:a||s.open,children:g.jsx(Zl,{asChild:!0,container:c,children:r})})})},"TooltipPortal"),c2="TooltipContent",_Ee=m.forwardRef(zt(function(t,a){const r=MEe(c2,t.__scopeTooltip),{forceMount:c=r.forceMount,side:s="top",...u}=t,h=C2(c2,t.__scopeTooltip);return g.jsx(bn,{present:c||h.open,children:h.disableHoverableContent?g.jsx(PW,{side:s,...u,ref:a}):g.jsx(SEe,{side:s,...u,ref:a})})},"TooltipContent")),SEe=m.forwardRef(zt(function(t,a){const r=C2(c2,t.__scopeTooltip),c=_z(c2,t.__scopeTooltip),s=m.useRef(null),u=Pe(a,s),[h,y]=m.useState(null),{trigger:p,onClose:b}=r,k=s.current,{onPointerInTransitChange:x}=c,M=m.useCallback(()=>{y(null),x(!1)},[x]),_=m.useCallback((C,S)=>{const L=C.currentTarget,A={x:C.clientX,y:C.clientY},N=RW(A,L.getBoundingClientRect()),j=DW(A,N),T=qW(S.getBoundingClientRect()),R=TW([...j,...T]);y(R),x(!0)},[x]);return m.useEffect(()=>()=>M(),[M]),m.useEffect(()=>{if(p&&k){const C=zt(L=>_(L,k),"handleTriggerLeave"),S=zt(L=>_(L,p),"handleContentLeave");return p.addEventListener("pointerleave",C),k.addEventListener("pointerleave",S),()=>{p.removeEventListener("pointerleave",C),k.removeEventListener("pointerleave",S)}}},[p,k,_,M]),m.useEffect(()=>{if(h){const C=zt(S=>{const L=S.target,A={x:S.clientX,y:S.clientY},N=p?.contains(L)||k?.contains(L),j=!zW(A,h);N?M():j&&(M(),b())},"handleTrackPointerGrace");return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,k,h,b,M]),g.jsx(PW,{...t,ref:u})},"TooltipContentHoverable")),CEe=nU("TooltipContent"),PW=m.forwardRef(zt(function(t,a){const{__scopeTooltip:r,children:c,"aria-label":s,id:u,onEscapeKeyDown:h,onPointerDownOutside:y,...p}=t,b=C2(c2,r),k=zj(r),{onClose:x}=b,[M,_]=m.useState(null),C=Pe(a,_);lj(M),m.useEffect(()=>(document.addEventListener(bD,x),()=>document.removeEventListener(bD,x)),[x]),m.useEffect(()=>{if(b.trigger){const L=zt(A=>{A.target instanceof Node&&A.target.contains(b.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",L,{capture:!0}),()=>window.removeEventListener("scroll",L,{capture:!0})}},[b.trigger,x]);const{setContentId:S}=b;return ht(()=>(S(u),()=>{S(void 0)}),[u,S]),g.jsx(g2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:y,onFocusOutside:L=>L.preventDefault(),onDismiss:x,children:g.jsxs(_j,{"data-state":b.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:b.contentId,...k,...p,ref:C,style:{...p.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:[g.jsx(CEe,{children:c}),s?g.jsx(pje,{id:b.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),LEe=m.forwardRef(zt(function(t,a){const{__scopeTooltip:r,...c}=t,s=zj(r);return g.jsx(tNe,{...s,...c,ref:a})},"TooltipArrow"));function RW(e,t){const a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),c=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(a,r,c,s)){case s:return"left";case c:return"right";case a:return"top";case r:return"bottom";default:throw new Error("unreachable")}}zt(RW,"getExitSideFromRect");function DW(e,t,a=5){const r=[];switch(t){case"top":r.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":r.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":r.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":r.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return r}zt(DW,"getPaddedExitPoints");function qW(e){const{top:t,right:a,bottom:r,left:c}=e;return[{x:c,y:t},{x:a,y:t},{x:a,y:r},{x:c,y:r}]}zt(qW,"getPointsFromRect");function zW(e,t){const{x:a,y:r}=e;let c=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const h=t[s],y=t[u],p=h.x,b=h.y,k=y.x,x=y.y;b>r!=x>r&&a<(k-p)*(r-b)/(x-b)+p&&(c=!c)}return c}zt(zW,"isPointInPolygon");function TW(e){const t=e.slice();return t.sort((a,r)=>a.x<r.x?-1:a.x>r.x?1:a.y<r.y?-1:a.y>r.y?1:0),$W(t)}zt(TW,"getHull");function $W(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const c=e[r];for(;t.length>=2;){const s=t[t.length-1],u=t[t.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))t.pop();else break}t.push(c)}t.pop();const a=[];for(let r=e.length-1;r>=0;r--){const c=e[r];for(;a.length>=2;){const s=a[a.length-1],u=a[a.length-2];if((s.x-u.x)*(c.y-u.y)>=(s.y-u.y)*(c.x-u.x))a.pop();else break}a.push(c)}return a.pop(),t.length===1&&a.length===1&&t[0].x===a[0].x&&t[0].y===a[0].y?t:t.concat(a)}zt($W,"getHullPresorted");function OW(...e){const t=new Set;for(const a of e)if(typeof a=="string")for(const r of String(a).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}zt(OW,"concatAriaDescribedby");function Tj({delayDuration:e=0,...t}){return g.jsx(gEe,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Sz({...e}){return g.jsx(Tj,{children:g.jsx(vEe,{"data-slot":"tooltip",...e})})}function Cz({...e}){return g.jsx(bEe,{"data-slot":"tooltip-trigger",...e})}function Lz({className:e,sideOffset:t=0,children:a,...r}){return g.jsx(wEe,{children:g.jsxs(_Ee,{"data-slot":"tooltip-content",sideOffset:t,className:Q("bg-primary text-primary-foreground 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[a,g.jsx(LEe,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const NEe="sidebar_state",IEe=3600*24*7,AEe="16rem",jEe="18rem",EEe="3rem",PEe="b",HW=m.createContext(null);function L2(){const e=m.useContext(HW);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function REe({defaultOpen:e=!0,open:t,onOpenChange:a,className:r,style:c,children:s,...u}){const h=hEe(),[y,p]=m.useState(!1),[b,k]=m.useState(e),x=t??b,M=m.useCallback(L=>{const A=typeof L=="function"?L(x):L;a?a(A):k(A),document.cookie=`${NEe}=${A}; path=/; max-age=${IEe}`},[a,x]),_=m.useCallback(()=>h?p(L=>!L):M(L=>!L),[h,M,p]);m.useEffect(()=>{const L=A=>{A.key===PEe&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),_())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[_]);const C=x?"expanded":"collapsed",S=m.useMemo(()=>({state:C,open:x,setOpen:M,isMobile:h,openMobile:y,setOpenMobile:p,toggleSidebar:_}),[C,x,M,h,y,p,_]);return g.jsx(HW.Provider,{value:S,children:g.jsx(Tj,{delayDuration:0,children:g.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":AEe,"--sidebar-width-icon":EEe,...c},className:Q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...u,children:s})})})}function DEe({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:c,...s}){const{isMobile:u,state:h,openMobile:y,setOpenMobile:p}=L2();return a==="none"?g.jsx("div",{"data-slot":"sidebar",className:Q("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...s,children:c}):u?g.jsx(LW,{open:y,onOpenChange:p,...s,children:g.jsxs(NW,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden z-[1002]",style:{"--sidebar-width":jEe},side:e,children:[g.jsxs(IW,{className:"sr-only",children:[g.jsx(AW,{children:"Sidebar"}),g.jsx(jW,{children:"Displays the mobile sidebar."})]}),g.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):g.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?a:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[g.jsx("div",{"data-slot":"sidebar-gap",className:Q("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),g.jsx("div",{"data-slot":"sidebar-container",className:Q("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:g.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:c})})]})}function qEe({className:e,onClick:t,...a}){const{toggleSidebar:r}=L2();return g.jsxs(sn,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:Q("size-7",e),onClick:c=>{t?.(c),r()},...a,children:[g.jsx(mr,{}),g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function zEe({className:e,...t}){const{toggleSidebar:a}=L2();return g.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:Q("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function TEe({className:e,...t}){return g.jsx("main",{"data-slot":"sidebar-inset",className:Q("bg-background relative flex min-h-0 w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function $Ee({className:e,...t}){return g.jsx(hz,{"data-slot":"sidebar-input","data-sidebar":"input",className:Q("bg-background h-8 w-full shadow-none",e),...t})}function OEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Q("flex flex-col gap-2 p-2",e),...t})}function HEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Q("flex flex-col gap-2 p-2",e),...t})}function VEe({className:e,...t}){return g.jsx(Mz,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:Q("bg-sidebar-border mx-2 w-auto",e),...t})}function BEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function FEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Q("relative flex w-full min-w-0 flex-col p-2",e),...t})}function UEe({className:e,asChild:t=!1,...a}){const r=t?Lr:"div";return g.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:Q("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a})}function GEe({className:e,asChild:t=!1,...a}){const r=t?Lr:"button";return g.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...a})}function ZEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:Q("w-full text-sm",e),...t})}function WEe({className:e,...t}){return g.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Q("flex w-full min-w-0 flex-col gap-1",e),...t})}function YEe({className:e,...t}){return g.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Q("group/menu-item relative",e),...t})}const XEe=aj("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden 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"}});function KEe({asChild:e=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:c,className:s,...u}){const h=e?Lr:"button",{isMobile:y,state:p}=L2(),b=g.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:Q(XEe({variant:a,size:r}),s),...u});return c?(typeof c=="string"&&(c={children:c}),g.jsxs(Sz,{children:[g.jsx(Cz,{asChild:!0,children:b}),g.jsx(Lz,{side:"right",align:"center",hidden:p!=="collapsed"||y,...c})]})):b}function QEe({className:e,asChild:t=!1,showOnHover:a=!1,...r}){const c=t?Lr:"button";return g.jsx(c,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after: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",a&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function JEe({className:e,...t}){return g.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:Q("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})}function ePe({className:e,showIcon:t=!1,...a}){const r=m.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return g.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:Q("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[t&&g.jsx(GA,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),g.jsx(GA,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function tPe({className:e,...t}){return g.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Q("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function nPe({className:e,...t}){return g.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Q("group/menu-sub-item relative",e),...t})}function aPe({asChild:e=!1,size:t="md",isActive:a=!1,className:r,...c}){const s=e?Lr:"a";return g.jsx(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 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","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...c})}var oPe=Object.defineProperty,Ke=(e,t)=>oPe(e,"name",{value:t,configurable:!0}),AB={Horizontal:"horizontal"},rPe={LTR:"ltr"},VW=["PageUp","PageDown"],BW=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],FW={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},N2="Slider",[MD,iPe,cPe]=Md(N2),[Nz,PDe]=Vt(N2,[cPe]),[sPe,Cd]=Nz(N2),lPe=m.forwardRef(Ke(function(t,a){const{name:r,min:c=0,max:s=100,step:u=1,orientation:h=AB.Horizontal,disabled:y=!1,minStepsBetweenThumbs:p=0,preserveThumbOrder:b=!1,defaultValue:k=[c],value:x,onValueChange:M=Ke(()=>{},"onValueChange"),onValueCommit:_=Ke(()=>{},"onValueCommit"),inverted:C=!1,form:S,...L}=t,A=m.useRef(new Set),N=m.useRef(0),j=m.useRef(!1),[T,R]=m.useState(null),$=h===AB.Horizontal?dPe:uPe,[ee,re]=m.useState(null),F=Pe(a,re),[G=[],X]=Wt({prop:x,defaultProp:k,onChange:Ke(V=>{[...A.current][N.current]?.focus({preventScroll:!0,focusVisible:j.current}),j.current=!1,M(V)},"onChange")}),ae=m.useRef(G),he=m.useRef(G);m.useEffect(()=>{const V=S?ee?.ownerDocument.getElementById(S):ee?.closest("form");if(V instanceof HTMLFormElement){const D=Ke(()=>X(he.current),"reset");return V.addEventListener("reset",D),()=>V.removeEventListener("reset",D)}},[ee,S,X]);function P(V){const D=QW(G,V);Y(V,D)}Ke(P,"handleSlideStart");function E(V){Y(V,N.current)}Ke(E,"handleSlideMove");function O(){String(G)!==String(ae.current)&&_(G)}Ke(O,"handleSlideEnd");function Y(V,D,{commit:z}={commit:!1}){const J=Az(u),K=Fu(Math.round((V-c)/u)*u+c,J),W=yd(K,[c,s]),U=p*u;function de(ie){const pe=b?yd(W,[ie[D-1]===void 0?c:ie[D-1]+U,ie[D+1]===void 0?s:ie[D+1]-U]):W,be=XW(ie,pe,D);return tY(be,U)?{nextValues:be,changedIndex:b?D:be.indexOf(pe),hasChanged:String(be)!==String(ie)}:null}Ke(de,"getNextValues");const ke=de(G);ke?.hasChanged&&R(ke.nextValues),X((ie=[])=>{const pe=de(ie);return pe?(N.current=pe.changedIndex,pe.hasChanged&&z&&_(pe.nextValues),pe.hasChanged?pe.nextValues:ie):ie})}return Ke(Y,"updateValues"),g.jsx(sPe,{scope:t.__scopeSlider,name:r,disabled:y,min:c,max:s,valueIndexToChangeRef:N,thumbs:A.current,values:G,orientation:h,form:S,userRequestedValues:T,children:g.jsx(MD.Provider,{scope:t.__scopeSlider,children:g.jsx(MD.Slot,{scope:t.__scopeSlider,children:g.jsx($,{"aria-disabled":y,"data-disabled":y?"":void 0,...L,ref:F,onPointerDown:ye(L.onPointerDown,()=>{y||(ae.current=G,j.current=!1)}),min:c,max:s,inverted:C,onSlideStart:y?void 0:P,onSlideMove:y?void 0:E,onSlideEnd:y?void 0:O,onHomeKeyDown:()=>{y||(j.current=!0,Y(c,0,{commit:!0}))},onEndKeyDown:()=>{y||(j.current=!0,Y(s,G.length-1,{commit:!0}))},onStepKeyDown:({event:V,direction:D})=>{if(!y){j.current=!0;const K=VW.includes(V.key)||V.shiftKey&&BW.includes(V.key)?10:1,W=N.current,U=G[W],de=nY(U,{min:c,step:u,direction:D,multiplier:K});Y(de,W,{commit:!0})}}})})})})},"Slider")),[UW,GW]=Nz(N2,{startEdge:"left",endEdge:"right",size:"width",direction:1}),dPe=m.forwardRef(Ke(function(t,a){const{min:r,max:c,dir:s,inverted:u,onSlideStart:h,onSlideMove:y,onSlideEnd:p,onStepKeyDown:b,...k}=t,[x,M]=m.useState(null),_=Pe(a,M),C=m.useRef(void 0),S=Yl(s),L=S===rPe.LTR,A=L&&!u||!L&&u;function N(j){const T=C.current||x.getBoundingClientRect(),R=[0,T.width],$=$j(R,A?[r,c]:[c,r]);return C.current=T,$(j-T.left)}return Ke(N,"getValueFromPointer"),g.jsx(UW,{scope:t.__scopeSlider,startEdge:A?"left":"right",endEdge:A?"right":"left",direction:A?1:-1,size:"width",children:g.jsx(ZW,{dir:S,"data-orientation":"horizontal",...k,ref:_,style:{...k.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const T=N(j.clientX);h?.(T)},onSlideMove:j=>{const T=N(j.clientX);y?.(T)},onSlideEnd:()=>{C.current=void 0,p?.()},onStepKeyDown:j=>{const R=FW[A?"from-left":"from-right"].includes(j.key);b?.({event:j,direction:R?-1:1})}})})},"SliderHorizontal")),uPe=m.forwardRef(Ke(function(t,a){const{min:r,max:c,inverted:s,onSlideStart:u,onSlideMove:h,onSlideEnd:y,onStepKeyDown:p,...b}=t,k=m.useRef(null),x=Pe(a,k),M=m.useRef(void 0),_=!s;function C(S){const L=M.current||k.current.getBoundingClientRect(),A=[0,L.height],j=$j(A,_?[c,r]:[r,c]);return M.current=L,j(S-L.top)}return Ke(C,"getValueFromPointer"),g.jsx(UW,{scope:t.__scopeSlider,startEdge:_?"bottom":"top",endEdge:_?"top":"bottom",size:"height",direction:_?1:-1,children:g.jsx(ZW,{"data-orientation":"vertical",...b,ref:x,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const L=C(S.clientY);u?.(L)},onSlideMove:S=>{const L=C(S.clientY);h?.(L)},onSlideEnd:()=>{M.current=void 0,y?.()},onStepKeyDown:S=>{const A=FW[_?"from-bottom":"from-top"].includes(S.key);p?.({event:S,direction:A?-1:1})}})})},"SliderVertical")),ZW=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,onSlideStart:c,onSlideMove:s,onSlideEnd:u,onHomeKeyDown:h,onEndKeyDown:y,onStepKeyDown:p,...b}=t,k=Cd(N2,r);return g.jsx(we.span,{...b,ref:a,onKeyDown:ye(t.onKeyDown,x=>{x.key==="Home"?(h(x),x.preventDefault()):x.key==="End"?(y(x),x.preventDefault()):VW.concat(BW).includes(x.key)&&(p(x),x.preventDefault())}),onPointerDown:ye(t.onPointerDown,x=>{const M=x.target;M.setPointerCapture(x.pointerId),x.preventDefault(),k.thumbs.has(M)?M.focus({preventScroll:!0,focusVisible:!1}):c(x)}),onPointerMove:ye(t.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&s(x)}),onPointerUp:ye(t.onPointerUp,x=>{const M=x.target;M.hasPointerCapture(x.pointerId)&&(M.releasePointerCapture(x.pointerId),u(x))})})},"SliderImpl")),hPe="SliderTrack",pPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,...c}=t,s=Cd(hPe,r);return g.jsx(we.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...c,ref:a})},"SliderTrack")),jB="SliderRange",fPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,...c}=t,s=Cd(jB,r),u=GW(jB,r),h=m.useRef(null),y=Pe(a,h),p=s.values.length,b=s.values.map(M=>Iz(M,s.min,s.max)),k=p>1?Math.min(...b):0,x=100-Math.max(...b);return g.jsx(we.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...c,ref:y,style:{...t.style,[u.startEdge]:k+"%",[u.endEdge]:x+"%"}})},"SliderRange")),yPe="SliderThumb",[mPe,WW]=Nz(yPe),gPe="SliderThumbProvider";function YW(e){const{__scopeSlider:t,name:a,children:r,internal_do_not_use_render:c}=e,s=Cd(gPe,t),u=iPe(t),[h,y]=m.useState(null),p=m.useMemo(()=>h?u().findIndex(S=>S.ref.current===h):-1,[u,h]),b=y2(h),k=h?!!s.form||!!h.closest("form"):!0,x=s.values[p],M=a??(s.name?s.name+(s.values.length>1?"[]":""):void 0),_=x===void 0?0:Iz(x,s.min,s.max);m.useEffect(()=>{if(h)return s.thumbs.add(h),()=>{s.thumbs.delete(h)}},[h,s.thumbs]);const C={value:x,name:M,form:s.form,isFormControl:k,index:p,thumb:h,onThumbChange:y,percent:_,size:b};return g.jsx(mPe,{scope:t,...C,children:aY(c)?c(C):r})}Ke(YW,"SliderThumbProvider");var DR="SliderThumbTrigger",kPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,...c}=t,s=Cd(DR,r),u=GW(DR,r),{index:h,value:y,percent:p,size:b,onThumbChange:k}=WW(DR,r),x=Pe(a,k),M=KW(h,s.values.length),_=b?.[u.size],C=_?JW(_,p,u.direction):0;return g.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${p}% + ${C}px)`},children:g.jsx(MD.ItemSlot,{scope:r,children:g.jsx(we.span,{role:"slider","aria-label":t["aria-label"]||M,"aria-valuemin":s.min,"aria-valuenow":y,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...c,ref:x,style:y===void 0?{display:"none"}:t.style,onFocus:ye(t.onFocus,()=>{s.valueIndexToChangeRef.current=h})})})})},"SliderThumbTrigger")),vPe=m.forwardRef(Ke(function(t,a){const{__scopeSlider:r,name:c,...s}=t;return g.jsx(YW,{__scopeSlider:r,name:c,internal_do_not_use_render:({index:u,isFormControl:h})=>g.jsxs(g.Fragment,{children:[g.jsx(kPe,{...s,ref:a,__scopeSlider:r}),h?g.jsx(bPe,{__scopeSlider:r},u):null]})})},"SliderThumb")),EB="SliderBubbleInput",bPe=m.forwardRef(Ke(function({__scopeSlider:t,onInput:a,...r},c){const{index:s,value:u,name:h,form:y}=WW(EB,t),{userRequestedValues:p}=Cd(EB,t),b=m.useRef(null),k=Pe(b,c),x=m.useRef(!1),M=m.useRef(u),_=m.useRef(p),C=m.useRef(p);return m.useEffect(()=>{const S=b.current;if(!S)return;const L=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(L,"value").set,j=M.current,T=j!==u;M.current=u;const R=p!==C.current;if(C.current=p,T&&N){const q=p!==_.current;_.current=p;const $=p?.[s],ee=q&&(R&&$!==j||$===u);x.current=!ee;const re=new Event("input",{bubbles:!0});N.call(S,u),S.dispatchEvent(re),x.current=!1}},[s,u,p]),g.jsx(we.input,{style:{display:"none"},name:h,form:y,...r,ref:k,defaultValue:u,onInput:ye(a,S=>{x.current&&S.stopPropagation()})})},"SliderBubbleInput"));function XW(e=[],t,a){const r=[...e];return r[a]=t,r.sort((c,s)=>c-s)}Ke(XW,"getNextSortedValues");function Iz(e,t,a){const s=100/(a-t)*(e-t);return yd(s,[0,100])}Ke(Iz,"convertValueToPercentage");function KW(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}Ke(KW,"getLabel");function QW(e,t){if(e.length===1)return 0;const a=e.map(c=>Math.abs(c-t)),r=Math.min(...a);return a.indexOf(r)}Ke(QW,"getClosestValueIndex");function JW(e,t,a){const r=e/2,s=$j([0,50],[0,r]);return(r-s(t)*a)*a}Ke(JW,"getThumbInBoundsOffset");function eY(e){return e.slice(0,-1).map((t,a)=>e[a+1]-t)}Ke(eY,"getStepsBetweenValues");function tY(e,t){if(t>0){const a=eY(e);return Math.min(...a)>=t}return!0}Ke(tY,"hasMinStepsBetweenValues");function $j(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}Ke($j,"linearScale");function Az(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[r,c]=t.split("e"),s=r.split(".")[1]||"",u=Number(c);return Math.max(0,s.length-u)}const a=t.split(".")[1];return a?a.length:0}Ke(Az,"getDecimalCount");function Fu(e,t){const a=Math.pow(10,t);return Math.round(e*a)/a}Ke(Fu,"roundValue");function nY(e,{min:t,step:a,direction:r,multiplier:c}){const s=Az(a),u=(e-t)/a,h=Math.round(u),y=Fu(h*a+t,s)===Fu(e,s);let p;return y?p=h+c*r:r>0?p=Math.ceil(u):p=Math.floor(u),Fu(p*a+t,s)}Ke(nY,"getNextStepValue");function aY(e){return typeof e=="function"}Ke(aY,"isFunction");function oY({className:e,defaultValue:t,value:a,min:r=0,max:c=100,id:s,...u}){const h=m.useMemo(()=>Array.isArray(a)?a:Array.isArray(t)?t:[r,c],[a,t,r,c]);return g.jsxs(lPe,{"data-slot":"slider",defaultValue:t,value:a,min:r,max:c,id:s,className:Q("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...u,children:[g.jsx(pPe,{"data-slot":"slider-track",className:Q("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:g.jsx(fPe,{"data-slot":"slider-range",className:Q("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:h.length},(y,p)=>g.jsx(vPe,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},p))]})}var xPe=(e,t,a,r,c,s,u,h)=>{let y=document.documentElement,p=["light","dark"];function b(M){(Array.isArray(e)?e:[e]).forEach(_=>{let C=_==="class",S=C&&s?c.map(L=>s[L]||L):c;C?(y.classList.remove(...S),y.classList.add(s&&s[M]?s[M]:M)):y.setAttribute(_,M)}),k(M)}function k(M){h&&p.includes(M)&&(y.style.colorScheme=M)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)b(r);else try{let M=localStorage.getItem(t)||a,_=u&&M==="system"?x():M;b(_)}catch{}},MPe=m.createContext(void 0),wPe={setTheme:e=>{},themes:[]},_Pe=()=>{var e;return(e=m.useContext(MPe))!=null?e:wPe};m.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:r,enableColorScheme:c,defaultTheme:s,value:u,themes:h,nonce:y,scriptProps:p})=>{let b=JSON.stringify([a,t,s,e,h,u,r,c]).slice(1,-1);return m.createElement("script",{...p,suppressHydrationWarning:!0,nonce:typeof window>"u"?y:"",dangerouslySetInnerHTML:{__html:`(${xPe.toString()})(${b})`}})});function SPe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const CPe=e=>{switch(e){case"success":return IPe;case"info":return jPe;case"warning":return APe;case"error":return EPe;default:return null}},LPe=Array(12).fill(0),NPe=({visible:e,className:t})=>me.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},me.createElement("div",{className:"sonner-spinner"},LPe.map((a,r)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),IPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),APe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),jPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),EPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),PPe=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RPe=()=>{const[e,t]=me.useState(document.hidden);return me.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e};let DPe=1;const qPe=100,PB=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:DPe++};class zPe{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(a=>t(a)),()=>{const a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-qPe;t<=0||(this.toasts=this.toasts.filter(a=>t>0&&this.dismissedToasts.has(a.id)?(this.dismissedToasts.delete(a.id),t--,!1):!0))},this.create=t=>{const{message:a,...r}=t,c=PB(t),s=this.pendingDismissals.get(c);s!==void 0&&(cancelAnimationFrame(s),this.pendingDismissals.delete(c),this.dismissedToasts.delete(c));const u=this.dismissedToasts.has(c),h=t.dismissible===void 0?!0:t.dismissible;return u&&(this.dismissedToasts.delete(c),this.toasts=this.toasts.filter(p=>p.id!==c)),(u?void 0:this.toasts.find(p=>p.id===c))?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...t,id:c,title:a}),{...p,...t,id:c,dismissible:h,title:a}):p):this.addToast({title:a,...r,dismissible:h,id:c}),c},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(c=>c({id:r.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const a=this.pendingDismissals.get(t);return a!==void 0&&cancelAnimationFrame(a),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(r=>r({id:t,dismiss:!0}))})),t},this.message=(t,a)=>this.create({...a,message:t,type:void 0}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let r;a.loading!==void 0&&(r=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const c=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,u;const h=c.then(async p=>{if(u=["resolve",p],me.isValidElement(p))s=!1,this.create({id:r,type:"default",message:p});else if($Pe(p)&&!p.ok){s=!1;const k=typeof a.error=="function"?await a.error(`HTTP error! status: ${p.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${p.status}`):a.description,_=typeof k=="object"&&!me.isValidElement(k)?k:{message:k};this.create({id:r,type:"error",description:x,..._})}else if(p instanceof Error){s=!1;const k=typeof a.error=="function"?await a.error(p):a.error,x=typeof a.description=="function"?await a.description(p):a.description,_=typeof k=="object"&&!me.isValidElement(k)?k:{message:k};this.create({id:r,type:"error",description:x,..._})}else if(a.success!==void 0){s=!1;const k=typeof a.success=="function"?await a.success(p):a.success,x=typeof a.description=="function"?await a.description(p):a.description,_=typeof k=="object"&&!me.isValidElement(k)?k:{message:k};this.create({id:r,type:"success",description:x,..._})}}).catch(async p=>{if(u=["reject",p],a.error!==void 0){s=!1;const b=typeof a.error=="function"?await a.error(p):a.error,k=typeof a.description=="function"?await a.description(p):a.description,M=typeof b=="object"&&!me.isValidElement(b)?b:{message:b};this.create({id:r,type:"error",description:k,...M})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),a.finally==null||a.finally.call(a)}),y=()=>new Promise((p,b)=>h.then(()=>u[0]==="reject"?b(u[1]):p(u[1])).catch(b));return typeof r!="string"&&typeof r!="number"?{unwrap:y}:Object.assign(r,{unwrap:y})},this.custom=(t,a)=>{const r=PB(a);return this.create({...a,jsx:t(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const yn=new zPe,TPe=(e,t)=>yn.message(e,t),$Pe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",OPe=TPe,HPe=()=>yn.toasts,VPe=()=>yn.getActiveToasts(),rY=Object.assign(OPe,{success:yn.success,info:yn.info,warning:yn.warning,error:yn.error,custom:yn.custom,message:yn.message,promise:yn.promise,dismiss:yn.dismiss,loading:yn.loading},{getHistory:HPe,getToasts:VPe});SPe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function rh(e){return e.label!==void 0}const BPe=3,FPe="24px",UPe="16px",RB=4e3,GPe=356,ZPe=14,WPe=45,YPe=200;function za(...e){return e.filter(Boolean).join(" ")}function XPe(e){const[t,a]=e.split("-"),r=[];return t&&r.push(t),a&&r.push(a),r}const KPe=e=>{var t,a,r,c,s,u,h,y,p;const{invert:b,toast:k,unstyled:x,interacting:M,setHeights:_,visibleToasts:C,heights:S,index:L,toasts:A,expanded:N,removeToast:j,defaultRichColors:T,closeButton:R,style:q,cancelButtonStyle:$,actionButtonStyle:ee,className:re="",descriptionClassName:F="",duration:G,position:X,gap:ae,expandByDefault:he,classNames:P,icons:E,closeButtonAriaLabel:O="Close toast"}=e,[Y,V]=me.useState(null),[D,z]=me.useState(null),[J,K]=me.useState(!1),[W,U]=me.useState(!1),[de,ke]=me.useState(!1),[ie,pe]=me.useState(!1),[be,Ie]=me.useState(!1),[_e,Me]=me.useState(0),[Ae,Lt]=me.useState(0),vt=me.useRef(k.duration||G||RB),ve=me.useRef(null),xe=me.useRef(null),ge=L===0,He=L+1<=C,We=k.type,an=We??"default",tt=k.dismissible!==!1,Yt=k.className||"",gt=k.descriptionClassName||"",Sn=me.useMemo(()=>S.findIndex(De=>De.toastId===k.id)||0,[S,k.id]),Ro=me.useMemo(()=>{var De;return(De=k.closeButton)!=null?De:R},[k.closeButton,R]),Do=me.useMemo(()=>k.duration||G||RB,[k.duration,G]),Aa=me.useRef(0),qo=me.useRef(0),A2=me.useRef(0),na=me.useRef(null),[dn,ja]=X.split("-"),on=me.useMemo(()=>S.reduce((De,Mt,Nt)=>Nt>=Sn?De:De+Mt.height,0),[S,Sn]),j2=RPe(),aa=me.useMemo(()=>{var De;return(De=e.swipeDirections)!=null?De:XPe(X)},[e.swipeDirections,X]),Oj=k.invert||b,zo=We==="loading";qo.current=me.useMemo(()=>Sn*ae+on,[Sn,on]),me.useEffect(()=>{vt.current=Do},[Do]),me.useEffect(()=>{K(!0)},[]),me.useEffect(()=>{const De=xe.current;if(De){const Mt=De.getBoundingClientRect().height;return Lt(Mt),_(Nt=>[{toastId:k.id,height:Mt,position:k.position},...Nt]),()=>_(Nt=>Nt.filter(It=>It.toastId!==k.id))}},[_,k.id]),me.useLayoutEffect(()=>{if(!J)return;const De=xe.current,Mt=De.style.height;De.style.height="auto";const Nt=De.getBoundingClientRect().height;De.style.height=Mt,Lt(Nt),_(It=>It.find(At=>At.toastId===k.id)?It.map(At=>At.toastId===k.id?{...At,height:Nt}:At):[{toastId:k.id,height:Nt,position:k.position},...It])},[J,k.title,k.description,_,k.id,k.jsx,k.action,k.cancel]);const Bn=me.useCallback(()=>{U(!0),Me(qo.current),_(De=>De.filter(Mt=>Mt.toastId!==k.id)),setTimeout(()=>{j(k)},YPe)},[k,j,_,qo]);me.useEffect(()=>{if(k.promise&&We==="loading"||k.duration===1/0||k.type==="loading")return;let De;return N||M||j2?(()=>{if(A2.current<Aa.current){const It=new Date().getTime()-Aa.current;vt.current=vt.current-It}A2.current=new Date().getTime()})():vt.current!==1/0&&(Aa.current=new Date().getTime(),De=setTimeout(()=>{k.onAutoClose==null||k.onAutoClose.call(k,k),Bn()},vt.current)),()=>clearTimeout(De)},[N,M,k,We,j2,Bn]),me.useEffect(()=>{k.delete&&(Bn(),k.onDismiss==null||k.onDismiss.call(k,k))},[Bn,k.delete]);function Pr(){var De;if(E?.loading){var Mt;return me.createElement("div",{className:za(P?.loader,k==null||(Mt=k.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":We==="loading"},E.loading)}return me.createElement(NPe,{className:za(P?.loader,k==null||(De=k.classNames)==null?void 0:De.loader),visible:We==="loading"})}const Ka=k.icon||E?.[We]||CPe(We);var Rr,To;return me.createElement("li",{tabIndex:0,ref:xe,className:za(re,Yt,P?.toast,k==null||(t=k.classNames)==null?void 0:t.toast,P?.[an],k==null||(a=k.classNames)==null?void 0:a[an]),"data-sonner-toast":"","data-rich-colors":(Rr=k.richColors)!=null?Rr:T,"data-styled":!(k.jsx||k.unstyled||x),"data-mounted":J,"data-promise":!!k.promise,"data-swiped":be,"data-removed":W,"data-visible":He,"data-y-position":dn,"data-x-position":ja,"data-index":L,"data-front":ge,"data-swiping":de,"data-dismissible":tt,"data-type":We,"data-invert":Oj,"data-swipe-out":ie,"data-swipe-direction":D,"data-expanded":!!(N||he&&J),"data-testid":k.testId,style:{"--index":L,"--toasts-before":L,"--z-index":A.length-L,"--offset":`${W?_e:qo.current}px`,"--initial-height":he?"auto":`${Ae}px`,...q,...k.style},onDragEnd:()=>{ke(!1),V(null),na.current=null},onPointerDown:De=>{De.button!==2&&(zo||!tt||(ve.current=new Date,Me(qo.current),De.target.setPointerCapture(De.pointerId),De.target.tagName!=="BUTTON"&&(ke(!0),na.current={x:De.clientX,y:De.clientY})))},onPointerUp:()=>{var De,Mt,Nt;if(ie||!tt)return;na.current=null;const It=Number(((De=xe.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dr=Number(((Mt=xe.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),At=new Date().getTime()-((Nt=ve.current)==null?void 0:Nt.getTime()),un=Y==="x"?It:Dr,Fn=Math.abs(un)/At;if((Y==="x"?aa.includes(It>0?"right":"left"):aa.includes(Dr>0?"bottom":"top"))&&(Math.abs(un)>=WPe||Fn>.11)){Me(qo.current),k.onDismiss==null||k.onDismiss.call(k,k),z(Y==="x"?It>0?"right":"left":Dr>0?"down":"up"),Bn(),pe(!0);return}else{var Cn,t1;(Cn=xe.current)==null||Cn.style.setProperty("--swipe-amount-x","0px"),(t1=xe.current)==null||t1.style.setProperty("--swipe-amount-y","0px")}Ie(!1),ke(!1),V(null)},onPointerMove:De=>{var Mt,Nt,It;if(!na.current||!tt||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const At=De.clientY-na.current.y,un=De.clientX-na.current.x;!Y&&(Math.abs(un)>1||Math.abs(At)>1)&&V(Math.abs(un)>Math.abs(At)?"x":"y");let Fn={x:0,y:0};const qr=Cn=>1/(1.5+Math.abs(Cn)/20);if(Y==="y"){if(aa.includes("top")||aa.includes("bottom"))if(aa.includes("top")&&At<0||aa.includes("bottom")&&At>0)Fn.y=At;else{const Cn=At*qr(At);Fn.y=Math.abs(Cn)<Math.abs(At)?Cn:At}}else if(Y==="x"&&(aa.includes("left")||aa.includes("right")))if(aa.includes("left")&&un<0||aa.includes("right")&&un>0)Fn.x=un;else{const Cn=un*qr(un);Fn.x=Math.abs(Cn)<Math.abs(un)?Cn:un}(Math.abs(Fn.x)>0||Math.abs(Fn.y)>0)&&Ie(!0),(Nt=xe.current)==null||Nt.style.setProperty("--swipe-amount-x",`${Fn.x}px`),(It=xe.current)==null||It.style.setProperty("--swipe-amount-y",`${Fn.y}px`)}},Ro&&!k.jsx&&We!=="loading"?me.createElement("button",{"aria-label":O,"data-disabled":zo,"data-close-button":!0,onClick:zo||!tt?()=>{}:()=>{Bn(),k.onDismiss==null||k.onDismiss.call(k,k)},className:za(P?.closeButton,k==null||(r=k.classNames)==null?void 0:r.closeButton)},(To=E?.close)!=null?To:PPe):null,(We||k.icon||k.promise)&&k.icon!==null&&(E?.[We]!==null||k.icon)?me.createElement("div",{"data-icon":"",className:za(P?.icon,k==null||(c=k.classNames)==null?void 0:c.icon)},We==="loading"?k.icon||Pr():k.promise?Pr():null,We!=="loading"?Ka:null):null,me.createElement("div",{"data-content":"",className:za(P?.content,k==null||(s=k.classNames)==null?void 0:s.content)},me.createElement("div",{"data-title":"",className:za(P?.title,k==null||(u=k.classNames)==null?void 0:u.title)},k.jsx?k.jsx:typeof k.title=="function"?k.title():k.title),k.description?me.createElement("div",{"data-description":"",className:za(F,gt,P?.description,k==null||(h=k.classNames)==null?void 0:h.description)},typeof k.description=="function"?k.description():k.description):null),me.isValidElement(k.cancel)?k.cancel:k.cancel&&rh(k.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:k.cancelButtonStyle||$,onClick:De=>{rh(k.cancel)&&tt&&(k.cancel.onClick==null||k.cancel.onClick.call(k.cancel,De),Bn())},className:za(P?.cancelButton,k==null||(y=k.classNames)==null?void 0:y.cancelButton)},k.cancel.label):null,me.isValidElement(k.action)?k.action:k.action&&rh(k.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:k.actionButtonStyle||ee,onClick:De=>{rh(k.action)&&(k.action.onClick==null||k.action.onClick.call(k.action,De),!De.defaultPrevented&&Bn())},className:za(P?.actionButton,k==null||(p=k.classNames)==null?void 0:p.actionButton)},k.action.label):null)};function DB(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function QPe(e,t){const a={};return[e,t].forEach((r,c)=>{const s=c===1,u=s?"--mobile-offset":"--offset",h=s?UPe:FPe;function y(p){["top","right","bottom","left"].forEach(b=>{a[`${u}-${b}`]=typeof p=="number"?`${p}px`:p})}typeof r=="number"||typeof r=="string"?y(r):typeof r=="object"?["top","right","bottom","left"].forEach(p=>{r[p]===void 0?a[`${u}-${p}`]=h:a[`${u}-${p}`]=typeof r[p]=="number"?`${r[p]}px`:r[p]}):y(h)}),a}function JPe(){const[e,t]=me.useState([]);return me.useEffect(()=>yn.subscribe(a=>{if(a.dismiss){setTimeout(()=>{PA.flushSync(()=>{t(r=>r.filter(c=>c.id!==a.id))})});return}setTimeout(()=>{PA.flushSync(()=>{t(r=>{const c=r.findIndex(s=>s.id===a.id);return c!==-1?[...r.slice(0,c),{...r[c],...a},...r.slice(c+1)]:[a,...r]})})})}),[]),{toasts:e}}const iY=me.forwardRef(function(t,a){const{id:r,invert:c,position:s="bottom-right",hotkey:u=["altKey","KeyT"],expand:h,closeButton:y,className:p,offset:b,mobileOffset:k,theme:x="light",richColors:M,duration:_,style:C,visibleToasts:S=BPe,toastOptions:L,dir:A=DB(),gap:N=ZPe,icons:j,customAriaLabel:T,containerAriaLabel:R="Notifications"}=t,[q,$]=me.useState([]),ee=me.useMemo(()=>r?q.filter(K=>K.toasterId===r):q.filter(K=>!K.toasterId),[q,r]),re=me.useMemo(()=>Array.from(new Set([s].concat(ee.filter(K=>K.position).map(K=>K.position)))),[ee,s]),[F,G]=me.useState([]),[X,ae]=me.useState(!1),[he,P]=me.useState(!1),[E,O]=me.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=me.useRef(null),V=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=me.useRef(null),z=me.useRef(!1),J=me.useCallback(K=>{$(W=>{var U;return(U=W.find(de=>de.id===K.id))!=null&&U.delete||yn.dismiss(K.id),W.filter(({id:de})=>de!==K.id)})},[]);return me.useEffect(()=>yn.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{$(W=>W.map(U=>U.id===K.id?{...U,delete:!0}:U))});return}setTimeout(()=>{PA.flushSync(()=>{$(W=>{const U=W.findIndex(de=>de.id===K.id);return U!==-1?[...W.slice(0,U),{...W[U],...K},...W.slice(U+1)]:[K,...W]})})})}),[]),me.useEffect(()=>{if(x!=="system"){O(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:W})=>{O(W?"dark":"light")})}catch{K.addListener(({matches:U})=>{try{O(U?"dark":"light")}catch(de){console.error(de)}})}},[x]),me.useEffect(()=>{q.length<=1&&ae(!1)},[q]),me.useEffect(()=>{const K=W=>{var U;if(u.length>0&&u.every(ie=>W[ie]||W.code===ie)){var ke;ae(!0),(ke=Y.current)==null||ke.focus()}W.code==="Escape"&&(document.activeElement===Y.current||(U=Y.current)!=null&&U.contains(document.activeElement))&&ae(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[u]),me.useEffect(()=>{if(Y.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,z.current=!1)}},[Y.current]),me.createElement("section",{ref:a,"aria-label":T??`${R} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},re.map((K,W)=>{var U;const[de,ke]=K.split("-");return ee.length?me.createElement("ol",{key:K,dir:A==="auto"?DB():A,tabIndex:-1,ref:Y,className:p,"data-sonner-toaster":!0,"data-sonner-theme":E,"data-y-position":de,"data-x-position":ke,style:{"--front-toast-height":`${((U=F[0])==null?void 0:U.height)||0}px`,"--width":`${GPe}px`,"--gap":`${N}px`,...C,...QPe(b,k)},onBlur:ie=>{z.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(z.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||z.current||(z.current=!0,D.current=ie.relatedTarget)},onMouseEnter:()=>ae(!0),onMouseMove:()=>ae(!0),onMouseLeave:()=>{he||ae(!1)},onDragEnd:()=>ae(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||P(!0)},onPointerUp:()=>P(!1)},ee.filter(ie=>!ie.position&&W===0||ie.position===K).map((ie,pe)=>{var be,Ie;return me.createElement(KPe,{key:ie.id,icons:j,index:pe,toast:ie,defaultRichColors:M,duration:(be=L?.duration)!=null?be:_,className:L?.className,descriptionClassName:L?.descriptionClassName,invert:c,visibleToasts:S,closeButton:(Ie=L?.closeButton)!=null?Ie:y,interacting:he,position:K,style:L?.style,unstyled:L?.unstyled,classNames:L?.classNames,cancelButtonStyle:L?.cancelButtonStyle,actionButtonStyle:L?.actionButtonStyle,closeButtonAriaLabel:L?.closeButtonAriaLabel,removeToast:J,toasts:ee.filter(_e=>_e.position==ie.position),heights:F.filter(_e=>_e.position==ie.position),setHeights:G,expandByDefault:h,gap:N,expanded:X,swipeDirections:t.swipeDirections})})):null}))}),eRe=Object.freeze(Object.defineProperty({__proto__:null,Toaster:iY,toast:rY,useSonner:JPe},Symbol.toStringTag,{value:"Module"})),tRe=({...e})=>{const{theme:t="system"}=_Pe();return g.jsx(iY,{theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})};var nRe=Object.defineProperty,Cr=(e,t)=>nRe(e,"name",{value:t,configurable:!0}),jz="Switch",[aRe,RDe]=Vt(jz),[oRe,Ez]=aRe(jz);function cY(e){const{__scopeSwitch:t,checked:a,children:r,defaultChecked:c,disabled:s,form:u,name:h,onCheckedChange:y,required:p,value:b="on",internal_do_not_use_render:k}=e,[x,M]=Wt({prop:a,defaultProp:c??!1,onChange:y,caller:jz}),[_,C]=m.useState(null),[S,L]=m.useState(null),[A,N]=m.useState(null),j=_?!!u||!!_.closest("form"):!0,T={checked:x,setChecked:M,disabled:s,control:_,setControl:C,name:h,form:u,value:b,userClick:A,onUserClick:N,required:p,defaultChecked:c,isFormControl:j,bubbleInput:S,setBubbleInput:L};return g.jsx(oRe,{scope:t,...T,children:sY(k)?k(T):r})}Cr(cY,"SwitchProvider");var rRe="SwitchTrigger",iRe=m.forwardRef(Cr(function({__scopeSwitch:t,onClick:a,...r},c){const{control:s,form:u,value:h,disabled:y,checked:p,required:b,setControl:k,setChecked:x,onUserClick:M,isFormControl:_,bubbleInput:C}=Ez(rRe,t),S=Pe(c,k),L=m.useRef(p);return m.useEffect(()=>{const A=u?s?.ownerDocument.getElementById(u):s?.form;if(A instanceof HTMLFormElement){const N=Cr(()=>x(L.current),"reset");return A.addEventListener("reset",N),()=>A.removeEventListener("reset",N)}},[s,u,x]),g.jsx(we.button,{type:"button",role:"switch","aria-checked":p,"aria-required":b,"data-state":Pz(p),"data-disabled":y?"":void 0,disabled:y,value:h,...r,ref:S,onClick:ye(a,A=>{const N=A.isPropagationStopped();M({requestedChecked:!p,hasConsumerStoppedPropagation:N}),x(j=>!j),C&&_&&(N||A.stopPropagation())})})},"SwitchTrigger")),cRe=m.forwardRef(Cr(function(t,a){const{__scopeSwitch:r,name:c,checked:s,defaultChecked:u,required:h,disabled:y,value:p,onCheckedChange:b,form:k,...x}=t;return g.jsx(cY,{__scopeSwitch:r,checked:s,defaultChecked:u,disabled:y,required:h,onCheckedChange:b,name:c,form:k,value:p,internal_do_not_use_render:({isFormControl:M})=>g.jsxs(g.Fragment,{children:[g.jsx(iRe,{...x,ref:a,__scopeSwitch:r}),M&&g.jsx(uRe,{__scopeSwitch:r})]})})},"Switch")),sRe="SwitchThumb",lRe=m.forwardRef(Cr(function(t,a){const{__scopeSwitch:r,...c}=t,s=Ez(sRe,r);return g.jsx(we.span,{"data-state":Pz(s.checked),"data-disabled":s.disabled?"":void 0,...c,ref:a})},"SwitchThumb")),dRe="SwitchBubbleInput",uRe=m.forwardRef(Cr(function({__scopeSwitch:t,onClick:a,...r},c){const{control:s,userClick:u,checked:h,defaultChecked:y,required:p,disabled:b,name:k,value:x,form:M,bubbleInput:_,setBubbleInput:C}=Ez(dRe,t),S=Pe(c,C),L=y2(s),A=m.useRef(!1),N=m.useRef(h),j=m.useRef(u),T=m.useRef(null);m.useEffect(()=>{const q=_;if(!q)return;const $=window.HTMLInputElement.prototype,re=Object.getOwnPropertyDescriptor($,"checked").set;if(!re)return;const F=N.current!==h;N.current=h;const G=u!==null&&u!==j.current;if(j.current=u,G)T.current=F?null:u,F&&re.call(q,h),q.dispatchEvent(new Event("click",{bubbles:!u.hasConsumerStoppedPropagation}));else if(F){const X=T.current;T.current=null;const ae=X?.requestedChecked===h;A.current=!0,re.call(q,h),q.dispatchEvent(new Event("click",{bubbles:!(ae&&X.hasConsumerStoppedPropagation)})),A.current=!1}},[_,h,u]);const R=m.useRef(h);return g.jsx(we.input,{type:"checkbox","aria-hidden":!0,defaultChecked:y??R.current,required:p,disabled:b,name:k,value:x,form:M,...r,tabIndex:-1,ref:S,onClick:ye(a,q=>{A.current&&q.stopPropagation()}),style:{...r.style,...L,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function sY(e){return typeof e=="function"}Cr(sY,"isFunction");function Pz(e){return e?"checked":"unchecked"}Cr(Pz,"getState");function hRe({className:e,...t}){return g.jsx(cRe,{"data-slot":"switch",className:Q("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(lRe,{"data-slot":"switch-thumb",className:Q("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var pRe=Object.defineProperty,Ld=(e,t)=>pRe(e,"name",{value:t,configurable:!0}),lY={Automatic:"automatic",Manual:"manual"},Rz="Tabs",[fRe,DDe]=Vt(Rz,[Sd]),dY=Sd(),[yRe,Dz]=fRe(Rz),mRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,value:c,onValueChange:s,defaultValue:u,orientation:h="horizontal",dir:y,activationMode:p=lY.Automatic,...b}=t,k=Yl(y),[x,M]=Wt({prop:c,onChange:s,defaultProp:u??"",caller:Rz});return g.jsx(yRe,{scope:r,baseId:pt(),value:x,onValueChange:M,orientation:h,dir:k,activationMode:p,children:g.jsx(we.div,{dir:k,"data-orientation":h,...b,ref:a})})},"Tabs")),gRe="TabsList",kRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,loop:c=!0,...s}=t,u=Dz(gRe,r),h=dY(r);return g.jsx(Bq,{asChild:!0,...h,orientation:u.orientation,dir:u.dir,loop:c,children:g.jsx(we.div,{role:"tablist","aria-orientation":u.orientation,...s,ref:a})})},"TabsList")),vRe="TabsTrigger",bRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,value:c,disabled:s=!1,...u}=t,h=Dz(vRe,r),y=dY(r),p=qz(h.baseId,c),b=zz(h.baseId,c),k=c===h.value;return g.jsx(Fq,{asChild:!0,...y,focusable:!s,active:k,children:g.jsx(we.button,{type:"button",role:"tab","aria-selected":k,"aria-controls":b,"data-state":k?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:p,...u,ref:a,onMouseDown:ye(t.onMouseDown,x=>{!s&&x.button===0&&x.ctrlKey===!1?(x.currentTarget.focus(),h.onValueChange(c)):x.preventDefault()}),onKeyDown:ye(t.onKeyDown,x=>{s||x.target!==x.currentTarget||[" ","Enter"].includes(x.key)&&h.onValueChange(c)}),onFocus:ye(t.onFocus,()=>{const x=h.activationMode!==lY.Manual;!k&&!s&&x&&h.onValueChange(c)})})})},"TabsTrigger")),xRe="TabsContent",MRe=m.forwardRef(Ld(function(t,a){const{__scopeTabs:r,value:c,forceMount:s,children:u,...h}=t,y=Dz(xRe,r),p=qz(y.baseId,c),b=zz(y.baseId,c),k=c===y.value,x=m.useRef(k);return m.useEffect(()=>{const M=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(M)},[]),g.jsx(bn,{present:s||k,children:({present:M})=>g.jsx(we.div,{"data-state":k?"active":"inactive","data-orientation":y.orientation,role:"tabpanel","aria-labelledby":p,hidden:!M,id:b,tabIndex:0,...h,ref:a,style:{...t.style,animationDuration:x.current?"0s":void 0},children:M&&u})})},"TabsContent"));function qz(e,t){return`${e}-trigger-${t}`}Ld(qz,"makeTriggerId");function zz(e,t){return`${e}-content-${t}`}Ld(zz,"makeContentId");function wRe({className:e,...t}){return g.jsx(mRe,{"data-slot":"tabs",className:Q("flex flex-col gap-2",e),...t})}function _Re({className:e,...t}){return g.jsx(kRe,{"data-slot":"tabs-list",className:Q("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function SRe({className:e,...t}){return g.jsx(bRe,{"data-slot":"tabs-trigger",className:Q("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",e),...t})}function CRe({className:e,...t}){return g.jsx(MRe,{"data-slot":"tabs-content",className:Q("flex-1 outline-none",e),...t})}function uY({className:e,wrapperHeight:t,ref:a,...r}){return g.jsx("div",{"data-slot":"table-container",ref:a,className:Q("relative w-full overflow-x-auto",t),children:g.jsx("table",{"data-slot":"table",className:Q("w-full caption-bottom text-sm",e),...r})})}function hY({className:e,...t}){return g.jsx("thead",{"data-slot":"table-header",className:Q("[&_tr]:border-b",e),...t})}function pY({className:e,...t}){return g.jsx("tbody",{"data-slot":"table-body",className:Q("[&_tr:last-child]:border-0",e),...t})}function LRe({className:e,...t}){return g.jsx("tfoot",{"data-slot":"table-footer",className:Q("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ju({className:e,...t}){return g.jsx("tr",{"data-slot":"table-row",className:Q("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function J1({className:e,...t}){return g.jsx("th",{"data-slot":"table-head",className:Q("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function fr({className:e,...t}){return g.jsx("td",{"data-slot":"table-cell",className:Q("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function NRe({className:e,...t}){return g.jsx("caption",{"data-slot":"table-caption",className:Q("text-muted-foreground mt-4 text-sm",e),...t})}function fY({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:Q("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const qR=new Map;function IRe(e){if(!e)return Promise.resolve();const t=new URL(e,window.location.href).href;if(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(s=>s.href===t))return Promise.resolve();const r=qR.get(t);if(r)return r;const c=new Promise((s,u)=>{const h=document.createElement("link");h.rel="stylesheet",h.href=t,h.onload=()=>s(),h.onerror=()=>{qR.delete(t),u(new Error(`Failed to load control stylesheet: ${t}`))},document.head.appendChild(h)});return qR.set(t,c),c}async function yY(e,t){const a=IRe(t).catch(c=>{console.error(c)}),r=await import(e);return await a,r}function Tz(e,t,a="default"){return function(c){const[s,u]=m.useState(null);return m.useEffect(()=>{let h=!0;return yY(e(),t()).then(y=>{const p=a==="Component"?y.Component:y.default;if(!p)throw new Error(`Control module does not export "${a}"`);h&&u(()=>p)}),()=>{h=!1}},[]),s?m.createElement(s,c):null}}const mY=()=>window.adminizerVersion??"",ARe=e=>`${window.routePrefix}/assets/controls/${e}.es.js?v=${mY()}`,jRe=e=>`${window.routePrefix}/assets/controls/${e}.css?v=${mY()}`;function gd(e){return{modulePath:ARe(e),cssPath:jRe(e)}}const qB=Tz(()=>gd("jsoneditor").modulePath,()=>gd("jsoneditor").cssPath,"Component"),ERe=Tz(()=>gd("handsontable").modulePath,()=>gd("handsontable").cssPath,"Component"),PRe=Tz(()=>gd("monaco").modulePath,()=>gd("monaco").cssPath,"Component");function I2(e){const a=vd().props,r=a.i18n?.common||{},c=e?.page||a.i18n?.page||a.i18nPage||{};return{t:(u,h)=>c[u]||r[u]||h||u,locale:a.i18n?.locale}}const zR=aj("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),$z=m.forwardRef(({options:e,onValueChange:t,variant:a,processing:r,disabled:c,defaultValue:s=[],placeholder:u="",notFound:h="",search:y="",animation:p=0,maxCount:b=3,modalPopover:k=!1,asChild:x=!1,className:M,mode:_="multiple",onOpenItem:C,onAddNew:S,...L},A)=>{const{t:N}=I2(),[j,T]=m.useState(s),[R,q]=m.useState(!1),[$,ee]=m.useState(!1);m.useEffect(()=>{s&&T(s)},[s]);const re=P=>{if(P.key==="Enter")q(!0);else if(P.key==="Backspace"&&!P.currentTarget.value){const E=[...j];E.pop(),T(E),t(E)}},F=P=>{let E;_==="single"?E=j.includes(P)?[]:[P]:E=j.includes(P)?j.filter(O=>O!==P):[...j,P],T(E),t(E),_==="single"&&q(!1)},G=()=>{T([]),t([])},X=()=>{q(P=>!P)},ae=()=>{const P=j.slice(0,b);T(P),t(P)},he=()=>S?g.jsxs("div",{role:"button",className:Q("m-1 cursor-pointer",$?"animate-bounce":"",zR({variant:a})),style:{animationDuration:`${p}s`},onClick:P=>{P.stopPropagation(),S()},children:[g.jsx(cd,{className:"mr-1 h-3.5 w-3.5"}),g.jsx("span",{children:N("Add")})]}):null;return g.jsxs(sW,{open:R,onOpenChange:q,modal:k,children:[g.jsx(lW,{asChild:!0,children:g.jsx(sn,{ref:A,...L,onClick:X,disabled:c,className:Q("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",M),children:j.length>0?g.jsxs("div",{className:"flex justify-between items-center w-full",children:[g.jsxs("div",{className:"flex flex-wrap items-center",children:[j.slice(0,b).map(P=>{const E=e.find(Y=>Y.value===P),O=E?.icon;return g.jsxs("div",{className:Q($?"animate-bounce":"",zR({variant:a})),style:{animationDuration:`${p}s`},children:[O&&g.jsx(O,{className:"h-4 w-4 mr-2"}),E?.label,C&&g.jsx(Tu,{className:"ml-2 h-4 w-4 cursor-pointer text-muted-foreground hover:text-foreground",onClick:Y=>{Y.stopPropagation(),C(P)}}),g.jsx(bo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:Y=>{Y.stopPropagation(),r||F(P)}})]},P)}),_==="multiple"&&j.length>b&&g.jsxs("div",{className:Q("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",$?"animate-bounce":"",zR({variant:a})),style:{animationDuration:`${p}s`},children:[`+ ${j.length-b} more`,g.jsx(bo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:P=>{P.stopPropagation(),ae()}})]}),he()]}),g.jsxs("div",{className:"flex items-center justify-between",children:[j.length>0&&g.jsxs(g.Fragment,{children:[g.jsx(vr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:P=>{P.stopPropagation(),G()}}),g.jsx(Mz,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),g.jsx(kr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):g.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[g.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:u}),g.jsxs("div",{className:"flex items-center",children:[he(),g.jsx(kr,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})]})})}),g.jsx(dW,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>q(!1),children:g.jsxs(Rq,{children:[g.jsx(YG,{placeholder:y,onKeyDown:re}),g.jsxs(XG,{children:[g.jsx(KG,{children:h}),g.jsx(QG,{children:e.map(P=>{const E=j.includes(P.value);return g.jsxs(eZ,{onSelect:()=>F(P.value),className:"cursor-pointer",children:[g.jsx("div",{className:Q("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",E?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:g.jsx(Ua,{className:"h-4 w-4 text-primary-foreground"})}),P.icon&&g.jsx(P.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),g.jsx("span",{children:P.label})]},P.value)})}),g.jsx(JG,{})]})]})}),p>0&&j.length>0&&_==="multiple"&&g.jsx(gr,{className:Q("cursor-pointer my-2 text-foreground bg-background w-3 h-3",$?"":"text-muted-foreground"),onClick:()=>ee(!$)})]})});$z.displayName="MultiSelect";const gY={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},kY=e=>({...e??{},_ts:Date.now()}),RRe=e=>{if(e==="")return"";try{return JSON.parse(e)}catch{return e}},zB=e=>{if(typeof e!="string")return!1;const t=e.trim().toLowerCase();return t.startsWith("<!doctype html")||t.startsWith("<html")||t.startsWith("<")},DRe=e=>{const t={};return e.forEach((a,r)=>{t[r.toLowerCase()]=a}),t},qRe=e=>{if(typeof document>"u")return;const t=document.cookie.split("; ").find(a=>a.startsWith(`${encodeURIComponent(e)}=`));return t?decodeURIComponent(t.split("=").slice(1).join("=")):void 0},zRe=(e,t)=>{const a=new URL(e,window.location.origin);return Object.entries(kY(t)).forEach(([r,c])=>{if(c!=null){if(Array.isArray(c)){c.forEach(s=>a.searchParams.append(r,String(s)));return}a.searchParams.set(r,String(c))}}),`${a.pathname}${a.search}${a.hash}`},TRe=async(e,t,a,r)=>{const c=qRe("XSRF-TOKEN"),s=new Headers(gY);s.set("X-Requested-With","XMLHttpRequest"),c&&s.set("x-xsrf-token",c),Object.entries(r?.headers??{}).forEach(([k,x])=>{x!=null&&s.set(k,String(x))});let u;a instanceof FormData?u=a:a!=null&&(u=typeof a=="string"?a:JSON.stringify(a),s.has("Content-Type")||s.set("Content-Type","application/json"));const h=await fetch(zRe(t,r?.params),{method:e.toUpperCase(),body:u,headers:s,credentials:"same-origin",signal:r?.signal}),y=DRe(h.headers);let p;switch(r?.responseType){case"arraybuffer":p=await h.arrayBuffer();break;case"document":{const k=await h.text(),x=new DOMParser,M=y["content-type"]?.includes("xml")?"application/xml":"text/html";p=x.parseFromString(k,M);break}default:p=await h.blob();break}const b={data:p,status:h.status,headers:y};if(!h.ok){const k=new Error(`Request failed with status ${h.status}`);throw k.response=b,k}return b},ed=async(e,t,a,r)=>{if(r?.responseType&&r.responseType!=="json"&&r.responseType!=="text")return TRe(e,t,a,r);const c=await kd.getClient().request({method:e,url:t,data:a,params:kY(r?.params),headers:{...gY,...r?.headers??{}},signal:r?.signal});return{data:RRe(c.data),status:c.status,headers:c.headers}},Su=async(e,t,a,r)=>{try{const c=await ed(e,t,a,r),s=String(c.headers?.["content-type"]??"").toLowerCase();if(s&&!s.includes("application/json")||zB(c.data))throw new Error(`Expected JSON response from "${t}", but received "${s||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return c}catch(c){const s=c,u=String(s.response?.headers?.["content-type"]??"").toLowerCase();throw zB(s.response?.data)||u.includes("text/html")?new Error("Server returned HTML instead of JSON. Most likely auth session expired. Please reload the page and log in again."):c}},Ha={get:(e,t)=>ed("get",e,void 0,t),post:(e,t,a)=>ed("post",e,t,a),put:(e,t,a)=>ed("put",e,t,a),patch:(e,t,a)=>ed("patch",e,t,a),delete:(e,t,a)=>ed("delete",e,t,a),getJson:(e,t)=>Su("get",e,void 0,t),postJson:(e,t,a)=>Su("post",e,t,a),putJson:(e,t,a)=>Su("put",e,t,a),patchJson:(e,t,a)=>Su("patch",e,t,a),deleteJson:(e,t,a)=>Su("delete",e,t,a)},$Re="axios-compat is a legacy compatibility API. Please use adminApi from @/lib/admin-api instead.",td=()=>{console.log($Re)};td();const Cu=e=>{if(typeof e=="object"&&e!==null&&"isAxiosError"in e)return e;const t=e instanceof Error?e.message:"Request failed",a=new Error(t);a.isAxiosError=!0;const r=e.response;return r&&(a.response=r),a},ORe={async get(e,t){td();try{return await Ha.get(e,t)}catch(a){throw Cu(a)}},async post(e,t,a){td();try{return await Ha.post(e,t,a)}catch(r){throw Cu(r)}},async put(e,t,a){td();try{return await Ha.put(e,t,a)}catch(r){throw Cu(r)}},async patch(e,t,a){td();try{return await Ha.patch(e,t,a)}catch(r){throw Cu(r)}},async delete(e,t){td();try{return await Ha.delete(e,t?.data,t)}catch(a){throw Cu(a)}},isAxiosError(e){return!!(e&&typeof e=="object"&&"isAxiosError"in e)}};function ZA({iconNode:e,className:t,...a}){return g.jsx(e,{className:Q("h-4 w-4",t),...a})}const vY=m.forwardRef(({btnTitle:e,link:t,delModal:a,handleDelete:r,variant:c,btnCLass:s,isLink:u=!0},h)=>{const{t:y}=I2();return g.jsxs(yj,{children:[g.jsx(FG,{asChild:!0,children:g.jsxs(sn,{ref:h,size:"list",variant:c??"ghost",className:Q("cursor-pointer",s),children:[g.jsx(ZA,{iconNode:Bu}),e]})}),g.jsxs(mj,{className:"sm:max-w-[425px] z-[1011]",children:[g.jsxs(gj,{children:[g.jsx(kj,{children:y("Delete")}),g.jsx("div",{className:"mt-2 text-base",children:a.text})]}),g.jsxs(ZG,{children:[g.jsx(hD,{asChild:!0,children:u?g.jsx(sn,{variant:"destructive",asChild:!0,children:g.jsx(RA,{href:t??"#",children:a.yes})}):g.jsx(sn,{variant:"destructive",asChild:!0,onClick:r,children:g.jsx("span",{children:a.yes})})}),g.jsx(hD,{asChild:!0,children:g.jsx(sn,{type:"button",variant:"secondary",children:a.no})})]})]})]})});vY.displayName="DeleteModal";function Lu({moduleComponent:e,cssPath:t,options:a,initialValue:r,onChange:c,name:s,disabled:u}){const[h,y]=m.useState(null);return m.useEffect(()=>{let p=!0;const b=async()=>{const k=await yY(e,t);p&&y(()=>k.default)};return y(null),b(),()=>{p=!1}},[e,t]),h?g.jsx(h,{initialValue:r,options:a,onChange:c,name:s,disabled:u}):null}const HRe=g.jsx("svg",{width:"10",height:"10",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",children:g.jsx("path",{d:"M2.99998 -0.000206962C2.7441 -0.000206962 2.48794 0.0972617 2.29294 0.292762L0.292945 2.29276C-0.0980552 2.68376 -0.0980552 3.31682 0.292945 3.70682L7.58591 10.9998L0.292945 18.2928C-0.0980552 18.6838 -0.0980552 19.3168 0.292945 19.7068L2.29294 21.7068C2.68394 22.0978 3.31701 22.0978 3.70701 21.7068L11 14.4139L18.2929 21.7068C18.6829 22.0978 19.317 22.0978 19.707 21.7068L21.707 19.7068C22.098 19.3158 22.098 18.6828 21.707 18.2928L14.414 10.9998L21.707 3.70682C22.098 3.31682 22.098 2.68276 21.707 2.29276L19.707 0.292762C19.316 -0.0982383 18.6829 -0.0982383 18.2929 0.292762L11 7.58573L3.70701 0.292762C3.51151 0.0972617 3.25585 -0.000206962 2.99998 -0.000206962Z"})}),VRe="_Wrapper_18nsw_1",BRe="_active_18nsw_7",FRe="_Page_18nsw_8",URe="_clone_18nsw_18",GRe="_Remove_18nsw_29",ZRe="_insertBefore_18nsw_35",WRe="_insertAfter_18nsw_36",YRe="_vertical_18nsw_44",pr={Wrapper:VRe,active:BRe,Page:FRe,clone:URe,Remove:GRe,insertBefore:ZRe,insertAfter:WRe,vertical:YRe};var XRe=(e=>(e[e.Before=-1]="Before",e[e.After=1]="After",e))(XRe||{}),bY=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e.Grid="grid",e))(bY||{});const qDe=m.forwardRef(function({id:t,index:a,active:r,clone:c,insertPosition:s,layout:u,onRemove:h,style:y,url:p,mimeType:b,fileName:k,...x},M){const _=b?.startsWith("image/");return g.jsxs("li",{className:Q(pr.Wrapper,r&&pr.active,c&&pr.clone,s===-1&&pr.insertBefore,s===1&&pr.insertAfter,u==="vertical"&&pr.vertical),style:y,ref:M,children:[g.jsxs("button",{className:`${pr.Page} after:bg-black dark:after:bg-gray-300`,"data-id":t.toString(),...x,children:[g.jsx("img",{src:p,alt:"",className:"absolute top-0 left-0 w-full h-full object-cover overflow-hidden rounded-[5px]"}),!_&&g.jsx("div",{className:"absolute inset-x-0 bottom-0 break-words text-white text-sm font-medium bg-black/75 h-[40%] rounded-b-[5px] p-2",children:k})]}),!r&&h?g.jsx("button",{className:pr.Remove,onClick:h,children:HRe}):null]})}),xY=m.createContext(null),KRe=()=>m.useContext(xY),QRe=({entry:e,onSaved:t})=>e.loading||!e.props?g.jsx("div",{className:"flex items-center justify-center h-full w-full",children:g.jsx(wa,{className:"h-6 w-6 animate-spin"})}):e.error?g.jsx("div",{className:"p-4 text-red-500",children:e.error}):g.jsx("div",{className:"h-full",children:g.jsx(wY,{page:{props:e.props},catalog:!0,callback:()=>t()})}),zDe=({children:e})=>{const t=m.useRef(null),[a,r]=m.useState([]),c=m.useRef(0),s=m.useCallback(async(k,x,M)=>{try{const _=M===null?`${window.routePrefix}/model/${x}/add?without_layout=true`:`${window.routePrefix}/model/${x}/edit/${M}?without_layout=true`,C=await Ha.get(_),S=C.data?.props??C.data;r(L=>{const A=[...L];return A[k]&&A[k].model===x&&A[k].id===M&&(A[k]={...A[k],loading:!1,props:S}),A})}catch(_){r(C=>{const S=[...C];return S[k]&&S[k].model===x&&S[k].id===M&&(S[k]={...S[k],loading:!1,error:_?.message||"Error"}),S})}},[]),u=m.useCallback((k,x)=>{r(M=>{const _=M.length,C={model:k,id:x,props:null,loading:!0};return s(_,k,x),[...M,C]})},[s]),h=m.useCallback(k=>{r(x=>{const M=x.length,_={model:k,id:null,props:null,loading:!0};return s(M,k,null),[...x,_]})},[s]);m.useEffect(()=>{const k=c.current,x=a.length;if(x>k)if(k===0)t.current?.open();else for(let M=0;M<x-k;M++)t.current?.next();c.current=x},[a.length]);const y=m.useCallback(k=>{k||(r([]),c.current=0)},[]),p=m.useCallback(()=>{r(k=>k.length<=1?(t.current?.close(),c.current=0,[]):(t.current?.prev(),c.current=k.length-1,k.slice(0,-1)))},[]),b=m.useMemo(()=>({open:u,openCreate:h}),[u,h]);return g.jsxs(xY.Provider,{value:b,children:[e,g.jsxs(Ej,{ref:t,onOpenChange:y,children:[g.jsx(sz,{}),a.length>0&&g.jsx(lz,{children:a.map((k,x)=>g.jsx(dz,{children:g.jsx(QRe,{entry:k,onSaved:p})},`${k.model}-${k.id}-${x}`))})]})]})},JRe=m.lazy(()=>cn(()=>import("./media-manager-SrUV61oz.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),MY=m.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:s})=>{const u=KRe(),h=m.useCallback(N=>{a(e.name,N.target.value)},[a,e.name]),y=m.useCallback(N=>{a(e.name,N[0])},[a,e.name]),p=m.useCallback(N=>{a(e.name,N)},[a,e.name]),b=m.useCallback(N=>{a(e.name,N)},[a,e.name]),k=m.useCallback(N=>{a(e.name,N)},[a,e.name]),x=m.useCallback(N=>{a(e.name,N)},[a,e.name]),M=m.useCallback(N=>{a(e.name,N.json)},[a,e.name]),_=m.useCallback(N=>{a(e.name,N)},[a,e.name]),C=m.useCallback(N=>{a(e.name,N)},[a,e.name]),S=m.useCallback(N=>{a(e.name,N)},[a,e.name]),L=m.useCallback(N=>{const j=N.map(T=>({id:T.id,url:T.url,mimeType:T.mimeType,filename:T.filename}));a(e.name,j)},[a,e.name]),A=m.useMemo(()=>e.type==="color"?"max-w-[40px] p-px h-[40px] border-transparent":["date","datetime-local","time","month","week"].includes(e.type)?"w-fit":"",[]);switch(e.type){case"checkbox":return g.jsx(OA,{id:`${e.type}-${e.name}`,disabled:r||e.disabled,tabIndex:1,required:e.required,className:"cursor-pointer size-5 scroll-pt-30 scroll-mt-30",checked:t??!1,onCheckedChange:p});case"textarea":return g.jsx(fY,{id:`${e.type}-${e.name}`,tabIndex:1,disabled:r||e.disabled,value:t??"",required:e.required,onChange:h,placeholder:e.label,className:"scroll-pt-30 scroll-mt-30"});case"range":return g.jsxs(g.Fragment,{children:[g.jsx("output",{children:t}),g.jsx(oY,{defaultValue:[Number(e.value)||0],value:[Number(t)||0],max:e.options?.max?Number(e.options.max):100,min:e.options?.min?Number(e.options.min):0,step:1,id:`${e.type}-${e.name}`,onValueChange:y,disabled:r||e.disabled})]});case"select":return g.jsxs(kW,{onValueChange:b,value:t??"",disabled:r||e.disabled,required:e.required,children:[g.jsx(bW,{className:"w-full cursor-pointer min-h-10 scroll-pt-30 scroll-mt-30",id:e.name,children:g.jsx(vW,{placeholder:""})}),g.jsx(xW,{className:"z-[9999999]",children:(Array.isArray(e.isIn)?e.isIn.map(N=>[N,N]):Object.entries(e.isIn)).map(([N,j])=>g.jsx(MW,{value:String(N),children:String(j)},String(N)))})]});case"association":case"association-many":case"select-many":{const j=(e.type==="association"||e.type==="association-many")&&!!e.relatedModel&&!!u,T=j?q=>u.open(e.relatedModel,q):void 0,R=j&&e.canCreateRelated?()=>u.openCreate(e.relatedModel):void 0;return g.jsx($z,{options:e.options,onValueChange:S,defaultValue:t??[],variant:"secondary",notFound:c,search:s,disabled:r||e.disabled,mode:e.type==="association"?"single":"multiple",maxCount:10,onOpenItem:T,onAddNew:R,className:`${r?"pointer-events-none":""} scroll-pt-30 scroll-mt-30`})}case"wysiwyg":case"markdown":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??"",name:`${e.type}-${e.name}`,onChange:k,disabled:r||e.disabled});case"table":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:x,disabled:r||e.disabled});case"jsonEditor":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t,name:`${e.type}-${e.name}`,onChange:M,disabled:r||e.disabled});case"codeEditor":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??"",name:`${e.type}-${e.name}`,onChange:_,disabled:r||e.disabled});case"geoJson":return g.jsx(Lu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:C,disabled:r||e.disabled});case"mediamanager":case"single-file":return g.jsx(JRe,{layout:bY.Grid,value:t,onChange:L,config:{...e.options},type:e.type,name:e.name});default:return g.jsx(hz,{id:e.name,type:e.type,className:`${A} min-h-10 scroll-pt-30 scroll-mt-30`,required:e.required,tabIndex:1,value:t??"",onChange:h,disabled:r||e.disabled,placeholder:e.label})}});var wD=new Map,ih=new WeakMap,TB=0,eDe=void 0;function tDe(e){return e?(ih.has(e)||(TB+=1,ih.set(e,TB.toString())),ih.get(e)):"0"}function nDe(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?tDe(e.root):e[t]}`).toString()}function aDe(e){const t=nDe(e);let a=wD.get(t);if(!a){const r=new Map;let c;const s=new IntersectionObserver(u=>{u.forEach(h=>{var y;const p=h.isIntersecting&&c.some(b=>h.intersectionRatio>=b);e.trackVisibility&&typeof h.isVisible>"u"&&(h.isVisible=p),(y=r.get(h.target))==null||y.forEach(b=>{b(p,h)})})},e);c=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:s,elements:r},wD.set(t,a)}return a}function oDe(e,t,a={},r=eDe){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const y=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:y,intersectionRect:y,rootBounds:y}),()=>{}}const{id:c,observer:s,elements:u}=aDe(a),h=u.get(e)||[];return u.has(e)||u.set(e,h),h.push(t),s.observe(e),function(){h.splice(h.indexOf(t),1),h.length===0&&(u.delete(e),s.unobserve(e)),u.size===0&&(s.disconnect(),wD.delete(c))}}function rDe({threshold:e,delay:t,trackVisibility:a,rootMargin:r,root:c,triggerOnce:s,skip:u,initialInView:h,fallbackInView:y,onChange:p}={}){var b;const[k,x]=m.useState(null),M=m.useRef(p),[_,C]=m.useState({inView:!!h,entry:void 0});M.current=p,m.useEffect(()=>{if(u||!k)return;let N;return N=oDe(k,(j,T)=>{C({inView:j,entry:T}),M.current&&M.current(j,T),T.isIntersecting&&s&&N&&(N(),N=void 0)},{root:c,rootMargin:r,threshold:e,trackVisibility:a,delay:t},y),()=>{N&&N()}},[Array.isArray(e)?e.toString():e,k,c,r,s,u,a,y,t]);const S=(b=_.entry)==null?void 0:b.target,L=m.useRef(void 0);!k&&S&&!s&&!u&&L.current!==S&&(L.current=S,C({inView:!!h,entry:void 0}));const A=[x,_.inView,_.entry];return A.ref=A[0],A.inView=A[1],A.entry=A[2],A}const iDe={errors:{}},Oz=new Proxy(iDe,{set(e,t,a){return t==="errors"&&(Object.keys(a).length===0?e.errors={}:e.errors={...e.errors,...a}),!0}}),$B=e=>Oz.errors[e]?.message,OB=()=>Object.values(Oz.errors).some(e=>e.hasError),HB=()=>{Oz.errors={}};function VB({message:e,className:t="",...a}){return e?g.jsx("p",{...a,className:Q("text-sm text-red-600 dark:text-red-400",t),children:e}):null}const cDe=({changes:e,title:t="Changes",className:a="",messages:r={}})=>{const{t:c}=I2({page:r}),s=(y,p)=>c(y,p);if(!e||e.length===0)return g.jsx("div",{className:Q("bg-muted border border-border rounded-lg p-4",a),children:g.jsxs("div",{className:"flex items-center text-muted-foreground",children:[g.jsx($u,{className:"w-5 h-5 mr-2"}),g.jsx("span",{children:s("Changes not found","Changes not found")})]})});const u=y=>y===null?"null":y===void 0?"—":typeof y=="boolean"?y?s("Yes","Yes"):s("No","No"):typeof y=="object"?JSON.stringify(y):String(y),h=y=>y.oldValue===void 0?"added":y.newValue===void 0?"removed":"modified";return g.jsxs("div",{className:Q("bg-card border border-border rounded-lg shadow-sm",a),children:[g.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted",children:g.jsxs("h3",{className:"text-lg font-semibold text-card-foreground flex items-center",children:[g.jsx(fn,{className:"w-5 h-5 mr-2"}),t," (",e.length,")"]})}),g.jsx("div",{className:"divide-y divide-border",children:e.map((y,p)=>{const b=h(y),k=b==="added"?cd:b==="removed"?Hu:fn,x=Q("text-xs px-2 py-1 rounded-full bg-opacity-10",b==="added"&&"text-green-600 bg-green-100",b==="removed"&&"text-destructive bg-destructive/20",b==="modified"&&"text-primary bg-primary/20"),M=b==="added"?"text-green-600":b==="removed"?"text-destructive":"text-primary";return g.jsxs("div",{className:"p-4 hover:bg-muted/50 transition-colors",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center",children:[me.createElement(k,{className:Q("w-4 h-4 mr-2",M)}),g.jsx("span",{className:"font-medium text-card-foreground",children:y.field})]}),g.jsx("span",{className:x,children:b==="added"?s("Added","Added"):b==="removed"?s("Removed","Removed"):s("Updated","Updated")})]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[b!=="added"&&g.jsxs("div",{className:"p-2 bg-destructive/10 border border-destructive/20 rounded",children:[g.jsxs("div",{className:"text-xs text-destructive font-medium mb-1",children:[s("Old","Old"),":"]}),g.jsx("div",{className:"text-destructive-foreground font-mono break-words",children:u(y.oldValue)})]}),b!=="removed"&&g.jsxs("div",{className:"p-2 bg-green-50 border border-green-100 rounded",children:[g.jsxs("div",{className:"text-xs text-green-600 font-medium mb-1",children:[s("New","New"),":"]}),g.jsx("div",{className:"text-green-800 font-mono break-words",children:u(y.newValue)})]})]}),b==="modified"&&g.jsxs("div",{className:"mt-2 flex items-center text-xs text-muted-foreground",children:[g.jsx(qu,{className:"w-3 h-3 mr-1"}),s("changed type","changed type"),": ",y.type]})]},p)})})]})},sDe=({modelName:e,modelId:t,handleWatchHistory:a})=>{const[r,c]=m.useState([]),[s,u]=m.useState(!1),[h,y]=m.useState(null),[p,b]=m.useState(!0),k="currentHistoryView",{t:x}=I2(),M=x("Diff");m.useEffect(()=>{(async()=>{b(!0);try{const L=await Ha.post(`${window.routePrefix}/history/get-model-history`,{modelName:e,modelId:t});L.data.data&&c(L.data.data)}catch(L){console.log(L)}finally{b(!1)}})()},[e,t]);const _=async S=>{try{const L=await Ha.post(`${window.routePrefix}/history/get-model-fields`,{historyId:S});L.data.data&&(localStorage.setItem(k,S.toString()),a(L.data.data))}catch(L){console.log(L)}},C=S=>{const L=localStorage.getItem(k);return L?L===S.id.toString():S.isCurrent};return g.jsx("div",{className:"relative h-full",children:g.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[g.jsxs(uY,{wrapperHeight:"max-h-full",children:[g.jsx(hY,{className:"sticky top-0 bg-background shadow",children:g.jsxs(ju,{children:[g.jsx(J1,{className:"p-2 text-left",children:x("Date")}),g.jsx(J1,{className:"p-2 text-left",children:x("Event")}),g.jsx(J1,{className:"p-2 text-left",children:x("User")}),g.jsx(J1,{className:"p-2 text-left",children:M}),g.jsx(J1,{className:"p-2 text-left"})]})}),g.jsx(pY,{children:p?g.jsx(ju,{children:g.jsx(fr,{colSpan:5,className:"p-10 text-center",children:g.jsx(wa,{className:"mx-auto size-8 animate-spin"})})}):r.length>0?r.map(S=>g.jsxs(ju,{children:[g.jsx(fr,{className:"p-2 self-start pt-2.5",children:new Date(S.createdAt).toLocaleString()}),g.jsx(fr,{className:"p-2 self-start pt-2.5 capitalize",children:S.action}),g.jsx(fr,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:g.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:S.user.login})}),g.jsx(fr,{className:"p-2 align-middle",children:g.jsx(sn,{variant:"green",size:"sm",onClick:()=>{y(S.diff),u(!0)},children:g.jsx(yr,{})})}),g.jsx(fr,{className:"p-2 align-middle text-center",children:C(S)?g.jsx("span",{className:"font-medium",children:x("Current")}):g.jsx(sn,{variant:"outline",size:"sm",onClick:()=>_(S.id),children:x("Watch")})})]},S.id)):g.jsx(ju,{children:g.jsx(fr,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:x("There is no history")})})})]}),g.jsx(yj,{open:s,onOpenChange:S=>{u(S),S||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:g.jsxs(mj,{className:"z-[1022] sm:max-w-[60vw]",children:[g.jsx(gj,{children:g.jsx(kj,{children:M})}),g.jsx(cDe,{changes:h,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},lDe=({dialogRef:e,modelId:t,modelName:a,callback:r})=>g.jsxs(Ej,{ref:e,children:[g.jsx(sz,{}),g.jsx(lz,{children:g.jsx(dz,{children:g.jsx(sDe,{modelId:t,modelName:a,handleWatchHistory:r})})})]}),BB=m.memo(({field:e})=>!e||typeof e!="object"||!e.label?(console.error("Invalid field for LabelRenderer:",e),null):g.jsxs("div",{className:"flex gap-3",children:[g.jsx(UA,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&g.jsx(Tj,{children:g.jsxs(Sz,{children:[g.jsx(Cz,{onClick:t=>t.preventDefault(),children:g.jsx(ZA,{iconNode:Ou,className:"text-primary w-5 h-5 cursor-pointer"})}),g.jsx(Lz,{align:"center",side:"top",className:"z-1002",children:g.jsx("p",{children:e.tooltip})})]})})]})),dDe=m.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:s,invalidFieldMessage:u})=>{if(!e||typeof e!="object"||!e.name||!e.type)return console.error("Invalid field for LazyField:",e),g.jsx("div",{className:"text-red-500",children:u||"Error: Invalid field data"});const[h,y]=rDe({triggerOnce:!0,rootMargin:"100px 0px"});return g.jsx("div",{ref:h,className:"grid gap-4 w-full",children:y?g.jsx(MY,{field:e,value:t,onChange:a,notFound:c,search:s,processing:r}):g.jsx(GA,{className:"w-full h-[250px] rounded-sm"})})}),wY=({page:e,catalog:t,callback:a,openNewWindow:r,openNewWindowLabel:c,isNavigation:s,DnavVisible:u,visibleLable:h})=>{const{btnBack:y,btnHistory:p,view:b,edit:k,history:x,notFound:M,model:_,fields:C}=e.props,{t:S}=I2(),{data:L,setData:A,post:N,processing:j,transform:T,errors:R}=nq({...Object.fromEntries((C||[]).map(E=>[E.name,E.value??void 0])),jsonPopupCatalog:t}),[q,$]=m.useState(!1),[ee,re]=m.useState(r??!1),[F,G]=m.useState(u??!1),X=m.useRef(null);m.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),m.useEffect(()=>(re(r??!1),HB(),A({...Object.fromEntries((C||[]).map(E=>[E.name,(E.type==="mediamanager"||E.type==="single-file")&&(E.value===null||E.value===void 0)?[]:E.value])),jsonPopupCatalog:t}),()=>HB()),[C,t,r,A]);const ae=m.useCallback((E,O)=>{A(E,O)},[A]);if(!Array.isArray(C))return console.error("Fields is not an array:",C),g.jsx("div",{className:"p-4 text-red-500",children:S("Error: Fields data is invalid")});if(C.length===0)return console.warn("Fields array is empty"),g.jsx("div",{className:"p-4 text-gray-500",children:S("No fields to display")});const he=C.filter(E=>!E||typeof E!="object"||!E.name||!E.type||!E.label);if(he.length>0)return console.error("Invalid fields found:",he),g.jsx("div",{className:"p-4 text-red-500",children:S("Error: Some fields are missing required properties (name, type, label)")});const P=async E=>{if(E.preventDefault(),t){$(!0);try{const O=await Ha.post(e.props.postLink,L);O.status===200&&a&&(s?a(O.data.record,ee,F):a(O.data.record))}catch(O){const Y=O?.response;rY.error(Y?.data?.error??S("Error: Invalid field data"))}finally{$(!1)}}else{const O=localStorage.getItem("backUrl");T(Y=>({...Y,redirectUrl:O??""})),N(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return g.jsxs("div",{className:"w-full min-w-0",children:[g.jsx("div",{className:"w-full sticky z-[1001] top-0 bg-background shadow-md lg:hidden",children:g.jsxs("div",{className:"p-4 flex gap-4",children:[!t&&g.jsx(sn,{className:"w-fit",asChild:!0,children:g.jsxs(RA,{href:y.link,preserveScroll:!0,children:[g.jsx(ZA,{iconNode:id}),y.title]})}),g.jsxs(sn,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:q||j||e.props.view||OB(),children:[q||j&&g.jsx(wa,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]}),x&&(k||b)&&g.jsx("div",{className:"flex gap-2 justify-start",children:g.jsx(sn,{variant:"outline",className:"w-fit",onClick:E=>{E.preventDefault(),X.current?.open()},children:p.title})})]})}),g.jsxs("div",{className:"p-4 w-full mt-6",children:[g.jsx("form",{id:"addUserForm",onSubmit:P,className:b?"cursor-not-allowed":"",children:g.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[g.jsx("div",{className:"flex flex-col gap-10",children:C.map(E=>g.jsx("div",{className:`grid gap-4 w-full ${b?"pointer-events-none":""}`,children:E.type==="markdown"||E.type==="table"||E.type==="jsonEditor"||E.type==="codeEditor"||E.type==="geoJson"?g.jsxs(g.Fragment,{children:[g.jsx(BB,{field:E}),g.jsx(VB,{message:R[E.name]??$B(`${E.type}-${E.name}`)}),g.jsx(dDe,{field:E,value:L[E.name],onChange:ae,processing:q||j||b,notFound:M,search:e.props.search,invalidFieldMessage:S("Error: Invalid field data")})]}):g.jsxs(g.Fragment,{children:[g.jsx(BB,{field:E}),g.jsx(VB,{message:R[E.name]??$B(`${E.type}-${E.name}`)}),g.jsx(MY,{field:E,value:L[E.name],onChange:ae,processing:q||j||b,notFound:M,search:e.props.search})]})},E.name))}),g.jsxs("div",{className:"p-4 rounded-md h-fit sticky top-[54px] hidden lg:grid gap-4 shadow",children:[g.jsxs("div",{className:"flex gap-4",children:[!t&&g.jsx(sn,{className:"w-fit",asChild:!0,children:g.jsxs(RA,{href:y.link,preserveScroll:!0,children:[g.jsx(ZA,{iconNode:id}),y.title]})}),g.jsxs(sn,{variant:"green",type:"submit",className:"w-fit",disabled:q||j||e.props.view||OB(),children:[(q||j)&&g.jsx(wa,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex gap-4 items-center",children:[g.jsx(OA,{id:"targetBlank",checked:ee,onCheckedChange:E=>re(!!E),className:"cursor-pointer size-5"}),g.jsx(UA,{htmlFor:"targetBlank",children:c})]}),g.jsxs("div",{className:"flex gap-4 items-center",children:[g.jsx(OA,{id:"visible",checked:F,onCheckedChange:E=>G(!!E),className:"cursor-pointer size-5"}),g.jsx(UA,{htmlFor:"visible",children:h})]})]}),x&&(k||b)&&g.jsx("div",{className:"flex gap-2 justify-start",children:g.jsx(sn,{variant:"outline",className:"w-fit",onClick:E=>{E.preventDefault(),X.current?.open()},children:p.title})})]})]})}),x&&(k||b)&&g.jsx(lDe,{dialogRef:X,modelName:_,modelId:C.find(E=>E.name==="id")?.value,callback:E=>{for(const O of Object.keys(E))A(O,E[O]);X.current?.close()}})]})]})};function uDe(){window.UIComponents??={},window.JSComponents??={},window.sonner=eRe,window.axios=ORe,window.cn=Q,Object.assign(window.UIComponents,{Avatar:gne,AvatarImage:kne,AvatarFallback:vne,Badge:xne,Breadcrumb:w7e,BreadcrumbList:_7e,BreadcrumbItem:S7e,BreadcrumbLink:C7e,BreadcrumbPage:L7e,BreadcrumbSeparator:N7e,BreadcrumbEllipsis:I7e,Button:sn,Calendar:m_e,Card:g_e,CardHeader:k_e,CardFooter:w_e,CardTitle:v_e,CardAction:x_e,CardDescription:b_e,CardContent:M_e,Checkbox:OA,Collapsible:nSe,CollapsibleTrigger:aSe,CollapsibleContent:oSe,Command:Rq,CommandDialog:ECe,CommandInput:YG,CommandList:XG,CommandEmpty:KG,CommandGroup:QG,CommandItem:eZ,CommandShortcut:PCe,CommandSeparator:JG,ContextMenu:tIe,ContextMenuTrigger:nIe,ContextMenuContent:lIe,ContextMenuItem:dIe,ContextMenuCheckboxItem:uIe,ContextMenuRadioItem:hIe,ContextMenuLabel:pIe,ContextMenuSeparator:fIe,ContextMenuShortcut:yIe,ContextMenuGroup:aIe,ContextMenuPortal:oIe,ContextMenuSub:rIe,ContextMenuSubContent:sIe,ContextMenuSubTrigger:cIe,ContextMenuRadioGroup:iIe,Dialog:yj,DialogClose:hD,DialogContent:mj,DialogDescription:WG,DialogFooter:ZG,DialogHeader:gj,DialogOverlay:GG,DialogPortal:UG,DialogTitle:kj,DialogTrigger:FG,DialogStack:Ej,DialogStackTrigger:mIe,DialogStackOverlay:sz,DialogStackBody:lz,DialogStackContent:dz,DialogStackTitle:gIe,DialogStackDescription:kIe,DialogStackHeader:vIe,DialogStackFooter:bIe,DialogStackNext:xIe,DialogStackPrevious:MIe,DropdownMenu:HIe,DropdownMenuPortal:VIe,DropdownMenuTrigger:BIe,DropdownMenuContent:FIe,DropdownMenuGroup:UIe,DropdownMenuLabel:XIe,DropdownMenuItem:GIe,DropdownMenuCheckboxItem:ZIe,DropdownMenuRadioGroup:WIe,DropdownMenuRadioItem:YIe,DropdownMenuSeparator:KIe,DropdownMenuShortcut:QIe,DropdownMenuSub:JIe,DropdownMenuSubTrigger:eAe,DropdownMenuSubContent:tAe,Input:hz,Label:UA,Menubar:LAe,MenubarPortal:aW,MenubarMenu:NAe,MenubarTrigger:jAe,MenubarContent:EAe,MenubarGroup:IAe,MenubarSeparator:zAe,MenubarLabel:qAe,MenubarItem:PAe,MenubarShortcut:TAe,MenubarCheckboxItem:RAe,MenubarRadioGroup:AAe,MenubarRadioItem:DAe,MenubarSub:$Ae,MenubarSubTrigger:OAe,MenubarSubContent:HAe,Pagination:VAe,PaginationContent:BAe,PaginationLink:fz,PaginationItem:FAe,PaginationPrevious:UAe,PaginationNext:GAe,PaginationEllipsis:ZAe,Popover:sW,PopoverTrigger:lW,PopoverContent:dW,PopoverAnchor:sje,Select:kW,SelectContent:xW,SelectGroup:tEe,SelectItem:MW,SelectLabel:nEe,SelectScrollDownButton:_W,SelectScrollUpButton:wW,SelectSeparator:aEe,SelectTrigger:bW,SelectValue:vW,Separator:Mz,Sheet:LW,SheetTrigger:cEe,SheetClose:sEe,SheetContent:NW,SheetHeader:IW,SheetFooter:uEe,SheetTitle:AW,SheetDescription:jW,Sidebar:DEe,SidebarContent:BEe,SidebarFooter:HEe,SidebarGroup:FEe,SidebarGroupAction:GEe,SidebarGroupContent:ZEe,SidebarGroupLabel:UEe,SidebarHeader:OEe,SidebarInput:$Ee,SidebarInset:TEe,SidebarMenu:WEe,SidebarMenuAction:QEe,SidebarMenuBadge:JEe,SidebarMenuButton:KEe,SidebarMenuItem:YEe,SidebarMenuSkeleton:ePe,SidebarMenuSub:tPe,SidebarMenuSubButton:aPe,SidebarMenuSubItem:nPe,SidebarProvider:REe,SidebarRail:zEe,SidebarSeparator:VEe,SidebarTrigger:qEe,useSidebar:L2,Skeleton:GA,Slider:oY,Toaster:tRe,Switch:hRe,Tabs:wRe,TabsList:_Re,TabsTrigger:SRe,TabsContent:CRe,Table:uY,TableHeader:hY,TableBody:pY,TableFooter:LRe,TableHead:J1,TableRow:ju,TableCell:fr,TableCaption:NRe,Textarea:fY,Tooltip:Sz,TooltipTrigger:Cz,TooltipContent:Lz,TooltipProvider:Tj,VanillaJSONEditor:qB}),Object.assign(window.JSComponents,{VanillaJSONEditor:qB,HandsonTable:ERe,MonacoEditor:PRe,MultiSelect:$z,DeleteModal:vY,AddForm:wY,adminApi:Ha})}const{createInertiaApp:hDe,router:_Y}=JF;window.React=me;window.ReactDOM=PA;window.InertiajsReact=JF;window.LucideReact=M7e;uDe();let Hz=!1;_Y.on("navigate",e=>{Hz=!0});_Y.on("finish",e=>{Hz=!1});const FB=document.createElement.bind(document);document.createElement=function(e,t){const a=FB(e,t);return e.toLowerCase()==="iframe"&&Hz?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),FB("div")):a};hDe({title:e=>`${e}`,resolve:async e=>(await Object.assign({"./pages/add-group.tsx":()=>cn(()=>import("./add-group-BOsQ0Q3j.js"),__vite__mapDeps([5,6,7]),import.meta.url),"./pages/add-user.tsx":()=>cn(()=>import("./add-user-L2wD_b_T.js"),__vite__mapDeps([8,6,7]),import.meta.url),"./pages/add.tsx":()=>cn(()=>import("./add-CqSZIEWV.js"),__vite__mapDeps([9,6,7]),import.meta.url),"./pages/catalog.tsx":()=>cn(()=>import("./catalog-D6aEgpu7.js"),__vite__mapDeps([10,6,7,1,2,3,11]),import.meta.url),"./pages/dashboard.tsx":()=>cn(()=>import("./dashboard-C0pXUDqP.js"),__vite__mapDeps([12,6,7,13]),import.meta.url),"./pages/docs.tsx":()=>cn(()=>import("./docs-Db-NexCf.js"),__vite__mapDeps([14,6,7]),import.meta.url),"./pages/history.tsx":()=>cn(()=>import("./history-DXiUYmwU.js"),__vite__mapDeps([15,16,6,7]),import.meta.url),"./pages/init-user.tsx":()=>cn(()=>import("./init-user-pCW_Q05s.js"),__vite__mapDeps([17,7]),import.meta.url),"./pages/list.tsx":()=>cn(()=>import("./list-DUvMtSpV.js"),__vite__mapDeps([18,6,7,16]),import.meta.url),"./pages/login.tsx":()=>cn(()=>import("./login-E_Y7wut5.js"),__vite__mapDeps([19,7]),import.meta.url),"./pages/module.tsx":()=>cn(()=>import("./module-BLZcWhbK.js"),__vite__mapDeps([20,6,7]),import.meta.url),"./pages/notification.tsx":()=>cn(()=>import("./notification-Dud_cS95.js"),__vite__mapDeps([21,6,7,1,2,3]),import.meta.url),"./pages/register.tsx":()=>cn(()=>import("./register-CLXNA3RH.js"),__vite__mapDeps([22,7]),import.meta.url),"./pages/user-filters-list.tsx":()=>cn(()=>import("./user-filters-list-Cv2Z3Fwm.js"),__vite__mapDeps([23,6,7]),import.meta.url),"./pages/welcome.tsx":()=>cn(()=>import("./welcome-CXTRhMo9.js"),__vite__mapDeps([24,6,7]),import.meta.url)})[`./pages/${e}.tsx`]()).default,setup({el:e,App:t,props:a}){ZR.createRoot(e).render(g.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{WA as $,wY as A,qy as B,rd as C,xne as D,hx as E,D5 as F,q6 as G,ZA as H,hz as I,OA as J,Tj as K,UA as L,id as M,Sz as N,Cz as O,Ou as P,Lz as Q,sW as R,Vu as S,tRe as T,uI as U,lW as V,dW as W,vr as X,ob as Y,yk as Z,a_ as _,I2 as a,KG as a$,Zu as a0,ud as a1,ch as a2,zD as a3,qD as a4,DD as a5,RD as a6,LD as a7,YA as a8,AD as a9,UB as aA,HIe as aB,BIe as aC,hc as aD,FIe as aE,XIe as aF,KIe as aG,ZIe as aH,VAe as aI,BAe as aJ,FAe as aK,fz as aL,UAe as aM,GAe as aN,wDe as aO,Xp as aP,Pp as aQ,Fp as aR,Nc as aS,o9 as aT,mS as aU,vY as aV,Gl as aW,m_e as aX,Rq as aY,YG as aZ,XG as a_,SD as aa,Eu as ab,XA as ac,ID as ad,OD as ae,$D as af,TD as ag,VD as ah,HD as ai,ND as aj,KA as ak,PD as al,ED as am,jD as an,CD as ao,Za as ap,pR as aq,Mu as ar,wu as as,nwe as at,fDe as au,$u as av,wRe as aw,_Re as ax,SRe as ay,CRe as az,Oe as b,xA as b$,QG as b0,eZ as b1,Ej as b2,sz as b3,lz as b4,dz as b5,vIe as b6,gIe as b7,kIe as b8,cd as b9,hD as bA,zp as bB,qu as bC,FG as bD,jc as bE,qDe as bF,XRe as bG,pr as bH,Um as bI,yr as bJ,cDe as bK,RU as bL,cn as bM,dI as bN,Vv as bO,tq as bP,HF as bQ,yDe as bR,g_e as bS,k_e as bT,v_e as bU,w_e as bV,GA as bW,mIe as bX,KK as bY,Uu as bZ,TR as b_,z_ as ba,Bu as bb,zu as bc,kr as bd,bIe as be,fY as bf,hRe as bg,nl as bh,e_ as bi,gv as bj,UIe as bk,GIe as bl,pi as bm,Nw as bn,me as bo,No as bp,gl as bq,tIe as br,nIe as bs,lIe as bt,dIe as bu,yj as bv,mj as bw,gj as bx,kj as by,ZG as bz,Q as c,TEe as c$,fU as c0,zDe as c1,REe as c2,L2 as c3,FEe as c4,UEe as c5,ZEe as c6,WEe as c7,YEe as c8,KEe as c9,HAe as cA,PAe as cB,K_e as cC,eSe as cD,w7e as cE,_7e as cF,S7e as cG,L7e as cH,C7e as cI,N7e as cJ,gne as cK,kne as cL,vne as cM,fx as cN,JC as cO,e7 as cP,tL as cQ,ty as cR,ECe as cS,LW as cT,NW as cU,IW as cV,AW as cW,jW as cX,qEe as cY,S8 as cZ,Gee as c_,JIe as ca,eAe as cb,tAe as cc,nSe as cd,aSe as ce,oSe as cf,tPe as cg,nPe as ch,aPe as ci,JEe as cj,xM as ck,Oi as cl,mw as cm,hEe as cn,Rg as co,Ua as cp,DEe as cq,OEe as cr,BEe as cs,HEe as ct,LAe as cu,NAe as cv,jAe as cw,EAe as cx,$Ae as cy,OAe as cz,sn as d,Sf as d0,CIe as d1,fs as e,Ga as f,nq as g,VB as h,kW as i,g as j,bW as k,vW as l,xW as m,MW as n,wa as o,RA as p,Ha as q,m as r,uY as s,rY as t,vd as u,hY as v,ju as w,J1 as x,pY as y,fr as z};
|