adminizer 5.0.0-build.13 → 5.0.0-build.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/assets/{add-B_hn__Ba.js → add-C97ZlnYa.js} +1 -1
  2. package/assets/add-group-Ck1ckPjg.js +1 -0
  3. package/assets/{add-user-Bh1iqSem.js → add-user-DrAae33F.js} +1 -1
  4. package/assets/ai-assistant/agent.es.js +1 -1
  5. package/assets/app-Lpo3bWGf.css +1 -0
  6. package/assets/app.js +2 -2
  7. package/assets/{catalog-DjK8r0Mn.js → catalog-CBGXyd1t.js} +4 -4
  8. package/assets/{dashboard-CbJIK7ka.js → dashboard-UMjkspUS.js} +1 -1
  9. package/assets/history-XWYf-Ejp.js +1 -0
  10. package/assets/{init-user-8aUohVDq.js → init-user-QihBlzjm.js} +1 -1
  11. package/assets/{list-C6w_xDK2.js → list-Cge_ZbFX.js} +1 -1
  12. package/assets/{login-CO4laf6m.js → login-TJqrgvWB.js} +1 -1
  13. package/assets/manifest.json +33 -33
  14. package/assets/{media-manager-BDbpSSjH.js → media-manager-CHrLjpDc.js} +3 -3
  15. package/assets/{module-DvPjKyF_.js → module-DxrI93ll.js} +1 -1
  16. package/assets/{notification-N_b-N0Zu.js → notification-BGZpCz0c.js} +1 -1
  17. package/assets/{register-DBYIMXGQ.js → register-C9ZkVhe0.js} +1 -1
  18. package/assets/{ru-rYKdQbWF.js → ru-3AOtVW4L.js} +1 -1
  19. package/assets/{user-filters-list-xbJoY_5_.js → user-filters-list-C4G5mYJZ.js} +1 -1
  20. package/assets/{welcome-BUkdkKa5.js → welcome-Az9UFvA4.js} +1 -1
  21. package/assets/with-app-layout-CrZPDh-O.js +1 -0
  22. package/controllers/access-rights/permissionOptions.d.ts +2 -0
  23. package/controllers/access-rights/permissionOptions.js +23 -0
  24. package/controllers/add.js +1 -1
  25. package/controllers/addGroup.js +15 -6
  26. package/controllers/ai/AiAssistantController.js +4 -3
  27. package/controllers/edit.js +1 -1
  28. package/controllers/editGroup.js +15 -6
  29. package/controllers/filter-fields/savedFilters.js +1 -1
  30. package/controllers/history-actions/HistoryController.js +6 -6
  31. package/controllers/list.js +1 -1
  32. package/controllers/login.js +1 -1
  33. package/controllers/notifications/NotificationController.js +14 -8
  34. package/controllers/view.js +1 -1
  35. package/controllers/widgets/filterInfo.js +1 -1
  36. package/helpers/accessRightsHelper.d.ts +9 -2
  37. package/helpers/accessRightsHelper.js +79 -12
  38. package/helpers/inertiaActionsHelper.d.ts +1 -1
  39. package/helpers/inertiaActionsHelper.js +4 -5
  40. package/helpers/inertiaAddHelper.d.ts +1 -1
  41. package/helpers/inertiaAddHelper.js +3 -3
  42. package/helpers/inertiaGroupHelper.js +10 -2
  43. package/helpers/inertiaListHelper.d.ts +1 -1
  44. package/helpers/inertiaListHelper.js +7 -8
  45. package/interfaces/types.d.ts +18 -0
  46. package/lib/app-manager/AdminizerApp.d.ts +7 -2
  47. package/lib/app-manager/AppManager.js +4 -0
  48. package/lib/notifications/GeneralNotificationService.js +1 -1
  49. package/lib/notifications/SystemNotificationService.js +1 -1
  50. package/models/Group.d.ts +2 -1
  51. package/package.json +2 -2
  52. package/policies/authPolicies.js +6 -6
  53. package/system/Router.js +2 -0
  54. package/assets/add-group-0SdYgiXZ.js +0 -1
  55. package/assets/app-DcWwG3m4.css +0 -1
  56. package/assets/history-CZAJgVXP.js +0 -1
  57. package/assets/with-app-layout-WhRyO5WK.js +0 -1
package/assets/app.js CHANGED
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./media-manager-BDbpSSjH.js","./debounce-BMmXVQ06.js","./media-manager-BZPjl98I.css","./add-group-0SdYgiXZ.js","./with-app-layout-WhRyO5WK.js","./use-appearance-_EbbjHTh.js","./add-user-Bh1iqSem.js","./add-B_hn__Ba.js","./catalog-DjK8r0Mn.js","./catalog-D4n6dpGl.css","./dashboard-CbJIK7ka.js","./dashboard-BOltB2Hq.css","./history-CZAJgVXP.js","./ru-rYKdQbWF.js","./init-user-8aUohVDq.js","./list-C6w_xDK2.js","./login-CO4laf6m.js","./module-DvPjKyF_.js","./notification-N_b-N0Zu.js","./register-DBYIMXGQ.js","./user-filters-list-xbJoY_5_.js","./welcome-BUkdkKa5.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./media-manager-CHrLjpDc.js","./debounce-BMmXVQ06.js","./media-manager-BZPjl98I.css","./add-group-Ck1ckPjg.js","./with-app-layout-CrZPDh-O.js","./use-appearance-_EbbjHTh.js","./add-user-DrAae33F.js","./add-C97ZlnYa.js","./catalog-CBGXyd1t.js","./catalog-D4n6dpGl.css","./dashboard-UMjkspUS.js","./dashboard-BOltB2Hq.css","./history-XWYf-Ejp.js","./ru-3AOtVW4L.js","./init-user-QihBlzjm.js","./list-Cge_ZbFX.js","./login-TJqrgvWB.js","./module-DxrI93ll.js","./notification-BGZpCz0c.js","./register-C9ZkVhe0.js","./user-filters-list-C4G5mYJZ.js","./welcome-Az9UFvA4.js"])))=>i.map(i=>d[i]);
2
2
  var ZO=e=>{throw TypeError(e)};var YO=(e,t,a)=>t.has(e)||ZO("Cannot "+a);var Jt=(e,t,a)=>(YO(e,t,"read from private field"),a?a.call(e):t.get(e)),XO=(e,t,a)=>t.has(e)?ZO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),gP=(e,t,a,r)=>(YO(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a);function DW(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 d=Object.getOwnPropertyDescriptor(r,c);d&&Object.defineProperty(e,c,d.get?d:{enumerable:!0,get:()=>r[c]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const zW="modulepreload",$W=function(e,t){return new URL(e,t).href},WO={},cn=function(t,a,r){let c=Promise.resolve();if(a&&a.length>0){let y=function(x){return Promise.all(x.map(g=>Promise.resolve(g).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const u=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),f=h?.nonce||h?.getAttribute("nonce");c=y(a.map(x=>{if(x=$W(x,r),x in WO)return;WO[x]=!0;const g=x.endsWith(".css"),b=g?'[rel="stylesheet"]':"";if(r)for(let _=u.length-1;_>=0;_--){const S=u[_];if(S.href===x&&(!g||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${b}`))return;const M=document.createElement("link");if(M.rel=g?"stylesheet":zW,g||(M.as="script"),M.crossOrigin="",M.href=x,f&&M.setAttribute("nonce",f),document.head.appendChild(M),g)return new Promise((_,S)=>{M.addEventListener("load",_),M.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${x}`)))})}))}function d(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"&&d(h.reason);return t().catch(d)})};var MTe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function GV(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wTe(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 vP={exports:{}},tu={};var KO;function qW(){if(KO)return tu;KO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(r,c,d){var u=null;if(d!==void 0&&(u=""+d),c.key!==void 0&&(u=""+c.key),"key"in c){d={};for(var h in c)h!=="key"&&(d[h]=c[h])}else d=c;return c=d.ref,{$$typeof:e,type:r,key:u,ref:c!==void 0?c:null,props:d}}return tu.Fragment=t,tu.jsx=a,tu.jsxs=a,tu}var QO;function OW(){return QO||(QO=1,vP.exports=qW()),vP.exports}var m=OW();const JO=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function HW(e,t,{signal:a,edges:r}={}){let c,d=null;const u=r!=null&&r.includes("leading"),h=r==null||r.includes("trailing"),f=()=>{d!==null&&(e.apply(c,d),c=void 0,d=null)},y=()=>{h&&f(),M()};let x=null;const g=()=>{x!=null&&clearTimeout(x),x=setTimeout(()=>{x=null,y()},t)},b=()=>{x!==null&&(clearTimeout(x),x=null)},M=()=>{b(),c=void 0,d=null},_=()=>{f()},S=function(...C){if(a?.aborted)return;c=this,d=C;const L=x==null;g(),u&&L&&f()};return S.schedule=g,S.cancel=M,S.flush=_,a?.addEventListener("abort",M,{once:!0}),S}function ZV(){}function XR(e){return e==null||typeof e!="object"&&typeof e!="function"}function WR(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function VW(e){if(XR(e))return e;if(Array.isArray(e)||WR(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 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}return typeof File<"u"&&e instanceof File?new a([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function nA(e){return typeof JO.Buffer<"u"&&JO.Buffer.isBuffer(e)}function aA(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Au(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const YV="[object RegExp]",KR="[object String]",QR="[object Number]",JR="[object Boolean]",XV="[object Arguments]",WV="[object Symbol]",KV="[object Date]",QV="[object Map]",JV="[object Set]",eB="[object Array]",BW="[object Function]",tB="[object ArrayBuffer]",G0="[object Object]",FW="[object Error]",nB="[object DataView]",aB="[object Uint8Array]",oB="[object Uint8ClampedArray]",rB="[object Uint16Array]",iB="[object Uint32Array]",UW="[object BigUint64Array]",cB="[object Int8Array]",sB="[object Int16Array]",lB="[object Int32Array]",GW="[object BigInt64Array]",dB="[object Float32Array]",uB="[object Float64Array]";function ZW(e,t){return Ll(e,void 0,e,new Map,t)}function Ll(e,t,a,r=new Map,c=void 0){const d=c?.(e,t,a,r);if(d!==void 0)return d;if(XR(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]=Ll(e[h],h,a,r,c);return Object.hasOwn(e,"index")&&(u.index=e.index),Object.hasOwn(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;r.set(e,u);for(const[h,f]of e)u.set(h,Ll(f,h,a,r,c));return u}if(e instanceof Set){const u=new Set;r.set(e,u);for(const h of e)u.add(Ll(h,void 0,a,r,c));return u}if(nA(e))return e.subarray();if(WR(e)){const u=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,u);for(let h=0;h<e.length;h++)u[h]=Ll(e[h],h,a,r,c);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),ga(u,e,a,r,c),u}if(typeof File<"u"&&e instanceof File){const u=new File([e],e.name,{type:e.type});return r.set(e,u),ga(u,e,a,r,c),u}if(typeof Blob<"u"&&e instanceof Blob){const u=new Blob([e],{type:e.type});return r.set(e,u),ga(u,e,a,r,c),u}if(e instanceof Error){const u=structuredClone(e);return r.set(e,u),u.message=e.message,u.name=e.name,u.stack=e.stack,u.cause=e.cause,u.constructor=e.constructor,ga(u,e,a,r,c),u}if(e instanceof Boolean){const u=new Boolean(e.valueOf());return r.set(e,u),ga(u,e,a,r,c),u}if(e instanceof Number){const u=new Number(e.valueOf());return r.set(e,u),ga(u,e,a,r,c),u}if(e instanceof String){const u=new String(e.valueOf());return r.set(e,u),ga(u,e,a,r,c),u}if(typeof e=="object"&&YW(e)){const u=Object.create(Object.getPrototypeOf(e));return r.set(e,u),ga(u,e,a,r,c),u}return e}function ga(e,t,a=e,r,c){const d=[...Object.keys(t),...aA(t)];for(let u=0;u<d.length;u++){const h=d[u],f=Object.getOwnPropertyDescriptor(e,h);(f==null||f.writable)&&(e[h]=Ll(t[h],h,a,r,c))}}function YW(e){switch(Au(e)){case XV:case eB:case tB:case nB:case JR:case KV:case dB:case uB:case cB:case sB:case lB:case QV:case QR:case G0:case YV:case JV:case KR:case WV:case aB:case oB:case rB:case iB:return!0;default:return!1}}function it(e){return Ll(e,void 0,e,new Map,void 0)}function eH(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 ju(e){return e==="__proto__"}function xP(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const a=e[Symbol.toStringTag];return a==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${a}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function hB(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function XW(e,t,a){return fu(e,t,void 0,void 0,void 0,void 0,a)}function fu(e,t,a,r,c,d,u){const h=u(e,t,a,r,c,d);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 gu(e,t,d,u)}return gu(e,t,d,u)}function gu(e,t,a,r){if(Object.is(e,t))return!0;let c=Au(e),d=Au(t);if(c==="[object Arguments]"&&(c=G0),d==="[object Arguments]"&&(d=G0),c!==d)return!1;switch(c){case KR:return e.toString()===t.toString();case QR:return hB(e.valueOf(),t.valueOf());case JR:case KV:case WV:return Object.is(e.valueOf(),t.valueOf());case YV:return e.source===t.source&&e.flags===t.flags;case BW: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 QV:if(e.size!==t.size)return!1;for(const[f,y]of e.entries())if(!t.has(f)||!fu(y,t.get(f),f,e,t,a,r))return!1;return!0;case JV:{if(e.size!==t.size)return!1;const f=Array.from(e.values()),y=Array.from(t.values());for(let x=0;x<f.length;x++){const g=f[x],b=y.findIndex(M=>fu(g,M,void 0,e,t,a,r));if(b===-1)return!1;y.splice(b,1)}return!0}case eB:case aB:case oB:case rB:case iB:case UW:case cB:case sB:case lB:case GW:case dB:case uB:if(nA(e)!==nA(t)||e.length!==t.length)return!1;for(let f=0;f<e.length;f++)if(!fu(e[f],t[f],f,e,t,a,r))return!1;return!0;case tB:return e.byteLength!==t.byteLength?!1:gu(new Uint8Array(e),new Uint8Array(t),a,r);case nB:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:gu(new Uint8Array(e),new Uint8Array(t),a,r);case FW:return e.name===t.name&&e.message===t.message;case G0:{if(!(gu(e.constructor,t.constructor,a,r)||eH(e)&&eH(t)))return!1;const f=[...Object.keys(e),...aA(e)],y=[...Object.keys(t),...aA(t)];if(f.length!==y.length)return!1;for(let x=0;x<f.length;x++){const g=f[x],b=e[g];if(!Object.hasOwn(t,g))return!1;const M=t[g];if(!fu(b,M,g,e,t,a,r))return!1}return!0}default:return!1}}finally{a.delete(e),a.delete(t)}}function Ba(e,t){return XW(e,t,ZV)}function WW(e){return Number.isSafeInteger(e)&&e>=0}const KW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function QW(e){return e.replace(/[&<>"']/g,t=>KW[t])}function JW(e){return e!=null&&typeof e!="function"&&WW(e.length)}function eT(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(eT).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function tT(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function nT(e){if(Array.isArray(e))return e.map(tT);if(typeof e=="symbol")return[e];e=eT(e);const t=[],a=e.length;if(a===0)return t;let r=0,c="",d="",u=!1;for(e.charCodeAt(0)===46&&t.push("");r<a;){const h=e[r];if(d)h==="\\"&&r+1<a?(r++,c+=e[r]):h===d?d="":c+=h;else if(u)h==='"'||h==="'"?d=h:h==="]"?(u=!1,t.push(c),c=""):c+=h;else if(h==="[")u=!0,c&&(t.push(c),c="");else if(h==="."){c&&(t.push(c),c="");const f=e[r+1];(f===void 0||f===".")&&t.push("")}else c+=h;r++}return c&&t.push(c),t}const eK=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function pB(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:eK.test(e);default:return!1}}function yt(e,t,a){if(e==null)return a;switch(typeof t){case"string":{if(ju(t))return a;const r=e[t];return r===void 0?pB(t)&&!Object.hasOwn(e,t)?yt(e,nT(t),a):a:r}case"number":case"symbol":{typeof t=="number"&&(t=tT(t));const r=e[t];return r===void 0?a:r}default:{if(Array.isArray(t))return tK(e,t,a);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),ju(t))return a;const r=e[t];return r===void 0?a:r}}}function tK(e,t,a){if(t.length===0)return a;let r=e;for(let c=0;c<t.length;c++){if(r==null||ju(t[c]))return a;r=r[t[c]]}return r===void 0?a:r}function tH(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function nK(e,t){return ZW(e,(a,r,c,d)=>{if(typeof e=="object"){if(Au(e)==="[object Object]"&&typeof e.constructor!="function"){const u={};return d.set(e,u),ga(u,e,c,d),u}switch(Object.prototype.toString.call(e)){case QR:case KR:case JR:{const u=new e.constructor(e?.valueOf());return ga(u,e),u}case XV:{const u={};return ga(u,e),u.length=e.length,u[Symbol.iterator]=e[Symbol.iterator],u}default:return}}})}function nH(e){return nK(e)}function cR(e){return e!==null&&typeof e=="object"&&Au(e)==="[object Arguments]"}const aK=/^(?:0|[1-9]\d*)$/;function fB(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 aK.test(e)}}function sR(e,t){let a;if(Array.isArray(t)?a=t:typeof t=="string"&&pB(t)&&!(t in Object(e))?a=nT(t):a=[t],a.length===0)return!1;let r=e;for(let c=0;c<a.length;c++){const d=a[c];if((r==null||!Object.hasOwn(r,d))&&!((Array.isArray(r)||cR(r))&&fB(d)&&d<r.length))return!1;r=r[d]}return!0}function lR(e){return typeof e=="object"&&e!==null}function oK(e){return lR(e)&&JW(e)}function rK(e){return typeof e=="symbol"||e instanceof Symbol}const iK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cK=/^\w*$/;function sK(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||rK(e)?!0:typeof e=="string"&&(cK.test(e)||!iK.test(e))||t!=null&&Object.hasOwn(t,e)}function bP(e){return WR(e)}const lK=(e,t,a)=>{const r=e[t];(!(Object.hasOwn(e,t)&&hB(r,a))||a===void 0&&!(t in e))&&(e[t]=a)};function dK(e,t,a,r){if(e==null&&!tH(e))return e;let c;sK(t,e)?c=[t]:Array.isArray(t)?c=t:c=nT(t);const d=a(yt(e,c));let u=e;for(let h=0;h<c.length&&u!=null;h++){const f=tT(c[h]);if(ju(f))continue;let y;if(h===c.length-1)y=d;else{const x=u[f],g=r?.(x,f,e);y=g!==void 0?g:tH(x)?x:fB(c[h+1])?[]:{}}lK(u,f,y),u=u[f]}return e}function Rn(e,t,a){return dK(e,t,()=>a,()=>{})}function uK(e,t=0,a={}){typeof a!="object"&&(a={});const{leading:r=!1,trailing:c=!0,maxWait:d}=a,u=Array(2);r&&(u[0]="leading"),c&&(u[1]="trailing");let h,f=null;const y=HW(function(...b){h=e.apply(this,b),f=null},t,{edges:u}),x=function(...b){return d!=null&&(f===null&&(f=Date.now()),Date.now()-f>=d)?(h=e.apply(this,b),f=Date.now(),y.cancel(),y.schedule(),h):(y.apply(this,b),h)},g=()=>(y.flush(),h);return x.cancel=y.cancel,x.flush=g,x}function hK(e,...t){const a=t.slice(0,-1),r=t[t.length-1];let c=e;for(let d=0;d<a.length;d++){const u=a[d];c=Z0(c,u,r,new Map)}return c}function Z0(e,t,a,r){if(XR(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(r.has(t))return VW(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let d=0;d<t.length;d++)t[d]=t[d]??void 0}const c=[...Object.keys(t),...aA(t)];for(let d=0;d<c.length;d++){const u=c[d];if(ju(u))continue;let h=t[u],f=e[u];if(cR(h)&&(h={...h}),cR(f)&&(f={...f}),nA(h)&&(h=nH(h)),Array.isArray(h))if(Array.isArray(f)){const x=[],g=Reflect.ownKeys(f);for(let b=0;b<g.length;b++){const M=g[b];x[M]=f[M]}f=x}else if(oK(f)){const x=[];for(let g=0;g<f.length;g++)x[g]=f[g];f=x}else f=[];const y=a(f,h,u,e,t,r);y!==void 0?e[u]=y:Array.isArray(h)||lR(f)&&lR(h)&&(xP(f)||xP(h)||bP(f)||bP(h))?e[u]=Z0(f,h,a,r):f==null&&xP(h)?e[u]=Z0({},h,a,r):f==null&&bP(h)?e[u]=nH(h):(f===void 0||h!==void 0)&&(e[u]=h)}return e}function oA(e,...t){return hK(e,...t,ZV)}function aH(e){return QW(eT(e))}const aT=e=>typeof File<"u"&&e instanceof File||e instanceof Blob||typeof FileList<"u"&&e instanceof FileList&&e.length>0,LA=e=>e instanceof FormData?!0:aT(e)||typeof e=="object"&&e!==null&&Object.values(e).some(t=>LA(t));let rA=class extends Error{response;constructor(t){super(`HTTP error ${t.status}`),this.name="HttpResponseError",this.response=t}},yB=class extends Error{constructor(t="Request was cancelled"){super(t),this.name="HttpCancelledError"}},pK=class extends Error{constructor(t="Network error"){super(t),this.name="HttpNetworkError"}};function fK(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 yK(e,t,a){if(t&&!e.startsWith("http://")&&!e.startsWith("https://")&&(e=t.replace(/\/$/,"")+"/"+e.replace(/^\//,"")),a&&Object.keys(a).length>0){const r=fK(a);r&&(e+=(e.includes("?")?"&":"?")+r)}return e}function mK(){return typeof window>"u"?null:window.axios?.defaults?.headers?.common?.["X-Requested-With"]??null}function mB(e,t=new FormData,a=null){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&kB(t,a?`${a}[${r}]`:r,e[r]);return t}function kB(e,t,a){if(Array.isArray(a))return a.forEach((r,c)=>kB(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(a==null)return e.append(t,"");mB(a,e,t)}function kK(e,t){if(e!=null)return e instanceof FormData?e:typeof e=="object"&&LA(e)?mB(e):typeof e=="object"||t["Content-Type"]?.includes("application/json")?JSON.stringify(e):String(e)}function gK(e){const t={};return e.forEach((a,r)=>{t[r.toLowerCase()]=a}),t}function vK(e={}){let t=e.xsrfCookieName??"XSRF-TOKEN",a=e.xsrfHeaderName??"X-XSRF-TOKEN";function r(){if(typeof document>"u")return null;const c=document.cookie.match(new RegExp("(^|;\\s*)"+t+"=([^;]*)"));return c?decodeURIComponent(c[2]):null}return{setXsrfCookieName(c){t=c},setXsrfHeaderName(c){a=c},async request(c){const d=yK(c.url,c.baseURL,c.params),u=c.method.toUpperCase(),h={},f=mK();f&&(h["X-Requested-With"]=f),c.data!==void 0&&!["GET","DELETE"].includes(u)&&!(c.data instanceof FormData)&&!LA(c.data)&&(h["Content-Type"]="application/json"),c.headers&&Object.entries(c.headers).forEach(([_,S])=>{S!==void 0&&(h[_]=String(S))});const y=r();y&&!["GET","HEAD","OPTIONS"].includes(u)&&(h[a]=y);let x=c.signal,g;const b=c.timeout??3e4;if(b>0&&!x){const _=new AbortController;x=_.signal,g=setTimeout(()=>_.abort(),b)}const M=["GET","DELETE"].includes(u)?void 0:kK(c.data,h);M instanceof FormData&&delete h["Content-Type"];try{const _=await fetch(d,{method:u,headers:h,body:M,signal:x,credentials:c.credentials??"same-origin"});g&&clearTimeout(g);let S;_.headers.get("content-type")?.includes("application/json")?S=await _.json():S=await _.text();const L={status:_.status,data:S,headers:gK(_.headers)};if(!_.ok)throw new rA(L);return L}catch(_){throw g&&clearTimeout(g),_ instanceof rA?_:_ instanceof DOMException&&_.name==="AbortError"?new yB:_ instanceof TypeError?new pK(_.message):_}}}}const dR=vK();let oT=dR,rT,gB,vB="same-origin",xB=e=>`${e.method}:${e.baseURL??rT??""}${e.url}`,bB=e=>e.status===204&&e.headers["precognition-success"]==="true";const iA={},un={get:(e,t={},a={})=>au(nu("get",e,t,a)),post:(e,t={},a={})=>au(nu("post",e,t,a)),patch:(e,t={},a={})=>au(nu("patch",e,t,a)),put:(e,t={},a={})=>au(nu("put",e,t,a)),delete:(e,t={},a={})=>au(nu("delete",e,t,a)),useHttpClient(e){return oT=e,un},withBaseURL(e){return rT=e,un},withTimeout(e){return gB=e,un},withCredentials(e){return vB=typeof e=="string"?e:e?"include":"omit",un},fingerprintRequestsUsing(e){return xB=e===null?()=>null:e,un},determineSuccessUsing(e){return bB=e,un},withXsrfCookieName(e){return dR.setXsrfCookieName(e),un},withXsrfHeaderName(e){return dR.setXsrfHeaderName(e),un}},nu=(e,t,a,r)=>({url:t,method:e,...r,...["get","delete"].includes(e)?{params:oA({},a,r?.params)}:{data:oA({},a,r?.data)}}),au=(e={})=>{const t=[xK,MK,wK].reduce((a,r)=>r(a),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),oT.request({method:t.method,url:t.url,baseURL:t.baseURL??rT,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:vB}).then(async a=>{t.precognitive&&oH(a);const r=a.status;let c=a;return t.precognitive&&t.onPrecognitionSuccess&&bB(a)&&(c=await Promise.resolve(t.onPrecognitionSuccess(a)??c)),t.onSuccess&&bK(r)&&(c=await Promise.resolve(t.onSuccess(c)??c)),(rH(t,r)??(u=>u))(c)??c},a=>{if(_K(a))return Promise.reject(a);const r=a;return t.precognitive&&oH(r.response),(rH(t,r.response.status)??((d,u)=>Promise.reject(u)))(r.response,r)}).finally(t.onFinish??(()=>null)))},xK=e=>{const t=e.only??e.validate;return{...e,timeout:e.timeout??gB,precognitive:e.precognitive!==!1,fingerprint:typeof e.fingerprint>"u"?xB(e,oT):e.fingerprint,headers:{...e.headers,Accept:"application/json","Content-Type":SK(e),...e.precognitive!==!1?{Precognition:!0}:{},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},bK=e=>e>=200&&e<300,MK=e=>(typeof e.fingerprint!="string"||(iA[e.fingerprint]?.abort(),delete iA[e.fingerprint]),e),wK=e=>typeof e.fingerprint!="string"||e.signal||!e.precognitive?e:(iA[e.fingerprint]=new AbortController,{...e,signal:iA[e.fingerprint].signal}),oH=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.")},_K=e=>!(e instanceof rA)||typeof e.response?.status!="number",rH=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],SK=e=>e.headers?.["Content-Type"]??e.headers?.["Content-type"]??e.headers?.["content-type"]??(LA(e.data)?"multipart/form-data":"application/json"),CK=(e,t)=>{if(!e.includes("*"))return[e];const a=e.split(".");let r=[""];for(const c of a)if(c==="*"){const d=[];for(const u of r){const h=u?yt(t,u):t;if(Array.isArray(h))for(let f=0;f<h.length;f++)d.push(u?`${u}.${f}`:String(f));else if(h!==null&&typeof h=="object")for(const f of Object.keys(h))d.push(u?`${u}.${f}`:f)}r=d}else r=r.map(d=>d?`${d}.${c}`:c);return r},LK=(e,t)=>t.includes("*")?new RegExp("^"+t.replace(/\./g,"\\.").replace(/\*/g,"[^.]+")+"$").test(e):e===t,iH=(e,t)=>Object.fromEntries(Object.entries(e).filter(([a])=>!t.some(r=>LK(a,r)))),NK=(e,t={})=>{const a={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]};let r=!1,c=!1;const d=Y=>Y!==c?(c=Y,a.validatingChanged):[];let u=[];const h=Y=>{const G=[...new Set(Y)];return u.length!==G.length||!G.every(J=>u.includes(J))?(u=G,a.validatedChanged):[]},f=()=>u.filter(Y=>typeof g[Y]>"u");let y=[];const x=Y=>{const G=[...new Set(Y)];return y.length!==G.length||!G.every(J=>y.includes(J))?(y=G,a.touchedChanged):[]};let g={};const b=Y=>{const G=IK(Y);return Ba(g,G)?[]:(g=G,a.errorsChanged)},M=Y=>{const G={...g};return delete G[vu(Y)],b(G)},_=()=>Object.keys(g).length>0;let S=1500;const C=Y=>{S=Y,R.cancel(),R=z()};let L=t,A=null,j=[],E=null;const z=()=>uK(Y=>{e({get:(G,J={},oe={})=>un.get(G,K(J),$(oe,Y,J)),post:(G,J={},oe={})=>un.post(G,K(J),$(oe,Y,J)),patch:(G,J={},oe={})=>un.patch(G,K(J),$(oe,Y,J)),put:(G,J={},oe={})=>un.put(G,K(J),$(oe,Y,J)),delete:(G,J={},oe={})=>un.delete(G,K(J),$(oe,Y,J))}).catch(G=>G instanceof yB||G instanceof rA&&G.response?.status===422?null:Promise.reject(G))},S,{leading:!0,trailing:!0});let R=z();const $=(Y,G,J={})=>{const oe={...Y,...G},he=Array.from(oe.only??oe.validate??y);return{...G,...oA({},Y,G),only:he,timeout:oe.timeout??5e3,onValidationError:(N,P)=>([...h([...u,...he]),...b(oA(iH({...g},he),N.data.errors))].forEach(O=>O()),oe.onValidationError?oe.onValidationError(N,P):Promise.reject(P)),onSuccess:N=>(h([...u,...he]).forEach(P=>P()),oe.onSuccess?oe.onSuccess(N):N),onPrecognitionSuccess:N=>([...h([...u,...he]),...b(iH({...g},he))].forEach(P=>P()),oe.onPrecognitionSuccess?oe.onPrecognitionSuccess(N):N),onBefore:()=>{const N=y.some(te=>te.includes("*")),P=N?[...new Set(y.flatMap(te=>CK(te,J)))]:y;return oe.onBeforeValidation&&oe.onBeforeValidation({data:J,touched:P},{data:L,touched:j})===!1||(oe.onBefore||(()=>!0))()===!1?!1:(N&&x(P).forEach(te=>te()),E=y,A=J,!0)},onStart:()=>{d(!0).forEach(N=>N()),(oe.onStart??(()=>null))()},onFinish:()=>{d(!1).forEach(N=>N()),j=E,L=A,E=A=null,(oe.onFinish??(()=>null))()}}},H=(Y,G,J)=>{if(typeof Y>"u"){const oe=Array.from(J?.only??J?.validate??[]);x([...y,...oe]).forEach(he=>he()),R(J??{});return}if(aT(G)&&!r){console.warn('Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.');return}Y=vu(Y),(Y.includes("*")||yt(L,Y)!==G)&&(x([Y,...y]).forEach(oe=>oe()),R(J??{}))},K=Y=>r===!1?uR(Y):Y,ae={touched:()=>y,validate(Y,G,J){return typeof Y=="object"&&!("target"in Y)&&(J=Y,Y=G=void 0),H(Y,G,J),ae},touch(Y){const G=Array.isArray(Y)?Y:[vu(Y)];return x([...y,...G]).forEach(J=>J()),ae},validating:()=>c,valid:f,errors:()=>g,hasErrors:_,setErrors(Y){return b(Y).forEach(G=>G()),ae},forgetError(Y){return M(Y).forEach(G=>G()),ae},defaults(Y){return t=Y,L=Y,ae},reset(...Y){if(Y.length===0)x([]).forEach(G=>G());else{const G=[...y];Y.forEach(J=>{G.includes(J)&&G.splice(G.indexOf(J),1),Rn(L,J,yt(t,J))}),x(G).forEach(J=>J())}return ae},setTimeout(Y){return C(Y),ae},on(Y,G){return a[Y].push(G),ae},validateFiles(){return r=!0,ae},withoutFileValidation(){return r=!1,ae}};return ae},MB=e=>Object.keys(e).reduce((t,a)=>({...t,[a]:Array.isArray(e[a])?e[a][0]:e[a]}),{}),IK=e=>Object.keys(e).reduce((t,a)=>({...t,[a]:typeof e[a]=="string"?[e[a]]:e[a]}),{}),vu=e=>typeof e!="string"?e.target.name:e,uR=e=>{const t={...e};return Object.keys(t).forEach(a=>{const r=t[a];if(r!==null){if(aT(r)){delete t[a];return}if(Array.isArray(r)){t[a]=Object.values(uR({...r}));return}if(typeof r=="object"){t[a]=uR(t[a]);return}}}),t};var AK=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 sR(this.config,e)?yt(this.config,e):yt(this.defaults,e)}set(e,t){typeof e=="string"?Rn(this.config,e,t):Object.entries(e).forEach(([a,r])=>{Rn(this.config,a,r)})}},Il=new AK({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function Eu(e,t){let a;return function(...r){clearTimeout(a),a=setTimeout(()=>e.apply(this,r),t)}}function mn(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var cH=e=>mn("before",{cancelable:!0,detail:{visit:e}}),jK=(e,{page:t,visitId:a}={})=>mn("error",{detail:{errors:e,page:t,visitId:a}}),EK=e=>mn("networkError",{cancelable:!0,detail:{error:e}}),PK=e=>mn("finish",{detail:{visit:e}}),sH=e=>mn("httpException",{cancelable:!0,detail:{response:e}}),RK=e=>mn("beforeUpdate",{detail:{page:e}}),cA=(e,{cached:t=!1,visitId:a}={})=>mn("navigate",{detail:{page:e,cached:t,visitId:a}}),TK=(e,{replace:t,visitId:a})=>mn("clientVisit",{detail:{page:e,replace:t,visitId:a}}),DK=e=>mn("progress",{detail:{progress:e}}),zK=e=>mn("start",{detail:{visit:e}}),$K=(e,{visitId:t}={})=>mn("success",{detail:{page:e,visitId:t}}),qK=(e,t)=>mn("prefetched",{detail:{fetchedAt:Date.now(),response:e,visit:t}}),OK=e=>mn("prefetching",{detail:{visit:e}}),sA=e=>mn("flash",{detail:{flash:e}}),HK=(e,t)=>mn("location",{cancelable:!0,detail:{url:e,versionChange:t}}),En=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()}},VK=async e=>{if(typeof window>"u")throw new Error("Unable to encrypt history");const t=wB(),a=await _B(),r=await YK(a);if(!r)throw new Error("Unable to encrypt history");return await FK(t,r,e)},K1={key:"historyKey",iv:"historyIv"},BK=async e=>{const t=wB(),a=await _B();if(!a)throw new Error("Unable to decrypt history");return await UK(t,a,e)},FK=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=JSON.stringify(a),d=new Uint8Array(c.length*3),u=r.encodeInto(c,d);return window.crypto.subtle.encrypt({name:"AES-GCM",iv:e},t,d.subarray(0,u.written))},UK=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 JSON.parse(new TextDecoder().decode(r))},wB=()=>{const e=En.get(K1.iv);if(e)return new Uint8Array(e);const t=window.crypto.getRandomValues(new Uint8Array(12));return En.set(K1.iv,Array.from(t)),t},GK=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"]),ZK=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);En.set(K1.key,Array.from(new Uint8Array(t)))},YK=async e=>{if(e)return e;const t=await GK();return t?(await ZK(t),t):null},_B=async()=>{const e=En.get(K1.key);return e?await window.crypto.subtle.importKey("raw",new Uint8Array(e),{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]):null},lH=e=>{const t={};for(const a of Object.keys(e))e[a]!==void 0&&(t[a]=e[a]);return t},SB=(e,t,a)=>{if(e===t)return!0;for(const r in e)if(!a.includes(r)&&e[r]!==t[r]&&!XK(e[r],t[r]))return!1;for(const r in t)if(!a.includes(r)&&!(r in e))return!1;return!0},XK=(e,t)=>{switch(typeof e){case"object":return SB(e,t,[]);case"function":return e.toString()===t.toString();default:return e===t}},WK={ms:1,s:1e3,m:1e3*60,h:1e3*60*60,d:1e3*60*60*24},dH=e=>{if(typeof e=="number")return e;for(const[t,a]of Object.entries(WK))if(e.endsWith(t))return parseFloat(e)*a;return parseInt(e)},KK=class{cached=[];inFlightRequests=[];removalTimers=[];currentUseId=null;add(e,t,{cacheFor:a,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();const d=this.findCached(e);if(!e.fresh&&d&&d.staleTimestamp>Date.now())return Promise.resolve();const[u,h]=this.extractStaleValues(a),f=new Promise((y,x)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),x()},onError:g=>{this.remove(e),e.onError(g),x()},onPrefetching(g){e.onPrefetching(g)},onPrefetched(g,b){e.onPrefetched(g,b)},onPrefetchResponse(g){y(g)},onPrefetchError(g){za.removeFromInFlight(e),x(g)}})}).then(y=>{this.remove(e);const x=y.getPageResponse();me.mergeOncePropsIntoResponse(x),this.cached.push({params:{...e},staleTimestamp:Date.now()+u,expiresAt:Date.now()+h,response:f,singleUse:h===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});const g=this.getShortestOncePropTtl(x);return this.scheduleForRemoval(e,g?Math.min(h,g):h),this.removeFromInFlight(e),y.handlePrefetch(),y});return this.inFlightRequests.push({params:{...e},response:f,staleTimestamp:null,inFlight:!0}),f}removeAll(){this.cached=[],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)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){const[t,a]=this.cacheForToStaleAndExpires(e);return[dH(t),dH(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)}`;this.currentUseId=a;const r={...t,cached:!0};return e.response.then(c=>{if(this.currentUseId===a)return c.mergeParams({...r,onPrefetched:()=>{}}),this.removeSingleUseItems(t),c.handle()})}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=it(e);return t.headers.Purpose==="prefetch"&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return SB(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),["id","showProgress","replace","prefetch","preserveScroll","preserveState","onBefore","onBeforeUpdate","onStart","onProgress","onFinish","onCancel","onSuccess","onError","onFlash","onPrefetched","onCancelToken","onPrefetching","async","viewTransition","optimistic","component","pageProps","cached"])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{const a=t.getPageResponse();me.mergeOncePropsIntoResponse(a,{force:!0});for(const[u,h]of Object.entries(a.deferredProps??{})){const f=h.filter(y=>yt(a.props,y)===void 0);f.length>0?a.deferredProps[u]=f:delete a.deferredProps[u]}const r=this.getShortestOncePropTtl(a);if(r===null)return;const c=e.expiresAt-Date.now(),d=Math.min(c,r);d>0?this.scheduleForRemoval(e.params,d):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()}},za=new KK,MP=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},QK=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 f=u.parentElement;if(!f)return!1;const y=window.getComputedStyle(f);if(["flex","inline-flex"].includes(y.display)){const x=["column","column-reverse"].includes(y.flexDirection);return h==="height"?x:!x}return["grid","inline-grid"].includes(y.display)};let d=e?.parentElement;for(;d;){const u=t(d)||a(d);if(window.getComputedStyle(d).display!=="contents"&&u)return d;d=d.parentElement}return null},CB=(e,t)=>{if(!t)return e.filter(d=>MP(d));const a=e.indexOf(t),r=[],c=[];for(let d=a;d>=0;d--){const u=e[d];if(MP(u))r.push(u);else break}for(let d=a+1;d<e.length;d++){const u=e[d];if(MP(u))c.push(u);else break}return[...r.reverse(),...c]},xu=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?xu(e,t-1):e()})},JK=e=>{if(typeof window>"u")return null;const t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?JSON.parse(t.textContent):null},yu=typeof window>"u",eQ=!yu&&/Firefox/i.test(window.navigator.userAgent),Pn=class{static save(){Ye.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(eQ&&getComputedStyle(document.documentElement).scrollBehavior==="smooth")return xu(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!yu&&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=yu?null:window.location.hash;t&&setTimeout(()=>{const a=document.getElementById(t.slice(1));a?a.scrollIntoView():this.scrollToTop()})}static restore(t){yu||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(t)})}static restoreScrollRegions(t){yu||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=Ye.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(){Ye.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},iT=e=>typeof File<"u"&&e instanceof File||e instanceof Blob||typeof FileList<"u"&&e instanceof FileList&&e.length>0;function lA(e){return iT(e)||e instanceof FormData&&Array.from(e.values()).some(t=>lA(t))||typeof e=="object"&&e!==null&&Object.values(e).some(t=>lA(t))}var hR=e=>e instanceof FormData;function cT(e,t=new FormData,a=null,r="brackets"){e=e||{};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&NB(t,LB(a,c,"indices"),e[c],r);return t}function LB(e,t,a){return e?a==="brackets"?`${e}[]`:`${e}[${t}]`:t}function NB(e,t,a,r){if(Array.isArray(a))return Array.from(a.keys()).forEach(c=>NB(e,LB(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(a==null)return e.append(t,"");cT(a,e,t,r)}function tQ(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function nQ(e){if(!e||e==="?")return{};const t={};return e.replace(/^\?/,"").split("&").filter(Boolean).forEach(a=>{const[r,c]=oQ(a);rQ(t,uH(r),uH(c))}),t}function aQ(e,t){const a=[];return pR(e,"",a,t),a.length?"?"+a.join("&"):""}function oQ(e){const t=e.indexOf("=");return t===-1?[e,""]:[e.substring(0,t),e.substring(t+1)]}function uH(e){return decodeURIComponent(e.replace(/\+/g," "))}function rQ(e,t,a){const r=iQ(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 d=r.shift();d===""&&Array.isArray(c)?c.push(a):c[d]=a}function iQ(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 pR(e,t,a,r){if(e!==void 0){if(e===null){a.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((c,d)=>{const u=r==="indices"?`${t}[${d}]`:`${t}[]`;pR(c,u,a,r)});return}if(typeof e=="object"){Object.keys(e).forEach(c=>{pR(e[c],t?`${t}[${c}]`:c,a,r)});return}a.push(`${t}=${encodeURIComponent(String(e))}`)}}function da(e){return new URL(e.toString(),typeof window>"u"?void 0:window.location.toString())}var cQ=(e,t,a,r,c)=>{let d=typeof e=="string"?da(e):e;if((lA(t)||r)&&!hR(t)&&(Il.get("form.forceIndicesArrayFormatInFormData")&&(c="indices"),t=cT(t,new FormData,null,c)),hR(t))return[d,t];const[u,h]=Gu(a,d,t,c);return[da(u),h]};function Gu(e,t,a,r="brackets"){const c=e==="get"&&!hR(a)&&Object.keys(a).length>0,d=jB(t.toString()),u=d||t.toString().startsWith("/")||t.toString()==="",h=!u&&!t.toString().startsWith("#")&&!t.toString().startsWith("?"),f=/^[.]{1,2}([/]|$)/.test(t.toString()),y=t.toString().includes("?")||c,x=t.toString().includes("#"),g=new URL(t.toString(),typeof window>"u"?"http://localhost":window.location.toString());if(c){const b=tQ(g)?"indices":r;g.search=aQ({...nQ(g.search),...a},b)}return[[d?`${g.protocol}//${g.host}`:"",u?g.pathname:"",h?g.pathname.substring(f?0:1):"",y?g.search:"",x?g.hash:""].join(""),c?{}:a]}function dA(e){return e=new URL(e.href),e.hash="",e}var hH=(e,t)=>{e.hash&&!t.hash&&dA(e).href===t.href&&(t.hash=e.hash)},uA=(e,t)=>dA(e).href===dA(t).href,IB=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function xa(e){return e!==null&&typeof e=="object"&&e!==void 0&&"url"in e&&"method"in e}function AB(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 jB(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function sQ(e,t){const a=typeof e=="string"?da(e):e;return t?`${a.protocol}//${a.host}${a.pathname}${a.search}${a.hash}`:`${a.pathname}${a.search}${a.hash}`}var lQ=class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;init({initialPage:e,swapComponent:t,resolveComponent:a,onFlash:r}){return this.page={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},this.swapComponent=t,this.resolveComponent=a,this.onFlashCallback=r,$a.on("historyQuotaExceeded",()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:a=!1,preserveState:r=!1,viewTransition:c=!1,cached:d=!1,visitId:u}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};const h=this.componentId;return e.clearHistory&&Ye.clear(),this.resolve(e.component,e).then(f=>{if(h!==this.componentId)return;e.rememberedState??={};const y=typeof window>"u",x=y?new URL(e.url):window.location,g=!y&&a?Pn.getScrollRegions():[];t=t||uA(da(e.url),x);const b={...e,flash:{}};return new Promise(M=>t?Ye.replaceState(b,M):Ye.pushState(b,M)).then(()=>{const M=!this.isTheSame(e);if(!M&&Object.keys(e.props.errors||{}).length>0&&(c=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&za.updateCachedOncePropsFromCurrentPage(),M&&this.fireEventsFor("newComponent"),this.isFirstPageLoad&&this.fireEventsFor("firstLoad"),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:f,page:e,preserveState:r,viewTransition:c}).then(()=>{a?window.requestAnimationFrame(()=>Pn.restoreScrollRegions(g)):Pn.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&$a.fireInternalEvent("loadDeferredProps",this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||cA(e,{cached:d,visitId:u})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(a=>(this.page=e,this.cleared=!1,Ye.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}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}){const c=()=>this.swapComponent({component:e,page:t,preserveState:a});if(!r||!document?.startViewTransition||document.visibilityState==="hidden")return c();const d=typeof r=="boolean"?()=>null:r;return new Promise(u=>{const h=document.startViewTransition(()=>c().then(u));h.ready.catch(()=>{}),d(h)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}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=it(this.page.props);for(const r of e)t[r]=it(this.optimisticBaseline[r]);for(const{callback:r}of this.pendingOptimistics){const c=r(it(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=[]}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||yt(e.props,r.prop)===void 0)&&(Rn(e.props,r.prop,yt(this.page.props,c.prop)),e.onceProps[a].expiresAt=c.expiresAt)})}},me=new lQ,NA=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){const e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},q1=typeof window>"u",ou=new NA,pH=!q1&&/CriOS/.test(window.navigator.userAgent),dQ=class{rememberedState="rememberedState";scrollRegions="scrollRegions";preserveUrl=!1;current={};initialState=null;remember(t,a){this.replaceState({...me.getWithoutFlashData(),rememberedState:{...me.get()?.rememberedState??{},[a]:t}})}restore(t){if(!q1)return this.current[this.rememberedState]?.[t]!==void 0?this.current[this.rememberedState]?.[t]:this.initialState?.[this.rememberedState]?.[t]}pushState(t,a=null){if(!q1){if(this.preserveUrl){a&&a();return}this.current=t,ou.add(()=>this.getPageData(t).then(r=>{const c=()=>this.doPushState({page:r},t.url).then(()=>a?.());return pH?new Promise(d=>{setTimeout(()=>c().then(d))}):c()}))}}clonePageProps(t){try{return structuredClone(t.props),t}catch{return{...t,props:it(t.props)}}}getPageData(t){const a=this.clonePageProps(t);return new Promise(r=>t.encryptHistory?VK(a).then(r):r(a))}processQueue(){return ou.process()}decrypt(t=null){if(q1)return Promise.resolve(t??me.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?BK(t):Promise.resolve(t)}saveScrollPositions(t){ou.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!Ba(this.getScrollRegions(),t))return this.doReplaceState({page:window.history.state.page,scrollRegions:t})}))}saveDocumentScrollPosition(t){ou.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!Ba(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(Ba(this.current,t)){a&&a();return}const{flash:r,...c}=t;if(me.merge(c),!q1){if(this.preserveUrl){a&&a();return}this.current=t,ou.add(()=>this.getPageData(t).then(d=>{const u=()=>this.doReplaceState({page:d},t.url).then(()=>a?.());return pH?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(()=>{window.history.replaceState({...t,scrollRegions:t.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:t.documentScrollPosition??window.history.state?.documentScrollPosition},"",a)})}doPushState(t,a){return this.withThrottleProtection(()=>{try{window.history.pushState(t,"",a)}catch(r){if(!this.isQuotaExceededError(r))throw r;$a.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&&delete this.initialState[t]}browserHasHistoryEntry(){return!q1&&!!window.history.state?.page}clear(){En.remove(K1.key),En.remove(K1.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 Ye=new dQ,uQ=class{internalListeners=[];init(){typeof window<"u"&&(window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),window.addEventListener("pageshow",this.handlePageshowEvent.bind(this)),window.addEventListener("scroll",Eu(Pn.onWindowScroll.bind(Pn),100),!0)),typeof document<"u"&&document.addEventListener("scroll",Eu(Pn.onScroll.bind(Pn),100),!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(){me.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&&Ye.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){const t=e.state||null;if(t===null){const a=da(me.get().url);a.hash=window.location.hash,Ye.replaceState({...me.getWithoutFlashData(),url:a.href}),Pn.reset();return}if(!Ye.isValidState(t))return this.onMissingHistoryItem();Ye.decrypt(t.page).then(a=>{if(me.get().version!==a.version){this.onMissingHistoryItem();return}Ue.cancelAll({prefetch:!1}),me.setQuietly(a,{preserveState:!1}).then(()=>{Pn.restore(Ye.getScrollRegions()),cA(me.get());const r={},c=me.get().props;for(const[d,u]of Object.entries(a.initialDeferredProps??a.deferredProps??{})){const h=u.filter(f=>yt(c,f)===void 0);h.length>0&&(r[d]=h)}Object.keys(r).length>0&&this.fireInternalEvent("loadDeferredProps",r)})}).catch(()=>{this.onMissingHistoryItem()})}},$a=new uQ,hQ=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"}},wP=new hQ;function Y0(){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 pQ=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(t=>t.bind(this)())}static clearRememberedStateOnReload(){wP.isReload()&&(Ye.deleteState(Ye.rememberedState),Ye.clearInitialState(Ye.rememberedState))}static handleBackForward(){if(!wP.isBackForward()||!Ye.browserHasHistoryEntry())return!1;const e=Ye.getScrollRegions();return Ye.decrypt().then(t=>{const a=Y0();me.set(t,{preserveScroll:!0,preserveState:!0,visitId:a}).then(()=>{Pn.restore(e),cA(me.get(),{visitId:a})})}).catch(()=>{$a.onMissingHistoryItem()}),!0}static handleLocation(){if(!En.exists(En.locationVisitKey))return!1;const e=En.get(En.locationVisitKey)||{};return En.remove(En.locationVisitKey),typeof window<"u"&&me.setUrlHash(window.location.hash),Ye.decrypt(me.get()).then(()=>{const t=Y0(),a=Ye.getState(Ye.rememberedState,{}),r=Ye.getScrollRegions();me.remember(a),me.set(me.get(),{preserveScroll:e.preserveScroll,preserveState:!0,visitId:t}).then(()=>{e.preserveScroll&&Pn.restore(r),this.fireInitialEvents(t)})}).catch(()=>{$a.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<"u"&&me.setUrlHash(window.location.hash);const e=Y0();me.set(me.get(),{preserveScroll:!0,preserveState:!0,visitId:e}).then(()=>{wP.isReload()?Pn.restore(Ye.getScrollRegions()):Pn.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){const t=me.get();cA(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>sA(t.flash))}},fQ=class{intervalId=null;timeoutId=null;throttle=!1;keepAlive=!1;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;constructor(e,t,a){this.keepAlive=a.keepAlive??!1,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.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}start(){if(!(typeof window>"u")){if(this.stop(),this.stopped=!1,this.mode==="rest"){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=this.keepAlive?!1:e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10===0?this.fire():this.mode==="rest"&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode==="cancel"&&this.currentCancel?.();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.scheduleNext())}})}},yQ=class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,a){const r=new fQ(e,t,a);return 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(){typeof document>"u"||document.addEventListener("visibilitychange",()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},fH=new yQ,mQ=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)}},sn=new mQ,sT=class extends Error{code;url;constructor(e,t,a){super(a?`${e} (${a})`:e),this.name="HttpError",this.code=t,this.url=a}},Pu=class extends sT{response;constructor(e,t,a){super(e,"ERR_HTTP_RESPONSE",a),this.name="HttpResponseError",this.response=t}},Ru=class extends sT{constructor(e="Request was cancelled",t){super(e,"ERR_CANCELLED",t),this.name="HttpCancelledError"}},yH=class extends sT{cause;constructor(e,t,a){super(e,"ERR_NETWORK",t),this.name="HttpNetworkError",this.cause=a}};function kQ(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null}function gQ(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 EB(e){return typeof FormData<"u"&&e instanceof FormData}function vQ(e){return typeof e=="string"||EB(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 xQ(e,t){if(!t.headers)return;const a=EB(t.data);Object.entries(t.headers).forEach(([r,c])=>{(r.toLowerCase()!=="content-type"||!a)&&e.setRequestHeader(r,String(c))})}function bQ(e,t){if(!t||Object.keys(t).length===0)return e;const[a]=Gu("get",e,t);return a}var PB=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??"XSRF-TOKEN",this.xsrfHeaderName=e.xsrfHeaderName??"X-XSRF-TOKEN"}async request(e){const t=await sn.processRequest(e);try{const a=await this.doRequest(t);return await sn.processResponse(a)}catch(a){throw(a instanceof Pu||a instanceof yH||a instanceof Ru)&&await sn.processError(a),a}}doRequest(e){return new Promise((t,a)=>{const r=new XMLHttpRequest,c=bQ(e.url,e.params);r.open(e.method.toUpperCase(),c,!0);const d=kQ(this.xsrfCookieName);d&&r.setRequestHeader(this.xsrfHeaderName,d),Object.keys(e.headers??{}).some(f=>f.toLowerCase()==="x-requested-with")||r.setRequestHeader("X-Requested-With","XMLHttpRequest");let h=null;e.data!==null&&e.data!==void 0&&(vQ(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)),xQ(r,e),e.onUploadProgress&&(r.upload.onprogress=f=>{const y=f.lengthComputable?f.loaded/f.total:void 0;e.onUploadProgress({progress:y,percentage:y?Math.round(y*100):0,loaded:f.loaded,total:f.lengthComputable?f.total:void 0})}),e.signal&&e.signal.addEventListener("abort",()=>r.abort()),r.onabort=()=>a(new Ru("Request was cancelled",e.url)),r.onerror=()=>a(new yH("Network error",e.url)),r.onload=()=>{const f={status:r.status,data:r.responseText,headers:gQ(r)};r.status>=400?a(new Pu(`Request failed with status ${r.status}`,f,e.url)):t(f)},r.send(h)})}},MQ=new PB,_P=MQ;function wQ(e){return!("request"in e)}var Zu={getClient(){return _P},setClient(e){if(!wQ(e)){_P=e;return}_P=new PB(e),e.xsrfCookieName&&un.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&un.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:sn.onRequest.bind(sn),onResponse:sn.onResponse.bind(sn),onError:sn.onError.bind(sn),processRequest:sn.processRequest.bind(sn),processResponse:sn.processResponse.bind(sn),processError:sn.processError.bind(sn)},_Q=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}},lT=new _Q;function SQ(){typeof window>"u"||(window.__inertia_interceptors__=lT)}var X0=class W0{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 W0(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}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"]=me.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=W0.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=W0.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}},CQ={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: `+l.message+`
135
135
  `)},sV=function(){var e=parseInt(document.body.getAttribute(X1)||"0",10);return isFinite(e)?e:0},w_e=function(){k.useEffect(function(){return document.body.setAttribute(X1,(sV()+1).toString()),function(){var e=sV()-1;e<=0?document.body.removeAttribute(X1):document.body.setAttribute(X1,e.toString())}},[])},__e=function(e){var t=e.noRelative,a=e.noImportant,r=e.gapMode,c=r===void 0?"margin":r;w_e();var d=k.useMemo(function(){return x_e(c)},[c]);return k.createElement(b_e,{styles:M_e(d,!t,c,a?"":"!important")})},PR=!1;if(typeof window<"u")try{var z0=Object.defineProperty({},"passive",{get:function(){return PR=!0,!0}});window.addEventListener("test",z0,z0),window.removeEventListener("test",z0,z0)}catch{PR=!1}var D1=PR?{passive:!1}:!1,S_e=function(e){return e.tagName==="TEXTAREA"},AU=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!S_e(e)&&a[t]==="visible")},C_e=function(e){return AU(e,"overflowY")},L_e=function(e){return AU(e,"overflowX")},lV=function(e,t){var a=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var c=jU(e,r);if(c){var d=EU(e,r),u=d[1],h=d[2];if(u>h)return!0}r=r.parentNode}while(r&&r!==a.body);return!1},N_e=function(e){var t=e.scrollTop,a=e.scrollHeight,r=e.clientHeight;return[t,a,r]},I_e=function(e){var t=e.scrollLeft,a=e.scrollWidth,r=e.clientWidth;return[t,a,r]},jU=function(e,t){return e==="v"?C_e(t):L_e(t)},EU=function(e,t){return e==="v"?N_e(t):I_e(t)},A_e=function(e,t){return e==="h"&&t==="rtl"?-1:1},j_e=function(e,t,a,r,c){var d=A_e(e,window.getComputedStyle(t).direction),u=d*r,h=a.target,f=t.contains(h),y=!1,x=u>0,g=0,b=0;do{if(!h)break;var M=EU(e,h),_=M[0],S=M[1],C=M[2],L=S-C-d*_;(_||L)&&jU(e,h)&&(g+=L,b+=_);var A=h.parentNode;h=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&h!==document.body||f&&(t.contains(h)||t===h));return(x&&Math.abs(g)<1||!x&&Math.abs(b)<1)&&(y=!0),y},$0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dV=function(e){return[e.deltaX,e.deltaY]},uV=function(e){return e&&"current"in e?e.current:e},E_e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},P_e=function(e){return`
136
136
  .block-interactivity-`.concat(e,` {pointer-events: none;}
137
137
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
138
- `)},R_e=0,z1=[];function T_e(e){var t=k.useRef([]),a=k.useRef([0,0]),r=k.useRef(),c=k.useState(R_e++)[0],d=k.useState(IU)[0],u=k.useRef(e);k.useEffect(function(){u.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var S=n_e([e.lockRef.current],(e.shards||[]).map(uV),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var h=k.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var L=$0(S),A=a.current,j="deltaX"in S?S.deltaX:A[0]-L[0],E="deltaY"in S?S.deltaY:A[1]-L[1],z,R=S.target,$=Math.abs(j)>Math.abs(E)?"h":"v";if("touches"in S&&$==="h"&&R.type==="range")return!1;var H=window.getSelection(),K=H&&H.anchorNode,ae=K?K===R||K.contains(R):!1;if(ae)return!1;var Y=lV($,R);if(!Y)return!0;if(Y?z=$:(z=$==="v"?"h":"v",Y=lV($,R)),!Y)return!1;if(!r.current&&"changedTouches"in S&&(j||E)&&(r.current=z),!z)return!0;var G=r.current||z;return j_e(G,C,S,G==="h"?j:E)},[]),f=k.useCallback(function(S){var C=S;if(!(!z1.length||z1[z1.length-1]!==d)){var L="deltaY"in C?dV(C):$0(C),A=t.current.filter(function(z){return z.name===C.type&&(z.target===C.target||C.target===z.shadowParent)&&E_e(z.delta,L)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var j=(u.current.shards||[]).map(uV).filter(Boolean).filter(function(z){return z.contains(C.target)}),E=j.length>0?h(C,j[0]):!u.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),y=k.useCallback(function(S,C,L,A){var j={name:S,delta:C,target:L,should:A,shadowParent:D_e(L)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(E){return E!==j})},1)},[]),x=k.useCallback(function(S){a.current=$0(S),r.current=void 0},[]),g=k.useCallback(function(S){y(S.type,dV(S),S.target,h(S,e.lockRef.current))},[]),b=k.useCallback(function(S){y(S.type,$0(S),S.target,h(S,e.lockRef.current))},[]);k.useEffect(function(){return z1.push(d),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",f,D1),document.addEventListener("touchmove",f,D1),document.addEventListener("touchstart",x,D1),function(){z1=z1.filter(function(S){return S!==d}),document.removeEventListener("wheel",f,D1),document.removeEventListener("touchmove",f,D1),document.removeEventListener("touchstart",x,D1)}},[]);var M=e.removeScrollBar,_=e.inert;return k.createElement(k.Fragment,null,_?k.createElement(d,{styles:P_e(c)}):null,M?k.createElement(__e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function D_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const z_e=u_e(NU,T_e);var o2=k.forwardRef(function(e,t){return k.createElement(RA,qa({},e,{ref:t,sideCar:z_e}))});o2.classNames=RA.classNames;var $_e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$1=new WeakMap,q0=new WeakMap,O0={},XP=0,PU=function(e){return e&&(e.host||PU(e.parentNode))},q_e=function(e,t){return t.map(function(a){if(e.contains(a))return a;var r=PU(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})},O_e=function(e,t,a,r){var c=q_e(t,Array.isArray(e)?e:[e]);O0[a]||(O0[a]=new WeakMap);var d=O0[a],u=[],h=new Set,f=new Set(c),y=function(g){!g||h.has(g)||(h.add(g),y(g.parentNode))};c.forEach(y);var x=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(b){if(h.has(b))x(b);else try{var M=b.getAttribute(r),_=M!==null&&M!=="false",S=($1.get(b)||0)+1,C=(d.get(b)||0)+1;$1.set(b,S),d.set(b,C),u.push(b),S===1&&_&&q0.set(b,!0),C===1&&b.setAttribute(a,"true"),_||b.setAttribute(r,"true")}catch(L){console.error("aria-hidden: cannot operate on ",b,L)}})};return x(t),h.clear(),XP++,function(){u.forEach(function(g){var b=$1.get(g)-1,M=d.get(g)-1;$1.set(g,b),d.set(g,M),b||(q0.has(g)||g.removeAttribute(r),q0.delete(g)),M||g.removeAttribute(a)}),XP--,XP||($1=new WeakMap,$1=new WeakMap,q0=new WeakMap,O0={})}},TA=function(e,t,a){a===void 0&&(a="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),c=$_e(e);return c?(r.push.apply(r,Array.from(c.querySelectorAll("[aria-live], script"))),O_e(r,c,a,"aria-hidden")):function(){return null}},H_e=Object.defineProperty,Wn=(e,t)=>H_e(e,"name",{value:t,configurable:!0}),$T="Dialog",[RU,RTe]=qt($T),[V_e,Ca]=RU($T),qT=Wn(e=>{const{__scopeDialog:t,children:a,open:r,defaultOpen:c,onOpenChange:d,modal:u=!0}=e,h=k.useRef(null),f=k.useRef(null),[y,x]=Ut({prop:r,defaultProp:c??!1,onChange:d,caller:$T}),[g,b]=k.useState(0),[M,_]=k.useState(0);return m.jsx(V_e,{scope:t,triggerRef:h,contentRef:f,contentId:kt(),titleId:kt(),descriptionId:kt(),titlePresent:g>0,descriptionPresent:M>0,setTitleCount:b,setDescriptionCount:_,open:y,onOpenChange:x,onOpenToggle:k.useCallback(()=>x(S=>!S),[x]),modal:u,children:a})},"Dialog"),B_e="DialogTrigger",TU=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(B_e,r),u=Ee(a,d.triggerRef);return m.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":zA(d.open),...c,ref:u,onClick:fe(t.onClick,d.onOpenToggle)})},"DialogTrigger")),DU="DialogPortal",[F_e,zU]=RU(DU,{forceMount:void 0}),OT=Wn(e=>{const{__scopeDialog:t,forceMount:a,children:r,container:c}=e,d=Ca(DU,t);return m.jsx(F_e,{scope:t,forceMount:a,children:k.Children.map(r,u=>m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),RR="DialogOverlay",HT=k.forwardRef(Wn(function(t,a){const r=zU(RR,t.__scopeDialog),{forceMount:c=r.forceMount,...d}=t,u=Ca(RR,t.__scopeDialog);return u.modal?m.jsx(kn,{present:c||u.open,children:m.jsx(G_e,{...d,ref:a})}):null},"DialogOverlay")),U_e=Ma("DialogOverlay.RemoveScroll"),G_e=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(RR,r),u=mU(),h=Ee(a,u);return m.jsx(o2,{as:U_e,allowPinchZoom:!0,shards:[d.contentRef],children:m.jsx(ge.div,{"data-state":zA(d.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),$u="DialogContent",VT=k.forwardRef(Wn(function(t,a){const r=zU($u,t.__scopeDialog),{forceMount:c=r.forceMount,...d}=t,u=Ca($u,t.__scopeDialog);return m.jsx(kn,{present:c||u.open,children:u.modal?m.jsx(Z_e,{...d,ref:a}):m.jsx(Y_e,{...d,ref:a})})},"DialogContent")),Z_e=k.forwardRef(Wn(function(t,a){const r=Ca($u,t.__scopeDialog),c=k.useRef(null),d=Ee(a,r.contentRef,c);return k.useEffect(()=>{const u=c.current;if(u)return TA(u)},[]),m.jsx($U,{...t,ref:d,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:fe(t.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:fe(t.onPointerDownOutside,u=>{const h=u.detail.originalEvent,f=h.button===0&&h.ctrlKey===!0;(h.button===2||f)&&u.preventDefault()}),onFocusOutside:fe(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),Y_e=k.forwardRef(Wn(function(t,a){const r=Ca($u,t.__scopeDialog),c=k.useRef(!1),d=k.useRef(!1);return m.jsx($U,{...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,d.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&d.current&&u.preventDefault()}})},"DialogContentNonModal")),$U=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:u,...h}=t,f=Ca($u,r);return id(),m.jsx(m.Fragment,{children:m.jsx(PA,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:d,onUnmountAutoFocus:u,children:m.jsx(a2,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":zA(f.open),...h,ref:a,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),X_e="DialogTitle",qU=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(X_e,r),{setTitleCount:u}=d;return mt(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),m.jsx(ge.h2,{id:d.titleId,...c,ref:a})},"DialogTitle")),W_e="DialogDescription",OU=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(W_e,r),{setDescriptionCount:u}=d;return mt(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),m.jsx(ge.p,{id:d.descriptionId,...c,ref:a})},"DialogDescription")),K_e="DialogClose",DA=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(K_e,r);return m.jsx(ge.button,{type:"button",...c,ref:a,onClick:fe(t.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function zA(e){return e?"open":"closed"}Wn(zA,"getState");var du='[cmdk-group=""]',WP='[cmdk-group-items=""]',Q_e='[cmdk-group-heading=""]',HU='[cmdk-item=""]',hV=`${HU}:not([aria-disabled="true"])`,TR="cmdk-item-select",H1="data-value",J_e=(e,t,a)=>Gwe(e,t,a),VU=k.createContext(void 0),r2=()=>k.useContext(VU),BU=k.createContext(void 0),BT=()=>k.useContext(BU),FU=k.createContext(void 0),UU=k.forwardRef((e,t)=>{let a=V1(()=>{var T,U;return{search:"",value:(U=(T=e.value)!=null?T:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=V1(()=>new Set),c=V1(()=>new Map),d=V1(()=>new Map),u=V1(()=>new Set),h=GU(e),{label:f,children:y,value:x,onValueChange:g,filter:b,shouldFilter:M,loop:_,disablePointerSelection:S=!1,vimBindings:C=!0,...L}=e,A=kt(),j=kt(),E=kt(),z=k.useRef(null),R=dSe();Rl(()=>{if(x!==void 0){let T=x.trim();a.current.value=T,$.emit()}},[x]),Rl(()=>{R(6,J)},[]);let $=k.useMemo(()=>({subscribe:T=>(u.current.add(T),()=>u.current.delete(T)),snapshot:()=>a.current,setState:(T,U,X)=>{var Z,ce,pe,ie;if(!Object.is(a.current[T],U)){if(a.current[T]=U,T==="search")G(),ae(),R(1,Y);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(E);se?se.focus():(Z=document.getElementById(A))==null||Z.focus()}if(R(7,()=>{var se;a.current.selectedItemId=(se=oe())==null?void 0:se.id,$.emit()}),X||R(5,J),((ce=h.current)==null?void 0:ce.value)!==void 0){let se=U??"";(ie=(pe=h.current).onValueChange)==null||ie.call(pe,se);return}}$.emit()}},emit:()=>{u.current.forEach(T=>T())}}),[]),H=k.useMemo(()=>({value:(T,U,X)=>{var Z;U!==((Z=d.current.get(T))==null?void 0:Z.value)&&(d.current.set(T,{value:U,keywords:X}),a.current.filtered.items.set(T,K(U,X)),R(2,()=>{ae(),$.emit()}))},item:(T,U)=>(r.current.add(T),U&&(c.current.has(U)?c.current.get(U).add(T):c.current.set(U,new Set([T]))),R(3,()=>{G(),ae(),a.current.value||Y(),$.emit()}),()=>{d.current.delete(T),r.current.delete(T),a.current.filtered.items.delete(T);let X=oe();R(4,()=>{G(),X?.getAttribute("id")===T&&Y(),$.emit()})}),group:T=>(c.current.has(T)||c.current.set(T,new Set),()=>{d.current.delete(T),c.current.delete(T)}),filter:()=>h.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:A,inputId:E,labelId:j,listInnerRef:z}),[]);function K(T,U){var X,Z;let ce=(Z=(X=h.current)==null?void 0:X.filter)!=null?Z:J_e;return T?ce(T,a.current.search,U):0}function ae(){if(!a.current.search||h.current.shouldFilter===!1)return;let T=a.current.filtered.items,U=[];a.current.filtered.groups.forEach(Z=>{let ce=c.current.get(Z),pe=0;ce.forEach(ie=>{let se=T.get(ie);pe=Math.max(se,pe)}),U.push([Z,pe])});let X=z.current;he().sort((Z,ce)=>{var pe,ie;let se=Z.getAttribute("id"),_e=ce.getAttribute("id");return((pe=T.get(_e))!=null?pe:0)-((ie=T.get(se))!=null?ie:0)}).forEach(Z=>{let ce=Z.closest(WP);ce?ce.appendChild(Z.parentElement===ce?Z:Z.closest(`${WP} > *`)):X.appendChild(Z.parentElement===X?Z:Z.closest(`${WP} > *`))}),U.sort((Z,ce)=>ce[1]-Z[1]).forEach(Z=>{var ce;let pe=(ce=z.current)==null?void 0:ce.querySelector(`${du}[${H1}="${encodeURIComponent(Z[0])}"]`);pe?.parentElement.appendChild(pe)})}function Y(){let T=he().find(X=>X.getAttribute("aria-disabled")!=="true"),U=T?.getAttribute(H1);$.setState("value",U||void 0)}function G(){var T,U,X,Z;if(!a.current.search||h.current.shouldFilter===!1){a.current.filtered.count=r.current.size;return}a.current.filtered.groups=new Set;let ce=0;for(let pe of r.current){let ie=(U=(T=d.current.get(pe))==null?void 0:T.value)!=null?U:"",se=(Z=(X=d.current.get(pe))==null?void 0:X.keywords)!=null?Z:[],_e=K(ie,se);a.current.filtered.items.set(pe,_e),_e>0&&ce++}for(let[pe,ie]of c.current)for(let se of ie)if(a.current.filtered.items.get(se)>0){a.current.filtered.groups.add(pe);break}a.current.filtered.count=ce}function J(){var T,U,X;let Z=oe();Z&&(((T=Z.parentElement)==null?void 0:T.firstChild)===Z&&((X=(U=Z.closest(du))==null?void 0:U.querySelector(Q_e))==null||X.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function oe(){var T;return(T=z.current)==null?void 0:T.querySelector(`${HU}[aria-selected="true"]`)}function he(){var T;return Array.from(((T=z.current)==null?void 0:T.querySelectorAll(hV))||[])}function N(T){let U=he()[T];U&&$.setState("value",U.getAttribute(H1))}function P(T){var U;let X=oe(),Z=he(),ce=Z.findIndex(ie=>ie===X),pe=Z[ce+T];(U=h.current)!=null&&U.loop&&(pe=ce+T<0?Z[Z.length-1]:ce+T===Z.length?Z[0]:Z[ce+T]),pe&&$.setState("value",pe.getAttribute(H1))}function O(T){let U=oe(),X=U?.closest(du),Z;for(;X&&!Z;)X=T>0?sSe(X,du):lSe(X,du),Z=X?.querySelector(hV);Z?$.setState("value",Z.getAttribute(H1)):P(T)}let te=()=>N(he().length-1),B=T=>{T.preventDefault(),T.metaKey?te():T.altKey?O(1):P(1)},D=T=>{T.preventDefault(),T.metaKey?N(0):T.altKey?O(-1):P(-1)};return k.createElement(ge.div,{ref:t,tabIndex:-1,...L,"cmdk-root":"",onKeyDown:T=>{var U;(U=L.onKeyDown)==null||U.call(L,T);let X=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||X))switch(T.key){case"n":case"j":{C&&T.ctrlKey&&B(T);break}case"ArrowDown":{B(T);break}case"p":case"k":{C&&T.ctrlKey&&D(T);break}case"ArrowUp":{D(T);break}case"Home":{T.preventDefault(),N(0);break}case"End":{T.preventDefault(),te();break}case"Enter":{T.preventDefault();let Z=oe();if(Z){let ce=new Event(TR);Z.dispatchEvent(ce)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:hSe},f),$A(e,T=>k.createElement(BU.Provider,{value:$},k.createElement(VU.Provider,{value:H},T))))}),eSe=k.forwardRef((e,t)=>{var a,r;let c=kt(),d=k.useRef(null),u=k.useContext(FU),h=r2(),f=GU(e),y=(r=(a=f.current)==null?void 0:a.forceMount)!=null?r:u?.forceMount;Rl(()=>{if(!y)return h.item(c,u?.id)},[y]);let x=ZU(c,d,[e.value,e.children,d],e.keywords),g=BT(),b=kr(R=>R.value&&R.value===x.current),M=kr(R=>y||h.filter()===!1?!0:R.search?R.filtered.items.get(c)>0:!0);k.useEffect(()=>{let R=d.current;if(!(!R||e.disabled))return R.addEventListener(TR,_),()=>R.removeEventListener(TR,_)},[M,e.onSelect,e.disabled]);function _(){var R,$;S(),($=(R=f.current).onSelect)==null||$.call(R,x.current)}function S(){g.setState("value",x.current,!0)}if(!M)return null;let{disabled:C,value:L,onSelect:A,forceMount:j,keywords:E,...z}=e;return k.createElement(ge.div,{ref:El(d,t),...z,id:c,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!b,"data-disabled":!!C,"data-selected":!!b,onPointerMove:C||h.getDisablePointerSelection()?void 0:S,onClick:C?void 0:_},e.children)}),tSe=k.forwardRef((e,t)=>{let{heading:a,children:r,forceMount:c,...d}=e,u=kt(),h=k.useRef(null),f=k.useRef(null),y=kt(),x=r2(),g=kr(M=>c||x.filter()===!1?!0:M.search?M.filtered.groups.has(u):!0);Rl(()=>x.group(u),[]),ZU(u,h,[e.value,e.heading,f]);let b=k.useMemo(()=>({id:u,forceMount:c}),[c]);return k.createElement(ge.div,{ref:El(h,t),...d,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},a&&k.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:y},a),$A(e,M=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?y:void 0},k.createElement(FU.Provider,{value:b},M))))}),nSe=k.forwardRef((e,t)=>{let{alwaysRender:a,...r}=e,c=k.useRef(null),d=kr(u=>!u.search);return!a&&!d?null:k.createElement(ge.div,{ref:El(c,t),...r,"cmdk-separator":"",role:"separator"})}),aSe=k.forwardRef((e,t)=>{let{onValueChange:a,...r}=e,c=e.value!=null,d=BT(),u=kr(y=>y.search),h=kr(y=>y.selectedItemId),f=r2();return k.useEffect(()=>{e.value!=null&&d.setState("search",e.value)},[e.value]),k.createElement(ge.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":h,id:f.inputId,type:"text",value:c?e.value:u,onChange:y=>{c||d.setState("search",y.target.value),a?.(y.target.value)}})}),oSe=k.forwardRef((e,t)=>{let{children:a,label:r="Suggestions",...c}=e,d=k.useRef(null),u=k.useRef(null),h=kr(y=>y.selectedItemId),f=r2();return k.useEffect(()=>{if(u.current&&d.current){let y=u.current,x=d.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let M=y.offsetHeight;x.style.setProperty("--cmdk-list-height",M.toFixed(1)+"px")})});return b.observe(y),()=>{cancelAnimationFrame(g),b.unobserve(y)}}},[]),k.createElement(ge.div,{ref:El(d,t),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":r,id:f.listId},$A(e,y=>k.createElement("div",{ref:El(u,f.listInnerRef),"cmdk-list-sizer":""},y)))}),rSe=k.forwardRef((e,t)=>{let{open:a,onOpenChange:r,overlayClassName:c,contentClassName:d,container:u,...h}=e;return k.createElement(qT,{open:a,onOpenChange:r},k.createElement(OT,{container:u},k.createElement(HT,{"cmdk-overlay":"",className:c}),k.createElement(VT,{"aria-label":e.label,"cmdk-dialog":"",className:d},k.createElement(UU,{ref:t,...h}))))}),iSe=k.forwardRef((e,t)=>kr(a=>a.filtered.count===0)?k.createElement(ge.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),cSe=k.forwardRef((e,t)=>{let{progress:a,children:r,label:c="Loading...",...d}=e;return k.createElement(ge.div,{ref:t,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},$A(e,u=>k.createElement("div",{"aria-hidden":!0},u)))}),Hl=Object.assign(UU,{List:oSe,Item:eSe,Input:aSe,Group:tSe,Separator:nSe,Dialog:rSe,Empty:iSe,Loading:cSe});function sSe(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function lSe(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function GU(e){let t=k.useRef(e);return Rl(()=>{t.current=e}),t}var Rl=typeof window>"u"?k.useEffect:k.useLayoutEffect;function V1(e){let t=k.useRef();return t.current===void 0&&(t.current=e()),t}function kr(e){let t=BT(),a=()=>e(t.snapshot());return k.useSyncExternalStore(t.subscribe,a,a)}function ZU(e,t,a,r=[]){let c=k.useRef(),d=r2();return Rl(()=>{var u;let h=(()=>{var y;for(let x of a){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(y=x.current.textContent)==null?void 0:y.trim():c.current}})(),f=r.map(y=>y.trim());d.value(e,h,f),(u=t.current)==null||u.setAttribute(H1,h),c.current=h}),c}var dSe=()=>{let[e,t]=k.useState(),a=V1(()=>new Map);return Rl(()=>{a.current.forEach(r=>r()),a.current=new Map},[e]),(r,c)=>{a.current.set(r,c),t({})}};function uSe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function $A({asChild:e,children:t},a){return e&&k.isValidElement(t)?k.cloneElement(uSe(t),{ref:t.ref},a(t.props.children)):a(t)}var hSe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function qA({...e}){return m.jsx(qT,{"data-slot":"dialog",...e})}function YU({...e}){return m.jsx(TU,{"data-slot":"dialog-trigger",...e})}function XU({...e}){return m.jsx(OT,{"data-slot":"dialog-portal",...e})}function DR({...e}){return m.jsx(DA,{"data-slot":"dialog-close",...e})}function WU({className:e,...t}){return m.jsx(HT,{"data-slot":"dialog-overlay",className:W("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 OA({className:e,children:t,...a}){return m.jsxs(XU,{"data-slot":"dialog-portal",children:[m.jsx(WU,{}),m.jsxs(VT,{"data-slot":"dialog-content",className:W("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,m.jsxs(DA,{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:[m.jsx(yr,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function HA({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:W("flex flex-col gap-2 text-center sm:text-left",e),...t})}function KU({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-footer",className:W("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function VA({className:e,...t}){return m.jsx(qU,{"data-slot":"dialog-title",className:W("text-lg leading-none font-semibold",e),...t})}function QU({className:e,...t}){return m.jsx(OU,{"data-slot":"dialog-description",className:W("text-muted-foreground text-sm",e),...t})}function FT({className:e,...t}){return m.jsx(Hl,{"data-slot":"command",className:W("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function pSe({title:e="Command Palette",description:t="Search for a command to run...",children:a,...r}){return m.jsxs(qA,{...r,children:[m.jsxs(HA,{className:"sr-only",children:[m.jsx(VA,{children:e}),m.jsx(QU,{children:t})]}),m.jsx(OA,{className:"overflow-hidden p-0",children:m.jsx(FT,{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:a})})]})}function JU({className:e,...t}){return m.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[m.jsx(Lu,{className:"size-4 shrink-0 opacity-50"}),m.jsx(Hl.Input,{"data-slot":"command-input",className:W("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 eG({className:e,...t}){return m.jsx(Hl.List,{"data-slot":"command-list",className:W("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function tG({...e}){return m.jsx(Hl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function nG({className:e,...t}){return m.jsx(Hl.Group,{"data-slot":"command-group",className:W("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 aG({className:e,...t}){return m.jsx(Hl.Separator,{"data-slot":"command-separator",className:W("bg-border -mx-1 h-px",e),...t})}function oG({className:e,...t}){return m.jsx(Hl.Item,{"data-slot":"command-item",className:W("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 fSe({className:e,...t}){return m.jsx("span",{"data-slot":"command-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var ySe=Object.defineProperty,Bt=(e,t)=>ySe(e,"name",{value:t,configurable:!0});function cd(e){const t=e+"CollectionProvider",[a,r]=qt(t),[c,d]=a(t,{collectionRef:{current:null},itemMap:new Map}),u=Bt(S=>{const{scope:C,children:L}=S,A=k.useRef(null),j=k.useRef(new Map).current;return m.jsx(c,{scope:C,itemMap:j,collectionRef:A,children:L})},"CollectionProvider");u.displayName=t;const h=e+"CollectionSlot",f=Ma(h),y=k.forwardRef((S,C)=>{const{scope:L,children:A}=S,j=d(h,L),E=Ee(C,j.collectionRef);return m.jsx(f,{ref:E,children:A})});y.displayName=h;const x=e+"CollectionItemSlot",g="data-radix-collection-item",b=Ma(x),M=k.forwardRef((S,C)=>{const{scope:L,children:A,...j}=S,E=k.useRef(null),z=Ee(C,E),R=d(x,L);return k.useEffect(()=>(R.itemMap.set(E,{ref:E,...j}),()=>{R.itemMap.delete(E)})),m.jsx(b,{[g]:"",ref:z,children:A})});M.displayName=x;function _(S){const C=d(e+"CollectionConsumer",S);return k.useCallback(()=>{const A=C.collectionRef.current;if(!A)return[];const j=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((R,$)=>j.indexOf(R.ref.current)-j.indexOf($.ref.current))},[C.collectionRef,C.itemMap])}return Bt(_,"useCollection"),[{Provider:u,Slot:y,ItemSlot:M},_,r]}Bt(cd,"createCollection");var pV=new WeakMap,Rt,Zn,KP=(Zn=class extends Map{constructor(a){super(a);XO(this,Rt);gP(this,Rt,[...super.keys()]),pV.set(this,!0)}set(a,r){return pV.get(this)&&(this.has(a)?Jt(this,Rt)[Jt(this,Rt).indexOf(a)]=a:Jt(this,Rt).push(a)),super.set(a,r),this}insert(a,r,c){const d=this.has(r),u=Jt(this,Rt).length,h=UT(a);let f=h>=0?h:u+h;const y=f<0||f>=u?-1:f;if(y===this.size||d&&y===this.size-1||y===-1)return this.set(r,c),this;const x=this.size+(d?0:1);h<0&&f++;const g=[...Jt(this,Rt)];let b,M=!1;for(let _=f;_<x;_++)if(f===_){let S=g[_];g[_]===r&&(S=g[_+1]),d&&this.delete(r),b=this.get(S),this.set(r,c)}else{!M&&g[_-1]===r&&(M=!0);const S=g[M?_:_-1],C=b;b=this.get(S),this.delete(S),this.set(S,C)}return this}with(a,r,c){const d=new Zn(this);return d.insert(a,r,c),d}before(a){const r=Jt(this,Rt).indexOf(a)-1;if(!(r<0))return this.entryAt(r)}setBefore(a,r,c){const d=Jt(this,Rt).indexOf(a);return d===-1?this:this.insert(d,r,c)}after(a){let r=Jt(this,Rt).indexOf(a);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(a,r,c){const d=Jt(this,Rt).indexOf(a);return d===-1?this:this.insert(d+1,r,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return gP(this,Rt,[]),super.clear()}delete(a){const r=super.delete(a);return r&&Jt(this,Rt).splice(Jt(this,Rt).indexOf(a),1),r}deleteAt(a){const r=this.keyAt(a);return r!==void 0?this.delete(r):!1}at(a){const r=eA(Jt(this,Rt),a);if(r!==void 0)return this.get(r)}entryAt(a){const r=eA(Jt(this,Rt),a);if(r!==void 0)return[r,this.get(r)]}indexOf(a){return Jt(this,Rt).indexOf(a)}keyAt(a){return eA(Jt(this,Rt),a)}from(a,r){const c=this.indexOf(a);if(c===-1)return;let d=c+r;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,r){const c=this.indexOf(a);if(c===-1)return;let d=c+r;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,r){let c=0;for(const d of this){if(Reflect.apply(a,r,[d,c,this]))return d;c++}}findIndex(a,r){let c=0;for(const d of this){if(Reflect.apply(a,r,[d,c,this]))return c;c++}return-1}filter(a,r){const c=[];let d=0;for(const u of this)Reflect.apply(a,r,[u,d,this])&&c.push(u),d++;return new Zn(c)}map(a,r){const c=[];let d=0;for(const u of this)c.push([u[0],Reflect.apply(a,r,[u,d,this])]),d++;return new Zn(c)}reduce(...a){const[r,c]=a;let d=0,u=c??this.at(0);for(const h of this)d===0&&a.length===1?u=h:u=Reflect.apply(r,this,[u,h,d,this]),d++;return u}reduceRight(...a){const[r,c]=a;let d=c??this.at(-1);for(let u=this.size-1;u>=0;u--){const h=this.at(u);u===this.size-1&&a.length===1?d=h:d=Reflect.apply(r,this,[d,h,u,this])}return d}toSorted(a){const r=[...this.entries()].sort(a);return new Zn(r)}toReversed(){const a=new Zn;for(let r=this.size-1;r>=0;r--){const c=this.keyAt(r),d=this.get(c);a.set(c,d)}return a}toSpliced(...a){const r=[...this.entries()];return r.splice(...a),new Zn(r)}slice(a,r){const c=new Zn;let d=this.size-1;if(a===void 0)return c;a<0&&(a=a+this.size),r!==void 0&&r>0&&(d=r-1);for(let u=a;u<=d;u++){const h=this.keyAt(u),f=this.get(h);c.set(h,f)}return c}every(a,r){let c=0;for(const d of this){if(!Reflect.apply(a,r,[d,c,this]))return!1;c++}return!0}some(a,r){let c=0;for(const d of this){if(Reflect.apply(a,r,[d,c,this]))return!0;c++}return!1}},Rt=new WeakMap,Bt(Zn,"OrderedDict"),Zn);function eA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const a=rG(e,t);return a===-1?void 0:e[a]}Bt(eA,"at");function rG(e,t){const a=e.length,r=UT(t),c=r>=0?r:a+r;return c<0||c>=a?-1:c}Bt(rG,"toSafeIndex");function UT(e){return e!==e||e===0?0:Math.trunc(e)}Bt(UT,"toSafeInteger");function mSe(e){const t=e+"CollectionProvider",[a,r]=qt(t),[c,d]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new KP,setItemMap:Bt(()=>{},"setItemMap")}),u=Bt(({state:j,...E})=>j?m.jsx(f,{...E,state:j}):m.jsx(h,{...E}),"CollectionProvider");u.displayName=t;const h=Bt(j=>{const E=C();return m.jsx(f,{...j,state:E})},"CollectionInit");h.displayName=t+"Init";const f=Bt(j=>{const{scope:E,children:z,state:R}=j,$=k.useRef(null),[H,K]=k.useState(null),ae=Ee($,K),[Y,G]=R;return k.useEffect(()=>{if(!H)return;const J=sG(()=>{});return J.observe(H,{childList:!0,subtree:!0}),()=>{J.disconnect()}},[H]),m.jsx(c,{scope:E,itemMap:Y,setItemMap:G,collectionRef:ae,collectionRefObject:$,collectionElement:H,children:z})},"CollectionProviderImpl");f.displayName=t+"Impl";const y=e+"CollectionSlot",x=Ma(y),g=k.forwardRef((j,E)=>{const{scope:z,children:R}=j,$=d(y,z),H=Ee(E,$.collectionRef);return m.jsx(x,{ref:H,children:R})});g.displayName=y;const b=e+"CollectionItemSlot",M="data-radix-collection-item",_=Ma(b),S=k.forwardRef((j,E)=>{const{scope:z,children:R,...$}=j,H=k.useRef(null),[K,ae]=k.useState(null),Y=Ee(E,H,ae),G=d(b,z),{setItemMap:J}=G,oe=k.useRef($);iG(oe.current,$)||(oe.current=$);const he=oe.current;return k.useEffect(()=>{const N=he;return J(P=>K?P.has(K)?P.set(K,{...N,element:K}).toSorted(zR):(P.set(K,{...N,element:K}),P.toSorted(zR)):P),()=>{J(P=>!K||!P.has(K)?P:(P.delete(K),new KP(P)))}},[K,he,J]),m.jsx(_,{[M]:"",ref:Y,children:R})});S.displayName=b;function C(){return k.useState(new KP)}Bt(C,"useInitCollection");function L(j){const{itemMap:E}=d(e+"CollectionConsumer",j);return E}return Bt(L,"useCollection"),[{Provider:u,Slot:g,ItemSlot:S},{createCollectionScope:r,useCollection:L,useInitCollection:C}]}Bt(mSe,"createCollection");function iG(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}Bt(iG,"shallowEqual");function cG(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Bt(cG,"isElementPreceding");function zR(e,t){return!e[1].element||!t[1].element?0:cG(e[1].element,t[1].element)?-1:1}Bt(zR,"sortByDocumentPosition");function sG(e){return new MutationObserver(a=>{for(const r of a)if(r.type==="childList"){e();return}})}Bt(sG,"getChildListObserver");var kSe=Object.defineProperty,gSe=(e,t)=>kSe(e,"name",{value:t,configurable:!0}),vSe=k.createContext(void 0);function Vl(e){const t=k.useContext(vSe);return e||t||"ltr"}gSe(Vl,"useDirection");const xSe=["top","right","bottom","left"],gr=Math.min,Mo=Math.max,xA=Math.round,H0=Math.floor,wo=e=>({x:e,y:e}),bSe={left:"right",right:"left",bottom:"top",top:"bottom"};function lG(e,t,a){return Mo(e,gr(t,a))}function No(e,t){return typeof e=="function"?e(t):e}function vr(e){return e.split("-")[0]}function sd(e){return e.split("-")[1]}function GT(e){return e==="x"?"y":"x"}function ZT(e){return e==="y"?"height":"width"}function Va(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function YT(e){return GT(Va(e))}function MSe(e,t,a){a===void 0&&(a=!1);const r=sd(e),c=YT(e),d=ZT(c);let u=c==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[d]>t.floating[d]&&(u=bA(u)),[u,bA(u)]}function wSe(e){const t=bA(e);return[$R(e),t,$R(t)]}function $R(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const fV=["left","right"],yV=["right","left"],_Se=["top","bottom"],SSe=["bottom","top"];function CSe(e,t,a){switch(e){case"top":case"bottom":return a?t?yV:fV:t?fV:yV;case"left":case"right":return t?_Se:SSe;default:return[]}}function LSe(e,t,a,r){const c=sd(e);let d=CSe(vr(e),a==="start",r);return c&&(d=d.map(u=>u+"-"+c),t&&(d=d.concat(d.map($R)))),d}function bA(e){const t=vr(e);return bSe[t]+e.slice(t.length)}function NSe(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 dG(e){return typeof e!="number"?NSe(e):{top:e,right:e,bottom:e,left:e}}function MA(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 mV(e,t,a){let{reference:r,floating:c}=e;const d=Va(t),u=YT(t),h=ZT(u),f=vr(t),y=d==="y",x=r.x+r.width/2-c.width/2,g=r.y+r.height/2-c.height/2,b=r[h]/2-c[h]/2;let M;switch(f){case"top":M={x,y:r.y-c.height};break;case"bottom":M={x,y:r.y+r.height};break;case"right":M={x:r.x+r.width,y:g};break;case"left":M={x:r.x-c.width,y:g};break;default:M={x:r.x,y:r.y}}const _=sd(t);return _&&(M[u]+=b*(_==="end"?1:-1)*(a&&y?-1:1)),M}async function ISe(e,t){var a;t===void 0&&(t={});const{x:r,y:c,platform:d,rects:u,elements:h,strategy:f}=e,{boundary:y="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:b=!1,padding:M=0}=No(t,e),_=dG(M),C=h[b?g==="floating"?"reference":"floating":g],L=MA(await d.getClippingRect({element:(a=await(d.isElement==null?void 0:d.isElement(C)))==null||a?C:C.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(h.floating)),boundary:y,rootBoundary:x,strategy:f})),A=g==="floating"?{x:r,y:c,width:u.floating.width,height:u.floating.height}:u.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(h.floating)),E=await(d.isElement==null?void 0:d.isElement(j))&&await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1},z=MA(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:j,strategy:f}):A);return{top:(L.top-z.top+_.top)/E.y,bottom:(z.bottom-L.bottom+_.bottom)/E.y,left:(L.left-z.left+_.left)/E.x,right:(z.right-L.right+_.right)/E.x}}const ASe=50,jSe=async(e,t,a)=>{const{placement:r="bottom",strategy:c="absolute",middleware:d=[],platform:u}=a,h=u.detectOverflow?u:{...u,detectOverflow:ISe},f=await(u.isRTL==null?void 0:u.isRTL(t));let y=await u.getElementRects({reference:e,floating:t,strategy:c}),{x,y:g}=mV(y,r,f),b=r,M=0;const _={};for(let S=0;S<d.length;S++){const C=d[S];if(!C)continue;const{name:L,fn:A}=C,{x:j,y:E,data:z,reset:R}=await A({x,y:g,initialPlacement:r,placement:b,strategy:c,middlewareData:_,rects:y,platform:h,elements:{reference:e,floating:t}});x=j??x,g=E??g,_[L]={..._[L],...z},R&&M<ASe&&(M++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(y=R.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:c}):R.rects),{x,y:g}=mV(y,b,f)),S=-1)}return{x,y:g,placement:b,strategy:c,middlewareData:_}},ESe=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:r,placement:c,rects:d,platform:u,elements:h,middlewareData:f}=t,{element:y,padding:x=0}=No(e,t)||{};if(y==null)return{};const g=dG(x),b={x:a,y:r},M=YT(c),_=ZT(M),S=await u.getDimensions(y),C=M==="y",L=C?"top":"left",A=C?"bottom":"right",j=C?"clientHeight":"clientWidth",E=d.reference[_]+d.reference[M]-b[M]-d.floating[_],z=b[M]-d.reference[M],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(y));let $=R?R[j]:0;(!$||!await(u.isElement==null?void 0:u.isElement(R)))&&($=h.floating[j]||d.floating[_]);const H=E/2-z/2,K=$/2-S[_]/2-1,ae=gr(g[L],K),Y=gr(g[A],K),G=$-S[_]-Y,J=$/2-S[_]/2+H,oe=lG(ae,J,G),he=!f.arrow&&sd(c)!=null&&J!==oe&&d.reference[_]/2-(J<ae?ae:Y)-S[_]/2<0,N=he?J<ae?J-ae:J-G:0;return{[M]:b[M]+N,data:{[M]:oe,centerOffset:J-oe-N,...he&&{alignmentOffset:N}},reset:he}}}),PSe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,r;const{placement:c,middlewareData:d,rects:u,initialPlacement:h,platform:f,elements:y}=t,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:M="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:S=!0,...C}=No(e,t);if((a=d.arrow)!=null&&a.alignmentOffset)return{};const L=vr(c),A=Va(h),j=vr(h)===h,E=await(f.isRTL==null?void 0:f.isRTL(y.floating)),z=b||(j||!S?[bA(h)]:wSe(h)),R=_!=="none";!b&&R&&z.push(...LSe(h,S,_,E));const $=[h,...z],H=await f.detectOverflow(t,C),K=[];let ae=((r=d.flip)==null?void 0:r.overflows)||[];if(x&&K.push(H[L]),g){const oe=MSe(c,u,E);K.push(H[oe[0]],H[oe[1]])}if(ae=[...ae,{placement:c,overflows:K}],!K.every(oe=>oe<=0)){var Y,G;const oe=(((Y=d.flip)==null?void 0:Y.index)||0)+1,he=$[oe];if(he&&(!(g==="alignment"?A!==Va(he):!1)||ae.every(O=>Va(O.placement)===A?O.overflows[0]>0:!0)))return{data:{index:oe,overflows:ae},reset:{placement:he}};let N=(G=ae.filter(P=>P.overflows[0]<=0).sort((P,O)=>P.overflows[1]-O.overflows[1])[0])==null?void 0:G.placement;if(!N)switch(M){case"bestFit":{var J;const P=(J=ae.filter(O=>{if(R){const te=Va(O.placement);return te===A||te==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(te=>te>0).reduce((te,B)=>te+B,0)]).sort((O,te)=>O[1]-te[1])[0])==null?void 0:J[0];P&&(N=P);break}case"initialPlacement":N=h;break}if(c!==N)return{reset:{placement:N}}}return{}}}};function kV(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gV(e){return xSe.some(t=>e[t]>=0)}const RSe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:r}=t,{strategy:c="referenceHidden",...d}=No(e,t);switch(c){case"referenceHidden":{const u=await r.detectOverflow(t,{...d,elementContext:"reference"}),h=kV(u,a.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:gV(h)}}}case"escaped":{const u=await r.detectOverflow(t,{...d,altBoundary:!0}),h=kV(u,a.floating);return{data:{escapedOffsets:h,escaped:gV(h)}}}default:return{}}}}},uG=new Set(["left","top"]);async function TSe(e,t){const{placement:a,platform:r,elements:c}=e,d=await(r.isRTL==null?void 0:r.isRTL(c.floating)),u=vr(a),h=sd(a),f=Va(a)==="y",y=uG.has(u)?-1:1,x=d&&f?-1:1,g=No(t,e);let{mainAxis:b,crossAxis:M,alignmentAxis:_}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return h&&typeof _=="number"&&(M=h==="end"?_*-1:_),f?{x:M*x,y:b*y}:{x:b*y,y:M*x}}const DSe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,r;const{x:c,y:d,placement:u,middlewareData:h}=t,f=await TSe(t,e);return u===((a=h.offset)==null?void 0:a.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:c+f.x,y:d+f.y,data:{...f,placement:u}}}}},zSe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:r,placement:c,platform:d}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:f={fn:A=>{let{x:j,y:E}=A;return{x:j,y:E}}},...y}=No(e,t),x={x:a,y:r},g=await d.detectOverflow(t,y),b=Va(c),M=GT(b);let _=x[M],S=x[b];const C=(A,j)=>lG(j+g[A==="y"?"top":"left"],j,j-g[A==="y"?"bottom":"right"]);u&&(_=C(M,_)),h&&(S=C(b,S));const L=f.fn({...t,[M]:_,[b]:S});return{...L,data:{x:L.x-a,y:L.y-r,enabled:{[M]:u,[b]:h}}}}}},$Se=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,r;const{x:c,y:d,placement:u,rects:h,middlewareData:f}=t,{offset:y=0,mainAxis:x=!0,crossAxis:g=!0}=No(e,t),b={x:c,y:d},M=Va(u),_=GT(M);let S=b[_],C=b[M];const L=No(y,t),A=typeof L=="number"?{mainAxis:L,crossAxis:0}:{mainAxis:(a=L.mainAxis)!=null?a:0,crossAxis:(r=L.crossAxis)!=null?r:0};if(x){const z=_==="y"?"height":"width",R=h.reference[_]-h.floating[z]+A.mainAxis,$=h.reference[_]+h.reference[z]-A.mainAxis;S<R?S=R:S>$&&(S=$)}if(g){var j,E;const z=_==="y"?"width":"height",R=uG.has(vr(u)),$=h.reference[M]-h.floating[z]+(R&&((j=f.offset)==null?void 0:j[M])||0)+(R?0:A.crossAxis),H=h.reference[M]+h.reference[z]+(R?0:((E=f.offset)==null?void 0:E[M])||0)-(R?A.crossAxis:0);C<$?C=$:C>H&&(C=H)}return{[_]:S,[M]:C}}}},qSe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:r,platform:c,elements:d}=t,{apply:u=()=>{},...h}=No(e,t),f=await c.detectOverflow(t,h),y=vr(a),x=sd(a),g=Va(a)==="y",{width:b,height:M}=r.floating;let _,S;y==="top"||y==="bottom"?(_=y,S=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=y,_=x==="end"?"top":"bottom");const C=M-f.top-f.bottom,L=b-f.left-f.right,A=gr(M-f[_],C),j=gr(b-f[S],L),E=t.middlewareData.shift,z=!E;let R=A,$=j;E!=null&&E.enabled.x&&($=L),E!=null&&E.enabled.y&&(R=C),z&&!x&&(g?$=b-2*Mo(f.left,f.right):R=M-2*Mo(f.top,f.bottom)),await u({...t,availableWidth:$,availableHeight:R});const H=await c.getDimensions(d.floating);return b!==H.width||M!==H.height?{reset:{rects:!0}}:{}}}};function BA(){return typeof window<"u"}function ld(e){return hG(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Io(e){var t;return(t=(hG(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hG(e){return BA()?e instanceof Node||e instanceof zn(e).Node:!1}function Za(e){return BA()?e instanceof Element||e instanceof zn(e).Element:!1}function _r(e){return BA()?e instanceof HTMLElement||e instanceof zn(e).HTMLElement:!1}function vV(e){return!BA()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot}function FA(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 OSe(e){return/^(table|td|th)$/.test(ld(e))}function UA(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const HSe=/transform|translate|scale|rotate|perspective|filter/,VSe=/paint|layout|strict|content/,Wr=e=>!!e&&e!=="none";let QP;function XT(e){const t=Za(e)?Ya(e):e;return Wr(t.transform)||Wr(t.translate)||Wr(t.scale)||Wr(t.rotate)||Wr(t.perspective)||!WT()&&(Wr(t.backdropFilter)||Wr(t.filter))||HSe.test(t.willChange||"")||VSe.test(t.contain||"")}function BSe(e){let t=Tl(e);for(;_r(t)&&!qu(t);){if(XT(t))return t;if(UA(t))return null;t=Tl(t)}return null}function WT(){return QP==null&&(QP=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),QP}function qu(e){return/^(html|body|#document)$/.test(ld(e))}function Ya(e){return zn(e).getComputedStyle(e)}function GA(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tl(e){if(ld(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vV(e)&&e.host||Io(e);return vV(t)?t.host:t}function pG(e){const t=Tl(e);return qu(t)?(e.ownerDocument||e).body:_r(t)&&FA(t)?t:pG(t)}function Ou(e,t,a){var r;t===void 0&&(t=[]),a===void 0&&(a=!0);const c=pG(e),d=c===((r=e.ownerDocument)==null?void 0:r.body),u=zn(c);if(d){const h=qR(u);return t.concat(u,u.visualViewport||[],FA(c)?c:[],h&&a?Ou(h):[])}else return t.concat(c,Ou(c,[],a))}function qR(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fG(e){const t=Ya(e);let a=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const c=_r(e),d=c?e.offsetWidth:a,u=c?e.offsetHeight:r,h=xA(a)!==d||xA(r)!==u;return h&&(a=d,r=u),{width:a,height:r,$:h}}function KT(e){return Za(e)?e:e.contextElement}function W1(e){const t=KT(e);if(!_r(t))return wo(1);const a=t.getBoundingClientRect(),{width:r,height:c,$:d}=fG(t);let u=(d?xA(a.width):a.width)/r,h=(d?xA(a.height):a.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const FSe=wo(0);function yG(e){const t=zn(e);return!WT()||!t.visualViewport?FSe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function USe(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===zn(e)}function Dl(e,t,a,r){t===void 0&&(t=!1),a===void 0&&(a=!1);const c=e.getBoundingClientRect(),d=KT(e);let u=wo(1);t&&(r?Za(r)&&(u=W1(r)):u=W1(e));const h=USe(d,a,r)?yG(d):wo(0);let f=(c.left+h.x)/u.x,y=(c.top+h.y)/u.y,x=c.width/u.x,g=c.height/u.y;if(d&&r){const b=zn(d),M=Za(r)?zn(r):r;let _=b,S=qR(_);for(;S&&M!==_;){const C=W1(S),L=S.getBoundingClientRect(),A=Ya(S),j=L.left+(S.clientLeft+parseFloat(A.paddingLeft))*C.x,E=L.top+(S.clientTop+parseFloat(A.paddingTop))*C.y;f*=C.x,y*=C.y,x*=C.x,g*=C.y,f+=j,y+=E,_=zn(S),S=qR(_)}}return MA({width:x,height:g,x:f,y})}function ZA(e,t){const a=GA(e).scrollLeft;return t?t.left+a:Dl(Io(e)).left+a}function mG(e,t){const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-ZA(e,a),c=a.top+t.scrollTop;return{x:r,y:c}}function GSe(e){let{elements:t,rect:a,offsetParent:r,strategy:c}=e;const d=c==="fixed",u=Io(r),h=t?UA(t.floating):!1;if(r===u||h&&d)return a;let f={scrollLeft:0,scrollTop:0},y=wo(1);const x=wo(0),g=_r(r);if((g||!d)&&((ld(r)!=="body"||FA(u))&&(f=GA(r)),g)){const M=Dl(r);y=W1(r),x.x=M.x+r.clientLeft,x.y=M.y+r.clientTop}const b=u&&!g&&!d?mG(u,f):wo(0);return{width:a.width*y.x,height:a.height*y.y,x:a.x*y.x-f.scrollLeft*y.x+x.x+b.x,y:a.y*y.y-f.scrollTop*y.y+x.y+b.y}}function ZSe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function YSe(e){const t=GA(e),a=e.ownerDocument.body,r=Mo(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),c=Mo(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let d=-t.scrollLeft+ZA(e);const u=-t.scrollTop;return Ya(a).direction==="rtl"&&(d+=Mo(e.clientWidth,a.clientWidth)-r),{width:r,height:c,x:d,y:u}}const XSe=25;function WSe(e,t,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",c=zn(e),d=Io(e),u=c.visualViewport;let h=d.clientWidth,f=d.clientHeight,y=0,x=0;if(u){const b=!WT()||t==="fixed";r?b||(y=-u.offsetLeft,x=-u.offsetTop):(h=u.width,f=u.height,b&&(y=u.offsetLeft,x=u.offsetTop))}if(ZA(d)<=0){const b=d.ownerDocument,M=b.body,_=getComputedStyle(M),S=b.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,C=Math.abs(d.clientWidth-M.clientWidth-S),L=getComputedStyle(d).scrollbarGutter==="stable both-edges"?C/2:C;L<=XSe&&(h-=L)}return{width:h,height:f,x:y,y:x}}function KSe(e,t){const a=Dl(e,!0,t==="fixed"),r=a.top+e.clientTop,c=a.left+e.clientLeft,d=W1(e),u=e.clientWidth*d.x,h=e.clientHeight*d.y,f=c*d.x,y=r*d.y;return{width:u,height:h,x:f,y}}function xV(e,t,a){let r;if(t==="viewport"||t==="layoutViewport")r=WSe(e,a,t);else if(t==="document")r=YSe(Io(e));else if(Za(t))r=KSe(t,a);else{const c=yG(e);r={x:t.x-c.x,y:t.y-c.y,width:t.width,height:t.height}}return MA(r)}function QSe(e,t){const a=t.get(e);if(a)return a;let r=Ou(e,[],!1).filter(h=>Za(h)&&ld(h)!=="body"),c=null;const d=Ya(e).position==="fixed";let u=d?Tl(e):e;for(;Za(u)&&!qu(u);){const h=Ya(u),f=XT(u),y=c?c.position:d?"fixed":"";!f&&(y==="fixed"||y==="absolute"&&h.position==="static")?r=r.filter(g=>g!==u):c=h,u=Tl(u)}return t.set(e,r),r}function JSe(e){let{element:t,boundary:a,rootBoundary:r,strategy:c}=e;const u=[...a==="clippingAncestors"?UA(t)?[]:QSe(t,this._c):[].concat(a),r],h=xV(t,u[0],c);let f=h.top,y=h.right,x=h.bottom,g=h.left;for(let b=1;b<u.length;b++){const M=xV(t,u[b],c);f=Mo(M.top,f),y=gr(M.right,y),x=gr(M.bottom,x),g=Mo(M.left,g)}return{width:y-g,height:x-f,x:g,y:f}}function eCe(e){const{width:t,height:a}=fG(e);return{width:t,height:a}}function tCe(e,t,a){const r=_r(t),c=Io(t),d=a==="fixed",u=Dl(e,!0,d,t);let h={scrollLeft:0,scrollTop:0};const f=wo(0);if((r||!d)&&((ld(t)!=="body"||FA(c))&&(h=GA(t)),r)){const b=Dl(t,!0,d,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!r&&c&&(f.x=ZA(c));const y=c&&!r&&!d?mG(c,h):wo(0),x=u.left+h.scrollLeft-f.x-y.x,g=u.top+h.scrollTop-f.y-y.y;return{x,y:g,width:u.width,height:u.height}}function JP(e){return Ya(e).position==="static"}function bV(e,t){if(!_r(e)||Ya(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Io(e)===a&&(a=a.ownerDocument.body),a}function kG(e,t){const a=zn(e);if(UA(e))return a;if(!_r(e)){let c=Tl(e);for(;c&&!qu(c);){if(Za(c)&&!JP(c))return c;c=Tl(c)}return a}let r=bV(e,t);for(;r&&OSe(r)&&JP(r);)r=bV(r,t);return r&&qu(r)&&JP(r)&&!XT(r)?a:r||BSe(e)||a}const nCe=async function(e){const t=this.getOffsetParent||kG,a=this.getDimensions,r=await a(e.floating);return{reference:tCe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function aCe(e){return Ya(e).direction==="rtl"}const oCe={convertOffsetParentRelativeRectToViewportRelativeRect:GSe,getDocumentElement:Io,getClippingRect:JSe,getOffsetParent:kG,getElementRects:nCe,getClientRects:ZSe,getDimensions:eCe,getScale:W1,isElement:Za,isRTL:aCe};function gG(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rCe(e,t,a){let r=null,c;const d=Io(e);function u(){var x;clearTimeout(c),(x=r)==null||x.disconnect(),r=null}function h(x,g){x===void 0&&(x=!1),g===void 0&&(g=1),u();const b=e.getBoundingClientRect(),{left:M,top:_,width:S,height:C}=b;if(x||t(),!S||!C)return;const L=H0(_),A=H0(d.clientWidth-(M+S)),j=H0(d.clientHeight-(_+C)),E=H0(M),R={rootMargin:-L+"px "+-A+"px "+-j+"px "+-E+"px",threshold:Mo(0,gr(1,g))||1};let $=!0;function H(K){const ae=K[0].intersectionRatio;if(!gG(b,e.getBoundingClientRect()))return h();if(ae!==g){if(!$)return h();ae?h(!1,ae):c=setTimeout(()=>{h(!1,1e-7)},1e3)}$=!1}try{r=new IntersectionObserver(H,{...R,root:d.ownerDocument})}catch{r=new IntersectionObserver(H,R)}r.observe(e)}const f=zn(e),y=()=>h(a);return f.addEventListener("resize",y),h(!0),()=>{f.removeEventListener("resize",y),u()}}function iCe(e,t,a,r){r===void 0&&(r={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,y=KT(e),x=c||d?[...y?Ou(y):[],...t?Ou(t):[]]:[];x.forEach(L=>{c&&L.addEventListener("scroll",a),d&&L.addEventListener("resize",a)});const g=y&&h?rCe(y,a,d):null;let b=-1,M=null;u&&(M=new ResizeObserver(L=>{let[A]=L;A&&A.target===y&&M&&t&&(M.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var j;(j=M)==null||j.observe(t)})),a()}),y&&!f&&M.observe(y),t&&M.observe(t));let _,S=f?Dl(e):null;f&&C();function C(){const L=Dl(e);S&&!gG(S,L)&&a(),S=L,_=requestAnimationFrame(C)}return a(),()=>{var L;x.forEach(A=>{c&&A.removeEventListener("scroll",a),d&&A.removeEventListener("resize",a)}),g?.(),(L=M)==null||L.disconnect(),M=null,f&&cancelAnimationFrame(_)}}const cCe=DSe,sCe=zSe,lCe=PSe,dCe=qSe,uCe=RSe,MV=ESe,hCe=$Se,pCe=(e,t,a)=>{const r=new Map,c=a??{},d={...oCe,...c.platform,_c:r};return jSe(e,t,{...c,platform:d})};var fCe=typeof document<"u",yCe=function(){},tA=fCe?k.useLayoutEffect:yCe;function wA(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(!wA(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 d=c[r];if(!(d==="_owner"&&e.$$typeof)&&!wA(e[d],t[d]))return!1}return!0}return e!==e&&t!==t}function vG(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wV(e,t){const a=vG(e);return Math.round(t*a)/a}function eR(e){const t=k.useRef(e);return tA(()=>{t.current=e}),t}function mCe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:r=[],platform:c,elements:{reference:d,floating:u}={},transform:h=!0,whileElementsMounted:f,open:y}=e,[x,g]=k.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[b,M]=k.useState(r);wA(b,r)||M(r);const[_,S]=k.useState(null),[C,L]=k.useState(null),A=k.useCallback(O=>{O!==R.current&&(R.current=O,S(O))},[]),j=k.useCallback(O=>{O!==$.current&&($.current=O,L(O))},[]),E=d||_,z=u||C,R=k.useRef(null),$=k.useRef(null),H=k.useRef(x),K=f!=null,ae=eR(f),Y=eR(c),G=eR(y),J=k.useCallback(()=>{if(!R.current||!$.current)return;const O={placement:t,strategy:a,middleware:b};Y.current&&(O.platform=Y.current),pCe(R.current,$.current,O).then(te=>{const B={...te,isPositioned:G.current!==!1};oe.current&&!wA(H.current,B)&&(H.current=B,$l.flushSync(()=>{g(B)}))})},[b,t,a,Y,G]);tA(()=>{y===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[y]);const oe=k.useRef(!1);tA(()=>(oe.current=!0,()=>{oe.current=!1}),[]),tA(()=>{if(E&&(R.current=E),z&&($.current=z),E&&z){if(ae.current)return ae.current(E,z,J);J()}},[E,z,J,ae,K]);const he=k.useMemo(()=>({reference:R,floating:$,setReference:A,setFloating:j}),[A,j]),N=k.useMemo(()=>({reference:E,floating:z}),[E,z]),P=k.useMemo(()=>{const O={position:a,left:0,top:0};if(!N.floating)return O;const te=wV(N.floating,x.x),B=wV(N.floating,x.y);return h?{...O,transform:"translate("+te+"px, "+B+"px)",...vG(N.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:te,top:B}},[a,h,N.floating,x.x,x.y]);return k.useMemo(()=>({...x,update:J,refs:he,elements:N,floatingStyles:P}),[x,J,he,N,P])}const kCe=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?MV({element:r.current,padding:c}).fn(a):{}:r?MV({element:r,padding:c}).fn(a):{}}}},gCe=(e,t)=>{const a=cCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},vCe=(e,t)=>{const a=sCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},xCe=(e,t)=>({fn:hCe(e).fn,options:[e,t]}),bCe=(e,t)=>{const a=lCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},MCe=(e,t)=>{const a=dCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},wCe=(e,t)=>{const a=uCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},_Ce=(e,t)=>{const a=kCe(e);return{name:a.name,fn:a.fn,options:[e,t]}};var SCe=Object.defineProperty,CCe=(e,t)=>SCe(e,"name",{value:t,configurable:!0}),LCe=k.forwardRef(CCe(function(t,a){const{children:r,width:c=10,height:d=5,...u}=t;return m.jsx(ge.svg,{...u,ref:a,width:c,height:d,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:m.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),NCe=LCe,ICe=Object.defineProperty,_o=(e,t)=>ICe(e,"name",{value:t,configurable:!0}),xG="Popper",[bG,Sr]=qt(xG),[ACe,MG]=bG(xG),jCe=_o(e=>{const{__scopePopper:t,children:a}=e,[r,c]=k.useState(null),[d,u]=k.useState(void 0);return m.jsx(ACe,{scope:t,anchor:r,onAnchorChange:c,placementState:d,setPlacementState:u,children:a})},"Popper"),ECe="PopperAnchor",PCe=k.forwardRef(_o(function(t,a){const{__scopePopper:r,virtualRef:c,...d}=t,u=MG(ECe,r),h=k.useRef(null),f=u.onAnchorChange,y=k.useCallback(S=>{h.current=S,S&&f(S)},[f]),x=Ee(a,y),g=k.useRef(null);k.useEffect(()=>{if(!c)return;const S=g.current;g.current=c.current,S!==g.current&&f(g.current)});const b=u.placementState&&YA(u.placementState),M=b?.[0],_=b?.[1];return c?null:m.jsx(ge.div,{"data-radix-popper-side":M,"data-radix-popper-align":_,...d,ref:x})},"PopperAnchor")),wG="PopperContent",[RCe,TCe]=bG(wG),DCe=k.forwardRef(_o(function(t,a){const{__scopePopper:r,side:c="bottom",sideOffset:d=0,align:u="center",alignOffset:h=0,arrowPadding:f=0,avoidCollisions:y=!0,collisionBoundary:x=[],collisionPadding:g=0,sticky:b="partial",hideWhenDetached:M=!1,updatePositionStrategy:_="optimized",onPlaced:S,...C}=t,L=MG(wG,r),[A,j]=k.useState(null),E=Ee(a,j),[z,R]=k.useState(null),$=t2(z),H=$?.width??0,K=$?.height??0,ae=c+(u!=="center"?"-"+u:""),Y=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},G=Array.isArray(x)?x:[x],J=G.length>0,oe={padding:Y,boundary:G.filter(_G),altBoundary:J},{refs:he,floatingStyles:N,placement:P,isPositioned:O,middlewareData:te}=mCe({strategy:"fixed",placement:ae,whileElementsMounted:_o((...se)=>iCe(...se,{animationFrame:_==="always"}),"whileElementsMounted"),elements:{reference:L.anchor},middleware:[gCe({mainAxis:d+K,alignmentAxis:h}),y&&vCe({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?xCe():void 0,...oe}),y&&bCe({...oe}),MCe({...oe,apply:_o(({elements:se,rects:_e,availableWidth:ve,availableHeight:Ne})=>{const{width:Re,height:qe}=_e.reference,xe=se.floating.style;xe.setProperty("--radix-popper-available-width",`${ve}px`),xe.setProperty("--radix-popper-available-height",`${Ne}px`),xe.setProperty("--radix-popper-anchor-width",`${Re}px`),xe.setProperty("--radix-popper-anchor-height",`${qe}px`)},"apply")}),z&&_Ce({element:z,padding:f}),OCe({arrowWidth:H,arrowHeight:K}),M&&wCe({strategy:"referenceHidden",...oe,boundary:J?oe.boundary:void 0})]}),B=L.setPlacementState;mt(()=>(B(P),()=>{B(void 0)}),[P,B]);const[D,T]=YA(P),U=yn(S);mt(()=>{O&&U?.()},[O,U]);const X=te.arrow?.x,Z=te.arrow?.y,ce=te.arrow?.centerOffset!==0,[pe,ie]=k.useState();return mt(()=>{A&&ie(window.getComputedStyle(A).zIndex)},[A]),m.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:O?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(RCe,{scope:r,placedSide:D,placedAlign:T,onArrowChange:R,arrowX:X,arrowY:Z,shouldHideArrow:ce,children:m.jsx(ge.div,{"data-side":D,"data-align":T,...C,ref:E,style:{...C.style,animation:O?C.style?.animation:"none"}})})})},"PopperContent")),zCe="PopperArrow",$Ce={top:"bottom",right:"left",bottom:"top",left:"right"},qCe=k.forwardRef(_o(function(t,a){const{__scopePopper:r,...c}=t,d=TCe(zCe,r),u=$Ce[d.placedSide];return m.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:m.jsx(NCe,{...c,ref:a,style:{...c.style,display:"block"}})})},"PopperArrow"));function _G(e){return e!==null}_o(_G,"isNotNull");var OCe=_o(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,f=u?0:e.arrowHeight,[y,x]=YA(a),g={start:"0%",center:"50%",end:"100%"}[x],b=(c.arrow?.x??0)+h/2,M=(c.arrow?.y??0)+f/2;let _="",S="";return y==="bottom"?(_=u?g:`${b}px`,S=`${-f}px`):y==="top"?(_=u?g:`${b}px`,S=`${r.floating.height+f}px`):y==="right"?(_=`${-f}px`,S=u?g:`${M}px`):y==="left"&&(_=`${r.floating.width+f}px`,S=u?g:`${M}px`),{data:{x:_,y:S}}}}),"transformOrigin");function YA(e){const[t,a="center"]=e.split("-");return[t,a]}_o(YA,"getSideAndAlignFromPlacement");var i2=jCe,c2=PCe,XA=DCe,HCe=qCe,VCe=Object.defineProperty,QT=(e,t)=>VCe(e,"name",{value:t,configurable:!0}),tR=!1;function SG(){const[e,t]=k.useState(tR);return k.useEffect(()=>{tR||(tR=!0,t(!0))},[]),e}QT(SG,"useIsHydrated");var CG=ad[" useSyncExternalStore ".trim().toString()];function LG(){return()=>{}}QT(LG,"subscribe");function NG(){return CG(LG,()=>!0,()=>!1)}QT(NG,"useIsHydratedModern");var BCe=typeof CG=="function"?NG:SG,FCe=Object.defineProperty,Bl=(e,t)=>FCe(e,"name",{value:t,configurable:!0}),nR="rovingFocusGroup.onEntryFocus",UCe={bubbles:!1,cancelable:!0},WA="RovingFocusGroup",[OR,IG,GCe]=cd(WA),[ZCe,dd]=qt(WA,[GCe]),[YCe,XCe]=ZCe(WA),WCe=k.forwardRef(Bl(function(t,a){return m.jsx(OR.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(OR.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(KCe,{...t,ref:a})})})},"RovingFocusGroup")),KCe=k.forwardRef(Bl(function(t,a){const{__scopeRovingFocusGroup:r,orientation:c,loop:d=!1,dir:u,currentTabStopId:h,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:y,onEntryFocus:x,preventScrollOnEntryFocus:g=!1,...b}=t,M=k.useRef(null),_=Ee(a,M),S=Vl(u),[C,L]=Ut({prop:h,defaultProp:f??null,onChange:y,caller:WA}),[A,j]=k.useState(!1),E=yn(x),z=IG(r),R=k.useRef(!1),[$,H]=k.useState(0);return k.useEffect(()=>{const K=M.current;if(K)return K.addEventListener(nR,E),()=>K.removeEventListener(nR,E)},[E]),m.jsx(YCe,{scope:r,orientation:c,dir:S,loop:d,currentTabStopId:C,onItemFocus:k.useCallback(K=>L(K),[L]),onItemShiftTab:k.useCallback(()=>j(!0),[]),onFocusableItemAdd:k.useCallback(()=>H(K=>K+1),[]),onFocusableItemRemove:k.useCallback(()=>H(K=>K-1),[]),children:m.jsx(ge.div,{tabIndex:A||$===0?-1:0,"data-orientation":c,...b,ref:_,style:{outline:"none",...t.style},onMouseDown:fe(t.onMouseDown,()=>{R.current=!0}),onFocus:fe(t.onFocus,K=>{const ae=!R.current;if(K.target===K.currentTarget&&ae&&!A){const Y=new CustomEvent(nR,UCe);if(K.currentTarget.dispatchEvent(Y),!Y.defaultPrevented){const G=z().filter(P=>P.focusable),J=G.find(P=>P.active),oe=G.find(P=>P.id===C),N=[J,oe,...G].filter(Boolean).map(P=>P.ref.current);JT(N,g)}}R.current=!1}),onBlur:fe(t.onBlur,()=>j(!1))})})},"RovingFocusGroupImpl")),QCe="RovingFocusGroupItem",JCe=k.forwardRef(Bl(function(t,a){const{__scopeRovingFocusGroup:r,focusable:c=!0,active:d=!1,tabStopId:u,children:h,...f}=t,y=kt(),x=u||y,g=XCe(QCe,r),b=g.currentTabStopId===x,M=IG(r),{onFocusableItemAdd:_,onFocusableItemRemove:S,currentTabStopId:C}=g,L=BCe();return mt(()=>{if(!(!L||!c))return _(),()=>S()},[L,c,_,S]),k.useEffect(()=>{if(!(L||!c))return _(),()=>S()},[L,c,_,S]),m.jsx(OR.ItemSlot,{scope:r,id:x,focusable:c,active:d,children:m.jsx(ge.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:fe(t.onMouseDown,A=>{c?g.onItemFocus(x):A.preventDefault()}),onFocus:fe(t.onFocus,()=>g.onItemFocus(x)),onKeyDown:fe(t.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){g.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const j=jG(A,g.orientation,g.dir);if(j!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let z=M().filter(R=>R.focusable).map(R=>R.ref.current);if(j==="last")z.reverse();else if(j==="prev"||j==="next"){j==="prev"&&z.reverse();const R=z.indexOf(A.currentTarget);z=g.loop?EG(z,R+1):z.slice(R+1)}setTimeout(()=>JT(z))}}),children:typeof h=="function"?h({isCurrentTabStop:b,hasTabStop:C!=null}):h})})},"RovingFocusGroupItem")),eLe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function AG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Bl(AG,"getDirectionAwareKey");function jG(e,t,a){const r=AG(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eLe[r]}Bl(jG,"getFocusIntent");function JT(e,t=!1){const a=document.activeElement;for(const r of e)if(r===a||(r.focus({preventScroll:t}),document.activeElement!==a))return}Bl(JT,"focusFirst");function EG(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Bl(EG,"wrapArray");var eD=WCe,tD=JCe,tLe=Object.defineProperty,Xe=(e,t)=>tLe(e,"name",{value:t,configurable:!0}),HR=["Enter"," "],nLe=["ArrowDown","PageUp","Home"],PG=["ArrowUp","PageDown","End"],aLe=[...nLe,...PG],oLe={ltr:[...HR,"ArrowRight"],rtl:[...HR,"ArrowLeft"]},rLe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},KA="Menu",[Hu,iLe,cLe]=cd(KA),[Fl,s2]=qt(KA,[cLe,Sr,dd]),QA=Sr(),RG=dd(),[TG,Cr]=Fl(KA),[sLe,l2]=Fl(KA),lLe=Xe(e=>{const{__scopeMenu:t,open:a=!1,children:r,dir:c,onOpenChange:d,modal:u=!0}=e,h=QA(t),[f,y]=k.useState(null),x=k.useRef(!1),g=yn(d),b=Vl(c);return k.useEffect(()=>{const M=Xe(()=>{x.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=Xe(()=>x.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})}},[]),k.useEffect(()=>{if(!a)return;const M=Xe(()=>g(!1),"handleBlur");return window.addEventListener("blur",M),()=>window.removeEventListener("blur",M)},[a,g]),m.jsx(i2,{...h,children:m.jsx(TG,{scope:t,open:a,onOpenChange:g,content:f,onContentChange:y,children:m.jsx(sLe,{scope:t,onClose:k.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:x,dir:b,modal:u,children:r})})})},"Menu"),DG=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t,d=QA(r);return m.jsx(c2,{...d,...c,ref:a})},"MenuAnchor")),zG="MenuPortal",[dLe,$G]=Fl(zG,{forceMount:void 0}),uLe=Xe(e=>{const{__scopeMenu:t,forceMount:a,children:r,container:c}=e,d=Cr(zG,t);return m.jsx(dLe,{scope:t,forceMount:a,children:m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:r})})})},"MenuPortal"),ba="MenuContent",[hLe,nD]=Fl(ba),pLe=k.forwardRef(Xe(function(t,a){const r=$G(ba,t.__scopeMenu),{forceMount:c=r.forceMount,...d}=t,u=Cr(ba,t.__scopeMenu),h=l2(ba,t.__scopeMenu);return m.jsx(Hu.Provider,{scope:t.__scopeMenu,children:m.jsx(kn,{present:c||u.open,children:m.jsx(Hu.Slot,{scope:t.__scopeMenu,children:h.modal?m.jsx(fLe,{...d,ref:a}):m.jsx(yLe,{...d,ref:a})})})})},"MenuContent")),fLe=k.forwardRef(Xe(function(t,a){const r=Cr(ba,t.__scopeMenu),c=k.useRef(null),d=Ee(a,c);return k.useEffect(()=>{const u=c.current;if(u)return TA(u)},[]),m.jsx(aD,{...t,ref:d,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:fe(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),yLe=k.forwardRef(Xe(function(t,a){const r=Cr(ba,t.__scopeMenu);return m.jsx(aD,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),mLe=Ma("MenuContent.ScrollLock"),aD=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,loop:c=!1,trapFocus:d,onOpenAutoFocus:u,onCloseAutoFocus:h,disableOutsidePointerEvents:f,onEntryFocus:y,onEscapeKeyDown:x,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:M,onDismiss:_,disableOutsideScroll:S,...C}=t,L=Cr(ba,r),A=l2(ba,r),j=QA(r),E=RG(r),z=iLe(r),[R,$]=k.useState(null),H=k.useRef(null),K=Ee(a,H,L.onContentChange),ae=k.useRef(0),Y=k.useRef(""),G=k.useRef(0),J=k.useRef(null),oe=k.useRef("right"),he=k.useRef(0),N=S?o2:k.Fragment,P=S?{as:mLe,allowPinchZoom:!0}:void 0,O=Xe(B=>{const D=Y.current+B,T=z().filter(ie=>!ie.disabled),U=document.activeElement,X=T.find(ie=>ie.ref.current===U)?.textValue,Z=T.map(ie=>ie.textValue),ce=ZG(Z,D,X),pe=T.find(ie=>ie.textValue===ce)?.ref.current;Xe((function ie(se){Y.current=se,window.clearTimeout(ae.current),se!==""&&(ae.current=window.setTimeout(()=>ie(""),1e3))}),"updateSearch")(D),pe&&setTimeout(()=>pe.focus())},"handleTypeaheadSearch");k.useEffect(()=>()=>window.clearTimeout(ae.current),[]),id();const te=k.useCallback(B=>oe.current===J.current?.side&&XG(B,J.current?.area),[]);return m.jsx(hLe,{scope:r,searchRef:Y,onItemEnter:k.useCallback(B=>{te(B)&&B.preventDefault()},[te]),onItemLeave:k.useCallback(B=>{te(B)||(H.current?.focus(),$(null))},[te]),onTriggerLeave:k.useCallback(B=>{te(B)&&B.preventDefault()},[te]),pointerGraceTimerRef:G,onPointerGraceIntentChange:k.useCallback(B=>{J.current=B},[]),children:m.jsx(N,{...P,children:m.jsx(PA,{asChild:!0,trapped:d,onMountAutoFocus:fe(u,B=>{B.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:x,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:M,onDismiss:_,children:m.jsx(eD,{asChild:!0,...E,dir:A.dir,orientation:"vertical",loop:c,currentTabStopId:R,onCurrentTabStopIdChange:$,onEntryFocus:fe(y,B=>{A.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(XA,{role:"menu","aria-orientation":"vertical","data-state":rD(L.open),"data-radix-menu-content":"",dir:A.dir,...j,...C,ref:K,style:{outline:"none",...C.style},onKeyDown:fe(C.onKeyDown,B=>{const T=B.target.closest("[data-radix-menu-content]")===B.currentTarget,U=B.ctrlKey||B.altKey||B.metaKey,X=B.key.length===1;T&&(B.key==="Tab"&&B.preventDefault(),!U&&X&&O(B.key));const Z=H.current;if(B.target!==Z||!aLe.includes(B.key))return;B.preventDefault();const pe=z().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);PG.includes(B.key)&&pe.reverse(),UG(pe)}),onBlur:fe(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(ae.current),Y.current="")}),onPointerMove:fe(t.onPointerMove,ed(B=>{const D=B.target,T=he.current!==B.clientX;if(B.currentTarget.contains(D)&&T){const U=B.clientX>he.current?"right":"left";oe.current=U,he.current=B.clientX}}))})})})})})})},"MenuContentImpl")),qG=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return m.jsx(ge.div,{role:"group",...c,ref:a})},"MenuGroup")),kLe=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return m.jsx(ge.div,{...c,ref:a})},"MenuLabel")),VR="MenuItem",_V="menu.itemSelect",oD=k.forwardRef(Xe(function(t,a){const{disabled:r=!1,onSelect:c,...d}=t,u=k.useRef(null),h=l2(VR,t.__scopeMenu),f=nD(VR,t.__scopeMenu),y=Ee(a,u),x=k.useRef(!1),g=Xe(()=>{const b=u.current;if(!r&&b){const M=new CustomEvent(_V,{bubbles:!0,cancelable:!0});b.addEventListener(_V,_=>c?.(_),{once:!0}),yT(b,M),M.defaultPrevented?x.current=!1:h.onClose()}},"handleSelect");return m.jsx(OG,{...d,ref:y,disabled:r,onClick:fe(t.onClick,g),onPointerDown:b=>{t.onPointerDown?.(b),x.current=!0},onPointerUp:fe(t.onPointerUp,b=>{x.current||b.currentTarget?.click()}),onKeyDown:fe(t.onKeyDown,b=>{r||b.target!==b.currentTarget||f.searchRef.current!==""&&b.key===" "||HR.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),OG=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,disabled:c=!1,textValue:d,...u}=t,h=nD(VR,r),f=RG(r),y=k.useRef(null),x=Ee(a,y),[g,b]=k.useState(!1),[M,_]=k.useState("");return k.useEffect(()=>{const S=y.current;S&&_((S.textContent??"").trim())},[u.children]),m.jsx(Hu.ItemSlot,{scope:r,disabled:c,textValue:d??M,children:m.jsx(tD,{asChild:!0,...f,focusable:!c,children:m.jsx(ge.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:x,onPointerMove:fe(t.onPointerMove,ed(S=>{c?h.onItemLeave(S):(h.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fe(t.onPointerLeave,ed(S=>h.onItemLeave(S))),onFocus:fe(t.onFocus,()=>b(!0)),onBlur:fe(t.onBlur,()=>b(!1))})})})},"MenuItemImpl")),gLe=k.forwardRef(Xe(function(t,a){const{checked:r=!1,onCheckedChange:c,...d}=t;return m.jsx(VG,{scope:t.__scopeMenu,checked:r,children:m.jsx(oD,{role:"menuitemcheckbox","aria-checked":Vu(r)?"mixed":r,...d,ref:a,"data-state":JA(r),onSelect:fe(d.onSelect,()=>c?.(Vu(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),vLe="MenuRadioGroup",[xLe,bLe]=Fl(vLe,{value:void 0,onValueChange:Xe(()=>{},"onValueChange")}),MLe=k.forwardRef(Xe(function(t,a){const{value:r,onValueChange:c,...d}=t,u=yn(c);return m.jsx(xLe,{scope:t.__scopeMenu,value:r,onValueChange:u,children:m.jsx(qG,{...d,ref:a})})},"MenuRadioGroup")),wLe="MenuRadioItem",_Le=k.forwardRef(Xe(function(t,a){const{value:r,...c}=t,d=bLe(wLe,t.__scopeMenu),u=r===d.value;return m.jsx(VG,{scope:t.__scopeMenu,checked:u,children:m.jsx(oD,{role:"menuitemradio","aria-checked":u,...c,ref:a,"data-state":JA(u),onSelect:fe(c.onSelect,()=>d.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),HG="MenuItemIndicator",[VG,SLe]=Fl(HG,{checked:!1}),CLe=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,forceMount:c,...d}=t,u=SLe(HG,r);return m.jsx(kn,{present:c||Vu(u.checked)||u.checked===!0,children:m.jsx(ge.span,{...d,ref:a,"data-state":JA(u.checked)})})},"MenuItemIndicator")),LLe=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return m.jsx(ge.div,{role:"separator","aria-orientation":"horizontal",...c,ref:a})},"MenuSeparator")),BG="MenuSub",[NLe,FG]=Fl(BG),ILe=Xe(e=>{const{__scopeMenu:t,children:a,open:r=!1,onOpenChange:c}=e,d=Cr(BG,t),u=QA(t),[h,f]=k.useState(null),[y,x]=k.useState(null),g=yn(c);return k.useEffect(()=>(d.open===!1&&g(!1),()=>g(!1)),[d.open,g]),m.jsx(i2,{...u,children:m.jsx(TG,{scope:t,open:r,onOpenChange:g,content:y,onContentChange:x,children:m.jsx(NLe,{scope:t,contentId:kt(),triggerId:kt(),trigger:h,onTriggerChange:f,children:a})})})},"MenuSub"),V0="MenuSubTrigger",ALe=k.forwardRef(Xe(function(t,a){const r=Cr(V0,t.__scopeMenu),c=l2(V0,t.__scopeMenu),d=FG(V0,t.__scopeMenu),u=nD(V0,t.__scopeMenu),h=k.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:y}=u,x={__scopeMenu:t.__scopeMenu},g=k.useCallback(()=>{h.current&&window.clearTimeout(h.current),h.current=null},[]);k.useEffect(()=>g,[g]),k.useEffect(()=>{const M=f.current;return()=>{window.clearTimeout(M),y(null)}},[f,y]);const b=Ee(a,d.onTriggerChange);return m.jsx(DG,{asChild:!0,...x,children:m.jsx(OG,{id:d.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?d.contentId:void 0,"data-state":rD(r.open),...t,ref:b,onClick:M=>{t.onClick?.(M),!(t.disabled||M.defaultPrevented)&&(M.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:fe(t.onPointerMove,ed(M=>{u.onItemEnter(M),!M.defaultPrevented&&!t.disabled&&!r.open&&!h.current&&(u.onPointerGraceIntentChange(null),h.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:fe(t.onPointerLeave,ed(M=>{g();const _=r.content?.getBoundingClientRect();if(_){const S=r.content?.dataset.side,C=S==="right",L=C?-5:5,A=_[C?"left":"right"],j=_[C?"right":"left"];u.onPointerGraceIntentChange({area:[{x:M.clientX+L,y:M.clientY},{x:A,y:_.top},{x:j,y:_.top},{x:j,y:_.bottom},{x:A,y:_.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(M),M.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:fe(t.onKeyDown,M=>{t.disabled||M.target!==M.currentTarget||u.searchRef.current!==""&&M.key===" "||oLe[c.dir].includes(M.key)&&(r.onOpenChange(!0),r.content?.focus(),M.preventDefault())})})})},"MenuSubTrigger")),jLe="MenuSubContent",ELe=k.forwardRef(Xe(function(t,a){const r=$G(ba,t.__scopeMenu),{forceMount:c=r.forceMount,align:d="start",...u}=t,h=Cr(ba,t.__scopeMenu),f=l2(ba,t.__scopeMenu),y=FG(jLe,t.__scopeMenu),x=k.useRef(null),g=Ee(a,x);return m.jsx(Hu.Provider,{scope:t.__scopeMenu,children:m.jsx(kn,{present:c||h.open,children:m.jsx(Hu.Slot,{scope:t.__scopeMenu,children:m.jsx(aD,{id:y.contentId,"aria-labelledby":y.triggerId,...u,ref:g,align:d,side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:b=>{f.isUsingKeyboardRef.current&&x.current?.focus(),b.preventDefault()},onCloseAutoFocus:b=>b.preventDefault(),onFocusOutside:fe(t.onFocusOutside,b=>{b.target!==y.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:fe(t.onEscapeKeyDown,b=>{f.onClose(),b.preventDefault()}),onKeyDown:fe(t.onKeyDown,b=>{const M=b.currentTarget.contains(b.target),_=rLe[f.dir].includes(b.key);M&&_&&(h.onOpenChange(!1),y.trigger?.focus(),b.preventDefault())})})})})})},"MenuSubContent"));function rD(e){return e?"open":"closed"}Xe(rD,"getOpenState");function Vu(e){return e==="indeterminate"}Xe(Vu,"isIndeterminate");function JA(e){return Vu(e)?"indeterminate":e?"checked":"unchecked"}Xe(JA,"getCheckedState");function UG(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}Xe(UG,"focusFirst");function GG(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Xe(GG,"wrapArray");function ZG(e,t,a){const c=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,d=a?e.indexOf(a):-1;let u=GG(e,Math.max(d,0));c.length===1&&(u=u.filter(y=>y!==a));const f=u.find(y=>y.toLowerCase().startsWith(c.toLowerCase()));return f!==a?f:void 0}Xe(ZG,"getNextMatch");function YG(e,t){const{x:a,y:r}=e;let c=!1;for(let d=0,u=t.length-1;d<t.length;u=d++){const h=t[d],f=t[u],y=h.x,x=h.y,g=f.x,b=f.y;x>r!=b>r&&a<(g-y)*(r-x)/(b-x)+y&&(c=!c)}return c}Xe(YG,"isPointInPolygon");function XG(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return YG(a,t)}Xe(XG,"isPointerInGraceArea");function ed(e){return t=>t.pointerType==="mouse"?e(t):void 0}Xe(ed,"whenMouse");var iD=lLe,cD=DG,sD=uLe,lD=pLe,dD=qG,uD=kLe,hD=oD,pD=gLe,fD=MLe,yD=_Le,mD=CLe,kD=LLe,gD=ILe,vD=ALe,xD=ELe,PLe=Object.defineProperty,Ft=(e,t)=>PLe(e,"name",{value:t,configurable:!0}),bD="ContextMenu",[RLe,TTe]=qt(bD,[s2]),gn=s2(),[TLe,WG]=RLe(bD),DLe=Ft(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,dir:d,modal:u=!0}=e,h=k.useRef(!1),[f,y]=Ut({prop:c,defaultProp:!1,onChange:r,caller:bD}),x=gn(t);return m.jsx(TLe,{scope:t,open:f,onOpenChange:y,modal:u,hasInteractedRef:h,children:m.jsx(iD,{...x,dir:d,open:f,onOpenChange:y,modal:u,children:a})})},"ContextMenu"),zLe="ContextMenuTrigger",$Le=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,disabled:c=!1,...d}=t,u=WG(zLe,r),h=gn(r),[f,y]=k.useState({x:0,y:0}),x=k.useMemo(()=>({current:{getBoundingClientRect:Ft(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),g=k.useRef(0),b=k.useCallback(()=>window.clearTimeout(g.current),[]),M=Ft(_=>{u.hasInteractedRef.current=!0,y({x:_.clientX,y:_.clientY}),u.onOpenChange(!0)},"handleOpen");return k.useEffect(()=>b,[b]),k.useEffect(()=>{c&&b()},[c,b]),m.jsxs(m.Fragment,{children:[m.jsx(cD,{...h,virtualRef:x}),m.jsx(ge.span,{"data-state":u.open?"open":"closed","data-disabled":c?"":void 0,...d,ref:a,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:c?t.onContextMenu:fe(t.onContextMenu,_=>{b(),M(_),_.preventDefault()}),onPointerDown:c?t.onPointerDown:fe(t.onPointerDown,mu(_=>{b(),u.open&&u.onOpenChange(!1),g.current=window.setTimeout(()=>M(_),700)})),onPointerMove:c?t.onPointerMove:fe(t.onPointerMove,mu(b)),onPointerCancel:c?t.onPointerCancel:fe(t.onPointerCancel,mu(b)),onPointerUp:c?t.onPointerUp:fe(t.onPointerUp,mu(b))})]})},"ContextMenuTrigger")),qLe=Ft(e=>{const{__scopeContextMenu:t,...a}=e,r=gn(t);return m.jsx(sD,{...r,...a})},"ContextMenuPortal"),OLe="ContextMenuContent",HLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=WG(OLe,r),u=gn(r),h=k.useRef(!1);return m.jsx(lD,{...u,...c,ref:a,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{t.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{t.onInteractOutside?.(f),!f.defaultPrevented&&!d.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")),VLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(dD,{...d,...c,ref:a})},"ContextMenuGroup")),BLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(uD,{...d,...c,ref:a})},"ContextMenuLabel")),FLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(hD,{...d,...c,ref:a})},"ContextMenuItem")),ULe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(pD,{...d,...c,ref:a})},"ContextMenuCheckboxItem")),GLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(fD,{...d,...c,ref:a})},"ContextMenuRadioGroup")),ZLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(yD,{...d,...c,ref:a})},"ContextMenuRadioItem")),YLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(mD,{...d,...c,ref:a})},"ContextMenuItemIndicator")),XLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(kD,{...d,...c,ref:a})},"ContextMenuSeparator")),WLe="ContextMenuSub",KLe=Ft(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,defaultOpen:d}=e,u=gn(t),[h,f]=Ut({prop:c,defaultProp:d??!1,onChange:r,caller:WLe});return m.jsx(gD,{...u,open:h,onOpenChange:f,children:a})},"ContextMenuSub"),QLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(vD,{...d,...c,ref:a})},"ContextMenuSubTrigger")),JLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(xD,{...d,...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 mu(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Ft(mu,"whenTouchOrPen");var eNe=DLe,tNe=$Le,KG=qLe,nNe=HLe,aNe=VLe,oNe=BLe,rNe=FLe,iNe=ULe,cNe=GLe,sNe=ZLe,QG=YLe,lNe=XLe,dNe=KLe,uNe=QLe,hNe=JLe;function pNe({...e}){return m.jsx(eNe,{"data-slot":"context-menu",...e})}function fNe({...e}){return m.jsx(tNe,{"data-slot":"context-menu-trigger",...e})}function yNe({...e}){return m.jsx(aNe,{"data-slot":"context-menu-group",...e})}function mNe({...e}){return m.jsx(KG,{"data-slot":"context-menu-portal",...e})}function kNe({...e}){return m.jsx(dNe,{"data-slot":"context-menu-sub",...e})}function gNe({...e}){return m.jsx(cNe,{"data-slot":"context-menu-radio-group",...e})}function vNe({className:e,inset:t,children:a,...r}){return m.jsxs(uNe,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:W("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,m.jsx(Ua,{className:"ml-auto"})]})}function xNe({className:e,...t}){return m.jsx(hNe,{"data-slot":"context-menu-sub-content",className:W("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 bNe({className:e,...t}){return m.jsx(KG,{children:m.jsx(nNe,{"data-slot":"context-menu-content",className:W("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 MNe({className:e,inset:t,variant:a="default",...r}){return m.jsx(rNe,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:W("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 wNe({className:e,children:t,checked:a,...r}){return m.jsxs(iNe,{"data-slot":"context-menu-checkbox-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(QG,{children:m.jsx(Fa,{className:"size-4"})})}),t]})}function _Ne({className:e,children:t,...a}){return m.jsxs(sNe,{"data-slot":"context-menu-radio-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(QG,{children:m.jsx(Nl,{className:"size-2 fill-current"})})}),t]})}function SNe({className:e,inset:t,...a}){return m.jsx(oNe,{"data-slot":"context-menu-label","data-inset":t,className:W("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function CNe({className:e,...t}){return m.jsx(lNe,{"data-slot":"context-menu-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function LNe({className:e,...t}){return m.jsx("span",{"data-slot":"context-menu-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const xr=k.createContext({activeIndex:0,setActiveIndex:()=>{},totalDialogs:0,setTotalDialogs:()=>{},isOpen:!1,setIsOpen:()=>{},clickable:!1,shouldAnimate:!1,setShouldAnimate:()=>{},closeDialog:()=>{}}),ej=k.forwardRef(({children:e,className:t,open:a=!1,onOpenChange:r,clickable:c=!1,...d},u)=>{const[h,f]=k.useState(0),[y,x]=k.useState(a),[g,b]=k.useState(!1),[M,_]=k.useState(0),S=C=>{C===h&&(h>0?f(L=>L-1):x(!1))};return k.useImperativeHandle(u,()=>({open:()=>{x(!0)},close:()=>{x(!1),f(0)},closeAll:()=>{x(!1),f(0)},next:()=>{f(C=>C+1)},prev:()=>{f(C=>C>0?C-1:0)},goTo:C=>{C>=0&&C<M&&f(C)},closeCurrent:()=>S(h),isOpen:y,activeIndex:h,totalDialogs:M}),[h,M,y]),k.useEffect(()=>{const C=document.documentElement;return y?(C.style.overflow="hidden",b(!0)):C.style.overflow="",r?.(y),()=>{C.style.overflow=""}},[y,r]),m.jsx(xr.Provider,{value:{activeIndex:h,setActiveIndex:f,totalDialogs:M,setTotalDialogs:_,isOpen:y,setIsOpen:x,clickable:c,shouldAnimate:g,setShouldAnimate:b,closeDialog:S},children:m.jsx("div",{className:t,...d,children:e})})});ej.displayName="DialogStack";const NNe=({children:e,className:t,onClick:a,asChild:r,...c})=>{const d=k.useContext(xr);if(!d)throw new Error("DialogStackTrigger must be used within a DialogStack");const u=h=>{d.setIsOpen(!0),a?.(h)};return r&&k.isValidElement(e)?k.cloneElement(e,{onClick:u,className:W(t,e.props.className),...c}):m.jsx("button",{onClick:u,className:W("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})},MD=({className:e,...t})=>{const a=k.useContext(xr);if(!a)throw new Error("DialogStackOverlay must be used within a DialogStack");return a.isOpen?m.jsx("div",{className:W("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},wD=({children:e,className:t,...a})=>{const r=k.useContext(xr),c=k.Children.count(e),[d,u]=k.useState(c);if(k.useEffect(()=>{u(c)},[c]),!r)throw new Error("DialogStackBody must be used within a DialogStack");return r.isOpen?m.jsx(xr.Provider,{value:{...r,totalDialogs:d,setTotalDialogs:u},children:m.jsx(SU,{children:m.jsx("div",{className:W("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:k.Children.map(e,(h,f)=>k.isValidElement(h)?k.cloneElement(h,{index:f}):h)})})}):null},_D=({children:e,className:t,index:a=0,offset:r=20,...c})=>{const d=k.useContext(xr),[u,h]=k.useState(!1),f=k.useRef(null),y=k.useRef(!1);if(!d)throw new Error("DialogStackContent must be used within a DialogStack");if(!d.isOpen)return null;const x=()=>{d.setIsOpen(!1),d.setActiveIndex(0)},g=()=>{if(y.current){y.current=!1;return}d.closeDialog(a)},b=()=>{y.current=!1,h(!0),f.current=setTimeout(()=>{y.current=!0,h(!1),x()},600)},M=()=>{f.current&&(clearTimeout(f.current),f.current=null),h(!1)},_=A=>{A.stopPropagation(),d.clickable&&d.activeIndex>a&&d.setActiveIndex(a??0)},S=a-d.activeIndex,C=S<0?`-${Math.abs(S)*r}px`:"0",L=a===0&&d.activeIndex===0&&d.shouldAnimate;return k.useEffect(()=>{if(L){const A=setTimeout(()=>{d.setShouldAnimate(!1)},200);return()=>clearTimeout(A)}},[L]),m.jsxs("div",{onClick:_,className:W("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",S<0&&"brightness-75 blur-[2px]",t),style:{top:0,marginLeft:`${C}`,marginTop:`${window.innerWidth>768?Math.abs(S)*10:0}px`,width:S<0?`calc(100% + ${Math.abs(S)*r}px)`:"100%",zIndex:S<0?50-Math.abs(d.activeIndex-(a??0)):1002,position:S?"absolute":"relative",opacity:S>0?0:1,pointerEvents:S>0?"none":"auto",cursor:d.clickable&&d.activeIndex>a?"pointer":"default"},...c,children:[m.jsx("div",{className:W("h-full w-full overflow-y-auto p-6 transition-all duration-200",d.activeIndex!==a&&"pointer-events-none select-none"),children:e}),d.activeIndex===a&&m.jsx(SU,{children:m.jsx(tn,{variant:"ghost",className:W("fixed z-[1100] top-4 right-4 p-1 size-8 transition-all",u&&"bg-destructive/20 scale-110"),onClick:g,onPointerDown:b,onPointerUp:M,onPointerLeave:M,onPointerCancel:M,"aria-label":"Close",title:d.totalDialogs>1?"Click to close, hold to close all":"Close",children:m.jsx(yr,{})})})]})},INe=({children:e,className:t,...a})=>m.jsx("h2",{className:W("font-semibold text-lg leading-none tracking-tight",t),...a,children:e}),ANe=({children:e,className:t,...a})=>m.jsx("p",{className:W("text-muted-foreground text-sm",t),...a,children:e}),jNe=({className:e,...t})=>m.jsx("div",{className:W("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),ENe=({children:e,className:t,...a})=>m.jsx("div",{className:W("flex items-center justify-end space-x-2 pt-4",t),...a,children:e}),PNe=({children:e,className:t,asChild:a,...r})=>{const c=k.useContext(xr);if(!c)throw new Error("DialogStackNext must be used within a DialogStack");const d=()=>{c.activeIndex<c.totalDialogs-1&&c.setActiveIndex(c.activeIndex+1)};return a&&k.isValidElement(e)?k.cloneElement(e,{onClick:d,className:W(t,e.props.className),...r}):m.jsx("button",{type:"button",onClick:d,className:W("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"})},RNe=({children:e,className:t,asChild:a,...r})=>{const c=k.useContext(xr);if(!c)throw new Error("DialogStackPrevious must be used within a DialogStack");const d=()=>{c.activeIndex>0&&c.setActiveIndex(c.activeIndex-1)};return a&&k.isValidElement(e)?k.cloneElement(e,{onClick:d,className:W(t,e.props.className),...r}):m.jsx("button",{type:"button",onClick:d,className:W("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 TNe=Object.defineProperty,vn=(e,t)=>TNe(e,"name",{value:t,configurable:!0}),SD="DropdownMenu",[DNe,DTe]=qt(SD,[s2]),xn=s2(),[zNe,JG]=DNe(SD),$Ne=vn(e=>{const{__scopeDropdownMenu:t,children:a,dir:r,open:c,defaultOpen:d,onOpenChange:u,modal:h=!0}=e,f=xn(t),y=k.useRef(null),[x,g]=Ut({prop:c,defaultProp:d??!1,onChange:u,caller:SD});return m.jsx(zNe,{scope:t,triggerId:kt(),triggerRef:y,contentId:kt(),open:x,onOpenChange:g,onOpenToggle:k.useCallback(()=>g(b=>!b),[g]),modal:h,children:m.jsx(iD,{...f,open:x,onOpenChange:g,dir:r,modal:h,children:a})})},"DropdownMenu"),qNe="DropdownMenuTrigger",ONe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,disabled:c=!1,...d}=t,u=JG(qNe,r),h=xn(r),f=Ee(a,u.triggerRef);return m.jsx(cD,{asChild:!0,...h,children:m.jsx(ge.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,...d,ref:f,onPointerDown:fe(t.onPointerDown,y=>{!c&&y.button===0&&y.ctrlKey===!1&&(u.onOpenToggle(),u.open||y.preventDefault())}),onKeyDown:fe(t.onKeyDown,y=>{c||(["Enter"," "].includes(y.key)&&u.onOpenToggle(),y.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(y.key)&&y.preventDefault())})})})},"DropdownMenuTrigger")),HNe=vn(e=>{const{__scopeDropdownMenu:t,...a}=e,r=xn(t);return m.jsx(sD,{...r,...a})},"DropdownMenuPortal"),VNe="DropdownMenuContent",BNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=JG(VNe,r),u=xn(r),h=k.useRef(!1);return m.jsx(lD,{id:d.contentId,"aria-labelledby":d.triggerId,...u,...c,ref:a,onCloseAutoFocus:fe(t.onCloseAutoFocus,f=>{h.current||d.triggerRef.current?.focus(),h.current=!1,f.preventDefault()}),onInteractOutside:fe(t.onInteractOutside,f=>{const y=f.detail.originalEvent,x=y.button===0&&y.ctrlKey===!0,g=y.button===2||x;(!d.modal||g)&&(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")),FNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(dD,{...d,...c,ref:a})},"DropdownMenuGroup")),UNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(uD,{...d,...c,ref:a})},"DropdownMenuLabel")),GNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(hD,{...d,...c,ref:a})},"DropdownMenuItem")),ZNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(pD,{...d,...c,ref:a})},"DropdownMenuCheckboxItem")),YNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(fD,{...d,...c,ref:a})},"DropdownMenuRadioGroup")),XNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(yD,{...d,...c,ref:a})},"DropdownMenuRadioItem")),WNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(mD,{...d,...c,ref:a})},"DropdownMenuItemIndicator")),KNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(kD,{...d,...c,ref:a})},"DropdownMenuSeparator")),QNe=vn(e=>{const{__scopeDropdownMenu:t,children:a,open:r,onOpenChange:c,defaultOpen:d}=e,u=xn(t),[h,f]=Ut({prop:r,defaultProp:d??!1,onChange:c,caller:"DropdownMenuSub"});return m.jsx(gD,{...u,open:h,onOpenChange:f,children:a})},"DropdownMenuSub"),JNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(vD,{...d,...c,ref:a})},"DropdownMenuSubTrigger")),eIe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(xD,{...d,...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")),tIe=$Ne,nIe=ONe,eZ=HNe,aIe=BNe,oIe=FNe,rIe=UNe,iIe=GNe,cIe=ZNe,sIe=YNe,lIe=XNe,tZ=WNe,dIe=KNe,uIe=QNe,hIe=JNe,pIe=eIe;function fIe({...e}){return m.jsx(tIe,{"data-slot":"dropdown-menu",...e})}function yIe({...e}){return m.jsx(eZ,{"data-slot":"dropdown-menu-portal",...e})}function mIe({...e}){return m.jsx(nIe,{"data-slot":"dropdown-menu-trigger",...e})}function kIe({className:e,sideOffset:t=4,...a}){return m.jsx(eZ,{children:m.jsx(aIe,{"data-slot":"dropdown-menu-content",sideOffset:t,className:W("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 gIe({...e}){return m.jsx(oIe,{"data-slot":"dropdown-menu-group",...e})}function vIe({className:e,inset:t,variant:a="default",...r}){return m.jsx(iIe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:W("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 xIe({className:e,children:t,checked:a,...r}){return m.jsxs(cIe,{"data-slot":"dropdown-menu-checkbox-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(tZ,{children:m.jsx(Fa,{className:"size-4"})})}),t]})}function bIe({...e}){return m.jsx(sIe,{"data-slot":"dropdown-menu-radio-group",...e})}function MIe({className:e,children:t,...a}){return m.jsxs(lIe,{"data-slot":"dropdown-menu-radio-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(tZ,{children:m.jsx(Nl,{className:"size-2 fill-current"})})}),t]})}function wIe({className:e,inset:t,...a}){return m.jsx(rIe,{"data-slot":"dropdown-menu-label","data-inset":t,className:W("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function _Ie({className:e,...t}){return m.jsx(dIe,{"data-slot":"dropdown-menu-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function SIe({className:e,...t}){return m.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function CIe({...e}){return m.jsx(uIe,{"data-slot":"dropdown-menu-sub",...e})}function LIe({className:e,inset:t,children:a,...r}){return m.jsxs(hIe,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:W("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,m.jsx(Ua,{className:"ml-auto size-4"})]})}function NIe({className:e,...t}){return m.jsx(pIe,{"data-slot":"dropdown-menu-sub-content",className:W("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 CD({className:e,type:t,...a}){return m.jsx("input",{type:t,"data-slot":"input",className:W("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 IIe=Object.defineProperty,AIe=(e,t)=>IIe(e,"name",{value:t,configurable:!0}),jIe=k.forwardRef(AIe(function(t,a){return m.jsx(ge.label,{...t,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),EIe=jIe;function _A({className:e,...t}){return m.jsx(EIe,{"data-slot":"label",className:W("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 PIe=Object.defineProperty,Kt=(e,t)=>PIe(e,"name",{value:t,configurable:!0}),tj="Menubar",[BR,RIe,TIe]=cd(tj),[nZ,zTe]=qt(tj,[TIe,dd]),bn=s2(),aZ=dd(),[DIe,LD]=nZ(tj),zIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,value:c,onValueChange:d,defaultValue:u,loop:h=!0,dir:f,...y}=t,x=Vl(f),g=aZ(r),[b,M]=Ut({prop:c,onChange:d,defaultProp:u??"",caller:tj}),[_,S]=k.useState(null);return m.jsx(DIe,{scope:r,value:b,onMenuOpen:k.useCallback(C=>{M(C),S(C)},[M]),onMenuClose:k.useCallback(()=>M(""),[M]),onMenuToggle:k.useCallback(C=>{M(L=>L?"":C),S(C)},[M]),dir:x,loop:h,children:m.jsx(BR.Provider,{scope:r,children:m.jsx(BR.Slot,{scope:r,children:m.jsx(eD,{asChild:!0,...g,orientation:"horizontal",loop:h,dir:x,currentTabStopId:_,onCurrentTabStopIdChange:S,children:m.jsx(ge.div,{role:"menubar",...y,ref:a})})})})})},"Menubar")),oZ="MenubarMenu",[$Ie,rZ]=nZ(oZ),qIe=Kt(e=>{const{__scopeMenubar:t,value:a,...r}=e,c=kt(),d=a||c||"LEGACY_REACT_AUTO_VALUE",u=LD(oZ,t),h=bn(t),f=k.useRef(null),y=k.useRef(!1),x=u.value===d;return k.useEffect(()=>{x||(y.current=!1)},[x]),m.jsx($Ie,{scope:t,value:d,triggerId:kt(),triggerRef:f,contentId:kt(),wasKeyboardTriggerOpenRef:y,children:m.jsx(iD,{...h,open:x,onOpenChange:g=>{g||u.onMenuClose()},modal:!1,dir:u.dir,...r})})},"MenubarMenu"),SV="MenubarTrigger",OIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,disabled:c=!1,...d}=t,u=aZ(r),h=bn(r),f=LD(SV,r),y=rZ(SV,r),x=k.useRef(null),g=Ee(a,x,y.triggerRef),[b,M]=k.useState(!1),_=f.value===y.value;return m.jsx(BR.ItemSlot,{scope:r,value:y.value,disabled:c,children:m.jsx(tD,{asChild:!0,...u,focusable:!c,tabStopId:y.value,children:m.jsx(cD,{asChild:!0,...h,children:m.jsx(ge.button,{type:"button",role:"menuitem",id:y.triggerId,"aria-haspopup":"menu","aria-expanded":_,"aria-controls":_?y.contentId:void 0,"data-highlighted":b?"":void 0,"data-state":_?"open":"closed","data-disabled":c?"":void 0,disabled:c,...d,ref:g,onPointerDown:fe(t.onPointerDown,S=>{!c&&S.button===0&&S.ctrlKey===!1&&(f.onMenuOpen(y.value),_||S.preventDefault())}),onPointerEnter:fe(t.onPointerEnter,()=>{f.value&&!_&&(f.onMenuOpen(y.value),x.current?.focus())}),onKeyDown:fe(t.onKeyDown,S=>{c||(["Enter"," "].includes(S.key)&&f.onMenuToggle(y.value),S.key==="ArrowDown"&&f.onMenuOpen(y.value),["Enter"," ","ArrowDown"].includes(S.key)&&(y.wasKeyboardTriggerOpenRef.current=!0,S.preventDefault()))}),onFocus:fe(t.onFocus,()=>M(!0)),onBlur:fe(t.onBlur,()=>M(!1))})})})})},"MenubarTrigger")),HIe=Kt(e=>{const{__scopeMenubar:t,...a}=e,r=bn(t);return m.jsx(sD,{...r,...a})},"MenubarPortal"),CV="MenubarContent",VIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,align:c="start",...d}=t,u=bn(r),h=LD(CV,r),f=rZ(CV,r),y=RIe(r),x=k.useRef(!1);return m.jsx(lD,{id:f.contentId,"aria-labelledby":f.triggerId,"data-radix-menubar-content":"",...u,...d,ref:a,align:c,onCloseAutoFocus:fe(t.onCloseAutoFocus,g=>{!h.value&&!x.current&&f.triggerRef.current?.focus(),x.current=!1,g.preventDefault()}),onFocusOutside:fe(t.onFocusOutside,g=>{const b=g.target;y().some(_=>_.ref.current?.contains(b))&&g.preventDefault()}),onInteractOutside:fe(t.onInteractOutside,()=>{x.current=!0}),onEntryFocus:g=>{f.wasKeyboardTriggerOpenRef.current||g.preventDefault()},onKeyDown:fe(t.onKeyDown,g=>{if(["ArrowRight","ArrowLeft"].includes(g.key)){const b=g.target,M=b.hasAttribute("data-radix-menubar-subtrigger"),_=b.closest("[data-radix-menubar-content]")!==g.currentTarget,C=(h.dir==="rtl"?"ArrowRight":"ArrowLeft")===g.key;if(!C&&M||_&&C)return;let j=y().filter(R=>!R.disabled).map(R=>R.value);C&&j.reverse();const E=j.indexOf(f.value);j=h.loop?iZ(j,E+1):j.slice(E+1);const[z]=j;z&&h.onMenuOpen(z)}},{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")),BIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(dD,{...d,...c,ref:a})},"MenubarGroup")),FIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(uD,{...d,...c,ref:a})},"MenubarLabel")),UIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(hD,{...d,...c,ref:a})},"MenubarItem")),GIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(pD,{...d,...c,ref:a})},"MenubarCheckboxItem")),ZIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(fD,{...d,...c,ref:a})},"MenubarRadioGroup")),YIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(yD,{...d,...c,ref:a})},"MenubarRadioItem")),XIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(mD,{...d,...c,ref:a})},"MenubarItemIndicator")),WIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(kD,{...d,...c,ref:a})},"MenubarSeparator")),KIe="MenubarSub",QIe=Kt(e=>{const{__scopeMenubar:t,children:a,open:r,onOpenChange:c,defaultOpen:d}=e,u=bn(t),[h,f]=Ut({prop:r,defaultProp:d??!1,onChange:c,caller:KIe});return m.jsx(gD,{...u,open:h,onOpenChange:f,children:a})},"MenubarSub"),JIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(vD,{"data-radix-menubar-subtrigger":"",...d,...c,ref:a})},"MenubarSubTrigger")),eAe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(xD,{...d,"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 iZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Kt(iZ,"wrapArray");var tAe=zIe,nAe=qIe,aAe=OIe,oAe=HIe,rAe=VIe,iAe=BIe,cAe=FIe,sAe=UIe,lAe=GIe,dAe=ZIe,uAe=YIe,cZ=XIe,hAe=WIe,pAe=QIe,fAe=JIe,yAe=eAe;function mAe({className:e,...t}){return m.jsx(tAe,{"data-slot":"menubar",className:W("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function kAe({...e}){return m.jsx(nAe,{"data-slot":"menubar-menu",...e})}function gAe({...e}){return m.jsx(iAe,{"data-slot":"menubar-group",...e})}function sZ({...e}){return m.jsx(oAe,{"data-slot":"menubar-portal",...e})}function vAe({...e}){return m.jsx(dAe,{"data-slot":"menubar-radio-group",...e})}function xAe({className:e,...t}){return m.jsx(aAe,{"data-slot":"menubar-trigger",className:W("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 bAe({className:e,align:t="start",alignOffset:a=-4,sideOffset:r=8,...c}){return m.jsx(sZ,{children:m.jsx(rAe,{"data-slot":"menubar-content",align:t,alignOffset:a,sideOffset:r,className:W("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 MAe({className:e,inset:t,variant:a="default",...r}){return m.jsx(sAe,{"data-slot":"menubar-item","data-inset":t,"data-variant":a,className:W("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 wAe({className:e,children:t,checked:a,...r}){return m.jsxs(lAe,{"data-slot":"menubar-checkbox-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(cZ,{children:m.jsx(Fa,{className:"size-4"})})}),t]})}function _Ae({className:e,children:t,...a}){return m.jsxs(uAe,{"data-slot":"menubar-radio-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(cZ,{children:m.jsx(Nl,{className:"size-2 fill-current"})})}),t]})}function SAe({className:e,inset:t,...a}){return m.jsx(cAe,{"data-slot":"menubar-label","data-inset":t,className:W("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function CAe({className:e,...t}){return m.jsx(hAe,{"data-slot":"menubar-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function LAe({className:e,...t}){return m.jsx("span",{"data-slot":"menubar-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function NAe({...e}){return m.jsx(pAe,{"data-slot":"menubar-sub",...e})}function IAe({className:e,inset:t,children:a,...r}){return m.jsxs(fAe,{"data-slot":"menubar-sub-trigger","data-inset":t,className:W("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,m.jsx(Ua,{className:"ml-auto h-4 w-4"})]})}function AAe({className:e,...t}){return m.jsx(yAe,{"data-slot":"menubar-sub-content",className:W("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 jAe({className:e,...t}){return m.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:W("mx-auto flex w-full justify-center",e),...t})}function EAe({className:e,...t}){return m.jsx("ul",{"data-slot":"pagination-content",className:W("flex flex-row items-center gap-1",e),...t})}function PAe({...e}){return m.jsx("li",{"data-slot":"pagination-item",...e})}function ND({className:e,isActive:t,size:a="icon",...r}){return m.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:W(mA({variant:t?"outline":"ghost",size:a}),e),...r})}function RAe({className:e,label:t="Previous",...a}){return m.jsxs(ND,{"aria-label":t,size:"default",className:W("gap-1 px-2.5 sm:pl-2.5",e),...a,children:[m.jsx(G1,{}),m.jsx("span",{className:"hidden sm:block",children:t})]})}function TAe({className:e,label:t="Next",...a}){return m.jsxs(ND,{"aria-label":t,size:"default",className:W("gap-1 px-2.5 sm:pr-2.5",e),...a,children:[m.jsx("span",{className:"hidden sm:block",children:t}),m.jsx(Ua,{})]})}function DAe({className:e,...t}){return m.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:W("flex size-9 items-center justify-center",e),...t,children:[m.jsx(xo,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"More pages"})]})}var zAe=Object.defineProperty,Ao=(e,t)=>zAe(e,"name",{value:t,configurable:!0}),ID="Popover",[lZ,$Te]=qt(ID,[Sr]),nj=Sr(),[$Ae,Ul]=lZ(ID),qAe=Ao(e=>{const{__scopePopover:t,children:a,open:r,defaultOpen:c,onOpenChange:d,modal:u=!1}=e,h=nj(t),f=k.useRef(null),[y,x]=k.useState(!1),[g,b]=Ut({prop:r,defaultProp:c??!1,onChange:d,caller:ID});return m.jsx(i2,{...h,children:m.jsx($Ae,{scope:t,contentId:kt(),triggerRef:f,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(M=>!M),[b]),hasCustomAnchor:y,onCustomAnchorAdd:k.useCallback(()=>x(!0),[]),onCustomAnchorRemove:k.useCallback(()=>x(!1),[]),modal:u,children:a})})},"Popover"),OAe="PopoverAnchor",HAe=k.forwardRef(Ao(function(t,a){const{__scopePopover:r,...c}=t,d=Ul(OAe,r),u=nj(r),{onCustomAnchorAdd:h,onCustomAnchorRemove:f}=d;return k.useEffect(()=>(h(),()=>f()),[h,f]),m.jsx(c2,{...u,...c,ref:a})},"PopoverAnchor")),VAe="PopoverTrigger",BAe=k.forwardRef(Ao(function(t,a){const{__scopePopover:r,...c}=t,d=Ul(VAe,r),u=nj(r),h=Ee(a,d.triggerRef),f=m.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":AD(d.open),...c,ref:h,onClick:fe(t.onClick,d.onOpenToggle)});return d.hasCustomAnchor?f:m.jsx(c2,{asChild:!0,...u,children:f})},"PopoverTrigger")),dZ="PopoverPortal",[FAe,UAe]=lZ(dZ,{forceMount:void 0}),GAe=Ao(e=>{const{__scopePopover:t,forceMount:a,children:r,container:c}=e,d=Ul(dZ,t);return m.jsx(FAe,{scope:t,forceMount:a,children:m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:r})})})},"PopoverPortal"),Bu="PopoverContent",ZAe=k.forwardRef(Ao(function(t,a){const r=UAe(Bu,t.__scopePopover),{forceMount:c=r.forceMount,...d}=t,u=Ul(Bu,t.__scopePopover);return m.jsx(kn,{present:c||u.open,children:u.modal?m.jsx(XAe,{...d,ref:a}):m.jsx(WAe,{...d,ref:a})})},"PopoverContent")),YAe=Ma("PopoverContent.RemoveScroll"),XAe=k.forwardRef(Ao(function(t,a){const r=Ul(Bu,t.__scopePopover),c=k.useRef(null),d=Ee(a,c),u=k.useRef(!1);return k.useEffect(()=>{const h=c.current;if(h)return TA(h)},[]),m.jsx(o2,{as:YAe,allowPinchZoom:!0,children:m.jsx(uZ,{...t,ref:d,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(t.onCloseAutoFocus,h=>{h.preventDefault(),u.current||r.triggerRef.current?.focus()}),onPointerDownOutside:fe(t.onPointerDownOutside,h=>{const f=h.detail.originalEvent,y=f.button===0&&f.ctrlKey===!0,x=f.button===2||y;u.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:fe(t.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),WAe=k.forwardRef(Ao(function(t,a){const r=Ul(Bu,t.__scopePopover),c=k.useRef(!1),d=k.useRef(!1);return m.jsx(uZ,{...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,d.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&d.current&&u.preventDefault()}})},"PopoverContentNonModal")),uZ=k.forwardRef(Ao(function(t,a){const{__scopePopover:r,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEscapeKeyDown:f,onPointerDownOutside:y,onFocusOutside:x,onInteractOutside:g,...b}=t,M=Ul(Bu,r),_=nj(r);return id(),m.jsx(PA,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:d,onUnmountAutoFocus:u,children:m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:y,onFocusOutside:x,onDismiss:()=>M.onOpenChange(!1),deferPointerDownOutside:!0,children:m.jsx(XA,{"data-state":AD(M.open),role:"dialog",id:M.contentId,..._,...b,ref:a,style:{...b.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 AD(e){return e?"open":"closed"}Ao(AD,"getState");var KAe=qAe,QAe=HAe,JAe=BAe,eje=GAe,tje=ZAe;function hZ({...e}){return m.jsx(KAe,{"data-slot":"popover",...e})}function pZ({...e}){return m.jsx(JAe,{"data-slot":"popover-trigger",...e})}function fZ({className:e,align:t="center",sideOffset:a=4,...r}){return m.jsx(eje,{children:m.jsx(tje,{"data-slot":"popover-content",align:t,sideOffset:a,className:W("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 nje({...e}){return m.jsx(QAe,{"data-slot":"popover-anchor",...e})}var aje=Object.defineProperty,oje=(e,t)=>aje(e,"name",{value:t,configurable:!0});function Fu(e,[t,a]){return Math.min(a,Math.max(t,e))}oje(Fu,"clamp");var rje=Object.defineProperty,ije=(e,t)=>rje(e,"name",{value:t,configurable:!0});function jD(e){const t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}ije(jD,"usePrevious");var cje=Object.defineProperty,sje=(e,t)=>cje(e,"name",{value:t,configurable:!0}),yZ=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"}),lje=k.forwardRef(sje(function(t,a){return m.jsx(ge.span,{...t,ref:a,style:{...yZ,...t.style}})},"VisuallyHidden")),dje=lje,uje=Object.defineProperty,Ge=(e,t)=>uje(e,"name",{value:t,configurable:!0}),hje=[" ","Enter","ArrowUp","ArrowDown"],pje=[" ","Enter"],td="Select",[aj,oj,fje]=cd(td),[Gl,qTe]=qt(td,[fje,Sr]),ED=Sr(),[yje,Lr]=Gl(td),[mje,kje]=Gl(td);function mZ(e){const{__scopeSelect:t,children:a,open:r,defaultOpen:c,onOpenChange:d,value:u,defaultValue:h,onValueChange:f,dir:y,name:x,autoComplete:g,disabled:b,required:M,form:_,internal_do_not_use_render:S}=e,C=ED(t),[L,A]=k.useState(null),[j,E]=k.useState(null),[z,R]=k.useState(!1),$=Vl(y),[H,K]=Ut({prop:r,defaultProp:c??!1,onChange:d,caller:td}),[ae,Y]=Ut({prop:u,defaultProp:h,onChange:f,caller:td}),G=k.useRef(null),J=k.useRef(ae);k.useEffect(()=>{const T=_?L?.ownerDocument.getElementById(_):L?.form;if(T instanceof HTMLFormElement){const U=Ge(()=>Y(J.current),"reset");return T.addEventListener("reset",U),()=>T.removeEventListener("reset",U)}},[_,L,Y]);const oe=L?!!_||!!L.closest("form"):!0,[he,N]=k.useState(new Set),P=kt(),O=Array.from(he).map(T=>T.props.value).join(";"),te=k.useCallback(T=>{N(U=>new Set(U).add(T))},[]),B=k.useCallback(T=>{N(U=>{const X=new Set(U);return X.delete(T),X})},[]),D={required:M,trigger:L,onTriggerChange:A,valueNode:j,onValueNodeChange:E,valueNodeHasChildren:z,onValueNodeHasChildrenChange:R,contentId:P,value:ae,onValueChange:Y,open:H,onOpenChange:K,dir:$,triggerPointerDownPosRef:G,disabled:b,name:x,autoComplete:g,form:_,nativeOptions:he,nativeSelectKey:O,isFormControl:oe};return m.jsx(i2,{...C,children:m.jsx(yje,{scope:t,...D,children:m.jsx(aj.Provider,{scope:t,children:m.jsx(mje,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:B,children:xZ(S)?S(D):a})})})})}Ge(mZ,"SelectProvider");var gje=Ge(e=>{const{__scopeSelect:t,children:a,...r}=e;return m.jsx(mZ,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:c})=>m.jsxs(m.Fragment,{children:[a,c?m.jsx(Wje,{__scopeSelect:t}):null]})})},"Select"),vje="SelectTrigger",xje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,disabled:c=!1,...d}=t,u=ED(r),h=Lr(vje,r),f=h.disabled||c,y=Ee(a,h.onTriggerChange),x=oj(r),g=k.useRef("touch"),[b,M,_]=RD(C=>{const L=x().filter(E=>!E.disabled),A=L.find(E=>E.value===h.value),j=TD(L,C,A);j!==void 0&&h.onValueChange(j.value)}),S=Ge(C=>{f||(h.onOpenChange(!0),_()),C&&(h.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return m.jsx(c2,{asChild:!0,...u,children:m.jsx(ge.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:f,"data-disabled":f?"":void 0,"data-placeholder":d2(h.value)?"":void 0,...d,ref:y,onClick:fe(d.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&S(C)}),onPointerDown:fe(d.onPointerDown,C=>{g.current=C.pointerType;const L=C.target;L.hasPointerCapture(C.pointerId)&&L.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:fe(d.onKeyDown,C=>{const L=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&M(C.key),!(L&&C.key===" ")&&hje.includes(C.key)&&(S(),C.preventDefault())})})})},"SelectTrigger")),bje="SelectValue",Mje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,className:c,style:d,children:u,placeholder:h="",...f}=t,y=Lr(bje,r),{onValueNodeHasChildrenChange:x}=y,g=u!==void 0,b=Ee(a,y.onValueNodeChange);mt(()=>{x(g)},[x,g]);const M=d2(y.value);return m.jsx(ge.span,{...f,asChild:M?!1:f.asChild,ref:b,style:{pointerEvents:"none"},children:m.jsx(k.Fragment,{children:M?h:u},M?"placeholder":"value")})},"SelectValue")),wje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,children:c,...d}=t;return m.jsx(ge.span,{"aria-hidden":!0,...d,ref:a,children:c||"▼"})},"SelectIcon")),_je="SelectPortal",[Sje,Cje]=Gl(_je,{forceMount:void 0}),Lje=Ge(e=>{const{__scopeSelect:t,forceMount:a,...r}=e;return m.jsx(Sje,{scope:e.__scopeSelect,forceMount:a,children:m.jsx(rd,{asChild:!0,...r})})},"SelectPortal"),zl="SelectContent",Nje=k.forwardRef(Ge(function(t,a){const r=Cje(zl,t.__scopeSelect),{forceMount:c=r.forceMount,...d}=t,u=Lr(zl,t.__scopeSelect),[h,f]=k.useState();return mt(()=>{f(new DocumentFragment)},[]),m.jsx(kn,{present:c||u.open,children:({present:y})=>y?m.jsx(jje,{...d,ref:a}):m.jsx(Ije,{...d,fragment:h})})},"SelectContent")),Ije=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,children:c,fragment:d}=t;return d?$l.createPortal(m.jsx(kZ,{scope:r,children:m.jsx(aj.Slot,{scope:r,children:m.jsx("div",{ref:a,children:c})})}),d):null},"SelectContentFragment")),ka=10,[kZ,Zl]=Gl(zl),Aje=Ma("SelectContent.RemoveScroll"),jje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r}=t,{position:c="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:u,onPointerDownOutside:h,side:f,sideOffset:y,align:x,alignOffset:g,arrowPadding:b,collisionBoundary:M,collisionPadding:_,sticky:S,hideWhenDetached:C,avoidCollisions:L,...A}=t,j=Lr(zl,r),[E,z]=k.useState(null),[R,$]=k.useState(null),H=Ee(a,z),[K,ae]=k.useState(null),[Y,G]=k.useState(null),J=oj(r),[oe,he]=k.useState(!1),N=k.useRef(!1);k.useEffect(()=>{if(E)return TA(E)},[E]),id();const P=k.useCallback(ie=>{const[se,..._e]=J().map(Re=>Re.ref.current),[ve]=_e.slice(-1),Ne=document.activeElement;for(const Re of ie)if(Re===Ne||(Re?.scrollIntoView({block:"nearest"}),Re===se&&R&&(R.scrollTop=0),Re===ve&&R&&(R.scrollTop=R.scrollHeight),Re?.focus(),document.activeElement!==Ne))return},[J,R]),O=k.useCallback(()=>P([K,E]),[P,K,E]);k.useEffect(()=>{oe&&O()},[oe,O]);const{onOpenChange:te,triggerPointerDownPosRef:B}=j;k.useEffect(()=>{if(E){let ie={x:0,y:0};const se=Ge(ve=>{ie={x:Math.abs(Math.round(ve.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(B.current?.y??0))}},"handlePointerMove"),_e=Ge(ve=>{ie.x<=10&&ie.y<=10?ve.preventDefault():ve.composedPath().includes(E)||te(!1),document.removeEventListener("pointermove",se),B.current=null},"handlePointerUp");return B.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",_e,{capture:!0})}}},[E,te,B]),k.useEffect(()=>{const ie=Ge(()=>te(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[te]);const[D,T]=RD(ie=>{const se=J().filter(Ne=>!Ne.disabled),_e=se.find(Ne=>Ne.ref.current===document.activeElement),ve=TD(se,ie,_e);ve&&setTimeout(()=>ve.ref.current?.focus())}),U=k.useCallback((ie,se,_e)=>{const ve=!N.current&&!_e;(j.value!==void 0&&j.value===se||ve)&&(ae(ie),ve&&(N.current=!0))},[j.value]),X=k.useCallback(()=>E?.focus(),[E]),Z=k.useCallback((ie,se,_e)=>{const ve=!N.current&&!_e;(j.value!==void 0&&j.value===se||ve)&&G(ie)},[j.value]),ce=c==="popper"?LV:Eje,pe=ce===LV?{side:f,sideOffset:y,align:x,alignOffset:g,arrowPadding:b,collisionBoundary:M,collisionPadding:_,sticky:S,hideWhenDetached:C,avoidCollisions:L}:{};return m.jsx(kZ,{scope:r,content:E,viewport:R,onViewportChange:$,itemRefCallback:U,selectedItem:K,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:O,selectedItemText:Y,position:c,isPositioned:oe,searchRef:D,children:m.jsx(o2,{as:Aje,allowPinchZoom:!0,children:m.jsx(PA,{asChild:!0,trapped:j.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:fe(d,ie=>{j.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:m.jsx(ce,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ie=>ie.preventDefault(),...A,...pe,onPlaced:()=>he(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:fe(A.onKeyDown,ie=>{const se=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!se&&ie.key.length===1&&T(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ve=J().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Ne=ie.target,Re=ve.indexOf(Ne);ve=ve.slice(Re+1)}setTimeout(()=>P(ve)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),Eje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,onPlaced:c,...d}=t,u=Lr(zl,r),h=Zl(zl,r),[f,y]=k.useState(null),[x,g]=k.useState(null),b=Ee(a,g),M=oj(r),_=k.useRef(!1),S=k.useRef(!0),{viewport:C,selectedItem:L,selectedItemText:A,focusSelectedItem:j}=h,E=k.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&x&&C&&L&&A){const H=u.trigger.getBoundingClientRect(),K=x.getBoundingClientRect(),ae=u.valueNode.getBoundingClientRect(),Y=A.getBoundingClientRect();if(u.dir!=="rtl"){const Ne=Y.left-K.left,Re=ae.left-Ne,qe=H.left-Re,xe=H.width+qe,Ae=Math.max(xe,K.width),vt=window.innerWidth-ka,ke=Fu(Re,[ka,Math.max(ka,vt-Ae)]);f.style.minWidth=xe+"px",f.style.left=ke+"px"}else{const Ne=K.right-Y.right,Re=window.innerWidth-ae.right-Ne,qe=window.innerWidth-H.right-Re,xe=H.width+qe,Ae=Math.max(xe,K.width),vt=window.innerWidth-ka,ke=Fu(Re,[ka,Math.max(ka,vt-Ae)]);f.style.minWidth=xe+"px",f.style.right=ke+"px"}const G=M(),J=window.innerHeight-ka*2,oe=C.scrollHeight,he=window.getComputedStyle(x),N=parseInt(he.borderTopWidth,10),P=parseInt(he.paddingTop,10),O=parseInt(he.borderBottomWidth,10),te=parseInt(he.paddingBottom,10),B=N+P+oe+te+O,D=Math.min(L.offsetHeight*5,B),T=window.getComputedStyle(C),U=parseInt(T.paddingTop,10),X=parseInt(T.paddingBottom,10),Z=H.top+H.height/2-ka,ce=J-Z,pe=L.offsetHeight/2,ie=L.offsetTop+pe,se=N+P+ie,_e=B-se;if(se<=Z){const Ne=G.length>0&&L===G[G.length-1].ref.current;f.style.bottom="0px";const Re=x.clientHeight-C.offsetTop-C.offsetHeight,qe=Math.max(ce,pe+(Ne?X:0)+Re+O),xe=se+qe;f.style.height=xe+"px"}else{const Ne=G.length>0&&L===G[0].ref.current;f.style.top="0px";const qe=Math.max(Z,N+C.offsetTop+(Ne?U:0)+pe)+_e;f.style.height=qe+"px",C.scrollTop=se-Z+C.offsetTop}f.style.margin=`${ka}px 0`,f.style.minHeight=D+"px",f.style.maxHeight=J+"px",c?.(),requestAnimationFrame(()=>_.current=!0)}},[M,u.trigger,u.valueNode,f,x,C,L,A,u.dir,c]);mt(()=>E(),[E]);const[z,R]=k.useState();mt(()=>{x&&R(window.getComputedStyle(x).zIndex)},[x]);const $=k.useCallback(H=>{H&&S.current===!0&&(E(),j?.(),S.current=!1)},[E,j]);return m.jsx(Pje,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:_,onScrollButtonChange:$,children:m.jsx("div",{ref:y,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:m.jsx(ge.div,{...d,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),LV=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,align:c="start",collisionPadding:d=ka,...u}=t,h=ED(r);return m.jsx(XA,{...h,...u,ref:a,align:c,collisionPadding:d,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")),[Pje,PD]=Gl(zl,{}),NV="SelectViewport",Rje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,nonce:c,...d}=t,u=Zl(NV,r),h=PD(NV,r),f=Ee(a,u.onViewportChange),y=k.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),m.jsx(aj.Slot,{scope:r,children:m.jsx(ge.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:fe(d.onScroll,x=>{const g=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:M}=h;if(M?.current&&b){const _=Math.abs(y.current-g.scrollTop);if(_>0){const S=window.innerHeight-ka*2,C=parseFloat(b.style.minHeight),L=parseFloat(b.style.height),A=Math.max(C,L);if(A<S){const j=A+_,E=Math.min(S,j),z=j-E;b.style.height=E+"px",b.style.bottom==="0px"&&(g.scrollTop=z>0?z:0,b.style.justifyContent="flex-end")}}}y.current=g.scrollTop})})})]})},"SelectViewport")),Tje="SelectGroup",[Dje,zje]=Gl(Tje),$je=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t,d=kt();return m.jsx(Dje,{scope:r,id:d,children:m.jsx(ge.div,{role:"group","aria-labelledby":d,...c,ref:a})})},"SelectGroup")),qje="SelectLabel",Oje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t,d=zje(qje,r);return m.jsx(ge.div,{id:d.id,...c,ref:a})},"SelectLabel")),FR="SelectItem",[Hje,gZ]=Gl(FR),Vje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,value:c,disabled:d=!1,textValue:u,...h}=t,f=Lr(FR,r),y=Zl(FR,r),x=f.value===c,[g,b]=k.useState(u??""),[M,_]=k.useState(!1),S=yn(E=>y.itemRefCallback?.(E,c,d)),C=Ee(a,S),L=kt(),A=k.useRef("touch"),j=Ge(()=>{d||(f.onValueChange(c),f.onOpenChange(!1))},"handleSelect");return m.jsx(Hje,{scope:r,value:c,disabled:d,textId:L,isSelected:x,onItemTextChange:k.useCallback(E=>{b(z=>z||(E?.textContent??"").trim())},[]),children:m.jsx(aj.ItemSlot,{scope:r,value:c,disabled:d,textValue:g,children:m.jsx(ge.div,{role:"option","aria-labelledby":L,"data-highlighted":M?"":void 0,"aria-selected":x&&M,"data-state":x?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...h,ref:C,onFocus:fe(h.onFocus,()=>_(!0)),onBlur:fe(h.onBlur,()=>_(!1)),onClick:fe(h.onClick,()=>{A.current!=="mouse"&&j()}),onPointerUp:fe(h.onPointerUp,()=>{A.current==="mouse"&&j()}),onPointerDown:fe(h.onPointerDown,E=>{A.current=E.pointerType}),onPointerMove:fe(h.onPointerMove,E=>{A.current=E.pointerType,d?y.onItemLeave?.():A.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(h.onPointerLeave,E=>{E.currentTarget===document.activeElement&&y.onItemLeave?.()}),onKeyDown:fe(h.onKeyDown,E=>{d||E.target!==E.currentTarget||y.searchRef?.current!==""&&E.key===" "||(pje.includes(E.key)&&j(),E.key===" "&&E.preventDefault())})})})})},"SelectItem")),B0="SelectItemText",Bje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,className:c,style:d,...u}=t,h=Lr(B0,r),f=Zl(B0,r),y=gZ(B0,r),x=kje(B0,r),[g,b]=k.useState(null),M=yn(j=>f.itemTextRefCallback?.(j,y.value,y.disabled)),_=Ee(a,b,y.onItemTextChange,M),S=g?.textContent,C=k.useMemo(()=>m.jsx("option",{value:y.value,disabled:y.disabled,children:S},y.value),[y.disabled,y.value,S]),{onNativeOptionAdd:L,onNativeOptionRemove:A}=x;return mt(()=>(L(C),()=>A(C)),[L,A,C]),m.jsxs(m.Fragment,{children:[m.jsx(ge.span,{id:y.textId,...u,ref:_}),y.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!d2(h.value)?$l.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),Fje="SelectItemIndicator",Uje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t;return gZ(Fje,r).isSelected?m.jsx(ge.span,{"aria-hidden":!0,...c,ref:a}):null},"SelectItemIndicator")),IV="SelectScrollUpButton",Gje=k.forwardRef(Ge(function(t,a){const r=Zl(IV,t.__scopeSelect),c=PD(IV,t.__scopeSelect),[d,u]=k.useState(!1),h=Ee(a,c.onScrollButtonChange);return mt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const x=y.scrollTop>0;u(x)};Ge(f,"handleScroll");const y=r.viewport;return f(),y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),d?m.jsx(vZ,{...t,ref:h,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=r;f&&y&&(f.scrollTop=f.scrollTop-y.offsetHeight)}}):null},"SelectScrollUpButton")),AV="SelectScrollDownButton",Zje=k.forwardRef(Ge(function(t,a){const r=Zl(AV,t.__scopeSelect),c=PD(AV,t.__scopeSelect),[d,u]=k.useState(!1),h=Ee(a,c.onScrollButtonChange);return mt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const x=y.scrollHeight-y.clientHeight,g=Math.ceil(y.scrollTop)<x;u(g)};Ge(f,"handleScroll");const y=r.viewport;return f(),y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),d?m.jsx(vZ,{...t,ref:h,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=r;f&&y&&(f.scrollTop=f.scrollTop+y.offsetHeight)}}):null},"SelectScrollDownButton")),vZ=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,onAutoScroll:c,...d}=t,u=Zl("SelectScrollButton",r),h=k.useRef(null),f=oj(r),y=k.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return k.useEffect(()=>()=>y(),[y]),mt(()=>{f().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),m.jsx(ge.div,{"aria-hidden":!0,...d,ref:a,style:{flexShrink:0,...d.style},onPointerDown:fe(d.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(c,50))}),onPointerMove:fe(d.onPointerMove,()=>{u.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(c,50))}),onPointerLeave:fe(d.onPointerLeave,()=>{y()})})},"SelectScrollButtonImpl")),Yje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t;return m.jsx(ge.div,{"aria-hidden":!0,...c,ref:a})},"SelectSeparator")),Xje="SelectBubbleInput",Wje=k.forwardRef(Ge(function({__scopeSelect:t,...a},r){const c=Lr(Xje,t),{value:d,onValueChange:u,required:h,disabled:f,name:y,autoComplete:x,form:g}=c,{nativeOptions:b,nativeSelectKey:M}=c,_=k.useRef(null),S=Ee(r,_),C=d??"",L=jD(C),A=Array.from(b).some(j=>(j.props.value??"")==="");return k.useEffect(()=>{const j=_.current;if(!j)return;const E=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(E,"value").set;if(L!==C&&R){const $=new Event("change",{bubbles:!0});R.call(j,C),j.dispatchEvent($)}},[L,C]),m.jsxs(ge.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:y,autoComplete:x,disabled:f,form:g,onChange:j=>u(j.target.value),...a,style:{...yZ,...a.style},ref:S,defaultValue:C,children:[d2(d)&&!A?m.jsx("option",{value:""}):null,Array.from(b)]},M)},"SelectBubbleInput"));function xZ(e){return typeof e=="function"}Ge(xZ,"isFunction");function d2(e){return e===""||e===void 0}Ge(d2,"shouldShowPlaceholder");function RD(e){const t=yn(e),a=k.useRef(""),r=k.useRef(0),c=k.useCallback(u=>{const h=a.current+u;t(h),Ge((function f(y){a.current=y,window.clearTimeout(r.current),y!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(h)},[t]),d=k.useCallback(()=>{a.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[a,c,d]}Ge(RD,"useTypeaheadSearch");function TD(e,t,a){const c=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,d=a?e.indexOf(a):-1;let u=bZ(e,Math.max(d,0));c.length===1&&(u=u.filter(y=>y!==a));const f=u.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return f!==a?f:void 0}Ge(TD,"findNextItem");function bZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Ge(bZ,"wrapArray");function MZ({...e}){return m.jsx(gje,{"data-slot":"select",...e})}function Kje({...e}){return m.jsx($je,{"data-slot":"select-group",...e})}function wZ({...e}){return m.jsx(Mje,{"data-slot":"select-value",...e})}function _Z({className:e,size:t="default",children:a,...r}){return m.jsxs(xje,{"data-slot":"select-trigger","data-size":t,className:W("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,m.jsx(wje,{asChild:!0,children:m.jsx(fr,{className:"size-4 opacity-50"})})]})}function SZ({className:e,children:t,position:a="popper",...r}){return m.jsx(Lje,{children:m.jsxs(Nje,{"data-slot":"select-content",className:W("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:[m.jsx(LZ,{}),m.jsx(Rje,{className:W("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),m.jsx(NZ,{})]})})}function Qje({className:e,...t}){return m.jsx(Oje,{"data-slot":"select-label",className:W("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function CZ({className:e,children:t,...a}){return m.jsxs(Vje,{"data-slot":"select-item",className:W("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:[m.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:m.jsx(Uje,{children:m.jsx(Fa,{className:"size-4"})})}),m.jsx(Bje,{children:t})]})}function Jje({className:e,...t}){return m.jsx(Yje,{"data-slot":"select-separator",className:W("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function LZ({className:e,...t}){return m.jsx(Gje,{"data-slot":"select-scroll-up-button",className:W("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Mu,{className:"size-4"})})}function NZ({className:e,...t}){return m.jsx(Zje,{"data-slot":"select-scroll-down-button",className:W("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(fr,{className:"size-4"})})}var eEe=Object.defineProperty,IZ=(e,t)=>eEe(e,"name",{value:t,configurable:!0}),jV="horizontal",tEe=["horizontal","vertical"],nEe=k.forwardRef(IZ(function(t,a){const{decorative:r,orientation:c=jV,...d}=t,u=AZ(c)?c:jV,f=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return m.jsx(ge.div,{"data-orientation":u,...f,...d,ref:a})},"Separator"));function AZ(e){return tEe.includes(e)}IZ(AZ,"isValidOrientation");var aEe=nEe;function DD({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return m.jsx(aEe,{"data-slot":"separator-root",decorative:a,orientation:t,className:W("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 jZ({...e}){return m.jsx(qT,{"data-slot":"sheet",...e})}function oEe({...e}){return m.jsx(TU,{"data-slot":"sheet-trigger",...e})}function rEe({...e}){return m.jsx(DA,{"data-slot":"sheet-close",...e})}function iEe({...e}){return m.jsx(OT,{"data-slot":"sheet-portal",...e})}function cEe({className:e,...t}){return m.jsx(HT,{"data-slot":"sheet-overlay",className:W("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 EZ({className:e,children:t,side:a="right",...r}){return m.jsxs(iEe,{children:[m.jsx(cEe,{}),m.jsxs(VT,{"data-slot":"sheet-content",className:W("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,m.jsxs(DA,{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:[m.jsx(yr,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function PZ({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-header",className:W("flex flex-col gap-1.5 p-4",e),...t})}function sEe({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-footer",className:W("mt-auto flex flex-col gap-2 p-4",e),...t})}function RZ({className:e,...t}){return m.jsx(qU,{"data-slot":"sheet-title",className:W("text-foreground font-semibold",e),...t})}function TZ({className:e,...t}){return m.jsx(OU,{"data-slot":"sheet-description",className:W("text-muted-foreground text-sm",e),...t})}const aR=768;function lEe(){const[e,t]=k.useState(void 0);return k.useEffect(()=>{const a=window.matchMedia(`(max-width: ${aR-1}px)`),r=()=>{t(window.innerWidth<aR)};return a.addEventListener("change",r),t(window.innerWidth<aR),()=>a.removeEventListener("change",r)},[]),!!e}function SA({className:e,...t}){return m.jsx("div",{"data-slot":"skeleton",className:W("bg-accent animate-pulse rounded-md",e),...t})}var dEe=Object.defineProperty,$t=(e,t)=>dEe(e,"name",{value:t,configurable:!0}),[zD,OTe]=qt("Tooltip",[Sr]),rj=Sr(),uEe="TooltipProvider",hEe=700,UR="tooltip.open",[pEe,$D]=zD(uEe),fEe=$t(e=>{const{__scopeTooltip:t,delayDuration:a=hEe,skipDelayDuration:r=300,disableHoverableContent:c=!1,children:d}=e,u=k.useRef(!0),h=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const y=f.current;return()=>window.clearTimeout(y)},[]),m.jsx(pEe,{scope:t,isOpenDelayedRef:u,delayDuration:a,onOpen:k.useCallback(()=>{r<=0||(window.clearTimeout(f.current),u.current=!1)},[r]),onClose:k.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:h,onPointerInTransitChange:k.useCallback(y=>{h.current=y},[]),disableHoverableContent:c,children:d})},"TooltipProvider"),GR="Tooltip",[yEe,u2]=zD(GR),mEe=$t(e=>{const{__scopeTooltip:t,children:a,open:r,defaultOpen:c,onOpenChange:d,disableHoverableContent:u,delayDuration:h}=e,f=$D(GR,e.__scopeTooltip),y=rj(t),[x,g]=k.useState(null),[b,M]=k.useState(void 0),_=kt(),S=k.useRef(0),C=u??f.disableHoverableContent,L=h??f.delayDuration,A=k.useRef(!1),[j,E]=Ut({prop:r,defaultProp:c??!1,onChange:$t(ae=>{ae?(f.onOpen(),document.dispatchEvent(new CustomEvent(UR))):f.onClose(),d?.(ae)},"onChange"),caller:GR}),z=k.useMemo(()=>j?A.current?"delayed-open":"instant-open":"closed",[j]),R=k.useCallback(()=>{window.clearTimeout(S.current),S.current=0,A.current=!1,E(!0)},[E]),$=k.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E(!1)},[E]),H=k.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{A.current=!0,E(!0),S.current=0},L)},[L,E]);k.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const K=b??_;return m.jsx(i2,{...y,children:m.jsx(yEe,{scope:t,contentId:K,setContentId:M,open:j,stateAttribute:z,trigger:x,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{f.isOpenDelayedRef.current?H():R()},[f.isOpenDelayedRef,H,R]),onTriggerLeave:k.useCallback(()=>{C?$():(window.clearTimeout(S.current),S.current=0)},[$,C]),onOpen:R,onClose:$,disableHoverableContent:C,children:a})})},"Tooltip"),EV="TooltipTrigger",kEe=k.forwardRef($t(function(t,a){const{__scopeTooltip:r,...c}=t,d=u2(EV,r),u=$D(EV,r),h=rj(r),f=k.useRef(null),y=Ee(a,f,d.onTriggerChange),x=k.useRef(!1),g=k.useRef(!1),b=k.useCallback(()=>x.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),m.jsx(c2,{asChild:!0,...h,children:m.jsx(ge.button,{"aria-describedby":d.open?d.contentId:void 0,"data-state":d.stateAttribute,...c,ref:y,onPointerMove:fe(t.onPointerMove,M=>{M.pointerType!=="touch"&&!g.current&&!u.isPointerInTransitRef.current&&(d.onTriggerEnter(),g.current=!0)}),onPointerLeave:fe(t.onPointerLeave,()=>{d.onTriggerLeave(),g.current=!1}),onPointerDown:fe(t.onPointerDown,()=>{d.open&&d.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:fe(t.onFocus,()=>{x.current||d.onOpen()}),onBlur:fe(t.onBlur,d.onClose),onClick:fe(t.onClick,d.onClose)})})},"TooltipTrigger")),DZ="TooltipPortal",[gEe,vEe]=zD(DZ,{forceMount:void 0}),xEe=$t(e=>{const{__scopeTooltip:t,forceMount:a,children:r,container:c}=e,d=u2(DZ,t);return m.jsx(gEe,{scope:t,forceMount:a,children:m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:r})})})},"TooltipPortal"),Uu="TooltipContent",bEe=k.forwardRef($t(function(t,a){const r=vEe(Uu,t.__scopeTooltip),{forceMount:c=r.forceMount,side:d="top",...u}=t,h=u2(Uu,t.__scopeTooltip);return m.jsx(kn,{present:c||h.open,children:h.disableHoverableContent?m.jsx(zZ,{side:d,...u,ref:a}):m.jsx(MEe,{side:d,...u,ref:a})})},"TooltipContent")),MEe=k.forwardRef($t(function(t,a){const r=u2(Uu,t.__scopeTooltip),c=$D(Uu,t.__scopeTooltip),d=k.useRef(null),u=Ee(a,d),[h,f]=k.useState(null),{trigger:y,onClose:x}=r,g=d.current,{onPointerInTransitChange:b}=c,M=k.useCallback(()=>{f(null),b(!1)},[b]),_=k.useCallback((S,C)=>{const L=S.currentTarget,A={x:S.clientX,y:S.clientY},j=$Z(A,L.getBoundingClientRect()),E=qZ(A,j),z=OZ(C.getBoundingClientRect()),R=VZ([...E,...z]);f(R),b(!0)},[b]);return k.useEffect(()=>()=>M(),[M]),k.useEffect(()=>{if(y&&g){const S=$t(L=>_(L,g),"handleTriggerLeave"),C=$t(L=>_(L,y),"handleContentLeave");return y.addEventListener("pointerleave",S),g.addEventListener("pointerleave",C),()=>{y.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",C)}}},[y,g,_,M]),k.useEffect(()=>{if(h){const S=$t(C=>{const L=C.target,A={x:C.clientX,y:C.clientY},j=y?.contains(L)||g?.contains(L),E=!HZ(A,h);j?M():E&&(M(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[y,g,h,x,M]),m.jsx(zZ,{...t,ref:u})},"TooltipContentHoverable")),wEe=lF("TooltipContent"),zZ=k.forwardRef($t(function(t,a){const{__scopeTooltip:r,children:c,"aria-label":d,id:u,onEscapeKeyDown:h,onPointerDownOutside:f,...y}=t,x=u2(Uu,r),g=rj(r),{onClose:b}=x;k.useEffect(()=>(document.addEventListener(UR,b),()=>document.removeEventListener(UR,b)),[b]),k.useEffect(()=>{if(x.trigger){const _=$t(S=>{S.target instanceof Node&&S.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",_,{capture:!0}),()=>window.removeEventListener("scroll",_,{capture:!0})}},[x.trigger,b]);const{setContentId:M}=x;return mt(()=>(M(u),()=>{M(void 0)}),[u,M]),m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:_=>_.preventDefault(),onDismiss:b,children:m.jsxs(XA,{"data-state":x.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:x.contentId,...g,...y,ref:a,style:{...y.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:[m.jsx(wEe,{children:c}),d?m.jsx(dje,{id:x.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl")),_Ee=k.forwardRef($t(function(t,a){const{__scopeTooltip:r,...c}=t,d=rj(r);return m.jsx(HCe,{...d,...c,ref:a})},"TooltipArrow"));function $Z(e,t){const a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),c=Math.abs(t.right-e.x),d=Math.abs(t.left-e.x);switch(Math.min(a,r,c,d)){case d:return"left";case c:return"right";case a:return"top";case r:return"bottom";default:throw new Error("unreachable")}}$t($Z,"getExitSideFromRect");function qZ(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}$t(qZ,"getPaddedExitPoints");function OZ(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}]}$t(OZ,"getPointsFromRect");function HZ(e,t){const{x:a,y:r}=e;let c=!1;for(let d=0,u=t.length-1;d<t.length;u=d++){const h=t[d],f=t[u],y=h.x,x=h.y,g=f.x,b=f.y;x>r!=b>r&&a<(g-y)*(r-x)/(b-x)+y&&(c=!c)}return c}$t(HZ,"isPointInPolygon");function VZ(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),BZ(t)}$t(VZ,"getHull");function BZ(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 d=t[t.length-1],u=t[t.length-2];if((d.x-u.x)*(c.y-u.y)>=(d.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 d=a[a.length-1],u=a[a.length-2];if((d.x-u.x)*(c.y-u.y)>=(d.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)}$t(BZ,"getHullPresorted");var SEe=fEe,CEe=mEe,LEe=kEe,NEe=xEe,IEe=bEe,AEe=_Ee;function ij({delayDuration:e=0,...t}){return m.jsx(SEe,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qD({...e}){return m.jsx(ij,{children:m.jsx(CEe,{"data-slot":"tooltip",...e})})}function OD({...e}){return m.jsx(LEe,{"data-slot":"tooltip-trigger",...e})}function HD({className:e,sideOffset:t=0,children:a,...r}){return m.jsx(NEe,{children:m.jsxs(IEe,{"data-slot":"tooltip-content",sideOffset:t,className:W("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,m.jsx(AEe,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const jEe="sidebar_state",EEe=3600*24*7,PEe="16rem",REe="18rem",TEe="3rem",DEe="b",FZ=k.createContext(null);function h2(){const e=k.useContext(FZ);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function zEe({defaultOpen:e=!0,open:t,onOpenChange:a,className:r,style:c,children:d,...u}){const h=lEe(),[f,y]=k.useState(!1),[x,g]=k.useState(e),b=t??x,M=k.useCallback(L=>{const A=typeof L=="function"?L(b):L;a?a(A):g(A),document.cookie=`${jEe}=${A}; path=/; max-age=${EEe}`},[a,b]),_=k.useCallback(()=>h?y(L=>!L):M(L=>!L),[h,M,y]);k.useEffect(()=>{const L=A=>{A.key===DEe&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),_())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[_]);const S=b?"expanded":"collapsed",C=k.useMemo(()=>({state:S,open:b,setOpen:M,isMobile:h,openMobile:f,setOpenMobile:y,toggleSidebar:_}),[S,b,M,h,f,y,_]);return m.jsx(FZ.Provider,{value:C,children:m.jsx(ij,{delayDuration:0,children:m.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":PEe,"--sidebar-width-icon":TEe,...c},className:W("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...u,children:d})})})}function $Ee({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:c,...d}){const{isMobile:u,state:h,openMobile:f,setOpenMobile:y}=h2();return a==="none"?m.jsx("div",{"data-slot":"sidebar",className:W("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...d,children:c}):u?m.jsx(jZ,{open:f,onOpenChange:y,...d,children:m.jsxs(EZ,{"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":REe},side:e,children:[m.jsxs(PZ,{className:"sr-only",children:[m.jsx(RZ,{children:"Sidebar"}),m.jsx(TZ,{children:"Displays the mobile sidebar."})]}),m.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):m.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:[m.jsx("div",{"data-slot":"sidebar-gap",className:W("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)")}),m.jsx("div",{"data-slot":"sidebar-container",className:W("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),...d,children:m.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}=h2();return m.jsxs(tn,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:W("size-7",e),onClick:c=>{t?.(c),r()},...a,children:[m.jsx(hr,{}),m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function OEe({className:e,...t}){const{toggleSidebar:a}=h2();return m.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:W("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 HEe({className:e,...t}){return m.jsx("main",{"data-slot":"sidebar-inset",className:W("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 VEe({className:e,...t}){return m.jsx(CD,{"data-slot":"sidebar-input","data-sidebar":"input",className:W("bg-background h-8 w-full shadow-none",e),...t})}function BEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:W("flex flex-col gap-2 p-2",e),...t})}function FEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:W("flex flex-col gap-2 p-2",e),...t})}function UEe({className:e,...t}){return m.jsx(DD,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:W("bg-sidebar-border mx-2 w-auto",e),...t})}function GEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:W("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function ZEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:W("relative flex w-full min-w-0 flex-col p-2",e),...t})}function YEe({className:e,asChild:t=!1,...a}){const r=t?Mr:"div";return m.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:W("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 XEe({className:e,asChild:t=!1,...a}){const r=t?Mr:"button";return m.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:W("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 WEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:W("w-full text-sm",e),...t})}function KEe({className:e,...t}){return m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:W("flex w-full min-w-0 flex-col gap-1",e),...t})}function QEe({className:e,...t}){return m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:W("group/menu-item relative",e),...t})}const JEe=AA("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 ePe({asChild:e=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:c,className:d,...u}){const h=e?Mr:"button",{isMobile:f,state:y}=h2(),x=m.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:W(JEe({variant:a,size:r}),d),...u});return c?(typeof c=="string"&&(c={children:c}),m.jsxs(qD,{children:[m.jsx(OD,{asChild:!0,children:x}),m.jsx(HD,{side:"right",align:"center",hidden:y!=="collapsed"||f,...c})]})):x}function tPe({className:e,asChild:t=!1,showOnHover:a=!1,...r}){const c=t?Mr:"button";return m.jsx(c,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:W("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 nPe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:W("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 aPe({className:e,showIcon:t=!1,...a}){const r=k.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return m.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:W("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[t&&m.jsx(SA,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),m.jsx(SA,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function oPe({className:e,...t}){return m.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:W("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 rPe({className:e,...t}){return m.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:W("group/menu-sub-item relative",e),...t})}function iPe({asChild:e=!1,size:t="md",isActive:a=!1,className:r,...c}){const d=e?Mr:"a";return m.jsx(d,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:W("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 cPe=Object.defineProperty,et=(e,t)=>cPe(e,"name",{value:t,configurable:!0}),UZ=["PageUp","PageDown"],GZ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZZ={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},p2="Slider",[ZR,sPe,lPe]=cd(p2),[VD,HTe]=qt(p2,[lPe]),[dPe,f2]=VD(p2),uPe=k.forwardRef(et(function(t,a){const{name:r,min:c=0,max:d=100,step:u=1,orientation:h="horizontal",disabled:f=!1,minStepsBetweenThumbs:y=0,defaultValue:x=[c],value:g,onValueChange:b=et(()=>{},"onValueChange"),onValueCommit:M=et(()=>{},"onValueCommit"),inverted:_=!1,form:S,...C}=t,L=k.useRef(new Set),A=k.useRef(0),j=k.useRef(!1),z=h==="horizontal"?hPe:pPe,[R,$]=k.useState(null),H=Ee(a,$),[K=[],ae]=Ut({prop:g,defaultProp:x,onChange:et(P=>{[...L.current][A.current]?.focus({preventScroll:!0,focusVisible:j.current}),j.current=!1,b(P)},"onChange")}),Y=k.useRef(K),G=k.useRef(K);k.useEffect(()=>{const P=S?R?.ownerDocument.getElementById(S):R?.closest("form");if(P instanceof HTMLFormElement){const O=et(()=>ae(G.current),"reset");return P.addEventListener("reset",O),()=>P.removeEventListener("reset",O)}},[R,S,ae]);function J(P){const O=tY(K,P);N(P,O)}et(J,"handleSlideStart");function oe(P){N(P,A.current)}et(oe,"handleSlideMove");function he(){String(K)!==String(Y.current)&&M(K)}et(he,"handleSlideEnd");function N(P,O,{commit:te}={commit:!1}){const B=FD(u),D=Iu(Math.round((P-c)/u)*u+c,B),T=Fu(D,[c,d]);ae((U=[])=>{const X=JZ(U,T,O);if(oY(X,y*u)){A.current=X.indexOf(T);const Z=String(X)!==String(U);return Z&&te&&M(X),Z?X:U}else return U})}return et(N,"updateValues"),m.jsx(dPe,{scope:t.__scopeSlider,name:r,disabled:f,min:c,max:d,valueIndexToChangeRef:A,thumbs:L.current,values:K,orientation:h,form:S,children:m.jsx(ZR.Provider,{scope:t.__scopeSlider,children:m.jsx(ZR.Slot,{scope:t.__scopeSlider,children:m.jsx(z,{"aria-disabled":f,"data-disabled":f?"":void 0,...C,ref:H,onPointerDown:fe(C.onPointerDown,()=>{f||(Y.current=K,j.current=!1)}),min:c,max:d,inverted:_,onSlideStart:f?void 0:J,onSlideMove:f?void 0:oe,onSlideEnd:f?void 0:he,onHomeKeyDown:()=>{f||(j.current=!0,N(c,0,{commit:!0}))},onEndKeyDown:()=>{f||(j.current=!0,N(d,K.length-1,{commit:!0}))},onStepKeyDown:({event:P,direction:O})=>{if(!f){j.current=!0;const D=UZ.includes(P.key)||P.shiftKey&&GZ.includes(P.key)?10:1,T=A.current,U=K[T],X=rY(U,{min:c,step:u,direction:O,multiplier:D});N(X,T,{commit:!0})}}})})})})},"Slider")),[YZ,XZ]=VD(p2,{startEdge:"left",endEdge:"right",size:"width",direction:1}),hPe=k.forwardRef(et(function(t,a){const{min:r,max:c,dir:d,inverted:u,onSlideStart:h,onSlideMove:f,onSlideEnd:y,onStepKeyDown:x,...g}=t,[b,M]=k.useState(null),_=Ee(a,M),S=k.useRef(void 0),C=Vl(d),L=C==="ltr",A=L&&!u||!L&&u;function j(E){const z=S.current||b.getBoundingClientRect(),R=[0,z.width],H=cj(R,A?[r,c]:[c,r]);return S.current=z,H(E-z.left)}return et(j,"getValueFromPointer"),m.jsx(YZ,{scope:t.__scopeSlider,startEdge:A?"left":"right",endEdge:A?"right":"left",direction:A?1:-1,size:"width",children:m.jsx(WZ,{dir:C,"data-orientation":"horizontal",...g,ref:_,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:E=>{const z=j(E.clientX);h?.(z)},onSlideMove:E=>{const z=j(E.clientX);f?.(z)},onSlideEnd:()=>{S.current=void 0,y?.()},onStepKeyDown:E=>{const R=ZZ[A?"from-left":"from-right"].includes(E.key);x?.({event:E,direction:R?-1:1})}})})},"SliderHorizontal")),pPe=k.forwardRef(et(function(t,a){const{min:r,max:c,inverted:d,onSlideStart:u,onSlideMove:h,onSlideEnd:f,onStepKeyDown:y,...x}=t,g=k.useRef(null),b=Ee(a,g),M=k.useRef(void 0),_=!d;function S(C){const L=M.current||g.current.getBoundingClientRect(),A=[0,L.height],E=cj(A,_?[c,r]:[r,c]);return M.current=L,E(C-L.top)}return et(S,"getValueFromPointer"),m.jsx(YZ,{scope:t.__scopeSlider,startEdge:_?"bottom":"top",endEdge:_?"top":"bottom",size:"height",direction:_?1:-1,children:m.jsx(WZ,{"data-orientation":"vertical",...x,ref:b,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const L=S(C.clientY);u?.(L)},onSlideMove:C=>{const L=S(C.clientY);h?.(L)},onSlideEnd:()=>{M.current=void 0,f?.()},onStepKeyDown:C=>{const A=ZZ[_?"from-bottom":"from-top"].includes(C.key);y?.({event:C,direction:A?-1:1})}})})},"SliderVertical")),WZ=k.forwardRef(et(function(t,a){const{__scopeSlider:r,onSlideStart:c,onSlideMove:d,onSlideEnd:u,onHomeKeyDown:h,onEndKeyDown:f,onStepKeyDown:y,...x}=t,g=f2(p2,r);return m.jsx(ge.span,{...x,ref:a,onKeyDown:fe(t.onKeyDown,b=>{b.key==="Home"?(h(b),b.preventDefault()):b.key==="End"?(f(b),b.preventDefault()):UZ.concat(GZ).includes(b.key)&&(y(b),b.preventDefault())}),onPointerDown:fe(t.onPointerDown,b=>{const M=b.target;M.setPointerCapture(b.pointerId),b.preventDefault(),g.thumbs.has(M)?M.focus({preventScroll:!0,focusVisible:!1}):c(b)}),onPointerMove:fe(t.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&d(b)}),onPointerUp:fe(t.onPointerUp,b=>{const M=b.target;M.hasPointerCapture(b.pointerId)&&(M.releasePointerCapture(b.pointerId),u(b))})})},"SliderImpl")),fPe="SliderTrack",yPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,...c}=t,d=f2(fPe,r);return m.jsx(ge.span,{"data-disabled":d.disabled?"":void 0,"data-orientation":d.orientation,...c,ref:a})},"SliderTrack")),PV="SliderRange",mPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,...c}=t,d=f2(PV,r),u=XZ(PV,r),h=k.useRef(null),f=Ee(a,h),y=d.values.length,x=d.values.map(M=>BD(M,d.min,d.max)),g=y>1?Math.min(...x):0,b=100-Math.max(...x);return m.jsx(ge.span,{"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,...c,ref:f,style:{...t.style,[u.startEdge]:g+"%",[u.endEdge]:b+"%"}})},"SliderRange")),kPe="SliderThumb",[gPe,KZ]=VD(kPe),vPe="SliderThumbProvider";function QZ(e){const{__scopeSlider:t,name:a,children:r,internal_do_not_use_render:c}=e,d=f2(vPe,t),u=sPe(t),[h,f]=k.useState(null),y=k.useMemo(()=>h?u().findIndex(C=>C.ref.current===h):-1,[u,h]),x=t2(h),g=h?!!d.form||!!h.closest("form"):!0,b=d.values[y],M=a??(d.name?d.name+(d.values.length>1?"[]":""):void 0),_=b===void 0?0:BD(b,d.min,d.max);k.useEffect(()=>{if(h)return d.thumbs.add(h),()=>{d.thumbs.delete(h)}},[h,d.thumbs]);const S={value:b,name:M,form:d.form,isFormControl:g,index:y,thumb:h,onThumbChange:f,percent:_,size:x};return m.jsx(gPe,{scope:t,...S,children:iY(c)?c(S):r})}et(QZ,"SliderThumbProvider");var oR="SliderThumbTrigger",xPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,...c}=t,d=f2(oR,r),u=XZ(oR,r),{index:h,value:f,percent:y,size:x,onThumbChange:g}=KZ(oR,r),b=Ee(a,g),M=eY(h,d.values.length),_=x?.[u.size],S=_?nY(_,y,u.direction):0;return m.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${y}% + ${S}px)`},children:m.jsx(ZR.ItemSlot,{scope:r,children:m.jsx(ge.span,{role:"slider","aria-label":t["aria-label"]||M,"aria-valuemin":d.min,"aria-valuenow":f,"aria-valuemax":d.max,"aria-orientation":d.orientation,"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,tabIndex:d.disabled?void 0:0,...c,ref:b,style:f===void 0?{display:"none"}:t.style,onFocus:fe(t.onFocus,()=>{d.valueIndexToChangeRef.current=h})})})})},"SliderThumbTrigger")),bPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,name:c,...d}=t;return m.jsx(QZ,{__scopeSlider:r,name:c,internal_do_not_use_render:({index:u,isFormControl:h})=>m.jsxs(m.Fragment,{children:[m.jsx(xPe,{...d,ref:a,__scopeSlider:r}),h?m.jsx(wPe,{__scopeSlider:r},u):null]})})},"SliderThumb")),MPe="SliderBubbleInput",wPe=k.forwardRef(et(function({__scopeSlider:t,...a},r){const{value:c,name:d,form:u}=KZ(MPe,t),h=k.useRef(null),f=Ee(h,r),y=jD(c);return k.useEffect(()=>{const x=h.current;if(!x)return;const g=window.HTMLInputElement.prototype,M=Object.getOwnPropertyDescriptor(g,"value").set;if(y!==c&&M){const _=new Event("input",{bubbles:!0});M.call(x,c),x.dispatchEvent(_)}},[y,c]),m.jsx(ge.input,{style:{display:"none"},name:d,form:u,...a,ref:f,defaultValue:c})},"SliderBubbleInput"));function JZ(e=[],t,a){const r=[...e];return r[a]=t,r.sort((c,d)=>c-d)}et(JZ,"getNextSortedValues");function BD(e,t,a){const d=100/(a-t)*(e-t);return Fu(d,[0,100])}et(BD,"convertValueToPercentage");function eY(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}et(eY,"getLabel");function tY(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)}et(tY,"getClosestValueIndex");function nY(e,t,a){const r=e/2,d=cj([0,50],[0,r]);return(r-d(t)*a)*a}et(nY,"getThumbInBoundsOffset");function aY(e){return e.slice(0,-1).map((t,a)=>e[a+1]-t)}et(aY,"getStepsBetweenValues");function oY(e,t){if(t>0){const a=aY(e);return Math.min(...a)>=t}return!0}et(oY,"hasMinStepsBetweenValues");function cj(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])}}et(cj,"linearScale");function FD(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[r,c]=t.split("e"),d=r.split(".")[1]||"",u=Number(c);return Math.max(0,d.length-u)}const a=t.split(".")[1];return a?a.length:0}et(FD,"getDecimalCount");function Iu(e,t){const a=Math.pow(10,t);return Math.round(e*a)/a}et(Iu,"roundValue");function rY(e,{min:t,step:a,direction:r,multiplier:c}){const d=FD(a),u=(e-t)/a,h=Math.round(u),f=Iu(h*a+t,d)===Iu(e,d);let y;return f?y=h+c*r:r>0?y=Math.ceil(u):y=Math.floor(u),Iu(y*a+t,d)}et(rY,"getNextStepValue");function iY(e){return typeof e=="function"}et(iY,"isFunction");function cY({className:e,defaultValue:t,value:a,min:r=0,max:c=100,id:d,...u}){const h=k.useMemo(()=>Array.isArray(a)?a:Array.isArray(t)?t:[r,c],[a,t,r,c]);return m.jsxs(uPe,{"data-slot":"slider",defaultValue:t,value:a,min:r,max:c,id:d,className:W("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:[m.jsx(yPe,{"data-slot":"slider-track",className:W("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:m.jsx(mPe,{"data-slot":"slider-range",className:W("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:h.length},(f,y)=>m.jsx(bPe,{"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"},y))]})}var _Pe=(e,t,a,r,c,d,u,h)=>{let f=document.documentElement,y=["light","dark"];function x(M){(Array.isArray(e)?e:[e]).forEach(_=>{let S=_==="class",C=S&&d?c.map(L=>d[L]||L):c;S?(f.classList.remove(...C),f.classList.add(d&&d[M]?d[M]:M)):f.setAttribute(_,M)}),g(M)}function g(M){h&&y.includes(M)&&(f.style.colorScheme=M)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)x(r);else try{let M=localStorage.getItem(t)||a,_=u&&M==="system"?b():M;x(_)}catch{}},SPe=k.createContext(void 0),CPe={setTheme:e=>{},themes:[]},LPe=()=>{var e;return(e=k.useContext(SPe))!=null?e:CPe};k.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:r,enableColorScheme:c,defaultTheme:d,value:u,themes:h,nonce:f,scriptProps:y})=>{let x=JSON.stringify([a,t,d,e,h,u,r,c]).slice(1,-1);return k.createElement("script",{...y,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${_Pe.toString()})(${x})`}})});function NPe(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 IPe=e=>{switch(e){case"success":return EPe;case"info":return RPe;case"warning":return PPe;case"error":return TPe;default:return null}},APe=Array(12).fill(0),jPe=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},APe.map((a,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),EPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),PPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),RPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),TPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),DPe=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zPe=()=>{const[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e};let $Pe=1;const qPe=100,RV=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:$Pe++};class OPe{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=RV(t),d=this.pendingDismissals.get(c);d!==void 0&&(cancelAnimationFrame(d),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(y=>y.id!==c)),(u?void 0:this.toasts.find(y=>y.id===c))?this.toasts=this.toasts.map(y=>y.id===c?(this.publish({...y,...t,id:c,title:a}),{...y,...t,id:c,dismissible:h,title:a}):y):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 d=r!==void 0,u;const h=c.then(async y=>{if(u=["resolve",y],ye.isValidElement(y))d=!1,this.create({id:r,type:"default",message:y});else if(VPe(y)&&!y.ok){d=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${y.status}`):a.error,b=typeof a.description=="function"?await a.description(`HTTP error! status: ${y.status}`):a.description,_=typeof g=="object"&&!ye.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:b,..._})}else if(y instanceof Error){d=!1;const g=typeof a.error=="function"?await a.error(y):a.error,b=typeof a.description=="function"?await a.description(y):a.description,_=typeof g=="object"&&!ye.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:b,..._})}else if(a.success!==void 0){d=!1;const g=typeof a.success=="function"?await a.success(y):a.success,b=typeof a.description=="function"?await a.description(y):a.description,_=typeof g=="object"&&!ye.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:b,..._})}}).catch(async y=>{if(u=["reject",y],a.error!==void 0){d=!1;const x=typeof a.error=="function"?await a.error(y):a.error,g=typeof a.description=="function"?await a.description(y):a.description,M=typeof x=="object"&&!ye.isValidElement(x)?x:{message:x};this.create({id:r,type:"error",description:g,...M})}}).finally(()=>{d&&(this.dismiss(r),r=void 0),a.finally==null||a.finally.call(a)}),f=()=>new Promise((y,x)=>h.then(()=>u[0]==="reject"?x(u[1]):y(u[1])).catch(x));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,a)=>{const r=RV(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 dn=new OPe,HPe=(e,t)=>dn.message(e,t),VPe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",BPe=HPe,FPe=()=>dn.toasts,UPe=()=>dn.getActiveToasts(),GPe=Object.assign(BPe,{success:dn.success,info:dn.info,warning:dn.warning,error:dn.error,custom:dn.custom,message:dn.message,promise:dn.promise,dismiss:dn.dismiss,loading:dn.loading},{getHistory:FPe,getToasts:UPe});NPe("[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 F0(e){return e.label!==void 0}const ZPe=3,YPe="24px",XPe="16px",TV=4e3,WPe=356,KPe=14,QPe=45,JPe=200;function Ra(...e){return e.filter(Boolean).join(" ")}function eRe(e){const[t,a]=e.split("-"),r=[];return t&&r.push(t),a&&r.push(a),r}const tRe=e=>{var t,a,r,c,d,u,h,f,y;const{invert:x,toast:g,unstyled:b,interacting:M,setHeights:_,visibleToasts:S,heights:C,index:L,toasts:A,expanded:j,removeToast:E,defaultRichColors:z,closeButton:R,style:$,cancelButtonStyle:H,actionButtonStyle:K,className:ae="",descriptionClassName:Y="",duration:G,position:J,gap:oe,expandByDefault:he,classNames:N,icons:P,closeButtonAriaLabel:O="Close toast"}=e,[te,B]=ye.useState(null),[D,T]=ye.useState(null),[U,X]=ye.useState(!1),[Z,ce]=ye.useState(!1),[pe,ie]=ye.useState(!1),[se,_e]=ye.useState(!1),[ve,Ne]=ye.useState(!1),[Re,qe]=ye.useState(0),[xe,Ae]=ye.useState(0),vt=ye.useRef(g.duration||G||TV),ke=ye.useRef(null),Te=ye.useRef(null),Le=L===0,ct=L+1<=S,Ke=g.type,nn=Ke??"default",nt=g.dismissible!==!1,ua=g.className||"",xt=g.descriptionClassName||"",Mn=ye.useMemo(()=>C.findIndex(Pe=>Pe.toastId===g.id)||0,[C,g.id]),jo=ye.useMemo(()=>{var Pe;return(Pe=g.closeButton)!=null?Pe:R},[g.closeButton,R]),Eo=ye.useMemo(()=>g.duration||G||TV,[g.duration,G]),La=ye.useRef(0),Po=ye.useRef(0),m2=ye.useRef(0),Kn=ye.useRef(null),[an,Na]=J.split("-"),Qt=ye.useMemo(()=>C.reduce((Pe,wt,Lt)=>Lt>=Mn?Pe:Pe+wt.height,0),[C,Mn]),k2=zPe(),Qn=ye.useMemo(()=>{var Pe;return(Pe=e.swipeDirections)!=null?Pe:eRe(J)},[e.swipeDirections,J]),sj=g.invert||x,Ro=Ke==="loading";Po.current=ye.useMemo(()=>Mn*oe+Qt,[Mn,Qt]),ye.useEffect(()=>{vt.current=Eo},[Eo]),ye.useEffect(()=>{X(!0)},[]),ye.useEffect(()=>{const Pe=Te.current;if(Pe){const wt=Pe.getBoundingClientRect().height;return Ae(wt),_(Lt=>[{toastId:g.id,height:wt,position:g.position},...Lt]),()=>_(Lt=>Lt.filter(Nt=>Nt.toastId!==g.id))}},[_,g.id]),ye.useLayoutEffect(()=>{if(!U)return;const Pe=Te.current,wt=Pe.style.height;Pe.style.height="auto";const Lt=Pe.getBoundingClientRect().height;Pe.style.height=wt,Ae(Lt),_(Nt=>Nt.find(It=>It.toastId===g.id)?Nt.map(It=>It.toastId===g.id?{...It,height:Lt}:It):[{toastId:g.id,height:Lt,position:g.position},...Nt])},[U,g.title,g.description,_,g.id,g.jsx,g.action,g.cancel]);const $n=ye.useCallback(()=>{ce(!0),qe(Po.current),_(Pe=>Pe.filter(wt=>wt.toastId!==g.id)),setTimeout(()=>{E(g)},JPe)},[g,E,_,Po]);ye.useEffect(()=>{if(g.promise&&Ke==="loading"||g.duration===1/0||g.type==="loading")return;let Pe;return j||M||k2?(()=>{if(m2.current<La.current){const Nt=new Date().getTime()-La.current;vt.current=vt.current-Nt}m2.current=new Date().getTime()})():vt.current!==1/0&&(La.current=new Date().getTime(),Pe=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),$n()},vt.current)),()=>clearTimeout(Pe)},[j,M,g,Ke,k2,$n]),ye.useEffect(()=>{g.delete&&($n(),g.onDismiss==null||g.onDismiss.call(g,g))},[$n,g.delete]);function Nr(){var Pe;if(P?.loading){var wt;return ye.createElement("div",{className:Ra(N?.loader,g==null||(wt=g.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":Ke==="loading"},P.loading)}return ye.createElement(jPe,{className:Ra(N?.loader,g==null||(Pe=g.classNames)==null?void 0:Pe.loader),visible:Ke==="loading"})}const Xa=g.icon||P?.[Ke]||IPe(Ke);var Ir,To;return ye.createElement("li",{tabIndex:0,ref:Te,className:Ra(ae,ua,N?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,N?.[nn],g==null||(a=g.classNames)==null?void 0:a[nn]),"data-sonner-toast":"","data-rich-colors":(Ir=g.richColors)!=null?Ir:z,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":U,"data-promise":!!g.promise,"data-swiped":ve,"data-removed":Z,"data-visible":ct,"data-y-position":an,"data-x-position":Na,"data-index":L,"data-front":Le,"data-swiping":pe,"data-dismissible":nt,"data-type":Ke,"data-invert":sj,"data-swipe-out":se,"data-swipe-direction":D,"data-expanded":!!(j||he&&U),"data-testid":g.testId,style:{"--index":L,"--toasts-before":L,"--z-index":A.length-L,"--offset":`${Z?Re:Po.current}px`,"--initial-height":he?"auto":`${xe}px`,...$,...g.style},onDragEnd:()=>{ie(!1),B(null),Kn.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Ro||!nt||(ke.current=new Date,qe(Po.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ie(!0),Kn.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,wt,Lt;if(se||!nt)return;Kn.current=null;const Nt=Number(((Pe=Te.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ar=Number(((wt=Te.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),It=new Date().getTime()-((Lt=ke.current)==null?void 0:Lt.getTime()),on=te==="x"?Nt:Ar,qn=Math.abs(on)/It;if((te==="x"?Qn.includes(Nt>0?"right":"left"):Qn.includes(Ar>0?"bottom":"top"))&&(Math.abs(on)>=QPe||qn>.11)){qe(Po.current),g.onDismiss==null||g.onDismiss.call(g,g),T(te==="x"?Nt>0?"right":"left":Ar>0?"down":"up"),$n(),_e(!0);return}else{var wn,Yl;(wn=Te.current)==null||wn.style.setProperty("--swipe-amount-x","0px"),(Yl=Te.current)==null||Yl.style.setProperty("--swipe-amount-y","0px")}Ne(!1),ie(!1),B(null)},onPointerMove:Pe=>{var wt,Lt,Nt;if(!Kn.current||!nt||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;const It=Pe.clientY-Kn.current.y,on=Pe.clientX-Kn.current.x;!te&&(Math.abs(on)>1||Math.abs(It)>1)&&B(Math.abs(on)>Math.abs(It)?"x":"y");let qn={x:0,y:0};const jr=wn=>1/(1.5+Math.abs(wn)/20);if(te==="y"){if(Qn.includes("top")||Qn.includes("bottom"))if(Qn.includes("top")&&It<0||Qn.includes("bottom")&&It>0)qn.y=It;else{const wn=It*jr(It);qn.y=Math.abs(wn)<Math.abs(It)?wn:It}}else if(te==="x"&&(Qn.includes("left")||Qn.includes("right")))if(Qn.includes("left")&&on<0||Qn.includes("right")&&on>0)qn.x=on;else{const wn=on*jr(on);qn.x=Math.abs(wn)<Math.abs(on)?wn:on}(Math.abs(qn.x)>0||Math.abs(qn.y)>0)&&Ne(!0),(Lt=Te.current)==null||Lt.style.setProperty("--swipe-amount-x",`${qn.x}px`),(Nt=Te.current)==null||Nt.style.setProperty("--swipe-amount-y",`${qn.y}px`)}},jo&&!g.jsx&&Ke!=="loading"?ye.createElement("button",{"aria-label":O,"data-disabled":Ro,"data-close-button":!0,onClick:Ro||!nt?()=>{}:()=>{$n(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Ra(N?.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(To=P?.close)!=null?To:DPe):null,(Ke||g.icon||g.promise)&&g.icon!==null&&(P?.[Ke]!==null||g.icon)?ye.createElement("div",{"data-icon":"",className:Ra(N?.icon,g==null||(c=g.classNames)==null?void 0:c.icon)},Ke==="loading"?g.icon||Nr():g.promise?Nr():null,Ke!=="loading"?Xa:null):null,ye.createElement("div",{"data-content":"",className:Ra(N?.content,g==null||(d=g.classNames)==null?void 0:d.content)},ye.createElement("div",{"data-title":"",className:Ra(N?.title,g==null||(u=g.classNames)==null?void 0:u.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ye.createElement("div",{"data-description":"",className:Ra(Y,xt,N?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),ye.isValidElement(g.cancel)?g.cancel:g.cancel&&F0(g.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||H,onClick:Pe=>{F0(g.cancel)&&nt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Pe),$n())},className:Ra(N?.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,ye.isValidElement(g.action)?g.action:g.action&&F0(g.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||K,onClick:Pe=>{F0(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Pe),!Pe.defaultPrevented&&$n())},className:Ra(N?.actionButton,g==null||(y=g.classNames)==null?void 0:y.actionButton)},g.action.label):null)};function DV(){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 nRe(e,t){const a={};return[e,t].forEach((r,c)=>{const d=c===1,u=d?"--mobile-offset":"--offset",h=d?XPe:YPe;function f(y){["top","right","bottom","left"].forEach(x=>{a[`${u}-${x}`]=typeof y=="number"?`${y}px`:y})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(y=>{r[y]===void 0?a[`${u}-${y}`]=h:a[`${u}-${y}`]=typeof r[y]=="number"?`${r[y]}px`:r[y]}):f(h)}),a}function aRe(){const[e,t]=ye.useState([]);return ye.useEffect(()=>dn.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(d=>d.id===a.id);return c!==-1?[...r.slice(0,c),{...r[c],...a},...r.slice(c+1)]:[a,...r]})})})}),[]),{toasts:e}}const sY=ye.forwardRef(function(t,a){const{id:r,invert:c,position:d="bottom-right",hotkey:u=["altKey","KeyT"],expand:h,closeButton:f,className:y,offset:x,mobileOffset:g,theme:b="light",richColors:M,duration:_,style:S,visibleToasts:C=ZPe,toastOptions:L,dir:A=DV(),gap:j=KPe,icons:E,customAriaLabel:z,containerAriaLabel:R="Notifications"}=t,[$,H]=ye.useState([]),K=ye.useMemo(()=>r?$.filter(X=>X.toasterId===r):$.filter(X=>!X.toasterId),[$,r]),ae=ye.useMemo(()=>Array.from(new Set([d].concat(K.filter(X=>X.position).map(X=>X.position)))),[K,d]),[Y,G]=ye.useState([]),[J,oe]=ye.useState(!1),[he,N]=ye.useState(!1),[P,O]=ye.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=ye.useRef(null),B=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=ye.useRef(null),T=ye.useRef(!1),U=ye.useCallback(X=>{H(Z=>{var ce;return(ce=Z.find(pe=>pe.id===X.id))!=null&&ce.delete||dn.dismiss(X.id),Z.filter(({id:pe})=>pe!==X.id)})},[]);return ye.useEffect(()=>dn.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{H(Z=>Z.map(ce=>ce.id===X.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{pA.flushSync(()=>{H(Z=>{const ce=Z.findIndex(pe=>pe.id===X.id);return ce!==-1?[...Z.slice(0,ce),{...Z[ce],...X},...Z.slice(ce+1)]:[X,...Z]})})})}),[]),ye.useEffect(()=>{if(b!=="system"){O(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Z})=>{O(Z?"dark":"light")})}catch{X.addListener(({matches:ce})=>{try{O(ce?"dark":"light")}catch(pe){console.error(pe)}})}},[b]),ye.useEffect(()=>{$.length<=1&&oe(!1)},[$]),ye.useEffect(()=>{const X=Z=>{var ce;if(u.length>0&&u.every(se=>Z[se]||Z.code===se)){var ie;oe(!0),(ie=te.current)==null||ie.focus()}Z.code==="Escape"&&(document.activeElement===te.current||(ce=te.current)!=null&&ce.contains(document.activeElement))&&oe(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[u]),ye.useEffect(()=>{if(te.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,T.current=!1)}},[te.current]),ye.createElement("section",{ref:a,"aria-label":z??`${R} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},ae.map((X,Z)=>{var ce;const[pe,ie]=X.split("-");return K.length?ye.createElement("ol",{key:X,dir:A==="auto"?DV():A,tabIndex:-1,ref:te,className:y,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":pe,"data-x-position":ie,style:{"--front-toast-height":`${((ce=Y[0])==null?void 0:ce.height)||0}px`,"--width":`${WPe}px`,"--gap":`${j}px`,...S,...nRe(x,g)},onBlur:se=>{T.current&&!se.currentTarget.contains(se.relatedTarget)&&(T.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||T.current||(T.current=!0,D.current=se.relatedTarget)},onMouseEnter:()=>oe(!0),onMouseMove:()=>oe(!0),onMouseLeave:()=>{he||oe(!1)},onDragEnd:()=>oe(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||N(!0)},onPointerUp:()=>N(!1)},K.filter(se=>!se.position&&Z===0||se.position===X).map((se,_e)=>{var ve,Ne;return ye.createElement(tRe,{key:se.id,icons:E,index:_e,toast:se,defaultRichColors:M,duration:(ve=L?.duration)!=null?ve:_,className:L?.className,descriptionClassName:L?.descriptionClassName,invert:c,visibleToasts:C,closeButton:(Ne=L?.closeButton)!=null?Ne:f,interacting:he,position:X,style:L?.style,unstyled:L?.unstyled,classNames:L?.classNames,cancelButtonStyle:L?.cancelButtonStyle,actionButtonStyle:L?.actionButtonStyle,closeButtonAriaLabel:L?.closeButtonAriaLabel,removeToast:U,toasts:K.filter(Re=>Re.position==se.position),heights:Y.filter(Re=>Re.position==se.position),setHeights:G,expandByDefault:h,gap:j,expanded:J,swipeDirections:t.swipeDirections})})):null}))}),oRe=Object.freeze(Object.defineProperty({__proto__:null,Toaster:sY,toast:GPe,useSonner:aRe},Symbol.toStringTag,{value:"Module"})),rRe=({...e})=>{const{theme:t="system"}=LPe();return m.jsx(sY,{theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})};var iRe=Object.defineProperty,br=(e,t)=>iRe(e,"name",{value:t,configurable:!0}),UD="Switch",[cRe,VTe]=qt(UD),[sRe,GD]=cRe(UD);function lY(e){const{__scopeSwitch:t,checked:a,children:r,defaultChecked:c,disabled:d,form:u,name:h,onCheckedChange:f,required:y,value:x="on",internal_do_not_use_render:g}=e,[b,M]=Ut({prop:a,defaultProp:c??!1,onChange:f,caller:UD}),[_,S]=k.useState(null),[C,L]=k.useState(null),A=k.useRef(!1),[j,E]=k.useReducer($=>$+1,0),z=_?!!u||!!_.closest("form"):!0,R={checked:b,setChecked:M,disabled:d,control:_,setControl:S,name:h,form:u,value:x,hasConsumerStoppedPropagationRef:A,userInteractionCount:j,onUserInteraction:E,required:y,defaultChecked:c,isFormControl:z,bubbleInput:C,setBubbleInput:L};return m.jsx(sRe,{scope:t,...R,children:dY(g)?g(R):r})}br(lY,"SwitchProvider");var lRe="SwitchTrigger",dRe=k.forwardRef(br(function({__scopeSwitch:t,onClick:a,...r},c){const{control:d,form:u,value:h,disabled:f,checked:y,required:x,setControl:g,setChecked:b,hasConsumerStoppedPropagationRef:M,onUserInteraction:_,isFormControl:S,bubbleInput:C}=GD(lRe,t),L=Ee(c,g),A=k.useRef(y);return k.useEffect(()=>{const j=u?d?.ownerDocument.getElementById(u):d?.form;if(j instanceof HTMLFormElement){const E=br(()=>b(A.current),"reset");return j.addEventListener("reset",E),()=>j.removeEventListener("reset",E)}},[d,u,b]),m.jsx(ge.button,{type:"button",role:"switch","aria-checked":y,"aria-required":x,"data-state":ZD(y),"data-disabled":f?"":void 0,disabled:f,value:h,...r,ref:L,onClick:fe(a,j=>{_(),b(E=>!E),C&&S&&(M.current=j.isPropagationStopped(),M.current||j.stopPropagation())})})},"SwitchTrigger")),uRe=k.forwardRef(br(function(t,a){const{__scopeSwitch:r,name:c,checked:d,defaultChecked:u,required:h,disabled:f,value:y,onCheckedChange:x,form:g,...b}=t;return m.jsx(lY,{__scopeSwitch:r,checked:d,defaultChecked:u,disabled:f,required:h,onCheckedChange:x,name:c,form:g,value:y,internal_do_not_use_render:({isFormControl:M})=>m.jsxs(m.Fragment,{children:[m.jsx(dRe,{...b,ref:a,__scopeSwitch:r}),M&&m.jsx(yRe,{__scopeSwitch:r})]})})},"Switch")),hRe="SwitchThumb",pRe=k.forwardRef(br(function(t,a){const{__scopeSwitch:r,...c}=t,d=GD(hRe,r);return m.jsx(ge.span,{"data-state":ZD(d.checked),"data-disabled":d.disabled?"":void 0,...c,ref:a})},"SwitchThumb")),fRe="SwitchBubbleInput",yRe=k.forwardRef(br(function({__scopeSwitch:t,onClick:a,...r},c){const{control:d,hasConsumerStoppedPropagationRef:u,userInteractionCount:h,checked:f,defaultChecked:y,required:x,disabled:g,name:b,value:M,form:_,bubbleInput:S,setBubbleInput:C}=GD(fRe,t),L=Ee(c,C),A=t2(d),j=k.useRef(!1),E=k.useRef(f),z=k.useRef(h);k.useEffect(()=>{const $=S;if(!$)return;const H=window.HTMLInputElement.prototype,ae=Object.getOwnPropertyDescriptor(H,"checked").set,Y=h!==z.current;z.current=h;const G=E.current!==f;E.current=f;const J=!(Y&&u.current);if(G&&ae){j.current=!Y;const oe=new Event("click",{bubbles:J});ae.call($,f),$.dispatchEvent(oe),j.current=!1}},[S,f,u,h]);const R=k.useRef(f);return m.jsx(ge.input,{type:"checkbox","aria-hidden":!0,defaultChecked:y??R.current,required:x,disabled:g,name:b,value:M,form:_,...r,tabIndex:-1,ref:L,onClick:fe(a,$=>{j.current&&$.stopPropagation()}),style:{...r.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function dY(e){return typeof e=="function"}br(dY,"isFunction");function ZD(e){return e?"checked":"unchecked"}br(ZD,"getState");function mRe({className:e,...t}){return m.jsx(uRe,{"data-slot":"switch",className:W("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:m.jsx(pRe,{"data-slot":"switch-thumb",className:W("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 kRe=Object.defineProperty,ud=(e,t)=>kRe(e,"name",{value:t,configurable:!0}),YD="Tabs",[gRe,BTe]=qt(YD,[dd]),uY=dd(),[vRe,XD]=gRe(YD),xRe=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,value:c,onValueChange:d,defaultValue:u,orientation:h="horizontal",dir:f,activationMode:y="automatic",...x}=t,g=Vl(f),[b,M]=Ut({prop:c,onChange:d,defaultProp:u??"",caller:YD});return m.jsx(vRe,{scope:r,baseId:kt(),value:b,onValueChange:M,orientation:h,dir:g,activationMode:y,children:m.jsx(ge.div,{dir:g,"data-orientation":h,...x,ref:a})})},"Tabs")),bRe="TabsList",MRe=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,loop:c=!0,...d}=t,u=XD(bRe,r),h=uY(r);return m.jsx(eD,{asChild:!0,...h,orientation:u.orientation,dir:u.dir,loop:c,children:m.jsx(ge.div,{role:"tablist","aria-orientation":u.orientation,...d,ref:a})})},"TabsList")),wRe="TabsTrigger",_Re=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,value:c,disabled:d=!1,...u}=t,h=XD(wRe,r),f=uY(r),y=WD(h.baseId,c),x=KD(h.baseId,c),g=c===h.value;return m.jsx(tD,{asChild:!0,...f,focusable:!d,active:g,children:m.jsx(ge.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":x,"data-state":g?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:y,...u,ref:a,onMouseDown:fe(t.onMouseDown,b=>{!d&&b.button===0&&b.ctrlKey===!1?h.onValueChange(c):b.preventDefault()}),onKeyDown:fe(t.onKeyDown,b=>{d||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&h.onValueChange(c)}),onFocus:fe(t.onFocus,()=>{const b=h.activationMode!=="manual";!g&&!d&&b&&h.onValueChange(c)})})})},"TabsTrigger")),SRe="TabsContent",CRe=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,value:c,forceMount:d,children:u,...h}=t,f=XD(SRe,r),y=WD(f.baseId,c),x=KD(f.baseId,c),g=c===f.value,b=k.useRef(g);return k.useEffect(()=>{const M=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(M)},[]),m.jsx(kn,{present:d||g,children:({present:M})=>m.jsx(ge.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":y,hidden:!M,id:x,tabIndex:0,...h,ref:a,style:{...t.style,animationDuration:b.current?"0s":void 0},children:M&&u})})},"TabsContent"));function WD(e,t){return`${e}-trigger-${t}`}ud(WD,"makeTriggerId");function KD(e,t){return`${e}-content-${t}`}ud(KD,"makeContentId");var LRe=xRe,NRe=MRe,IRe=_Re,ARe=CRe;function jRe({className:e,...t}){return m.jsx(LRe,{"data-slot":"tabs",className:W("flex flex-col gap-2",e),...t})}function ERe({className:e,...t}){return m.jsx(NRe,{"data-slot":"tabs-list",className:W("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function PRe({className:e,...t}){return m.jsx(IRe,{"data-slot":"tabs-trigger",className:W("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 RRe({className:e,...t}){return m.jsx(ARe,{"data-slot":"tabs-content",className:W("flex-1 outline-none",e),...t})}function hY({className:e,wrapperHeight:t,ref:a,...r}){return m.jsx("div",{"data-slot":"table-container",ref:a,className:W("relative w-full overflow-x-auto",t),children:m.jsx("table",{"data-slot":"table",className:W("w-full caption-bottom text-sm",e),...r})})}function pY({className:e,...t}){return m.jsx("thead",{"data-slot":"table-header",className:W("[&_tr]:border-b",e),...t})}function fY({className:e,...t}){return m.jsx("tbody",{"data-slot":"table-body",className:W("[&_tr:last-child]:border-0",e),...t})}function TRe({className:e,...t}){return m.jsx("tfoot",{"data-slot":"table-footer",className:W("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ku({className:e,...t}){return m.jsx("tr",{"data-slot":"table-row",className:W("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function B1({className:e,...t}){return m.jsx("th",{"data-slot":"table-head",className:W("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 dr({className:e,...t}){return m.jsx("td",{"data-slot":"table-cell",className:W("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function DRe({className:e,...t}){return m.jsx("caption",{"data-slot":"table-caption",className:W("text-muted-foreground mt-4 text-sm",e),...t})}function yY({className:e,...t}){return m.jsx("textarea",{"data-slot":"textarea",className:W("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 rR=new Map;function zRe(e){if(!e)return Promise.resolve();const t=new URL(e,window.location.href).href;if(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(d=>d.href===t))return Promise.resolve();const r=rR.get(t);if(r)return r;const c=new Promise((d,u)=>{const h=document.createElement("link");h.rel="stylesheet",h.href=t,h.onload=()=>d(),h.onerror=()=>{rR.delete(t),u(new Error(`Failed to load control stylesheet: ${t}`))},document.head.appendChild(h)});return rR.set(t,c),c}async function mY(e,t){const a=zRe(t).catch(c=>{console.error(c)}),r=await import(e);return await a,r}function QD(e,t,a="default"){return function(c){const[d,u]=k.useState(null);return k.useEffect(()=>{let h=!0;return mY(e(),t()).then(f=>{const y=a==="Component"?f.Component:f.default;if(!y)throw new Error(`Control module does not export "${a}"`);h&&u(()=>y)}),()=>{h=!1}},[]),d?k.createElement(d,c):null}}const $Re=e=>`${window.routePrefix}/assets/controls/${e}.es.js`,qRe=e=>`${window.routePrefix}/assets/controls/${e}.css`;function nd(e){return{modulePath:$Re(e),cssPath:qRe(e)}}const zV=QD(()=>nd("jsoneditor").modulePath,()=>nd("jsoneditor").cssPath,"Component"),ORe=QD(()=>nd("handsontable").modulePath,()=>nd("handsontable").cssPath,"Component"),HRe=QD(()=>nd("monaco").modulePath,()=>nd("monaco").cssPath,"Component");function y2(e){const a=Xu().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 iR=AA("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"}}),JD=k.forwardRef(({options:e,onValueChange:t,variant:a,processing:r,disabled:c,defaultValue:d=[],placeholder:u="",notFound:h="",search:f="",animation:y=0,maxCount:x=3,modalPopover:g=!1,asChild:b=!1,className:M,mode:_="multiple",onOpenItem:S,onAddNew:C,...L},A)=>{const{t:j}=y2(),[E,z]=k.useState(d),[R,$]=k.useState(!1),[H,K]=k.useState(!1);k.useEffect(()=>{d&&z(d)},[d]);const ae=N=>{if(N.key==="Enter")$(!0);else if(N.key==="Backspace"&&!N.currentTarget.value){const P=[...E];P.pop(),z(P),t(P)}},Y=N=>{let P;_==="single"?P=E.includes(N)?[]:[N]:P=E.includes(N)?E.filter(O=>O!==N):[...E,N],z(P),t(P),_==="single"&&$(!1)},G=()=>{z([]),t([])},J=()=>{$(N=>!N)},oe=()=>{const N=E.slice(0,x);z(N),t(N)},he=()=>C?m.jsxs("div",{role:"button",className:W("m-1 cursor-pointer",H?"animate-bounce":"",iR({variant:a})),style:{animationDuration:`${y}s`},onClick:N=>{N.stopPropagation(),C()},children:[m.jsx(Y1,{className:"mr-1 h-3.5 w-3.5"}),m.jsx("span",{children:j("Add")})]}):null;return m.jsxs(hZ,{open:R,onOpenChange:$,modal:g,children:[m.jsx(pZ,{asChild:!0,children:m.jsx(tn,{ref:A,...L,onClick:J,disabled:c,className:W("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:E.length>0?m.jsxs("div",{className:"flex justify-between items-center w-full",children:[m.jsxs("div",{className:"flex flex-wrap items-center",children:[E.slice(0,x).map(N=>{const P=e.find(te=>te.value===N),O=P?.icon;return m.jsxs("div",{className:W(H?"animate-bounce":"",iR({variant:a})),style:{animationDuration:`${y}s`},children:[O&&m.jsx(O,{className:"h-4 w-4 mr-2"}),P?.label,S&&m.jsx(wu,{className:"ml-2 h-4 w-4 cursor-pointer text-muted-foreground hover:text-foreground",onClick:te=>{te.stopPropagation(),S(N)}}),m.jsx(vo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:te=>{te.stopPropagation(),r||Y(N)}})]},N)}),_==="multiple"&&E.length>x&&m.jsxs("div",{className:W("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",H?"animate-bounce":"",iR({variant:a})),style:{animationDuration:`${y}s`},children:[`+ ${E.length-x} more`,m.jsx(vo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:N=>{N.stopPropagation(),oe()}})]}),he()]}),m.jsxs("div",{className:"flex items-center justify-between",children:[E.length>0&&m.jsxs(m.Fragment,{children:[m.jsx(yr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:N=>{N.stopPropagation(),G()}}),m.jsx(DD,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),m.jsx(fr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):m.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[m.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:u}),m.jsxs("div",{className:"flex items-center",children:[he(),m.jsx(fr,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})]})})}),m.jsx(fZ,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>$(!1),children:m.jsxs(FT,{children:[m.jsx(JU,{placeholder:f,onKeyDown:ae}),m.jsxs(eG,{children:[m.jsx(tG,{children:h}),m.jsx(nG,{children:e.map(N=>{const P=E.includes(N.value);return m.jsxs(oG,{onSelect:()=>Y(N.value),className:"cursor-pointer",children:[m.jsx("div",{className:W("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",P?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:m.jsx(Fa,{className:"h-4 w-4 text-primary-foreground"})}),N.icon&&m.jsx(N.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),m.jsx("span",{children:N.label})]},N.value)})}),m.jsx(aG,{})]})]})}),y>0&&E.length>0&&_==="multiple"&&m.jsx(pr,{className:W("cursor-pointer my-2 text-foreground bg-background w-3 h-3",H?"":"text-muted-foreground"),onClick:()=>K(!H)})]})});JD.displayName="MultiSelect";const kY={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},gY=e=>({...e??{},_ts:Date.now()}),VRe=e=>{if(e==="")return"";try{return JSON.parse(e)}catch{return e}},$V=e=>{if(typeof e!="string")return!1;const t=e.trim().toLowerCase();return t.startsWith("<!doctype html")||t.startsWith("<html")||t.startsWith("<")},BRe=e=>{const t={};return e.forEach((a,r)=>{t[r.toLowerCase()]=a}),t},FRe=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},URe=(e,t)=>{const a=new URL(e,window.location.origin);return Object.entries(gY(t)).forEach(([r,c])=>{if(c!=null){if(Array.isArray(c)){c.forEach(d=>a.searchParams.append(r,String(d)));return}a.searchParams.set(r,String(c))}}),`${a.pathname}${a.search}${a.hash}`},GRe=async(e,t,a,r)=>{const c=FRe("XSRF-TOKEN"),d=new Headers(kY);d.set("X-Requested-With","XMLHttpRequest"),c&&d.set("x-xsrf-token",c),Object.entries(r?.headers??{}).forEach(([g,b])=>{b!=null&&d.set(g,String(b))});let u;a instanceof FormData?u=a:a!=null&&(u=typeof a=="string"?a:JSON.stringify(a),d.has("Content-Type")||d.set("Content-Type","application/json"));const h=await fetch(URe(t,r?.params),{method:e.toUpperCase(),body:u,headers:d,credentials:"same-origin",signal:r?.signal}),f=BRe(h.headers);let y;switch(r?.responseType){case"arraybuffer":y=await h.arrayBuffer();break;case"document":{const g=await h.text(),b=new DOMParser,M=f["content-type"]?.includes("xml")?"application/xml":"text/html";y=b.parseFromString(g,M);break}default:y=await h.blob();break}const x={data:y,status:h.status,headers:f};if(!h.ok){const g=new Error(`Request failed with status ${h.status}`);throw g.response=x,g}return x},F1=async(e,t,a,r)=>{if(r?.responseType&&r.responseType!=="json"&&r.responseType!=="text")return GRe(e,t,a,r);const c=await Zu.getClient().request({method:e,url:t,data:a,params:gY(r?.params),headers:{...kY,...r?.headers??{}},signal:r?.signal});return{data:VRe(c.data),status:c.status,headers:c.headers}},uu=async(e,t,a,r)=>{try{const c=await F1(e,t,a,r),d=String(c.headers?.["content-type"]??"").toLowerCase();if(d&&!d.includes("application/json")||$V(c.data))throw new Error(`Expected JSON response from "${t}", but received "${d||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return c}catch(c){const d=c,u=String(d.response?.headers?.["content-type"]??"").toLowerCase();throw $V(d.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}},Oa={get:(e,t)=>F1("get",e,void 0,t),post:(e,t,a)=>F1("post",e,t,a),put:(e,t,a)=>F1("put",e,t,a),patch:(e,t,a)=>F1("patch",e,t,a),delete:(e,t,a)=>F1("delete",e,t,a),getJson:(e,t)=>uu("get",e,void 0,t),postJson:(e,t,a)=>uu("post",e,t,a),putJson:(e,t,a)=>uu("put",e,t,a),patchJson:(e,t,a)=>uu("patch",e,t,a),deleteJson:(e,t,a)=>uu("delete",e,t,a)},ZRe="axios-compat is a legacy compatibility API. Please use adminApi from @/lib/admin-api instead.",U1=()=>{console.log(ZRe)};U1();const hu=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},YRe={async get(e,t){U1();try{return await Oa.get(e,t)}catch(a){throw hu(a)}},async post(e,t,a){U1();try{return await Oa.post(e,t,a)}catch(r){throw hu(r)}},async put(e,t,a){U1();try{return await Oa.put(e,t,a)}catch(r){throw hu(r)}},async patch(e,t,a){U1();try{return await Oa.patch(e,t,a)}catch(r){throw hu(r)}},async delete(e,t){U1();try{return await Oa.delete(e,t?.data,t)}catch(a){throw hu(a)}},isAxiosError(e){return!!(e&&typeof e=="object"&&"isAxiosError"in e)}};function CA({iconNode:e,className:t,...a}){return m.jsx(e,{className:W("h-4 w-4",t),...a})}const vY=k.forwardRef(({btnTitle:e,link:t,delModal:a,handleDelete:r,variant:c,btnCLass:d,isLink:u=!0},h)=>{const{t:f}=y2();return m.jsxs(qA,{children:[m.jsx(YU,{asChild:!0,children:m.jsxs(tn,{ref:h,size:"list",variant:c??"ghost",className:W("cursor-pointer",d),children:[m.jsx(CA,{iconNode:Nu}),e]})}),m.jsxs(OA,{className:"sm:max-w-[425px] z-[1011]",children:[m.jsxs(HA,{children:[m.jsx(VA,{children:f("Delete")}),m.jsx("div",{className:"mt-2 text-base",children:a.text})]}),m.jsxs(KU,{children:[m.jsx(DR,{asChild:!0,children:u?m.jsx(tn,{variant:"destructive",asChild:!0,children:m.jsx(fA,{href:t??"#",children:a.yes})}):m.jsx(tn,{variant:"destructive",asChild:!0,onClick:r,children:m.jsx("span",{children:a.yes})})}),m.jsx(DR,{asChild:!0,children:m.jsx(tn,{type:"button",variant:"secondary",children:a.no})})]})]})]})});vY.displayName="DeleteModal";function pu({moduleComponent:e,cssPath:t,options:a,initialValue:r,onChange:c,name:d,disabled:u}){const[h,f]=k.useState(null);return k.useEffect(()=>{let y=!0;const x=async()=>{const g=await mY(e,t);y&&f(()=>g.default)};return f(null),x(),()=>{y=!1}},[e,t]),h?m.jsx(h,{initialValue:r,options:a,onChange:c,name:d,disabled:u}):null}const XRe=m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",children:m.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"})}),WRe="_Wrapper_18nsw_1",KRe="_active_18nsw_7",QRe="_Page_18nsw_8",JRe="_clone_18nsw_18",eTe="_Remove_18nsw_29",tTe="_insertBefore_18nsw_35",nTe="_insertAfter_18nsw_36",aTe="_vertical_18nsw_44",lr={Wrapper:WRe,active:KRe,Page:QRe,clone:JRe,Remove:eTe,insertBefore:tTe,insertAfter:nTe,vertical:aTe};var oTe=(e=>(e[e.Before=-1]="Before",e[e.After=1]="After",e))(oTe||{}),xY=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e.Grid="grid",e))(xY||{});const FTe=k.forwardRef(function({id:t,index:a,active:r,clone:c,insertPosition:d,layout:u,onRemove:h,style:f,url:y,mimeType:x,fileName:g,...b},M){const _=x?.startsWith("image/");return m.jsxs("li",{className:W(lr.Wrapper,r&&lr.active,c&&lr.clone,d===-1&&lr.insertBefore,d===1&&lr.insertAfter,u==="vertical"&&lr.vertical),style:f,ref:M,children:[m.jsxs("button",{className:`${lr.Page} after:bg-black dark:after:bg-gray-300`,"data-id":t.toString(),...b,children:[m.jsx("img",{src:y,alt:"",className:"absolute top-0 left-0 w-full h-full object-cover overflow-hidden rounded-[5px]"}),!_&&m.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:g})]}),!r&&h?m.jsx("button",{className:lr.Remove,onClick:h,children:XRe}):null]})}),bY=k.createContext(null),rTe=()=>k.useContext(bY),iTe=({entry:e,onSaved:t})=>e.loading||!e.props?m.jsx("div",{className:"flex items-center justify-center h-full w-full",children:m.jsx(va,{className:"h-6 w-6 animate-spin"})}):e.error?m.jsx("div",{className:"p-4 text-red-500",children:e.error}):m.jsx("div",{className:"h-full",children:m.jsx(wY,{page:{props:e.props},catalog:!0,callback:()=>t()})}),UTe=({children:e})=>{const t=k.useRef(null),[a,r]=k.useState([]),c=k.useRef(0),d=k.useCallback(async(g,b,M)=>{try{const _=M===null?`${window.routePrefix}/model/${b}/add?without_layout=true`:`${window.routePrefix}/model/${b}/edit/${M}?without_layout=true`,S=await Oa.get(_),C=S.data?.props??S.data;r(L=>{const A=[...L];return A[g]&&A[g].model===b&&A[g].id===M&&(A[g]={...A[g],loading:!1,props:C}),A})}catch(_){r(S=>{const C=[...S];return C[g]&&C[g].model===b&&C[g].id===M&&(C[g]={...C[g],loading:!1,error:_?.message||"Error"}),C})}},[]),u=k.useCallback((g,b)=>{r(M=>{const _=M.length,S={model:g,id:b,props:null,loading:!0};return d(_,g,b),[...M,S]})},[d]),h=k.useCallback(g=>{r(b=>{const M=b.length,_={model:g,id:null,props:null,loading:!0};return d(M,g,null),[...b,_]})},[d]);k.useEffect(()=>{const g=c.current,b=a.length;if(b>g)if(g===0)t.current?.open();else for(let M=0;M<b-g;M++)t.current?.next();c.current=b},[a.length]);const f=k.useCallback(g=>{g||(r([]),c.current=0)},[]),y=k.useCallback(()=>{r(g=>g.length<=1?(t.current?.close(),c.current=0,[]):(t.current?.prev(),c.current=g.length-1,g.slice(0,-1)))},[]),x=k.useMemo(()=>({open:u,openCreate:h}),[u,h]);return m.jsxs(bY.Provider,{value:x,children:[e,m.jsxs(ej,{ref:t,onOpenChange:f,children:[m.jsx(MD,{}),a.length>0&&m.jsx(wD,{children:a.map((g,b)=>m.jsx(_D,{children:m.jsx(iTe,{entry:g,onSaved:y})},`${g.model}-${g.id}-${b}`))})]})]})},cTe=k.lazy(()=>cn(()=>import("./media-manager-BDbpSSjH.js"),__vite__mapDeps([0,1,2]),import.meta.url)),MY=k.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:d})=>{const u=rTe(),h=k.useCallback(j=>{a(e.name,j.target.value)},[a,e.name]),f=k.useCallback(j=>{a(e.name,j[0])},[a,e.name]),y=k.useCallback(j=>{a(e.name,j)},[a,e.name]),x=k.useCallback(j=>{a(e.name,j)},[a,e.name]),g=k.useCallback(j=>{a(e.name,j)},[a,e.name]),b=k.useCallback(j=>{a(e.name,j)},[a,e.name]),M=k.useCallback(j=>{a(e.name,j.json)},[a,e.name]),_=k.useCallback(j=>{a(e.name,j)},[a,e.name]),S=k.useCallback(j=>{a(e.name,j)},[a,e.name]),C=k.useCallback(j=>{a(e.name,j)},[a,e.name]),L=k.useCallback(j=>{const E=j.map(z=>({id:z.id,url:z.url,mimeType:z.mimeType,filename:z.filename}));a(e.name,E)},[a,e.name]),A=k.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 m.jsx(vA,{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:y});case"textarea":return m.jsx(yY,{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 m.jsxs(m.Fragment,{children:[m.jsx("output",{children:t}),m.jsx(cY,{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:f,disabled:r||e.disabled})]});case"select":return m.jsxs(MZ,{onValueChange:x,value:t??"",disabled:r||e.disabled,required:e.required,children:[m.jsx(_Z,{className:"w-full cursor-pointer min-h-10 scroll-pt-30 scroll-mt-30",id:e.name,children:m.jsx(wZ,{placeholder:""})}),m.jsx(SZ,{className:"z-[9999999]",children:(Array.isArray(e.isIn)?e.isIn.map(j=>[j,j]):Object.entries(e.isIn)).map(([j,E])=>m.jsx(CZ,{value:String(j),children:String(E)},String(j)))})]});case"association":case"association-many":case"select-many":{const E=(e.type==="association"||e.type==="association-many")&&!!e.relatedModel&&!!u,z=E?$=>u.open(e.relatedModel,$):void 0,R=E&&e.canCreateRelated?()=>u.openCreate(e.relatedModel):void 0;return m.jsx(JD,{options:e.options,onValueChange:C,defaultValue:t??[],variant:"secondary",notFound:c,search:d,disabled:r||e.disabled,mode:e.type==="association"?"single":"multiple",maxCount:10,onOpenItem:z,onAddNew:R,className:`${r?"pointer-events-none":""} scroll-pt-30 scroll-mt-30`})}case"wysiwyg":case"markdown":return m.jsx(pu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??"",name:`${e.type}-${e.name}`,onChange:g,disabled:r||e.disabled});case"table":return m.jsx(pu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:b,disabled:r||e.disabled});case"jsonEditor":return m.jsx(pu,{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 m.jsx(pu,{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 m.jsx(pu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:S,disabled:r||e.disabled});case"mediamanager":case"single-file":return m.jsx(cTe,{layout:xY.Grid,value:t,onChange:L,config:{...e.options},type:e.type,name:e.name});default:return m.jsx(CD,{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 YR=new Map,U0=new WeakMap,qV=0,sTe=void 0;function lTe(e){return e?(U0.has(e)||(qV+=1,U0.set(e,qV.toString())),U0.get(e)):"0"}function dTe(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?lTe(e.root):e[t]}`).toString()}function uTe(e){const t=dTe(e);let a=YR.get(t);if(!a){const r=new Map;let c;const d=new IntersectionObserver(u=>{u.forEach(h=>{var f;const y=h.isIntersecting&&c.some(x=>h.intersectionRatio>=x);e.trackVisibility&&typeof h.isVisible>"u"&&(h.isVisible=y),(f=r.get(h.target))==null||f.forEach(x=>{x(y,h)})})},e);c=d.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:d,elements:r},YR.set(t,a)}return a}function hTe(e,t,a={},r=sTe){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const f=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:f,intersectionRect:f,rootBounds:f}),()=>{}}const{id:c,observer:d,elements:u}=uTe(a),h=u.get(e)||[];return u.has(e)||u.set(e,h),h.push(t),d.observe(e),function(){h.splice(h.indexOf(t),1),h.length===0&&(u.delete(e),d.unobserve(e)),u.size===0&&(d.disconnect(),YR.delete(c))}}function pTe({threshold:e,delay:t,trackVisibility:a,rootMargin:r,root:c,triggerOnce:d,skip:u,initialInView:h,fallbackInView:f,onChange:y}={}){var x;const[g,b]=k.useState(null),M=k.useRef(y),[_,S]=k.useState({inView:!!h,entry:void 0});M.current=y,k.useEffect(()=>{if(u||!g)return;let j;return j=hTe(g,(E,z)=>{S({inView:E,entry:z}),M.current&&M.current(E,z),z.isIntersecting&&d&&j&&(j(),j=void 0)},{root:c,rootMargin:r,threshold:e,trackVisibility:a,delay:t},f),()=>{j&&j()}},[Array.isArray(e)?e.toString():e,g,c,r,d,u,a,f,t]);const C=(x=_.entry)==null?void 0:x.target,L=k.useRef(void 0);!g&&C&&!d&&!u&&L.current!==C&&(L.current=C,S({inView:!!h,entry:void 0}));const A=[b,_.inView,_.entry];return A.ref=A[0],A.inView=A[1],A.entry=A[2],A}const fTe={errors:{}},ez=new Proxy(fTe,{set(e,t,a){return t==="errors"&&(Object.keys(a).length===0?e.errors={}:e.errors={...e.errors,...a}),!0}}),OV=e=>ez.errors[e]?.message,HV=()=>Object.values(ez.errors).some(e=>e.hasError),VV=()=>{ez.errors={}};function BV({message:e,className:t="",...a}){return e?m.jsx("p",{...a,className:W("text-sm text-red-600 dark:text-red-400",t),children:e}):null}const yTe=({changes:e,title:t="Changes",className:a="",messages:r={}})=>{const{t:c}=y2({page:r}),d=(f,y)=>c(f,y);if(!e||e.length===0)return m.jsx("div",{className:W("bg-muted border border-border rounded-lg p-4",a),children:m.jsxs("div",{className:"flex items-center text-muted-foreground",children:[m.jsx(_u,{className:"w-5 h-5 mr-2"}),m.jsx("span",{children:d("Changes not found","Changes not found")})]})});const u=f=>f===null?"null":f===void 0?"—":typeof f=="boolean"?f?d("Yes","Yes"):d("No","No"):typeof f=="object"?JSON.stringify(f):String(f),h=f=>f.oldValue===void 0?"added":f.newValue===void 0?"removed":"modified";return m.jsxs("div",{className:W("bg-card border border-border rounded-lg shadow-sm",a),children:[m.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted",children:m.jsxs("h3",{className:"text-lg font-semibold text-card-foreground flex items-center",children:[m.jsx(ln,{className:"w-5 h-5 mr-2"}),t," (",e.length,")"]})}),m.jsx("div",{className:"divide-y divide-border",children:e.map((f,y)=>{const x=h(f),g=x==="added"?Y1:x==="removed"?Cu:ln,b=W("text-xs px-2 py-1 rounded-full bg-opacity-10",x==="added"&&"text-green-600 bg-green-100",x==="removed"&&"text-destructive bg-destructive/20",x==="modified"&&"text-primary bg-primary/20"),M=x==="added"?"text-green-600":x==="removed"?"text-destructive":"text-primary";return m.jsxs("div",{className:"p-4 hover:bg-muted/50 transition-colors",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("div",{className:"flex items-center",children:[ye.createElement(g,{className:W("w-4 h-4 mr-2",M)}),m.jsx("span",{className:"font-medium text-card-foreground",children:f.field})]}),m.jsx("span",{className:b,children:x==="added"?d("Added","Added"):x==="removed"?d("Removed","Removed"):d("Updated","Updated")})]}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[x!=="added"&&m.jsxs("div",{className:"p-2 bg-destructive/10 border border-destructive/20 rounded",children:[m.jsxs("div",{className:"text-xs text-destructive font-medium mb-1",children:[d("Old","Old"),":"]}),m.jsx("div",{className:"text-destructive-foreground font-mono break-words",children:u(f.oldValue)})]}),x!=="removed"&&m.jsxs("div",{className:"p-2 bg-green-50 border border-green-100 rounded",children:[m.jsxs("div",{className:"text-xs text-green-600 font-medium mb-1",children:[d("New","New"),":"]}),m.jsx("div",{className:"text-green-800 font-mono break-words",children:u(f.newValue)})]})]}),x==="modified"&&m.jsxs("div",{className:"mt-2 flex items-center text-xs text-muted-foreground",children:[m.jsx(bu,{className:"w-3 h-3 mr-1"}),d("changed type","changed type"),": ",f.type]})]},y)})})]})},mTe=({modelName:e,modelId:t,handleWatchHistory:a})=>{const[r,c]=k.useState([]),[d,u]=k.useState(!1),[h,f]=k.useState(null),[y,x]=k.useState(!0),g="currentHistoryView",{t:b}=y2(),M=b("Diff");k.useEffect(()=>{(async()=>{x(!0);try{const L=await Oa.post(`${window.routePrefix}/history/get-model-history`,{modelName:e,modelId:t});L.data.data&&c(L.data.data)}catch(L){console.log(L)}finally{x(!1)}})()},[e,t]);const _=async C=>{try{const L=await Oa.post(`${window.routePrefix}/history/get-model-fields`,{historyId:C});L.data.data&&(localStorage.setItem(g,C.toString()),a(L.data.data))}catch(L){console.log(L)}},S=C=>{const L=localStorage.getItem(g);return L?L===C.id.toString():C.isCurrent};return m.jsx("div",{className:"relative h-full",children:m.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[m.jsxs(hY,{wrapperHeight:"max-h-full",children:[m.jsx(pY,{className:"sticky top-0 bg-background shadow",children:m.jsxs(ku,{children:[m.jsx(B1,{className:"p-2 text-left",children:b("Date")}),m.jsx(B1,{className:"p-2 text-left",children:b("Event")}),m.jsx(B1,{className:"p-2 text-left",children:b("User")}),m.jsx(B1,{className:"p-2 text-left",children:M}),m.jsx(B1,{className:"p-2 text-left"})]})}),m.jsx(fY,{children:y?m.jsx(ku,{children:m.jsx(dr,{colSpan:5,className:"p-10 text-center",children:m.jsx(va,{className:"mx-auto size-8 animate-spin"})})}):r.length>0?r.map(C=>m.jsxs(ku,{children:[m.jsx(dr,{className:"p-2 self-start pt-2.5",children:new Date(C.createdAt).toLocaleString()}),m.jsx(dr,{className:"p-2 self-start pt-2.5 capitalize",children:C.action}),m.jsx(dr,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:m.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:C.user.login})}),m.jsx(dr,{className:"p-2 align-middle",children:m.jsx(tn,{variant:"green",size:"sm",onClick:()=>{f(C.diff),u(!0)},children:m.jsx(ur,{})})}),m.jsx(dr,{className:"p-2 align-middle text-center",children:S(C)?m.jsx("span",{className:"font-medium",children:b("Current")}):m.jsx(tn,{variant:"outline",size:"sm",onClick:()=>_(C.id),children:b("Watch")})})]},C.id)):m.jsx(ku,{children:m.jsx(dr,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:b("There is no history")})})})]}),m.jsx(qA,{open:d,onOpenChange:C=>{u(C),C||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:m.jsxs(OA,{className:"z-[1022] sm:max-w-[60vw]",children:[m.jsx(HA,{children:m.jsx(VA,{children:M})}),m.jsx(yTe,{changes:h,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},kTe=({dialogRef:e,modelId:t,modelName:a,callback:r})=>m.jsxs(ej,{ref:e,children:[m.jsx(MD,{}),m.jsx(wD,{children:m.jsx(_D,{children:m.jsx(mTe,{modelId:t,modelName:a,handleWatchHistory:r})})})]}),FV=k.memo(({field:e})=>!e||typeof e!="object"||!e.label?(console.error("Invalid field for LabelRenderer:",e),null):m.jsxs("div",{className:"flex gap-3",children:[m.jsx(_A,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&m.jsx(ij,{children:m.jsxs(qD,{children:[m.jsx(OD,{onClick:t=>t.preventDefault(),children:m.jsx(CA,{iconNode:Su,className:"text-primary w-5 h-5 cursor-pointer"})}),m.jsx(HD,{align:"center",side:"top",className:"z-1002",children:m.jsx("p",{children:e.tooltip})})]})})]})),gTe=k.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:d,invalidFieldMessage:u})=>{if(!e||typeof e!="object"||!e.name||!e.type)return console.error("Invalid field for LazyField:",e),m.jsx("div",{className:"text-red-500",children:u||"Error: Invalid field data"});const[h,f]=pTe({triggerOnce:!0,rootMargin:"100px 0px"});return m.jsx("div",{ref:h,className:"grid gap-4 w-full",children:f?m.jsx(MY,{field:e,value:t,onChange:a,notFound:c,search:d,processing:r}):m.jsx(SA,{className:"w-full h-[250px] rounded-sm"})})}),wY=({page:e,catalog:t,callback:a,openNewWindow:r,openNewWindowLabel:c,isNavigation:d,DnavVisible:u,visibleLable:h})=>{const{btnBack:f,btnHistory:y,view:x,edit:g,history:b,notFound:M,model:_,fields:S}=e.props,{t:C}=y2(),{data:L,setData:A,post:j,processing:E,transform:z}=pT({...Object.fromEntries((S||[]).map(N=>[N.name,N.value??void 0])),jsonPopupCatalog:t}),[R,$]=k.useState(!1),[H,K]=k.useState(r??!1),[ae,Y]=k.useState(u??!1),G=k.useRef(null);k.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),k.useEffect(()=>(K(r??!1),VV(),A({...Object.fromEntries((S||[]).map(N=>[N.name,(N.type==="mediamanager"||N.type==="single-file")&&(N.value===null||N.value===void 0)?[]:N.value])),jsonPopupCatalog:t}),()=>VV()),[S,t,r,A]);const J=k.useCallback((N,P)=>{A(N,P)},[A]);if(!Array.isArray(S))return console.error("Fields is not an array:",S),m.jsx("div",{className:"p-4 text-red-500",children:C("Error: Fields data is invalid")});if(S.length===0)return console.warn("Fields array is empty"),m.jsx("div",{className:"p-4 text-gray-500",children:C("No fields to display")});const oe=S.filter(N=>!N||typeof N!="object"||!N.name||!N.type||!N.label);if(oe.length>0)return console.error("Invalid fields found:",oe),m.jsx("div",{className:"p-4 text-red-500",children:C("Error: Some fields are missing required properties (name, type, label)")});const he=async N=>{if(N.preventDefault(),t){$(!0);const P=await Oa.post(e.props.postLink,L);P.status===200&&a&&(d?a(P.data.record,H,ae):a(P.data.record))}else{const P=localStorage.getItem("backUrl");z(O=>({...O,redirectUrl:P??""})),j(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return m.jsxs("div",{className:"w-full min-w-0",children:[m.jsx("div",{className:"w-full sticky z-[1001] top-0 bg-background shadow-md lg:hidden",children:m.jsxs("div",{className:"p-4 flex gap-4",children:[!t&&m.jsx(tn,{className:"w-fit",asChild:!0,children:m.jsxs(fA,{href:f.link,preserveScroll:!0,children:[m.jsx(CA,{iconNode:Z1}),f.title]})}),m.jsxs(tn,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:R||E||e.props.view||HV(),children:[R||E&&m.jsx(va,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]}),b&&(g||x)&&m.jsx("div",{className:"flex gap-2 justify-start",children:m.jsx(tn,{variant:"outline",className:"w-fit",onClick:N=>{N.preventDefault(),G.current?.open()},children:y.title})})]})}),m.jsxs("div",{className:"p-4 w-full mt-6",children:[m.jsx("form",{id:"addUserForm",onSubmit:he,className:x?"cursor-not-allowed":"",children:m.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[m.jsx("div",{className:"flex flex-col gap-10",children:S.map(N=>m.jsx("div",{className:`grid gap-4 w-full ${x?"pointer-events-none":""}`,children:N.type==="markdown"||N.type==="table"||N.type==="jsonEditor"||N.type==="codeEditor"||N.type==="geoJson"?m.jsxs(m.Fragment,{children:[m.jsx(FV,{field:N}),m.jsx(BV,{message:OV(`${N.type}-${N.name}`)}),m.jsx(gTe,{field:N,value:L[N.name],onChange:J,processing:R||E||x,notFound:M,search:e.props.search,invalidFieldMessage:C("Error: Invalid field data")})]}):m.jsxs(m.Fragment,{children:[m.jsx(FV,{field:N}),m.jsx(BV,{message:OV(`${N.type}-${N.name}`)}),m.jsx(MY,{field:N,value:L[N.name],onChange:J,processing:R||E||x,notFound:M,search:e.props.search})]})},N.name))}),m.jsxs("div",{className:"p-4 rounded-md h-fit sticky top-[54px] hidden lg:grid gap-4 shadow",children:[m.jsxs("div",{className:"flex gap-4",children:[!t&&m.jsx(tn,{className:"w-fit",asChild:!0,children:m.jsxs(fA,{href:f.link,preserveScroll:!0,children:[m.jsx(CA,{iconNode:Z1}),f.title]})}),m.jsxs(tn,{variant:"green",type:"submit",className:"w-fit",disabled:R||E||e.props.view||HV(),children:[(R||E)&&m.jsx(va,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),d&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(vA,{id:"targetBlank",checked:H,onCheckedChange:N=>K(!!N),className:"cursor-pointer size-5"}),m.jsx(_A,{htmlFor:"targetBlank",children:c})]}),m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(vA,{id:"visible",checked:ae,onCheckedChange:N=>Y(!!N),className:"cursor-pointer size-5"}),m.jsx(_A,{htmlFor:"visible",children:h})]})]}),b&&(g||x)&&m.jsx("div",{className:"flex gap-2 justify-start",children:m.jsx(tn,{variant:"outline",className:"w-fit",onClick:N=>{N.preventDefault(),G.current?.open()},children:y.title})})]})]})}),b&&(g||x)&&m.jsx(kTe,{dialogRef:G,modelName:_,modelId:S.find(N=>N.name==="id")?.value,callback:N=>{for(const P of Object.keys(N))A(P,N[P]);G.current?.close()}})]})]})};function vTe(){window.UIComponents??={},window.JSComponents??={},window.sonner=oRe,window.axios=YRe,window.cn=W,Object.assign(window.UIComponents,{Avatar:Xee,AvatarImage:Wee,AvatarFallback:Kee,Badge:Jee,Breadcrumb:tMe,BreadcrumbList:nMe,BreadcrumbItem:aMe,BreadcrumbLink:oMe,BreadcrumbPage:rMe,BreadcrumbSeparator:iMe,BreadcrumbEllipsis:cMe,Button:tn,Calendar:Y9e,Card:X9e,CardHeader:W9e,CardFooter:twe,CardTitle:K9e,CardAction:J9e,CardDescription:Q9e,CardContent:ewe,Checkbox:vA,Collapsible:Twe,CollapsibleTrigger:Dwe,CollapsibleContent:zwe,Command:FT,CommandDialog:pSe,CommandInput:JU,CommandList:eG,CommandEmpty:tG,CommandGroup:nG,CommandItem:oG,CommandShortcut:fSe,CommandSeparator:aG,ContextMenu:pNe,ContextMenuTrigger:fNe,ContextMenuContent:bNe,ContextMenuItem:MNe,ContextMenuCheckboxItem:wNe,ContextMenuRadioItem:_Ne,ContextMenuLabel:SNe,ContextMenuSeparator:CNe,ContextMenuShortcut:LNe,ContextMenuGroup:yNe,ContextMenuPortal:mNe,ContextMenuSub:kNe,ContextMenuSubContent:xNe,ContextMenuSubTrigger:vNe,ContextMenuRadioGroup:gNe,Dialog:qA,DialogClose:DR,DialogContent:OA,DialogDescription:QU,DialogFooter:KU,DialogHeader:HA,DialogOverlay:WU,DialogPortal:XU,DialogTitle:VA,DialogTrigger:YU,DialogStack:ej,DialogStackTrigger:NNe,DialogStackOverlay:MD,DialogStackBody:wD,DialogStackContent:_D,DialogStackTitle:INe,DialogStackDescription:ANe,DialogStackHeader:jNe,DialogStackFooter:ENe,DialogStackNext:PNe,DialogStackPrevious:RNe,DropdownMenu:fIe,DropdownMenuPortal:yIe,DropdownMenuTrigger:mIe,DropdownMenuContent:kIe,DropdownMenuGroup:gIe,DropdownMenuLabel:wIe,DropdownMenuItem:vIe,DropdownMenuCheckboxItem:xIe,DropdownMenuRadioGroup:bIe,DropdownMenuRadioItem:MIe,DropdownMenuSeparator:_Ie,DropdownMenuShortcut:SIe,DropdownMenuSub:CIe,DropdownMenuSubTrigger:LIe,DropdownMenuSubContent:NIe,Input:CD,Label:_A,Menubar:mAe,MenubarPortal:sZ,MenubarMenu:kAe,MenubarTrigger:xAe,MenubarContent:bAe,MenubarGroup:gAe,MenubarSeparator:CAe,MenubarLabel:SAe,MenubarItem:MAe,MenubarShortcut:LAe,MenubarCheckboxItem:wAe,MenubarRadioGroup:vAe,MenubarRadioItem:_Ae,MenubarSub:NAe,MenubarSubTrigger:IAe,MenubarSubContent:AAe,Pagination:jAe,PaginationContent:EAe,PaginationLink:ND,PaginationItem:PAe,PaginationPrevious:RAe,PaginationNext:TAe,PaginationEllipsis:DAe,Popover:hZ,PopoverTrigger:pZ,PopoverContent:fZ,PopoverAnchor:nje,Select:MZ,SelectContent:SZ,SelectGroup:Kje,SelectItem:CZ,SelectLabel:Qje,SelectScrollDownButton:NZ,SelectScrollUpButton:LZ,SelectSeparator:Jje,SelectTrigger:_Z,SelectValue:wZ,Separator:DD,Sheet:jZ,SheetTrigger:oEe,SheetClose:rEe,SheetContent:EZ,SheetHeader:PZ,SheetFooter:sEe,SheetTitle:RZ,SheetDescription:TZ,Sidebar:$Ee,SidebarContent:GEe,SidebarFooter:FEe,SidebarGroup:ZEe,SidebarGroupAction:XEe,SidebarGroupContent:WEe,SidebarGroupLabel:YEe,SidebarHeader:BEe,SidebarInput:VEe,SidebarInset:HEe,SidebarMenu:KEe,SidebarMenuAction:tPe,SidebarMenuBadge:nPe,SidebarMenuButton:ePe,SidebarMenuItem:QEe,SidebarMenuSkeleton:aPe,SidebarMenuSub:oPe,SidebarMenuSubButton:iPe,SidebarMenuSubItem:rPe,SidebarProvider:zEe,SidebarRail:OEe,SidebarSeparator:UEe,SidebarTrigger:qEe,useSidebar:h2,Skeleton:SA,Slider:cY,Toaster:rRe,Switch:mRe,Tabs:jRe,TabsList:ERe,TabsTrigger:PRe,TabsContent:RRe,Table:hY,TableHeader:pY,TableBody:fY,TableFooter:TRe,TableHead:B1,TableRow:ku,TableCell:dr,TableCaption:DRe,Textarea:yY,Tooltip:qD,TooltipTrigger:OD,TooltipContent:HD,TooltipProvider:ij,VanillaJSONEditor:zV}),Object.assign(window.JSComponents,{VanillaJSONEditor:zV,HandsonTable:ORe,MonacoEditor:HRe,MultiSelect:JD,DeleteModal:vY,AddForm:wY,adminApi:Oa})}const{createInertiaApp:xTe,router:_Y}=iF;window.React=ye;window.ReactDOM=pA;window.InertiajsReact=iF;window.LucideReact=eMe;vTe();let tz=!1;_Y.on("navigate",e=>{tz=!0});_Y.on("finish",e=>{tz=!1});const UV=document.createElement.bind(document);document.createElement=function(e,t){const a=UV(e,t);return e.toLowerCase()==="iframe"&&tz?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),UV("div")):a};xTe({title:e=>`${e}`,resolve:async e=>(await Object.assign({"./pages/add-group.tsx":()=>cn(()=>import("./add-group-0SdYgiXZ.js"),__vite__mapDeps([3,4,5]),import.meta.url),"./pages/add-user.tsx":()=>cn(()=>import("./add-user-Bh1iqSem.js"),__vite__mapDeps([6,4,5]),import.meta.url),"./pages/add.tsx":()=>cn(()=>import("./add-B_hn__Ba.js"),__vite__mapDeps([7,4,5]),import.meta.url),"./pages/catalog.tsx":()=>cn(()=>import("./catalog-DjK8r0Mn.js"),__vite__mapDeps([8,4,5,1,9]),import.meta.url),"./pages/dashboard.tsx":()=>cn(()=>import("./dashboard-CbJIK7ka.js"),__vite__mapDeps([10,4,5,11]),import.meta.url),"./pages/history.tsx":()=>cn(()=>import("./history-CZAJgVXP.js"),__vite__mapDeps([12,13,4,5]),import.meta.url),"./pages/init-user.tsx":()=>cn(()=>import("./init-user-8aUohVDq.js"),__vite__mapDeps([14,5]),import.meta.url),"./pages/list.tsx":()=>cn(()=>import("./list-C6w_xDK2.js"),__vite__mapDeps([15,4,5,13]),import.meta.url),"./pages/login.tsx":()=>cn(()=>import("./login-CO4laf6m.js"),__vite__mapDeps([16,5]),import.meta.url),"./pages/module.tsx":()=>cn(()=>import("./module-DvPjKyF_.js"),__vite__mapDeps([17,4,5]),import.meta.url),"./pages/notification.tsx":()=>cn(()=>import("./notification-N_b-N0Zu.js"),__vite__mapDeps([18,4,5,1]),import.meta.url),"./pages/register.tsx":()=>cn(()=>import("./register-DBYIMXGQ.js"),__vite__mapDeps([19,5]),import.meta.url),"./pages/user-filters-list.tsx":()=>cn(()=>import("./user-filters-list-xbJoY_5_.js"),__vite__mapDeps([20,4,5]),import.meta.url),"./pages/welcome.tsx":()=>cn(()=>import("./welcome-BUkdkKa5.js"),__vite__mapDeps([21,4,5]),import.meta.url)})[`./pages/${e}.tsx`]()).default,setup({el:e,App:t,props:a}){yR.createRoot(e).render(m.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{fNe as $,wY as A,tn as B,vA as C,ej as D,_u as E,_D as F,y2 as G,Ue as H,CA as I,SA as J,H8 as K,fA as L,Z1 as M,Jee as N,u9 as O,Y1 as P,vY as Q,Ow as R,MZ as S,ij as T,sf as U,$Ne as V,mIe as W,si as X,kIe as Y,gIe as Z,pNe as _,pT as a,nG as a$,bNe as a0,MNe as a1,hT as a2,XB as a3,wTe as a4,X9e as a5,W9e as a6,K9e as a7,twe as a8,mRe as a9,fIe as aA,cc as aB,wIe as aC,_Ie as aD,xIe as aE,jAe as aF,EAe as aG,PAe as aH,ND as aI,RAe as aJ,TAe as aK,jTe as aL,Pp as aM,mp as aN,Lp as aO,wc as aP,Xx as aQ,YN as aR,v6 as aS,H9 as aT,J_ as aU,W as aV,yr as aW,FT as aX,JU as aY,eG as aZ,tG as a_,NNe as aa,INe as ab,TP as ac,su as ad,lu as ae,RMe as af,hZ as ag,pZ as ah,Nm as ai,Ol as aj,fZ as ak,Y9e as al,hY as am,pY as an,ku as ao,B1 as ap,fY as aq,dr as ar,ur as as,qA as at,OA as au,HA as av,VA as aw,yTe as ax,qF as ay,Lu as az,va as b,h2 as b$,oG as b0,jNe as b1,ANe as b2,x_ as b3,Nu as b4,Mu as b5,fr as b6,G1 as b7,ENe as b8,yY as b9,Ti as bA,J7 as bB,$Ee as bC,BEe as bD,mAe as bE,kAe as bF,xAe as bG,k4 as bH,bAe as bI,NAe as bJ,IAe as bK,AAe as bL,MAe as bM,Iwe as bN,Ewe as bO,GEe as bP,FEe as bQ,tMe as bR,nMe as bS,aMe as bT,rMe as bU,oMe as bV,iMe as bW,Xee as bX,Wee as bY,Kee as bZ,Kx as b_,Ks as ba,zw as bb,ev as bc,vIe as bd,Ga as be,ZN as bf,MTe as bg,jRe as bh,ERe as bi,PRe as bj,RRe as bk,zEe as bl,ZEe as bm,YEe as bn,WEe as bo,KEe as bp,Twe as bq,QEe as br,Dwe as bs,ePe as bt,zwe as bu,oPe as bv,rPe as bw,iPe as bx,oM as by,$l as bz,_A as c,lEe as c0,DC as c1,zM as c2,$C as c3,$f as c4,ls as c5,vF as c6,qEe as c7,s8 as c8,IJ as c9,HEe as ca,UTe as cb,hl as cc,KU as cd,DR as ce,xp as cf,bu as cg,YU as ch,Cc as ci,FTe as cj,oTe as ck,lr as cl,CD as d,qD as e,OD as f,Su as g,HD as h,_Z as i,m as j,wZ as k,SZ as l,CZ as m,BV as n,Qk as o,Oa as p,rRe as q,k as r,GV as s,GPe as t,Xu as u,ye as v,Ua as w,Sv as x,MD as y,wD as z};
138
+ `)},R_e=0,z1=[];function T_e(e){var t=k.useRef([]),a=k.useRef([0,0]),r=k.useRef(),c=k.useState(R_e++)[0],d=k.useState(IU)[0],u=k.useRef(e);k.useEffect(function(){u.current=e},[e]),k.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var S=n_e([e.lockRef.current],(e.shards||[]).map(uV),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var h=k.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var L=$0(S),A=a.current,j="deltaX"in S?S.deltaX:A[0]-L[0],E="deltaY"in S?S.deltaY:A[1]-L[1],z,R=S.target,$=Math.abs(j)>Math.abs(E)?"h":"v";if("touches"in S&&$==="h"&&R.type==="range")return!1;var H=window.getSelection(),K=H&&H.anchorNode,ae=K?K===R||K.contains(R):!1;if(ae)return!1;var Y=lV($,R);if(!Y)return!0;if(Y?z=$:(z=$==="v"?"h":"v",Y=lV($,R)),!Y)return!1;if(!r.current&&"changedTouches"in S&&(j||E)&&(r.current=z),!z)return!0;var G=r.current||z;return j_e(G,C,S,G==="h"?j:E)},[]),f=k.useCallback(function(S){var C=S;if(!(!z1.length||z1[z1.length-1]!==d)){var L="deltaY"in C?dV(C):$0(C),A=t.current.filter(function(z){return z.name===C.type&&(z.target===C.target||C.target===z.shadowParent)&&E_e(z.delta,L)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var j=(u.current.shards||[]).map(uV).filter(Boolean).filter(function(z){return z.contains(C.target)}),E=j.length>0?h(C,j[0]):!u.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),y=k.useCallback(function(S,C,L,A){var j={name:S,delta:C,target:L,should:A,shadowParent:D_e(L)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(E){return E!==j})},1)},[]),x=k.useCallback(function(S){a.current=$0(S),r.current=void 0},[]),g=k.useCallback(function(S){y(S.type,dV(S),S.target,h(S,e.lockRef.current))},[]),b=k.useCallback(function(S){y(S.type,$0(S),S.target,h(S,e.lockRef.current))},[]);k.useEffect(function(){return z1.push(d),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",f,D1),document.addEventListener("touchmove",f,D1),document.addEventListener("touchstart",x,D1),function(){z1=z1.filter(function(S){return S!==d}),document.removeEventListener("wheel",f,D1),document.removeEventListener("touchmove",f,D1),document.removeEventListener("touchstart",x,D1)}},[]);var M=e.removeScrollBar,_=e.inert;return k.createElement(k.Fragment,null,_?k.createElement(d,{styles:P_e(c)}):null,M?k.createElement(__e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function D_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const z_e=u_e(NU,T_e);var o2=k.forwardRef(function(e,t){return k.createElement(RA,qa({},e,{ref:t,sideCar:z_e}))});o2.classNames=RA.classNames;var $_e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$1=new WeakMap,q0=new WeakMap,O0={},XP=0,PU=function(e){return e&&(e.host||PU(e.parentNode))},q_e=function(e,t){return t.map(function(a){if(e.contains(a))return a;var r=PU(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})},O_e=function(e,t,a,r){var c=q_e(t,Array.isArray(e)?e:[e]);O0[a]||(O0[a]=new WeakMap);var d=O0[a],u=[],h=new Set,f=new Set(c),y=function(g){!g||h.has(g)||(h.add(g),y(g.parentNode))};c.forEach(y);var x=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(b){if(h.has(b))x(b);else try{var M=b.getAttribute(r),_=M!==null&&M!=="false",S=($1.get(b)||0)+1,C=(d.get(b)||0)+1;$1.set(b,S),d.set(b,C),u.push(b),S===1&&_&&q0.set(b,!0),C===1&&b.setAttribute(a,"true"),_||b.setAttribute(r,"true")}catch(L){console.error("aria-hidden: cannot operate on ",b,L)}})};return x(t),h.clear(),XP++,function(){u.forEach(function(g){var b=$1.get(g)-1,M=d.get(g)-1;$1.set(g,b),d.set(g,M),b||(q0.has(g)||g.removeAttribute(r),q0.delete(g)),M||g.removeAttribute(a)}),XP--,XP||($1=new WeakMap,$1=new WeakMap,q0=new WeakMap,O0={})}},TA=function(e,t,a){a===void 0&&(a="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),c=$_e(e);return c?(r.push.apply(r,Array.from(c.querySelectorAll("[aria-live], script"))),O_e(r,c,a,"aria-hidden")):function(){return null}},H_e=Object.defineProperty,Wn=(e,t)=>H_e(e,"name",{value:t,configurable:!0}),$T="Dialog",[RU,RTe]=qt($T),[V_e,Ca]=RU($T),qT=Wn(e=>{const{__scopeDialog:t,children:a,open:r,defaultOpen:c,onOpenChange:d,modal:u=!0}=e,h=k.useRef(null),f=k.useRef(null),[y,x]=Ut({prop:r,defaultProp:c??!1,onChange:d,caller:$T}),[g,b]=k.useState(0),[M,_]=k.useState(0);return m.jsx(V_e,{scope:t,triggerRef:h,contentRef:f,contentId:kt(),titleId:kt(),descriptionId:kt(),titlePresent:g>0,descriptionPresent:M>0,setTitleCount:b,setDescriptionCount:_,open:y,onOpenChange:x,onOpenToggle:k.useCallback(()=>x(S=>!S),[x]),modal:u,children:a})},"Dialog"),B_e="DialogTrigger",TU=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(B_e,r),u=Ee(a,d.triggerRef);return m.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":zA(d.open),...c,ref:u,onClick:fe(t.onClick,d.onOpenToggle)})},"DialogTrigger")),DU="DialogPortal",[F_e,zU]=RU(DU,{forceMount:void 0}),OT=Wn(e=>{const{__scopeDialog:t,forceMount:a,children:r,container:c}=e,d=Ca(DU,t);return m.jsx(F_e,{scope:t,forceMount:a,children:k.Children.map(r,u=>m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:u})}))})},"DialogPortal"),RR="DialogOverlay",HT=k.forwardRef(Wn(function(t,a){const r=zU(RR,t.__scopeDialog),{forceMount:c=r.forceMount,...d}=t,u=Ca(RR,t.__scopeDialog);return u.modal?m.jsx(kn,{present:c||u.open,children:m.jsx(G_e,{...d,ref:a})}):null},"DialogOverlay")),U_e=Ma("DialogOverlay.RemoveScroll"),G_e=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(RR,r),u=mU(),h=Ee(a,u);return m.jsx(o2,{as:U_e,allowPinchZoom:!0,shards:[d.contentRef],children:m.jsx(ge.div,{"data-state":zA(d.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),$u="DialogContent",VT=k.forwardRef(Wn(function(t,a){const r=zU($u,t.__scopeDialog),{forceMount:c=r.forceMount,...d}=t,u=Ca($u,t.__scopeDialog);return m.jsx(kn,{present:c||u.open,children:u.modal?m.jsx(Z_e,{...d,ref:a}):m.jsx(Y_e,{...d,ref:a})})},"DialogContent")),Z_e=k.forwardRef(Wn(function(t,a){const r=Ca($u,t.__scopeDialog),c=k.useRef(null),d=Ee(a,r.contentRef,c);return k.useEffect(()=>{const u=c.current;if(u)return TA(u)},[]),m.jsx($U,{...t,ref:d,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:fe(t.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:fe(t.onPointerDownOutside,u=>{const h=u.detail.originalEvent,f=h.button===0&&h.ctrlKey===!0;(h.button===2||f)&&u.preventDefault()}),onFocusOutside:fe(t.onFocusOutside,u=>u.preventDefault())})},"DialogContentModal")),Y_e=k.forwardRef(Wn(function(t,a){const r=Ca($u,t.__scopeDialog),c=k.useRef(!1),d=k.useRef(!1);return m.jsx($U,{...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,d.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&d.current&&u.preventDefault()}})},"DialogContentNonModal")),$U=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:u,...h}=t,f=Ca($u,r);return id(),m.jsx(m.Fragment,{children:m.jsx(PA,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:d,onUnmountAutoFocus:u,children:m.jsx(a2,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionPresent?f.descriptionId:void 0,"aria-labelledby":f.titlePresent?f.titleId:void 0,"data-state":zA(f.open),...h,ref:a,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1)})})})},"DialogContentImpl")),X_e="DialogTitle",qU=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(X_e,r),{setTitleCount:u}=d;return mt(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),m.jsx(ge.h2,{id:d.titleId,...c,ref:a})},"DialogTitle")),W_e="DialogDescription",OU=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(W_e,r),{setDescriptionCount:u}=d;return mt(()=>(u(h=>h+1),()=>u(h=>h-1)),[u]),m.jsx(ge.p,{id:d.descriptionId,...c,ref:a})},"DialogDescription")),K_e="DialogClose",DA=k.forwardRef(Wn(function(t,a){const{__scopeDialog:r,...c}=t,d=Ca(K_e,r);return m.jsx(ge.button,{type:"button",...c,ref:a,onClick:fe(t.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function zA(e){return e?"open":"closed"}Wn(zA,"getState");var du='[cmdk-group=""]',WP='[cmdk-group-items=""]',Q_e='[cmdk-group-heading=""]',HU='[cmdk-item=""]',hV=`${HU}:not([aria-disabled="true"])`,TR="cmdk-item-select",H1="data-value",J_e=(e,t,a)=>Gwe(e,t,a),VU=k.createContext(void 0),r2=()=>k.useContext(VU),BU=k.createContext(void 0),BT=()=>k.useContext(BU),FU=k.createContext(void 0),UU=k.forwardRef((e,t)=>{let a=V1(()=>{var T,U;return{search:"",value:(U=(T=e.value)!=null?T:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=V1(()=>new Set),c=V1(()=>new Map),d=V1(()=>new Map),u=V1(()=>new Set),h=GU(e),{label:f,children:y,value:x,onValueChange:g,filter:b,shouldFilter:M,loop:_,disablePointerSelection:S=!1,vimBindings:C=!0,...L}=e,A=kt(),j=kt(),E=kt(),z=k.useRef(null),R=dSe();Rl(()=>{if(x!==void 0){let T=x.trim();a.current.value=T,$.emit()}},[x]),Rl(()=>{R(6,J)},[]);let $=k.useMemo(()=>({subscribe:T=>(u.current.add(T),()=>u.current.delete(T)),snapshot:()=>a.current,setState:(T,U,X)=>{var Z,ce,pe,ie;if(!Object.is(a.current[T],U)){if(a.current[T]=U,T==="search")G(),ae(),R(1,Y);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let se=document.getElementById(E);se?se.focus():(Z=document.getElementById(A))==null||Z.focus()}if(R(7,()=>{var se;a.current.selectedItemId=(se=oe())==null?void 0:se.id,$.emit()}),X||R(5,J),((ce=h.current)==null?void 0:ce.value)!==void 0){let se=U??"";(ie=(pe=h.current).onValueChange)==null||ie.call(pe,se);return}}$.emit()}},emit:()=>{u.current.forEach(T=>T())}}),[]),H=k.useMemo(()=>({value:(T,U,X)=>{var Z;U!==((Z=d.current.get(T))==null?void 0:Z.value)&&(d.current.set(T,{value:U,keywords:X}),a.current.filtered.items.set(T,K(U,X)),R(2,()=>{ae(),$.emit()}))},item:(T,U)=>(r.current.add(T),U&&(c.current.has(U)?c.current.get(U).add(T):c.current.set(U,new Set([T]))),R(3,()=>{G(),ae(),a.current.value||Y(),$.emit()}),()=>{d.current.delete(T),r.current.delete(T),a.current.filtered.items.delete(T);let X=oe();R(4,()=>{G(),X?.getAttribute("id")===T&&Y(),$.emit()})}),group:T=>(c.current.has(T)||c.current.set(T,new Set),()=>{d.current.delete(T),c.current.delete(T)}),filter:()=>h.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:A,inputId:E,labelId:j,listInnerRef:z}),[]);function K(T,U){var X,Z;let ce=(Z=(X=h.current)==null?void 0:X.filter)!=null?Z:J_e;return T?ce(T,a.current.search,U):0}function ae(){if(!a.current.search||h.current.shouldFilter===!1)return;let T=a.current.filtered.items,U=[];a.current.filtered.groups.forEach(Z=>{let ce=c.current.get(Z),pe=0;ce.forEach(ie=>{let se=T.get(ie);pe=Math.max(se,pe)}),U.push([Z,pe])});let X=z.current;he().sort((Z,ce)=>{var pe,ie;let se=Z.getAttribute("id"),_e=ce.getAttribute("id");return((pe=T.get(_e))!=null?pe:0)-((ie=T.get(se))!=null?ie:0)}).forEach(Z=>{let ce=Z.closest(WP);ce?ce.appendChild(Z.parentElement===ce?Z:Z.closest(`${WP} > *`)):X.appendChild(Z.parentElement===X?Z:Z.closest(`${WP} > *`))}),U.sort((Z,ce)=>ce[1]-Z[1]).forEach(Z=>{var ce;let pe=(ce=z.current)==null?void 0:ce.querySelector(`${du}[${H1}="${encodeURIComponent(Z[0])}"]`);pe?.parentElement.appendChild(pe)})}function Y(){let T=he().find(X=>X.getAttribute("aria-disabled")!=="true"),U=T?.getAttribute(H1);$.setState("value",U||void 0)}function G(){var T,U,X,Z;if(!a.current.search||h.current.shouldFilter===!1){a.current.filtered.count=r.current.size;return}a.current.filtered.groups=new Set;let ce=0;for(let pe of r.current){let ie=(U=(T=d.current.get(pe))==null?void 0:T.value)!=null?U:"",se=(Z=(X=d.current.get(pe))==null?void 0:X.keywords)!=null?Z:[],_e=K(ie,se);a.current.filtered.items.set(pe,_e),_e>0&&ce++}for(let[pe,ie]of c.current)for(let se of ie)if(a.current.filtered.items.get(se)>0){a.current.filtered.groups.add(pe);break}a.current.filtered.count=ce}function J(){var T,U,X;let Z=oe();Z&&(((T=Z.parentElement)==null?void 0:T.firstChild)===Z&&((X=(U=Z.closest(du))==null?void 0:U.querySelector(Q_e))==null||X.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function oe(){var T;return(T=z.current)==null?void 0:T.querySelector(`${HU}[aria-selected="true"]`)}function he(){var T;return Array.from(((T=z.current)==null?void 0:T.querySelectorAll(hV))||[])}function N(T){let U=he()[T];U&&$.setState("value",U.getAttribute(H1))}function P(T){var U;let X=oe(),Z=he(),ce=Z.findIndex(ie=>ie===X),pe=Z[ce+T];(U=h.current)!=null&&U.loop&&(pe=ce+T<0?Z[Z.length-1]:ce+T===Z.length?Z[0]:Z[ce+T]),pe&&$.setState("value",pe.getAttribute(H1))}function O(T){let U=oe(),X=U?.closest(du),Z;for(;X&&!Z;)X=T>0?sSe(X,du):lSe(X,du),Z=X?.querySelector(hV);Z?$.setState("value",Z.getAttribute(H1)):P(T)}let te=()=>N(he().length-1),B=T=>{T.preventDefault(),T.metaKey?te():T.altKey?O(1):P(1)},D=T=>{T.preventDefault(),T.metaKey?N(0):T.altKey?O(-1):P(-1)};return k.createElement(ge.div,{ref:t,tabIndex:-1,...L,"cmdk-root":"",onKeyDown:T=>{var U;(U=L.onKeyDown)==null||U.call(L,T);let X=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||X))switch(T.key){case"n":case"j":{C&&T.ctrlKey&&B(T);break}case"ArrowDown":{B(T);break}case"p":case"k":{C&&T.ctrlKey&&D(T);break}case"ArrowUp":{D(T);break}case"Home":{T.preventDefault(),N(0);break}case"End":{T.preventDefault(),te();break}case"Enter":{T.preventDefault();let Z=oe();if(Z){let ce=new Event(TR);Z.dispatchEvent(ce)}}}}},k.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:hSe},f),$A(e,T=>k.createElement(BU.Provider,{value:$},k.createElement(VU.Provider,{value:H},T))))}),eSe=k.forwardRef((e,t)=>{var a,r;let c=kt(),d=k.useRef(null),u=k.useContext(FU),h=r2(),f=GU(e),y=(r=(a=f.current)==null?void 0:a.forceMount)!=null?r:u?.forceMount;Rl(()=>{if(!y)return h.item(c,u?.id)},[y]);let x=ZU(c,d,[e.value,e.children,d],e.keywords),g=BT(),b=kr(R=>R.value&&R.value===x.current),M=kr(R=>y||h.filter()===!1?!0:R.search?R.filtered.items.get(c)>0:!0);k.useEffect(()=>{let R=d.current;if(!(!R||e.disabled))return R.addEventListener(TR,_),()=>R.removeEventListener(TR,_)},[M,e.onSelect,e.disabled]);function _(){var R,$;S(),($=(R=f.current).onSelect)==null||$.call(R,x.current)}function S(){g.setState("value",x.current,!0)}if(!M)return null;let{disabled:C,value:L,onSelect:A,forceMount:j,keywords:E,...z}=e;return k.createElement(ge.div,{ref:El(d,t),...z,id:c,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!b,"data-disabled":!!C,"data-selected":!!b,onPointerMove:C||h.getDisablePointerSelection()?void 0:S,onClick:C?void 0:_},e.children)}),tSe=k.forwardRef((e,t)=>{let{heading:a,children:r,forceMount:c,...d}=e,u=kt(),h=k.useRef(null),f=k.useRef(null),y=kt(),x=r2(),g=kr(M=>c||x.filter()===!1?!0:M.search?M.filtered.groups.has(u):!0);Rl(()=>x.group(u),[]),ZU(u,h,[e.value,e.heading,f]);let b=k.useMemo(()=>({id:u,forceMount:c}),[c]);return k.createElement(ge.div,{ref:El(h,t),...d,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},a&&k.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:y},a),$A(e,M=>k.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":a?y:void 0},k.createElement(FU.Provider,{value:b},M))))}),nSe=k.forwardRef((e,t)=>{let{alwaysRender:a,...r}=e,c=k.useRef(null),d=kr(u=>!u.search);return!a&&!d?null:k.createElement(ge.div,{ref:El(c,t),...r,"cmdk-separator":"",role:"separator"})}),aSe=k.forwardRef((e,t)=>{let{onValueChange:a,...r}=e,c=e.value!=null,d=BT(),u=kr(y=>y.search),h=kr(y=>y.selectedItemId),f=r2();return k.useEffect(()=>{e.value!=null&&d.setState("search",e.value)},[e.value]),k.createElement(ge.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":h,id:f.inputId,type:"text",value:c?e.value:u,onChange:y=>{c||d.setState("search",y.target.value),a?.(y.target.value)}})}),oSe=k.forwardRef((e,t)=>{let{children:a,label:r="Suggestions",...c}=e,d=k.useRef(null),u=k.useRef(null),h=kr(y=>y.selectedItemId),f=r2();return k.useEffect(()=>{if(u.current&&d.current){let y=u.current,x=d.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let M=y.offsetHeight;x.style.setProperty("--cmdk-list-height",M.toFixed(1)+"px")})});return b.observe(y),()=>{cancelAnimationFrame(g),b.unobserve(y)}}},[]),k.createElement(ge.div,{ref:El(d,t),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":r,id:f.listId},$A(e,y=>k.createElement("div",{ref:El(u,f.listInnerRef),"cmdk-list-sizer":""},y)))}),rSe=k.forwardRef((e,t)=>{let{open:a,onOpenChange:r,overlayClassName:c,contentClassName:d,container:u,...h}=e;return k.createElement(qT,{open:a,onOpenChange:r},k.createElement(OT,{container:u},k.createElement(HT,{"cmdk-overlay":"",className:c}),k.createElement(VT,{"aria-label":e.label,"cmdk-dialog":"",className:d},k.createElement(UU,{ref:t,...h}))))}),iSe=k.forwardRef((e,t)=>kr(a=>a.filtered.count===0)?k.createElement(ge.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),cSe=k.forwardRef((e,t)=>{let{progress:a,children:r,label:c="Loading...",...d}=e;return k.createElement(ge.div,{ref:t,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},$A(e,u=>k.createElement("div",{"aria-hidden":!0},u)))}),Hl=Object.assign(UU,{List:oSe,Item:eSe,Input:aSe,Group:tSe,Separator:nSe,Dialog:rSe,Empty:iSe,Loading:cSe});function sSe(e,t){let a=e.nextElementSibling;for(;a;){if(a.matches(t))return a;a=a.nextElementSibling}}function lSe(e,t){let a=e.previousElementSibling;for(;a;){if(a.matches(t))return a;a=a.previousElementSibling}}function GU(e){let t=k.useRef(e);return Rl(()=>{t.current=e}),t}var Rl=typeof window>"u"?k.useEffect:k.useLayoutEffect;function V1(e){let t=k.useRef();return t.current===void 0&&(t.current=e()),t}function kr(e){let t=BT(),a=()=>e(t.snapshot());return k.useSyncExternalStore(t.subscribe,a,a)}function ZU(e,t,a,r=[]){let c=k.useRef(),d=r2();return Rl(()=>{var u;let h=(()=>{var y;for(let x of a){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(y=x.current.textContent)==null?void 0:y.trim():c.current}})(),f=r.map(y=>y.trim());d.value(e,h,f),(u=t.current)==null||u.setAttribute(H1,h),c.current=h}),c}var dSe=()=>{let[e,t]=k.useState(),a=V1(()=>new Map);return Rl(()=>{a.current.forEach(r=>r()),a.current=new Map},[e]),(r,c)=>{a.current.set(r,c),t({})}};function uSe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function $A({asChild:e,children:t},a){return e&&k.isValidElement(t)?k.cloneElement(uSe(t),{ref:t.ref},a(t.props.children)):a(t)}var hSe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function qA({...e}){return m.jsx(qT,{"data-slot":"dialog",...e})}function YU({...e}){return m.jsx(TU,{"data-slot":"dialog-trigger",...e})}function XU({...e}){return m.jsx(OT,{"data-slot":"dialog-portal",...e})}function DR({...e}){return m.jsx(DA,{"data-slot":"dialog-close",...e})}function WU({className:e,...t}){return m.jsx(HT,{"data-slot":"dialog-overlay",className:W("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 OA({className:e,children:t,...a}){return m.jsxs(XU,{"data-slot":"dialog-portal",children:[m.jsx(WU,{}),m.jsxs(VT,{"data-slot":"dialog-content",className:W("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,m.jsxs(DA,{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:[m.jsx(yr,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function HA({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:W("flex flex-col gap-2 text-center sm:text-left",e),...t})}function KU({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-footer",className:W("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function VA({className:e,...t}){return m.jsx(qU,{"data-slot":"dialog-title",className:W("text-lg leading-none font-semibold",e),...t})}function QU({className:e,...t}){return m.jsx(OU,{"data-slot":"dialog-description",className:W("text-muted-foreground text-sm",e),...t})}function FT({className:e,...t}){return m.jsx(Hl,{"data-slot":"command",className:W("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function pSe({title:e="Command Palette",description:t="Search for a command to run...",children:a,...r}){return m.jsxs(qA,{...r,children:[m.jsxs(HA,{className:"sr-only",children:[m.jsx(VA,{children:e}),m.jsx(QU,{children:t})]}),m.jsx(OA,{className:"overflow-hidden p-0",children:m.jsx(FT,{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:a})})]})}function JU({className:e,...t}){return m.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[m.jsx(Lu,{className:"size-4 shrink-0 opacity-50"}),m.jsx(Hl.Input,{"data-slot":"command-input",className:W("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 eG({className:e,...t}){return m.jsx(Hl.List,{"data-slot":"command-list",className:W("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function tG({...e}){return m.jsx(Hl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function nG({className:e,...t}){return m.jsx(Hl.Group,{"data-slot":"command-group",className:W("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 aG({className:e,...t}){return m.jsx(Hl.Separator,{"data-slot":"command-separator",className:W("bg-border -mx-1 h-px",e),...t})}function oG({className:e,...t}){return m.jsx(Hl.Item,{"data-slot":"command-item",className:W("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 fSe({className:e,...t}){return m.jsx("span",{"data-slot":"command-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var ySe=Object.defineProperty,Bt=(e,t)=>ySe(e,"name",{value:t,configurable:!0});function cd(e){const t=e+"CollectionProvider",[a,r]=qt(t),[c,d]=a(t,{collectionRef:{current:null},itemMap:new Map}),u=Bt(S=>{const{scope:C,children:L}=S,A=k.useRef(null),j=k.useRef(new Map).current;return m.jsx(c,{scope:C,itemMap:j,collectionRef:A,children:L})},"CollectionProvider");u.displayName=t;const h=e+"CollectionSlot",f=Ma(h),y=k.forwardRef((S,C)=>{const{scope:L,children:A}=S,j=d(h,L),E=Ee(C,j.collectionRef);return m.jsx(f,{ref:E,children:A})});y.displayName=h;const x=e+"CollectionItemSlot",g="data-radix-collection-item",b=Ma(x),M=k.forwardRef((S,C)=>{const{scope:L,children:A,...j}=S,E=k.useRef(null),z=Ee(C,E),R=d(x,L);return k.useEffect(()=>(R.itemMap.set(E,{ref:E,...j}),()=>{R.itemMap.delete(E)})),m.jsx(b,{[g]:"",ref:z,children:A})});M.displayName=x;function _(S){const C=d(e+"CollectionConsumer",S);return k.useCallback(()=>{const A=C.collectionRef.current;if(!A)return[];const j=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((R,$)=>j.indexOf(R.ref.current)-j.indexOf($.ref.current))},[C.collectionRef,C.itemMap])}return Bt(_,"useCollection"),[{Provider:u,Slot:y,ItemSlot:M},_,r]}Bt(cd,"createCollection");var pV=new WeakMap,Rt,Zn,KP=(Zn=class extends Map{constructor(a){super(a);XO(this,Rt);gP(this,Rt,[...super.keys()]),pV.set(this,!0)}set(a,r){return pV.get(this)&&(this.has(a)?Jt(this,Rt)[Jt(this,Rt).indexOf(a)]=a:Jt(this,Rt).push(a)),super.set(a,r),this}insert(a,r,c){const d=this.has(r),u=Jt(this,Rt).length,h=UT(a);let f=h>=0?h:u+h;const y=f<0||f>=u?-1:f;if(y===this.size||d&&y===this.size-1||y===-1)return this.set(r,c),this;const x=this.size+(d?0:1);h<0&&f++;const g=[...Jt(this,Rt)];let b,M=!1;for(let _=f;_<x;_++)if(f===_){let S=g[_];g[_]===r&&(S=g[_+1]),d&&this.delete(r),b=this.get(S),this.set(r,c)}else{!M&&g[_-1]===r&&(M=!0);const S=g[M?_:_-1],C=b;b=this.get(S),this.delete(S),this.set(S,C)}return this}with(a,r,c){const d=new Zn(this);return d.insert(a,r,c),d}before(a){const r=Jt(this,Rt).indexOf(a)-1;if(!(r<0))return this.entryAt(r)}setBefore(a,r,c){const d=Jt(this,Rt).indexOf(a);return d===-1?this:this.insert(d,r,c)}after(a){let r=Jt(this,Rt).indexOf(a);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(a,r,c){const d=Jt(this,Rt).indexOf(a);return d===-1?this:this.insert(d+1,r,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return gP(this,Rt,[]),super.clear()}delete(a){const r=super.delete(a);return r&&Jt(this,Rt).splice(Jt(this,Rt).indexOf(a),1),r}deleteAt(a){const r=this.keyAt(a);return r!==void 0?this.delete(r):!1}at(a){const r=eA(Jt(this,Rt),a);if(r!==void 0)return this.get(r)}entryAt(a){const r=eA(Jt(this,Rt),a);if(r!==void 0)return[r,this.get(r)]}indexOf(a){return Jt(this,Rt).indexOf(a)}keyAt(a){return eA(Jt(this,Rt),a)}from(a,r){const c=this.indexOf(a);if(c===-1)return;let d=c+r;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,r){const c=this.indexOf(a);if(c===-1)return;let d=c+r;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,r){let c=0;for(const d of this){if(Reflect.apply(a,r,[d,c,this]))return d;c++}}findIndex(a,r){let c=0;for(const d of this){if(Reflect.apply(a,r,[d,c,this]))return c;c++}return-1}filter(a,r){const c=[];let d=0;for(const u of this)Reflect.apply(a,r,[u,d,this])&&c.push(u),d++;return new Zn(c)}map(a,r){const c=[];let d=0;for(const u of this)c.push([u[0],Reflect.apply(a,r,[u,d,this])]),d++;return new Zn(c)}reduce(...a){const[r,c]=a;let d=0,u=c??this.at(0);for(const h of this)d===0&&a.length===1?u=h:u=Reflect.apply(r,this,[u,h,d,this]),d++;return u}reduceRight(...a){const[r,c]=a;let d=c??this.at(-1);for(let u=this.size-1;u>=0;u--){const h=this.at(u);u===this.size-1&&a.length===1?d=h:d=Reflect.apply(r,this,[d,h,u,this])}return d}toSorted(a){const r=[...this.entries()].sort(a);return new Zn(r)}toReversed(){const a=new Zn;for(let r=this.size-1;r>=0;r--){const c=this.keyAt(r),d=this.get(c);a.set(c,d)}return a}toSpliced(...a){const r=[...this.entries()];return r.splice(...a),new Zn(r)}slice(a,r){const c=new Zn;let d=this.size-1;if(a===void 0)return c;a<0&&(a=a+this.size),r!==void 0&&r>0&&(d=r-1);for(let u=a;u<=d;u++){const h=this.keyAt(u),f=this.get(h);c.set(h,f)}return c}every(a,r){let c=0;for(const d of this){if(!Reflect.apply(a,r,[d,c,this]))return!1;c++}return!0}some(a,r){let c=0;for(const d of this){if(Reflect.apply(a,r,[d,c,this]))return!0;c++}return!1}},Rt=new WeakMap,Bt(Zn,"OrderedDict"),Zn);function eA(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const a=rG(e,t);return a===-1?void 0:e[a]}Bt(eA,"at");function rG(e,t){const a=e.length,r=UT(t),c=r>=0?r:a+r;return c<0||c>=a?-1:c}Bt(rG,"toSafeIndex");function UT(e){return e!==e||e===0?0:Math.trunc(e)}Bt(UT,"toSafeInteger");function mSe(e){const t=e+"CollectionProvider",[a,r]=qt(t),[c,d]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new KP,setItemMap:Bt(()=>{},"setItemMap")}),u=Bt(({state:j,...E})=>j?m.jsx(f,{...E,state:j}):m.jsx(h,{...E}),"CollectionProvider");u.displayName=t;const h=Bt(j=>{const E=C();return m.jsx(f,{...j,state:E})},"CollectionInit");h.displayName=t+"Init";const f=Bt(j=>{const{scope:E,children:z,state:R}=j,$=k.useRef(null),[H,K]=k.useState(null),ae=Ee($,K),[Y,G]=R;return k.useEffect(()=>{if(!H)return;const J=sG(()=>{});return J.observe(H,{childList:!0,subtree:!0}),()=>{J.disconnect()}},[H]),m.jsx(c,{scope:E,itemMap:Y,setItemMap:G,collectionRef:ae,collectionRefObject:$,collectionElement:H,children:z})},"CollectionProviderImpl");f.displayName=t+"Impl";const y=e+"CollectionSlot",x=Ma(y),g=k.forwardRef((j,E)=>{const{scope:z,children:R}=j,$=d(y,z),H=Ee(E,$.collectionRef);return m.jsx(x,{ref:H,children:R})});g.displayName=y;const b=e+"CollectionItemSlot",M="data-radix-collection-item",_=Ma(b),S=k.forwardRef((j,E)=>{const{scope:z,children:R,...$}=j,H=k.useRef(null),[K,ae]=k.useState(null),Y=Ee(E,H,ae),G=d(b,z),{setItemMap:J}=G,oe=k.useRef($);iG(oe.current,$)||(oe.current=$);const he=oe.current;return k.useEffect(()=>{const N=he;return J(P=>K?P.has(K)?P.set(K,{...N,element:K}).toSorted(zR):(P.set(K,{...N,element:K}),P.toSorted(zR)):P),()=>{J(P=>!K||!P.has(K)?P:(P.delete(K),new KP(P)))}},[K,he,J]),m.jsx(_,{[M]:"",ref:Y,children:R})});S.displayName=b;function C(){return k.useState(new KP)}Bt(C,"useInitCollection");function L(j){const{itemMap:E}=d(e+"CollectionConsumer",j);return E}return Bt(L,"useCollection"),[{Provider:u,Slot:g,ItemSlot:S},{createCollectionScope:r,useCollection:L,useInitCollection:C}]}Bt(mSe,"createCollection");function iG(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}Bt(iG,"shallowEqual");function cG(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Bt(cG,"isElementPreceding");function zR(e,t){return!e[1].element||!t[1].element?0:cG(e[1].element,t[1].element)?-1:1}Bt(zR,"sortByDocumentPosition");function sG(e){return new MutationObserver(a=>{for(const r of a)if(r.type==="childList"){e();return}})}Bt(sG,"getChildListObserver");var kSe=Object.defineProperty,gSe=(e,t)=>kSe(e,"name",{value:t,configurable:!0}),vSe=k.createContext(void 0);function Vl(e){const t=k.useContext(vSe);return e||t||"ltr"}gSe(Vl,"useDirection");const xSe=["top","right","bottom","left"],gr=Math.min,Mo=Math.max,xA=Math.round,H0=Math.floor,wo=e=>({x:e,y:e}),bSe={left:"right",right:"left",bottom:"top",top:"bottom"};function lG(e,t,a){return Mo(e,gr(t,a))}function No(e,t){return typeof e=="function"?e(t):e}function vr(e){return e.split("-")[0]}function sd(e){return e.split("-")[1]}function GT(e){return e==="x"?"y":"x"}function ZT(e){return e==="y"?"height":"width"}function Va(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function YT(e){return GT(Va(e))}function MSe(e,t,a){a===void 0&&(a=!1);const r=sd(e),c=YT(e),d=ZT(c);let u=c==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[d]>t.floating[d]&&(u=bA(u)),[u,bA(u)]}function wSe(e){const t=bA(e);return[$R(e),t,$R(t)]}function $R(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const fV=["left","right"],yV=["right","left"],_Se=["top","bottom"],SSe=["bottom","top"];function CSe(e,t,a){switch(e){case"top":case"bottom":return a?t?yV:fV:t?fV:yV;case"left":case"right":return t?_Se:SSe;default:return[]}}function LSe(e,t,a,r){const c=sd(e);let d=CSe(vr(e),a==="start",r);return c&&(d=d.map(u=>u+"-"+c),t&&(d=d.concat(d.map($R)))),d}function bA(e){const t=vr(e);return bSe[t]+e.slice(t.length)}function NSe(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 dG(e){return typeof e!="number"?NSe(e):{top:e,right:e,bottom:e,left:e}}function MA(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 mV(e,t,a){let{reference:r,floating:c}=e;const d=Va(t),u=YT(t),h=ZT(u),f=vr(t),y=d==="y",x=r.x+r.width/2-c.width/2,g=r.y+r.height/2-c.height/2,b=r[h]/2-c[h]/2;let M;switch(f){case"top":M={x,y:r.y-c.height};break;case"bottom":M={x,y:r.y+r.height};break;case"right":M={x:r.x+r.width,y:g};break;case"left":M={x:r.x-c.width,y:g};break;default:M={x:r.x,y:r.y}}const _=sd(t);return _&&(M[u]+=b*(_==="end"?1:-1)*(a&&y?-1:1)),M}async function ISe(e,t){var a;t===void 0&&(t={});const{x:r,y:c,platform:d,rects:u,elements:h,strategy:f}=e,{boundary:y="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:b=!1,padding:M=0}=No(t,e),_=dG(M),C=h[b?g==="floating"?"reference":"floating":g],L=MA(await d.getClippingRect({element:(a=await(d.isElement==null?void 0:d.isElement(C)))==null||a?C:C.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(h.floating)),boundary:y,rootBoundary:x,strategy:f})),A=g==="floating"?{x:r,y:c,width:u.floating.width,height:u.floating.height}:u.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(h.floating)),E=await(d.isElement==null?void 0:d.isElement(j))&&await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1},z=MA(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:j,strategy:f}):A);return{top:(L.top-z.top+_.top)/E.y,bottom:(z.bottom-L.bottom+_.bottom)/E.y,left:(L.left-z.left+_.left)/E.x,right:(z.right-L.right+_.right)/E.x}}const ASe=50,jSe=async(e,t,a)=>{const{placement:r="bottom",strategy:c="absolute",middleware:d=[],platform:u}=a,h=u.detectOverflow?u:{...u,detectOverflow:ISe},f=await(u.isRTL==null?void 0:u.isRTL(t));let y=await u.getElementRects({reference:e,floating:t,strategy:c}),{x,y:g}=mV(y,r,f),b=r,M=0;const _={};for(let S=0;S<d.length;S++){const C=d[S];if(!C)continue;const{name:L,fn:A}=C,{x:j,y:E,data:z,reset:R}=await A({x,y:g,initialPlacement:r,placement:b,strategy:c,middlewareData:_,rects:y,platform:h,elements:{reference:e,floating:t}});x=j??x,g=E??g,_[L]={..._[L],...z},R&&M<ASe&&(M++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(y=R.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:c}):R.rects),{x,y:g}=mV(y,b,f)),S=-1)}return{x,y:g,placement:b,strategy:c,middlewareData:_}},ESe=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:r,placement:c,rects:d,platform:u,elements:h,middlewareData:f}=t,{element:y,padding:x=0}=No(e,t)||{};if(y==null)return{};const g=dG(x),b={x:a,y:r},M=YT(c),_=ZT(M),S=await u.getDimensions(y),C=M==="y",L=C?"top":"left",A=C?"bottom":"right",j=C?"clientHeight":"clientWidth",E=d.reference[_]+d.reference[M]-b[M]-d.floating[_],z=b[M]-d.reference[M],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(y));let $=R?R[j]:0;(!$||!await(u.isElement==null?void 0:u.isElement(R)))&&($=h.floating[j]||d.floating[_]);const H=E/2-z/2,K=$/2-S[_]/2-1,ae=gr(g[L],K),Y=gr(g[A],K),G=$-S[_]-Y,J=$/2-S[_]/2+H,oe=lG(ae,J,G),he=!f.arrow&&sd(c)!=null&&J!==oe&&d.reference[_]/2-(J<ae?ae:Y)-S[_]/2<0,N=he?J<ae?J-ae:J-G:0;return{[M]:b[M]+N,data:{[M]:oe,centerOffset:J-oe-N,...he&&{alignmentOffset:N}},reset:he}}}),PSe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,r;const{placement:c,middlewareData:d,rects:u,initialPlacement:h,platform:f,elements:y}=t,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:M="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:S=!0,...C}=No(e,t);if((a=d.arrow)!=null&&a.alignmentOffset)return{};const L=vr(c),A=Va(h),j=vr(h)===h,E=await(f.isRTL==null?void 0:f.isRTL(y.floating)),z=b||(j||!S?[bA(h)]:wSe(h)),R=_!=="none";!b&&R&&z.push(...LSe(h,S,_,E));const $=[h,...z],H=await f.detectOverflow(t,C),K=[];let ae=((r=d.flip)==null?void 0:r.overflows)||[];if(x&&K.push(H[L]),g){const oe=MSe(c,u,E);K.push(H[oe[0]],H[oe[1]])}if(ae=[...ae,{placement:c,overflows:K}],!K.every(oe=>oe<=0)){var Y,G;const oe=(((Y=d.flip)==null?void 0:Y.index)||0)+1,he=$[oe];if(he&&(!(g==="alignment"?A!==Va(he):!1)||ae.every(O=>Va(O.placement)===A?O.overflows[0]>0:!0)))return{data:{index:oe,overflows:ae},reset:{placement:he}};let N=(G=ae.filter(P=>P.overflows[0]<=0).sort((P,O)=>P.overflows[1]-O.overflows[1])[0])==null?void 0:G.placement;if(!N)switch(M){case"bestFit":{var J;const P=(J=ae.filter(O=>{if(R){const te=Va(O.placement);return te===A||te==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(te=>te>0).reduce((te,B)=>te+B,0)]).sort((O,te)=>O[1]-te[1])[0])==null?void 0:J[0];P&&(N=P);break}case"initialPlacement":N=h;break}if(c!==N)return{reset:{placement:N}}}return{}}}};function kV(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gV(e){return xSe.some(t=>e[t]>=0)}const RSe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:r}=t,{strategy:c="referenceHidden",...d}=No(e,t);switch(c){case"referenceHidden":{const u=await r.detectOverflow(t,{...d,elementContext:"reference"}),h=kV(u,a.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:gV(h)}}}case"escaped":{const u=await r.detectOverflow(t,{...d,altBoundary:!0}),h=kV(u,a.floating);return{data:{escapedOffsets:h,escaped:gV(h)}}}default:return{}}}}},uG=new Set(["left","top"]);async function TSe(e,t){const{placement:a,platform:r,elements:c}=e,d=await(r.isRTL==null?void 0:r.isRTL(c.floating)),u=vr(a),h=sd(a),f=Va(a)==="y",y=uG.has(u)?-1:1,x=d&&f?-1:1,g=No(t,e);let{mainAxis:b,crossAxis:M,alignmentAxis:_}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return h&&typeof _=="number"&&(M=h==="end"?_*-1:_),f?{x:M*x,y:b*y}:{x:b*y,y:M*x}}const DSe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,r;const{x:c,y:d,placement:u,middlewareData:h}=t,f=await TSe(t,e);return u===((a=h.offset)==null?void 0:a.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:c+f.x,y:d+f.y,data:{...f,placement:u}}}}},zSe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:r,placement:c,platform:d}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:f={fn:A=>{let{x:j,y:E}=A;return{x:j,y:E}}},...y}=No(e,t),x={x:a,y:r},g=await d.detectOverflow(t,y),b=Va(c),M=GT(b);let _=x[M],S=x[b];const C=(A,j)=>lG(j+g[A==="y"?"top":"left"],j,j-g[A==="y"?"bottom":"right"]);u&&(_=C(M,_)),h&&(S=C(b,S));const L=f.fn({...t,[M]:_,[b]:S});return{...L,data:{x:L.x-a,y:L.y-r,enabled:{[M]:u,[b]:h}}}}}},$Se=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,r;const{x:c,y:d,placement:u,rects:h,middlewareData:f}=t,{offset:y=0,mainAxis:x=!0,crossAxis:g=!0}=No(e,t),b={x:c,y:d},M=Va(u),_=GT(M);let S=b[_],C=b[M];const L=No(y,t),A=typeof L=="number"?{mainAxis:L,crossAxis:0}:{mainAxis:(a=L.mainAxis)!=null?a:0,crossAxis:(r=L.crossAxis)!=null?r:0};if(x){const z=_==="y"?"height":"width",R=h.reference[_]-h.floating[z]+A.mainAxis,$=h.reference[_]+h.reference[z]-A.mainAxis;S<R?S=R:S>$&&(S=$)}if(g){var j,E;const z=_==="y"?"width":"height",R=uG.has(vr(u)),$=h.reference[M]-h.floating[z]+(R&&((j=f.offset)==null?void 0:j[M])||0)+(R?0:A.crossAxis),H=h.reference[M]+h.reference[z]+(R?0:((E=f.offset)==null?void 0:E[M])||0)-(R?A.crossAxis:0);C<$?C=$:C>H&&(C=H)}return{[_]:S,[M]:C}}}},qSe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:r,platform:c,elements:d}=t,{apply:u=()=>{},...h}=No(e,t),f=await c.detectOverflow(t,h),y=vr(a),x=sd(a),g=Va(a)==="y",{width:b,height:M}=r.floating;let _,S;y==="top"||y==="bottom"?(_=y,S=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=y,_=x==="end"?"top":"bottom");const C=M-f.top-f.bottom,L=b-f.left-f.right,A=gr(M-f[_],C),j=gr(b-f[S],L),E=t.middlewareData.shift,z=!E;let R=A,$=j;E!=null&&E.enabled.x&&($=L),E!=null&&E.enabled.y&&(R=C),z&&!x&&(g?$=b-2*Mo(f.left,f.right):R=M-2*Mo(f.top,f.bottom)),await u({...t,availableWidth:$,availableHeight:R});const H=await c.getDimensions(d.floating);return b!==H.width||M!==H.height?{reset:{rects:!0}}:{}}}};function BA(){return typeof window<"u"}function ld(e){return hG(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Io(e){var t;return(t=(hG(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hG(e){return BA()?e instanceof Node||e instanceof zn(e).Node:!1}function Za(e){return BA()?e instanceof Element||e instanceof zn(e).Element:!1}function _r(e){return BA()?e instanceof HTMLElement||e instanceof zn(e).HTMLElement:!1}function vV(e){return!BA()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot}function FA(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 OSe(e){return/^(table|td|th)$/.test(ld(e))}function UA(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const HSe=/transform|translate|scale|rotate|perspective|filter/,VSe=/paint|layout|strict|content/,Wr=e=>!!e&&e!=="none";let QP;function XT(e){const t=Za(e)?Ya(e):e;return Wr(t.transform)||Wr(t.translate)||Wr(t.scale)||Wr(t.rotate)||Wr(t.perspective)||!WT()&&(Wr(t.backdropFilter)||Wr(t.filter))||HSe.test(t.willChange||"")||VSe.test(t.contain||"")}function BSe(e){let t=Tl(e);for(;_r(t)&&!qu(t);){if(XT(t))return t;if(UA(t))return null;t=Tl(t)}return null}function WT(){return QP==null&&(QP=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),QP}function qu(e){return/^(html|body|#document)$/.test(ld(e))}function Ya(e){return zn(e).getComputedStyle(e)}function GA(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tl(e){if(ld(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vV(e)&&e.host||Io(e);return vV(t)?t.host:t}function pG(e){const t=Tl(e);return qu(t)?(e.ownerDocument||e).body:_r(t)&&FA(t)?t:pG(t)}function Ou(e,t,a){var r;t===void 0&&(t=[]),a===void 0&&(a=!0);const c=pG(e),d=c===((r=e.ownerDocument)==null?void 0:r.body),u=zn(c);if(d){const h=qR(u);return t.concat(u,u.visualViewport||[],FA(c)?c:[],h&&a?Ou(h):[])}else return t.concat(c,Ou(c,[],a))}function qR(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fG(e){const t=Ya(e);let a=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const c=_r(e),d=c?e.offsetWidth:a,u=c?e.offsetHeight:r,h=xA(a)!==d||xA(r)!==u;return h&&(a=d,r=u),{width:a,height:r,$:h}}function KT(e){return Za(e)?e:e.contextElement}function W1(e){const t=KT(e);if(!_r(t))return wo(1);const a=t.getBoundingClientRect(),{width:r,height:c,$:d}=fG(t);let u=(d?xA(a.width):a.width)/r,h=(d?xA(a.height):a.height)/c;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const FSe=wo(0);function yG(e){const t=zn(e);return!WT()||!t.visualViewport?FSe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function USe(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===zn(e)}function Dl(e,t,a,r){t===void 0&&(t=!1),a===void 0&&(a=!1);const c=e.getBoundingClientRect(),d=KT(e);let u=wo(1);t&&(r?Za(r)&&(u=W1(r)):u=W1(e));const h=USe(d,a,r)?yG(d):wo(0);let f=(c.left+h.x)/u.x,y=(c.top+h.y)/u.y,x=c.width/u.x,g=c.height/u.y;if(d&&r){const b=zn(d),M=Za(r)?zn(r):r;let _=b,S=qR(_);for(;S&&M!==_;){const C=W1(S),L=S.getBoundingClientRect(),A=Ya(S),j=L.left+(S.clientLeft+parseFloat(A.paddingLeft))*C.x,E=L.top+(S.clientTop+parseFloat(A.paddingTop))*C.y;f*=C.x,y*=C.y,x*=C.x,g*=C.y,f+=j,y+=E,_=zn(S),S=qR(_)}}return MA({width:x,height:g,x:f,y})}function ZA(e,t){const a=GA(e).scrollLeft;return t?t.left+a:Dl(Io(e)).left+a}function mG(e,t){const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-ZA(e,a),c=a.top+t.scrollTop;return{x:r,y:c}}function GSe(e){let{elements:t,rect:a,offsetParent:r,strategy:c}=e;const d=c==="fixed",u=Io(r),h=t?UA(t.floating):!1;if(r===u||h&&d)return a;let f={scrollLeft:0,scrollTop:0},y=wo(1);const x=wo(0),g=_r(r);if((g||!d)&&((ld(r)!=="body"||FA(u))&&(f=GA(r)),g)){const M=Dl(r);y=W1(r),x.x=M.x+r.clientLeft,x.y=M.y+r.clientTop}const b=u&&!g&&!d?mG(u,f):wo(0);return{width:a.width*y.x,height:a.height*y.y,x:a.x*y.x-f.scrollLeft*y.x+x.x+b.x,y:a.y*y.y-f.scrollTop*y.y+x.y+b.y}}function ZSe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function YSe(e){const t=GA(e),a=e.ownerDocument.body,r=Mo(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),c=Mo(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let d=-t.scrollLeft+ZA(e);const u=-t.scrollTop;return Ya(a).direction==="rtl"&&(d+=Mo(e.clientWidth,a.clientWidth)-r),{width:r,height:c,x:d,y:u}}const XSe=25;function WSe(e,t,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",c=zn(e),d=Io(e),u=c.visualViewport;let h=d.clientWidth,f=d.clientHeight,y=0,x=0;if(u){const b=!WT()||t==="fixed";r?b||(y=-u.offsetLeft,x=-u.offsetTop):(h=u.width,f=u.height,b&&(y=u.offsetLeft,x=u.offsetTop))}if(ZA(d)<=0){const b=d.ownerDocument,M=b.body,_=getComputedStyle(M),S=b.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,C=Math.abs(d.clientWidth-M.clientWidth-S),L=getComputedStyle(d).scrollbarGutter==="stable both-edges"?C/2:C;L<=XSe&&(h-=L)}return{width:h,height:f,x:y,y:x}}function KSe(e,t){const a=Dl(e,!0,t==="fixed"),r=a.top+e.clientTop,c=a.left+e.clientLeft,d=W1(e),u=e.clientWidth*d.x,h=e.clientHeight*d.y,f=c*d.x,y=r*d.y;return{width:u,height:h,x:f,y}}function xV(e,t,a){let r;if(t==="viewport"||t==="layoutViewport")r=WSe(e,a,t);else if(t==="document")r=YSe(Io(e));else if(Za(t))r=KSe(t,a);else{const c=yG(e);r={x:t.x-c.x,y:t.y-c.y,width:t.width,height:t.height}}return MA(r)}function QSe(e,t){const a=t.get(e);if(a)return a;let r=Ou(e,[],!1).filter(h=>Za(h)&&ld(h)!=="body"),c=null;const d=Ya(e).position==="fixed";let u=d?Tl(e):e;for(;Za(u)&&!qu(u);){const h=Ya(u),f=XT(u),y=c?c.position:d?"fixed":"";!f&&(y==="fixed"||y==="absolute"&&h.position==="static")?r=r.filter(g=>g!==u):c=h,u=Tl(u)}return t.set(e,r),r}function JSe(e){let{element:t,boundary:a,rootBoundary:r,strategy:c}=e;const u=[...a==="clippingAncestors"?UA(t)?[]:QSe(t,this._c):[].concat(a),r],h=xV(t,u[0],c);let f=h.top,y=h.right,x=h.bottom,g=h.left;for(let b=1;b<u.length;b++){const M=xV(t,u[b],c);f=Mo(M.top,f),y=gr(M.right,y),x=gr(M.bottom,x),g=Mo(M.left,g)}return{width:y-g,height:x-f,x:g,y:f}}function eCe(e){const{width:t,height:a}=fG(e);return{width:t,height:a}}function tCe(e,t,a){const r=_r(t),c=Io(t),d=a==="fixed",u=Dl(e,!0,d,t);let h={scrollLeft:0,scrollTop:0};const f=wo(0);if((r||!d)&&((ld(t)!=="body"||FA(c))&&(h=GA(t)),r)){const b=Dl(t,!0,d,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!r&&c&&(f.x=ZA(c));const y=c&&!r&&!d?mG(c,h):wo(0),x=u.left+h.scrollLeft-f.x-y.x,g=u.top+h.scrollTop-f.y-y.y;return{x,y:g,width:u.width,height:u.height}}function JP(e){return Ya(e).position==="static"}function bV(e,t){if(!_r(e)||Ya(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Io(e)===a&&(a=a.ownerDocument.body),a}function kG(e,t){const a=zn(e);if(UA(e))return a;if(!_r(e)){let c=Tl(e);for(;c&&!qu(c);){if(Za(c)&&!JP(c))return c;c=Tl(c)}return a}let r=bV(e,t);for(;r&&OSe(r)&&JP(r);)r=bV(r,t);return r&&qu(r)&&JP(r)&&!XT(r)?a:r||BSe(e)||a}const nCe=async function(e){const t=this.getOffsetParent||kG,a=this.getDimensions,r=await a(e.floating);return{reference:tCe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function aCe(e){return Ya(e).direction==="rtl"}const oCe={convertOffsetParentRelativeRectToViewportRelativeRect:GSe,getDocumentElement:Io,getClippingRect:JSe,getOffsetParent:kG,getElementRects:nCe,getClientRects:ZSe,getDimensions:eCe,getScale:W1,isElement:Za,isRTL:aCe};function gG(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rCe(e,t,a){let r=null,c;const d=Io(e);function u(){var x;clearTimeout(c),(x=r)==null||x.disconnect(),r=null}function h(x,g){x===void 0&&(x=!1),g===void 0&&(g=1),u();const b=e.getBoundingClientRect(),{left:M,top:_,width:S,height:C}=b;if(x||t(),!S||!C)return;const L=H0(_),A=H0(d.clientWidth-(M+S)),j=H0(d.clientHeight-(_+C)),E=H0(M),R={rootMargin:-L+"px "+-A+"px "+-j+"px "+-E+"px",threshold:Mo(0,gr(1,g))||1};let $=!0;function H(K){const ae=K[0].intersectionRatio;if(!gG(b,e.getBoundingClientRect()))return h();if(ae!==g){if(!$)return h();ae?h(!1,ae):c=setTimeout(()=>{h(!1,1e-7)},1e3)}$=!1}try{r=new IntersectionObserver(H,{...R,root:d.ownerDocument})}catch{r=new IntersectionObserver(H,R)}r.observe(e)}const f=zn(e),y=()=>h(a);return f.addEventListener("resize",y),h(!0),()=>{f.removeEventListener("resize",y),u()}}function iCe(e,t,a,r){r===void 0&&(r={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,y=KT(e),x=c||d?[...y?Ou(y):[],...t?Ou(t):[]]:[];x.forEach(L=>{c&&L.addEventListener("scroll",a),d&&L.addEventListener("resize",a)});const g=y&&h?rCe(y,a,d):null;let b=-1,M=null;u&&(M=new ResizeObserver(L=>{let[A]=L;A&&A.target===y&&M&&t&&(M.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var j;(j=M)==null||j.observe(t)})),a()}),y&&!f&&M.observe(y),t&&M.observe(t));let _,S=f?Dl(e):null;f&&C();function C(){const L=Dl(e);S&&!gG(S,L)&&a(),S=L,_=requestAnimationFrame(C)}return a(),()=>{var L;x.forEach(A=>{c&&A.removeEventListener("scroll",a),d&&A.removeEventListener("resize",a)}),g?.(),(L=M)==null||L.disconnect(),M=null,f&&cancelAnimationFrame(_)}}const cCe=DSe,sCe=zSe,lCe=PSe,dCe=qSe,uCe=RSe,MV=ESe,hCe=$Se,pCe=(e,t,a)=>{const r=new Map,c=a??{},d={...oCe,...c.platform,_c:r};return jSe(e,t,{...c,platform:d})};var fCe=typeof document<"u",yCe=function(){},tA=fCe?k.useLayoutEffect:yCe;function wA(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(!wA(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 d=c[r];if(!(d==="_owner"&&e.$$typeof)&&!wA(e[d],t[d]))return!1}return!0}return e!==e&&t!==t}function vG(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wV(e,t){const a=vG(e);return Math.round(t*a)/a}function eR(e){const t=k.useRef(e);return tA(()=>{t.current=e}),t}function mCe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:r=[],platform:c,elements:{reference:d,floating:u}={},transform:h=!0,whileElementsMounted:f,open:y}=e,[x,g]=k.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[b,M]=k.useState(r);wA(b,r)||M(r);const[_,S]=k.useState(null),[C,L]=k.useState(null),A=k.useCallback(O=>{O!==R.current&&(R.current=O,S(O))},[]),j=k.useCallback(O=>{O!==$.current&&($.current=O,L(O))},[]),E=d||_,z=u||C,R=k.useRef(null),$=k.useRef(null),H=k.useRef(x),K=f!=null,ae=eR(f),Y=eR(c),G=eR(y),J=k.useCallback(()=>{if(!R.current||!$.current)return;const O={placement:t,strategy:a,middleware:b};Y.current&&(O.platform=Y.current),pCe(R.current,$.current,O).then(te=>{const B={...te,isPositioned:G.current!==!1};oe.current&&!wA(H.current,B)&&(H.current=B,$l.flushSync(()=>{g(B)}))})},[b,t,a,Y,G]);tA(()=>{y===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,g(O=>({...O,isPositioned:!1})))},[y]);const oe=k.useRef(!1);tA(()=>(oe.current=!0,()=>{oe.current=!1}),[]),tA(()=>{if(E&&(R.current=E),z&&($.current=z),E&&z){if(ae.current)return ae.current(E,z,J);J()}},[E,z,J,ae,K]);const he=k.useMemo(()=>({reference:R,floating:$,setReference:A,setFloating:j}),[A,j]),N=k.useMemo(()=>({reference:E,floating:z}),[E,z]),P=k.useMemo(()=>{const O={position:a,left:0,top:0};if(!N.floating)return O;const te=wV(N.floating,x.x),B=wV(N.floating,x.y);return h?{...O,transform:"translate("+te+"px, "+B+"px)",...vG(N.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:te,top:B}},[a,h,N.floating,x.x,x.y]);return k.useMemo(()=>({...x,update:J,refs:he,elements:N,floatingStyles:P}),[x,J,he,N,P])}const kCe=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?MV({element:r.current,padding:c}).fn(a):{}:r?MV({element:r,padding:c}).fn(a):{}}}},gCe=(e,t)=>{const a=cCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},vCe=(e,t)=>{const a=sCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},xCe=(e,t)=>({fn:hCe(e).fn,options:[e,t]}),bCe=(e,t)=>{const a=lCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},MCe=(e,t)=>{const a=dCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},wCe=(e,t)=>{const a=uCe(e);return{name:a.name,fn:a.fn,options:[e,t]}},_Ce=(e,t)=>{const a=kCe(e);return{name:a.name,fn:a.fn,options:[e,t]}};var SCe=Object.defineProperty,CCe=(e,t)=>SCe(e,"name",{value:t,configurable:!0}),LCe=k.forwardRef(CCe(function(t,a){const{children:r,width:c=10,height:d=5,...u}=t;return m.jsx(ge.svg,{...u,ref:a,width:c,height:d,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:m.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),NCe=LCe,ICe=Object.defineProperty,_o=(e,t)=>ICe(e,"name",{value:t,configurable:!0}),xG="Popper",[bG,Sr]=qt(xG),[ACe,MG]=bG(xG),jCe=_o(e=>{const{__scopePopper:t,children:a}=e,[r,c]=k.useState(null),[d,u]=k.useState(void 0);return m.jsx(ACe,{scope:t,anchor:r,onAnchorChange:c,placementState:d,setPlacementState:u,children:a})},"Popper"),ECe="PopperAnchor",PCe=k.forwardRef(_o(function(t,a){const{__scopePopper:r,virtualRef:c,...d}=t,u=MG(ECe,r),h=k.useRef(null),f=u.onAnchorChange,y=k.useCallback(S=>{h.current=S,S&&f(S)},[f]),x=Ee(a,y),g=k.useRef(null);k.useEffect(()=>{if(!c)return;const S=g.current;g.current=c.current,S!==g.current&&f(g.current)});const b=u.placementState&&YA(u.placementState),M=b?.[0],_=b?.[1];return c?null:m.jsx(ge.div,{"data-radix-popper-side":M,"data-radix-popper-align":_,...d,ref:x})},"PopperAnchor")),wG="PopperContent",[RCe,TCe]=bG(wG),DCe=k.forwardRef(_o(function(t,a){const{__scopePopper:r,side:c="bottom",sideOffset:d=0,align:u="center",alignOffset:h=0,arrowPadding:f=0,avoidCollisions:y=!0,collisionBoundary:x=[],collisionPadding:g=0,sticky:b="partial",hideWhenDetached:M=!1,updatePositionStrategy:_="optimized",onPlaced:S,...C}=t,L=MG(wG,r),[A,j]=k.useState(null),E=Ee(a,j),[z,R]=k.useState(null),$=t2(z),H=$?.width??0,K=$?.height??0,ae=c+(u!=="center"?"-"+u:""),Y=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},G=Array.isArray(x)?x:[x],J=G.length>0,oe={padding:Y,boundary:G.filter(_G),altBoundary:J},{refs:he,floatingStyles:N,placement:P,isPositioned:O,middlewareData:te}=mCe({strategy:"fixed",placement:ae,whileElementsMounted:_o((...se)=>iCe(...se,{animationFrame:_==="always"}),"whileElementsMounted"),elements:{reference:L.anchor},middleware:[gCe({mainAxis:d+K,alignmentAxis:h}),y&&vCe({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?xCe():void 0,...oe}),y&&bCe({...oe}),MCe({...oe,apply:_o(({elements:se,rects:_e,availableWidth:ve,availableHeight:Ne})=>{const{width:Re,height:qe}=_e.reference,xe=se.floating.style;xe.setProperty("--radix-popper-available-width",`${ve}px`),xe.setProperty("--radix-popper-available-height",`${Ne}px`),xe.setProperty("--radix-popper-anchor-width",`${Re}px`),xe.setProperty("--radix-popper-anchor-height",`${qe}px`)},"apply")}),z&&_Ce({element:z,padding:f}),OCe({arrowWidth:H,arrowHeight:K}),M&&wCe({strategy:"referenceHidden",...oe,boundary:J?oe.boundary:void 0})]}),B=L.setPlacementState;mt(()=>(B(P),()=>{B(void 0)}),[P,B]);const[D,T]=YA(P),U=yn(S);mt(()=>{O&&U?.()},[O,U]);const X=te.arrow?.x,Z=te.arrow?.y,ce=te.arrow?.centerOffset!==0,[pe,ie]=k.useState();return mt(()=>{A&&ie(window.getComputedStyle(A).zIndex)},[A]),m.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:O?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(RCe,{scope:r,placedSide:D,placedAlign:T,onArrowChange:R,arrowX:X,arrowY:Z,shouldHideArrow:ce,children:m.jsx(ge.div,{"data-side":D,"data-align":T,...C,ref:E,style:{...C.style,animation:O?C.style?.animation:"none"}})})})},"PopperContent")),zCe="PopperArrow",$Ce={top:"bottom",right:"left",bottom:"top",left:"right"},qCe=k.forwardRef(_o(function(t,a){const{__scopePopper:r,...c}=t,d=TCe(zCe,r),u=$Ce[d.placedSide];return m.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:m.jsx(NCe,{...c,ref:a,style:{...c.style,display:"block"}})})},"PopperArrow"));function _G(e){return e!==null}_o(_G,"isNotNull");var OCe=_o(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,f=u?0:e.arrowHeight,[y,x]=YA(a),g={start:"0%",center:"50%",end:"100%"}[x],b=(c.arrow?.x??0)+h/2,M=(c.arrow?.y??0)+f/2;let _="",S="";return y==="bottom"?(_=u?g:`${b}px`,S=`${-f}px`):y==="top"?(_=u?g:`${b}px`,S=`${r.floating.height+f}px`):y==="right"?(_=`${-f}px`,S=u?g:`${M}px`):y==="left"&&(_=`${r.floating.width+f}px`,S=u?g:`${M}px`),{data:{x:_,y:S}}}}),"transformOrigin");function YA(e){const[t,a="center"]=e.split("-");return[t,a]}_o(YA,"getSideAndAlignFromPlacement");var i2=jCe,c2=PCe,XA=DCe,HCe=qCe,VCe=Object.defineProperty,QT=(e,t)=>VCe(e,"name",{value:t,configurable:!0}),tR=!1;function SG(){const[e,t]=k.useState(tR);return k.useEffect(()=>{tR||(tR=!0,t(!0))},[]),e}QT(SG,"useIsHydrated");var CG=ad[" useSyncExternalStore ".trim().toString()];function LG(){return()=>{}}QT(LG,"subscribe");function NG(){return CG(LG,()=>!0,()=>!1)}QT(NG,"useIsHydratedModern");var BCe=typeof CG=="function"?NG:SG,FCe=Object.defineProperty,Bl=(e,t)=>FCe(e,"name",{value:t,configurable:!0}),nR="rovingFocusGroup.onEntryFocus",UCe={bubbles:!1,cancelable:!0},WA="RovingFocusGroup",[OR,IG,GCe]=cd(WA),[ZCe,dd]=qt(WA,[GCe]),[YCe,XCe]=ZCe(WA),WCe=k.forwardRef(Bl(function(t,a){return m.jsx(OR.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(OR.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(KCe,{...t,ref:a})})})},"RovingFocusGroup")),KCe=k.forwardRef(Bl(function(t,a){const{__scopeRovingFocusGroup:r,orientation:c,loop:d=!1,dir:u,currentTabStopId:h,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:y,onEntryFocus:x,preventScrollOnEntryFocus:g=!1,...b}=t,M=k.useRef(null),_=Ee(a,M),S=Vl(u),[C,L]=Ut({prop:h,defaultProp:f??null,onChange:y,caller:WA}),[A,j]=k.useState(!1),E=yn(x),z=IG(r),R=k.useRef(!1),[$,H]=k.useState(0);return k.useEffect(()=>{const K=M.current;if(K)return K.addEventListener(nR,E),()=>K.removeEventListener(nR,E)},[E]),m.jsx(YCe,{scope:r,orientation:c,dir:S,loop:d,currentTabStopId:C,onItemFocus:k.useCallback(K=>L(K),[L]),onItemShiftTab:k.useCallback(()=>j(!0),[]),onFocusableItemAdd:k.useCallback(()=>H(K=>K+1),[]),onFocusableItemRemove:k.useCallback(()=>H(K=>K-1),[]),children:m.jsx(ge.div,{tabIndex:A||$===0?-1:0,"data-orientation":c,...b,ref:_,style:{outline:"none",...t.style},onMouseDown:fe(t.onMouseDown,()=>{R.current=!0}),onFocus:fe(t.onFocus,K=>{const ae=!R.current;if(K.target===K.currentTarget&&ae&&!A){const Y=new CustomEvent(nR,UCe);if(K.currentTarget.dispatchEvent(Y),!Y.defaultPrevented){const G=z().filter(P=>P.focusable),J=G.find(P=>P.active),oe=G.find(P=>P.id===C),N=[J,oe,...G].filter(Boolean).map(P=>P.ref.current);JT(N,g)}}R.current=!1}),onBlur:fe(t.onBlur,()=>j(!1))})})},"RovingFocusGroupImpl")),QCe="RovingFocusGroupItem",JCe=k.forwardRef(Bl(function(t,a){const{__scopeRovingFocusGroup:r,focusable:c=!0,active:d=!1,tabStopId:u,children:h,...f}=t,y=kt(),x=u||y,g=XCe(QCe,r),b=g.currentTabStopId===x,M=IG(r),{onFocusableItemAdd:_,onFocusableItemRemove:S,currentTabStopId:C}=g,L=BCe();return mt(()=>{if(!(!L||!c))return _(),()=>S()},[L,c,_,S]),k.useEffect(()=>{if(!(L||!c))return _(),()=>S()},[L,c,_,S]),m.jsx(OR.ItemSlot,{scope:r,id:x,focusable:c,active:d,children:m.jsx(ge.span,{tabIndex:b?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:fe(t.onMouseDown,A=>{c?g.onItemFocus(x):A.preventDefault()}),onFocus:fe(t.onFocus,()=>g.onItemFocus(x)),onKeyDown:fe(t.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){g.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const j=jG(A,g.orientation,g.dir);if(j!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let z=M().filter(R=>R.focusable).map(R=>R.ref.current);if(j==="last")z.reverse();else if(j==="prev"||j==="next"){j==="prev"&&z.reverse();const R=z.indexOf(A.currentTarget);z=g.loop?EG(z,R+1):z.slice(R+1)}setTimeout(()=>JT(z))}}),children:typeof h=="function"?h({isCurrentTabStop:b,hasTabStop:C!=null}):h})})},"RovingFocusGroupItem")),eLe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function AG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Bl(AG,"getDirectionAwareKey");function jG(e,t,a){const r=AG(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eLe[r]}Bl(jG,"getFocusIntent");function JT(e,t=!1){const a=document.activeElement;for(const r of e)if(r===a||(r.focus({preventScroll:t}),document.activeElement!==a))return}Bl(JT,"focusFirst");function EG(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Bl(EG,"wrapArray");var eD=WCe,tD=JCe,tLe=Object.defineProperty,Xe=(e,t)=>tLe(e,"name",{value:t,configurable:!0}),HR=["Enter"," "],nLe=["ArrowDown","PageUp","Home"],PG=["ArrowUp","PageDown","End"],aLe=[...nLe,...PG],oLe={ltr:[...HR,"ArrowRight"],rtl:[...HR,"ArrowLeft"]},rLe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},KA="Menu",[Hu,iLe,cLe]=cd(KA),[Fl,s2]=qt(KA,[cLe,Sr,dd]),QA=Sr(),RG=dd(),[TG,Cr]=Fl(KA),[sLe,l2]=Fl(KA),lLe=Xe(e=>{const{__scopeMenu:t,open:a=!1,children:r,dir:c,onOpenChange:d,modal:u=!0}=e,h=QA(t),[f,y]=k.useState(null),x=k.useRef(!1),g=yn(d),b=Vl(c);return k.useEffect(()=>{const M=Xe(()=>{x.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},"handleKeyDown"),_=Xe(()=>x.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})}},[]),k.useEffect(()=>{if(!a)return;const M=Xe(()=>g(!1),"handleBlur");return window.addEventListener("blur",M),()=>window.removeEventListener("blur",M)},[a,g]),m.jsx(i2,{...h,children:m.jsx(TG,{scope:t,open:a,onOpenChange:g,content:f,onContentChange:y,children:m.jsx(sLe,{scope:t,onClose:k.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:x,dir:b,modal:u,children:r})})})},"Menu"),DG=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t,d=QA(r);return m.jsx(c2,{...d,...c,ref:a})},"MenuAnchor")),zG="MenuPortal",[dLe,$G]=Fl(zG,{forceMount:void 0}),uLe=Xe(e=>{const{__scopeMenu:t,forceMount:a,children:r,container:c}=e,d=Cr(zG,t);return m.jsx(dLe,{scope:t,forceMount:a,children:m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:r})})})},"MenuPortal"),ba="MenuContent",[hLe,nD]=Fl(ba),pLe=k.forwardRef(Xe(function(t,a){const r=$G(ba,t.__scopeMenu),{forceMount:c=r.forceMount,...d}=t,u=Cr(ba,t.__scopeMenu),h=l2(ba,t.__scopeMenu);return m.jsx(Hu.Provider,{scope:t.__scopeMenu,children:m.jsx(kn,{present:c||u.open,children:m.jsx(Hu.Slot,{scope:t.__scopeMenu,children:h.modal?m.jsx(fLe,{...d,ref:a}):m.jsx(yLe,{...d,ref:a})})})})},"MenuContent")),fLe=k.forwardRef(Xe(function(t,a){const r=Cr(ba,t.__scopeMenu),c=k.useRef(null),d=Ee(a,c);return k.useEffect(()=>{const u=c.current;if(u)return TA(u)},[]),m.jsx(aD,{...t,ref:d,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:fe(t.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),yLe=k.forwardRef(Xe(function(t,a){const r=Cr(ba,t.__scopeMenu);return m.jsx(aD,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),mLe=Ma("MenuContent.ScrollLock"),aD=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,loop:c=!1,trapFocus:d,onOpenAutoFocus:u,onCloseAutoFocus:h,disableOutsidePointerEvents:f,onEntryFocus:y,onEscapeKeyDown:x,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:M,onDismiss:_,disableOutsideScroll:S,...C}=t,L=Cr(ba,r),A=l2(ba,r),j=QA(r),E=RG(r),z=iLe(r),[R,$]=k.useState(null),H=k.useRef(null),K=Ee(a,H,L.onContentChange),ae=k.useRef(0),Y=k.useRef(""),G=k.useRef(0),J=k.useRef(null),oe=k.useRef("right"),he=k.useRef(0),N=S?o2:k.Fragment,P=S?{as:mLe,allowPinchZoom:!0}:void 0,O=Xe(B=>{const D=Y.current+B,T=z().filter(ie=>!ie.disabled),U=document.activeElement,X=T.find(ie=>ie.ref.current===U)?.textValue,Z=T.map(ie=>ie.textValue),ce=ZG(Z,D,X),pe=T.find(ie=>ie.textValue===ce)?.ref.current;Xe((function ie(se){Y.current=se,window.clearTimeout(ae.current),se!==""&&(ae.current=window.setTimeout(()=>ie(""),1e3))}),"updateSearch")(D),pe&&setTimeout(()=>pe.focus())},"handleTypeaheadSearch");k.useEffect(()=>()=>window.clearTimeout(ae.current),[]),id();const te=k.useCallback(B=>oe.current===J.current?.side&&XG(B,J.current?.area),[]);return m.jsx(hLe,{scope:r,searchRef:Y,onItemEnter:k.useCallback(B=>{te(B)&&B.preventDefault()},[te]),onItemLeave:k.useCallback(B=>{te(B)||(H.current?.focus(),$(null))},[te]),onTriggerLeave:k.useCallback(B=>{te(B)&&B.preventDefault()},[te]),pointerGraceTimerRef:G,onPointerGraceIntentChange:k.useCallback(B=>{J.current=B},[]),children:m.jsx(N,{...P,children:m.jsx(PA,{asChild:!0,trapped:d,onMountAutoFocus:fe(u,B=>{B.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:x,onPointerDownOutside:g,onFocusOutside:b,onInteractOutside:M,onDismiss:_,children:m.jsx(eD,{asChild:!0,...E,dir:A.dir,orientation:"vertical",loop:c,currentTabStopId:R,onCurrentTabStopIdChange:$,onEntryFocus:fe(y,B=>{A.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(XA,{role:"menu","aria-orientation":"vertical","data-state":rD(L.open),"data-radix-menu-content":"",dir:A.dir,...j,...C,ref:K,style:{outline:"none",...C.style},onKeyDown:fe(C.onKeyDown,B=>{const T=B.target.closest("[data-radix-menu-content]")===B.currentTarget,U=B.ctrlKey||B.altKey||B.metaKey,X=B.key.length===1;T&&(B.key==="Tab"&&B.preventDefault(),!U&&X&&O(B.key));const Z=H.current;if(B.target!==Z||!aLe.includes(B.key))return;B.preventDefault();const pe=z().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);PG.includes(B.key)&&pe.reverse(),UG(pe)}),onBlur:fe(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(ae.current),Y.current="")}),onPointerMove:fe(t.onPointerMove,ed(B=>{const D=B.target,T=he.current!==B.clientX;if(B.currentTarget.contains(D)&&T){const U=B.clientX>he.current?"right":"left";oe.current=U,he.current=B.clientX}}))})})})})})})},"MenuContentImpl")),qG=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return m.jsx(ge.div,{role:"group",...c,ref:a})},"MenuGroup")),kLe=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return m.jsx(ge.div,{...c,ref:a})},"MenuLabel")),VR="MenuItem",_V="menu.itemSelect",oD=k.forwardRef(Xe(function(t,a){const{disabled:r=!1,onSelect:c,...d}=t,u=k.useRef(null),h=l2(VR,t.__scopeMenu),f=nD(VR,t.__scopeMenu),y=Ee(a,u),x=k.useRef(!1),g=Xe(()=>{const b=u.current;if(!r&&b){const M=new CustomEvent(_V,{bubbles:!0,cancelable:!0});b.addEventListener(_V,_=>c?.(_),{once:!0}),yT(b,M),M.defaultPrevented?x.current=!1:h.onClose()}},"handleSelect");return m.jsx(OG,{...d,ref:y,disabled:r,onClick:fe(t.onClick,g),onPointerDown:b=>{t.onPointerDown?.(b),x.current=!0},onPointerUp:fe(t.onPointerUp,b=>{x.current||b.currentTarget?.click()}),onKeyDown:fe(t.onKeyDown,b=>{r||b.target!==b.currentTarget||f.searchRef.current!==""&&b.key===" "||HR.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),OG=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,disabled:c=!1,textValue:d,...u}=t,h=nD(VR,r),f=RG(r),y=k.useRef(null),x=Ee(a,y),[g,b]=k.useState(!1),[M,_]=k.useState("");return k.useEffect(()=>{const S=y.current;S&&_((S.textContent??"").trim())},[u.children]),m.jsx(Hu.ItemSlot,{scope:r,disabled:c,textValue:d??M,children:m.jsx(tD,{asChild:!0,...f,focusable:!c,children:m.jsx(ge.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...u,ref:x,onPointerMove:fe(t.onPointerMove,ed(S=>{c?h.onItemLeave(S):(h.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fe(t.onPointerLeave,ed(S=>h.onItemLeave(S))),onFocus:fe(t.onFocus,()=>b(!0)),onBlur:fe(t.onBlur,()=>b(!1))})})})},"MenuItemImpl")),gLe=k.forwardRef(Xe(function(t,a){const{checked:r=!1,onCheckedChange:c,...d}=t;return m.jsx(VG,{scope:t.__scopeMenu,checked:r,children:m.jsx(oD,{role:"menuitemcheckbox","aria-checked":Vu(r)?"mixed":r,...d,ref:a,"data-state":JA(r),onSelect:fe(d.onSelect,()=>c?.(Vu(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),vLe="MenuRadioGroup",[xLe,bLe]=Fl(vLe,{value:void 0,onValueChange:Xe(()=>{},"onValueChange")}),MLe=k.forwardRef(Xe(function(t,a){const{value:r,onValueChange:c,...d}=t,u=yn(c);return m.jsx(xLe,{scope:t.__scopeMenu,value:r,onValueChange:u,children:m.jsx(qG,{...d,ref:a})})},"MenuRadioGroup")),wLe="MenuRadioItem",_Le=k.forwardRef(Xe(function(t,a){const{value:r,...c}=t,d=bLe(wLe,t.__scopeMenu),u=r===d.value;return m.jsx(VG,{scope:t.__scopeMenu,checked:u,children:m.jsx(oD,{role:"menuitemradio","aria-checked":u,...c,ref:a,"data-state":JA(u),onSelect:fe(c.onSelect,()=>d.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),HG="MenuItemIndicator",[VG,SLe]=Fl(HG,{checked:!1}),CLe=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,forceMount:c,...d}=t,u=SLe(HG,r);return m.jsx(kn,{present:c||Vu(u.checked)||u.checked===!0,children:m.jsx(ge.span,{...d,ref:a,"data-state":JA(u.checked)})})},"MenuItemIndicator")),LLe=k.forwardRef(Xe(function(t,a){const{__scopeMenu:r,...c}=t;return m.jsx(ge.div,{role:"separator","aria-orientation":"horizontal",...c,ref:a})},"MenuSeparator")),BG="MenuSub",[NLe,FG]=Fl(BG),ILe=Xe(e=>{const{__scopeMenu:t,children:a,open:r=!1,onOpenChange:c}=e,d=Cr(BG,t),u=QA(t),[h,f]=k.useState(null),[y,x]=k.useState(null),g=yn(c);return k.useEffect(()=>(d.open===!1&&g(!1),()=>g(!1)),[d.open,g]),m.jsx(i2,{...u,children:m.jsx(TG,{scope:t,open:r,onOpenChange:g,content:y,onContentChange:x,children:m.jsx(NLe,{scope:t,contentId:kt(),triggerId:kt(),trigger:h,onTriggerChange:f,children:a})})})},"MenuSub"),V0="MenuSubTrigger",ALe=k.forwardRef(Xe(function(t,a){const r=Cr(V0,t.__scopeMenu),c=l2(V0,t.__scopeMenu),d=FG(V0,t.__scopeMenu),u=nD(V0,t.__scopeMenu),h=k.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:y}=u,x={__scopeMenu:t.__scopeMenu},g=k.useCallback(()=>{h.current&&window.clearTimeout(h.current),h.current=null},[]);k.useEffect(()=>g,[g]),k.useEffect(()=>{const M=f.current;return()=>{window.clearTimeout(M),y(null)}},[f,y]);const b=Ee(a,d.onTriggerChange);return m.jsx(DG,{asChild:!0,...x,children:m.jsx(OG,{id:d.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?d.contentId:void 0,"data-state":rD(r.open),...t,ref:b,onClick:M=>{t.onClick?.(M),!(t.disabled||M.defaultPrevented)&&(M.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:fe(t.onPointerMove,ed(M=>{u.onItemEnter(M),!M.defaultPrevented&&!t.disabled&&!r.open&&!h.current&&(u.onPointerGraceIntentChange(null),h.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:fe(t.onPointerLeave,ed(M=>{g();const _=r.content?.getBoundingClientRect();if(_){const S=r.content?.dataset.side,C=S==="right",L=C?-5:5,A=_[C?"left":"right"],j=_[C?"right":"left"];u.onPointerGraceIntentChange({area:[{x:M.clientX+L,y:M.clientY},{x:A,y:_.top},{x:j,y:_.top},{x:j,y:_.bottom},{x:A,y:_.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(M),M.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:fe(t.onKeyDown,M=>{t.disabled||M.target!==M.currentTarget||u.searchRef.current!==""&&M.key===" "||oLe[c.dir].includes(M.key)&&(r.onOpenChange(!0),r.content?.focus(),M.preventDefault())})})})},"MenuSubTrigger")),jLe="MenuSubContent",ELe=k.forwardRef(Xe(function(t,a){const r=$G(ba,t.__scopeMenu),{forceMount:c=r.forceMount,align:d="start",...u}=t,h=Cr(ba,t.__scopeMenu),f=l2(ba,t.__scopeMenu),y=FG(jLe,t.__scopeMenu),x=k.useRef(null),g=Ee(a,x);return m.jsx(Hu.Provider,{scope:t.__scopeMenu,children:m.jsx(kn,{present:c||h.open,children:m.jsx(Hu.Slot,{scope:t.__scopeMenu,children:m.jsx(aD,{id:y.contentId,"aria-labelledby":y.triggerId,...u,ref:g,align:d,side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:b=>{f.isUsingKeyboardRef.current&&x.current?.focus(),b.preventDefault()},onCloseAutoFocus:b=>b.preventDefault(),onFocusOutside:fe(t.onFocusOutside,b=>{b.target!==y.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:fe(t.onEscapeKeyDown,b=>{f.onClose(),b.preventDefault()}),onKeyDown:fe(t.onKeyDown,b=>{const M=b.currentTarget.contains(b.target),_=rLe[f.dir].includes(b.key);M&&_&&(h.onOpenChange(!1),y.trigger?.focus(),b.preventDefault())})})})})})},"MenuSubContent"));function rD(e){return e?"open":"closed"}Xe(rD,"getOpenState");function Vu(e){return e==="indeterminate"}Xe(Vu,"isIndeterminate");function JA(e){return Vu(e)?"indeterminate":e?"checked":"unchecked"}Xe(JA,"getCheckedState");function UG(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}Xe(UG,"focusFirst");function GG(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Xe(GG,"wrapArray");function ZG(e,t,a){const c=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,d=a?e.indexOf(a):-1;let u=GG(e,Math.max(d,0));c.length===1&&(u=u.filter(y=>y!==a));const f=u.find(y=>y.toLowerCase().startsWith(c.toLowerCase()));return f!==a?f:void 0}Xe(ZG,"getNextMatch");function YG(e,t){const{x:a,y:r}=e;let c=!1;for(let d=0,u=t.length-1;d<t.length;u=d++){const h=t[d],f=t[u],y=h.x,x=h.y,g=f.x,b=f.y;x>r!=b>r&&a<(g-y)*(r-x)/(b-x)+y&&(c=!c)}return c}Xe(YG,"isPointInPolygon");function XG(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return YG(a,t)}Xe(XG,"isPointerInGraceArea");function ed(e){return t=>t.pointerType==="mouse"?e(t):void 0}Xe(ed,"whenMouse");var iD=lLe,cD=DG,sD=uLe,lD=pLe,dD=qG,uD=kLe,hD=oD,pD=gLe,fD=MLe,yD=_Le,mD=CLe,kD=LLe,gD=ILe,vD=ALe,xD=ELe,PLe=Object.defineProperty,Ft=(e,t)=>PLe(e,"name",{value:t,configurable:!0}),bD="ContextMenu",[RLe,TTe]=qt(bD,[s2]),gn=s2(),[TLe,WG]=RLe(bD),DLe=Ft(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,dir:d,modal:u=!0}=e,h=k.useRef(!1),[f,y]=Ut({prop:c,defaultProp:!1,onChange:r,caller:bD}),x=gn(t);return m.jsx(TLe,{scope:t,open:f,onOpenChange:y,modal:u,hasInteractedRef:h,children:m.jsx(iD,{...x,dir:d,open:f,onOpenChange:y,modal:u,children:a})})},"ContextMenu"),zLe="ContextMenuTrigger",$Le=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,disabled:c=!1,...d}=t,u=WG(zLe,r),h=gn(r),[f,y]=k.useState({x:0,y:0}),x=k.useMemo(()=>({current:{getBoundingClientRect:Ft(()=>DOMRect.fromRect({width:0,height:0,...f}),"getBoundingClientRect")}}),[f]),g=k.useRef(0),b=k.useCallback(()=>window.clearTimeout(g.current),[]),M=Ft(_=>{u.hasInteractedRef.current=!0,y({x:_.clientX,y:_.clientY}),u.onOpenChange(!0)},"handleOpen");return k.useEffect(()=>b,[b]),k.useEffect(()=>{c&&b()},[c,b]),m.jsxs(m.Fragment,{children:[m.jsx(cD,{...h,virtualRef:x}),m.jsx(ge.span,{"data-state":u.open?"open":"closed","data-disabled":c?"":void 0,...d,ref:a,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:c?t.onContextMenu:fe(t.onContextMenu,_=>{b(),M(_),_.preventDefault()}),onPointerDown:c?t.onPointerDown:fe(t.onPointerDown,mu(_=>{b(),u.open&&u.onOpenChange(!1),g.current=window.setTimeout(()=>M(_),700)})),onPointerMove:c?t.onPointerMove:fe(t.onPointerMove,mu(b)),onPointerCancel:c?t.onPointerCancel:fe(t.onPointerCancel,mu(b)),onPointerUp:c?t.onPointerUp:fe(t.onPointerUp,mu(b))})]})},"ContextMenuTrigger")),qLe=Ft(e=>{const{__scopeContextMenu:t,...a}=e,r=gn(t);return m.jsx(sD,{...r,...a})},"ContextMenuPortal"),OLe="ContextMenuContent",HLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=WG(OLe,r),u=gn(r),h=k.useRef(!1);return m.jsx(lD,{...u,...c,ref:a,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{t.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{t.onInteractOutside?.(f),!f.defaultPrevented&&!d.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")),VLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(dD,{...d,...c,ref:a})},"ContextMenuGroup")),BLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(uD,{...d,...c,ref:a})},"ContextMenuLabel")),FLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(hD,{...d,...c,ref:a})},"ContextMenuItem")),ULe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(pD,{...d,...c,ref:a})},"ContextMenuCheckboxItem")),GLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(fD,{...d,...c,ref:a})},"ContextMenuRadioGroup")),ZLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(yD,{...d,...c,ref:a})},"ContextMenuRadioItem")),YLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(mD,{...d,...c,ref:a})},"ContextMenuItemIndicator")),XLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(kD,{...d,...c,ref:a})},"ContextMenuSeparator")),WLe="ContextMenuSub",KLe=Ft(e=>{const{__scopeContextMenu:t,children:a,onOpenChange:r,open:c,defaultOpen:d}=e,u=gn(t),[h,f]=Ut({prop:c,defaultProp:d??!1,onChange:r,caller:WLe});return m.jsx(gD,{...u,open:h,onOpenChange:f,children:a})},"ContextMenuSub"),QLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(vD,{...d,...c,ref:a})},"ContextMenuSubTrigger")),JLe=k.forwardRef(Ft(function(t,a){const{__scopeContextMenu:r,...c}=t,d=gn(r);return m.jsx(xD,{...d,...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 mu(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Ft(mu,"whenTouchOrPen");var eNe=DLe,tNe=$Le,KG=qLe,nNe=HLe,aNe=VLe,oNe=BLe,rNe=FLe,iNe=ULe,cNe=GLe,sNe=ZLe,QG=YLe,lNe=XLe,dNe=KLe,uNe=QLe,hNe=JLe;function pNe({...e}){return m.jsx(eNe,{"data-slot":"context-menu",...e})}function fNe({...e}){return m.jsx(tNe,{"data-slot":"context-menu-trigger",...e})}function yNe({...e}){return m.jsx(aNe,{"data-slot":"context-menu-group",...e})}function mNe({...e}){return m.jsx(KG,{"data-slot":"context-menu-portal",...e})}function kNe({...e}){return m.jsx(dNe,{"data-slot":"context-menu-sub",...e})}function gNe({...e}){return m.jsx(cNe,{"data-slot":"context-menu-radio-group",...e})}function vNe({className:e,inset:t,children:a,...r}){return m.jsxs(uNe,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:W("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,m.jsx(Ua,{className:"ml-auto"})]})}function xNe({className:e,...t}){return m.jsx(hNe,{"data-slot":"context-menu-sub-content",className:W("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 bNe({className:e,...t}){return m.jsx(KG,{children:m.jsx(nNe,{"data-slot":"context-menu-content",className:W("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 MNe({className:e,inset:t,variant:a="default",...r}){return m.jsx(rNe,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:W("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 wNe({className:e,children:t,checked:a,...r}){return m.jsxs(iNe,{"data-slot":"context-menu-checkbox-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(QG,{children:m.jsx(Fa,{className:"size-4"})})}),t]})}function _Ne({className:e,children:t,...a}){return m.jsxs(sNe,{"data-slot":"context-menu-radio-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(QG,{children:m.jsx(Nl,{className:"size-2 fill-current"})})}),t]})}function SNe({className:e,inset:t,...a}){return m.jsx(oNe,{"data-slot":"context-menu-label","data-inset":t,className:W("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function CNe({className:e,...t}){return m.jsx(lNe,{"data-slot":"context-menu-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function LNe({className:e,...t}){return m.jsx("span",{"data-slot":"context-menu-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}const xr=k.createContext({activeIndex:0,setActiveIndex:()=>{},totalDialogs:0,setTotalDialogs:()=>{},isOpen:!1,setIsOpen:()=>{},clickable:!1,shouldAnimate:!1,setShouldAnimate:()=>{},closeDialog:()=>{}}),ej=k.forwardRef(({children:e,className:t,open:a=!1,onOpenChange:r,clickable:c=!1,...d},u)=>{const[h,f]=k.useState(0),[y,x]=k.useState(a),[g,b]=k.useState(!1),[M,_]=k.useState(0),S=C=>{C===h&&(h>0?f(L=>L-1):x(!1))};return k.useImperativeHandle(u,()=>({open:()=>{x(!0)},close:()=>{x(!1),f(0)},closeAll:()=>{x(!1),f(0)},next:()=>{f(C=>C+1)},prev:()=>{f(C=>C>0?C-1:0)},goTo:C=>{C>=0&&C<M&&f(C)},closeCurrent:()=>S(h),isOpen:y,activeIndex:h,totalDialogs:M}),[h,M,y]),k.useEffect(()=>{const C=document.documentElement;return y?(C.style.overflow="hidden",b(!0)):C.style.overflow="",r?.(y),()=>{C.style.overflow=""}},[y,r]),m.jsx(xr.Provider,{value:{activeIndex:h,setActiveIndex:f,totalDialogs:M,setTotalDialogs:_,isOpen:y,setIsOpen:x,clickable:c,shouldAnimate:g,setShouldAnimate:b,closeDialog:S},children:m.jsx("div",{className:t,...d,children:e})})});ej.displayName="DialogStack";const NNe=({children:e,className:t,onClick:a,asChild:r,...c})=>{const d=k.useContext(xr);if(!d)throw new Error("DialogStackTrigger must be used within a DialogStack");const u=h=>{d.setIsOpen(!0),a?.(h)};return r&&k.isValidElement(e)?k.cloneElement(e,{onClick:u,className:W(t,e.props.className),...c}):m.jsx("button",{onClick:u,className:W("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})},MD=({className:e,...t})=>{const a=k.useContext(xr);if(!a)throw new Error("DialogStackOverlay must be used within a DialogStack");return a.isOpen?m.jsx("div",{className:W("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},wD=({children:e,className:t,...a})=>{const r=k.useContext(xr),c=k.Children.count(e),[d,u]=k.useState(c);if(k.useEffect(()=>{u(c)},[c]),!r)throw new Error("DialogStackBody must be used within a DialogStack");return r.isOpen?m.jsx(xr.Provider,{value:{...r,totalDialogs:d,setTotalDialogs:u},children:m.jsx(SU,{children:m.jsx("div",{className:W("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:k.Children.map(e,(h,f)=>k.isValidElement(h)?k.cloneElement(h,{index:f}):h)})})}):null},_D=({children:e,className:t,index:a=0,offset:r=20,...c})=>{const d=k.useContext(xr),[u,h]=k.useState(!1),f=k.useRef(null),y=k.useRef(!1);if(!d)throw new Error("DialogStackContent must be used within a DialogStack");if(!d.isOpen)return null;const x=()=>{d.setIsOpen(!1),d.setActiveIndex(0)},g=()=>{if(y.current){y.current=!1;return}d.closeDialog(a)},b=()=>{y.current=!1,h(!0),f.current=setTimeout(()=>{y.current=!0,h(!1),x()},600)},M=()=>{f.current&&(clearTimeout(f.current),f.current=null),h(!1)},_=A=>{A.stopPropagation(),d.clickable&&d.activeIndex>a&&d.setActiveIndex(a??0)},S=a-d.activeIndex,C=S<0?`-${Math.abs(S)*r}px`:"0",L=a===0&&d.activeIndex===0&&d.shouldAnimate;return k.useEffect(()=>{if(L){const A=setTimeout(()=>{d.setShouldAnimate(!1)},200);return()=>clearTimeout(A)}},[L]),m.jsxs("div",{onClick:_,className:W("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",S<0&&"brightness-75 blur-[2px]",t),style:{top:0,marginLeft:`${C}`,marginTop:`${window.innerWidth>768?Math.abs(S)*10:0}px`,width:S<0?`calc(100% + ${Math.abs(S)*r}px)`:"100%",zIndex:S<0?50-Math.abs(d.activeIndex-(a??0)):1002,position:S?"absolute":"relative",opacity:S>0?0:1,pointerEvents:S>0?"none":"auto",cursor:d.clickable&&d.activeIndex>a?"pointer":"default"},...c,children:[m.jsx("div",{className:W("h-full w-full overflow-y-auto p-6 transition-all duration-200",d.activeIndex!==a&&"pointer-events-none select-none"),children:e}),d.activeIndex===a&&m.jsx(SU,{children:m.jsx(tn,{variant:"ghost",className:W("fixed z-[1100] top-4 right-4 p-1 size-8 transition-all",u&&"bg-destructive/20 scale-110"),onClick:g,onPointerDown:b,onPointerUp:M,onPointerLeave:M,onPointerCancel:M,"aria-label":"Close",title:d.totalDialogs>1?"Click to close, hold to close all":"Close",children:m.jsx(yr,{})})})]})},INe=({children:e,className:t,...a})=>m.jsx("h2",{className:W("font-semibold text-lg leading-none tracking-tight",t),...a,children:e}),ANe=({children:e,className:t,...a})=>m.jsx("p",{className:W("text-muted-foreground text-sm",t),...a,children:e}),jNe=({className:e,...t})=>m.jsx("div",{className:W("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),ENe=({children:e,className:t,...a})=>m.jsx("div",{className:W("flex items-center justify-end space-x-2 pt-4",t),...a,children:e}),PNe=({children:e,className:t,asChild:a,...r})=>{const c=k.useContext(xr);if(!c)throw new Error("DialogStackNext must be used within a DialogStack");const d=()=>{c.activeIndex<c.totalDialogs-1&&c.setActiveIndex(c.activeIndex+1)};return a&&k.isValidElement(e)?k.cloneElement(e,{onClick:d,className:W(t,e.props.className),...r}):m.jsx("button",{type:"button",onClick:d,className:W("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"})},RNe=({children:e,className:t,asChild:a,...r})=>{const c=k.useContext(xr);if(!c)throw new Error("DialogStackPrevious must be used within a DialogStack");const d=()=>{c.activeIndex>0&&c.setActiveIndex(c.activeIndex-1)};return a&&k.isValidElement(e)?k.cloneElement(e,{onClick:d,className:W(t,e.props.className),...r}):m.jsx("button",{type:"button",onClick:d,className:W("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 TNe=Object.defineProperty,vn=(e,t)=>TNe(e,"name",{value:t,configurable:!0}),SD="DropdownMenu",[DNe,DTe]=qt(SD,[s2]),xn=s2(),[zNe,JG]=DNe(SD),$Ne=vn(e=>{const{__scopeDropdownMenu:t,children:a,dir:r,open:c,defaultOpen:d,onOpenChange:u,modal:h=!0}=e,f=xn(t),y=k.useRef(null),[x,g]=Ut({prop:c,defaultProp:d??!1,onChange:u,caller:SD});return m.jsx(zNe,{scope:t,triggerId:kt(),triggerRef:y,contentId:kt(),open:x,onOpenChange:g,onOpenToggle:k.useCallback(()=>g(b=>!b),[g]),modal:h,children:m.jsx(iD,{...f,open:x,onOpenChange:g,dir:r,modal:h,children:a})})},"DropdownMenu"),qNe="DropdownMenuTrigger",ONe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,disabled:c=!1,...d}=t,u=JG(qNe,r),h=xn(r),f=Ee(a,u.triggerRef);return m.jsx(cD,{asChild:!0,...h,children:m.jsx(ge.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,...d,ref:f,onPointerDown:fe(t.onPointerDown,y=>{!c&&y.button===0&&y.ctrlKey===!1&&(u.onOpenToggle(),u.open||y.preventDefault())}),onKeyDown:fe(t.onKeyDown,y=>{c||(["Enter"," "].includes(y.key)&&u.onOpenToggle(),y.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(y.key)&&y.preventDefault())})})})},"DropdownMenuTrigger")),HNe=vn(e=>{const{__scopeDropdownMenu:t,...a}=e,r=xn(t);return m.jsx(sD,{...r,...a})},"DropdownMenuPortal"),VNe="DropdownMenuContent",BNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=JG(VNe,r),u=xn(r),h=k.useRef(!1);return m.jsx(lD,{id:d.contentId,"aria-labelledby":d.triggerId,...u,...c,ref:a,onCloseAutoFocus:fe(t.onCloseAutoFocus,f=>{h.current||d.triggerRef.current?.focus(),h.current=!1,f.preventDefault()}),onInteractOutside:fe(t.onInteractOutside,f=>{const y=f.detail.originalEvent,x=y.button===0&&y.ctrlKey===!0,g=y.button===2||x;(!d.modal||g)&&(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")),FNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(dD,{...d,...c,ref:a})},"DropdownMenuGroup")),UNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(uD,{...d,...c,ref:a})},"DropdownMenuLabel")),GNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(hD,{...d,...c,ref:a})},"DropdownMenuItem")),ZNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(pD,{...d,...c,ref:a})},"DropdownMenuCheckboxItem")),YNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(fD,{...d,...c,ref:a})},"DropdownMenuRadioGroup")),XNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(yD,{...d,...c,ref:a})},"DropdownMenuRadioItem")),WNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(mD,{...d,...c,ref:a})},"DropdownMenuItemIndicator")),KNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(kD,{...d,...c,ref:a})},"DropdownMenuSeparator")),QNe=vn(e=>{const{__scopeDropdownMenu:t,children:a,open:r,onOpenChange:c,defaultOpen:d}=e,u=xn(t),[h,f]=Ut({prop:r,defaultProp:d??!1,onChange:c,caller:"DropdownMenuSub"});return m.jsx(gD,{...u,open:h,onOpenChange:f,children:a})},"DropdownMenuSub"),JNe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(vD,{...d,...c,ref:a})},"DropdownMenuSubTrigger")),eIe=k.forwardRef(vn(function(t,a){const{__scopeDropdownMenu:r,...c}=t,d=xn(r);return m.jsx(xD,{...d,...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")),tIe=$Ne,nIe=ONe,eZ=HNe,aIe=BNe,oIe=FNe,rIe=UNe,iIe=GNe,cIe=ZNe,sIe=YNe,lIe=XNe,tZ=WNe,dIe=KNe,uIe=QNe,hIe=JNe,pIe=eIe;function fIe({...e}){return m.jsx(tIe,{"data-slot":"dropdown-menu",...e})}function yIe({...e}){return m.jsx(eZ,{"data-slot":"dropdown-menu-portal",...e})}function mIe({...e}){return m.jsx(nIe,{"data-slot":"dropdown-menu-trigger",...e})}function kIe({className:e,sideOffset:t=4,...a}){return m.jsx(eZ,{children:m.jsx(aIe,{"data-slot":"dropdown-menu-content",sideOffset:t,className:W("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 gIe({...e}){return m.jsx(oIe,{"data-slot":"dropdown-menu-group",...e})}function vIe({className:e,inset:t,variant:a="default",...r}){return m.jsx(iIe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:W("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 xIe({className:e,children:t,checked:a,...r}){return m.jsxs(cIe,{"data-slot":"dropdown-menu-checkbox-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(tZ,{children:m.jsx(Fa,{className:"size-4"})})}),t]})}function bIe({...e}){return m.jsx(sIe,{"data-slot":"dropdown-menu-radio-group",...e})}function MIe({className:e,children:t,...a}){return m.jsxs(lIe,{"data-slot":"dropdown-menu-radio-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(tZ,{children:m.jsx(Nl,{className:"size-2 fill-current"})})}),t]})}function wIe({className:e,inset:t,...a}){return m.jsx(rIe,{"data-slot":"dropdown-menu-label","data-inset":t,className:W("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function _Ie({className:e,...t}){return m.jsx(dIe,{"data-slot":"dropdown-menu-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function SIe({className:e,...t}){return m.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function CIe({...e}){return m.jsx(uIe,{"data-slot":"dropdown-menu-sub",...e})}function LIe({className:e,inset:t,children:a,...r}){return m.jsxs(hIe,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:W("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,m.jsx(Ua,{className:"ml-auto size-4"})]})}function NIe({className:e,...t}){return m.jsx(pIe,{"data-slot":"dropdown-menu-sub-content",className:W("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 CD({className:e,type:t,...a}){return m.jsx("input",{type:t,"data-slot":"input",className:W("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 IIe=Object.defineProperty,AIe=(e,t)=>IIe(e,"name",{value:t,configurable:!0}),jIe=k.forwardRef(AIe(function(t,a){return m.jsx(ge.label,{...t,ref:a,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),EIe=jIe;function _A({className:e,...t}){return m.jsx(EIe,{"data-slot":"label",className:W("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 PIe=Object.defineProperty,Kt=(e,t)=>PIe(e,"name",{value:t,configurable:!0}),tj="Menubar",[BR,RIe,TIe]=cd(tj),[nZ,zTe]=qt(tj,[TIe,dd]),bn=s2(),aZ=dd(),[DIe,LD]=nZ(tj),zIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,value:c,onValueChange:d,defaultValue:u,loop:h=!0,dir:f,...y}=t,x=Vl(f),g=aZ(r),[b,M]=Ut({prop:c,onChange:d,defaultProp:u??"",caller:tj}),[_,S]=k.useState(null);return m.jsx(DIe,{scope:r,value:b,onMenuOpen:k.useCallback(C=>{M(C),S(C)},[M]),onMenuClose:k.useCallback(()=>M(""),[M]),onMenuToggle:k.useCallback(C=>{M(L=>L?"":C),S(C)},[M]),dir:x,loop:h,children:m.jsx(BR.Provider,{scope:r,children:m.jsx(BR.Slot,{scope:r,children:m.jsx(eD,{asChild:!0,...g,orientation:"horizontal",loop:h,dir:x,currentTabStopId:_,onCurrentTabStopIdChange:S,children:m.jsx(ge.div,{role:"menubar",...y,ref:a})})})})})},"Menubar")),oZ="MenubarMenu",[$Ie,rZ]=nZ(oZ),qIe=Kt(e=>{const{__scopeMenubar:t,value:a,...r}=e,c=kt(),d=a||c||"LEGACY_REACT_AUTO_VALUE",u=LD(oZ,t),h=bn(t),f=k.useRef(null),y=k.useRef(!1),x=u.value===d;return k.useEffect(()=>{x||(y.current=!1)},[x]),m.jsx($Ie,{scope:t,value:d,triggerId:kt(),triggerRef:f,contentId:kt(),wasKeyboardTriggerOpenRef:y,children:m.jsx(iD,{...h,open:x,onOpenChange:g=>{g||u.onMenuClose()},modal:!1,dir:u.dir,...r})})},"MenubarMenu"),SV="MenubarTrigger",OIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,disabled:c=!1,...d}=t,u=aZ(r),h=bn(r),f=LD(SV,r),y=rZ(SV,r),x=k.useRef(null),g=Ee(a,x,y.triggerRef),[b,M]=k.useState(!1),_=f.value===y.value;return m.jsx(BR.ItemSlot,{scope:r,value:y.value,disabled:c,children:m.jsx(tD,{asChild:!0,...u,focusable:!c,tabStopId:y.value,children:m.jsx(cD,{asChild:!0,...h,children:m.jsx(ge.button,{type:"button",role:"menuitem",id:y.triggerId,"aria-haspopup":"menu","aria-expanded":_,"aria-controls":_?y.contentId:void 0,"data-highlighted":b?"":void 0,"data-state":_?"open":"closed","data-disabled":c?"":void 0,disabled:c,...d,ref:g,onPointerDown:fe(t.onPointerDown,S=>{!c&&S.button===0&&S.ctrlKey===!1&&(f.onMenuOpen(y.value),_||S.preventDefault())}),onPointerEnter:fe(t.onPointerEnter,()=>{f.value&&!_&&(f.onMenuOpen(y.value),x.current?.focus())}),onKeyDown:fe(t.onKeyDown,S=>{c||(["Enter"," "].includes(S.key)&&f.onMenuToggle(y.value),S.key==="ArrowDown"&&f.onMenuOpen(y.value),["Enter"," ","ArrowDown"].includes(S.key)&&(y.wasKeyboardTriggerOpenRef.current=!0,S.preventDefault()))}),onFocus:fe(t.onFocus,()=>M(!0)),onBlur:fe(t.onBlur,()=>M(!1))})})})})},"MenubarTrigger")),HIe=Kt(e=>{const{__scopeMenubar:t,...a}=e,r=bn(t);return m.jsx(sD,{...r,...a})},"MenubarPortal"),CV="MenubarContent",VIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,align:c="start",...d}=t,u=bn(r),h=LD(CV,r),f=rZ(CV,r),y=RIe(r),x=k.useRef(!1);return m.jsx(lD,{id:f.contentId,"aria-labelledby":f.triggerId,"data-radix-menubar-content":"",...u,...d,ref:a,align:c,onCloseAutoFocus:fe(t.onCloseAutoFocus,g=>{!h.value&&!x.current&&f.triggerRef.current?.focus(),x.current=!1,g.preventDefault()}),onFocusOutside:fe(t.onFocusOutside,g=>{const b=g.target;y().some(_=>_.ref.current?.contains(b))&&g.preventDefault()}),onInteractOutside:fe(t.onInteractOutside,()=>{x.current=!0}),onEntryFocus:g=>{f.wasKeyboardTriggerOpenRef.current||g.preventDefault()},onKeyDown:fe(t.onKeyDown,g=>{if(["ArrowRight","ArrowLeft"].includes(g.key)){const b=g.target,M=b.hasAttribute("data-radix-menubar-subtrigger"),_=b.closest("[data-radix-menubar-content]")!==g.currentTarget,C=(h.dir==="rtl"?"ArrowRight":"ArrowLeft")===g.key;if(!C&&M||_&&C)return;let j=y().filter(R=>!R.disabled).map(R=>R.value);C&&j.reverse();const E=j.indexOf(f.value);j=h.loop?iZ(j,E+1):j.slice(E+1);const[z]=j;z&&h.onMenuOpen(z)}},{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")),BIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(dD,{...d,...c,ref:a})},"MenubarGroup")),FIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(uD,{...d,...c,ref:a})},"MenubarLabel")),UIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(hD,{...d,...c,ref:a})},"MenubarItem")),GIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(pD,{...d,...c,ref:a})},"MenubarCheckboxItem")),ZIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(fD,{...d,...c,ref:a})},"MenubarRadioGroup")),YIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(yD,{...d,...c,ref:a})},"MenubarRadioItem")),XIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(mD,{...d,...c,ref:a})},"MenubarItemIndicator")),WIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(kD,{...d,...c,ref:a})},"MenubarSeparator")),KIe="MenubarSub",QIe=Kt(e=>{const{__scopeMenubar:t,children:a,open:r,onOpenChange:c,defaultOpen:d}=e,u=bn(t),[h,f]=Ut({prop:r,defaultProp:d??!1,onChange:c,caller:KIe});return m.jsx(gD,{...u,open:h,onOpenChange:f,children:a})},"MenubarSub"),JIe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(vD,{"data-radix-menubar-subtrigger":"",...d,...c,ref:a})},"MenubarSubTrigger")),eAe=k.forwardRef(Kt(function(t,a){const{__scopeMenubar:r,...c}=t,d=bn(r);return m.jsx(xD,{...d,"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 iZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Kt(iZ,"wrapArray");var tAe=zIe,nAe=qIe,aAe=OIe,oAe=HIe,rAe=VIe,iAe=BIe,cAe=FIe,sAe=UIe,lAe=GIe,dAe=ZIe,uAe=YIe,cZ=XIe,hAe=WIe,pAe=QIe,fAe=JIe,yAe=eAe;function mAe({className:e,...t}){return m.jsx(tAe,{"data-slot":"menubar",className:W("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function kAe({...e}){return m.jsx(nAe,{"data-slot":"menubar-menu",...e})}function gAe({...e}){return m.jsx(iAe,{"data-slot":"menubar-group",...e})}function sZ({...e}){return m.jsx(oAe,{"data-slot":"menubar-portal",...e})}function vAe({...e}){return m.jsx(dAe,{"data-slot":"menubar-radio-group",...e})}function xAe({className:e,...t}){return m.jsx(aAe,{"data-slot":"menubar-trigger",className:W("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 bAe({className:e,align:t="start",alignOffset:a=-4,sideOffset:r=8,...c}){return m.jsx(sZ,{children:m.jsx(rAe,{"data-slot":"menubar-content",align:t,alignOffset:a,sideOffset:r,className:W("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 MAe({className:e,inset:t,variant:a="default",...r}){return m.jsx(sAe,{"data-slot":"menubar-item","data-inset":t,"data-variant":a,className:W("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 wAe({className:e,children:t,checked:a,...r}){return m.jsxs(lAe,{"data-slot":"menubar-checkbox-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(cZ,{children:m.jsx(Fa,{className:"size-4"})})}),t]})}function _Ae({className:e,children:t,...a}){return m.jsxs(uAe,{"data-slot":"menubar-radio-item",className:W("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:[m.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:m.jsx(cZ,{children:m.jsx(Nl,{className:"size-2 fill-current"})})}),t]})}function SAe({className:e,inset:t,...a}){return m.jsx(cAe,{"data-slot":"menubar-label","data-inset":t,className:W("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function CAe({className:e,...t}){return m.jsx(hAe,{"data-slot":"menubar-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function LAe({className:e,...t}){return m.jsx("span",{"data-slot":"menubar-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function NAe({...e}){return m.jsx(pAe,{"data-slot":"menubar-sub",...e})}function IAe({className:e,inset:t,children:a,...r}){return m.jsxs(fAe,{"data-slot":"menubar-sub-trigger","data-inset":t,className:W("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,m.jsx(Ua,{className:"ml-auto h-4 w-4"})]})}function AAe({className:e,...t}){return m.jsx(yAe,{"data-slot":"menubar-sub-content",className:W("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 jAe({className:e,...t}){return m.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:W("mx-auto flex w-full justify-center",e),...t})}function EAe({className:e,...t}){return m.jsx("ul",{"data-slot":"pagination-content",className:W("flex flex-row items-center gap-1",e),...t})}function PAe({...e}){return m.jsx("li",{"data-slot":"pagination-item",...e})}function ND({className:e,isActive:t,size:a="icon",...r}){return m.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:W(mA({variant:t?"outline":"ghost",size:a}),e),...r})}function RAe({className:e,label:t="Previous",...a}){return m.jsxs(ND,{"aria-label":t,size:"default",className:W("gap-1 px-2.5 sm:pl-2.5",e),...a,children:[m.jsx(G1,{}),m.jsx("span",{className:"hidden sm:block",children:t})]})}function TAe({className:e,label:t="Next",...a}){return m.jsxs(ND,{"aria-label":t,size:"default",className:W("gap-1 px-2.5 sm:pr-2.5",e),...a,children:[m.jsx("span",{className:"hidden sm:block",children:t}),m.jsx(Ua,{})]})}function DAe({className:e,...t}){return m.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:W("flex size-9 items-center justify-center",e),...t,children:[m.jsx(xo,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"More pages"})]})}var zAe=Object.defineProperty,Ao=(e,t)=>zAe(e,"name",{value:t,configurable:!0}),ID="Popover",[lZ,$Te]=qt(ID,[Sr]),nj=Sr(),[$Ae,Ul]=lZ(ID),qAe=Ao(e=>{const{__scopePopover:t,children:a,open:r,defaultOpen:c,onOpenChange:d,modal:u=!1}=e,h=nj(t),f=k.useRef(null),[y,x]=k.useState(!1),[g,b]=Ut({prop:r,defaultProp:c??!1,onChange:d,caller:ID});return m.jsx(i2,{...h,children:m.jsx($Ae,{scope:t,contentId:kt(),triggerRef:f,open:g,onOpenChange:b,onOpenToggle:k.useCallback(()=>b(M=>!M),[b]),hasCustomAnchor:y,onCustomAnchorAdd:k.useCallback(()=>x(!0),[]),onCustomAnchorRemove:k.useCallback(()=>x(!1),[]),modal:u,children:a})})},"Popover"),OAe="PopoverAnchor",HAe=k.forwardRef(Ao(function(t,a){const{__scopePopover:r,...c}=t,d=Ul(OAe,r),u=nj(r),{onCustomAnchorAdd:h,onCustomAnchorRemove:f}=d;return k.useEffect(()=>(h(),()=>f()),[h,f]),m.jsx(c2,{...u,...c,ref:a})},"PopoverAnchor")),VAe="PopoverTrigger",BAe=k.forwardRef(Ao(function(t,a){const{__scopePopover:r,...c}=t,d=Ul(VAe,r),u=nj(r),h=Ee(a,d.triggerRef),f=m.jsx(ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":AD(d.open),...c,ref:h,onClick:fe(t.onClick,d.onOpenToggle)});return d.hasCustomAnchor?f:m.jsx(c2,{asChild:!0,...u,children:f})},"PopoverTrigger")),dZ="PopoverPortal",[FAe,UAe]=lZ(dZ,{forceMount:void 0}),GAe=Ao(e=>{const{__scopePopover:t,forceMount:a,children:r,container:c}=e,d=Ul(dZ,t);return m.jsx(FAe,{scope:t,forceMount:a,children:m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:r})})})},"PopoverPortal"),Bu="PopoverContent",ZAe=k.forwardRef(Ao(function(t,a){const r=UAe(Bu,t.__scopePopover),{forceMount:c=r.forceMount,...d}=t,u=Ul(Bu,t.__scopePopover);return m.jsx(kn,{present:c||u.open,children:u.modal?m.jsx(XAe,{...d,ref:a}):m.jsx(WAe,{...d,ref:a})})},"PopoverContent")),YAe=Ma("PopoverContent.RemoveScroll"),XAe=k.forwardRef(Ao(function(t,a){const r=Ul(Bu,t.__scopePopover),c=k.useRef(null),d=Ee(a,c),u=k.useRef(!1);return k.useEffect(()=>{const h=c.current;if(h)return TA(h)},[]),m.jsx(o2,{as:YAe,allowPinchZoom:!0,children:m.jsx(uZ,{...t,ref:d,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(t.onCloseAutoFocus,h=>{h.preventDefault(),u.current||r.triggerRef.current?.focus()}),onPointerDownOutside:fe(t.onPointerDownOutside,h=>{const f=h.detail.originalEvent,y=f.button===0&&f.ctrlKey===!0,x=f.button===2||y;u.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:fe(t.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),WAe=k.forwardRef(Ao(function(t,a){const r=Ul(Bu,t.__scopePopover),c=k.useRef(!1),d=k.useRef(!1);return m.jsx(uZ,{...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,d.current=!1},onInteractOutside:u=>{t.onInteractOutside?.(u),u.defaultPrevented||(c.current=!0,u.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const h=u.target;r.triggerRef.current?.contains(h)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&d.current&&u.preventDefault()}})},"PopoverContentNonModal")),uZ=k.forwardRef(Ao(function(t,a){const{__scopePopover:r,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEscapeKeyDown:f,onPointerDownOutside:y,onFocusOutside:x,onInteractOutside:g,...b}=t,M=Ul(Bu,r),_=nj(r);return id(),m.jsx(PA,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:d,onUnmountAutoFocus:u,children:m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:y,onFocusOutside:x,onDismiss:()=>M.onOpenChange(!1),deferPointerDownOutside:!0,children:m.jsx(XA,{"data-state":AD(M.open),role:"dialog",id:M.contentId,..._,...b,ref:a,style:{...b.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 AD(e){return e?"open":"closed"}Ao(AD,"getState");var KAe=qAe,QAe=HAe,JAe=BAe,eje=GAe,tje=ZAe;function hZ({...e}){return m.jsx(KAe,{"data-slot":"popover",...e})}function pZ({...e}){return m.jsx(JAe,{"data-slot":"popover-trigger",...e})}function fZ({className:e,align:t="center",sideOffset:a=4,...r}){return m.jsx(eje,{children:m.jsx(tje,{"data-slot":"popover-content",align:t,sideOffset:a,className:W("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 nje({...e}){return m.jsx(QAe,{"data-slot":"popover-anchor",...e})}var aje=Object.defineProperty,oje=(e,t)=>aje(e,"name",{value:t,configurable:!0});function Fu(e,[t,a]){return Math.min(a,Math.max(t,e))}oje(Fu,"clamp");var rje=Object.defineProperty,ije=(e,t)=>rje(e,"name",{value:t,configurable:!0});function jD(e){const t=k.useRef({value:e,previous:e});return k.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}ije(jD,"usePrevious");var cje=Object.defineProperty,sje=(e,t)=>cje(e,"name",{value:t,configurable:!0}),yZ=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"}),lje=k.forwardRef(sje(function(t,a){return m.jsx(ge.span,{...t,ref:a,style:{...yZ,...t.style}})},"VisuallyHidden")),dje=lje,uje=Object.defineProperty,Ge=(e,t)=>uje(e,"name",{value:t,configurable:!0}),hje=[" ","Enter","ArrowUp","ArrowDown"],pje=[" ","Enter"],td="Select",[aj,oj,fje]=cd(td),[Gl,qTe]=qt(td,[fje,Sr]),ED=Sr(),[yje,Lr]=Gl(td),[mje,kje]=Gl(td);function mZ(e){const{__scopeSelect:t,children:a,open:r,defaultOpen:c,onOpenChange:d,value:u,defaultValue:h,onValueChange:f,dir:y,name:x,autoComplete:g,disabled:b,required:M,form:_,internal_do_not_use_render:S}=e,C=ED(t),[L,A]=k.useState(null),[j,E]=k.useState(null),[z,R]=k.useState(!1),$=Vl(y),[H,K]=Ut({prop:r,defaultProp:c??!1,onChange:d,caller:td}),[ae,Y]=Ut({prop:u,defaultProp:h,onChange:f,caller:td}),G=k.useRef(null),J=k.useRef(ae);k.useEffect(()=>{const T=_?L?.ownerDocument.getElementById(_):L?.form;if(T instanceof HTMLFormElement){const U=Ge(()=>Y(J.current),"reset");return T.addEventListener("reset",U),()=>T.removeEventListener("reset",U)}},[_,L,Y]);const oe=L?!!_||!!L.closest("form"):!0,[he,N]=k.useState(new Set),P=kt(),O=Array.from(he).map(T=>T.props.value).join(";"),te=k.useCallback(T=>{N(U=>new Set(U).add(T))},[]),B=k.useCallback(T=>{N(U=>{const X=new Set(U);return X.delete(T),X})},[]),D={required:M,trigger:L,onTriggerChange:A,valueNode:j,onValueNodeChange:E,valueNodeHasChildren:z,onValueNodeHasChildrenChange:R,contentId:P,value:ae,onValueChange:Y,open:H,onOpenChange:K,dir:$,triggerPointerDownPosRef:G,disabled:b,name:x,autoComplete:g,form:_,nativeOptions:he,nativeSelectKey:O,isFormControl:oe};return m.jsx(i2,{...C,children:m.jsx(yje,{scope:t,...D,children:m.jsx(aj.Provider,{scope:t,children:m.jsx(mje,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:B,children:xZ(S)?S(D):a})})})})}Ge(mZ,"SelectProvider");var gje=Ge(e=>{const{__scopeSelect:t,children:a,...r}=e;return m.jsx(mZ,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:c})=>m.jsxs(m.Fragment,{children:[a,c?m.jsx(Wje,{__scopeSelect:t}):null]})})},"Select"),vje="SelectTrigger",xje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,disabled:c=!1,...d}=t,u=ED(r),h=Lr(vje,r),f=h.disabled||c,y=Ee(a,h.onTriggerChange),x=oj(r),g=k.useRef("touch"),[b,M,_]=RD(C=>{const L=x().filter(E=>!E.disabled),A=L.find(E=>E.value===h.value),j=TD(L,C,A);j!==void 0&&h.onValueChange(j.value)}),S=Ge(C=>{f||(h.onOpenChange(!0),_()),C&&(h.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return m.jsx(c2,{asChild:!0,...u,children:m.jsx(ge.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:f,"data-disabled":f?"":void 0,"data-placeholder":d2(h.value)?"":void 0,...d,ref:y,onClick:fe(d.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&S(C)}),onPointerDown:fe(d.onPointerDown,C=>{g.current=C.pointerType;const L=C.target;L.hasPointerCapture(C.pointerId)&&L.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:fe(d.onKeyDown,C=>{const L=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&M(C.key),!(L&&C.key===" ")&&hje.includes(C.key)&&(S(),C.preventDefault())})})})},"SelectTrigger")),bje="SelectValue",Mje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,className:c,style:d,children:u,placeholder:h="",...f}=t,y=Lr(bje,r),{onValueNodeHasChildrenChange:x}=y,g=u!==void 0,b=Ee(a,y.onValueNodeChange);mt(()=>{x(g)},[x,g]);const M=d2(y.value);return m.jsx(ge.span,{...f,asChild:M?!1:f.asChild,ref:b,style:{pointerEvents:"none"},children:m.jsx(k.Fragment,{children:M?h:u},M?"placeholder":"value")})},"SelectValue")),wje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,children:c,...d}=t;return m.jsx(ge.span,{"aria-hidden":!0,...d,ref:a,children:c||"▼"})},"SelectIcon")),_je="SelectPortal",[Sje,Cje]=Gl(_je,{forceMount:void 0}),Lje=Ge(e=>{const{__scopeSelect:t,forceMount:a,...r}=e;return m.jsx(Sje,{scope:e.__scopeSelect,forceMount:a,children:m.jsx(rd,{asChild:!0,...r})})},"SelectPortal"),zl="SelectContent",Nje=k.forwardRef(Ge(function(t,a){const r=Cje(zl,t.__scopeSelect),{forceMount:c=r.forceMount,...d}=t,u=Lr(zl,t.__scopeSelect),[h,f]=k.useState();return mt(()=>{f(new DocumentFragment)},[]),m.jsx(kn,{present:c||u.open,children:({present:y})=>y?m.jsx(jje,{...d,ref:a}):m.jsx(Ije,{...d,fragment:h})})},"SelectContent")),Ije=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,children:c,fragment:d}=t;return d?$l.createPortal(m.jsx(kZ,{scope:r,children:m.jsx(aj.Slot,{scope:r,children:m.jsx("div",{ref:a,children:c})})}),d):null},"SelectContentFragment")),ka=10,[kZ,Zl]=Gl(zl),Aje=Ma("SelectContent.RemoveScroll"),jje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r}=t,{position:c="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:u,onPointerDownOutside:h,side:f,sideOffset:y,align:x,alignOffset:g,arrowPadding:b,collisionBoundary:M,collisionPadding:_,sticky:S,hideWhenDetached:C,avoidCollisions:L,...A}=t,j=Lr(zl,r),[E,z]=k.useState(null),[R,$]=k.useState(null),H=Ee(a,z),[K,ae]=k.useState(null),[Y,G]=k.useState(null),J=oj(r),[oe,he]=k.useState(!1),N=k.useRef(!1);k.useEffect(()=>{if(E)return TA(E)},[E]),id();const P=k.useCallback(ie=>{const[se,..._e]=J().map(Re=>Re.ref.current),[ve]=_e.slice(-1),Ne=document.activeElement;for(const Re of ie)if(Re===Ne||(Re?.scrollIntoView({block:"nearest"}),Re===se&&R&&(R.scrollTop=0),Re===ve&&R&&(R.scrollTop=R.scrollHeight),Re?.focus(),document.activeElement!==Ne))return},[J,R]),O=k.useCallback(()=>P([K,E]),[P,K,E]);k.useEffect(()=>{oe&&O()},[oe,O]);const{onOpenChange:te,triggerPointerDownPosRef:B}=j;k.useEffect(()=>{if(E){let ie={x:0,y:0};const se=Ge(ve=>{ie={x:Math.abs(Math.round(ve.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(B.current?.y??0))}},"handlePointerMove"),_e=Ge(ve=>{ie.x<=10&&ie.y<=10?ve.preventDefault():ve.composedPath().includes(E)||te(!1),document.removeEventListener("pointermove",se),B.current=null},"handlePointerUp");return B.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",_e,{capture:!0})}}},[E,te,B]),k.useEffect(()=>{const ie=Ge(()=>te(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[te]);const[D,T]=RD(ie=>{const se=J().filter(Ne=>!Ne.disabled),_e=se.find(Ne=>Ne.ref.current===document.activeElement),ve=TD(se,ie,_e);ve&&setTimeout(()=>ve.ref.current?.focus())}),U=k.useCallback((ie,se,_e)=>{const ve=!N.current&&!_e;(j.value!==void 0&&j.value===se||ve)&&(ae(ie),ve&&(N.current=!0))},[j.value]),X=k.useCallback(()=>E?.focus(),[E]),Z=k.useCallback((ie,se,_e)=>{const ve=!N.current&&!_e;(j.value!==void 0&&j.value===se||ve)&&G(ie)},[j.value]),ce=c==="popper"?LV:Eje,pe=ce===LV?{side:f,sideOffset:y,align:x,alignOffset:g,arrowPadding:b,collisionBoundary:M,collisionPadding:_,sticky:S,hideWhenDetached:C,avoidCollisions:L}:{};return m.jsx(kZ,{scope:r,content:E,viewport:R,onViewportChange:$,itemRefCallback:U,selectedItem:K,onItemLeave:X,itemTextRefCallback:Z,focusSelectedItem:O,selectedItemText:Y,position:c,isPositioned:oe,searchRef:D,children:m.jsx(o2,{as:Aje,allowPinchZoom:!0,children:m.jsx(PA,{asChild:!0,trapped:j.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:fe(d,ie=>{j.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:m.jsx(ce,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ie=>ie.preventDefault(),...A,...pe,onPlaced:()=>he(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:fe(A.onKeyDown,ie=>{const se=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!se&&ie.key.length===1&&T(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ve=J().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Ne=ie.target,Re=ve.indexOf(Ne);ve=ve.slice(Re+1)}setTimeout(()=>P(ve)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),Eje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,onPlaced:c,...d}=t,u=Lr(zl,r),h=Zl(zl,r),[f,y]=k.useState(null),[x,g]=k.useState(null),b=Ee(a,g),M=oj(r),_=k.useRef(!1),S=k.useRef(!0),{viewport:C,selectedItem:L,selectedItemText:A,focusSelectedItem:j}=h,E=k.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&x&&C&&L&&A){const H=u.trigger.getBoundingClientRect(),K=x.getBoundingClientRect(),ae=u.valueNode.getBoundingClientRect(),Y=A.getBoundingClientRect();if(u.dir!=="rtl"){const Ne=Y.left-K.left,Re=ae.left-Ne,qe=H.left-Re,xe=H.width+qe,Ae=Math.max(xe,K.width),vt=window.innerWidth-ka,ke=Fu(Re,[ka,Math.max(ka,vt-Ae)]);f.style.minWidth=xe+"px",f.style.left=ke+"px"}else{const Ne=K.right-Y.right,Re=window.innerWidth-ae.right-Ne,qe=window.innerWidth-H.right-Re,xe=H.width+qe,Ae=Math.max(xe,K.width),vt=window.innerWidth-ka,ke=Fu(Re,[ka,Math.max(ka,vt-Ae)]);f.style.minWidth=xe+"px",f.style.right=ke+"px"}const G=M(),J=window.innerHeight-ka*2,oe=C.scrollHeight,he=window.getComputedStyle(x),N=parseInt(he.borderTopWidth,10),P=parseInt(he.paddingTop,10),O=parseInt(he.borderBottomWidth,10),te=parseInt(he.paddingBottom,10),B=N+P+oe+te+O,D=Math.min(L.offsetHeight*5,B),T=window.getComputedStyle(C),U=parseInt(T.paddingTop,10),X=parseInt(T.paddingBottom,10),Z=H.top+H.height/2-ka,ce=J-Z,pe=L.offsetHeight/2,ie=L.offsetTop+pe,se=N+P+ie,_e=B-se;if(se<=Z){const Ne=G.length>0&&L===G[G.length-1].ref.current;f.style.bottom="0px";const Re=x.clientHeight-C.offsetTop-C.offsetHeight,qe=Math.max(ce,pe+(Ne?X:0)+Re+O),xe=se+qe;f.style.height=xe+"px"}else{const Ne=G.length>0&&L===G[0].ref.current;f.style.top="0px";const qe=Math.max(Z,N+C.offsetTop+(Ne?U:0)+pe)+_e;f.style.height=qe+"px",C.scrollTop=se-Z+C.offsetTop}f.style.margin=`${ka}px 0`,f.style.minHeight=D+"px",f.style.maxHeight=J+"px",c?.(),requestAnimationFrame(()=>_.current=!0)}},[M,u.trigger,u.valueNode,f,x,C,L,A,u.dir,c]);mt(()=>E(),[E]);const[z,R]=k.useState();mt(()=>{x&&R(window.getComputedStyle(x).zIndex)},[x]);const $=k.useCallback(H=>{H&&S.current===!0&&(E(),j?.(),S.current=!1)},[E,j]);return m.jsx(Pje,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:_,onScrollButtonChange:$,children:m.jsx("div",{ref:y,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:m.jsx(ge.div,{...d,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),LV=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,align:c="start",collisionPadding:d=ka,...u}=t,h=ED(r);return m.jsx(XA,{...h,...u,ref:a,align:c,collisionPadding:d,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")),[Pje,PD]=Gl(zl,{}),NV="SelectViewport",Rje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,nonce:c,...d}=t,u=Zl(NV,r),h=PD(NV,r),f=Ee(a,u.onViewportChange),y=k.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),m.jsx(aj.Slot,{scope:r,children:m.jsx(ge.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:fe(d.onScroll,x=>{const g=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:M}=h;if(M?.current&&b){const _=Math.abs(y.current-g.scrollTop);if(_>0){const S=window.innerHeight-ka*2,C=parseFloat(b.style.minHeight),L=parseFloat(b.style.height),A=Math.max(C,L);if(A<S){const j=A+_,E=Math.min(S,j),z=j-E;b.style.height=E+"px",b.style.bottom==="0px"&&(g.scrollTop=z>0?z:0,b.style.justifyContent="flex-end")}}}y.current=g.scrollTop})})})]})},"SelectViewport")),Tje="SelectGroup",[Dje,zje]=Gl(Tje),$je=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t,d=kt();return m.jsx(Dje,{scope:r,id:d,children:m.jsx(ge.div,{role:"group","aria-labelledby":d,...c,ref:a})})},"SelectGroup")),qje="SelectLabel",Oje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t,d=zje(qje,r);return m.jsx(ge.div,{id:d.id,...c,ref:a})},"SelectLabel")),FR="SelectItem",[Hje,gZ]=Gl(FR),Vje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,value:c,disabled:d=!1,textValue:u,...h}=t,f=Lr(FR,r),y=Zl(FR,r),x=f.value===c,[g,b]=k.useState(u??""),[M,_]=k.useState(!1),S=yn(E=>y.itemRefCallback?.(E,c,d)),C=Ee(a,S),L=kt(),A=k.useRef("touch"),j=Ge(()=>{d||(f.onValueChange(c),f.onOpenChange(!1))},"handleSelect");return m.jsx(Hje,{scope:r,value:c,disabled:d,textId:L,isSelected:x,onItemTextChange:k.useCallback(E=>{b(z=>z||(E?.textContent??"").trim())},[]),children:m.jsx(aj.ItemSlot,{scope:r,value:c,disabled:d,textValue:g,children:m.jsx(ge.div,{role:"option","aria-labelledby":L,"data-highlighted":M?"":void 0,"aria-selected":x&&M,"data-state":x?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...h,ref:C,onFocus:fe(h.onFocus,()=>_(!0)),onBlur:fe(h.onBlur,()=>_(!1)),onClick:fe(h.onClick,()=>{A.current!=="mouse"&&j()}),onPointerUp:fe(h.onPointerUp,()=>{A.current==="mouse"&&j()}),onPointerDown:fe(h.onPointerDown,E=>{A.current=E.pointerType}),onPointerMove:fe(h.onPointerMove,E=>{A.current=E.pointerType,d?y.onItemLeave?.():A.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(h.onPointerLeave,E=>{E.currentTarget===document.activeElement&&y.onItemLeave?.()}),onKeyDown:fe(h.onKeyDown,E=>{d||E.target!==E.currentTarget||y.searchRef?.current!==""&&E.key===" "||(pje.includes(E.key)&&j(),E.key===" "&&E.preventDefault())})})})})},"SelectItem")),B0="SelectItemText",Bje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,className:c,style:d,...u}=t,h=Lr(B0,r),f=Zl(B0,r),y=gZ(B0,r),x=kje(B0,r),[g,b]=k.useState(null),M=yn(j=>f.itemTextRefCallback?.(j,y.value,y.disabled)),_=Ee(a,b,y.onItemTextChange,M),S=g?.textContent,C=k.useMemo(()=>m.jsx("option",{value:y.value,disabled:y.disabled,children:S},y.value),[y.disabled,y.value,S]),{onNativeOptionAdd:L,onNativeOptionRemove:A}=x;return mt(()=>(L(C),()=>A(C)),[L,A,C]),m.jsxs(m.Fragment,{children:[m.jsx(ge.span,{id:y.textId,...u,ref:_}),y.isSelected&&h.valueNode&&!h.valueNodeHasChildren&&!d2(h.value)?$l.createPortal(u.children,h.valueNode):null]})},"SelectItemText")),Fje="SelectItemIndicator",Uje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t;return gZ(Fje,r).isSelected?m.jsx(ge.span,{"aria-hidden":!0,...c,ref:a}):null},"SelectItemIndicator")),IV="SelectScrollUpButton",Gje=k.forwardRef(Ge(function(t,a){const r=Zl(IV,t.__scopeSelect),c=PD(IV,t.__scopeSelect),[d,u]=k.useState(!1),h=Ee(a,c.onScrollButtonChange);return mt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const x=y.scrollTop>0;u(x)};Ge(f,"handleScroll");const y=r.viewport;return f(),y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),d?m.jsx(vZ,{...t,ref:h,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=r;f&&y&&(f.scrollTop=f.scrollTop-y.offsetHeight)}}):null},"SelectScrollUpButton")),AV="SelectScrollDownButton",Zje=k.forwardRef(Ge(function(t,a){const r=Zl(AV,t.__scopeSelect),c=PD(AV,t.__scopeSelect),[d,u]=k.useState(!1),h=Ee(a,c.onScrollButtonChange);return mt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const x=y.scrollHeight-y.clientHeight,g=Math.ceil(y.scrollTop)<x;u(g)};Ge(f,"handleScroll");const y=r.viewport;return f(),y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),d?m.jsx(vZ,{...t,ref:h,onAutoScroll:()=>{const{viewport:f,selectedItem:y}=r;f&&y&&(f.scrollTop=f.scrollTop+y.offsetHeight)}}):null},"SelectScrollDownButton")),vZ=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,onAutoScroll:c,...d}=t,u=Zl("SelectScrollButton",r),h=k.useRef(null),f=oj(r),y=k.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return k.useEffect(()=>()=>y(),[y]),mt(()=>{f().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),m.jsx(ge.div,{"aria-hidden":!0,...d,ref:a,style:{flexShrink:0,...d.style},onPointerDown:fe(d.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(c,50))}),onPointerMove:fe(d.onPointerMove,()=>{u.onItemLeave?.(),h.current===null&&(h.current=window.setInterval(c,50))}),onPointerLeave:fe(d.onPointerLeave,()=>{y()})})},"SelectScrollButtonImpl")),Yje=k.forwardRef(Ge(function(t,a){const{__scopeSelect:r,...c}=t;return m.jsx(ge.div,{"aria-hidden":!0,...c,ref:a})},"SelectSeparator")),Xje="SelectBubbleInput",Wje=k.forwardRef(Ge(function({__scopeSelect:t,...a},r){const c=Lr(Xje,t),{value:d,onValueChange:u,required:h,disabled:f,name:y,autoComplete:x,form:g}=c,{nativeOptions:b,nativeSelectKey:M}=c,_=k.useRef(null),S=Ee(r,_),C=d??"",L=jD(C),A=Array.from(b).some(j=>(j.props.value??"")==="");return k.useEffect(()=>{const j=_.current;if(!j)return;const E=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(E,"value").set;if(L!==C&&R){const $=new Event("change",{bubbles:!0});R.call(j,C),j.dispatchEvent($)}},[L,C]),m.jsxs(ge.select,{"aria-hidden":!0,required:h,tabIndex:-1,name:y,autoComplete:x,disabled:f,form:g,onChange:j=>u(j.target.value),...a,style:{...yZ,...a.style},ref:S,defaultValue:C,children:[d2(d)&&!A?m.jsx("option",{value:""}):null,Array.from(b)]},M)},"SelectBubbleInput"));function xZ(e){return typeof e=="function"}Ge(xZ,"isFunction");function d2(e){return e===""||e===void 0}Ge(d2,"shouldShowPlaceholder");function RD(e){const t=yn(e),a=k.useRef(""),r=k.useRef(0),c=k.useCallback(u=>{const h=a.current+u;t(h),Ge((function f(y){a.current=y,window.clearTimeout(r.current),y!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}),"updateSearch")(h)},[t]),d=k.useCallback(()=>{a.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[a,c,d]}Ge(RD,"useTypeaheadSearch");function TD(e,t,a){const c=t.length>1&&Array.from(t).every(y=>y===t[0])?t[0]:t,d=a?e.indexOf(a):-1;let u=bZ(e,Math.max(d,0));c.length===1&&(u=u.filter(y=>y!==a));const f=u.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return f!==a?f:void 0}Ge(TD,"findNextItem");function bZ(e,t){return e.map((a,r)=>e[(t+r)%e.length])}Ge(bZ,"wrapArray");function MZ({...e}){return m.jsx(gje,{"data-slot":"select",...e})}function Kje({...e}){return m.jsx($je,{"data-slot":"select-group",...e})}function wZ({...e}){return m.jsx(Mje,{"data-slot":"select-value",...e})}function _Z({className:e,size:t="default",children:a,...r}){return m.jsxs(xje,{"data-slot":"select-trigger","data-size":t,className:W("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,m.jsx(wje,{asChild:!0,children:m.jsx(fr,{className:"size-4 opacity-50"})})]})}function SZ({className:e,children:t,position:a="popper",...r}){return m.jsx(Lje,{children:m.jsxs(Nje,{"data-slot":"select-content",className:W("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:[m.jsx(LZ,{}),m.jsx(Rje,{className:W("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),m.jsx(NZ,{})]})})}function Qje({className:e,...t}){return m.jsx(Oje,{"data-slot":"select-label",className:W("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function CZ({className:e,children:t,...a}){return m.jsxs(Vje,{"data-slot":"select-item",className:W("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:[m.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:m.jsx(Uje,{children:m.jsx(Fa,{className:"size-4"})})}),m.jsx(Bje,{children:t})]})}function Jje({className:e,...t}){return m.jsx(Yje,{"data-slot":"select-separator",className:W("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function LZ({className:e,...t}){return m.jsx(Gje,{"data-slot":"select-scroll-up-button",className:W("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Mu,{className:"size-4"})})}function NZ({className:e,...t}){return m.jsx(Zje,{"data-slot":"select-scroll-down-button",className:W("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(fr,{className:"size-4"})})}var eEe=Object.defineProperty,IZ=(e,t)=>eEe(e,"name",{value:t,configurable:!0}),jV="horizontal",tEe=["horizontal","vertical"],nEe=k.forwardRef(IZ(function(t,a){const{decorative:r,orientation:c=jV,...d}=t,u=AZ(c)?c:jV,f=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return m.jsx(ge.div,{"data-orientation":u,...f,...d,ref:a})},"Separator"));function AZ(e){return tEe.includes(e)}IZ(AZ,"isValidOrientation");var aEe=nEe;function DD({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return m.jsx(aEe,{"data-slot":"separator-root",decorative:a,orientation:t,className:W("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 jZ({...e}){return m.jsx(qT,{"data-slot":"sheet",...e})}function oEe({...e}){return m.jsx(TU,{"data-slot":"sheet-trigger",...e})}function rEe({...e}){return m.jsx(DA,{"data-slot":"sheet-close",...e})}function iEe({...e}){return m.jsx(OT,{"data-slot":"sheet-portal",...e})}function cEe({className:e,...t}){return m.jsx(HT,{"data-slot":"sheet-overlay",className:W("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 EZ({className:e,children:t,side:a="right",...r}){return m.jsxs(iEe,{children:[m.jsx(cEe,{}),m.jsxs(VT,{"data-slot":"sheet-content",className:W("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,m.jsxs(DA,{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:[m.jsx(yr,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function PZ({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-header",className:W("flex flex-col gap-1.5 p-4",e),...t})}function sEe({className:e,...t}){return m.jsx("div",{"data-slot":"sheet-footer",className:W("mt-auto flex flex-col gap-2 p-4",e),...t})}function RZ({className:e,...t}){return m.jsx(qU,{"data-slot":"sheet-title",className:W("text-foreground font-semibold",e),...t})}function TZ({className:e,...t}){return m.jsx(OU,{"data-slot":"sheet-description",className:W("text-muted-foreground text-sm",e),...t})}const aR=768;function lEe(){const[e,t]=k.useState(void 0);return k.useEffect(()=>{const a=window.matchMedia(`(max-width: ${aR-1}px)`),r=()=>{t(window.innerWidth<aR)};return a.addEventListener("change",r),t(window.innerWidth<aR),()=>a.removeEventListener("change",r)},[]),!!e}function SA({className:e,...t}){return m.jsx("div",{"data-slot":"skeleton",className:W("bg-accent animate-pulse rounded-md",e),...t})}var dEe=Object.defineProperty,$t=(e,t)=>dEe(e,"name",{value:t,configurable:!0}),[zD,OTe]=qt("Tooltip",[Sr]),rj=Sr(),uEe="TooltipProvider",hEe=700,UR="tooltip.open",[pEe,$D]=zD(uEe),fEe=$t(e=>{const{__scopeTooltip:t,delayDuration:a=hEe,skipDelayDuration:r=300,disableHoverableContent:c=!1,children:d}=e,u=k.useRef(!0),h=k.useRef(!1),f=k.useRef(0);return k.useEffect(()=>{const y=f.current;return()=>window.clearTimeout(y)},[]),m.jsx(pEe,{scope:t,isOpenDelayedRef:u,delayDuration:a,onOpen:k.useCallback(()=>{r<=0||(window.clearTimeout(f.current),u.current=!1)},[r]),onClose:k.useCallback(()=>{r<=0||(window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.current=!0,r))},[r]),isPointerInTransitRef:h,onPointerInTransitChange:k.useCallback(y=>{h.current=y},[]),disableHoverableContent:c,children:d})},"TooltipProvider"),GR="Tooltip",[yEe,u2]=zD(GR),mEe=$t(e=>{const{__scopeTooltip:t,children:a,open:r,defaultOpen:c,onOpenChange:d,disableHoverableContent:u,delayDuration:h}=e,f=$D(GR,e.__scopeTooltip),y=rj(t),[x,g]=k.useState(null),[b,M]=k.useState(void 0),_=kt(),S=k.useRef(0),C=u??f.disableHoverableContent,L=h??f.delayDuration,A=k.useRef(!1),[j,E]=Ut({prop:r,defaultProp:c??!1,onChange:$t(ae=>{ae?(f.onOpen(),document.dispatchEvent(new CustomEvent(UR))):f.onClose(),d?.(ae)},"onChange"),caller:GR}),z=k.useMemo(()=>j?A.current?"delayed-open":"instant-open":"closed",[j]),R=k.useCallback(()=>{window.clearTimeout(S.current),S.current=0,A.current=!1,E(!0)},[E]),$=k.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E(!1)},[E]),H=k.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{A.current=!0,E(!0),S.current=0},L)},[L,E]);k.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const K=b??_;return m.jsx(i2,{...y,children:m.jsx(yEe,{scope:t,contentId:K,setContentId:M,open:j,stateAttribute:z,trigger:x,onTriggerChange:g,onTriggerEnter:k.useCallback(()=>{f.isOpenDelayedRef.current?H():R()},[f.isOpenDelayedRef,H,R]),onTriggerLeave:k.useCallback(()=>{C?$():(window.clearTimeout(S.current),S.current=0)},[$,C]),onOpen:R,onClose:$,disableHoverableContent:C,children:a})})},"Tooltip"),EV="TooltipTrigger",kEe=k.forwardRef($t(function(t,a){const{__scopeTooltip:r,...c}=t,d=u2(EV,r),u=$D(EV,r),h=rj(r),f=k.useRef(null),y=Ee(a,f,d.onTriggerChange),x=k.useRef(!1),g=k.useRef(!1),b=k.useCallback(()=>x.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),m.jsx(c2,{asChild:!0,...h,children:m.jsx(ge.button,{"aria-describedby":d.open?d.contentId:void 0,"data-state":d.stateAttribute,...c,ref:y,onPointerMove:fe(t.onPointerMove,M=>{M.pointerType!=="touch"&&!g.current&&!u.isPointerInTransitRef.current&&(d.onTriggerEnter(),g.current=!0)}),onPointerLeave:fe(t.onPointerLeave,()=>{d.onTriggerLeave(),g.current=!1}),onPointerDown:fe(t.onPointerDown,()=>{d.open&&d.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:fe(t.onFocus,()=>{x.current||d.onOpen()}),onBlur:fe(t.onBlur,d.onClose),onClick:fe(t.onClick,d.onClose)})})},"TooltipTrigger")),DZ="TooltipPortal",[gEe,vEe]=zD(DZ,{forceMount:void 0}),xEe=$t(e=>{const{__scopeTooltip:t,forceMount:a,children:r,container:c}=e,d=u2(DZ,t);return m.jsx(gEe,{scope:t,forceMount:a,children:m.jsx(kn,{present:a||d.open,children:m.jsx(rd,{asChild:!0,container:c,children:r})})})},"TooltipPortal"),Uu="TooltipContent",bEe=k.forwardRef($t(function(t,a){const r=vEe(Uu,t.__scopeTooltip),{forceMount:c=r.forceMount,side:d="top",...u}=t,h=u2(Uu,t.__scopeTooltip);return m.jsx(kn,{present:c||h.open,children:h.disableHoverableContent?m.jsx(zZ,{side:d,...u,ref:a}):m.jsx(MEe,{side:d,...u,ref:a})})},"TooltipContent")),MEe=k.forwardRef($t(function(t,a){const r=u2(Uu,t.__scopeTooltip),c=$D(Uu,t.__scopeTooltip),d=k.useRef(null),u=Ee(a,d),[h,f]=k.useState(null),{trigger:y,onClose:x}=r,g=d.current,{onPointerInTransitChange:b}=c,M=k.useCallback(()=>{f(null),b(!1)},[b]),_=k.useCallback((S,C)=>{const L=S.currentTarget,A={x:S.clientX,y:S.clientY},j=$Z(A,L.getBoundingClientRect()),E=qZ(A,j),z=OZ(C.getBoundingClientRect()),R=VZ([...E,...z]);f(R),b(!0)},[b]);return k.useEffect(()=>()=>M(),[M]),k.useEffect(()=>{if(y&&g){const S=$t(L=>_(L,g),"handleTriggerLeave"),C=$t(L=>_(L,y),"handleContentLeave");return y.addEventListener("pointerleave",S),g.addEventListener("pointerleave",C),()=>{y.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",C)}}},[y,g,_,M]),k.useEffect(()=>{if(h){const S=$t(C=>{const L=C.target,A={x:C.clientX,y:C.clientY},j=y?.contains(L)||g?.contains(L),E=!HZ(A,h);j?M():E&&(M(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[y,g,h,x,M]),m.jsx(zZ,{...t,ref:u})},"TooltipContentHoverable")),wEe=lF("TooltipContent"),zZ=k.forwardRef($t(function(t,a){const{__scopeTooltip:r,children:c,"aria-label":d,id:u,onEscapeKeyDown:h,onPointerDownOutside:f,...y}=t,x=u2(Uu,r),g=rj(r),{onClose:b}=x;k.useEffect(()=>(document.addEventListener(UR,b),()=>document.removeEventListener(UR,b)),[b]),k.useEffect(()=>{if(x.trigger){const _=$t(S=>{S.target instanceof Node&&S.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",_,{capture:!0}),()=>window.removeEventListener("scroll",_,{capture:!0})}},[x.trigger,b]);const{setContentId:M}=x;return mt(()=>(M(u),()=>{M(void 0)}),[u,M]),m.jsx(a2,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:_=>_.preventDefault(),onDismiss:b,children:m.jsxs(XA,{"data-state":x.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:x.contentId,...g,...y,ref:a,style:{...y.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:[m.jsx(wEe,{children:c}),d?m.jsx(dje,{id:x.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl")),_Ee=k.forwardRef($t(function(t,a){const{__scopeTooltip:r,...c}=t,d=rj(r);return m.jsx(HCe,{...d,...c,ref:a})},"TooltipArrow"));function $Z(e,t){const a=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),c=Math.abs(t.right-e.x),d=Math.abs(t.left-e.x);switch(Math.min(a,r,c,d)){case d:return"left";case c:return"right";case a:return"top";case r:return"bottom";default:throw new Error("unreachable")}}$t($Z,"getExitSideFromRect");function qZ(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}$t(qZ,"getPaddedExitPoints");function OZ(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}]}$t(OZ,"getPointsFromRect");function HZ(e,t){const{x:a,y:r}=e;let c=!1;for(let d=0,u=t.length-1;d<t.length;u=d++){const h=t[d],f=t[u],y=h.x,x=h.y,g=f.x,b=f.y;x>r!=b>r&&a<(g-y)*(r-x)/(b-x)+y&&(c=!c)}return c}$t(HZ,"isPointInPolygon");function VZ(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),BZ(t)}$t(VZ,"getHull");function BZ(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 d=t[t.length-1],u=t[t.length-2];if((d.x-u.x)*(c.y-u.y)>=(d.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 d=a[a.length-1],u=a[a.length-2];if((d.x-u.x)*(c.y-u.y)>=(d.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)}$t(BZ,"getHullPresorted");var SEe=fEe,CEe=mEe,LEe=kEe,NEe=xEe,IEe=bEe,AEe=_Ee;function ij({delayDuration:e=0,...t}){return m.jsx(SEe,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function qD({...e}){return m.jsx(ij,{children:m.jsx(CEe,{"data-slot":"tooltip",...e})})}function OD({...e}){return m.jsx(LEe,{"data-slot":"tooltip-trigger",...e})}function HD({className:e,sideOffset:t=0,children:a,...r}){return m.jsx(NEe,{children:m.jsxs(IEe,{"data-slot":"tooltip-content",sideOffset:t,className:W("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,m.jsx(AEe,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const jEe="sidebar_state",EEe=3600*24*7,PEe="16rem",REe="18rem",TEe="3rem",DEe="b",FZ=k.createContext(null);function h2(){const e=k.useContext(FZ);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function zEe({defaultOpen:e=!0,open:t,onOpenChange:a,className:r,style:c,children:d,...u}){const h=lEe(),[f,y]=k.useState(!1),[x,g]=k.useState(e),b=t??x,M=k.useCallback(L=>{const A=typeof L=="function"?L(b):L;a?a(A):g(A),document.cookie=`${jEe}=${A}; path=/; max-age=${EEe}`},[a,b]),_=k.useCallback(()=>h?y(L=>!L):M(L=>!L),[h,M,y]);k.useEffect(()=>{const L=A=>{A.key===DEe&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),_())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[_]);const S=b?"expanded":"collapsed",C=k.useMemo(()=>({state:S,open:b,setOpen:M,isMobile:h,openMobile:f,setOpenMobile:y,toggleSidebar:_}),[S,b,M,h,f,y,_]);return m.jsx(FZ.Provider,{value:C,children:m.jsx(ij,{delayDuration:0,children:m.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":PEe,"--sidebar-width-icon":TEe,...c},className:W("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...u,children:d})})})}function $Ee({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:r,children:c,...d}){const{isMobile:u,state:h,openMobile:f,setOpenMobile:y}=h2();return a==="none"?m.jsx("div",{"data-slot":"sidebar",className:W("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...d,children:c}):u?m.jsx(jZ,{open:f,onOpenChange:y,...d,children:m.jsxs(EZ,{"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":REe},side:e,children:[m.jsxs(PZ,{className:"sr-only",children:[m.jsx(RZ,{children:"Sidebar"}),m.jsx(TZ,{children:"Displays the mobile sidebar."})]}),m.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):m.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:[m.jsx("div",{"data-slot":"sidebar-gap",className:W("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)")}),m.jsx("div",{"data-slot":"sidebar-container",className:W("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),...d,children:m.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}=h2();return m.jsxs(tn,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:W("size-7",e),onClick:c=>{t?.(c),r()},...a,children:[m.jsx(hr,{}),m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function OEe({className:e,...t}){const{toggleSidebar:a}=h2();return m.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:W("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 HEe({className:e,...t}){return m.jsx("main",{"data-slot":"sidebar-inset",className:W("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 VEe({className:e,...t}){return m.jsx(CD,{"data-slot":"sidebar-input","data-sidebar":"input",className:W("bg-background h-8 w-full shadow-none",e),...t})}function BEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:W("flex flex-col gap-2 p-2",e),...t})}function FEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:W("flex flex-col gap-2 p-2",e),...t})}function UEe({className:e,...t}){return m.jsx(DD,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:W("bg-sidebar-border mx-2 w-auto",e),...t})}function GEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:W("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function ZEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:W("relative flex w-full min-w-0 flex-col p-2",e),...t})}function YEe({className:e,asChild:t=!1,...a}){const r=t?Mr:"div";return m.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:W("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 XEe({className:e,asChild:t=!1,...a}){const r=t?Mr:"button";return m.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:W("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 WEe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:W("w-full text-sm",e),...t})}function KEe({className:e,...t}){return m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:W("flex w-full min-w-0 flex-col gap-1",e),...t})}function QEe({className:e,...t}){return m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:W("group/menu-item relative",e),...t})}const JEe=AA("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 ePe({asChild:e=!1,isActive:t=!1,variant:a="default",size:r="default",tooltip:c,className:d,...u}){const h=e?Mr:"button",{isMobile:f,state:y}=h2(),x=m.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:W(JEe({variant:a,size:r}),d),...u});return c?(typeof c=="string"&&(c={children:c}),m.jsxs(qD,{children:[m.jsx(OD,{asChild:!0,children:x}),m.jsx(HD,{side:"right",align:"center",hidden:y!=="collapsed"||f,...c})]})):x}function tPe({className:e,asChild:t=!1,showOnHover:a=!1,...r}){const c=t?Mr:"button";return m.jsx(c,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:W("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 nPe({className:e,...t}){return m.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:W("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 aPe({className:e,showIcon:t=!1,...a}){const r=k.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return m.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:W("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[t&&m.jsx(SA,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),m.jsx(SA,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function oPe({className:e,...t}){return m.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:W("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 rPe({className:e,...t}){return m.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:W("group/menu-sub-item relative",e),...t})}function iPe({asChild:e=!1,size:t="md",isActive:a=!1,className:r,...c}){const d=e?Mr:"a";return m.jsx(d,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:W("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 cPe=Object.defineProperty,et=(e,t)=>cPe(e,"name",{value:t,configurable:!0}),UZ=["PageUp","PageDown"],GZ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZZ={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},p2="Slider",[ZR,sPe,lPe]=cd(p2),[VD,HTe]=qt(p2,[lPe]),[dPe,f2]=VD(p2),uPe=k.forwardRef(et(function(t,a){const{name:r,min:c=0,max:d=100,step:u=1,orientation:h="horizontal",disabled:f=!1,minStepsBetweenThumbs:y=0,defaultValue:x=[c],value:g,onValueChange:b=et(()=>{},"onValueChange"),onValueCommit:M=et(()=>{},"onValueCommit"),inverted:_=!1,form:S,...C}=t,L=k.useRef(new Set),A=k.useRef(0),j=k.useRef(!1),z=h==="horizontal"?hPe:pPe,[R,$]=k.useState(null),H=Ee(a,$),[K=[],ae]=Ut({prop:g,defaultProp:x,onChange:et(P=>{[...L.current][A.current]?.focus({preventScroll:!0,focusVisible:j.current}),j.current=!1,b(P)},"onChange")}),Y=k.useRef(K),G=k.useRef(K);k.useEffect(()=>{const P=S?R?.ownerDocument.getElementById(S):R?.closest("form");if(P instanceof HTMLFormElement){const O=et(()=>ae(G.current),"reset");return P.addEventListener("reset",O),()=>P.removeEventListener("reset",O)}},[R,S,ae]);function J(P){const O=tY(K,P);N(P,O)}et(J,"handleSlideStart");function oe(P){N(P,A.current)}et(oe,"handleSlideMove");function he(){String(K)!==String(Y.current)&&M(K)}et(he,"handleSlideEnd");function N(P,O,{commit:te}={commit:!1}){const B=FD(u),D=Iu(Math.round((P-c)/u)*u+c,B),T=Fu(D,[c,d]);ae((U=[])=>{const X=JZ(U,T,O);if(oY(X,y*u)){A.current=X.indexOf(T);const Z=String(X)!==String(U);return Z&&te&&M(X),Z?X:U}else return U})}return et(N,"updateValues"),m.jsx(dPe,{scope:t.__scopeSlider,name:r,disabled:f,min:c,max:d,valueIndexToChangeRef:A,thumbs:L.current,values:K,orientation:h,form:S,children:m.jsx(ZR.Provider,{scope:t.__scopeSlider,children:m.jsx(ZR.Slot,{scope:t.__scopeSlider,children:m.jsx(z,{"aria-disabled":f,"data-disabled":f?"":void 0,...C,ref:H,onPointerDown:fe(C.onPointerDown,()=>{f||(Y.current=K,j.current=!1)}),min:c,max:d,inverted:_,onSlideStart:f?void 0:J,onSlideMove:f?void 0:oe,onSlideEnd:f?void 0:he,onHomeKeyDown:()=>{f||(j.current=!0,N(c,0,{commit:!0}))},onEndKeyDown:()=>{f||(j.current=!0,N(d,K.length-1,{commit:!0}))},onStepKeyDown:({event:P,direction:O})=>{if(!f){j.current=!0;const D=UZ.includes(P.key)||P.shiftKey&&GZ.includes(P.key)?10:1,T=A.current,U=K[T],X=rY(U,{min:c,step:u,direction:O,multiplier:D});N(X,T,{commit:!0})}}})})})})},"Slider")),[YZ,XZ]=VD(p2,{startEdge:"left",endEdge:"right",size:"width",direction:1}),hPe=k.forwardRef(et(function(t,a){const{min:r,max:c,dir:d,inverted:u,onSlideStart:h,onSlideMove:f,onSlideEnd:y,onStepKeyDown:x,...g}=t,[b,M]=k.useState(null),_=Ee(a,M),S=k.useRef(void 0),C=Vl(d),L=C==="ltr",A=L&&!u||!L&&u;function j(E){const z=S.current||b.getBoundingClientRect(),R=[0,z.width],H=cj(R,A?[r,c]:[c,r]);return S.current=z,H(E-z.left)}return et(j,"getValueFromPointer"),m.jsx(YZ,{scope:t.__scopeSlider,startEdge:A?"left":"right",endEdge:A?"right":"left",direction:A?1:-1,size:"width",children:m.jsx(WZ,{dir:C,"data-orientation":"horizontal",...g,ref:_,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:E=>{const z=j(E.clientX);h?.(z)},onSlideMove:E=>{const z=j(E.clientX);f?.(z)},onSlideEnd:()=>{S.current=void 0,y?.()},onStepKeyDown:E=>{const R=ZZ[A?"from-left":"from-right"].includes(E.key);x?.({event:E,direction:R?-1:1})}})})},"SliderHorizontal")),pPe=k.forwardRef(et(function(t,a){const{min:r,max:c,inverted:d,onSlideStart:u,onSlideMove:h,onSlideEnd:f,onStepKeyDown:y,...x}=t,g=k.useRef(null),b=Ee(a,g),M=k.useRef(void 0),_=!d;function S(C){const L=M.current||g.current.getBoundingClientRect(),A=[0,L.height],E=cj(A,_?[c,r]:[r,c]);return M.current=L,E(C-L.top)}return et(S,"getValueFromPointer"),m.jsx(YZ,{scope:t.__scopeSlider,startEdge:_?"bottom":"top",endEdge:_?"top":"bottom",size:"height",direction:_?1:-1,children:m.jsx(WZ,{"data-orientation":"vertical",...x,ref:b,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const L=S(C.clientY);u?.(L)},onSlideMove:C=>{const L=S(C.clientY);h?.(L)},onSlideEnd:()=>{M.current=void 0,f?.()},onStepKeyDown:C=>{const A=ZZ[_?"from-bottom":"from-top"].includes(C.key);y?.({event:C,direction:A?-1:1})}})})},"SliderVertical")),WZ=k.forwardRef(et(function(t,a){const{__scopeSlider:r,onSlideStart:c,onSlideMove:d,onSlideEnd:u,onHomeKeyDown:h,onEndKeyDown:f,onStepKeyDown:y,...x}=t,g=f2(p2,r);return m.jsx(ge.span,{...x,ref:a,onKeyDown:fe(t.onKeyDown,b=>{b.key==="Home"?(h(b),b.preventDefault()):b.key==="End"?(f(b),b.preventDefault()):UZ.concat(GZ).includes(b.key)&&(y(b),b.preventDefault())}),onPointerDown:fe(t.onPointerDown,b=>{const M=b.target;M.setPointerCapture(b.pointerId),b.preventDefault(),g.thumbs.has(M)?M.focus({preventScroll:!0,focusVisible:!1}):c(b)}),onPointerMove:fe(t.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&d(b)}),onPointerUp:fe(t.onPointerUp,b=>{const M=b.target;M.hasPointerCapture(b.pointerId)&&(M.releasePointerCapture(b.pointerId),u(b))})})},"SliderImpl")),fPe="SliderTrack",yPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,...c}=t,d=f2(fPe,r);return m.jsx(ge.span,{"data-disabled":d.disabled?"":void 0,"data-orientation":d.orientation,...c,ref:a})},"SliderTrack")),PV="SliderRange",mPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,...c}=t,d=f2(PV,r),u=XZ(PV,r),h=k.useRef(null),f=Ee(a,h),y=d.values.length,x=d.values.map(M=>BD(M,d.min,d.max)),g=y>1?Math.min(...x):0,b=100-Math.max(...x);return m.jsx(ge.span,{"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,...c,ref:f,style:{...t.style,[u.startEdge]:g+"%",[u.endEdge]:b+"%"}})},"SliderRange")),kPe="SliderThumb",[gPe,KZ]=VD(kPe),vPe="SliderThumbProvider";function QZ(e){const{__scopeSlider:t,name:a,children:r,internal_do_not_use_render:c}=e,d=f2(vPe,t),u=sPe(t),[h,f]=k.useState(null),y=k.useMemo(()=>h?u().findIndex(C=>C.ref.current===h):-1,[u,h]),x=t2(h),g=h?!!d.form||!!h.closest("form"):!0,b=d.values[y],M=a??(d.name?d.name+(d.values.length>1?"[]":""):void 0),_=b===void 0?0:BD(b,d.min,d.max);k.useEffect(()=>{if(h)return d.thumbs.add(h),()=>{d.thumbs.delete(h)}},[h,d.thumbs]);const S={value:b,name:M,form:d.form,isFormControl:g,index:y,thumb:h,onThumbChange:f,percent:_,size:x};return m.jsx(gPe,{scope:t,...S,children:iY(c)?c(S):r})}et(QZ,"SliderThumbProvider");var oR="SliderThumbTrigger",xPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,...c}=t,d=f2(oR,r),u=XZ(oR,r),{index:h,value:f,percent:y,size:x,onThumbChange:g}=KZ(oR,r),b=Ee(a,g),M=eY(h,d.values.length),_=x?.[u.size],S=_?nY(_,y,u.direction):0;return m.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${y}% + ${S}px)`},children:m.jsx(ZR.ItemSlot,{scope:r,children:m.jsx(ge.span,{role:"slider","aria-label":t["aria-label"]||M,"aria-valuemin":d.min,"aria-valuenow":f,"aria-valuemax":d.max,"aria-orientation":d.orientation,"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,tabIndex:d.disabled?void 0:0,...c,ref:b,style:f===void 0?{display:"none"}:t.style,onFocus:fe(t.onFocus,()=>{d.valueIndexToChangeRef.current=h})})})})},"SliderThumbTrigger")),bPe=k.forwardRef(et(function(t,a){const{__scopeSlider:r,name:c,...d}=t;return m.jsx(QZ,{__scopeSlider:r,name:c,internal_do_not_use_render:({index:u,isFormControl:h})=>m.jsxs(m.Fragment,{children:[m.jsx(xPe,{...d,ref:a,__scopeSlider:r}),h?m.jsx(wPe,{__scopeSlider:r},u):null]})})},"SliderThumb")),MPe="SliderBubbleInput",wPe=k.forwardRef(et(function({__scopeSlider:t,...a},r){const{value:c,name:d,form:u}=KZ(MPe,t),h=k.useRef(null),f=Ee(h,r),y=jD(c);return k.useEffect(()=>{const x=h.current;if(!x)return;const g=window.HTMLInputElement.prototype,M=Object.getOwnPropertyDescriptor(g,"value").set;if(y!==c&&M){const _=new Event("input",{bubbles:!0});M.call(x,c),x.dispatchEvent(_)}},[y,c]),m.jsx(ge.input,{style:{display:"none"},name:d,form:u,...a,ref:f,defaultValue:c})},"SliderBubbleInput"));function JZ(e=[],t,a){const r=[...e];return r[a]=t,r.sort((c,d)=>c-d)}et(JZ,"getNextSortedValues");function BD(e,t,a){const d=100/(a-t)*(e-t);return Fu(d,[0,100])}et(BD,"convertValueToPercentage");function eY(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}et(eY,"getLabel");function tY(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)}et(tY,"getClosestValueIndex");function nY(e,t,a){const r=e/2,d=cj([0,50],[0,r]);return(r-d(t)*a)*a}et(nY,"getThumbInBoundsOffset");function aY(e){return e.slice(0,-1).map((t,a)=>e[a+1]-t)}et(aY,"getStepsBetweenValues");function oY(e,t){if(t>0){const a=aY(e);return Math.min(...a)>=t}return!0}et(oY,"hasMinStepsBetweenValues");function cj(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])}}et(cj,"linearScale");function FD(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[r,c]=t.split("e"),d=r.split(".")[1]||"",u=Number(c);return Math.max(0,d.length-u)}const a=t.split(".")[1];return a?a.length:0}et(FD,"getDecimalCount");function Iu(e,t){const a=Math.pow(10,t);return Math.round(e*a)/a}et(Iu,"roundValue");function rY(e,{min:t,step:a,direction:r,multiplier:c}){const d=FD(a),u=(e-t)/a,h=Math.round(u),f=Iu(h*a+t,d)===Iu(e,d);let y;return f?y=h+c*r:r>0?y=Math.ceil(u):y=Math.floor(u),Iu(y*a+t,d)}et(rY,"getNextStepValue");function iY(e){return typeof e=="function"}et(iY,"isFunction");function cY({className:e,defaultValue:t,value:a,min:r=0,max:c=100,id:d,...u}){const h=k.useMemo(()=>Array.isArray(a)?a:Array.isArray(t)?t:[r,c],[a,t,r,c]);return m.jsxs(uPe,{"data-slot":"slider",defaultValue:t,value:a,min:r,max:c,id:d,className:W("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:[m.jsx(yPe,{"data-slot":"slider-track",className:W("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:m.jsx(mPe,{"data-slot":"slider-range",className:W("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:h.length},(f,y)=>m.jsx(bPe,{"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"},y))]})}var _Pe=(e,t,a,r,c,d,u,h)=>{let f=document.documentElement,y=["light","dark"];function x(M){(Array.isArray(e)?e:[e]).forEach(_=>{let S=_==="class",C=S&&d?c.map(L=>d[L]||L):c;S?(f.classList.remove(...C),f.classList.add(d&&d[M]?d[M]:M)):f.setAttribute(_,M)}),g(M)}function g(M){h&&y.includes(M)&&(f.style.colorScheme=M)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)x(r);else try{let M=localStorage.getItem(t)||a,_=u&&M==="system"?b():M;x(_)}catch{}},SPe=k.createContext(void 0),CPe={setTheme:e=>{},themes:[]},LPe=()=>{var e;return(e=k.useContext(SPe))!=null?e:CPe};k.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:r,enableColorScheme:c,defaultTheme:d,value:u,themes:h,nonce:f,scriptProps:y})=>{let x=JSON.stringify([a,t,d,e,h,u,r,c]).slice(1,-1);return k.createElement("script",{...y,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${_Pe.toString()})(${x})`}})});function NPe(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 IPe=e=>{switch(e){case"success":return EPe;case"info":return RPe;case"warning":return PPe;case"error":return TPe;default:return null}},APe=Array(12).fill(0),jPe=({visible:e,className:t})=>ye.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ye.createElement("div",{className:"sonner-spinner"},APe.map((a,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),EPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),PPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),RPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),TPe=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),DPe=ye.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"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zPe=()=>{const[e,t]=ye.useState(document.hidden);return ye.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e};let $Pe=1;const qPe=100,RV=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:$Pe++};class OPe{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=RV(t),d=this.pendingDismissals.get(c);d!==void 0&&(cancelAnimationFrame(d),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(y=>y.id!==c)),(u?void 0:this.toasts.find(y=>y.id===c))?this.toasts=this.toasts.map(y=>y.id===c?(this.publish({...y,...t,id:c,title:a}),{...y,...t,id:c,dismissible:h,title:a}):y):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 d=r!==void 0,u;const h=c.then(async y=>{if(u=["resolve",y],ye.isValidElement(y))d=!1,this.create({id:r,type:"default",message:y});else if(VPe(y)&&!y.ok){d=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${y.status}`):a.error,b=typeof a.description=="function"?await a.description(`HTTP error! status: ${y.status}`):a.description,_=typeof g=="object"&&!ye.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:b,..._})}else if(y instanceof Error){d=!1;const g=typeof a.error=="function"?await a.error(y):a.error,b=typeof a.description=="function"?await a.description(y):a.description,_=typeof g=="object"&&!ye.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:b,..._})}else if(a.success!==void 0){d=!1;const g=typeof a.success=="function"?await a.success(y):a.success,b=typeof a.description=="function"?await a.description(y):a.description,_=typeof g=="object"&&!ye.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:b,..._})}}).catch(async y=>{if(u=["reject",y],a.error!==void 0){d=!1;const x=typeof a.error=="function"?await a.error(y):a.error,g=typeof a.description=="function"?await a.description(y):a.description,M=typeof x=="object"&&!ye.isValidElement(x)?x:{message:x};this.create({id:r,type:"error",description:g,...M})}}).finally(()=>{d&&(this.dismiss(r),r=void 0),a.finally==null||a.finally.call(a)}),f=()=>new Promise((y,x)=>h.then(()=>u[0]==="reject"?x(u[1]):y(u[1])).catch(x));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,a)=>{const r=RV(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 dn=new OPe,HPe=(e,t)=>dn.message(e,t),VPe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",BPe=HPe,FPe=()=>dn.toasts,UPe=()=>dn.getActiveToasts(),GPe=Object.assign(BPe,{success:dn.success,info:dn.info,warning:dn.warning,error:dn.error,custom:dn.custom,message:dn.message,promise:dn.promise,dismiss:dn.dismiss,loading:dn.loading},{getHistory:FPe,getToasts:UPe});NPe("[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 F0(e){return e.label!==void 0}const ZPe=3,YPe="24px",XPe="16px",TV=4e3,WPe=356,KPe=14,QPe=45,JPe=200;function Ra(...e){return e.filter(Boolean).join(" ")}function eRe(e){const[t,a]=e.split("-"),r=[];return t&&r.push(t),a&&r.push(a),r}const tRe=e=>{var t,a,r,c,d,u,h,f,y;const{invert:x,toast:g,unstyled:b,interacting:M,setHeights:_,visibleToasts:S,heights:C,index:L,toasts:A,expanded:j,removeToast:E,defaultRichColors:z,closeButton:R,style:$,cancelButtonStyle:H,actionButtonStyle:K,className:ae="",descriptionClassName:Y="",duration:G,position:J,gap:oe,expandByDefault:he,classNames:N,icons:P,closeButtonAriaLabel:O="Close toast"}=e,[te,B]=ye.useState(null),[D,T]=ye.useState(null),[U,X]=ye.useState(!1),[Z,ce]=ye.useState(!1),[pe,ie]=ye.useState(!1),[se,_e]=ye.useState(!1),[ve,Ne]=ye.useState(!1),[Re,qe]=ye.useState(0),[xe,Ae]=ye.useState(0),vt=ye.useRef(g.duration||G||TV),ke=ye.useRef(null),Te=ye.useRef(null),Le=L===0,ct=L+1<=S,Ke=g.type,nn=Ke??"default",nt=g.dismissible!==!1,ua=g.className||"",xt=g.descriptionClassName||"",Mn=ye.useMemo(()=>C.findIndex(Pe=>Pe.toastId===g.id)||0,[C,g.id]),jo=ye.useMemo(()=>{var Pe;return(Pe=g.closeButton)!=null?Pe:R},[g.closeButton,R]),Eo=ye.useMemo(()=>g.duration||G||TV,[g.duration,G]),La=ye.useRef(0),Po=ye.useRef(0),m2=ye.useRef(0),Kn=ye.useRef(null),[an,Na]=J.split("-"),Qt=ye.useMemo(()=>C.reduce((Pe,wt,Lt)=>Lt>=Mn?Pe:Pe+wt.height,0),[C,Mn]),k2=zPe(),Qn=ye.useMemo(()=>{var Pe;return(Pe=e.swipeDirections)!=null?Pe:eRe(J)},[e.swipeDirections,J]),sj=g.invert||x,Ro=Ke==="loading";Po.current=ye.useMemo(()=>Mn*oe+Qt,[Mn,Qt]),ye.useEffect(()=>{vt.current=Eo},[Eo]),ye.useEffect(()=>{X(!0)},[]),ye.useEffect(()=>{const Pe=Te.current;if(Pe){const wt=Pe.getBoundingClientRect().height;return Ae(wt),_(Lt=>[{toastId:g.id,height:wt,position:g.position},...Lt]),()=>_(Lt=>Lt.filter(Nt=>Nt.toastId!==g.id))}},[_,g.id]),ye.useLayoutEffect(()=>{if(!U)return;const Pe=Te.current,wt=Pe.style.height;Pe.style.height="auto";const Lt=Pe.getBoundingClientRect().height;Pe.style.height=wt,Ae(Lt),_(Nt=>Nt.find(It=>It.toastId===g.id)?Nt.map(It=>It.toastId===g.id?{...It,height:Lt}:It):[{toastId:g.id,height:Lt,position:g.position},...Nt])},[U,g.title,g.description,_,g.id,g.jsx,g.action,g.cancel]);const $n=ye.useCallback(()=>{ce(!0),qe(Po.current),_(Pe=>Pe.filter(wt=>wt.toastId!==g.id)),setTimeout(()=>{E(g)},JPe)},[g,E,_,Po]);ye.useEffect(()=>{if(g.promise&&Ke==="loading"||g.duration===1/0||g.type==="loading")return;let Pe;return j||M||k2?(()=>{if(m2.current<La.current){const Nt=new Date().getTime()-La.current;vt.current=vt.current-Nt}m2.current=new Date().getTime()})():vt.current!==1/0&&(La.current=new Date().getTime(),Pe=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),$n()},vt.current)),()=>clearTimeout(Pe)},[j,M,g,Ke,k2,$n]),ye.useEffect(()=>{g.delete&&($n(),g.onDismiss==null||g.onDismiss.call(g,g))},[$n,g.delete]);function Nr(){var Pe;if(P?.loading){var wt;return ye.createElement("div",{className:Ra(N?.loader,g==null||(wt=g.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":Ke==="loading"},P.loading)}return ye.createElement(jPe,{className:Ra(N?.loader,g==null||(Pe=g.classNames)==null?void 0:Pe.loader),visible:Ke==="loading"})}const Xa=g.icon||P?.[Ke]||IPe(Ke);var Ir,To;return ye.createElement("li",{tabIndex:0,ref:Te,className:Ra(ae,ua,N?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,N?.[nn],g==null||(a=g.classNames)==null?void 0:a[nn]),"data-sonner-toast":"","data-rich-colors":(Ir=g.richColors)!=null?Ir:z,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":U,"data-promise":!!g.promise,"data-swiped":ve,"data-removed":Z,"data-visible":ct,"data-y-position":an,"data-x-position":Na,"data-index":L,"data-front":Le,"data-swiping":pe,"data-dismissible":nt,"data-type":Ke,"data-invert":sj,"data-swipe-out":se,"data-swipe-direction":D,"data-expanded":!!(j||he&&U),"data-testid":g.testId,style:{"--index":L,"--toasts-before":L,"--z-index":A.length-L,"--offset":`${Z?Re:Po.current}px`,"--initial-height":he?"auto":`${xe}px`,...$,...g.style},onDragEnd:()=>{ie(!1),B(null),Kn.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Ro||!nt||(ke.current=new Date,qe(Po.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ie(!0),Kn.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,wt,Lt;if(se||!nt)return;Kn.current=null;const Nt=Number(((Pe=Te.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ar=Number(((wt=Te.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),It=new Date().getTime()-((Lt=ke.current)==null?void 0:Lt.getTime()),on=te==="x"?Nt:Ar,qn=Math.abs(on)/It;if((te==="x"?Qn.includes(Nt>0?"right":"left"):Qn.includes(Ar>0?"bottom":"top"))&&(Math.abs(on)>=QPe||qn>.11)){qe(Po.current),g.onDismiss==null||g.onDismiss.call(g,g),T(te==="x"?Nt>0?"right":"left":Ar>0?"down":"up"),$n(),_e(!0);return}else{var wn,Yl;(wn=Te.current)==null||wn.style.setProperty("--swipe-amount-x","0px"),(Yl=Te.current)==null||Yl.style.setProperty("--swipe-amount-y","0px")}Ne(!1),ie(!1),B(null)},onPointerMove:Pe=>{var wt,Lt,Nt;if(!Kn.current||!nt||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;const It=Pe.clientY-Kn.current.y,on=Pe.clientX-Kn.current.x;!te&&(Math.abs(on)>1||Math.abs(It)>1)&&B(Math.abs(on)>Math.abs(It)?"x":"y");let qn={x:0,y:0};const jr=wn=>1/(1.5+Math.abs(wn)/20);if(te==="y"){if(Qn.includes("top")||Qn.includes("bottom"))if(Qn.includes("top")&&It<0||Qn.includes("bottom")&&It>0)qn.y=It;else{const wn=It*jr(It);qn.y=Math.abs(wn)<Math.abs(It)?wn:It}}else if(te==="x"&&(Qn.includes("left")||Qn.includes("right")))if(Qn.includes("left")&&on<0||Qn.includes("right")&&on>0)qn.x=on;else{const wn=on*jr(on);qn.x=Math.abs(wn)<Math.abs(on)?wn:on}(Math.abs(qn.x)>0||Math.abs(qn.y)>0)&&Ne(!0),(Lt=Te.current)==null||Lt.style.setProperty("--swipe-amount-x",`${qn.x}px`),(Nt=Te.current)==null||Nt.style.setProperty("--swipe-amount-y",`${qn.y}px`)}},jo&&!g.jsx&&Ke!=="loading"?ye.createElement("button",{"aria-label":O,"data-disabled":Ro,"data-close-button":!0,onClick:Ro||!nt?()=>{}:()=>{$n(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Ra(N?.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(To=P?.close)!=null?To:DPe):null,(Ke||g.icon||g.promise)&&g.icon!==null&&(P?.[Ke]!==null||g.icon)?ye.createElement("div",{"data-icon":"",className:Ra(N?.icon,g==null||(c=g.classNames)==null?void 0:c.icon)},Ke==="loading"?g.icon||Nr():g.promise?Nr():null,Ke!=="loading"?Xa:null):null,ye.createElement("div",{"data-content":"",className:Ra(N?.content,g==null||(d=g.classNames)==null?void 0:d.content)},ye.createElement("div",{"data-title":"",className:Ra(N?.title,g==null||(u=g.classNames)==null?void 0:u.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ye.createElement("div",{"data-description":"",className:Ra(Y,xt,N?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),ye.isValidElement(g.cancel)?g.cancel:g.cancel&&F0(g.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||H,onClick:Pe=>{F0(g.cancel)&&nt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Pe),$n())},className:Ra(N?.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,ye.isValidElement(g.action)?g.action:g.action&&F0(g.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||K,onClick:Pe=>{F0(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Pe),!Pe.defaultPrevented&&$n())},className:Ra(N?.actionButton,g==null||(y=g.classNames)==null?void 0:y.actionButton)},g.action.label):null)};function DV(){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 nRe(e,t){const a={};return[e,t].forEach((r,c)=>{const d=c===1,u=d?"--mobile-offset":"--offset",h=d?XPe:YPe;function f(y){["top","right","bottom","left"].forEach(x=>{a[`${u}-${x}`]=typeof y=="number"?`${y}px`:y})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(y=>{r[y]===void 0?a[`${u}-${y}`]=h:a[`${u}-${y}`]=typeof r[y]=="number"?`${r[y]}px`:r[y]}):f(h)}),a}function aRe(){const[e,t]=ye.useState([]);return ye.useEffect(()=>dn.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(d=>d.id===a.id);return c!==-1?[...r.slice(0,c),{...r[c],...a},...r.slice(c+1)]:[a,...r]})})})}),[]),{toasts:e}}const sY=ye.forwardRef(function(t,a){const{id:r,invert:c,position:d="bottom-right",hotkey:u=["altKey","KeyT"],expand:h,closeButton:f,className:y,offset:x,mobileOffset:g,theme:b="light",richColors:M,duration:_,style:S,visibleToasts:C=ZPe,toastOptions:L,dir:A=DV(),gap:j=KPe,icons:E,customAriaLabel:z,containerAriaLabel:R="Notifications"}=t,[$,H]=ye.useState([]),K=ye.useMemo(()=>r?$.filter(X=>X.toasterId===r):$.filter(X=>!X.toasterId),[$,r]),ae=ye.useMemo(()=>Array.from(new Set([d].concat(K.filter(X=>X.position).map(X=>X.position)))),[K,d]),[Y,G]=ye.useState([]),[J,oe]=ye.useState(!1),[he,N]=ye.useState(!1),[P,O]=ye.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),te=ye.useRef(null),B=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=ye.useRef(null),T=ye.useRef(!1),U=ye.useCallback(X=>{H(Z=>{var ce;return(ce=Z.find(pe=>pe.id===X.id))!=null&&ce.delete||dn.dismiss(X.id),Z.filter(({id:pe})=>pe!==X.id)})},[]);return ye.useEffect(()=>dn.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{H(Z=>Z.map(ce=>ce.id===X.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{pA.flushSync(()=>{H(Z=>{const ce=Z.findIndex(pe=>pe.id===X.id);return ce!==-1?[...Z.slice(0,ce),{...Z[ce],...X},...Z.slice(ce+1)]:[X,...Z]})})})}),[]),ye.useEffect(()=>{if(b!=="system"){O(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Z})=>{O(Z?"dark":"light")})}catch{X.addListener(({matches:ce})=>{try{O(ce?"dark":"light")}catch(pe){console.error(pe)}})}},[b]),ye.useEffect(()=>{$.length<=1&&oe(!1)},[$]),ye.useEffect(()=>{const X=Z=>{var ce;if(u.length>0&&u.every(se=>Z[se]||Z.code===se)){var ie;oe(!0),(ie=te.current)==null||ie.focus()}Z.code==="Escape"&&(document.activeElement===te.current||(ce=te.current)!=null&&ce.contains(document.activeElement))&&oe(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[u]),ye.useEffect(()=>{if(te.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,T.current=!1)}},[te.current]),ye.createElement("section",{ref:a,"aria-label":z??`${R} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},ae.map((X,Z)=>{var ce;const[pe,ie]=X.split("-");return K.length?ye.createElement("ol",{key:X,dir:A==="auto"?DV():A,tabIndex:-1,ref:te,className:y,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":pe,"data-x-position":ie,style:{"--front-toast-height":`${((ce=Y[0])==null?void 0:ce.height)||0}px`,"--width":`${WPe}px`,"--gap":`${j}px`,...S,...nRe(x,g)},onBlur:se=>{T.current&&!se.currentTarget.contains(se.relatedTarget)&&(T.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||T.current||(T.current=!0,D.current=se.relatedTarget)},onMouseEnter:()=>oe(!0),onMouseMove:()=>oe(!0),onMouseLeave:()=>{he||oe(!1)},onDragEnd:()=>oe(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||N(!0)},onPointerUp:()=>N(!1)},K.filter(se=>!se.position&&Z===0||se.position===X).map((se,_e)=>{var ve,Ne;return ye.createElement(tRe,{key:se.id,icons:E,index:_e,toast:se,defaultRichColors:M,duration:(ve=L?.duration)!=null?ve:_,className:L?.className,descriptionClassName:L?.descriptionClassName,invert:c,visibleToasts:C,closeButton:(Ne=L?.closeButton)!=null?Ne:f,interacting:he,position:X,style:L?.style,unstyled:L?.unstyled,classNames:L?.classNames,cancelButtonStyle:L?.cancelButtonStyle,actionButtonStyle:L?.actionButtonStyle,closeButtonAriaLabel:L?.closeButtonAriaLabel,removeToast:U,toasts:K.filter(Re=>Re.position==se.position),heights:Y.filter(Re=>Re.position==se.position),setHeights:G,expandByDefault:h,gap:j,expanded:J,swipeDirections:t.swipeDirections})})):null}))}),oRe=Object.freeze(Object.defineProperty({__proto__:null,Toaster:sY,toast:GPe,useSonner:aRe},Symbol.toStringTag,{value:"Module"})),rRe=({...e})=>{const{theme:t="system"}=LPe();return m.jsx(sY,{theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})};var iRe=Object.defineProperty,br=(e,t)=>iRe(e,"name",{value:t,configurable:!0}),UD="Switch",[cRe,VTe]=qt(UD),[sRe,GD]=cRe(UD);function lY(e){const{__scopeSwitch:t,checked:a,children:r,defaultChecked:c,disabled:d,form:u,name:h,onCheckedChange:f,required:y,value:x="on",internal_do_not_use_render:g}=e,[b,M]=Ut({prop:a,defaultProp:c??!1,onChange:f,caller:UD}),[_,S]=k.useState(null),[C,L]=k.useState(null),A=k.useRef(!1),[j,E]=k.useReducer($=>$+1,0),z=_?!!u||!!_.closest("form"):!0,R={checked:b,setChecked:M,disabled:d,control:_,setControl:S,name:h,form:u,value:x,hasConsumerStoppedPropagationRef:A,userInteractionCount:j,onUserInteraction:E,required:y,defaultChecked:c,isFormControl:z,bubbleInput:C,setBubbleInput:L};return m.jsx(sRe,{scope:t,...R,children:dY(g)?g(R):r})}br(lY,"SwitchProvider");var lRe="SwitchTrigger",dRe=k.forwardRef(br(function({__scopeSwitch:t,onClick:a,...r},c){const{control:d,form:u,value:h,disabled:f,checked:y,required:x,setControl:g,setChecked:b,hasConsumerStoppedPropagationRef:M,onUserInteraction:_,isFormControl:S,bubbleInput:C}=GD(lRe,t),L=Ee(c,g),A=k.useRef(y);return k.useEffect(()=>{const j=u?d?.ownerDocument.getElementById(u):d?.form;if(j instanceof HTMLFormElement){const E=br(()=>b(A.current),"reset");return j.addEventListener("reset",E),()=>j.removeEventListener("reset",E)}},[d,u,b]),m.jsx(ge.button,{type:"button",role:"switch","aria-checked":y,"aria-required":x,"data-state":ZD(y),"data-disabled":f?"":void 0,disabled:f,value:h,...r,ref:L,onClick:fe(a,j=>{_(),b(E=>!E),C&&S&&(M.current=j.isPropagationStopped(),M.current||j.stopPropagation())})})},"SwitchTrigger")),uRe=k.forwardRef(br(function(t,a){const{__scopeSwitch:r,name:c,checked:d,defaultChecked:u,required:h,disabled:f,value:y,onCheckedChange:x,form:g,...b}=t;return m.jsx(lY,{__scopeSwitch:r,checked:d,defaultChecked:u,disabled:f,required:h,onCheckedChange:x,name:c,form:g,value:y,internal_do_not_use_render:({isFormControl:M})=>m.jsxs(m.Fragment,{children:[m.jsx(dRe,{...b,ref:a,__scopeSwitch:r}),M&&m.jsx(yRe,{__scopeSwitch:r})]})})},"Switch")),hRe="SwitchThumb",pRe=k.forwardRef(br(function(t,a){const{__scopeSwitch:r,...c}=t,d=GD(hRe,r);return m.jsx(ge.span,{"data-state":ZD(d.checked),"data-disabled":d.disabled?"":void 0,...c,ref:a})},"SwitchThumb")),fRe="SwitchBubbleInput",yRe=k.forwardRef(br(function({__scopeSwitch:t,onClick:a,...r},c){const{control:d,hasConsumerStoppedPropagationRef:u,userInteractionCount:h,checked:f,defaultChecked:y,required:x,disabled:g,name:b,value:M,form:_,bubbleInput:S,setBubbleInput:C}=GD(fRe,t),L=Ee(c,C),A=t2(d),j=k.useRef(!1),E=k.useRef(f),z=k.useRef(h);k.useEffect(()=>{const $=S;if(!$)return;const H=window.HTMLInputElement.prototype,ae=Object.getOwnPropertyDescriptor(H,"checked").set,Y=h!==z.current;z.current=h;const G=E.current!==f;E.current=f;const J=!(Y&&u.current);if(G&&ae){j.current=!Y;const oe=new Event("click",{bubbles:J});ae.call($,f),$.dispatchEvent(oe),j.current=!1}},[S,f,u,h]);const R=k.useRef(f);return m.jsx(ge.input,{type:"checkbox","aria-hidden":!0,defaultChecked:y??R.current,required:x,disabled:g,name:b,value:M,form:_,...r,tabIndex:-1,ref:L,onClick:fe(a,$=>{j.current&&$.stopPropagation()}),style:{...r.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function dY(e){return typeof e=="function"}br(dY,"isFunction");function ZD(e){return e?"checked":"unchecked"}br(ZD,"getState");function mRe({className:e,...t}){return m.jsx(uRe,{"data-slot":"switch",className:W("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:m.jsx(pRe,{"data-slot":"switch-thumb",className:W("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 kRe=Object.defineProperty,ud=(e,t)=>kRe(e,"name",{value:t,configurable:!0}),YD="Tabs",[gRe,BTe]=qt(YD,[dd]),uY=dd(),[vRe,XD]=gRe(YD),xRe=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,value:c,onValueChange:d,defaultValue:u,orientation:h="horizontal",dir:f,activationMode:y="automatic",...x}=t,g=Vl(f),[b,M]=Ut({prop:c,onChange:d,defaultProp:u??"",caller:YD});return m.jsx(vRe,{scope:r,baseId:kt(),value:b,onValueChange:M,orientation:h,dir:g,activationMode:y,children:m.jsx(ge.div,{dir:g,"data-orientation":h,...x,ref:a})})},"Tabs")),bRe="TabsList",MRe=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,loop:c=!0,...d}=t,u=XD(bRe,r),h=uY(r);return m.jsx(eD,{asChild:!0,...h,orientation:u.orientation,dir:u.dir,loop:c,children:m.jsx(ge.div,{role:"tablist","aria-orientation":u.orientation,...d,ref:a})})},"TabsList")),wRe="TabsTrigger",_Re=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,value:c,disabled:d=!1,...u}=t,h=XD(wRe,r),f=uY(r),y=WD(h.baseId,c),x=KD(h.baseId,c),g=c===h.value;return m.jsx(tD,{asChild:!0,...f,focusable:!d,active:g,children:m.jsx(ge.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":x,"data-state":g?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:y,...u,ref:a,onMouseDown:fe(t.onMouseDown,b=>{!d&&b.button===0&&b.ctrlKey===!1?h.onValueChange(c):b.preventDefault()}),onKeyDown:fe(t.onKeyDown,b=>{d||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&h.onValueChange(c)}),onFocus:fe(t.onFocus,()=>{const b=h.activationMode!=="manual";!g&&!d&&b&&h.onValueChange(c)})})})},"TabsTrigger")),SRe="TabsContent",CRe=k.forwardRef(ud(function(t,a){const{__scopeTabs:r,value:c,forceMount:d,children:u,...h}=t,f=XD(SRe,r),y=WD(f.baseId,c),x=KD(f.baseId,c),g=c===f.value,b=k.useRef(g);return k.useEffect(()=>{const M=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(M)},[]),m.jsx(kn,{present:d||g,children:({present:M})=>m.jsx(ge.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":y,hidden:!M,id:x,tabIndex:0,...h,ref:a,style:{...t.style,animationDuration:b.current?"0s":void 0},children:M&&u})})},"TabsContent"));function WD(e,t){return`${e}-trigger-${t}`}ud(WD,"makeTriggerId");function KD(e,t){return`${e}-content-${t}`}ud(KD,"makeContentId");var LRe=xRe,NRe=MRe,IRe=_Re,ARe=CRe;function jRe({className:e,...t}){return m.jsx(LRe,{"data-slot":"tabs",className:W("flex flex-col gap-2",e),...t})}function ERe({className:e,...t}){return m.jsx(NRe,{"data-slot":"tabs-list",className:W("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function PRe({className:e,...t}){return m.jsx(IRe,{"data-slot":"tabs-trigger",className:W("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 RRe({className:e,...t}){return m.jsx(ARe,{"data-slot":"tabs-content",className:W("flex-1 outline-none",e),...t})}function hY({className:e,wrapperHeight:t,ref:a,...r}){return m.jsx("div",{"data-slot":"table-container",ref:a,className:W("relative w-full overflow-x-auto",t),children:m.jsx("table",{"data-slot":"table",className:W("w-full caption-bottom text-sm",e),...r})})}function pY({className:e,...t}){return m.jsx("thead",{"data-slot":"table-header",className:W("[&_tr]:border-b",e),...t})}function fY({className:e,...t}){return m.jsx("tbody",{"data-slot":"table-body",className:W("[&_tr:last-child]:border-0",e),...t})}function TRe({className:e,...t}){return m.jsx("tfoot",{"data-slot":"table-footer",className:W("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function ku({className:e,...t}){return m.jsx("tr",{"data-slot":"table-row",className:W("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function B1({className:e,...t}){return m.jsx("th",{"data-slot":"table-head",className:W("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 dr({className:e,...t}){return m.jsx("td",{"data-slot":"table-cell",className:W("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function DRe({className:e,...t}){return m.jsx("caption",{"data-slot":"table-caption",className:W("text-muted-foreground mt-4 text-sm",e),...t})}function yY({className:e,...t}){return m.jsx("textarea",{"data-slot":"textarea",className:W("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 rR=new Map;function zRe(e){if(!e)return Promise.resolve();const t=new URL(e,window.location.href).href;if(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(d=>d.href===t))return Promise.resolve();const r=rR.get(t);if(r)return r;const c=new Promise((d,u)=>{const h=document.createElement("link");h.rel="stylesheet",h.href=t,h.onload=()=>d(),h.onerror=()=>{rR.delete(t),u(new Error(`Failed to load control stylesheet: ${t}`))},document.head.appendChild(h)});return rR.set(t,c),c}async function mY(e,t){const a=zRe(t).catch(c=>{console.error(c)}),r=await import(e);return await a,r}function QD(e,t,a="default"){return function(c){const[d,u]=k.useState(null);return k.useEffect(()=>{let h=!0;return mY(e(),t()).then(f=>{const y=a==="Component"?f.Component:f.default;if(!y)throw new Error(`Control module does not export "${a}"`);h&&u(()=>y)}),()=>{h=!1}},[]),d?k.createElement(d,c):null}}const $Re=e=>`${window.routePrefix}/assets/controls/${e}.es.js`,qRe=e=>`${window.routePrefix}/assets/controls/${e}.css`;function nd(e){return{modulePath:$Re(e),cssPath:qRe(e)}}const zV=QD(()=>nd("jsoneditor").modulePath,()=>nd("jsoneditor").cssPath,"Component"),ORe=QD(()=>nd("handsontable").modulePath,()=>nd("handsontable").cssPath,"Component"),HRe=QD(()=>nd("monaco").modulePath,()=>nd("monaco").cssPath,"Component");function y2(e){const a=Xu().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 iR=AA("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"}}),JD=k.forwardRef(({options:e,onValueChange:t,variant:a,processing:r,disabled:c,defaultValue:d=[],placeholder:u="",notFound:h="",search:f="",animation:y=0,maxCount:x=3,modalPopover:g=!1,asChild:b=!1,className:M,mode:_="multiple",onOpenItem:S,onAddNew:C,...L},A)=>{const{t:j}=y2(),[E,z]=k.useState(d),[R,$]=k.useState(!1),[H,K]=k.useState(!1);k.useEffect(()=>{d&&z(d)},[d]);const ae=N=>{if(N.key==="Enter")$(!0);else if(N.key==="Backspace"&&!N.currentTarget.value){const P=[...E];P.pop(),z(P),t(P)}},Y=N=>{let P;_==="single"?P=E.includes(N)?[]:[N]:P=E.includes(N)?E.filter(O=>O!==N):[...E,N],z(P),t(P),_==="single"&&$(!1)},G=()=>{z([]),t([])},J=()=>{$(N=>!N)},oe=()=>{const N=E.slice(0,x);z(N),t(N)},he=()=>C?m.jsxs("div",{role:"button",className:W("m-1 cursor-pointer",H?"animate-bounce":"",iR({variant:a})),style:{animationDuration:`${y}s`},onClick:N=>{N.stopPropagation(),C()},children:[m.jsx(Y1,{className:"mr-1 h-3.5 w-3.5"}),m.jsx("span",{children:j("Add")})]}):null;return m.jsxs(hZ,{open:R,onOpenChange:$,modal:g,children:[m.jsx(pZ,{asChild:!0,children:m.jsx(tn,{ref:A,...L,onClick:J,disabled:c,className:W("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:E.length>0?m.jsxs("div",{className:"flex justify-between items-center w-full",children:[m.jsxs("div",{className:"flex flex-wrap items-center",children:[E.slice(0,x).map(N=>{const P=e.find(te=>te.value===N),O=P?.icon;return m.jsxs("div",{className:W(H?"animate-bounce":"",iR({variant:a})),style:{animationDuration:`${y}s`},children:[O&&m.jsx(O,{className:"h-4 w-4 mr-2"}),P?.label,S&&m.jsx(wu,{className:"ml-2 h-4 w-4 cursor-pointer text-muted-foreground hover:text-foreground",onClick:te=>{te.stopPropagation(),S(N)}}),m.jsx(vo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:te=>{te.stopPropagation(),r||Y(N)}})]},N)}),_==="multiple"&&E.length>x&&m.jsxs("div",{className:W("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",H?"animate-bounce":"",iR({variant:a})),style:{animationDuration:`${y}s`},children:[`+ ${E.length-x} more`,m.jsx(vo,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:N=>{N.stopPropagation(),oe()}})]}),he()]}),m.jsxs("div",{className:"flex items-center justify-between",children:[E.length>0&&m.jsxs(m.Fragment,{children:[m.jsx(yr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:N=>{N.stopPropagation(),G()}}),m.jsx(DD,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),m.jsx(fr,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):m.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[m.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:u}),m.jsxs("div",{className:"flex items-center",children:[he(),m.jsx(fr,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})]})})}),m.jsx(fZ,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>$(!1),children:m.jsxs(FT,{children:[m.jsx(JU,{placeholder:f,onKeyDown:ae}),m.jsxs(eG,{children:[m.jsx(tG,{children:h}),m.jsx(nG,{children:e.map(N=>{const P=E.includes(N.value);return m.jsxs(oG,{onSelect:()=>Y(N.value),className:"cursor-pointer",children:[m.jsx("div",{className:W("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",P?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:m.jsx(Fa,{className:"h-4 w-4 text-primary-foreground"})}),N.icon&&m.jsx(N.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),m.jsx("span",{children:N.label})]},N.value)})}),m.jsx(aG,{})]})]})}),y>0&&E.length>0&&_==="multiple"&&m.jsx(pr,{className:W("cursor-pointer my-2 text-foreground bg-background w-3 h-3",H?"":"text-muted-foreground"),onClick:()=>K(!H)})]})});JD.displayName="MultiSelect";const kY={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},gY=e=>({...e??{},_ts:Date.now()}),VRe=e=>{if(e==="")return"";try{return JSON.parse(e)}catch{return e}},$V=e=>{if(typeof e!="string")return!1;const t=e.trim().toLowerCase();return t.startsWith("<!doctype html")||t.startsWith("<html")||t.startsWith("<")},BRe=e=>{const t={};return e.forEach((a,r)=>{t[r.toLowerCase()]=a}),t},FRe=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},URe=(e,t)=>{const a=new URL(e,window.location.origin);return Object.entries(gY(t)).forEach(([r,c])=>{if(c!=null){if(Array.isArray(c)){c.forEach(d=>a.searchParams.append(r,String(d)));return}a.searchParams.set(r,String(c))}}),`${a.pathname}${a.search}${a.hash}`},GRe=async(e,t,a,r)=>{const c=FRe("XSRF-TOKEN"),d=new Headers(kY);d.set("X-Requested-With","XMLHttpRequest"),c&&d.set("x-xsrf-token",c),Object.entries(r?.headers??{}).forEach(([g,b])=>{b!=null&&d.set(g,String(b))});let u;a instanceof FormData?u=a:a!=null&&(u=typeof a=="string"?a:JSON.stringify(a),d.has("Content-Type")||d.set("Content-Type","application/json"));const h=await fetch(URe(t,r?.params),{method:e.toUpperCase(),body:u,headers:d,credentials:"same-origin",signal:r?.signal}),f=BRe(h.headers);let y;switch(r?.responseType){case"arraybuffer":y=await h.arrayBuffer();break;case"document":{const g=await h.text(),b=new DOMParser,M=f["content-type"]?.includes("xml")?"application/xml":"text/html";y=b.parseFromString(g,M);break}default:y=await h.blob();break}const x={data:y,status:h.status,headers:f};if(!h.ok){const g=new Error(`Request failed with status ${h.status}`);throw g.response=x,g}return x},F1=async(e,t,a,r)=>{if(r?.responseType&&r.responseType!=="json"&&r.responseType!=="text")return GRe(e,t,a,r);const c=await Zu.getClient().request({method:e,url:t,data:a,params:gY(r?.params),headers:{...kY,...r?.headers??{}},signal:r?.signal});return{data:VRe(c.data),status:c.status,headers:c.headers}},uu=async(e,t,a,r)=>{try{const c=await F1(e,t,a,r),d=String(c.headers?.["content-type"]??"").toLowerCase();if(d&&!d.includes("application/json")||$V(c.data))throw new Error(`Expected JSON response from "${t}", but received "${d||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return c}catch(c){const d=c,u=String(d.response?.headers?.["content-type"]??"").toLowerCase();throw $V(d.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}},Oa={get:(e,t)=>F1("get",e,void 0,t),post:(e,t,a)=>F1("post",e,t,a),put:(e,t,a)=>F1("put",e,t,a),patch:(e,t,a)=>F1("patch",e,t,a),delete:(e,t,a)=>F1("delete",e,t,a),getJson:(e,t)=>uu("get",e,void 0,t),postJson:(e,t,a)=>uu("post",e,t,a),putJson:(e,t,a)=>uu("put",e,t,a),patchJson:(e,t,a)=>uu("patch",e,t,a),deleteJson:(e,t,a)=>uu("delete",e,t,a)},ZRe="axios-compat is a legacy compatibility API. Please use adminApi from @/lib/admin-api instead.",U1=()=>{console.log(ZRe)};U1();const hu=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},YRe={async get(e,t){U1();try{return await Oa.get(e,t)}catch(a){throw hu(a)}},async post(e,t,a){U1();try{return await Oa.post(e,t,a)}catch(r){throw hu(r)}},async put(e,t,a){U1();try{return await Oa.put(e,t,a)}catch(r){throw hu(r)}},async patch(e,t,a){U1();try{return await Oa.patch(e,t,a)}catch(r){throw hu(r)}},async delete(e,t){U1();try{return await Oa.delete(e,t?.data,t)}catch(a){throw hu(a)}},isAxiosError(e){return!!(e&&typeof e=="object"&&"isAxiosError"in e)}};function CA({iconNode:e,className:t,...a}){return m.jsx(e,{className:W("h-4 w-4",t),...a})}const vY=k.forwardRef(({btnTitle:e,link:t,delModal:a,handleDelete:r,variant:c,btnCLass:d,isLink:u=!0},h)=>{const{t:f}=y2();return m.jsxs(qA,{children:[m.jsx(YU,{asChild:!0,children:m.jsxs(tn,{ref:h,size:"list",variant:c??"ghost",className:W("cursor-pointer",d),children:[m.jsx(CA,{iconNode:Nu}),e]})}),m.jsxs(OA,{className:"sm:max-w-[425px] z-[1011]",children:[m.jsxs(HA,{children:[m.jsx(VA,{children:f("Delete")}),m.jsx("div",{className:"mt-2 text-base",children:a.text})]}),m.jsxs(KU,{children:[m.jsx(DR,{asChild:!0,children:u?m.jsx(tn,{variant:"destructive",asChild:!0,children:m.jsx(fA,{href:t??"#",children:a.yes})}):m.jsx(tn,{variant:"destructive",asChild:!0,onClick:r,children:m.jsx("span",{children:a.yes})})}),m.jsx(DR,{asChild:!0,children:m.jsx(tn,{type:"button",variant:"secondary",children:a.no})})]})]})]})});vY.displayName="DeleteModal";function pu({moduleComponent:e,cssPath:t,options:a,initialValue:r,onChange:c,name:d,disabled:u}){const[h,f]=k.useState(null);return k.useEffect(()=>{let y=!0;const x=async()=>{const g=await mY(e,t);y&&f(()=>g.default)};return f(null),x(),()=>{y=!1}},[e,t]),h?m.jsx(h,{initialValue:r,options:a,onChange:c,name:d,disabled:u}):null}const XRe=m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",children:m.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"})}),WRe="_Wrapper_18nsw_1",KRe="_active_18nsw_7",QRe="_Page_18nsw_8",JRe="_clone_18nsw_18",eTe="_Remove_18nsw_29",tTe="_insertBefore_18nsw_35",nTe="_insertAfter_18nsw_36",aTe="_vertical_18nsw_44",lr={Wrapper:WRe,active:KRe,Page:QRe,clone:JRe,Remove:eTe,insertBefore:tTe,insertAfter:nTe,vertical:aTe};var oTe=(e=>(e[e.Before=-1]="Before",e[e.After=1]="After",e))(oTe||{}),xY=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e.Grid="grid",e))(xY||{});const FTe=k.forwardRef(function({id:t,index:a,active:r,clone:c,insertPosition:d,layout:u,onRemove:h,style:f,url:y,mimeType:x,fileName:g,...b},M){const _=x?.startsWith("image/");return m.jsxs("li",{className:W(lr.Wrapper,r&&lr.active,c&&lr.clone,d===-1&&lr.insertBefore,d===1&&lr.insertAfter,u==="vertical"&&lr.vertical),style:f,ref:M,children:[m.jsxs("button",{className:`${lr.Page} after:bg-black dark:after:bg-gray-300`,"data-id":t.toString(),...b,children:[m.jsx("img",{src:y,alt:"",className:"absolute top-0 left-0 w-full h-full object-cover overflow-hidden rounded-[5px]"}),!_&&m.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:g})]}),!r&&h?m.jsx("button",{className:lr.Remove,onClick:h,children:XRe}):null]})}),bY=k.createContext(null),rTe=()=>k.useContext(bY),iTe=({entry:e,onSaved:t})=>e.loading||!e.props?m.jsx("div",{className:"flex items-center justify-center h-full w-full",children:m.jsx(va,{className:"h-6 w-6 animate-spin"})}):e.error?m.jsx("div",{className:"p-4 text-red-500",children:e.error}):m.jsx("div",{className:"h-full",children:m.jsx(wY,{page:{props:e.props},catalog:!0,callback:()=>t()})}),UTe=({children:e})=>{const t=k.useRef(null),[a,r]=k.useState([]),c=k.useRef(0),d=k.useCallback(async(g,b,M)=>{try{const _=M===null?`${window.routePrefix}/model/${b}/add?without_layout=true`:`${window.routePrefix}/model/${b}/edit/${M}?without_layout=true`,S=await Oa.get(_),C=S.data?.props??S.data;r(L=>{const A=[...L];return A[g]&&A[g].model===b&&A[g].id===M&&(A[g]={...A[g],loading:!1,props:C}),A})}catch(_){r(S=>{const C=[...S];return C[g]&&C[g].model===b&&C[g].id===M&&(C[g]={...C[g],loading:!1,error:_?.message||"Error"}),C})}},[]),u=k.useCallback((g,b)=>{r(M=>{const _=M.length,S={model:g,id:b,props:null,loading:!0};return d(_,g,b),[...M,S]})},[d]),h=k.useCallback(g=>{r(b=>{const M=b.length,_={model:g,id:null,props:null,loading:!0};return d(M,g,null),[...b,_]})},[d]);k.useEffect(()=>{const g=c.current,b=a.length;if(b>g)if(g===0)t.current?.open();else for(let M=0;M<b-g;M++)t.current?.next();c.current=b},[a.length]);const f=k.useCallback(g=>{g||(r([]),c.current=0)},[]),y=k.useCallback(()=>{r(g=>g.length<=1?(t.current?.close(),c.current=0,[]):(t.current?.prev(),c.current=g.length-1,g.slice(0,-1)))},[]),x=k.useMemo(()=>({open:u,openCreate:h}),[u,h]);return m.jsxs(bY.Provider,{value:x,children:[e,m.jsxs(ej,{ref:t,onOpenChange:f,children:[m.jsx(MD,{}),a.length>0&&m.jsx(wD,{children:a.map((g,b)=>m.jsx(_D,{children:m.jsx(iTe,{entry:g,onSaved:y})},`${g.model}-${g.id}-${b}`))})]})]})},cTe=k.lazy(()=>cn(()=>import("./media-manager-CHrLjpDc.js"),__vite__mapDeps([0,1,2]),import.meta.url)),MY=k.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:d})=>{const u=rTe(),h=k.useCallback(j=>{a(e.name,j.target.value)},[a,e.name]),f=k.useCallback(j=>{a(e.name,j[0])},[a,e.name]),y=k.useCallback(j=>{a(e.name,j)},[a,e.name]),x=k.useCallback(j=>{a(e.name,j)},[a,e.name]),g=k.useCallback(j=>{a(e.name,j)},[a,e.name]),b=k.useCallback(j=>{a(e.name,j)},[a,e.name]),M=k.useCallback(j=>{a(e.name,j.json)},[a,e.name]),_=k.useCallback(j=>{a(e.name,j)},[a,e.name]),S=k.useCallback(j=>{a(e.name,j)},[a,e.name]),C=k.useCallback(j=>{a(e.name,j)},[a,e.name]),L=k.useCallback(j=>{const E=j.map(z=>({id:z.id,url:z.url,mimeType:z.mimeType,filename:z.filename}));a(e.name,E)},[a,e.name]),A=k.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 m.jsx(vA,{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:y});case"textarea":return m.jsx(yY,{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 m.jsxs(m.Fragment,{children:[m.jsx("output",{children:t}),m.jsx(cY,{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:f,disabled:r||e.disabled})]});case"select":return m.jsxs(MZ,{onValueChange:x,value:t??"",disabled:r||e.disabled,required:e.required,children:[m.jsx(_Z,{className:"w-full cursor-pointer min-h-10 scroll-pt-30 scroll-mt-30",id:e.name,children:m.jsx(wZ,{placeholder:""})}),m.jsx(SZ,{className:"z-[9999999]",children:(Array.isArray(e.isIn)?e.isIn.map(j=>[j,j]):Object.entries(e.isIn)).map(([j,E])=>m.jsx(CZ,{value:String(j),children:String(E)},String(j)))})]});case"association":case"association-many":case"select-many":{const E=(e.type==="association"||e.type==="association-many")&&!!e.relatedModel&&!!u,z=E?$=>u.open(e.relatedModel,$):void 0,R=E&&e.canCreateRelated?()=>u.openCreate(e.relatedModel):void 0;return m.jsx(JD,{options:e.options,onValueChange:C,defaultValue:t??[],variant:"secondary",notFound:c,search:d,disabled:r||e.disabled,mode:e.type==="association"?"single":"multiple",maxCount:10,onOpenItem:z,onAddNew:R,className:`${r?"pointer-events-none":""} scroll-pt-30 scroll-mt-30`})}case"wysiwyg":case"markdown":return m.jsx(pu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??"",name:`${e.type}-${e.name}`,onChange:g,disabled:r||e.disabled});case"table":return m.jsx(pu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:b,disabled:r||e.disabled});case"jsonEditor":return m.jsx(pu,{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 m.jsx(pu,{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 m.jsx(pu,{moduleComponent:e.options?.path,cssPath:e.options?.cssPath,options:e.options?.config,initialValue:t??[],name:`${e.type}-${e.name}`,onChange:S,disabled:r||e.disabled});case"mediamanager":case"single-file":return m.jsx(cTe,{layout:xY.Grid,value:t,onChange:L,config:{...e.options},type:e.type,name:e.name});default:return m.jsx(CD,{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 YR=new Map,U0=new WeakMap,qV=0,sTe=void 0;function lTe(e){return e?(U0.has(e)||(qV+=1,U0.set(e,qV.toString())),U0.get(e)):"0"}function dTe(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?lTe(e.root):e[t]}`).toString()}function uTe(e){const t=dTe(e);let a=YR.get(t);if(!a){const r=new Map;let c;const d=new IntersectionObserver(u=>{u.forEach(h=>{var f;const y=h.isIntersecting&&c.some(x=>h.intersectionRatio>=x);e.trackVisibility&&typeof h.isVisible>"u"&&(h.isVisible=y),(f=r.get(h.target))==null||f.forEach(x=>{x(y,h)})})},e);c=d.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:d,elements:r},YR.set(t,a)}return a}function hTe(e,t,a={},r=sTe){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const f=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:f,intersectionRect:f,rootBounds:f}),()=>{}}const{id:c,observer:d,elements:u}=uTe(a),h=u.get(e)||[];return u.has(e)||u.set(e,h),h.push(t),d.observe(e),function(){h.splice(h.indexOf(t),1),h.length===0&&(u.delete(e),d.unobserve(e)),u.size===0&&(d.disconnect(),YR.delete(c))}}function pTe({threshold:e,delay:t,trackVisibility:a,rootMargin:r,root:c,triggerOnce:d,skip:u,initialInView:h,fallbackInView:f,onChange:y}={}){var x;const[g,b]=k.useState(null),M=k.useRef(y),[_,S]=k.useState({inView:!!h,entry:void 0});M.current=y,k.useEffect(()=>{if(u||!g)return;let j;return j=hTe(g,(E,z)=>{S({inView:E,entry:z}),M.current&&M.current(E,z),z.isIntersecting&&d&&j&&(j(),j=void 0)},{root:c,rootMargin:r,threshold:e,trackVisibility:a,delay:t},f),()=>{j&&j()}},[Array.isArray(e)?e.toString():e,g,c,r,d,u,a,f,t]);const C=(x=_.entry)==null?void 0:x.target,L=k.useRef(void 0);!g&&C&&!d&&!u&&L.current!==C&&(L.current=C,S({inView:!!h,entry:void 0}));const A=[b,_.inView,_.entry];return A.ref=A[0],A.inView=A[1],A.entry=A[2],A}const fTe={errors:{}},ez=new Proxy(fTe,{set(e,t,a){return t==="errors"&&(Object.keys(a).length===0?e.errors={}:e.errors={...e.errors,...a}),!0}}),OV=e=>ez.errors[e]?.message,HV=()=>Object.values(ez.errors).some(e=>e.hasError),VV=()=>{ez.errors={}};function BV({message:e,className:t="",...a}){return e?m.jsx("p",{...a,className:W("text-sm text-red-600 dark:text-red-400",t),children:e}):null}const yTe=({changes:e,title:t="Changes",className:a="",messages:r={}})=>{const{t:c}=y2({page:r}),d=(f,y)=>c(f,y);if(!e||e.length===0)return m.jsx("div",{className:W("bg-muted border border-border rounded-lg p-4",a),children:m.jsxs("div",{className:"flex items-center text-muted-foreground",children:[m.jsx(_u,{className:"w-5 h-5 mr-2"}),m.jsx("span",{children:d("Changes not found","Changes not found")})]})});const u=f=>f===null?"null":f===void 0?"—":typeof f=="boolean"?f?d("Yes","Yes"):d("No","No"):typeof f=="object"?JSON.stringify(f):String(f),h=f=>f.oldValue===void 0?"added":f.newValue===void 0?"removed":"modified";return m.jsxs("div",{className:W("bg-card border border-border rounded-lg shadow-sm",a),children:[m.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted",children:m.jsxs("h3",{className:"text-lg font-semibold text-card-foreground flex items-center",children:[m.jsx(ln,{className:"w-5 h-5 mr-2"}),t," (",e.length,")"]})}),m.jsx("div",{className:"divide-y divide-border",children:e.map((f,y)=>{const x=h(f),g=x==="added"?Y1:x==="removed"?Cu:ln,b=W("text-xs px-2 py-1 rounded-full bg-opacity-10",x==="added"&&"text-green-600 bg-green-100",x==="removed"&&"text-destructive bg-destructive/20",x==="modified"&&"text-primary bg-primary/20"),M=x==="added"?"text-green-600":x==="removed"?"text-destructive":"text-primary";return m.jsxs("div",{className:"p-4 hover:bg-muted/50 transition-colors",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("div",{className:"flex items-center",children:[ye.createElement(g,{className:W("w-4 h-4 mr-2",M)}),m.jsx("span",{className:"font-medium text-card-foreground",children:f.field})]}),m.jsx("span",{className:b,children:x==="added"?d("Added","Added"):x==="removed"?d("Removed","Removed"):d("Updated","Updated")})]}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[x!=="added"&&m.jsxs("div",{className:"p-2 bg-destructive/10 border border-destructive/20 rounded",children:[m.jsxs("div",{className:"text-xs text-destructive font-medium mb-1",children:[d("Old","Old"),":"]}),m.jsx("div",{className:"text-destructive-foreground font-mono break-words",children:u(f.oldValue)})]}),x!=="removed"&&m.jsxs("div",{className:"p-2 bg-green-50 border border-green-100 rounded",children:[m.jsxs("div",{className:"text-xs text-green-600 font-medium mb-1",children:[d("New","New"),":"]}),m.jsx("div",{className:"text-green-800 font-mono break-words",children:u(f.newValue)})]})]}),x==="modified"&&m.jsxs("div",{className:"mt-2 flex items-center text-xs text-muted-foreground",children:[m.jsx(bu,{className:"w-3 h-3 mr-1"}),d("changed type","changed type"),": ",f.type]})]},y)})})]})},mTe=({modelName:e,modelId:t,handleWatchHistory:a})=>{const[r,c]=k.useState([]),[d,u]=k.useState(!1),[h,f]=k.useState(null),[y,x]=k.useState(!0),g="currentHistoryView",{t:b}=y2(),M=b("Diff");k.useEffect(()=>{(async()=>{x(!0);try{const L=await Oa.post(`${window.routePrefix}/history/get-model-history`,{modelName:e,modelId:t});L.data.data&&c(L.data.data)}catch(L){console.log(L)}finally{x(!1)}})()},[e,t]);const _=async C=>{try{const L=await Oa.post(`${window.routePrefix}/history/get-model-fields`,{historyId:C});L.data.data&&(localStorage.setItem(g,C.toString()),a(L.data.data))}catch(L){console.log(L)}},S=C=>{const L=localStorage.getItem(g);return L?L===C.id.toString():C.isCurrent};return m.jsx("div",{className:"relative h-full",children:m.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[m.jsxs(hY,{wrapperHeight:"max-h-full",children:[m.jsx(pY,{className:"sticky top-0 bg-background shadow",children:m.jsxs(ku,{children:[m.jsx(B1,{className:"p-2 text-left",children:b("Date")}),m.jsx(B1,{className:"p-2 text-left",children:b("Event")}),m.jsx(B1,{className:"p-2 text-left",children:b("User")}),m.jsx(B1,{className:"p-2 text-left",children:M}),m.jsx(B1,{className:"p-2 text-left"})]})}),m.jsx(fY,{children:y?m.jsx(ku,{children:m.jsx(dr,{colSpan:5,className:"p-10 text-center",children:m.jsx(va,{className:"mx-auto size-8 animate-spin"})})}):r.length>0?r.map(C=>m.jsxs(ku,{children:[m.jsx(dr,{className:"p-2 self-start pt-2.5",children:new Date(C.createdAt).toLocaleString()}),m.jsx(dr,{className:"p-2 self-start pt-2.5 capitalize",children:C.action}),m.jsx(dr,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:m.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:C.user.login})}),m.jsx(dr,{className:"p-2 align-middle",children:m.jsx(tn,{variant:"green",size:"sm",onClick:()=>{f(C.diff),u(!0)},children:m.jsx(ur,{})})}),m.jsx(dr,{className:"p-2 align-middle text-center",children:S(C)?m.jsx("span",{className:"font-medium",children:b("Current")}):m.jsx(tn,{variant:"outline",size:"sm",onClick:()=>_(C.id),children:b("Watch")})})]},C.id)):m.jsx(ku,{children:m.jsx(dr,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:b("There is no history")})})})]}),m.jsx(qA,{open:d,onOpenChange:C=>{u(C),C||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:m.jsxs(OA,{className:"z-[1022] sm:max-w-[60vw]",children:[m.jsx(HA,{children:m.jsx(VA,{children:M})}),m.jsx(yTe,{changes:h,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},kTe=({dialogRef:e,modelId:t,modelName:a,callback:r})=>m.jsxs(ej,{ref:e,children:[m.jsx(MD,{}),m.jsx(wD,{children:m.jsx(_D,{children:m.jsx(mTe,{modelId:t,modelName:a,handleWatchHistory:r})})})]}),FV=k.memo(({field:e})=>!e||typeof e!="object"||!e.label?(console.error("Invalid field for LabelRenderer:",e),null):m.jsxs("div",{className:"flex gap-3",children:[m.jsx(_A,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&m.jsx(ij,{children:m.jsxs(qD,{children:[m.jsx(OD,{onClick:t=>t.preventDefault(),children:m.jsx(CA,{iconNode:Su,className:"text-primary w-5 h-5 cursor-pointer"})}),m.jsx(HD,{align:"center",side:"top",className:"z-1002",children:m.jsx("p",{children:e.tooltip})})]})})]})),gTe=k.memo(({field:e,value:t,onChange:a,processing:r,notFound:c,search:d,invalidFieldMessage:u})=>{if(!e||typeof e!="object"||!e.name||!e.type)return console.error("Invalid field for LazyField:",e),m.jsx("div",{className:"text-red-500",children:u||"Error: Invalid field data"});const[h,f]=pTe({triggerOnce:!0,rootMargin:"100px 0px"});return m.jsx("div",{ref:h,className:"grid gap-4 w-full",children:f?m.jsx(MY,{field:e,value:t,onChange:a,notFound:c,search:d,processing:r}):m.jsx(SA,{className:"w-full h-[250px] rounded-sm"})})}),wY=({page:e,catalog:t,callback:a,openNewWindow:r,openNewWindowLabel:c,isNavigation:d,DnavVisible:u,visibleLable:h})=>{const{btnBack:f,btnHistory:y,view:x,edit:g,history:b,notFound:M,model:_,fields:S}=e.props,{t:C}=y2(),{data:L,setData:A,post:j,processing:E,transform:z}=pT({...Object.fromEntries((S||[]).map(N=>[N.name,N.value??void 0])),jsonPopupCatalog:t}),[R,$]=k.useState(!1),[H,K]=k.useState(r??!1),[ae,Y]=k.useState(u??!1),G=k.useRef(null);k.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),k.useEffect(()=>(K(r??!1),VV(),A({...Object.fromEntries((S||[]).map(N=>[N.name,(N.type==="mediamanager"||N.type==="single-file")&&(N.value===null||N.value===void 0)?[]:N.value])),jsonPopupCatalog:t}),()=>VV()),[S,t,r,A]);const J=k.useCallback((N,P)=>{A(N,P)},[A]);if(!Array.isArray(S))return console.error("Fields is not an array:",S),m.jsx("div",{className:"p-4 text-red-500",children:C("Error: Fields data is invalid")});if(S.length===0)return console.warn("Fields array is empty"),m.jsx("div",{className:"p-4 text-gray-500",children:C("No fields to display")});const oe=S.filter(N=>!N||typeof N!="object"||!N.name||!N.type||!N.label);if(oe.length>0)return console.error("Invalid fields found:",oe),m.jsx("div",{className:"p-4 text-red-500",children:C("Error: Some fields are missing required properties (name, type, label)")});const he=async N=>{if(N.preventDefault(),t){$(!0);const P=await Oa.post(e.props.postLink,L);P.status===200&&a&&(d?a(P.data.record,H,ae):a(P.data.record))}else{const P=localStorage.getItem("backUrl");z(O=>({...O,redirectUrl:P??""})),j(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return m.jsxs("div",{className:"w-full min-w-0",children:[m.jsx("div",{className:"w-full sticky z-[1001] top-0 bg-background shadow-md lg:hidden",children:m.jsxs("div",{className:"p-4 flex gap-4",children:[!t&&m.jsx(tn,{className:"w-fit",asChild:!0,children:m.jsxs(fA,{href:f.link,preserveScroll:!0,children:[m.jsx(CA,{iconNode:Z1}),f.title]})}),m.jsxs(tn,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:R||E||e.props.view||HV(),children:[R||E&&m.jsx(va,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]}),b&&(g||x)&&m.jsx("div",{className:"flex gap-2 justify-start",children:m.jsx(tn,{variant:"outline",className:"w-fit",onClick:N=>{N.preventDefault(),G.current?.open()},children:y.title})})]})}),m.jsxs("div",{className:"p-4 w-full mt-6",children:[m.jsx("form",{id:"addUserForm",onSubmit:he,className:x?"cursor-not-allowed":"",children:m.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[m.jsx("div",{className:"flex flex-col gap-10",children:S.map(N=>m.jsx("div",{className:`grid gap-4 w-full ${x?"pointer-events-none":""}`,children:N.type==="markdown"||N.type==="table"||N.type==="jsonEditor"||N.type==="codeEditor"||N.type==="geoJson"?m.jsxs(m.Fragment,{children:[m.jsx(FV,{field:N}),m.jsx(BV,{message:OV(`${N.type}-${N.name}`)}),m.jsx(gTe,{field:N,value:L[N.name],onChange:J,processing:R||E||x,notFound:M,search:e.props.search,invalidFieldMessage:C("Error: Invalid field data")})]}):m.jsxs(m.Fragment,{children:[m.jsx(FV,{field:N}),m.jsx(BV,{message:OV(`${N.type}-${N.name}`)}),m.jsx(MY,{field:N,value:L[N.name],onChange:J,processing:R||E||x,notFound:M,search:e.props.search})]})},N.name))}),m.jsxs("div",{className:"p-4 rounded-md h-fit sticky top-[54px] hidden lg:grid gap-4 shadow",children:[m.jsxs("div",{className:"flex gap-4",children:[!t&&m.jsx(tn,{className:"w-fit",asChild:!0,children:m.jsxs(fA,{href:f.link,preserveScroll:!0,children:[m.jsx(CA,{iconNode:Z1}),f.title]})}),m.jsxs(tn,{variant:"green",type:"submit",className:"w-fit",disabled:R||E||e.props.view||HV(),children:[(R||E)&&m.jsx(va,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),d&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(vA,{id:"targetBlank",checked:H,onCheckedChange:N=>K(!!N),className:"cursor-pointer size-5"}),m.jsx(_A,{htmlFor:"targetBlank",children:c})]}),m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(vA,{id:"visible",checked:ae,onCheckedChange:N=>Y(!!N),className:"cursor-pointer size-5"}),m.jsx(_A,{htmlFor:"visible",children:h})]})]}),b&&(g||x)&&m.jsx("div",{className:"flex gap-2 justify-start",children:m.jsx(tn,{variant:"outline",className:"w-fit",onClick:N=>{N.preventDefault(),G.current?.open()},children:y.title})})]})]})}),b&&(g||x)&&m.jsx(kTe,{dialogRef:G,modelName:_,modelId:S.find(N=>N.name==="id")?.value,callback:N=>{for(const P of Object.keys(N))A(P,N[P]);G.current?.close()}})]})]})};function vTe(){window.UIComponents??={},window.JSComponents??={},window.sonner=oRe,window.axios=YRe,window.cn=W,Object.assign(window.UIComponents,{Avatar:Xee,AvatarImage:Wee,AvatarFallback:Kee,Badge:Jee,Breadcrumb:tMe,BreadcrumbList:nMe,BreadcrumbItem:aMe,BreadcrumbLink:oMe,BreadcrumbPage:rMe,BreadcrumbSeparator:iMe,BreadcrumbEllipsis:cMe,Button:tn,Calendar:Y9e,Card:X9e,CardHeader:W9e,CardFooter:twe,CardTitle:K9e,CardAction:J9e,CardDescription:Q9e,CardContent:ewe,Checkbox:vA,Collapsible:Twe,CollapsibleTrigger:Dwe,CollapsibleContent:zwe,Command:FT,CommandDialog:pSe,CommandInput:JU,CommandList:eG,CommandEmpty:tG,CommandGroup:nG,CommandItem:oG,CommandShortcut:fSe,CommandSeparator:aG,ContextMenu:pNe,ContextMenuTrigger:fNe,ContextMenuContent:bNe,ContextMenuItem:MNe,ContextMenuCheckboxItem:wNe,ContextMenuRadioItem:_Ne,ContextMenuLabel:SNe,ContextMenuSeparator:CNe,ContextMenuShortcut:LNe,ContextMenuGroup:yNe,ContextMenuPortal:mNe,ContextMenuSub:kNe,ContextMenuSubContent:xNe,ContextMenuSubTrigger:vNe,ContextMenuRadioGroup:gNe,Dialog:qA,DialogClose:DR,DialogContent:OA,DialogDescription:QU,DialogFooter:KU,DialogHeader:HA,DialogOverlay:WU,DialogPortal:XU,DialogTitle:VA,DialogTrigger:YU,DialogStack:ej,DialogStackTrigger:NNe,DialogStackOverlay:MD,DialogStackBody:wD,DialogStackContent:_D,DialogStackTitle:INe,DialogStackDescription:ANe,DialogStackHeader:jNe,DialogStackFooter:ENe,DialogStackNext:PNe,DialogStackPrevious:RNe,DropdownMenu:fIe,DropdownMenuPortal:yIe,DropdownMenuTrigger:mIe,DropdownMenuContent:kIe,DropdownMenuGroup:gIe,DropdownMenuLabel:wIe,DropdownMenuItem:vIe,DropdownMenuCheckboxItem:xIe,DropdownMenuRadioGroup:bIe,DropdownMenuRadioItem:MIe,DropdownMenuSeparator:_Ie,DropdownMenuShortcut:SIe,DropdownMenuSub:CIe,DropdownMenuSubTrigger:LIe,DropdownMenuSubContent:NIe,Input:CD,Label:_A,Menubar:mAe,MenubarPortal:sZ,MenubarMenu:kAe,MenubarTrigger:xAe,MenubarContent:bAe,MenubarGroup:gAe,MenubarSeparator:CAe,MenubarLabel:SAe,MenubarItem:MAe,MenubarShortcut:LAe,MenubarCheckboxItem:wAe,MenubarRadioGroup:vAe,MenubarRadioItem:_Ae,MenubarSub:NAe,MenubarSubTrigger:IAe,MenubarSubContent:AAe,Pagination:jAe,PaginationContent:EAe,PaginationLink:ND,PaginationItem:PAe,PaginationPrevious:RAe,PaginationNext:TAe,PaginationEllipsis:DAe,Popover:hZ,PopoverTrigger:pZ,PopoverContent:fZ,PopoverAnchor:nje,Select:MZ,SelectContent:SZ,SelectGroup:Kje,SelectItem:CZ,SelectLabel:Qje,SelectScrollDownButton:NZ,SelectScrollUpButton:LZ,SelectSeparator:Jje,SelectTrigger:_Z,SelectValue:wZ,Separator:DD,Sheet:jZ,SheetTrigger:oEe,SheetClose:rEe,SheetContent:EZ,SheetHeader:PZ,SheetFooter:sEe,SheetTitle:RZ,SheetDescription:TZ,Sidebar:$Ee,SidebarContent:GEe,SidebarFooter:FEe,SidebarGroup:ZEe,SidebarGroupAction:XEe,SidebarGroupContent:WEe,SidebarGroupLabel:YEe,SidebarHeader:BEe,SidebarInput:VEe,SidebarInset:HEe,SidebarMenu:KEe,SidebarMenuAction:tPe,SidebarMenuBadge:nPe,SidebarMenuButton:ePe,SidebarMenuItem:QEe,SidebarMenuSkeleton:aPe,SidebarMenuSub:oPe,SidebarMenuSubButton:iPe,SidebarMenuSubItem:rPe,SidebarProvider:zEe,SidebarRail:OEe,SidebarSeparator:UEe,SidebarTrigger:qEe,useSidebar:h2,Skeleton:SA,Slider:cY,Toaster:rRe,Switch:mRe,Tabs:jRe,TabsList:ERe,TabsTrigger:PRe,TabsContent:RRe,Table:hY,TableHeader:pY,TableBody:fY,TableFooter:TRe,TableHead:B1,TableRow:ku,TableCell:dr,TableCaption:DRe,Textarea:yY,Tooltip:qD,TooltipTrigger:OD,TooltipContent:HD,TooltipProvider:ij,VanillaJSONEditor:zV}),Object.assign(window.JSComponents,{VanillaJSONEditor:zV,HandsonTable:ORe,MonacoEditor:HRe,MultiSelect:JD,DeleteModal:vY,AddForm:wY,adminApi:Oa})}const{createInertiaApp:xTe,router:_Y}=iF;window.React=ye;window.ReactDOM=pA;window.InertiajsReact=iF;window.LucideReact=eMe;vTe();let tz=!1;_Y.on("navigate",e=>{tz=!0});_Y.on("finish",e=>{tz=!1});const UV=document.createElement.bind(document);document.createElement=function(e,t){const a=UV(e,t);return e.toLowerCase()==="iframe"&&tz?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),UV("div")):a};xTe({title:e=>`${e}`,resolve:async e=>(await Object.assign({"./pages/add-group.tsx":()=>cn(()=>import("./add-group-Ck1ckPjg.js"),__vite__mapDeps([3,4,5]),import.meta.url),"./pages/add-user.tsx":()=>cn(()=>import("./add-user-DrAae33F.js"),__vite__mapDeps([6,4,5]),import.meta.url),"./pages/add.tsx":()=>cn(()=>import("./add-C97ZlnYa.js"),__vite__mapDeps([7,4,5]),import.meta.url),"./pages/catalog.tsx":()=>cn(()=>import("./catalog-CBGXyd1t.js"),__vite__mapDeps([8,4,5,1,9]),import.meta.url),"./pages/dashboard.tsx":()=>cn(()=>import("./dashboard-UMjkspUS.js"),__vite__mapDeps([10,4,5,11]),import.meta.url),"./pages/history.tsx":()=>cn(()=>import("./history-XWYf-Ejp.js"),__vite__mapDeps([12,13,4,5]),import.meta.url),"./pages/init-user.tsx":()=>cn(()=>import("./init-user-QihBlzjm.js"),__vite__mapDeps([14,5]),import.meta.url),"./pages/list.tsx":()=>cn(()=>import("./list-Cge_ZbFX.js"),__vite__mapDeps([15,4,5,13]),import.meta.url),"./pages/login.tsx":()=>cn(()=>import("./login-TJqrgvWB.js"),__vite__mapDeps([16,5]),import.meta.url),"./pages/module.tsx":()=>cn(()=>import("./module-DxrI93ll.js"),__vite__mapDeps([17,4,5]),import.meta.url),"./pages/notification.tsx":()=>cn(()=>import("./notification-BGZpCz0c.js"),__vite__mapDeps([18,4,5,1]),import.meta.url),"./pages/register.tsx":()=>cn(()=>import("./register-C9ZkVhe0.js"),__vite__mapDeps([19,5]),import.meta.url),"./pages/user-filters-list.tsx":()=>cn(()=>import("./user-filters-list-C4G5mYJZ.js"),__vite__mapDeps([20,4,5]),import.meta.url),"./pages/welcome.tsx":()=>cn(()=>import("./welcome-Az9UFvA4.js"),__vite__mapDeps([21,4,5]),import.meta.url)})[`./pages/${e}.tsx`]()).default,setup({el:e,App:t,props:a}){yR.createRoot(e).render(m.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{kIe as $,wY as A,tn as B,vA as C,Y1 as D,_u as E,ej as F,MD as G,wD as H,CA as I,_D as J,H8 as K,fA as L,Z1 as M,y2 as N,Ue as O,hZ as P,SA as Q,Ow as R,MZ as S,ij as T,Jee as U,u9 as V,vY as W,sf as X,$Ne as Y,mIe as Z,si as _,pT as a,nG as a$,gIe as a0,pNe as a1,fNe as a2,bNe as a3,MNe as a4,hT as a5,XB as a6,wTe as a7,X9e as a8,W9e as a9,fIe as aA,cc as aB,wIe as aC,_Ie as aD,xIe as aE,jAe as aF,EAe as aG,PAe as aH,ND as aI,RAe as aJ,TAe as aK,jTe as aL,Pp as aM,mp as aN,Lp as aO,wc as aP,Xx as aQ,YN as aR,v6 as aS,H9 as aT,J_ as aU,W as aV,yr as aW,FT as aX,JU as aY,eG as aZ,tG as a_,K9e as aa,twe as ab,mRe as ac,NNe as ad,INe as ae,TP as af,su as ag,lu as ah,RMe as ai,Nm as aj,Ol as ak,Y9e as al,hY as am,pY as an,ku as ao,B1 as ap,fY as aq,dr as ar,ur as as,qA as at,OA as au,HA as av,VA as aw,yTe as ax,qF as ay,Lu as az,va as b,h2 as b$,oG as b0,jNe as b1,ANe as b2,x_ as b3,Nu as b4,Mu as b5,fr as b6,G1 as b7,ENe as b8,yY as b9,Ti as bA,J7 as bB,$Ee as bC,BEe as bD,mAe as bE,kAe as bF,xAe as bG,k4 as bH,bAe as bI,NAe as bJ,IAe as bK,AAe as bL,MAe as bM,Iwe as bN,Ewe as bO,GEe as bP,FEe as bQ,tMe as bR,nMe as bS,aMe as bT,rMe as bU,oMe as bV,iMe as bW,Xee as bX,Wee as bY,Kee as bZ,Kx as b_,Ks as ba,zw as bb,ev as bc,vIe as bd,Ga as be,ZN as bf,MTe as bg,jRe as bh,ERe as bi,PRe as bj,RRe as bk,zEe as bl,ZEe as bm,YEe as bn,WEe as bo,KEe as bp,Twe as bq,QEe as br,Dwe as bs,ePe as bt,zwe as bu,oPe as bv,rPe as bw,iPe as bx,oM as by,$l as bz,_A as c,lEe as c0,DC as c1,zM as c2,$C as c3,$f as c4,ls as c5,vF as c6,qEe as c7,s8 as c8,IJ as c9,HEe as ca,UTe as cb,hl as cc,KU as cd,DR as ce,xp as cf,bu as cg,YU as ch,Cc as ci,FTe as cj,oTe as ck,lr as cl,CD as d,qD as e,OD as f,Su as g,HD as h,pZ as i,m as j,fZ as k,Oa as l,_Z as m,wZ as n,SZ as o,CZ as p,BV as q,k as r,Qk as s,GPe as t,Xu as u,rRe as v,GV as w,ye as x,Ua as y,Sv as z};