@buildbase/sdk 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=r(t),a=r(n);exports.ApiVersion=void 0,(exports.ApiVersion||(exports.ApiVersion={})).V1="v1";const i=e=>({type:"SET_SESSION",payload:e});function s({name:n,initialState:r,reducer:o,initializer:a}){const i=t.createContext(null),s=t.createContext(null),c=t.createContext(null),l=t.memo(({children:n})=>{const[l,d]=t.useReducer(o,r,a||(e=>e)),u=t.useMemo(()=>({state:l,dispatch:d}),[l,d]);return e.jsx(c.Provider,{value:u,children:e.jsx(i.Provider,{value:l,children:e.jsx(s.Provider,{value:d,children:n})})})});l.displayName=n+"Provider";const d=()=>{const e=t.useContext(i);if(null===e)throw Error(`use${n}State must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw Error(`use${n}Context must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:d,useDispatch:()=>{const e=t.useContext(s);if(null===e)throw Error(`use${n}Dispatch must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,n)=>{const r=d(),o=e||(e=>e),a=t.useRef(o),i=t.useRef(n),s=t.useRef(void 0),c=t.useRef(r);return e&&(a.current=o),n&&(i.current=n),t.useMemo(()=>{const e=a.current(r);return void 0!==s.current&&(i.current?i.current(s.current,e):Object.is(s.current,e))&&c.current===r?s.current:(s.current=e,c.current=r,e)},[r])}}}var c;function l(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(e){return null}}function d(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(e){}}function u(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(e){}}!function(e){e.loading="loading",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(c||(c={}));const f="code",m="saas-session-id";function p(){u(m)}function h(){if("undefined"==typeof window)return null;try{return l(m)}catch(e){return null}}function b(){const e=h(),t={};return e&&(t["x-session-id"]=e),t}function g(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}const v=()=>({session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:c.unauthenticated}),{Provider:w,useState:y,useDispatch:x}=s({name:"Auth",initialState:v(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:c.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:c.unauthenticated};case"SET_SESSION":{const r=t.payload;return n=r.sessionId,d(m,n),{...e,session:r,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:c.authenticated}}case"REMOVE_SESSION":return p(),{...e,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:c.unauthenticated};default:return e}var n},initializer:v}),A=w,S=y,k=x,T=e=>({type:"SET_SETTINGS",payload:e}),C=()=>({serverUrl:"",version:exports.ApiVersion.V1,orgId:"",settings:null}),{Provider:N,useState:E,useDispatch:P}=s({name:"OS",initialState:C(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return C();case"SET_SETTINGS":return{...e,settings:t.payload};default:return e}}}),M=N,O=E,R=P,_=e=>({type:"SET_WORKSPACES",payload:e}),D=e=>({type:"SET_LOADING",payload:e}),I=e=>({type:"SET_ERROR",payload:e}),U=e=>({type:"SET_REFRESHING",payload:e}),F="saas-workspace-current",{Provider:j,useState:L,useDispatch:B}=s({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switching:!1,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return{...e,workspaces:t.payload};case"SET_ALL_FEATURES":return{...e,allFeatures:t.payload};case"SET_CURRENT_WORKSPACE":return(n=t.payload.t)?d(F,n):u(F),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return u(F),{...e,currentWorkspace:null};case"SET_IS_INITIALIZED":return{...e,isInitialized:t.payload};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_REFRESHING":return{...e,refreshing:t.payload};case"SET_SWITCHING":return{...e,switching:t.payload};default:return e}var n}}),$=j,z=L,G=B,Z=t.memo(({children:t})=>e.jsx(M,{children:e.jsx(A,{children:e.jsx($,{children:t})})}));function W(e,n){const r=O(),o=S(),a=z(),i=t.useMemo(()=>({os:r,auth:o,workspaces:a}),[r,o,a]),s=e||(e=>e),c=t.useRef(s),l=t.useRef(n),d=t.useRef(void 0),u=t.useRef(i);return e&&(c.current=s),t.useMemo(()=>{const e=c.current(i);return void 0!==d.current&&(l.current?l.current(d.current,e):Object.is(d.current,e))&&u.current===i?d.current:(d.current=e,u.current=i,e)},[i])}function K(){const e=k(),n=R(),r=G();return t.useMemo(()=>({auth:e,os:n,workspaces:r}),[e,n,r])}Z.displayName="SDKContextProvider";const V=t.memo(({children:n,callbacks:r})=>{const o=K(),a=W(e=>e.auth),s=W(e=>e.os),c=t.useRef(!1),l=t.useRef(null),d=t.useMemo(()=>r,[r]),u=t.useCallback(async e=>{try{if(d?.handleAuthentication){const{sessionId:t}=await d.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw Error("Invalid sessionId received from authentication callback");const n=s,{serverUrl:r,version:a,orgId:c}=n;if(!r||!a||!c)throw Error("OS configuration is not available");const l=await fetch(`${r}/api/${a}/public/profile`,{headers:{"x-session-id":t,"Content-Type":"application/json"}});if(!l.ok)throw Error("Failed to fetch user profile");let u;try{u=await l.json()}catch(e){throw Error("Failed to parse user profile response")}const m=g({id:u.t||u.id,name:u.name||"",org:c,email:u.email||"",emailVerified:!0,clientId:n.auth?.clientId||"",role:u.role||"",image:u.image},t);o.auth(i(m)),function(){try{const e=new URL(window.location.href);e.searchParams.delete(f),window.history.replaceState({},"",e.toString())}catch(e){}}()}}catch(e){throw o.auth({type:"AUTHENTICATION_FAILED"}),e}},[o,d,s]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(a.isAuthenticated)return;const e=h();e&&(async()=>{try{const{serverUrl:t,version:n,orgId:r}=s;if(!t||!n||!r)return;const a=await fetch(`${t}/api/${n}/public/profile`,{headers:{"x-session-id":e,"Content-Type":"application/json"}});if(!a.ok)return void p();let c;try{c=await a.json()}catch(e){return void p()}const l=g({id:c.t||c.id,name:c.name||"",org:r,email:c.email||"",emailVerified:!0,clientId:s.auth?.clientId||"",role:c.role||"",image:c.image},e);o.auth(i(l))}catch(e){p()}})()},[a.isAuthenticated,o,s]),t.useEffect(()=>{const e=function(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(f)}catch(e){return null}}();if(!e)return;if(c.current||l.current===e)return;const{serverUrl:t,version:n,orgId:r}=s;t&&n&&r&&(c.current=!0,l.current=e,u(e).then(()=>{l.current=null}).catch(e=>{l.current=null}).finally(()=>{c.current=!1}))},[u,s.serverUrl,s.version,s.orgId]),e.jsx(e.Fragment,{children:n})});V.displayName="AuthProviderWrapper";const H=t.memo(({config:n,auth:r,children:o})=>{const a=K(),i=W(e=>e.os),s=t.useMemo(()=>({clientId:r?.clientId||"",redirectUrl:r?.redirectUrl||"",callbacks:r?.callbacks}),[r?.clientId,r?.redirectUrl,r?.callbacks]);t.useEffect(()=>{a.os((e=>({type:"SET_SAAS_OS_CONFIG",payload:e}))({...n,auth:s}))},[n,s,a]),t.useEffect(()=>{const{serverUrl:e,version:t,orgId:n,settings:r}=i;e&&t&&n&&!r&&(async()=>{try{const r=b(),o=await fetch(`${e}/api/${t}/public/${n}/settings`,{headers:r});if(o.ok){const e=await o.json();a.os(T(e))}}catch(e){}})()},[i.serverUrl,i.version,i.orgId,i.settings,a]);const c=t.useMemo(()=>o,[o]);return e.jsx(e.Fragment,{children:c})});H.displayName="ContextConfigProvider";const J=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(e){}}async emitUserCreated(e){await this.emit("user:created",{user:e})}async emitUserUpdated(e,t){await this.emit("user:updated",{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit("workspace:changed",{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit("workspace:updated",{workspace:e})}async emitWorkspaceUserAdded(e,t,n){await this.emit("workspace:user-added",{userId:e,workspace:t,role:n})}async emitWorkspaceUserRemoved(e,t,n){await this.emit("workspace:user-removed",{userId:e,workspace:t,role:n})}async emitWorkspaceUserRoleChanged(e,t,n,r){await this.emit("workspace:user-role-changed",{userId:e,workspace:t,previousRole:n,newRole:r})}async emitWorkspaceCreated(e){await this.emit("workspace:created",{workspace:e})}async emitWorkspaceDeleted(e){await this.emit("workspace:deleted",{workspace:e})}},q=t.createContext({container:null,setContainer:()=>{}}),Y=t.memo(({children:n})=>{const[r,o]=t.useState(null),a=t.useMemo(()=>({container:r,setContainer:o}),[r]),i=t.useMemo(()=>n,[n]);return e.jsxs(q.Provider,{value:a,children:[i,e.jsx("div",{ref:o,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});Y.displayName="PortalProvider";const X=t.memo(({serverUrl:n,version:r,orgId:o,auth:a,children:i})=>{((e,t,n)=>{if(t!==exports.ApiVersion.V1)throw Error(`Invalid version: "${t}". Only "${exports.ApiVersion.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!n||"string"!=typeof n)throw Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(n))throw Error(`Invalid orgId: "${n}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)})(n,r,o);const s=t.useMemo(()=>({serverUrl:n,version:r,orgId:o}),[n,r,o]),c=t.useMemo(()=>a?.callbacks,[a?.callbacks]),l=t.useMemo(()=>a?.callbacks?.handleEvent,[a?.callbacks]);return t.useEffect(()=>(J.setCallbacks(l?{handleEvent:l}:null),()=>{J.setCallbacks(null)}),[l]),e.jsx(Z,{children:e.jsx(V,{callbacks:c,children:e.jsx(Y,{children:e.jsx(H,{config:s,auth:a,children:i})})})})});X.displayName="SaaSOSProvider";var Q=e=>"checkbox"===e.type,ee=e=>e instanceof Date,te=e=>null==e;const ne=e=>"object"==typeof e;var re=e=>!te(e)&&!Array.isArray(e)&&ne(e)&&!ee(e),oe=e=>re(e)&&e.target?Q(e.target)?e.target.checked:e.target.value:e,ae=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),ie="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function se(e){let t;const n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(ie&&(e instanceof Blob||r)||!n&&!re(e))return e;if(t=n?[]:Object.create(Object.getPrototypeOf(e)),n||(e=>{const t=e.constructor&&e.constructor.prototype;return re(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=se(e[n]));else t=e}return t}var ce=e=>/^\w*$/.test(e),le=e=>void 0===e,de=e=>Array.isArray(e)?e.filter(Boolean):[],ue=e=>de(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{if(!t||!re(e))return n;const r=(ce(t)?[t]:ue(t)).reduce((e,t)=>te(e)?e:e[t],e);return le(r)||r===e?le(e[t])?n:e[t]:r},me=e=>"boolean"==typeof e,pe=(e,t,n)=>{let r=-1;const o=ce(t)?[t]:ue(t),a=o.length,i=a-1;for(;++r<a;){const t=o[r];let a=n;if(r!==i){const n=e[t];a=re(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const he="blur",be="onChange",ge="onSubmit",ve="all",we="pattern",ye="required",xe=t.createContext(null);xe.displayName="HookFormContext";const Ae=()=>t.useContext(xe),Se=e=>{const{children:n,...r}=e;return t.createElement(xe.Provider,{value:r},n)};var ke=(e,t,n,r=!0)=>{const o={defaultValues:t.o};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t.i[o]!==ve&&(t.i[o]=!r||ve),n&&(n[o]=!0),e[o]}});return o};const Te="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var Ce=e=>"string"==typeof e,Ne=(e,t,n,r,o)=>Ce(e)?(r&&t.watch.add(e),fe(n,e,o)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),fe(n,e))):(r&&(t.watchAll=!0),n),Ee=e=>te(e)||!ne(e);function Pe(e,t,n=new WeakSet){if(Ee(e)||Ee(t))return e===t;if(ee(e)&&ee(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const a of r){const r=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(ee(r)&&ee(e)||re(r)&&re(e)||Array.isArray(r)&&Array.isArray(e)?!Pe(r,e,n):r!==e)return!1}}return!0}const Me=e=>e.render(function(e){const n=Ae(),{name:r,disabled:o,control:a=n.control,shouldUnregister:i,defaultValue:s}=e,c=ae(a.l.array,r),l=t.useMemo(()=>fe(a.u,r,fe(a.o,r,s)),[a,r,s]),d=function(e){const n=Ae(),{control:r=n.control,name:o,defaultValue:a,disabled:i,exact:s,compute:c}=e||{},l=t.useRef(a),d=t.useRef(c),u=t.useRef(void 0);d.current=c;const f=t.useMemo(()=>r.v(o,l.current),[r,o]),[m,p]=t.useState(d.current?d.current(f):f);return Te(()=>r.A({name:o,formState:{values:!0},exact:s,callback:e=>{if(!i){const t=Ne(o,r.l,e.values||r.u,!1,l.current);if(d.current){const e=d.current(t);Pe(e,u.current)||(p(e),u.current=e)}else p(t)}}}),[r,i,o,s]),t.useEffect(()=>r.S()),m}({control:a,name:r,defaultValue:l,exact:!0}),u=function(e){const n=Ae(),{control:r=n.control,disabled:o,name:a,exact:i}=e||{},[s,c]=t.useState(r.k),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Te(()=>r.A({name:a,formState:l.current,exact:i,callback:e=>{!o&&c({...r.k,...e})}}),[a,o,i]),t.useEffect(()=>{l.current.isValid&&r.T(!0)},[r]),t.useMemo(()=>ke(s,r,l.current,!1),[s,r])}({control:a,name:r,exact:!0}),f=t.useRef(e),m=t.useRef(a.register(r,{...e.rules,value:d,...me(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const p=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!fe(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!fe(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!fe(u.validatingFields,r)},error:{enumerable:!0,get:()=>fe(u.errors,r)}}),[u,r]),h=t.useCallback(e=>m.current.onChange({target:{value:oe(e),name:r},type:"change"}),[r]),b=t.useCallback(()=>m.current.onBlur({target:{value:fe(a.u,r),name:r},type:he}),[r,a.u]),g=t.useCallback(e=>{const t=fe(a.C,r);t&&e&&(t.N.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[a.C,r]),v=t.useMemo(()=>({name:r,value:d,...me(o)||u.disabled?{disabled:u.disabled||o}:{},onChange:h,onBlur:b,ref:g}),[r,o,u.disabled,h,b,g,d]);return t.useEffect(()=>{const e=a.P.shouldUnregister||i;a.register(r,{...f.current.rules,...me(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const n=fe(a.C,e);n&&n.N&&(n.N.mount=t)};if(t(r,!0),e){const e=se(fe(a.P.defaultValues,r));pe(a.o,r,e),le(fe(a.u,r))&&pe(a.u,r,e)}return!c&&a.register(r),()=>{(c?e&&!a.M.action:e)?a.unregister(r):t(r,!1)}},[r,a,c,i]),t.useEffect(()=>{a.O({disabled:o,name:r})},[o,r,a]),t.useMemo(()=>({field:v,formState:u,fieldState:p}),[v,u,p])}(e));var Oe=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Re=e=>Array.isArray(e)?e:[e],_e=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},De=e=>re(e)&&!Object.keys(e).length,Ie=e=>"file"===e.type,Ue=e=>"function"==typeof e,Fe=e=>{if(!ie)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},je=e=>"select-multiple"===e.type,Le=e=>"radio"===e.type,Be=e=>Fe(e)&&e.isConnected;function $e(e,t){const n=Array.isArray(t)?t:ce(t)?[t]:ue(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;n>r;)e=le(e)?r++:e[t[r++]];return e}(e,n),o=n.length-1,a=n[o];return r&&delete r[a],0!==o&&(re(r)&&De(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!le(e[t]))return!1;return!0}(r))&&$e(e,n.slice(0,-1)),e}var ze=e=>{for(const t in e)if(Ue(e[t]))return!0;return!1};function Ge(e,t={}){const n=Array.isArray(e);if(re(e)||n)for(const n in e)Array.isArray(e[n])||re(e[n])&&!ze(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Ge(e[n],t[n])):te(e[n])||(t[n]=!0);return t}function Ze(e,t,n){const r=Array.isArray(e);if(re(e)||r)for(const r in e)Array.isArray(e[r])||re(e[r])&&!ze(e[r])?le(t)||Ee(n[r])?n[r]=Array.isArray(e[r])?Ge(e[r],[]):{...Ge(e[r])}:Ze(e[r],te(t)?{}:t[r],n[r]):n[r]=!Pe(e[r],t[r]);return n}var We=(e,t)=>Ze(e,t,Ge(t));const Ke={value:!1,isValid:!1},Ve={value:!0,isValid:!0};var He=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!le(e[0].attributes.value)?le(e[0].value)||""===e[0].value?Ve:{value:e[0].value,isValid:!0}:Ve:Ke}return Ke},Je=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>le(e)?e:t?""===e?NaN:e?+e:e:n&&Ce(e)?new Date(e):r?r(e):e;const qe={isValid:!1,value:null};var Ye=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,qe):qe;function Xe(e){const t=e.ref;return Ie(t)?t.files:Le(t)?Ye(e.refs).value:je(t)?[...t.selectedOptions].map(({value:e})=>e):Q(t)?He(e.refs).value:Je(le(t.value)?e.ref.value:t.value,e)}var Qe=e=>e instanceof RegExp,et=e=>le(e)?e:Qe(e)?e.source:re(e)?Qe(e.value)?e.value.source:e.value:e,tt=e=>({isOnSubmit:!e||e===ge,isOnBlur:"onBlur"===e,isOnChange:e===be,isOnAll:e===ve,isOnTouch:"onTouched"===e});const nt="AsyncFunction";var rt=e=>!!e&&!!e.validate&&!!(Ue(e.validate)&&e.validate.constructor.name===nt||re(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===nt)),ot=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const at=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const n=fe(e,o);if(n){const{N:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(at(a,t))break}else if(re(a)&&at(a,t))break}}};function it(e,t,n){const r=fe(e,n);if(r||ce(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const r=o.join("."),a=fe(t,r),i=fe(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};if(i&&i.root&&i.root.type)return{name:r+".root",error:i.root};o.pop()}return{name:n}}var st=(e,t,n)=>{const r=Re(fe(e,n));return pe(r,"root",t[n]),pe(e,n,r),e},ct=e=>Ce(e);function lt(e,t,n="validate"){if(ct(e)||Array.isArray(e)&&e.every(ct)||me(e)&&!e)return{type:n,message:ct(e)?e:"",ref:t}}var dt=e=>re(e)&&!Qe(e)?e:{value:e,message:""},ut=async(e,t,n,r,o,a)=>{const{ref:i,refs:s,required:c,maxLength:l,minLength:d,min:u,max:f,pattern:m,validate:p,name:h,valueAsNumber:b,mount:g}=e.N,v=fe(n,h);if(!g||t.has(h))return{};const w=s?s[0]:i,y=e=>{o&&w.reportValidity&&(w.setCustomValidity(me(e)?"":e||""),w.reportValidity())},x={},A=Le(i),S=Q(i),k=A||S,T=(b||Ie(i))&&le(i.value)&&le(v)||Fe(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,C=Oe.bind(null,h,r,x),N=(e,t,n,r="maxLength",o="minLength")=>{const a=e?t:n;x[h]={type:e?r:o,message:a,ref:i,...C(e?r:o,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!k&&(T||te(v))||me(v)&&!v||S&&!He(s).isValid||A&&!Ye(s).isValid)){const{value:e,message:t}=ct(c)?{value:!!c,message:c}:dt(c);if(e&&(x[h]={type:ye,message:t,ref:w,...C(ye,t)},!r))return y(t),x}if(!(T||te(u)&&te(f))){let e,t;const n=dt(f),o=dt(u);if(te(v)||isNaN(v)){const r=i.valueAsDate||new Date(v),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,c="week"==i.type;Ce(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),Ce(o.value)&&v&&(t=s?a(v)<a(o.value):c?v<o.value:r<new Date(o.value))}else{const r=i.valueAsNumber||(v?+v:v);te(n.value)||(e=r>n.value),te(o.value)||(t=r<o.value)}if((e||t)&&(N(!!e,n.message,o.message,"max","min"),!r))return y(x[h].message),x}if((l||d)&&!T&&(Ce(v)||a&&Array.isArray(v))){const e=dt(l),t=dt(d),n=!te(e.value)&&v.length>+e.value,o=!te(t.value)&&v.length<+t.value;if((n||o)&&(N(n,e.message,t.message),!r))return y(x[h].message),x}if(m&&!T&&Ce(v)){const{value:e,message:t}=dt(m);if(Qe(e)&&!v.match(e)&&(x[h]={type:we,message:t,ref:i,...C(we,t)},!r))return y(t),x}if(p)if(Ue(p)){const e=lt(await p(v,n),w);if(e&&(x[h]={...e,...C("validate",e.message)},!r))return y(e.message),x}else if(re(p)){let e={};for(const t in p){if(!De(e)&&!r)break;const o=lt(await p[t](v,n),w,t);o&&(e={...o,...C(t,o.message)},y(o.message),r&&(x[h]=e))}if(!De(e)&&(x[h]={ref:w,...e},!r))return x}return y(!0),x};const ft={mode:ge,reValidateMode:be,shouldFocusError:!0};function mt(e={}){const n=t.useRef(void 0),r=t.useRef(void 0),[o,a]=t.useState({isDirty:!1,isValidating:!1,isLoading:Ue(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Ue(e.defaultValues)?void 0:e.defaultValues});if(!n.current)if(e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!Ue(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...r}=function(e={}){let t,n={...ft,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ue(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},a=(re(n.defaultValues)||re(n.values))&&se(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:se(a),s={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...d};const f={array:_e(),state:_e()},m=n.criteriaMode===ve,p=async e=>{if(!n.disabled&&(d.isValid||u.isValid||e)){const e=n.resolver?De((await v()).errors):await w(o,!0);e!==r.isValid&&f.state.next({isValid:e})}},h=(e,t)=>{!n.disabled&&(d.isValidating||d.validatingFields||u.isValidating||u.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?pe(r.validatingFields,e,t):$e(r.validatingFields,e))}),f.state.next({validatingFields:r.validatingFields,isValidating:!De(r.validatingFields)}))},b=(e,t,n,r)=>{const c=fe(o,e);if(c){const o=fe(i,e,le(n)?fe(a,e):n);le(o)||r&&r.defaultChecked||t?pe(i,e,t?o:Xe(c.N)):A(e,o),s.mount&&p()}},g=(e,t,o,i,s)=>{let c=!1,l=!1;const m={name:e};if(!n.disabled){if(!o||i){(d.isDirty||u.isDirty)&&(l=r.isDirty,r.isDirty=m.isDirty=y(),c=l!==m.isDirty);const n=Pe(fe(a,e),t);l=!!fe(r.dirtyFields,e),n?$e(r.dirtyFields,e):pe(r.dirtyFields,e,!0),m.dirtyFields=r.dirtyFields,c=c||(d.dirtyFields||u.dirtyFields)&&l!==!n}if(o){const t=fe(r.touchedFields,e);t||(pe(r.touchedFields,e,o),m.touchedFields=r.touchedFields,c=c||(d.touchedFields||u.touchedFields)&&t!==o)}c&&s&&f.state.next(m)}return c?m:{}},v=async e=>{h(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const o={};for(const n of e){const e=fe(t,n);e&&pe(o,n,e.N)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}})(e||c.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return h(e),t},w=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{N:e,...l}=s;if(e){const l=c.array.has(e.name),u=s.N&&rt(s.N);u&&d.validatingFields&&h([a],!0);const f=await ut(s,c.disabled,i,m,n.shouldUseNativeValidation&&!t,l);if(u&&d.validatingFields&&h([a]),f[e.name]&&(o.valid=!1,t))break;!t&&(fe(f,e.name)?l?st(r.errors,f,e.name):pe(r.errors,e.name,f[e.name]):$e(r.errors,e.name))}!De(l)&&await w(l,t,o)}}return o.valid},y=(e,t)=>!n.disabled&&(e&&t&&pe(i,e,t),!Pe(E(),a)),x=(e,t,n)=>Ne(e,c,{...s.mount?i:le(t)?a:Ce(e)?{[e]:t}:t},n,t),A=(e,t,n={})=>{const r=fe(o,e);let a=t;if(r){const n=r.N;n&&(!n.disabled&&pe(i,e,Je(t,n)),a=Fe(n.ref)&&te(t)?"":t,je(n.ref)?[...n.ref.options].forEach(e=>e.selected=a.includes(e.value)):n.refs?Q(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(e.checked=Array.isArray(a)?!!a.find(t=>t===e.value):a===e.value||!!a)}):n.refs.forEach(e=>e.checked=e.value===a):Ie(n.ref)?n.ref.value="":(n.ref.value=a,n.ref.type||f.state.next({name:e,values:se(i)})))}(n.shouldDirty||n.shouldTouch)&&g(e,a,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&N(e)},S=(e,t,n)=>{for(const r in t){if(!t.hasOwnProperty(r))return;const a=t[r],i=e+"."+r,s=fe(o,i);(c.array.has(e)||re(a)||s&&!s.N)&&!ee(a)?S(i,a,n):A(i,a,n)}},k=(e,t,n={})=>{const l=fe(o,e),m=c.array.has(e),p=se(t);pe(i,e,p),m?(f.array.next({name:e,values:se(i)}),(d.isDirty||d.dirtyFields||u.isDirty||u.dirtyFields)&&n.shouldDirty&&f.state.next({name:e,dirtyFields:We(a,i),isDirty:y(e,p)})):!l||l.N||te(p)?A(e,p,n):S(e,p,n),ot(e,c)&&f.state.next({...r,name:e}),f.state.next({name:s.mount?e:void 0,values:se(i)})},T=async e=>{s.mount=!0;const a=e.target;let b=a.name,y=!0;const x=fe(o,b),A=e=>{y=Number.isNaN(e)||ee(e)&&isNaN(e.getTime())||Pe(e,fe(i,b,e))},S=tt(n.mode),k=tt(n.reValidateMode);if(x){let s,T;const C=a.type?Xe(x.N):oe(e),E=e.type===he||"focusout"===e.type,P=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(x.N)&&!n.resolver&&!fe(r.errors,b)&&!x.N.deps||((e,t,n,r,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:!(n?r.isOnChange:o.isOnChange)||e))(E,fe(r.touchedFields,b),r.isSubmitted,k,S),M=ot(b,c,E);pe(i,b,C),E?a&&a.readOnly||(x.N.onBlur&&x.N.onBlur(e),t&&t(0)):x.N.onChange&&x.N.onChange(e);const O=g(b,C,E),R=!De(O)||M;if(!E&&f.state.next({name:b,type:e.type,values:se(i)}),P)return(d.isValid||u.isValid)&&("onBlur"===n.mode?E&&p():E||p()),R&&f.state.next({name:b,...M?{}:O});if(!E&&M&&f.state.next({...r}),n.resolver){const{errors:e}=await v([b]);if(A(C),y){const t=it(r.errors,o,b),n=it(e,o,t.name||b);s=n.error,b=n.name,T=De(e)}}else h([b],!0),s=(await ut(x,c.disabled,i,m,n.shouldUseNativeValidation))[b],h([b]),A(C),y&&(s?T=!1:(d.isValid||u.isValid)&&(T=await w(o,!0)));y&&(x.N.deps&&N(x.N.deps),((e,o,a,i)=>{const s=fe(r.errors,e),c=(d.isValid||u.isValid)&&me(o)&&r.isValid!==o;var m;if(n.delayError&&a?(m=()=>((e,t)=>{pe(r.errors,e,t),f.state.next({errors:r.errors})})(e,a),t=e=>{clearTimeout(l),l=setTimeout(m,e)},t(n.delayError)):(clearTimeout(l),t=null,a?pe(r.errors,e,a):$e(r.errors,e)),(a?!Pe(s,a):s)||!De(i)||c){const t={...i,...c&&me(o)?{isValid:o}:{},errors:r.errors,name:e};r={...r,...t},f.state.next(t)}})(b,T,s,O))}},C=(e,t)=>{if(fe(r.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let a,i;const s=Re(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await v(e);if(e)for(const n of e){const e=fe(t,n);e?pe(r.errors,n,e):$e(r.errors,n)}else r.errors=t;return t})(le(e)?e:s);a=De(t),i=e?!s.some(e=>fe(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=fe(o,e);return await w(t&&t.N?{[e]:t}:t)}))).every(Boolean),(i||r.isValid)&&p()):i=a=await w(o);return f.state.next({...!Ce(e)||(d.isValid||u.isValid)&&a!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:a}:{},errors:r.errors}),t.shouldFocus&&!i&&at(o,C,e?s:c.mount),i},E=e=>{const t={...s.mount?i:a};return le(e)?t:Ce(e)?fe(t,e):e.map(e=>fe(t,e))},P=(e,t)=>({invalid:!!fe((t||r).errors,e),isDirty:!!fe((t||r).dirtyFields,e),error:fe((t||r).errors,e),isValidating:!!fe(r.validatingFields,e),isTouched:!!fe((t||r).touchedFields,e)}),M=(e,t,n)=>{const a=(fe(o,e,{N:{}}).N||{}).ref,i=fe(r.errors,e)||{},{ref:s,message:c,type:l,...d}=i;pe(r.errors,e,{...d,...t,ref:a}),f.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&a&&a.focus&&a.focus()},O=e=>f.state.subscribe({next:t=>{var n,o,s;n=e.name,o=t.name,s=e.exact,n&&o&&n!==o&&!Re(n).some(e=>e&&(s?e===o:e.startsWith(o)||o.startsWith(e)))||!((e,t,n,r)=>{n(e);const{name:o,...a}=e;return De(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||ve))})(t,e.formState||d,L,e.reRenderRoot)||e.callback({values:{...i},...r,...t,defaultValues:a})}}).unsubscribe,R=(e,t={})=>{for(const s of e?Re(e):c.mount)c.mount.delete(s),c.array.delete(s),t.keepValue||($e(o,s),$e(i,s)),!t.keepError&&$e(r.errors,s),!t.keepDirty&&$e(r.dirtyFields,s),!t.keepTouched&&$e(r.touchedFields,s),!t.keepIsValidating&&$e(r.validatingFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&$e(a,s);f.state.next({values:se(i)}),f.state.next({...r,...t.keepDirty?{isDirty:y()}:{}}),!t.keepIsValid&&p()},_=({disabled:e,name:t})=>{(me(e)&&s.mount||e||c.disabled.has(t))&&(e?c.disabled.add(t):c.disabled.delete(t))},D=(e,t={})=>{let r=fe(o,e);const i=me(t.disabled)||me(n.disabled);return pe(o,e,{...r||{},N:{...r&&r.N?r.N:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),r?_({disabled:me(t.disabled)?t.disabled:n.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:et(t.min),max:et(t.max),minLength:et(t.minLength),maxLength:et(t.maxLength),pattern:et(t.pattern)}:{},name:e,onChange:T,onBlur:T,ref:i=>{if(i){D(e,t),r=fe(o,e);const n=le(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>Le(e)||Q(e))(n),c=r.N.refs||[];if(s?c.find(e=>e===n):n===r.N.ref)return;pe(o,e,{N:{...r.N,...s?{refs:[...c.filter(Be),n,...Array.isArray(fe(a,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),b(e,!1,void 0,n)}else r=fe(o,e,{}),r.N&&(r.N.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!ae(c.array,e)||!s.action)&&c.unMount.add(e)}}},I=()=>n.shouldFocusError&&at(o,C,c.mount),U=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let l=se(i);if(f.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await v();r.errors=e,l=se(t)}else await w(o);if(c.disabled.size)for(const e of c.disabled)$e(l,e);if($e(r.errors,"root"),De(r.errors)){f.state.next({errors:{}});try{await e(l,a)}catch(e){s=e}}else t&&await t({...r.errors},a),I(),setTimeout(I);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:De(r.errors)&&!s,submitCount:r.submitCount+1,errors:r.errors}),s)throw s},F=(e,t={})=>{const l=e?se(e):a,u=se(l),m=De(e),p=m?a:u;if(t.keepDefaultValues||(a=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(We(a,i))]);for(const t of Array.from(e))fe(r.dirtyFields,t)?pe(p,t,fe(i,t)):k(t,fe(p,t))}else{if(ie&&le(e))for(const e of c.mount){const t=fe(o,e);if(t&&t.N){const e=Array.isArray(t.N.refs)?t.N.refs[0]:t.N.ref;if(Fe(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)k(e,fe(p,e));else o={}}i=n.shouldUnregister?t.keepDefaultValues?se(a):{}:se(p),f.array.next({values:{...p}}),f.state.next({values:{...p}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!n.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!m&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||Pe(e,a))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&i?We(a,i):r.dirtyFields:t.keepDefaultValues&&e?We(a,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1,defaultValues:a})},j=(e,t)=>F(Ue(e)?e(i):e,t),L=e=>{r={...r,...e}},B={control:{register:D,unregister:R,getFieldState:P,handleSubmit:U,setError:M,A:O,R:v,_:I,v:x,D:y,T:p,I:(e,t=[],c,l,m=!0,p=!0)=>{if(l&&c&&!n.disabled){if(s.action=!0,p&&Array.isArray(fe(o,e))){const t=c(fe(o,e),l.argA,l.argB);m&&pe(o,e,t)}if(p&&Array.isArray(fe(r.errors,e))){const t=c(fe(r.errors,e),l.argA,l.argB);m&&pe(r.errors,e,t),((e,t)=>{!de(fe(e,t)).length&&$e(e,t)})(r.errors,e)}if((d.touchedFields||u.touchedFields)&&p&&Array.isArray(fe(r.touchedFields,e))){const t=c(fe(r.touchedFields,e),l.argA,l.argB);m&&pe(r.touchedFields,e,t)}(d.dirtyFields||u.dirtyFields)&&(r.dirtyFields=We(a,i)),f.state.next({name:e,isDirty:y(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else pe(i,e,t)},O:_,U:e=>{r.errors=e,f.state.next({errors:r.errors,isValid:!1})},F:e=>de(fe(s.mount?i:a,e,n.shouldUnregister?fe(a,e,[]):[])),j:F,L:()=>Ue(n.defaultValues)&&n.defaultValues().then(e=>{j(e,n.resetOptions),f.state.next({isLoading:!1})}),S:()=>{for(const e of c.unMount){const t=fe(o,e);t&&(t.N.refs?t.N.refs.every(e=>!Be(e)):!Be(t.N.ref))&&R(e)}c.unMount=new Set},B:e=>{me(e)&&(f.state.next({disabled:e}),at(o,(t,n)=>{const r=fe(o,n);r&&(t.disabled=r.N.disabled||e,Array.isArray(r.N.refs)&&r.N.refs.forEach(t=>{t.disabled=r.N.disabled||e}))},0,!1))},G:f,i:d,get C(){return o},get u(){return i},get M(){return s},set M(e){s=e},get o(){return a},get l(){return c},set l(e){c=e},get k(){return r},get P(){return n},set P(e){n={...n,...e}}},subscribe:e=>(s.mount=!0,u={...u,...e.formState},O({...e,formState:u})),trigger:N,register:D,handleSubmit:U,watch:(e,t)=>Ue(e)?f.state.subscribe({next:n=>"values"in n&&e(x(void 0,t),n)}):x(e,t,!0),setValue:k,getValues:E,reset:j,resetField:(e,t={})=>{fe(o,e)&&(le(t.defaultValue)?k(e,se(fe(a,e))):(k(e,t.defaultValue),pe(a,e,se(t.defaultValue))),t.keepTouched||$e(r.touchedFields,e),t.keepDirty||($e(r.dirtyFields,e),r.isDirty=t.defaultValue?y(e,se(fe(a,e))):y()),t.keepError||($e(r.errors,e),d.isValid&&p()),f.state.next({...r}))},clearErrors:e=>{e&&Re(e).forEach(e=>$e(r.errors,e)),f.state.next({errors:e?r.errors:{}})},unregister:R,setError:M,setFocus:(e,t={})=>{const n=fe(o,e),r=n&&n.N;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&Ue(e.select)&&e.select())}},getFieldState:P};return{...B,formControl:B}}(e);n.current={...r,formState:o}}const i=n.current.control;return i.P=e,Te(()=>{const e=i.A({formState:i.i,callback:()=>a({...i.k}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),i.k.isReady=!0,e},[i]),t.useEffect(()=>i.B(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i.P.mode=e.mode),e.reValidateMode&&(i.P.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i.U(e.errors),i._())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i.G.state.next({values:i.v()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i.i.isDirty){const e=i.D();e!==o.isDirty&&i.G.state.next({isDirty:e})}},[i,o.isDirty]),t.useEffect(()=>{e.values&&!Pe(e.values,r.current)?(i.j(e.values,{keepFieldsRef:!0,...i.P.resetOptions}),r.current=e.values,a(e=>({...e}))):i.L()},[i,e.values]),t.useEffect(()=>{i.M.mount||(i.T(),i.M.mount=!0),i.M.watch&&(i.M.watch=!1,i.G.state.next({...i.k})),i.S()}),n.current.formState=ke(o,i),n.current}const pt=(e,t,n)=>{if(e&&"reportValidity"in e){const r=fe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ht=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?pt(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>pt(t,n,e))}},bt=(e,t)=>{t.shouldUseNativeValidation&&ht(e,t);const n={};for(const r in e){const o=fe(t.fields,r),a=Object.assign(e[r]||{},{ref:o&&o.ref});if(gt(t.names||Object.keys(e),r)){const e=Object.assign({},fe(n,r));pe(e,"root",a),pe(n,r,e)}else pe(n,r,a)}return n},gt=(e,t)=>{const n=vt(t);return e.some(e=>vt(e).match(`^${n}\\.\\d+`))};function vt(e){return e.replace(/\]|\[/g,"")}function wt(e,t,n){function r(n,r){var o;Object.defineProperty(n,"Z",{value:n.Z??{},enumerable:!1}),(o=n.Z).traits??(o.traits=new Set),n.Z.traits.add(e),t(n,r);for(const e in i.prototype)e in n||Object.defineProperty(n,e,{value:i.prototype[e].bind(n)});n.Z.constr=i,n.Z.def=r}const o=n?.Parent??Object;class a extends o{}function i(e){var t;const o=n?.Parent?new a:this;r(o,e),(t=o.Z).deferred??(t.deferred=[]);for(const e of o.Z.deferred)e();return o}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?.Z?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class yt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class xt extends Error{constructor(e){super("Encountered unidirectional transform during encode: "+e),this.name="ZodEncodeError"}}const At={};function St(e){return At}function kt(e,t){return"bigint"==typeof t?t.toString():t}function Tt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ct(e){return null==e}function Nt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Et=Symbol("evaluating");function Pt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Et)return void 0===r&&(r=Et,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Mt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Rt(e){return JSON.stringify(e)}const _t="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Dt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const It=Tt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function Ut(e){if(!1===Dt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Dt(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ft(e){return Ut(e)?{...e}:Array.isArray(e)?[...e]:e}const jt=new Set(["string","number","symbol"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bt(e,t,n){const r=new e.Z.constr(t??e.Z.def);return t&&!n?.parent||(r.Z.parent=e),r}function $t(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function zt(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Gt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Zt(e){return"string"==typeof e?e:e?.message}function Wt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Zt(e.inst?.Z.def?.error?.(e))??Zt(t?.error?.(e))??Zt(n.customError?.(e))??Zt(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Kt(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Vt(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ht=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"Z",{value:e.Z,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jt=wt("$ZodError",Ht),qt=wt("$ZodError",Ht,{Parent:Error}),Yt=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},i=t.Z.run({value:n,issues:[]},a);if(i instanceof Promise)throw new yt;if(i.issues.length){const t=new(o?.Err??e)(i.issues.map(e=>Wt(e,a,St())));throw _t(t,o?.callee),t}return i.value},Xt=Yt(qt),Qt=e=>async(t,n,r,o)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let i=t.Z.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(o?.Err??e)(i.issues.map(e=>Wt(e,a,St())));throw _t(t,o?.callee),t}return i.value},en=Qt(qt),tn=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},a=t.Z.run({value:n,issues:[]},o);if(a instanceof Promise)throw new yt;return a.issues.length?{success:!1,error:new(e??Jt)(a.issues.map(e=>Wt(e,o,St())))}:{success:!0,data:a.value}},nn=tn(qt),rn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t.Z.run({value:n,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Wt(e,o,St())))}:{success:!0,data:a.value}},on=rn(qt),an=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yt(e)(t,n,o)},sn=e=>(t,n,r)=>Yt(e)(t,n,r),cn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qt(e)(t,n,o)},ln=e=>async(t,n,r)=>Qt(e)(t,n,r),dn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tn(e)(t,n,o)},un=e=>(t,n,r)=>tn(e)(t,n,r),fn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return rn(e)(t,n,o)},mn=e=>async(t,n,r)=>rn(e)(t,n,r),pn=/^[cC][^\s-]{8,}$/,hn=/^[0-9a-z]+$/,bn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gn=/^[0-9a-vA-V]{20}$/,vn=/^[A-Za-z0-9]{27}$/,wn=/^[a-zA-Z0-9_-]{21}$/,yn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,An=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Sn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Cn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,En=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pn=/^[A-Za-z0-9_-]*$/,Mn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,On=/^\+(?:[0-9]){6,14}[0-9]$/,Rn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_n=RegExp(`^${Rn}$`);function Dn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?""+t:0===e.precision?t+":[0-5]\\d":`${t}:[0-5]\\d\\.\\d{${e.precision}}`:t+"(?::[0-5]\\d(?:\\.\\d+)?)?"}const In=/^[^A-Z]*$/,Un=/^[^a-z]*$/,Fn=wt("$ZodCheck",(e,t)=>{var n;e.Z??(e.Z={}),e.Z.def=t,(n=e.Z).onattach??(n.onattach=[])}),jn=wt("$ZodCheckMaxLength",(e,t)=>{var n;Fn.init(e,t),(n=e.Z.def).when??(n.when=e=>{const t=e.value;return!Ct(t)&&void 0!==t.length}),e.Z.onattach.push(e=>{const n=e.Z.bag.maximum??1/0;t.maximum<n&&(e.Z.bag.maximum=t.maximum)}),e.Z.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=Kt(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ln=wt("$ZodCheckMinLength",(e,t)=>{var n;Fn.init(e,t),(n=e.Z.def).when??(n.when=e=>{const t=e.value;return!Ct(t)&&void 0!==t.length}),e.Z.onattach.push(e=>{const n=e.Z.bag.minimum??-1/0;t.minimum>n&&(e.Z.bag.minimum=t.minimum)}),e.Z.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=Kt(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bn=wt("$ZodCheckLengthEquals",(e,t)=>{var n;Fn.init(e,t),(n=e.Z.def).when??(n.when=e=>{const t=e.value;return!Ct(t)&&void 0!==t.length}),e.Z.onattach.push(e=>{const n=e.Z.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e.Z.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const a=Kt(r),i=o>t.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$n=wt("$ZodCheckStringFormat",(e,t)=>{var n,r;Fn.init(e,t),e.Z.onattach.push(e=>{const n=e.Z.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e.Z).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e.Z).check??(r.check=()=>{})}),zn=wt("$ZodCheckRegex",(e,t)=>{$n.init(e,t),e.Z.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gn=wt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=In),$n.init(e,t)}),Zn=wt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Un),$n.init(e,t)}),Wn=wt("$ZodCheckIncludes",(e,t)=>{Fn.init(e,t);const n=Lt(t.includes),r=RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e.Z.onattach.push(e=>{const t=e.Z.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e.Z.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Kn=wt("$ZodCheckStartsWith",(e,t)=>{Fn.init(e,t);const n=RegExp(`^${Lt(t.prefix)}.*`);t.pattern??(t.pattern=n),e.Z.onattach.push(e=>{const t=e.Z.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e.Z.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Vn=wt("$ZodCheckEndsWith",(e,t)=>{Fn.init(e,t);const n=RegExp(`.*${Lt(t.suffix)}$`);t.pattern??(t.pattern=n),e.Z.onattach.push(e=>{const t=e.Z.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e.Z.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Hn=wt("$ZodCheckOverwrite",(e,t)=>{Fn.init(e,t),e.Z.check=e=>{e.value=t.tx(e.value)}});class Jn{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>" "+e)].join("\n"))}}const qn={major:4,minor:1,patch:8},Yn=wt("$ZodType",(e,t)=>{var n;e??(e={}),e.Z.def=t,e.Z.bag=e.Z.bag||{},e.Z.version=qn;const r=[...e.Z.def.checks??[]];e.Z.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t.Z.onattach)n(e);if(0===r.length)(n=e.Z).deferred??(n.deferred=[]),e.Z.deferred?.push(()=>{e.Z.run=e.Z.parse});else{const t=(e,t,n)=>{let r,o=zt(e);for(const a of t){if(a.Z.def.when){if(!a.Z.def.when(e))continue}else if(o)continue;const t=e.issues.length,i=a.Z.check(e);if(i instanceof Promise&&!1===n?.async)throw new yt;if(r||i instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await i,e.issues.length!==t&&(o||(o=zt(e,t)))});else{if(e.issues.length===t)continue;o||(o=zt(e,t))}}return r?r.then(()=>e):e},n=(n,o,a)=>{if(zt(n))return n.aborted=!0,n;const i=t(o,r,a);if(i instanceof Promise){if(!1===a.async)throw new yt;return i.then(t=>e.Z.parse(t,a))}return e.Z.parse(i,a)};e.Z.run=(o,a)=>{if(a.skipChecks)return e.Z.parse(o,a);if("backward"===a.direction){const t=e.Z.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,a)):n(t,o,a)}const i=e.Z.parse(o,a);if(i instanceof Promise){if(!1===a.async)throw new yt;return i.then(e=>t(e,r,a))}return t(i,r,a)}}e["~standard"]={validate:t=>{try{const n=nn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return on(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Xn=wt("$ZodString",(e,t)=>{var n;Yn.init(e,t),e.Z.pattern=[...e?.Z.bag?.patterns??[]].pop()??(n=e.Z.bag,RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e.Z.parse=(n,r)=>{if(t.coerce)try{n.value=n.value+""}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Qn=wt("$ZodStringFormat",(e,t)=>{$n.init(e,t),Xn.init(e,t)}),er=wt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xn),Qn.init(e,t)}),tr=wt("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=An(e))}else t.pattern??(t.pattern=An());Qn.init(e,t)}),nr=wt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Sn),Qn.init(e,t)}),rr=wt("$ZodURL",(e,t)=>{Qn.init(e,t),e.Z.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Mn.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),or=wt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Qn.init(e,t)}),ar=wt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wn),Qn.init(e,t)}),ir=wt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pn),Qn.init(e,t)}),sr=wt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=hn),Qn.init(e,t)}),cr=wt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bn),Qn.init(e,t)}),lr=wt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=gn),Qn.init(e,t)}),dr=wt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vn),Qn.init(e,t)}),ur=wt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Dn({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return RegExp(`^${Rn}T(?:${r})$`)}(t)),Qn.init(e,t)}),fr=wt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_n),Qn.init(e,t)}),mr=wt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${Dn(t)}$`)),Qn.init(e,t)}),pr=wt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=yn),Qn.init(e,t)}),hr=wt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=kn),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.format="ipv4"})}),br=wt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tn),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.format="ipv6"}),e.Z.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),gr=wt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Cn),Qn.init(e,t)}),vr=wt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nn),Qn.init(e,t),e.Z.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw Error();const[e,t]=r;if(!t)throw Error();const n=+t;if(""+n!==t)throw Error();if(0>n||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function wr(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const yr=wt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=En),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.contentEncoding="base64"}),e.Z.check=n=>{wr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),xr=wt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Pn),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.contentEncoding="base64url"}),e.Z.check=n=>{(function(e){if(!Pn.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return wr(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ar=wt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=On),Qn.init(e,t)}),Sr=wt("$ZodJWT",(e,t)=>{Qn.init(e,t),e.Z.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),kr=wt("$ZodUnknown",(e,t)=>{Yn.init(e,t),e.Z.parse=e=>e}),Tr=wt("$ZodNever",(e,t)=>{Yn.init(e,t),e.Z.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Cr(e,t,n){e.issues.length&&t.issues.push(...Gt(n,e.issues)),t.value[n]=e.value}const Nr=wt("$ZodArray",(e,t)=>{Yn.init(e,t),e.Z.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const a=[];for(let e=0;e<o.length;e++){const i=o[e],s=t.element.Z.run({value:i,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Cr(t,n,e))):Cr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Er(e,t,n,r){e.issues.length&&t.issues.push(...Gt(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Pr(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?.Z?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e].Z.optin&&"optional"===r[e].Z.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Mr(e,t,n,r,o,a){const i=[],s=o.keySet,c=o.catchall.Z,l=c.def.type;for(const o of Object.keys(t)){if(s.has(o))continue;if("never"===l){i.push(o);continue}const a=c.run({value:t[o],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Er(e,n,o,t))):Er(a,n,o,t)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Or=wt("$ZodObject",(e,t)=>{Yn.init(e,t);const n=Tt(()=>Pr(t));Pt(e.Z,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t].Z;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const r=Dt,o=t.catchall;let a;e.Z.parse=(t,i)=>{a??(a=n.value);const s=t.value;if(!r(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const c=[],l=a.shape;for(const e of a.keys){const n=l[e].Z.run({value:s[e],issues:[]},i);n instanceof Promise?c.push(n.then(n=>Er(n,t,e,s))):Er(n,t,e,s)}return o?Mr(c,s,t,i,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Rr=wt("$ZodObjectJIT",(e,t)=>{Or.init(e,t);const n=e.Z.parse,r=Tt(()=>Pr(t));let o;const a=Dt,i=!At.jitless,s=i&&It.value,c=t.catchall;let l;e.Z.parse=(d,u)=>{l??(l=r.value);const f=d.value;return a(f)?i&&s&&!1===u?.async&&!0!==u.jitless?(o||(o=(e=>{const t=new Jn(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Rt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const a=Object.create(null);let i=0;for(const e of n.keys)a[e]="key_"+i++;t.write("const newResult = {};");for(const e of n.keys){const n=a[e],r=Rt(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),d=o(d,u),c?Mr([],f,d,u,l,e):d):n(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),d)}});function _r(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!zt(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Wt(e,r,St())))}),t)}const Dr=wt("$ZodUnion",(e,t)=>{Yn.init(e,t),Pt(e.Z,"optin",()=>t.options.some(e=>"optional"===e.Z.optin)?"optional":void 0),Pt(e.Z,"optout",()=>t.options.some(e=>"optional"===e.Z.optout)?"optional":void 0),Pt(e.Z,"values",()=>{if(t.options.every(e=>e.Z.values))return new Set(t.options.flatMap(e=>Array.from(e.Z.values)))}),Pt(e.Z,"pattern",()=>{if(t.options.every(e=>e.Z.pattern)){const e=t.options.map(e=>e.Z.pattern);return RegExp(`^(${e.map(e=>Nt(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0].Z.run;e.Z.parse=(o,a)=>{if(n)return r(o,a);let i=!1;const s=[];for(const e of t.options){const t=e.Z.run({value:o.value,issues:[]},a);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>_r(t,o,e,a)):_r(s,o,e,a)}}),Ir=wt("$ZodIntersection",(e,t)=>{Yn.init(e,t),e.Z.parse=(e,n)=>{const r=e.value,o=t.left.Z.run({value:r,issues:[]},n),a=t.right.Z.run({value:r,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([t,n])=>Fr(e,t,n)):Fr(e,o,a)}});function Ur(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ut(e)&&Ut(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=Ur(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=Ur(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fr(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),zt(e))return e;const r=Ur(t.value,n.value);if(!r.valid)throw Error("Unmergable intersection. Error path: "+JSON.stringify(r.mergeErrorPath));return e.value=r.data,e}const jr=wt("$ZodEnum",(e,t)=>{Yn.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e),n=Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t);return n}(t.entries),r=new Set(n);e.Z.values=r,e.Z.pattern=RegExp(`^(${n.filter(e=>jt.has(typeof e)).map(e=>"string"==typeof e?Lt(e):e.toString()).join("|")})$`),e.Z.parse=(t,o)=>{const a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),Lr=wt("$ZodTransform",(e,t)=>{Yn.init(e,t),e.Z.parse=(n,r)=>{if("backward"===r.direction)throw new xt(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new yt;return n.value=o,n}});function Br(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const $r=wt("$ZodOptional",(e,t)=>{Yn.init(e,t),e.Z.optin="optional",e.Z.optout="optional",Pt(e.Z,"values",()=>t.innerType.Z.values?new Set([...t.innerType.Z.values,void 0]):void 0),Pt(e.Z,"pattern",()=>{const e=t.innerType.Z.pattern;return e?RegExp(`^(${Nt(e.source)})?$`):void 0}),e.Z.parse=(e,n)=>{if("optional"===t.innerType.Z.optin){const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(t=>Br(t,e.value)):Br(r,e.value)}return void 0===e.value?e:t.innerType.Z.run(e,n)}}),zr=wt("$ZodNullable",(e,t)=>{Yn.init(e,t),Pt(e.Z,"optin",()=>t.innerType.Z.optin),Pt(e.Z,"optout",()=>t.innerType.Z.optout),Pt(e.Z,"pattern",()=>{const e=t.innerType.Z.pattern;return e?RegExp(`^(${Nt(e.source)}|null)$`):void 0}),Pt(e.Z,"values",()=>t.innerType.Z.values?new Set([...t.innerType.Z.values,null]):void 0),e.Z.parse=(e,n)=>null===e.value?e:t.innerType.Z.run(e,n)}),Gr=wt("$ZodDefault",(e,t)=>{Yn.init(e,t),e.Z.optin="optional",Pt(e.Z,"values",()=>t.innerType.Z.values),e.Z.parse=(e,n)=>{if("backward"===n.direction)return t.innerType.Z.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(e=>Zr(e,t)):Zr(r,t)}});function Zr(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Wr=wt("$ZodPrefault",(e,t)=>{Yn.init(e,t),e.Z.optin="optional",Pt(e.Z,"values",()=>t.innerType.Z.values),e.Z.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType.Z.run(e,n))}),Kr=wt("$ZodNonOptional",(e,t)=>{Yn.init(e,t),Pt(e.Z,"values",()=>{const e=t.innerType.Z.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e.Z.parse=(n,r)=>{const o=t.innerType.Z.run(n,r);return o instanceof Promise?o.then(t=>Vr(t,e)):Vr(o,e)}});function Vr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Hr=wt("$ZodCatch",(e,t)=>{Yn.init(e,t),Pt(e.Z,"optin",()=>t.innerType.Z.optin),Pt(e.Z,"optout",()=>t.innerType.Z.optout),Pt(e.Z,"values",()=>t.innerType.Z.values),e.Z.parse=(e,n)=>{if("backward"===n.direction)return t.innerType.Z.run(e,n);const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Wt(e,n,St()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Wt(e,n,St()))},input:e.value}),e.issues=[]),e)}}),Jr=wt("$ZodPipe",(e,t)=>{Yn.init(e,t),Pt(e.Z,"values",()=>t.in.Z.values),Pt(e.Z,"optin",()=>t.in.Z.optin),Pt(e.Z,"optout",()=>t.out.Z.optout),Pt(e.Z,"propValues",()=>t.in.Z.propValues),e.Z.parse=(e,n)=>{if("backward"===n.direction){const r=t.out.Z.run(e,n);return r instanceof Promise?r.then(e=>qr(e,t.in,n)):qr(r,t.in,n)}const r=t.in.Z.run(e,n);return r instanceof Promise?r.then(e=>qr(e,t.out,n)):qr(r,t.out,n)}});function qr(e,t,n){return e.issues.length?(e.aborted=!0,e):t.Z.run({value:e.value,issues:e.issues},n)}const Yr=wt("$ZodReadonly",(e,t)=>{Yn.init(e,t),Pt(e.Z,"propValues",()=>t.innerType.Z.propValues),Pt(e.Z,"values",()=>t.innerType.Z.values),Pt(e.Z,"optin",()=>t.innerType.Z.optin),Pt(e.Z,"optout",()=>t.innerType.Z.optout),e.Z.parse=(e,n)=>{if("backward"===n.direction)return t.innerType.Z.run(e,n);const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(Xr):Xr(r)}});function Xr(e){return e.value=Object.freeze(e.value),e}const Qr=wt("$ZodCustom",(e,t)=>{Fn.init(e,t),Yn.init(e,t),e.Z.parse=(e,t)=>e,e.Z.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>eo(t,n,r,e));eo(o,n,r,e)}});function eo(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r.Z.def.path??[]],continue:!r.Z.def.abort};r.Z.def.params&&(e.params=r.Z.def.params),t.issues.push(Vt(e))}}class to{constructor(){this.W=new WeakMap,this.K=new Map}add(e,...t){const n=t[0];if(this.W.set(e,n),n&&"object"==typeof n&&"id"in n){if(this.K.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this.K.set(n.id,e)}return this}clear(){return this.W=new WeakMap,this.K=new Map,this}remove(e){const t=this.W.get(e);return t&&"object"==typeof t&&"id"in t&&this.K.delete(t.id),this.W.delete(e),this}get(e){const t=e.Z.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this.W.get(e)};return Object.keys(r).length?r:void 0}return this.W.get(e)}has(e){return this.W.has(e)}}function no(){return new to}const ro=no();function oo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$t(t)})}function ao(e,t){return new jn({check:"max_length",...$t(t),maximum:e})}function io(e,t){return new Ln({check:"min_length",...$t(t),minimum:e})}function so(e,t){return new Bn({check:"length_equals",...$t(t),length:e})}function co(e){return new Hn({check:"overwrite",tx:e})}function lo(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function uo(e,t){for(var n={};e.length;){var r=e[0],o=r.code,a=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[i]={message:s.message,type:s.code}}else n[i]={message:a,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Oe(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function fo(e,t){for(var n={};e.length;){var r=e[0],o=r.code,a=r.message,i=r.path.join(".");if(!n[i])if("invalid_union"===r.code&&r.errors.length>0){var s=r.errors[0][0];n[i]={message:s.message,type:s.code}}else n[i]={message:a,type:o};if("invalid_union"===r.code&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Oe(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function mo(e,t,n){if(void 0===n&&(n={}),function(e){return"V"in e&&"object"==typeof e.V&&"typeName"in e.V}(e))return function(r,o,a){try{return Promise.resolve(lo(function(){return Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](r,t)).then(function(e){return a.shouldUseNativeValidation&&ht({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:bt(uo(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"Z"in e&&"object"==typeof e.Z}(e))return function(r,o,a){try{return Promise.resolve(lo(function(){return Promise.resolve(("sync"===n.mode?Xt:en)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&ht({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof Jt}(e))return{values:{},errors:bt(fo(e.issues,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error("Invalid input: not a Zod schema")}function po(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;o>t;t++)e[t]&&(n=po(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ho(){for(var e,t,n=0,r="",o=arguments.length;o>n;n++)(e=arguments[n])&&(t=po(e))&&(r&&(r+=" "),r+=t);return r}const bo=e=>{const t=yo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),go(n,t)||wo(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},go=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?go(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},vo=/^\[(.+)\]$/,wo=e=>{if(vo.test(e)){const t=vo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yo=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const e in n)xo(n[e],r,e,t);return r},xo=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?So(e)?void xo(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{xo(o,Ao(t,e),n,r)});(""===e?t:Ao(t,e)).classGroupId=n})},Ao=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},So=e=>e.isThemeGetter,ko=e=>{if(1>e)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},To=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===r&&0===o){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const i=0===t.length?e:e.substring(a),s=Co(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Co=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,No=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(1>=e.length)return e;const n=[];let r=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...r.sort(),e),r=[]):r.push(e)}),n.push(...r.sort()),n}},Eo=/\s+/;function Po(){let e,t,n=0,r="";for(;arguments.length>n;)(e=arguments[n++])&&(t=Mo(e))&&(r&&(r+=" "),r+=t);return r}const Mo=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mo(e[r]))&&(n&&(n+=" "),n+=t);return n};function Oo(e,...t){let n,r,o,a=function(s){const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:ko(e.cacheSize),parseClassName:To(e),sortModifiers:No(e),...bo(e)}))(c),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(Eo);let c="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:l,modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=n(t);if(l){c=t+(c.length>0?" "+c:c);continue}let p=!!m,h=r(p?f.substring(0,m):f);if(!h){if(!p){c=t+(c.length>0?" "+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?" "+c:c);continue}p=!1}const b=a(d).join(":"),g=u?b+"!":b,v=g+h;if(i.includes(v))continue;i.push(v);const w=o(h,p);for(let e=0;e<w.length;++e){const t=w[e];i.push(g+t)}c=t+(c.length>0?" "+c:c)}return c})(e,n);return o(e,a),a}return function(){return a(Po.apply(null,arguments))}}const Ro=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},_o=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Do=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Io=/^\d+\/\d+$/,Uo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$o=e=>Io.test(e),zo=e=>!!e&&!Number.isNaN(+e),Go=e=>!!e&&Number.isInteger(+e),Zo=e=>e.endsWith("%")&&zo(e.slice(0,-1)),Wo=e=>Uo.test(e),Ko=()=>!0,Vo=e=>Fo.test(e)&&!jo.test(e),Ho=()=>!1,Jo=e=>Lo.test(e),qo=e=>Bo.test(e),Yo=e=>!Qo(e)&&!aa(e),Xo=e=>fa(e,ba,Ho),Qo=e=>_o.test(e),ea=e=>fa(e,ga,Vo),ta=e=>fa(e,va,zo),na=e=>fa(e,pa,Ho),ra=e=>fa(e,ha,qo),oa=e=>fa(e,ya,Jo),aa=e=>Do.test(e),ia=e=>ma(e,ga),sa=e=>ma(e,wa),ca=e=>ma(e,pa),la=e=>ma(e,ba),da=e=>ma(e,ha),ua=e=>ma(e,ya,!0),fa=(e,t,n)=>{const r=_o.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ma=(e,t,n=!1)=>{const r=Do.exec(e);return!!r&&(r[1]?t(r[1]):n)},pa=e=>"position"===e||"percentage"===e,ha=e=>"image"===e||"url"===e,ba=e=>"length"===e||"size"===e||"bg-size"===e,ga=e=>"length"===e,va=e=>"number"===e,wa=e=>"family-name"===e,ya=e=>"shadow"===e,xa=Oo(()=>{const e=Ro("color"),t=Ro("font"),n=Ro("text"),r=Ro("font-weight"),o=Ro("tracking"),a=Ro("leading"),i=Ro("breakpoint"),s=Ro("container"),c=Ro("spacing"),l=Ro("radius"),d=Ro("shadow"),u=Ro("inset-shadow"),f=Ro("text-shadow"),m=Ro("drop-shadow"),p=Ro("blur"),h=Ro("perspective"),b=Ro("aspect"),g=Ro("ease"),v=Ro("animate"),w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",aa,Qo],y=()=>[aa,Qo,c],x=()=>[$o,"full","auto",...y()],A=()=>[Go,"none","subgrid",aa,Qo],S=()=>["auto",{span:["full",Go,aa,Qo]},Go,aa,Qo],k=()=>[Go,"auto",aa,Qo],T=()=>["auto","min","max","fr",aa,Qo],C=()=>["auto",...y()],N=()=>[$o,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],E=()=>[e,aa,Qo],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ca,na,{position:[aa,Qo]}],M=()=>["auto","cover","contain",la,Xo,{size:[aa,Qo]}],O=()=>[Zo,ia,ea],R=()=>["","none","full",l,aa,Qo],_=()=>["",zo,ia,ea],D=()=>[zo,Zo,ca,na],I=()=>["","none",p,aa,Qo],U=()=>["none",zo,aa,Qo],F=()=>["none",zo,aa,Qo],j=()=>[zo,aa,Qo],L=()=>[$o,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wo],breakpoint:[Wo],color:[Ko],container:[Wo],"drop-shadow":[Wo],ease:["in","out","in-out"],font:[Yo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wo],shadow:[Wo],spacing:["px",zo],text:[Wo],"text-shadow":[Wo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$o,Qo,aa,b]}],container:["container"],columns:[{columns:[zo,Qo,aa,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Go,"auto",aa,Qo]}],basis:[{basis:[$o,"full","auto",s,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[zo,$o,"auto","initial","none",Qo]}],grow:[{grow:["",zo,aa,Qo]}],shrink:[{shrink:["",zo,aa,Qo]}],order:[{order:[Go,"first","last","none",aa,Qo]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",n,ia,ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,aa,ta]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zo,Qo]}],"font-family":[{font:[sa,Qo,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,aa,Qo]}],"line-clamp":[{"line-clamp":[zo,"none",aa,ta]}],leading:[{leading:[a,...y()]}],"list-image":[{"list-image":["none",aa,Qo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",aa,Qo]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[zo,"from-font","auto",aa,ea]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[zo,"auto",aa,Qo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",aa,Qo]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",aa,Qo]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Go,aa,Qo],radial:["",aa,Qo],conic:[Go,aa,Qo]},da,ra]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[zo,aa,Qo]}],"outline-w":[{outline:["",zo,ia,ea]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,ua,oa]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,ua,oa]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[zo,ea]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",f,ua,oa]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[zo,aa,Qo]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[zo]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[aa,Qo]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[zo]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",aa,Qo]}],filter:[{filter:["","none",aa,Qo]}],blur:[{blur:I()}],brightness:[{brightness:[zo,aa,Qo]}],contrast:[{contrast:[zo,aa,Qo]}],"drop-shadow":[{"drop-shadow":["","none",m,ua,oa]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",zo,aa,Qo]}],"hue-rotate":[{"hue-rotate":[zo,aa,Qo]}],invert:[{invert:["",zo,aa,Qo]}],saturate:[{saturate:[zo,aa,Qo]}],sepia:[{sepia:["",zo,aa,Qo]}],"backdrop-filter":[{"backdrop-filter":["","none",aa,Qo]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[zo,aa,Qo]}],"backdrop-contrast":[{"backdrop-contrast":[zo,aa,Qo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",zo,aa,Qo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zo,aa,Qo]}],"backdrop-invert":[{"backdrop-invert":["",zo,aa,Qo]}],"backdrop-opacity":[{"backdrop-opacity":[zo,aa,Qo]}],"backdrop-saturate":[{"backdrop-saturate":[zo,aa,Qo]}],"backdrop-sepia":[{"backdrop-sepia":["",zo,aa,Qo]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",aa,Qo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[zo,"initial",aa,Qo]}],ease:[{ease:["linear","initial",g,aa,Qo]}],delay:[{delay:[zo,aa,Qo]}],animate:[{animate:["none",v,aa,Qo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,aa,Qo]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[aa,Qo,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",aa,Qo]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",aa,Qo]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[zo,ia,ea,ta]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Aa(...e){return xa(ho(e))}function Sa(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ka(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Sa(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Sa(e[t],null)}}}}function Ta(...e){return o.useCallback(ka(...e),e)}function Ca(t){const n=Ea(t),r=o.forwardRef((t,r)=>{const{children:a,...i}=t,s=o.Children.toArray(a),c=s.find(Ma);if(c){const t=c.props.children,a=s.map(e=>e===c?o.Children.count(t)>1?o.Children.only(null):o.isValidElement(t)?t.props.children:null:e);return e.jsx(n,{...i,ref:r,children:o.isValidElement(t)?o.cloneElement(t,void 0,a):null})}return e.jsx(n,{...i,ref:r,children:a})});return r.displayName=t+".Slot",r}var Na=Ca("Slot");function Ea(e){const t=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==o.Fragment&&(a.ref=t?ka(t,e):e),o.cloneElement(n,a)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=e+".SlotClone",t}var Pa=Symbol("radix.slottable");function Ma(e){return o.isValidElement(e)&&"function"==typeof e.type&&"H"in e.type&&e.type.H===Pa}const Oa=e=>"boolean"==typeof e?""+e:0===e?"0":e,Ra=ho,_a=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return Ra(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const i=Oa(t)||Oa(r);return o[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),c=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return Ra(e,i,c,null==n?void 0:n.class,null==n?void 0:n.className)},Da=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ia=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ua=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Fa=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var ja={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const La=t.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:s,...c},l)=>t.createElement("svg",{ref:l,...ja,width:n,height:n,stroke:e,strokeWidth:o?24*+r/+n:r,className:Ua("lucide",a),...!i&&!Fa(c)&&{"aria-hidden":"true"},...c},[...s.map(([e,n])=>t.createElement(e,n)),...Array.isArray(i)?i:[i]])),Ba=(e,n)=>{const r=t.forwardRef(({className:r,...o},a)=>t.createElement(La,{ref:a,iconNode:n,className:Ua("lucide-"+Da(Ia(e)),"lucide-"+e,r),...o}));return r.displayName=Ia(e),r},$a=Ba("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),za=Ba("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Ga=Ba("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Za=Ba("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Wa=Ba("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Ka=Ba("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Va=Ba("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),Ha=Ba("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Ja=Ba("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),qa=Ba("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),Ya=Ba("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),Xa=Ba("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Qa=Ba("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ei=Ba("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ti=Ba("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ni=Ba("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),ri=_a("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),oi=o.forwardRef(({className:t,variant:n,progress:r,size:a,startIcon:i,endIcon:s,asChild:c=!1,...l},d)=>{const u=c?Na:"button",f=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(a);return e.jsxs(u,{disabled:r||l.disabled,className:Aa(ri({variant:n,size:a,withIcon:null!=r||null!=i||null!=s,className:t})),ref:d,...l,children:[r&&e.jsx(Wa,{size:f,className:"animate-spin"}),i&&o.cloneElement(i,{size:f}),l.children,s&&o.cloneElement(s,{size:f})]})});oi.displayName="Button";var ai=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=Ca("Primitive."+n),a=o.forwardRef((t,o)=>{const{asChild:a,...i}=t,s=a?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(s,{...i,ref:o})});return a.displayName="Primitive."+n,{...t,[n]:a}},{}),ii=o.forwardRef((t,n)=>e.jsx(ai.label,{...t,ref:n,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));ii.displayName="Label";var si=ii;const ci=_a("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),li=o.forwardRef(({className:t,...n},r)=>e.jsx(si,{ref:r,className:Aa(ci(),t),...n}));li.displayName=si.displayName;const di=Se,ui=o.createContext({}),fi=({...t})=>e.jsx(ui.Provider,{value:{name:t.name},children:e.jsx(Me,{...t})}),mi=()=>{const e=o.useContext(ui),t=o.useContext(pi),{getFieldState:n,formState:r}=Ae(),a=n(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:i+"-form-item",formDescriptionId:i+"-form-item-description",formMessageId:i+"-form-item-message",...a}},pi=o.createContext({}),hi=o.forwardRef(({className:t,...n},r)=>{const a=o.useId();return e.jsx(pi.Provider,{value:{id:a},children:e.jsx("div",{ref:r,className:Aa("space-y-2",t),...n})})});hi.displayName="FormItem";const bi=o.forwardRef(({className:t,...n},r)=>{const{error:o,formItemId:a}=mi();return e.jsx(li,{ref:r,className:Aa(o&&"text-destructive",t),htmlFor:a,...n})});bi.displayName="FormLabel";const gi=o.forwardRef(({...t},n)=>{const{error:r,formItemId:o,formDescriptionId:a,formMessageId:i}=mi();return e.jsx(Na,{ref:n,id:o,"aria-describedby":r?`${a} ${i}`:""+a,"aria-invalid":!!r,...t})});gi.displayName="FormControl";const vi=o.forwardRef(({className:t,...n},r)=>{const{formDescriptionId:o}=mi();return e.jsx("p",{ref:r,id:o,className:Aa("text-sm text-muted-foreground",t),...n})});vi.displayName="FormDescription";const wi=o.forwardRef(({className:t,children:n,...r},o)=>{const{error:a,formMessageId:i}=mi(),s=a?a?.message+"":n;return s?e.jsx("p",{ref:o,id:i,className:Aa("text-sm font-medium text-destructive",t),...r,children:s}):null});wi.displayName="FormMessage";const yi=o.forwardRef(({className:t,type:n,...r},o)=>e.jsx("input",{type:n,className:Aa("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:o,...r}));function xi({className:t,...n}){return e.jsx("div",{className:Aa("animate-pulse rounded-md bg-primary/10",t),...n})}yi.displayName="Input";let Ai=class{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}async fetchConfig(){const e=await fetch(`${this.serverUrl}/api/${this.version}/beta/config?orgId=${this.orgId}`);if(!e.ok)throw Error("Failed to fetch beta form configuration: "+e.statusText);return e.json()}async submitBetaUser(e){const t=e?.context??{},n=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),r=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),o=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),a=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0),i=await fetch(`${this.serverUrl}/api/${this.version}/beta/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orgId:this.orgId,formData:{...e,country:n,language:r,timezone:o,currency:a}})});if(!i.ok)throw Error("Failed to submit beta user request: "+i.statusText);return i.json()}};const Si=wt("ZodISODateTime",(e,t)=>{ur.init(e,t),Zi.init(e,t)}),ki=wt("ZodISODate",(e,t)=>{fr.init(e,t),Zi.init(e,t)}),Ti=wt("ZodISOTime",(e,t)=>{mr.init(e,t),Zi.init(e,t)}),Ci=wt("ZodISODuration",(e,t)=>{pr.init(e,t),Zi.init(e,t)}),Ni=wt("ZodError",(e,t)=>{Jt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={J:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>o({issues:e}));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)r.J.push(n(t));else{let e=r,o=0;for(;o<t.path.length;){const r=t.path[o];o===t.path.length-1?(e[r]=e[r]||{J:[]},e[r].J.push(n(t))):e[r]=e[r]||{J:[]},e=e[r],o++}}};return o(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,kt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,kt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Ei=Yt(Ni),Pi=Qt(Ni),Mi=tn(Ni),Oi=rn(Ni),Ri=an(Ni),_i=sn(Ni),Di=cn(Ni),Ii=ln(Ni),Ui=dn(Ni),Fi=un(Ni),ji=fn(Ni),Li=mn(Ni),Bi=wt("ZodType",(e,t)=>(Yn.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"V",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{Z:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>Bt(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Ei(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Mi(e,t,n),e.parseAsync=async(t,n)=>Pi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Oi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ri(e,t,n),e.decode=(t,n)=>_i(e,t,n),e.encodeAsync=async(t,n)=>Di(e,t,n),e.decodeAsync=async(t,n)=>Ii(e,t,n),e.safeEncode=(t,n)=>Ui(e,t,n),e.safeDecode=(t,n)=>Fi(e,t,n),e.safeEncodeAsync=async(t,n)=>ji(e,t,n),e.safeDecodeAsync=async(t,n)=>Li(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new Os({type:"custom",check:"custom",fn:t,...$t(n)})}(0,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new Fn({check:"custom",...$t(void 0)});return t.Z.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Vt(e,n.value,t.Z.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t.Z.def.abort),n.issues.push(Vt(r))}},e(n.value,n)));return t}(t)),e.overwrite=t=>e.check(co(t)),e.optional=()=>xs(e),e.nullable=()=>Ss(e),e.nullish=()=>xs(Ss(e)),e.nonoptional=t=>function(e,t){return new Cs({type:"nonoptional",innerType:e,...$t(t)})}(e,t),e.array=()=>new ms({type:"array",element:e,...$t(void 0)}),e.or=t=>function(e){return new bs({type:"union",options:e,...$t(void 0)})}([e,t]),e.and=t=>new gs({type:"intersection",left:e,right:t}),e.transform=t=>Ps(e,new ws({type:"transform",transform:t})),e.default=t=>{return n=t,new ks({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ft(n)}});var n},e.prefault=t=>{return n=t,new Ts({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ft(n)}});var n},e.catch=t=>{return new Ns({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Ps(e,t),e.readonly=()=>new Ms({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return ro.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>ro.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return ro.get(e);const n=e.clone();return ro.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),$i=wt("_ZodString",(e,t)=>{Xn.init(e,t),Bi.init(e,t);const n=e.Z.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new zn({check:"string_format",format:"regex",...$t(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Wn({check:"string_format",format:"includes",...$t(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Kn({check:"string_format",format:"starts_with",...$t(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Vn({check:"string_format",format:"ends_with",...$t(t),suffix:e})}(...t)),e.min=(...t)=>e.check(io(...t)),e.max=(...t)=>e.check(ao(...t)),e.length=(...t)=>e.check(so(...t)),e.nonempty=(...t)=>e.check(io(1,...t)),e.lowercase=t=>e.check(function(e){return new Gn({check:"string_format",format:"lowercase",...$t(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Zn({check:"string_format",format:"uppercase",...$t(e)})}(t)),e.trim=()=>e.check(co(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return co(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(co(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(co(e=>e.toUpperCase()))}),zi=wt("ZodString",(e,t)=>{Xn.init(e,t),$i.init(e,t),e.email=t=>e.check(function(e,t){return new Wi({type:"string",format:"email",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.url=t=>e.check(function(e,t){return new Hi({type:"string",format:"url",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.jwt=t=>e.check(function(e,t){return new ls({type:"string",format:"jwt",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.emoji=t=>e.check(function(e,t){return new Ji({type:"string",format:"emoji",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.guid=t=>e.check(oo(Ki,t)),e.uuid=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.uuidv4=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$t(t)})}(0,t)),e.uuidv6=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$t(t)})}(0,t)),e.uuidv7=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$t(t)})}(0,t)),e.nanoid=t=>e.check(function(e,t){return new qi({type:"string",format:"nanoid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.guid=t=>e.check(oo(Ki,t)),e.cuid=t=>e.check(function(e,t){return new Yi({type:"string",format:"cuid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.cuid2=t=>e.check(function(e,t){return new Xi({type:"string",format:"cuid2",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ulid=t=>e.check(function(e,t){return new Qi({type:"string",format:"ulid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.base64=t=>e.check(function(e,t){return new is({type:"string",format:"base64",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.base64url=t=>e.check(function(e,t){return new ss({type:"string",format:"base64url",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.xid=t=>e.check(function(e,t){return new es({type:"string",format:"xid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ksuid=t=>e.check(function(e,t){return new ts({type:"string",format:"ksuid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ipv4=t=>e.check(function(e,t){return new ns({type:"string",format:"ipv4",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ipv6=t=>e.check(function(e,t){return new rs({type:"string",format:"ipv6",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.cidrv4=t=>e.check(function(e,t){return new os({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.cidrv6=t=>e.check(function(e,t){return new as({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.e164=t=>e.check(function(e,t){return new cs({type:"string",format:"e164",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new Si({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$t(t)})}(0,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new ki({type:"string",format:"date",check:"string_format",...$t(t)})}(0,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new Ti({type:"string",format:"time",check:"string_format",precision:null,...$t(t)})}(0,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new Ci({type:"string",format:"duration",check:"string_format",...$t(t)})}(0,e)}(t))});function Gi(e){return function(e,t){return new zi({type:"string",...$t(t)})}(0,e)}const Zi=wt("ZodStringFormat",(e,t)=>{Qn.init(e,t),$i.init(e,t)}),Wi=wt("ZodEmail",(e,t)=>{nr.init(e,t),Zi.init(e,t)}),Ki=wt("ZodGUID",(e,t)=>{er.init(e,t),Zi.init(e,t)}),Vi=wt("ZodUUID",(e,t)=>{tr.init(e,t),Zi.init(e,t)}),Hi=wt("ZodURL",(e,t)=>{rr.init(e,t),Zi.init(e,t)}),Ji=wt("ZodEmoji",(e,t)=>{or.init(e,t),Zi.init(e,t)}),qi=wt("ZodNanoID",(e,t)=>{ar.init(e,t),Zi.init(e,t)}),Yi=wt("ZodCUID",(e,t)=>{ir.init(e,t),Zi.init(e,t)}),Xi=wt("ZodCUID2",(e,t)=>{sr.init(e,t),Zi.init(e,t)}),Qi=wt("ZodULID",(e,t)=>{cr.init(e,t),Zi.init(e,t)}),es=wt("ZodXID",(e,t)=>{lr.init(e,t),Zi.init(e,t)}),ts=wt("ZodKSUID",(e,t)=>{dr.init(e,t),Zi.init(e,t)}),ns=wt("ZodIPv4",(e,t)=>{hr.init(e,t),Zi.init(e,t)}),rs=wt("ZodIPv6",(e,t)=>{br.init(e,t),Zi.init(e,t)}),os=wt("ZodCIDRv4",(e,t)=>{gr.init(e,t),Zi.init(e,t)}),as=wt("ZodCIDRv6",(e,t)=>{vr.init(e,t),Zi.init(e,t)}),is=wt("ZodBase64",(e,t)=>{yr.init(e,t),Zi.init(e,t)}),ss=wt("ZodBase64URL",(e,t)=>{xr.init(e,t),Zi.init(e,t)}),cs=wt("ZodE164",(e,t)=>{Ar.init(e,t),Zi.init(e,t)}),ls=wt("ZodJWT",(e,t)=>{Sr.init(e,t),Zi.init(e,t)}),ds=wt("ZodUnknown",(e,t)=>{kr.init(e,t),Bi.init(e,t)});function us(){return new ds({type:"unknown"})}const fs=wt("ZodNever",(e,t)=>{Tr.init(e,t),Bi.init(e,t)}),ms=wt("ZodArray",(e,t)=>{Nr.init(e,t),Bi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(io(t,n)),e.nonempty=t=>e.check(io(1,t)),e.max=(t,n)=>e.check(ao(t,n)),e.length=(t,n)=>e.check(so(t,n)),e.unwrap=()=>e.element}),ps=wt("ZodObject",(e,t)=>{Rr.init(e,t),Bi.init(e,t),Pt(e,"shape",()=>t.shape),e.keyof=()=>function(e){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new vs({type:"enum",entries:t,...$t(void 0)})}(Object.keys(e.Z.def.shape)),e.catchall=t=>e.clone({...e.Z.def,catchall:t}),e.passthrough=()=>e.clone({...e.Z.def,catchall:us()}),e.loose=()=>e.clone({...e.Z.def,catchall:us()}),e.strict=()=>e.clone({...e.Z.def,catchall:function(e,t){return new fs({type:"never",...$t(t)})}(0,undefined)}),e.strip=()=>e.clone({...e.Z.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ut(t))throw Error("Invalid input to extend: expected a plain object");const n=e.Z.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Ot(e.Z.def,{get shape(){const n={...e.Z.def.shape,...t};return Mt(this,"shape",n),n},checks:[]});return Bt(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Ut(t))throw Error("Invalid input to safeExtend: expected a plain object");const n={...e.Z.def,get shape(){const n={...e.Z.def.shape,...t};return Mt(this,"shape",n),n},checks:e.Z.def.checks};return Bt(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ot(e.Z.def,{get shape(){const n={...e.Z.def.shape,...t.Z.def.shape};return Mt(this,"shape",n),n},get catchall(){return t.Z.def.catchall},checks:[]});return Bt(e,n)}(e,t),e.pick=t=>function(e,t){const n=e.Z.def;return Bt(e,Ot(e.Z.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Mt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e.Z.def,r=Ot(e.Z.def,{get shape(){const r={...e.Z.def.shape};for(const e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Mt(this,"shape",r),r},checks:[]});return Bt(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Ot(t.Z.def,{get shape(){const r=t.Z.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Mt(this,"shape",o),o},checks:[]});return Bt(t,r)}(ys,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ot(t.Z.def,{get shape(){const r=t.Z.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return Mt(this,"shape",o),o},checks:[]});return Bt(t,r)}(Cs,e,t[0])});function hs(e,t){const n={type:"object",get shape(){var t;return Mt(this,"shape",e?Object.create(Object.getPrototypeOf(t=e),Object.getOwnPropertyDescriptors(t)):{}),this.shape},...$t(t)};return new ps(n)}const bs=wt("ZodUnion",(e,t)=>{Dr.init(e,t),Bi.init(e,t),e.options=t.options}),gs=wt("ZodIntersection",(e,t)=>{Ir.init(e,t),Bi.init(e,t)}),vs=wt("ZodEnum",(e,t)=>{jr.init(e,t),Bi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new vs({...t,checks:[],...$t(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw Error(`Key ${t} not found in enum`);delete o[t]}return new vs({...t,checks:[],...$t(r),entries:o})}}),ws=wt("ZodTransform",(e,t)=>{Lr.init(e,t),Bi.init(e,t),e.Z.parse=(n,r)=>{if("backward"===r.direction)throw new xt(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Vt(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Vt(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}}),ys=wt("ZodOptional",(e,t)=>{$r.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType});function xs(e){return new ys({type:"optional",innerType:e})}const As=wt("ZodNullable",(e,t)=>{zr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType});function Ss(e){return new As({type:"nullable",innerType:e})}const ks=wt("ZodDefault",(e,t)=>{Gr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType,e.removeDefault=e.unwrap}),Ts=wt("ZodPrefault",(e,t)=>{Wr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType}),Cs=wt("ZodNonOptional",(e,t)=>{Kr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType}),Ns=wt("ZodCatch",(e,t)=>{Hr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType,e.removeCatch=e.unwrap}),Es=wt("ZodPipe",(e,t)=>{Jr.init(e,t),Bi.init(e,t),e.in=t.in,e.out=t.out});function Ps(e,t){return new Es({type:"pipe",in:e,out:t})}const Ms=wt("ZodReadonly",(e,t)=>{Yr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType}),Os=wt("ZodCustom",(e,t)=>{Qr.init(e,t),Bi.init(e,t)}),Rs=hs({name:Gi().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s]*$/,"Name can only contain letters and spaces"),email:Gi().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),_s={en:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred"},es:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error"},fr:{nameLabel:"Nom",emailLabel:"Email",submitText:"Soumettre",submittingText:"Soumission...",errorMessage:"Une erreur est survenue"},de:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten"},zh:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"提交中...",errorMessage:"发生错误"},ja:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました"},ko:{nameLabel:"이름",emailLabel:"이메일",submitText:"제출",submittingText:"제출 중...",errorMessage:"오류가 발생했습니다"}};function Ds({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function Is({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function Us(e,t){return function(){return e.apply(t,arguments)}}const{toString:Fs}=Object.prototype,{getPrototypeOf:js}=Object,{iterator:Ls,toStringTag:Bs}=Symbol,$s=(zs=Object.create(null),e=>{const t=Fs.call(e);return zs[t]||(zs[t]=t.slice(8,-1).toLowerCase())});var zs;const Gs=e=>(e=e.toLowerCase(),t=>$s(t)===e),Zs=e=>t=>typeof t===e,{isArray:Ws}=Array,Ks=Zs("undefined");function Vs(e){return null!==e&&!Ks(e)&&null!==e.constructor&&!Ks(e.constructor)&&qs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Hs=Gs("ArrayBuffer"),Js=Zs("string"),qs=Zs("function"),Ys=Zs("number"),Xs=e=>null!==e&&"object"==typeof e,Qs=e=>{if("object"!==$s(e))return!1;const t=js(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Bs in e||Ls in e)},ec=Gs("Date"),tc=Gs("File"),nc=Gs("Blob"),rc=Gs("FileList"),oc=Gs("URLSearchParams"),[ac,ic,sc,cc]=["ReadableStream","Request","Response","Headers"].map(Gs);function lc(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Ws(e))for(r=0,o=e.length;o>r;r++)t.call(null,e[r],r,e);else{if(Vs(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(r=0;a>r;r++)i=o[r],t.call(null,e[i],i,e)}}function dc(e,t){if(Vs(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const uc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fc=e=>!Ks(e)&&e!==uc,mc=(pc="undefined"!=typeof Uint8Array&&js(Uint8Array),e=>pc&&e instanceof pc);var pc;const hc=Gs("HTMLFormElement"),bc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gc=Gs("RegExp"),vc=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lc(n,(n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)}),Object.defineProperties(e,r)},wc=Gs("AsyncFunction"),yc=(xc="function"==typeof setImmediate,Ac=qs(uc.postMessage),xc?setImmediate:Ac?(Sc="axios@"+Math.random(),kc=[],uc.addEventListener("message",({source:e,data:t})=>{e===uc&&t===Sc&&kc.length&&kc.shift()()},!1),e=>{kc.push(e),uc.postMessage(Sc,"*")}):e=>setTimeout(e));var xc,Ac,Sc,kc;const Tc="undefined"!=typeof queueMicrotask?queueMicrotask.bind(uc):"undefined"!=typeof process&&process.nextTick||yc;var Cc={isArray:Ws,isArrayBuffer:Hs,isBuffer:Vs,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||qs(e.append)&&("formdata"===(t=$s(e))||"object"===t&&qs(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Hs(e.buffer),t},isString:Js,isNumber:Ys,isBoolean:e=>!0===e||!1===e,isObject:Xs,isPlainObject:Qs,isEmptyObject:e=>{if(!Xs(e)||Vs(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ac,isRequest:ic,isResponse:sc,isHeaders:cc,isUndefined:Ks,isDate:ec,isFile:tc,isBlob:nc,isRegExp:gc,isFunction:qs,isStream:e=>Xs(e)&&qs(e.pipe),isURLSearchParams:oc,isTypedArray:mc,isFileList:rc,forEach:lc,merge:function e(){const{caseless:t,skipUndefined:n}=fc(this)&&this||{},r={},o=(o,a)=>{const i=t&&dc(r,a)||a;Qs(r[i])&&Qs(o)?r[i]=e(r[i],o):Qs(o)?r[i]=e({},o):Ws(o)?r[i]=o.slice():n&&Ks(o)||(r[i]=o)};for(let e=0,t=arguments.length;t>e;e++)arguments[e]&&lc(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(lc(t,(t,r)=>{n&&qs(t)?e[r]=Us(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==n&&js(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:$s,kindOfTest:Gs,endsWith:(e,t,n)=>{e+="",(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ws(e))return e;let t=e.length;if(!Ys(t))return null;const n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ls]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:hc,hasOwnProperty:bc,hasOwnProp:bc,reduceDescriptors:vc,freezeMethods:e=>{vc(e,(t,n)=>{if(qs(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];qs(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ws(e)?r(e):r((e+"").split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:dc,global:uc,isContextDefined:fc,isSpecCompliantForm:function(e){return!!(e&&qs(e.append)&&"FormData"===e[Bs]&&e[Ls])},toJSONObject:e=>{const t=[,,,,,,,,,,],n=(e,r)=>{if(Xs(e)){if(t.indexOf(e)>=0)return;if(Vs(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Ws(e)?[]:{};return lc(e,(e,t)=>{const a=n(e,r+1);!Ks(a)&&(o[t]=a)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:wc,isThenable:e=>e&&(Xs(e)||qs(e))&&qs(e.then)&&qs(e.catch),setImmediate:yc,asap:Tc,isIterable:e=>null!=e&&qs(e[Ls])};function Nc(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Cc.inherits(Nc,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Cc.toJSONObject(this.config),code:this.code,status:this.status}}});const Ec=Nc.prototype,Pc={};function Mc(e){return Cc.isPlainObject(e)||Cc.isArray(e)}function Oc(e){return Cc.endsWith(e,"[]")?e.slice(0,-2):e}function Rc(e,t,n){return e?e.concat(t).map(function(e,t){return e=Oc(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pc[e]={value:e}}),Object.defineProperties(Nc,Pc),Object.defineProperty(Ec,"isAxiosError",{value:!0}),Nc.from=(e,t,n,r,o,a)=>{const i=Object.create(Ec);Cc.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Nc.call(i,s,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",a&&Object.assign(i,a),i};const _c=Cc.toFlatObject(Cc,{},null,function(e){return/^is[A-Z]/.test(e)});function Dc(e,t,n){if(!Cc.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Cc.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Cc.isUndefined(t[e])})).metaTokens,o=n.visitor||l,a=n.dots,i=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Cc.isSpecCompliantForm(t);if(!Cc.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Cc.isDate(e))return e.toISOString();if(Cc.isBoolean(e))return e.toString();if(!s&&Cc.isBlob(e))throw new Nc("Blob is not supported. Use a Buffer instead.");return Cc.isArrayBuffer(e)||Cc.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Cc.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Cc.isArray(e)&&function(e){return Cc.isArray(e)&&!e.some(Mc)}(e)||(Cc.isFileList(e)||Cc.endsWith(n,"[]"))&&(s=Cc.toArray(e)))return n=Oc(n),s.forEach(function(e,r){!Cc.isUndefined(e)&&null!==e&&t.append(!0===i?Rc([n],r,a):null===i?n:n+"[]",c(e))}),!1;return!!Mc(e)||(t.append(Rc(o,n,a),c(e)),!1)}const d=[],u=Object.assign(_c,{defaultVisitor:l,convertValue:c,isVisitable:Mc});if(!Cc.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Cc.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),Cc.forEach(n,function(n,a){!0===(!(Cc.isUndefined(n)||null===n)&&o.call(t,n,Cc.isString(a)?a.trim():a,r,u))&&e(n,r?r.concat(a):[a])}),d.pop()}}(e),t}function Ic(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Uc(e,t){this.q=[],e&&Dc(e,this,t)}const Fc=Uc.prototype;function jc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Lc(e,t,n){if(!t)return e;const r=n&&n.encode||jc;Cc.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(a=o?o(t,n):Cc.isURLSearchParams(t)?t.toString():new Uc(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Fc.append=function(e,t){this.q.push([e,t])},Fc.toString=function(e){const t=e?function(t){return e.call(this,t,Ic)}:Ic;return this.q.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Bc{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Cc.forEach(this.handlers,function(t){null!==t&&e(t)})}}var $c={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Uc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Gc="undefined"!=typeof window&&"undefined"!=typeof document,Zc="object"==typeof navigator&&navigator||void 0,Wc=Gc&&(!Zc||0>["ReactNative","NativeScript","NS"].indexOf(Zc.product)),Kc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Vc=Gc&&window.location.href||"http://localhost";var Hc={...Object.freeze({__proto__:null,hasBrowserEnv:Gc,hasStandardBrowserEnv:Wc,hasStandardBrowserWebWorkerEnv:Kc,navigator:Zc,origin:Vc}),...zc};function Jc(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;return a=!a&&Cc.isArray(r)?r.length:a,s?(Cc.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i):(r[a]&&Cc.isObject(r[a])||(r[a]=[]),t(e,n,r[a],o)&&Cc.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;o>r;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i)}if(Cc.isFormData(e)&&Cc.isFunction(e.entries)){const n={};return Cc.forEachEntry(e,(e,r)=>{t(function(e){return Cc.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const qc={transitional:$c,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Cc.isObject(e);if(o&&Cc.isHTMLForm(e)&&(e=new FormData(e)),Cc.isFormData(e))return r?JSON.stringify(Jc(e)):e;if(Cc.isArrayBuffer(e)||Cc.isBuffer(e)||Cc.isStream(e)||Cc.isFile(e)||Cc.isBlob(e)||Cc.isReadableStream(e))return e;if(Cc.isArrayBufferView(e))return e.buffer;if(Cc.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Dc(e,new Hc.classes.URLSearchParams,{visitor:function(e,t,n,r){return Hc.isNode&&Cc.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=Cc.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Dc(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(Cc.isString(e))try{return(0,JSON.parse)(e),Cc.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||qc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Cc.isResponse(e)||Cc.isReadableStream(e))return e;if(e&&Cc.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Nc.from(e,Nc.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hc.classes.FormData,Blob:Hc.classes.Blob},validateStatus:function(e){return e>=200&&300>e},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Cc.forEach(["delete","get","head","post","put","patch"],e=>{qc.headers[e]={}});const Yc=Cc.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xc=Symbol("internals");function Qc(e){return e&&(e+"").trim().toLowerCase()}function el(e){return!1===e||null==e?e:Cc.isArray(e)?e.map(el):e+""}function tl(e,t,n,r,o){return Cc.isFunction(r)?r.call(this,t,n):(o&&(t=n),Cc.isString(t)?Cc.isString(r)?-1!==t.indexOf(r):Cc.isRegExp(r)?r.test(t):void 0:void 0)}class nl{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Qc(t);if(!o)throw Error("header name must be a non-empty string");const a=Cc.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=el(e))}const a=(e,t)=>Cc.forEach(e,(e,n)=>o(e,n,t));if(Cc.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Cc.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Yc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Cc.isObject(e)&&Cc.isIterable(e)){let n,r,o={};for(const t of e){if(!Cc.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Cc.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Qc(e)){const n=Cc.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Cc.isFunction(t))return t.call(this,e,n);if(Cc.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Qc(e)){const n=Cc.findKey(this,e);return!(!n||void 0===this[n]||t&&!tl(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Qc(e)){const o=Cc.findKey(n,e);!o||t&&!tl(0,n[o],o,t)||(delete n[o],r=!0)}}return Cc.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!tl(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Cc.forEach(this,(r,o)=>{const a=Cc.findKey(n,o);if(a)return t[a]=el(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):(o+"").trim();i!==o&&delete t[o],t[i]=el(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Cc.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Cc.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Xc]=this[Xc]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Qc(e);t[r]||(function(e,t){const n=Cc.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Cc.isArray(e)?e.forEach(r):r(e),this}}function rl(e,t){const n=this||qc,r=t||n,o=nl.from(r.headers);let a=r.data;return Cc.forEach(e,function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function ol(e){return!(!e||!e.Y)}function al(e,t,n){Nc.call(this,null==e?"canceled":e,Nc.ERR_CANCELED,t,n),this.name="CanceledError"}function il(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Nc("Request failed with status code "+n.status,[Nc.ERR_BAD_REQUEST,Nc.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}nl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Cc.reduceDescriptors(nl.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Cc.freezeMethods(nl),Cc.inherits(al,Nc,{Y:!0});const sl=(e,t,n=3)=>{let r=0;const o=function(e,t){const n=Array(e=e||10),r=Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=r[i];o||(o=c),n[a]=s,r[a]=c;let d=i,u=0;for(;d!==a;)u+=n[d++],d%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),t>c-o)return;const f=l&&c-l;return f?Math.round(1e3*u/f):void 0}}(50,250);return function(n,a){let i,s,c=0,l=1e3/a;const d=(n,a=Date.now())=>{c=a,i=null,s&&(clearTimeout(s),s=null),(n=>{const a=n.loaded,i=n.lengthComputable?n.total:void 0,s=a-r,c=o(s);r=a,e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:c||void 0,estimated:c&&i&&i>=a?(i-a)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-c;l>n?(i=e,s||(s=setTimeout(()=>{s=null,d(i)},l-n))):d(e,t)},()=>i&&d(i)]}(0,n)},cl=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ll=e=>(...t)=>Cc.asap(()=>e(...t));var dl=Hc.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Hc.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Hc.origin),Hc.navigator&&/(msie|trident)/i.test(Hc.navigator.userAgent)):()=>!0,ul=Hc.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];Cc.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Cc.isString(r)&&i.push("path="+r),Cc.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function fl(e,t,n){return!e||/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)&&0!=n?t:function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)}const ml=e=>e instanceof nl?{...e}:e;function pl(e,t){t=t||{};const n={};function r(e,t,n,r){return Cc.isPlainObject(e)&&Cc.isPlainObject(t)?Cc.merge.call({caseless:r},e,t):Cc.isPlainObject(t)?Cc.merge({},t):Cc.isArray(t)?t.slice():t}function o(e,t,n,o){return Cc.isUndefined(t)?Cc.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function a(e,t){if(!Cc.isUndefined(t))return r(void 0,t)}function i(e,t){return Cc.isUndefined(t)?Cc.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>o(ml(e),ml(t),0,!0)};return Cc.forEach(Object.keys({...e,...t}),function(r){const a=c[r]||o,i=a(e[r],t[r],r);Cc.isUndefined(i)&&a!==s||(n[r]=i)}),n}var hl=e=>{const t=pl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:s}=t;if(t.headers=i=nl.from(i),t.url=Lc(fl(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Cc.isFormData(n))if(Hc.hasStandardBrowserEnv||Hc.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Cc.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(Hc.hasStandardBrowserEnv&&(r&&Cc.isFunction(r)&&(r=r(t)),r||!1!==r&&dl(t.url))){const e=o&&a&&ul.read(a);e&&i.set(o,e)}return t},bl="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=hl(e);let o=r.data;const a=nl.from(r.headers).normalize();let i,s,c,l,d,{responseType:u,onUploadProgress:f,onDownloadProgress:m}=r;function p(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let h=new XMLHttpRequest;function b(){if(!h)return;const r=nl.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());il(function(e){t(e),p()},function(e){n(e),p()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout,"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(b)},h.onabort=function(){h&&(n(new Nc("Request aborted",Nc.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const r=new Nc(t&&t.message?t.message:"Network Error",Nc.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||$c;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Nc(t,o.clarifyTimeoutError?Nc.ETIMEDOUT:Nc.ECONNABORTED,e,h)),h=null},void 0===o&&a.setContentType(null),"setRequestHeader"in h&&Cc.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),Cc.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),u&&"json"!==u&&(h.responseType=r.responseType),m&&([c,d]=sl(m,!0),h.addEventListener("progress",c)),f&&h.upload&&([s,l]=sl(f),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{h&&(n(!t||t.type?new al(null,e,h):t),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===Hc.protocols.indexOf(g)?n(new Nc("Unsupported protocol "+g+":",Nc.ERR_BAD_REQUEST,e)):h.send(o||null)})};const gl=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Nc?t:new al(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,o(new Nc(`timeout ${t} of ms exceeded`,Nc.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>Cc.asap(i),s}},vl=function*(e,t){let n=e.byteLength;if(t>n)return void(yield e);let r,o=0;for(;n>o;)r=o+t,yield e.slice(o,r),o=r},wl=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*vl(n,t)}(e,t);let a,i=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=i+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:yl}=Cc,xl=(({Request:e,Response:t})=>({Request:e,Response:t}))(Cc.global),{ReadableStream:Al,TextEncoder:Sl}=Cc.global,kl=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Tl=e=>{e=Cc.merge.call({skipUndefined:!0},xl,e);const{fetch:t,Request:n,Response:r}=e,o=t?yl(t):"function"==typeof fetch,a=yl(n),i=yl(r);if(!o)return!1;const s=o&&yl(Al),c=o&&("function"==typeof Sl?(l=new Sl,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const d=a&&s&&kl(()=>{let e=!1;const t=new n(Hc.origin,{body:new Al,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&s&&kl(()=>Cc.isReadableStream(new r("").body)),f={stream:u&&(e=>e.body)};return o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Nc(`Response type '${e}' is not supported`,Nc.ERR_NOT_SUPPORT,n)})}),async e=>{let{url:o,method:i,data:s,signal:l,cancelToken:m,timeout:p,onDownloadProgress:h,onUploadProgress:b,responseType:g,headers:v,withCredentials:w="same-origin",fetchOptions:y}=hl(e),x=t||fetch;g=g?(g+"").toLowerCase():"text";let A=gl([l,m&&m.toAbortSignal()],p),S=null;const k=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let T;try{if(b&&d&&"get"!==i&&"head"!==i&&0!==(T=await(async(e,t)=>{const r=Cc.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Cc.isBlob(e))return e.size;if(Cc.isSpecCompliantForm(e)){const t=new n(Hc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Cc.isArrayBufferView(e)||Cc.isArrayBuffer(e)?e.byteLength:(Cc.isURLSearchParams(e)&&(e+=""),Cc.isString(e)?(await c(e)).byteLength:void 0)})(t):r})(v,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(Cc.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,n]=cl(T,sl(ll(b)));s=wl(t.body,65536,e,n)}}Cc.isString(w)||(w=w?"include":"omit");const t=a&&"credentials"in n.prototype,l={...y,signal:A,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?w:void 0};S=a&&new n(o,l);let m=await(a?x(S,y):x(o,l));const p=u&&("stream"===g||"response"===g);if(u&&(h||p&&k)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=m[t]});const t=Cc.toFiniteNumber(m.headers.get("content-length")),[n,o]=h&&cl(t,sl(ll(h),!0))||[];m=new r(wl(m.body,65536,n,()=>{o&&o(),k&&k()}),e)}g=g||"text";let C=await f[Cc.findKey(f,g)||"text"](m,e);return!p&&k&&k(),await new Promise((t,n)=>{il(t,n,{data:C,headers:nl.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:S})})}catch(t){if(k&&k(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Nc("Network Error",Nc.ERR_NETWORK,e,S),{cause:t.cause||t});throw Nc.from(t,t&&t.code,e,S)}}},Cl=new Map,Nl=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,a=[r,o,n];let i,s,c=a.length,l=Cl;for(;c--;)i=a[c],s=l.get(i),void 0===s&&l.set(i,s=c?new Map:Tl(t)),l=s;return s};Nl();const El={http:null,xhr:bl,fetch:{get:Nl}};Cc.forEach(El,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Pl=e=>"- "+e,Ml=e=>Cc.isFunction(e)||null===e||!1===e;var Ol=(e,t)=>{e=Cc.isArray(e)?e:[e];const{length:n}=e;let r,o;const a={};for(let i=0;n>i;i++){let n;if(r=e[i],o=r,!Ml(r)&&(o=El[(n=r+"").toLowerCase()],void 0===o))throw new Nc(`Unknown adapter '${n}'`);if(o&&(Cc.isFunction(o)||(o=o.get(t))))break;a[n||"#"+i]=o}if(!o){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Nc("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Pl).join("\n"):" "+Pl(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Rl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new al(null,e)}function _l(e){return Rl(e),e.headers=nl.from(e.headers),e.data=rl.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ol(e.adapter||qc.adapter,e)(e).then(function(t){return Rl(e),t.data=rl.call(e,e.transformResponse,t),t.headers=nl.from(t.headers),t},function(t){return ol(t)||(Rl(e),t&&t.response&&(t.response.data=rl.call(e,e.transformResponse,t.response),t.response.headers=nl.from(t.response.headers))),Promise.reject(t)})}const Dl="1.12.2",Il={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Il[e]=function(n){return typeof n===e||"a"+(1>t?"n ":" ")+e}});const Ul={};Il.transitional=function(e,t,n){return(r,o,a)=>{if(!1===e)throw new Nc(function(e,t){return"[Axios v"+Dl+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}(o," has been removed"+(t?" in "+t:"")),Nc.ERR_DEPRECATED);return t&&!Ul[o]&&(Ul[o]=!0),!e||e(r,o,a)}},Il.spelling=function(e){return(e,t)=>!0};var Fl={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Nc("options must be an object",Nc.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new Nc("option "+a+" must be "+n,Nc.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Nc("Unknown option "+a,Nc.ERR_BAD_OPTION)}},validators:Il};const jl=Fl.validators;class Ll{constructor(e){this.defaults=e||{},this.interceptors={request:new Bc,response:new Bc}}async request(e,t){try{return await this.X(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!(e.stack+"").endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}X(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pl(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Fl.assertOptions(n,{silentJSONParsing:jl.transitional(jl.boolean),forcedJSONParsing:jl.transitional(jl.boolean),clarifyTimeoutError:jl.transitional(jl.boolean)},!1),null!=r&&(Cc.isFunction(r)?t.paramsSerializer={serialize:r}:Fl.assertOptions(r,{encode:jl.function,serialize:jl.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Fl.assertOptions(t,{baseUrl:jl.spelling("baseURL"),withXsrfToken:jl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&Cc.merge(o.common,o[t.method]);o&&Cc.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=nl.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d,u=0;if(!s){const e=[_l.bind(this),void 0];for(e.unshift(...i),e.push(...c),d=e.length,l=Promise.resolve(t);d>u;)l=l.then(e[u++],e[u++]);return l}d=i.length;let f=t;for(;d>u;){const e=i[u++],t=i[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=_l(f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;d>u;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Lc(fl((e=pl(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Cc.forEach(["delete","get","head","options"],function(e){Ll.prototype[e]=function(t,n){return this.request(pl(n||{},{method:e,url:t,data:(n||{}).data}))}}),Cc.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(pl(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ll.prototype[e]=t(),Ll.prototype[e+"Form"]=t(!0)});class Bl{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n.ee)return;let t=n.ee.length;for(;t-- >0;)n.ee[t](e);n.ee=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new al(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this.ee?this.ee.push(e):this.ee=[e]}unsubscribe(e){if(!this.ee)return;const t=this.ee.indexOf(e);-1!==t&&this.ee.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Bl(function(t){e=t}),cancel:e}}}const $l={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($l).forEach(([e,t])=>{$l[t]=e});const zl=function e(t){const n=new Ll(t),r=Us(Ll.prototype.request,n);return Cc.extend(r,Ll.prototype,n,{allOwnKeys:!0}),Cc.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(pl(t,n))},r}(qc);zl.Axios=Ll,zl.CanceledError=al,zl.CancelToken=Bl,zl.isCancel=ol,zl.VERSION=Dl,zl.toFormData=Dc,zl.AxiosError=Nc,zl.Cancel=zl.CanceledError,zl.all=function(e){return Promise.all(e)},zl.spread=function(e){return function(t){return e.apply(null,t)}},zl.isAxiosError=function(e){return Cc.isObject(e)&&!0===e.isAxiosError},zl.mergeConfig=pl,zl.AxiosHeaders=nl,zl.formToJSON=e=>Jc(Cc.isHTMLForm(e)?new FormData(e):e),zl.getAdapter=Ol,zl.HttpStatusCode=$l,zl.default=zl;const Gl=new class{constructor(e={}){this.client=zl.create({baseURL:e.baseURL||"https://api.example.com",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json",...e.headers}}),this.client.interceptors.request.use(e=>{const t=h();return t&&(e.headers["x-session-id"]=t),e},e=>Promise.reject(e))}async get(e,t){const n=await this.client.get(e,t);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async post(e,t,n){const r=await this.client.post(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async put(e,t,n){const r=await this.client.put(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async delete(e,t){const n=await this.client.delete(e,t);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async patch(e,t,n){const r=await this.client.patch(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}setBaseURL(e){this.client.defaults.baseURL=e}setHeader(e,t){this.client.defaults.headers.common[e]=t}removeHeader(e){delete this.client.defaults.headers.common[e]}};class Zl{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){return b()}async getWorkspaces(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{headers:this.getAuthHeader()});if(!e.ok)throw Error("Failed to fetch workspaces");return e.json()}async createWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to create workspace");return t.json()}async updateWorkspace(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!n.ok)throw Error("Failed to update workspace");return n.json()}async deleteWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"DELETE",headers:this.getAuthHeader()});if(!t.ok)throw Error("Failed to delete workspace");return t.json()}async getWorkspaceUsers(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users`,{headers:this.getAuthHeader()});if(!t.ok)throw Error("Failed to fetch workspace users");return t.json()}async addUser(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/add`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!n.ok){const e=await n.json();throw Error(e.message||"Failed to invite member")}return n.json()}async removeUser(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"DELETE",headers:this.getAuthHeader()});if(!n.ok){const e=await n.json();throw Error(e.message||"Failed to remove user")}return n.json()}async updateUser(e,t,n){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(n)});if(!r.ok){const e=await r.json();throw Error(e.message||"Failed to update user")}return r.json()}async getFeatures(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/features`,{headers:this.getAuthHeader()});if(!e.ok)throw Error("Failed to fetch features");return e.json()}async updateFeature(e,t,n){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/features`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify({features:{[t]:n}})});if(!r.ok)throw Error("Failed to update feature");return r.json()}async getWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{headers:this.getAuthHeader()});if(!t.ok)throw Error("Failed to fetch workspace");return t.json()}async getProfile(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{headers:this.getAuthHeader()});if(!e.ok)throw Error("Failed to fetch profile");return e.json()}async updateUserProfile(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to update user profile");return t.json()}}function Wl(t,n=[]){let r=[];const a=()=>{const e=r.map(e=>o.createContext(e));return function(n){const r=n?.[t]||e;return o.useMemo(()=>({["__scope"+t]:{...n,[t]:r}}),[n,r])}};return a.scopeName=t,[function(n,a){const i=o.createContext(a),s=r.length;r=[...r,a];const c=n=>{const{scope:r,children:a,...c}=n,l=r?.[t]?.[s]||i,d=o.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,children:a})};return c.displayName=n+"Provider",[c,function(e,r){const c=r?.[t]?.[s]||i,l=o.useContext(c);if(l)return l;if(void 0!==a)return a;throw Error(`\`${e}\` must be used within \`${n}\``)}]},Kl(a,...n)]}function Kl(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)["__scope"+r]}),{});return o.useMemo(()=>({["__scope"+t.scopeName]:r}),[r])}};return n.scopeName=t.scopeName,n}function Vl(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}var Hl,Jl=globalThis?.document?o.useLayoutEffect:()=>{},ql={exports:{}},Yl={};function Xl(){if(Hl)return Yl;Hl=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,o=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),c=r({inst:{value:n,getSnapshot:t}}),l=c[0].inst,d=c[1];return a(function(){l.value=n,l.getSnapshot=t,s(l)&&d({inst:l})},[e,n,t]),o(function(){return s(l)&&d({inst:l}),e(function(){s(l)&&d({inst:l})})},[e]),i(n),n};return Yl.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,Yl}var Ql,ed,td={};function nd(){return Ql||(Ql=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=t,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,c=!1,l=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,d){c||void 0===n.startTransition||(c=!0);var u=d();if(!l){var f=d();r(u,f)||(l=!0)}var m=(f=o({inst:{value:u,getSnapshot:d}}))[0].inst,p=f[1];return i(function(){m.value=u,m.getSnapshot=d,e(m)&&p({inst:m})},[t,u,d]),a(function(){return e(m)&&p({inst:m}),t(function(){e(m)&&p({inst:m})})},[t]),s(u),u};td.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),td}function rd(){return ed||(ed=1,"production"===process.env.NODE_ENV?ql.exports=Xl():ql.exports=nd()),ql.exports}var od=rd();function ad(){return()=>{}}var id="Avatar",[sd,cd]=Wl(id),[ld,dd]=sd(id),ud=o.forwardRef((t,n)=>{const{te:r,...a}=t,[i,s]=o.useState("idle");return e.jsx(ld,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:e.jsx(ai.span,{...a,ref:n})})});ud.displayName=id;var fd="AvatarImage",md=o.forwardRef((t,n)=>{const{te:r,src:a,onLoadingStatusChange:i=()=>{},...s}=t,c=dd(fd,r),l=function(e,{referrerPolicy:t,crossOrigin:n}){const r=od.useSyncExternalStore(ad,()=>!0,()=>!1),a=o.useRef(null),i=r?(a.current||(a.current=new window.Image),a.current):null,[s,c]=o.useState(()=>bd(i,e));return Jl(()=>{c(bd(i,e))},[i,e]),Jl(()=>{const e=e=>()=>{c(e)};if(!i)return;const r=e("loaded"),o=e("error");return i.addEventListener("load",r),i.addEventListener("error",o),t&&(i.referrerPolicy=t),"string"==typeof n&&(i.crossOrigin=n),()=>{i.removeEventListener("load",r),i.removeEventListener("error",o)}},[i,n,t]),s}(a,s),d=Vl(e=>{i(e),c.onImageLoadingStatusChange(e)});return Jl(()=>{"idle"!==l&&d(l)},[l,d]),"loaded"===l?e.jsx(ai.img,{...s,ref:n,src:a}):null});md.displayName=fd;var pd="AvatarFallback",hd=o.forwardRef((t,n)=>{const{te:r,delayMs:a,...i}=t,s=dd(pd,r),[c,l]=o.useState(void 0===a);return o.useEffect(()=>{if(void 0!==a){const e=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(e)}},[a]),c&&"loaded"!==s.imageLoadingStatus?e.jsx(ai.span,{...i,ref:n}):null});function bd(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}hd.displayName=pd;var gd=ud,vd=md,wd=hd;const yd=o.forwardRef(({className:t,...n},r)=>e.jsx(gd,{ref:r,className:Aa("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n}));yd.displayName=gd.displayName;const xd=o.forwardRef(({className:t,...n},r)=>e.jsx(vd,{ref:r,className:Aa("aspect-square h-full w-full",t),...n}));xd.displayName=vd.displayName;const Ad=o.forwardRef(({className:t,...n},r)=>e.jsx(wd,{ref:r,className:Aa("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n}));function Sd(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}Ad.displayName=wd.displayName;var kd=o.useId||(()=>{}),Td=0;function Cd(e){const[t,n]=o.useState(kd());return Jl(()=>{n(e=>e??Td+++"")},[e]),e||(t?"radix-"+t:"")}var Nd=o.useInsertionEffect||Jl;function Ed({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),i=o.useRef(t);return Nd(()=>{i.current=t},[t]),o.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}({defaultProp:t,onChange:n}),c=void 0!==e,l=c?e:a;{const t=o.useRef(void 0!==e);o.useEffect(()=>{t.current,t.current=c},[c,r])}const d=o.useCallback(t=>{if(c){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[c,e,i,s]);return[l,d]}var Pd,Md="dismissableLayer.update",Od=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rd=o.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...d}=t,u=o.useContext(Od),[f,m]=o.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),b=Ta(n,e=>m(e)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),y=f?g.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,A=y>=w,S=function(e,t=globalThis?.document){const n=Vl(e),r=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Dd("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));A&&!n&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},p),k=function(e,t=globalThis?.document){const n=Vl(e),r=o.useRef(!1);return o.useEffect(()=>{const e=e=>{e.target&&!r.current&&Dd("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},p);return function(e,t=globalThis?.document){const n=Vl(e);o.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),o.useEffect(()=>{if(f)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Pd=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),_d(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Pd)}},[f,p,r,u]),o.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),_d())},[f,u]),o.useEffect(()=>{const e=()=>h({});return document.addEventListener(Md,e),()=>document.removeEventListener(Md,e)},[]),e.jsx(ai.div,{...d,ref:b,style:{pointerEvents:x?A?"auto":"none":void 0,...t.style},onFocusCapture:Sd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:Sd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Sd(t.onPointerDownCapture,S.onPointerDownCapture)})});function _d(){const e=new CustomEvent(Md);document.dispatchEvent(e)}function Dd(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}Rd.displayName="DismissableLayer",o.forwardRef((t,n)=>{const r=o.useContext(Od),a=o.useRef(null),i=Ta(n,a);return o.useEffect(()=>{const e=a.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),e.jsx(ai.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Id="focusScope.autoFocusOnMount",Ud="focusScope.autoFocusOnUnmount",Fd={bubbles:!1,cancelable:!0},jd=o.forwardRef((t,n)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...c}=t,[l,d]=o.useState(null),u=Vl(i),f=Vl(s),m=o.useRef(null),p=Ta(n,e=>d(e)),h=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:zd(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||zd(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&zd(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,l,h.paused]),o.useEffect(()=>{if(l){Gd.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(Id,Fd);l.addEventListener(Id,u),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zd(r,{select:t}),document.activeElement!==n)return}(Ld(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&zd(l))}return()=>{l.removeEventListener(Id,u),setTimeout(()=>{const t=new CustomEvent(Ud,Fd);l.addEventListener(Ud,f),l.dispatchEvent(t),t.defaultPrevented||zd(e??document.body,{select:!0}),l.removeEventListener(Ud,f),Gd.remove(h)},0)}}},[l,u,f,h]);const b=o.useCallback(e=>{if(!r&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=Ld(e);return[Bd(t,e),Bd(t.reverse(),e)]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&zd(a,{select:!0})):(e.preventDefault(),r&&zd(o,{select:!0})):n===t&&e.preventDefault()}},[r,a,h.paused]);return e.jsx(ai.div,{tabIndex:-1,...c,ref:p,onKeyDown:b})});function Ld(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t||0>e.tabIndex?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});for(;n.nextNode();)t.push(n.currentNode);return t}function Bd(e,t){for(const n of e)if(!$d(n,{upTo:t}))return n}function $d(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function zd(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}jd.displayName="FocusScope";var Gd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Zd(e,t),e.unshift(t)},remove(t){e=Zd(e,t),e[0]?.resume()}}}();function Zd(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Wd=o.forwardRef((t,r)=>{const{container:a,...i}=t,[s,c]=o.useState(!1);Jl(()=>c(!0),[]);const l=a||s&&globalThis?.document?.body;return l?n.createPortal(e.jsx(ai.div,{...i,ref:r}),l):null});Wd.displayName="Portal";var Kd=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=o.useState(),r=o.useRef(null),a=o.useRef(e),i=o.useRef("none"),s=e?"mounted":"unmounted",[c,l]=function(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=Vd(r.current);i.current="mounted"===c?e:"none"},[c]),Jl(()=>{const t=r.current,n=a.current;if(n!==e){const r=i.current,o=Vd(t);l(e?"MOUNT":"none"===o||"none"===t?.display?"UNMOUNT":n&&r!==o?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),Jl(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,o=o=>{const i=Vd(r.current).includes(CSS.escape(o.animationName));if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=Vd(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:r.isPresent}):o.Children.only(n),i=Ta(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof n||r.isPresent?o.cloneElement(a,{ref:i}):null};function Vd(e){return e?.animationName||"none"}Kd.displayName="Presence";var Hd=0;function Jd(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qd()),document.body.insertAdjacentElement("beforeend",e[1]??qd()),Hd++,()=>{1===Hd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Hd--}},[])}function qd(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Yd=function(){return Yd=Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Yd.apply(this,arguments)};function Xd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Qd="right-scroll-bar-position",eu="width-before-scroll-bar";function tu(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var nu="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ru=new WeakMap;function ou(e){return e}var au=function(e){var t=e.sideCar,n=Xd(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return o.createElement(r,Yd({},n))};au.isSideCarExport=!0;var iu=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ou);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}();return t.options=Yd({async:!0,ssr:!1},e),t}(),su=function(){},cu=o.forwardRef(function(e,n){var r=o.useRef(null),a=o.useState({onScrollCapture:su,onWheelCapture:su,onTouchMoveCapture:su}),i=a[0],s=a[1],c=e.forwardProps,l=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noRelative,b=e.noIsolation,g=e.inert,v=e.allowPinchZoom,w=e.as,y=void 0===w?"div":w,x=e.gapMode,A=Xd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,k=function(e){var n,r,o=(n=function(t){return e.forEach(function(e){return tu(e,t)})},(r=t.useState(function(){return{value:null,callback:n,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0]).callback=n,r.facade);return nu(function(){var t=ru.get(o);if(t){var n=new Set(t),r=new Set(e),a=o.current;n.forEach(function(e){r.has(e)||tu(e,null)}),r.forEach(function(e){n.has(e)||tu(e,a)})}ru.set(o,e)},[e]),o}([r,n]),T=Yd(Yd({},A),i);return o.createElement(o.Fragment,null,f&&o.createElement(S,{sideCar:iu,removeScrollBar:u,shards:m,noRelative:h,noIsolation:b,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:x}),c?o.cloneElement(o.Children.only(l),Yd(Yd({},T),{ref:k})):o.createElement(y,Yd({},T,{className:d,ref:k}),l))});cu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cu.classNames={fullWidth:eu,zeroRight:Qd};var lu=function(){var e,t,n,r=(t=0,n=null,e={add:function(e){var r,o;0==t&&(n=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}())&&(o=e,(r=n).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(n)),t++},remove:function(){! --t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}},function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var t=e.styles,n=e.dynamic;return r(t,n),null}},du={left:0,top:0,right:0,gap:0},uu=function(e){return parseInt(e||"",10)||0},fu=lu(),mu="data-scroll-locked",pu=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .with-scroll-bars-hidden {\n overflow: hidden ".concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(mu,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Qd," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(eu," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Qd," .").concat(Qd," {\n right: 0 ").concat(r,";\n }\n \n .").concat(eu," .").concat(eu," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(mu,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},hu=function(){var e=parseInt(document.body.getAttribute(mu)||"0",10);return isFinite(e)?e:0},bu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;o.useEffect(function(){return document.body.setAttribute(mu,""+(hu()+1)),function(){var e=hu()-1;e>0?document.body.setAttribute(mu,e.toString()):document.body.removeAttribute(mu)}},[]);var i=o.useMemo(function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return du;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[uu(n),uu(r),uu(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(a)},[a]);return o.createElement(fu,{styles:pu(i,!t,a,n?"":"!important")})},gu=!1;if("undefined"!=typeof window)try{var vu=Object.defineProperty({},"passive",{get:function(){return gu=!0,!0}});window.addEventListener("test",vu,vu),window.removeEventListener("test",vu,vu)}catch(e){gu=!1}var wu=!!gu&&{passive:!1},yu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},xu=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Au(e,r)){var o=Su(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Au=function(e,t){return"v"===e?function(e){return yu(e,"overflowY")}(t):function(e){return yu(e,"overflowX")}(t)},Su=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},ku=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tu=function(e){return[e.deltaX,e.deltaY]},Cu=function(e){return e&&"current"in e?e.current:e},Nu=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Eu=0,Pu=[];function Mu(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ou,Ru=(Ou=function(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),a=o.useState(Eu++)[0],i=o.useState(lu)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;a>o;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Cu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=ku(e),i=n.current,c="deltaX"in e?e.deltaX:i[0]-a[0],l="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var f=xu(u,d);if(!f)return!0;if(f?o=u:(o="v"===u?"h":"v",f=xu(u,d)),!f)return!1;if(!r.current&&"changedTouches"in e&&(c||l)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,s=t.contains(i),c=!1,l=a>0,d=0,u=0;do{if(!i)break;var f=Su(e,i),m=f[0],p=f[1]-f[2]-o*m;(m||p)&&Au(e,i)&&(d+=p,u+=m);var h=i.parentNode;i=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(l&&1>Math.abs(d)||!l&&1>Math.abs(u))&&(c=!0),c}(m,t,e,"h"===m?c:l)},[]),l=o.useCallback(function(e){var n=e;if(Pu.length&&Pu[Pu.length-1]===i){var r="deltaY"in n?Tu(n):ku(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var a=(s.current.shards||[]).map(Cu).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?c(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),d=o.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Mu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=o.useCallback(function(e){n.current=ku(e),r.current=void 0},[]),f=o.useCallback(function(t){d(t.type,Tu(t),t.target,c(t,e.lockRef.current))},[]),m=o.useCallback(function(t){d(t.type,ku(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Pu.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,wu),document.addEventListener("touchmove",l,wu),document.addEventListener("touchstart",u,wu),function(){Pu=Pu.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,wu),document.removeEventListener("touchmove",l,wu),document.removeEventListener("touchstart",u,wu)}},[]);var p=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(i,{styles:Nu(a)}):null,p?o.createElement(bu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},iu.useMedium(Ou),au),_u=o.forwardRef(function(e,t){return o.createElement(cu,Yd({},e,{ref:t,sideCar:Ru}))});_u.classNames=cu.classNames;var Du=new WeakMap,Iu=new WeakMap,Uu={},Fu=0,ju=function(e){return e&&(e.host||ju(e.parentNode))},Lu=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ju(t);return n&&e.contains(n)?n:null}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Uu[n]||(Uu[n]=new WeakMap);var a=Uu[n],i=[],s=new Set,c=new Set(o),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};o.forEach(l);var d=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,c=(Du.get(e)||0)+1,l=(a.get(e)||0)+1;Du.set(e,c),a.set(e,l),i.push(e),1===c&&o&&Iu.set(e,!0),1===l&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(e){}})};return d(t),s.clear(),Fu++,function(){i.forEach(function(e){var t=Du.get(e)-1,o=a.get(e)-1;Du.set(e,t),a.set(e,o),t||(Iu.has(e)||e.removeAttribute(r),Iu.delete(e)),o||e.removeAttribute(n)}),--Fu||(Du=new WeakMap,Du=new WeakMap,Iu=new WeakMap,Uu={})}}(r,o,n,"aria-hidden")):function(){return null}},Bu="Dialog",[$u,zu]=Wl(Bu),[Gu,Zu]=$u(Bu),Wu=t=>{const{ne:n,children:r,open:a,defaultOpen:i,onOpenChange:s,modal:c=!0}=t,l=o.useRef(null),d=o.useRef(null),[u,f]=Ed({prop:a,defaultProp:i??!1,onChange:s,caller:Bu});return e.jsx(Gu,{scope:n,triggerRef:l,contentRef:d,contentId:Cd(),titleId:Cd(),descriptionId:Cd(),open:u,onOpenChange:f,onOpenToggle:o.useCallback(()=>f(e=>!e),[f]),modal:c,children:r})};Wu.displayName=Bu;var Ku="DialogTrigger",Vu=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Zu(Ku,r),i=Ta(n,a.triggerRef);return e.jsx(ai.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":pf(a.open),...o,ref:i,onClick:Sd(t.onClick,a.onOpenToggle)})});Vu.displayName=Ku;var Hu="DialogPortal",[Ju,qu]=$u(Hu,{forceMount:void 0}),Yu=t=>{const{ne:n,forceMount:r,children:a,container:i}=t,s=Zu(Hu,n);return e.jsx(Ju,{scope:n,forceMount:r,children:o.Children.map(a,t=>e.jsx(Kd,{present:r||s.open,children:e.jsx(Wd,{asChild:!0,container:i,children:t})}))})};Yu.displayName=Hu;var Xu="DialogOverlay",Qu=o.forwardRef((t,n)=>{const r=qu(Xu,t.ne),{forceMount:o=r.forceMount,...a}=t,i=Zu(Xu,t.ne);return i.modal?e.jsx(Kd,{present:o||i.open,children:e.jsx(tf,{...a,ref:n})}):null});Qu.displayName=Xu;var ef=Ca("DialogOverlay.RemoveScroll"),tf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Zu(Xu,r);return e.jsx(_u,{as:ef,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(ai.div,{"data-state":pf(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),nf="DialogContent",rf=o.forwardRef((t,n)=>{const r=qu(nf,t.ne),{forceMount:o=r.forceMount,...a}=t,i=Zu(nf,t.ne);return e.jsx(Kd,{present:o||i.open,children:i.modal?e.jsx(of,{...a,ref:n}):e.jsx(af,{...a,ref:n})})});rf.displayName=nf;var of=o.forwardRef((t,n)=>{const r=Zu(nf,t.ne),a=o.useRef(null),i=Ta(n,r.contentRef,a);return o.useEffect(()=>{const e=a.current;if(e)return Lu(e)},[]),e.jsx(sf,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sd(t.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Sd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Sd(t.onFocusOutside,e=>e.preventDefault())})}),af=o.forwardRef((t,n)=>{const r=Zu(nf,t.ne),a=o.useRef(!1),i=o.useRef(!1);return e.jsx(sf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||r.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,o=r.triggerRef.current?.contains(n);o&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),sf=o.forwardRef((t,n)=>{const{ne:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...c}=t,l=Zu(nf,r),d=o.useRef(null),u=Ta(n,d);return Jd(),e.jsxs(e.Fragment,{children:[e.jsx(jd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(Rd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":pf(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(vf,{titleId:l.titleId}),e.jsx(wf,{contentRef:d,descriptionId:l.descriptionId})]})]})}),cf="DialogTitle",lf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Zu(cf,r);return e.jsx(ai.h2,{id:a.titleId,...o,ref:n})});lf.displayName=cf;var df="DialogDescription",uf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Zu(df,r);return e.jsx(ai.p,{id:a.descriptionId,...o,ref:n})});uf.displayName=df;var ff="DialogClose",mf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Zu(ff,r);return e.jsx(ai.button,{type:"button",...o,ref:n,onClick:Sd(t.onClick,()=>a.onOpenChange(!1))})});function pf(e){return e?"open":"closed"}mf.displayName=ff;var hf="DialogTitleWarning",[bf,gf]=function(t,n){const r=o.createContext(n),a=t=>{const{children:n,...a}=t,i=o.useMemo(()=>a,Object.values(a));return e.jsx(r.Provider,{value:i,children:n})};return a.displayName=t+"Provider",[a,function(e){return o.useContext(r)||n}]}(hf,{contentName:nf,titleName:cf,docsSlug:"dialog"}),vf=({titleId:e})=>{const t=gf(hf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return o.useEffect(()=>{e&&document.getElementById(e)},[n,e]),null},wf=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gf("DialogDescriptionWarning").contentName}}.`;return o.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");t&&n&&document.getElementById(t)},[n,e,t]),null},yf=Wu,xf=Vu,Af=Yu,Sf=Qu,kf=rf,Tf=lf,Cf=uf,Nf=mf;function Ef(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0>t.indexOf(n)&&(o[n]=e[n]);return o}var Pf=["color"],Mf=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Ef(e,Pf);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Of=["color"],Rf=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Ef(e,Of);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),_f=["color"],Df=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Ef(e,_f);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),If=["color"],Uf=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Ef(e,If);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});const Ff=yf,jf=xf,Lf=Af,Bf=o.forwardRef(({className:t,...n},r)=>e.jsx(Sf,{ref:r,className:Aa("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n}));Bf.displayName=Sf.displayName;const $f=o.forwardRef(({className:t,children:n,...r},a)=>{const{container:i}=o.useContext(q);return e.jsxs(Lf,{container:i,children:[e.jsx(Bf,{}),e.jsxs(kf,{ref:a,className:Aa("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...r,children:[n,e.jsxs(Nf,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Df,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});$f.displayName=kf.displayName;const zf=({className:t,...n})=>e.jsx("div",{className:Aa("flex flex-col space-y-1.5 text-center sm:text-left",t),...n});zf.displayName="DialogHeader";const Gf=o.forwardRef(({className:t,...n},r)=>e.jsx(Tf,{ref:r,className:Aa("text-lg font-semibold leading-none tracking-tight",t),...n}));Gf.displayName=Tf.displayName;const Zf=o.forwardRef(({className:t,...n},r)=>e.jsx(Cf,{ref:r,className:Aa("text-sm text-muted-foreground",t),...n}));function Wf(n){const r=n+"CollectionProvider",[o,a]=Wl(r),[i,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),c=n=>{const{scope:r,children:o}=n,a=t.useRef(null),s=t.useRef(new Map).current;return e.jsx(i,{scope:r,itemMap:s,collectionRef:a,children:o})};c.displayName=r;const l=n+"CollectionSlot",d=Ca(l),u=t.forwardRef((t,n)=>{const{scope:r,children:o}=t,a=Ta(n,s(l,r).collectionRef);return e.jsx(d,{ref:a,children:o})});u.displayName=l;const f=n+"CollectionItemSlot",m="data-radix-collection-item",p=Ca(f),h=t.forwardRef((n,r)=>{const{scope:o,children:a,...i}=n,c=t.useRef(null),l=Ta(r,c),d=s(f,o);return t.useEffect(()=>(d.itemMap.set(c,{ref:c,...i}),()=>{d.itemMap.delete(c)})),e.jsx(p,{[m]:"",ref:l,children:a})});return h.displayName=f,[{Provider:c,Slot:u,ItemSlot:h},function(e){const r=s(n+"CollectionConsumer",e),o=t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return n},[r.collectionRef,r.itemMap]);return o},a]}Zf.displayName=Cf.displayName;var Kf=o.createContext(void 0);function Vf(e){const t=o.useContext(Kf);return e||t||"ltr"}var Hf="rovingFocusGroup.onEntryFocus",Jf={bubbles:!1,cancelable:!0},qf="RovingFocusGroup",[Yf,Xf,Qf]=Wf(qf),[em,tm]=Wl(qf,[Qf]),[nm,rm]=em(qf),om=o.forwardRef((t,n)=>e.jsx(Yf.Provider,{scope:t.re,children:e.jsx(Yf.Slot,{scope:t.re,children:e.jsx(am,{...t,ref:n})})}));om.displayName=qf;var am=o.forwardRef((t,n)=>{const{re:r,orientation:a,loop:i=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=t,p=o.useRef(null),h=Ta(n,p),b=Vf(s),[g,v]=Ed({prop:c,defaultProp:l??null,onChange:d,caller:qf}),[w,y]=o.useState(!1),x=Vl(u),A=Xf(r),S=o.useRef(!1),[k,T]=o.useState(0);return o.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(Hf,x),()=>e.removeEventListener(Hf,x)},[x]),e.jsx(nm,{scope:r,orientation:a,dir:b,loop:i,currentTabStopId:g,onItemFocus:o.useCallback(e=>v(e),[v]),onItemShiftTab:o.useCallback(()=>y(!0),[]),onFocusableItemAdd:o.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>T(e=>e-1),[]),children:e.jsx(ai.div,{tabIndex:w||0===k?-1:0,"data-orientation":a,...m,ref:h,style:{outline:"none",...t.style},onMouseDown:Sd(t.onMouseDown,()=>{S.current=!0}),onFocus:Sd(t.onFocus,e=>{const t=!S.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(Hf,Jf);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=A().filter(e=>e.focusable);lm([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),f)}}S.current=!1}),onBlur:Sd(t.onBlur,()=>y(!1))})})}),im="RovingFocusGroupItem",sm=o.forwardRef((t,n)=>{const{re:r,focusable:a=!0,active:i=!1,tabStopId:s,children:c,...l}=t,d=Cd(),u=s||d,f=rm(im,r),m=f.currentTabStopId===u,p=Xf(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:g}=f;return o.useEffect(()=>{if(a)return h(),()=>b()},[a,h,b]),e.jsx(Yf.ItemSlot,{scope:r,id:u,focusable:a,active:i,children:e.jsx(ai.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:Sd(t.onMouseDown,e=>{a?f.onItemFocus(u):e.preventDefault()}),onFocus:Sd(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:Sd(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:cm[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const a=o.indexOf(e.currentTarget);o=f.loop?(r=a+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(a+1)}setTimeout(()=>lm(o))}var n,r}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=g}):c})})});sm.displayName=im;var cm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lm(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var dm=om,um=sm;function fm(e){const[t,n]=o.useState(void 0);return Jl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}function mm(e){const t=o.useRef({value:e,previous:e});return o.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var pm="Radio",[hm,bm]=Wl(pm),[gm,vm]=hm(pm),wm=o.forwardRef((t,n)=>{const{oe:r,name:a,checked:i=!1,required:s,disabled:c,value:l="on",onCheck:d,form:u,...f}=t,[m,p]=o.useState(null),h=Ta(n,e=>p(e)),b=o.useRef(!1),g=!m||u||!!m.closest("form");return e.jsxs(gm,{scope:r,checked:i,disabled:c,children:[e.jsx(ai.button,{type:"button",role:"radio","aria-checked":i,"data-state":Sm(i),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:h,onClick:Sd(t.onClick,e=>{i||d?.(),g&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),g&&e.jsx(Am,{control:m,bubbles:!b.current,name:a,value:l,checked:i,required:s,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});wm.displayName=pm;var ym="RadioIndicator",xm=o.forwardRef((t,n)=>{const{oe:r,forceMount:o,...a}=t,i=vm(ym,r);return e.jsx(Kd,{present:o||i.checked,children:e.jsx(ai.span,{"data-state":Sm(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n})})});xm.displayName=ym;var Am=o.forwardRef(({oe:t,control:n,checked:r,bubbles:a=!0,...i},s)=>{const c=o.useRef(null),l=Ta(c,s),d=mm(r),u=fm(n);return o.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==r&&n){const t=new Event("click",{bubbles:a});n.call(e,r),e.dispatchEvent(t)}},[d,r,a]),e.jsx(ai.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Sm(e){return e?"checked":"unchecked"}Am.displayName="RadioBubbleInput";var km=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Tm="RadioGroup",[Cm,Nm]=Wl(Tm,[tm,bm]),Em=tm(),Pm=bm(),[Mm,Om]=Cm(Tm),Rm=o.forwardRef((t,n)=>{const{ae:r,name:o,defaultValue:a,value:i,required:s=!1,disabled:c=!1,orientation:l,dir:d,loop:u=!0,onValueChange:f,...m}=t,p=Em(r),h=Vf(d),[b,g]=Ed({prop:i,defaultProp:a??null,onChange:f,caller:Tm});return e.jsx(Mm,{scope:r,name:o,required:s,disabled:c,value:b,onValueChange:g,children:e.jsx(dm,{asChild:!0,...p,orientation:l,dir:h,loop:u,children:e.jsx(ai.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":c?"":void 0,dir:h,...m,ref:n})})})});Rm.displayName=Tm;var _m="RadioGroupItem",Dm=o.forwardRef((t,n)=>{const{ae:r,disabled:a,...i}=t,s=Om(_m,r),c=s.disabled||a,l=Em(r),d=Pm(r),u=o.useRef(null),f=Ta(n,u),m=s.value===i.value,p=o.useRef(!1);return o.useEffect(()=>{const e=e=>{km.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(um,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(wm,{disabled:c,required:s.required,checked:m,...d,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:Sd(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Sd(i.onFocus,()=>{p.current&&u.current?.click()})})})});Dm.displayName=_m;var Im=o.forwardRef((t,n)=>{const{ae:r,...o}=t,a=Pm(r);return e.jsx(xm,{...a,...o,ref:n})});Im.displayName="RadioGroupIndicator";var Um=Rm,Fm=Dm,jm=Im;const Lm=o.forwardRef(({className:t,...n},r)=>e.jsx(Um,{className:Aa("grid gap-2",t),...n,ref:r}));Lm.displayName=Um.displayName;const Bm=o.forwardRef(({className:t,...n},r)=>e.jsx(Fm,{ref:r,className:Aa("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:e.jsx(jm,{className:"flex items-center justify-center",children:e.jsx(Rf,{className:"h-3.5 w-3.5 fill-primary"})})}));function $m(e,[t,n]){return Math.min(n,Math.max(t,e))}Bm.displayName=Fm.displayName;var zm="ScrollArea",[Gm,Zm]=Wl(zm),[Wm,Km]=Gm(zm),Vm=o.forwardRef((t,n)=>{const{ie:r,type:a="hover",dir:i,scrollHideDelay:s=600,...c}=t,[l,d]=o.useState(null),[u,f]=o.useState(null),[m,p]=o.useState(null),[h,b]=o.useState(null),[g,v]=o.useState(null),[w,y]=o.useState(0),[x,A]=o.useState(0),[S,k]=o.useState(!1),[T,C]=o.useState(!1),N=Ta(n,e=>d(e)),E=Vf(i);return e.jsx(Wm,{scope:r,type:a,dir:E,scrollHideDelay:s,scrollArea:l,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:b,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:v,scrollbarYEnabled:T,onScrollbarYEnabledChange:C,onCornerWidthChange:y,onCornerHeightChange:A,children:e.jsx(ai.div,{dir:E,...c,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Vm.displayName=zm;var Hm="ScrollAreaViewport",Jm=o.forwardRef((t,n)=>{const{ie:r,children:a,nonce:i,...s}=t,c=Km(Hm,r),l=Ta(n,o.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{se:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(ai.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});Jm.displayName=Hm;var qm="ScrollAreaScrollbar",Ym=o.forwardRef((t,n)=>{const{forceMount:r,...a}=t,i=Km(qm,t.ie),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return o.useEffect(()=>(l?s(!0):c(!0),()=>{l?s(!1):c(!1)}),[l,s,c]),"hover"===i.type?e.jsx(Xm,{...a,ref:n,forceMount:r}):"scroll"===i.type?e.jsx(Qm,{...a,ref:n,forceMount:r}):"auto"===i.type?e.jsx(ep,{...a,ref:n,forceMount:r}):"always"===i.type?e.jsx(tp,{...a,ref:n}):null});Ym.displayName=qm;var Xm=o.forwardRef((t,n)=>{const{forceMount:r,...a}=t,i=Km(qm,t.ie),[s,c]=o.useState(!1);return o.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),c(!0)},r=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(Kd,{present:r||s,children:e.jsx(ep,{"data-state":s?"visible":"hidden",...a,ref:n})})}),Qm=o.forwardRef((t,n)=>{const{forceMount:r,...a}=t,i=Km(qm,t.ie),s="horizontal"===t.orientation,c=yp(()=>d("SCROLL_END"),100),[l,d]=(u={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},o.useReducer((e,t)=>u[e][t]??e,"hidden"));var u;return o.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,d]),o.useEffect(()=>{const e=i.viewport,t=s?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(d("SCROLL"),c()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[i.viewport,s,d,c]),e.jsx(Kd,{present:r||"hidden"!==l,children:e.jsx(tp,{"data-state":"hidden"===l?"hidden":"visible",...a,ref:n,onPointerEnter:Sd(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Sd(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),ep=o.forwardRef((t,n)=>{const r=Km(qm,t.ie),{forceMount:a,...i}=t,[s,c]=o.useState(!1),l="horizontal"===t.orientation,d=yp(()=>{if(r.viewport){const e=r.viewport.offsetWidth<r.viewport.scrollWidth,t=r.viewport.offsetHeight<r.viewport.scrollHeight;c(l?e:t)}},10);return xp(r.viewport,d),xp(r.content,d),e.jsx(Kd,{present:a||s,children:e.jsx(tp,{"data-state":s?"visible":"hidden",...i,ref:n})})}),tp=o.forwardRef((t,n)=>{const{orientation:r="vertical",...a}=t,i=Km(qm,t.ie),s=o.useRef(null),c=o.useRef(0),[l,d]=o.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=pp(l.viewport,l.content),f={...a,sizes:l,onSizesChange:d,hasThumb:!(0>=u||u>=1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,n,r="ltr"){const o=hp(n),a=t||o/2,i=o-a,s=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-i,l=n.content-n.viewport;return gp([s,c],"ltr"===r?[0,l]:[-1*l,0])(e)}(e,c.current,l,t)}return"horizontal"===r?e.jsx(np,{...f,ref:n,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=bp(i.viewport.scrollLeft,l,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===r?e.jsx(rp,{...f,ref:n,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=bp(i.viewport.scrollTop,l);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),np=o.forwardRef((t,n)=>{const{sizes:r,onSizesChange:a,...i}=t,s=Km(qm,t.ie),[c,l]=o.useState(),d=o.useRef(null),u=Ta(n,d,s.onScrollbarXChange);return o.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(ip,{"data-orientation":"horizontal",...i,ref:u,sizes:r,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":hp(r)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(r),vp(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:mp(c.paddingLeft),paddingEnd:mp(c.paddingRight)}})}})}),rp=o.forwardRef((t,n)=>{const{sizes:r,onSizesChange:a,...i}=t,s=Km(qm,t.ie),[c,l]=o.useState(),d=o.useRef(null),u=Ta(n,d,s.onScrollbarYChange);return o.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(ip,{"data-orientation":"vertical",...i,ref:u,sizes:r,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":hp(r)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(r),vp(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:mp(c.paddingTop),paddingEnd:mp(c.paddingBottom)}})}})}),[op,ap]=Gm(qm),ip=o.forwardRef((t,n)=>{const{ie:r,sizes:a,hasThumb:i,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=t,h=Km(qm,r),[b,g]=o.useState(null),v=Ta(n,e=>g(e)),w=o.useRef(null),y=o.useRef(""),x=h.viewport,A=a.content-a.viewport,S=Vl(f),k=Vl(d),T=yp(m,10);function C(e){if(w.current){const t=e.clientX-w.current.left,n=e.clientY-w.current.top;u({x:t,y:n})}}return o.useEffect(()=>{const e=e=>{const t=e.target,n=b?.contains(t);n&&S(e,A)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,b,A,S]),o.useEffect(k,[a,k]),xp(b,T),xp(h.content,T),e.jsx(op,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:Vl(s),onThumbPointerUp:Vl(c),onThumbPositionChange:k,onThumbPointerDown:Vl(l),children:e.jsx(ai.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:Sd(t.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),w.current=b.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),C(e))}),onPointerMove:Sd(t.onPointerMove,C),onPointerUp:Sd(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),sp="ScrollAreaThumb",cp=o.forwardRef((t,n)=>{const{forceMount:r,...o}=t,a=ap(sp,t.ie);return e.jsx(Kd,{present:r||a.hasThumb,children:e.jsx(lp,{ref:n,...o})})}),lp=o.forwardRef((t,n)=>{const{ie:r,style:a,...i}=t,s=Km(sp,r),c=ap(sp,r),{onThumbPositionChange:l}=c,d=Ta(n,e=>c.onThumbChange(e)),u=o.useRef(void 0),f=yp(()=>{u.current&&(u.current(),u.current=void 0)},100);return o.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(f(),!u.current){const t=wp(e,l);u.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,f,l]),e.jsx(ai.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Sd(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;c.onThumbPointerDown({x:n,y:r})}),onPointerUp:Sd(t.onPointerUp,c.onThumbPointerUp)})});cp.displayName=sp;var dp="ScrollAreaCorner",up=o.forwardRef((t,n)=>{const r=Km(dp,t.ie),o=!(!r.scrollbarX||!r.scrollbarY);return"scroll"!==r.type&&o?e.jsx(fp,{...t,ref:n}):null});up.displayName=dp;var fp=o.forwardRef((t,n)=>{const{ie:r,...a}=t,i=Km(dp,r),[s,c]=o.useState(0),[l,d]=o.useState(0),u=!(!s||!l);return xp(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),xp(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),u?e.jsx(ai.div,{...a,ref:n,style:{width:s,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function mp(e){return e?parseInt(e,10):0}function pp(e,t){const n=e/t;return isNaN(n)?0:n}function hp(e){const t=pp(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function bp(e,t,n="ltr"){const r=hp(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-r,c=$m(e,"ltr"===n?[0,i]:[-1*i,0]);return gp([0,i],[0,s])(c)}function gp(e,t){return n=>{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*(n-e[0])}}function vp(e,t){return e>0&&t>e}var wp=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=n.left!==a.left,s=n.top!==a.top;(i||s)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function yp(e,t){const n=Vl(e),r=o.useRef(0);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),o.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function xp(e,t){const n=Vl(t);Jl(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Ap=Vm,Sp=Jm,kp=up;const Tp=o.forwardRef(({className:t,children:n,...r},o)=>e.jsxs(Ap,{ref:o,className:Aa("relative overflow-hidden",t),...r,children:[e.jsx(Sp,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(Cp,{}),e.jsx(kp,{})]}));Tp.displayName=Ap.displayName;const Cp=o.forwardRef(({className:t,orientation:n="vertical",...r},o)=>e.jsx(Ym,{ref:o,orientation:n,className:Aa("flex touch-none select-none transition-colors","vertical"===n&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===n&&"h-2.5 border-t border-t-transparent p-[1px]",t),...r,children:e.jsx(cp,{className:Aa("relative rounded-full bg-border","vertical"===n&&"flex-1")})}));Cp.displayName=Ym.displayName;var Np="horizontal",Ep=["horizontal","vertical"],Pp=o.forwardRef((t,n)=>{const{decorative:r,orientation:o=Np,...a}=t,i=function(e){return Ep.includes(e)}(o)?o:Np,s=r?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(ai.div,{"data-orientation":i,...s,...a,ref:n})});Pp.displayName="Separator";var Mp=Pp;const Op=o.forwardRef(({className:t,orientation:n="horizontal",decorative:r=!0,...o},a)=>e.jsx(Mp,{ref:a,decorative:r,orientation:n,className:Aa("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...o}));function Rp(){const e=K(),n=W(e=>e.os),{serverUrl:r,version:o,orgId:a,settings:i}=n,s=t.useRef(!1),c=t.useCallback(async()=>{if(s.current)return i||null;if(i)return i;if(!r||!o||!a)return null;s.current=!0;try{const t=b(),n=await fetch(`${r}/api/${o}/public/${a}/settings`,{headers:t});if(!n.ok)throw Error("Failed to fetch settings");const i=await n.json();return e.os(T(i)),i}catch(e){return null}finally{s.current=!1}},[r,o,a,i,e]);return t.useEffect(()=>{r&&o&&a&&!i&&!s.current&&c()},[r,o,a]),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}Op.displayName=Mp.displayName;var _p="AlertDialog",[Dp,Ip]=Wl(_p,[zu]),Up=zu(),Fp=t=>{const{ce:n,...r}=t,o=Up(n);return e.jsx(yf,{...o,...r,modal:!0})};Fp.displayName=_p;var jp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Up(r);return e.jsx(xf,{...a,...o,ref:n})});jp.displayName="AlertDialogTrigger";var Lp=t=>{const{ce:n,...r}=t,o=Up(n);return e.jsx(Af,{...o,...r})};Lp.displayName="AlertDialogPortal";var Bp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Up(r);return e.jsx(Sf,{...a,...o,ref:n})});Bp.displayName="AlertDialogOverlay";var $p="AlertDialogContent",[zp,Gp]=Dp($p),Zp=function(){const t=({children:t})=>e.jsx(e.Fragment,{children:t});return t.displayName="AlertDialogContent.Slottable",t.H=Pa,t}(),Wp=o.forwardRef((t,n)=>{const{ce:r,children:a,...i}=t,s=Up(r),c=o.useRef(null),l=Ta(n,c),d=o.useRef(null);return e.jsx(bf,{contentName:$p,titleName:Kp,docsSlug:"alert-dialog",children:e.jsx(zp,{scope:r,cancelRef:d,children:e.jsxs(kf,{role:"alertdialog",...s,...i,ref:l,onOpenAutoFocus:Sd(i.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Zp,{children:a}),e.jsx(Qp,{contentRef:c})]})})})});Wp.displayName=$p;var Kp="AlertDialogTitle",Vp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Up(r);return e.jsx(Tf,{...a,...o,ref:n})});Vp.displayName=Kp;var Hp="AlertDialogDescription",Jp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Up(r);return e.jsx(Cf,{...a,...o,ref:n})});Jp.displayName=Hp;var qp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Up(r);return e.jsx(Nf,{...a,...o,ref:n})});qp.displayName="AlertDialogAction";var Yp="AlertDialogCancel",Xp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,{cancelRef:a}=Gp(Yp,r),i=Up(r),s=Ta(n,a);return e.jsx(Nf,{...i,...o,ref:s})});Xp.displayName=Yp;var Qp=({contentRef:e})=>{const t=`\`${$p}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${$p}\` by passing a \`${Hp}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${$p}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return o.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))},[t,e]),null},eh=Bp,th=Wp,nh=qp,rh=Xp,oh=Vp,ah=Jp;const ih=Fp,sh=jp,ch=Lp,lh=o.forwardRef(({className:t,...n},r)=>e.jsx(eh,{className:Aa("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n,ref:r}));lh.displayName=eh.displayName;const dh=o.forwardRef(({className:t,...n},r)=>{const{container:a}=o.useContext(q);return e.jsxs(ch,{container:a,children:[e.jsx(lh,{}),e.jsx(th,{ref:r,className:Aa("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n})]})});dh.displayName=th.displayName;const uh=({className:t,...n})=>e.jsx("div",{className:Aa("flex flex-col space-y-2 text-center sm:text-left",t),...n});uh.displayName="AlertDialogHeader";const fh=({className:t,...n})=>e.jsx("div",{className:Aa("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n});fh.displayName="AlertDialogFooter";const mh=o.forwardRef(({className:t,...n},r)=>e.jsx(oh,{ref:r,className:Aa("text-lg font-semibold",t),...n}));mh.displayName=oh.displayName;const ph=o.forwardRef(({className:t,...n},r)=>e.jsx(ah,{ref:r,className:Aa("text-sm text-muted-foreground",t),...n}));ph.displayName=ah.displayName;const hh=o.forwardRef(({className:t,...n},r)=>e.jsx(nh,{ref:r,className:Aa(ri(),t),...n}));hh.displayName=nh.displayName;const bh=o.forwardRef(({className:t,...n},r)=>e.jsx(rh,{ref:r,className:Aa(ri({variant:"outline"}),"mt-2 sm:mt-0",t),...n}));function gh(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(xi,{className:"h-10 w-full"}),e.jsx(xi,{className:"h-10 w-full"}),e.jsx(xi,{className:"h-10 w-full"})]})}bh.displayName=rh.displayName;const vh=({workspace:n})=>{const[r,o]=t.useState(!1),{deleteWorkspace:a}=qy(),i=W(e=>e.auth.session?.user||null);if(!n)return e.jsx(gh,{});const s=n?.users.find(e=>("object"==typeof e&&null!==e?e.t:e)===i?.id)?.role;return"admin"===s?.toLowerCase()?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Delete Workspace"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Once you delete a workspace, there is no going back. This will permanently delete the workspace ",e.jsx("strong",{children:n.name})," and all of its data, including members, settings, and features."]})]}),e.jsxs(ih,{children:[e.jsx(sh,{asChild:!0,children:e.jsxs(oi,{variant:"destructive",disabled:r,children:[e.jsx(Xa,{className:"h-4 w-4 mr-2"}),"Delete Workspace"]})}),e.jsxs(dh,{children:[e.jsxs(uh,{children:[e.jsx(mh,{children:"Are you absolutely sure?"}),e.jsxs(ph,{children:["This action cannot be undone. This will permanently delete the workspace"," ",e.jsx("strong",{children:n.name})," and all of its data."]})]}),e.jsxs(fh,{children:[e.jsx(bh,{children:"Cancel"}),e.jsx(hh,{onClick:async()=>{o(!0);try{await a(n.t)}catch(e){alert(e instanceof Error?e.message:"Failed to delete workspace")}finally{o(!1)}},disabled:r,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:r?"Deleting...":"Delete Workspace"})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:"Only workspace admins can delete workspaces."})})};var wh="Switch",[yh,xh]=Wl(wh),[Ah,Sh]=yh(wh),kh=o.forwardRef((t,n)=>{const{le:r,name:a,checked:i,defaultChecked:s,required:c,disabled:l,value:d="on",onCheckedChange:u,form:f,...m}=t,[p,h]=o.useState(null),b=Ta(n,e=>h(e)),g=o.useRef(!1),v=!p||f||!!p.closest("form"),[w,y]=Ed({prop:i,defaultProp:s??!1,onChange:u,caller:wh});return e.jsxs(Ah,{scope:r,checked:w,disabled:l,children:[e.jsx(ai.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Eh(w),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:b,onClick:Sd(t.onClick,e=>{y(e=>!e),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),v&&e.jsx(Nh,{control:p,bubbles:!g.current,name:a,value:d,checked:w,required:c,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});kh.displayName=wh;var Th="SwitchThumb",Ch=o.forwardRef((t,n)=>{const{le:r,...o}=t,a=Sh(Th,r);return e.jsx(ai.span,{"data-state":Eh(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:n})});Ch.displayName=Th;var Nh=o.forwardRef(({le:t,control:n,checked:r,bubbles:a=!0,...i},s)=>{const c=o.useRef(null),l=Ta(c,s),d=mm(r),u=fm(n);return o.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==r&&n){const t=new Event("click",{bubbles:a});n.call(e,r),e.dispatchEvent(t)}},[d,r,a]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Eh(e){return e?"checked":"unchecked"}Nh.displayName="SwitchBubbleInput";var Ph=kh,Mh=Ch;const Oh=o.forwardRef(({className:t,...n},r)=>e.jsx(Ph,{className:Aa("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...n,ref:r,children:e.jsx(Mh,{className:Aa("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Oh.displayName=Ph.displayName;const Rh=({workspaceId:n})=>{const[r,o]=t.useState({}),{allFeatures:a,updateFeature:i,getWorkspace:s}=qy(),[c,l]=t.useState(null),d=W(e=>e.auth.session?.user||null);if(t.useEffect(()=>{s(n).then(l)},[n]),!c)return e.jsx(gh,{});const u=c?.users.find(e=>("string"==typeof e?e:e.t)===d?.id)?.role,f="admin"===u?.toLowerCase();return e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!a.length&&e.jsx("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),a.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:a.map(t=>{const n=c?.features?.[t.slug];return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),e.jsx(Oh,{disabled:r[t.slug]||!f,checked:n??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!c)return;o(n=>({...n,[e]:t}));const n=await i(c.t,e,t);l(n),o(t=>({...t,[e]:!1}))}(t.slug,e)})]},t.t)})})]})})};function _h(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e}</text></svg>`}const Dh=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],Ih=({workspace:n})=>{const[r,o]=t.useState(!1),[a,i]=t.useState("emoji"),[s,c]=t.useState(),{updateWorkspace:l}=qy(),d=W(e=>e.auth.session?.user||null),u=mt({resolver:mo(hs({name:Gi().min(2,{message:"Workspace name must be at least 2 characters."}),image:Gi().optional()})),defaultValues:{name:n.name||"",image:n.image||""}});if(!n)return e.jsx(gh,{});const f=n?.users.find(e=>("object"==typeof e&&null!==e?e.t:e)===d?.id)?.role,m="admin"===f?.toLowerCase();return e.jsxs("div",{children:[!m&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e.jsx(di,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(async function(e){o(!0);try{await l(n,e)}catch(e){}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(fi,{control:u.control,name:"name",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Name"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"My Awesome Workspace",...t,disabled:!m})}),e.jsx(wi,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(li,{className:"text-sm font-medium",children:"Icon"}),e.jsx(vi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(Lm,{value:a,disabled:!m,onValueChange:e=>i(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Bm,{value:"emoji",id:"emoji"}),e.jsxs(li,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(qa,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Bm,{value:"url",id:"url"}),e.jsxs(li,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Za,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===a&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[s&&e.jsx("span",{className:"text-2xl",children:s}),!s&&e.jsx("img",{src:u.watch("image")})]})]}),e.jsx(Tp,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Dh.map((t,n)=>e.jsx("button",{type:"button",onClick:()=>(e=>{c(e),u.setValue("image",_h(e))})(t),disabled:!m,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===a&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(fi,{control:u.control,name:"image",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Image URL"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"https://example.com/image.png",...t,disabled:!m})}),e.jsx(vi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(wi,{})]})}),u.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:u.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:m&&e.jsx(oi,{type:"submit",disabled:r,progress:r,children:"Update Workspace"})})]})})]})};var Uh=.999,Fh=/[\\\/_+.#"@\[\(\{&]/,jh=/[\\\/_+.#"@\[\(\{&]/g,Lh=/[\s-]/,Bh=/[\s-]/g;function $h(e,t,n,r,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var c,l,d,u,f=r.charAt(a),m=n.indexOf(f,o),p=0;m>=0;)(c=$h(e,t,n,r,m+1,a+1,i))>p&&(m===o?c*=1:Fh.test(e.charAt(m-1))?(c*=.8,(d=e.slice(o,m-1).match(jh))&&o>0&&(c*=Math.pow(Uh,d.length))):Lh.test(e.charAt(m-1))?(c*=.9,(u=e.slice(o,m-1).match(Bh))&&o>0&&(c*=Math.pow(Uh,u.length))):(c*=.17,o>0&&(c*=Math.pow(Uh,m-o))),e.charAt(m)!==t.charAt(a)&&(c*=.9999)),(.1>c&&n.charAt(m-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(m-1)!==r.charAt(a))&&.1*(l=$h(e,t,n,r,m+1,a+2,i))>c&&(c=.1*l),c>p&&(p=c),m=n.indexOf(f,m+1);return i[s]=p,p}function zh(e){return e.toLowerCase().replace(Bh," ")}function Gh(e,t,n){return $h(e=n&&n.length>0?e+" "+n.join(" "):e,t,zh(e),zh(t),0,0,{})}var Zh='[cmdk-group=""]',Wh='[cmdk-group-items=""]',Kh='[cmdk-item=""]',Vh=Kh+':not([aria-disabled="true"])',Hh="cmdk-item-select",Jh="data-value",qh=(e,t,n)=>Gh(e,t,n),Yh=o.createContext(void 0),Xh=()=>o.useContext(Yh),Qh=o.createContext(void 0),eb=()=>o.useContext(Qh),tb=o.createContext(void 0),nb=o.forwardRef((e,t)=>{let n=bb(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=bb(()=>new Set),a=bb(()=>new Map),i=bb(()=>new Map),s=bb(()=>new Set),c=pb(e),{label:l,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:h,disablePointerSelection:b=!1,vimBindings:g=!0,...v}=e,w=Cd(),y=Cd(),x=Cd(),A=o.useRef(null),S=wb();hb(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,k.emit()}},[u]),hb(()=>{S(6,M)},[]);let k=o.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)P(),N(),S(1,E);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(o=document.getElementById(w))||o.focus()}if(S(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,k.emit()}),r||S(5,M),void 0!==(null==(a=c.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=c.current).onValueChange)||s.call(i,e))}}k.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=o.useMemo(()=>({value:(e,t,r)=>{var o;t!==(null==(o=i.current.get(e))?void 0:o.value)&&(i.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,C(t,r)),S(2,()=>{N(),k.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),S(3,()=>{P(),N(),n.current.value||E(),k.emit()}),()=>{i.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&E(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:w,inputId:x,labelId:y,listInnerRef:A}),[]);function C(e,t){var r,o;let a=null!=(o=null==(r=c.current)?void 0:r.filter)?o:qh;return e?a(e,n.current.search,t):0}function N(){if(!n.current.search||!1===c.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n),o=0;r.forEach(t=>{let n=e.get(t);o=Math.max(n,o)}),t.push([n,o])});let r=A.current;R().sort((t,n)=>{var r,o;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(r=e.get(i))?r:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(Wh);t?t.appendChild(e.parentElement===t?e:e.closest(Wh+" > *")):r.appendChild(e.parentElement===r?e:e.closest(Wh+" > *"))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=A.current)?void 0:t.querySelector(`${Zh}[${Jh}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function E(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Jh);k.setState("value",t||void 0)}function P(){var e,t,o,s;if(!n.current.search||!1===c.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let l=0;for(let a of r.current){let r=C(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(o=i.current.get(a))?void 0:o.keywords)?s:[]);n.current.filtered.items.set(a,r),r>0&&l++}for(let[e,t]of a.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=l}function M(){var e,t,n;let r=O();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(Zh))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=A.current)?void 0:e.querySelector(Kh+'[aria-selected="true"]')}function R(){var e;return Array.from((null==(e=A.current)?void 0:e.querySelectorAll(Vh))||[])}function _(e){let t=R()[e];t&&k.setState("value",t.getAttribute(Jh))}function D(e){var t;let n=O(),r=R(),o=r.findIndex(e=>e===n),a=r[o+e];null!=(t=c.current)&&t.loop&&(a=0>o+e?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),a&&k.setState("value",a.getAttribute(Jh))}function I(e){let t,n=O(),r=null==n?void 0:n.closest(Zh);for(;r&&!t;)r=e>0?fb(r,Zh):mb(r,Zh),t=null==r?void 0:r.querySelector(Vh);t?k.setState("value",t.getAttribute(Jh)):D(e)}let U=()=>_(R().length-1),F=e=>{e.preventDefault(),e.metaKey?U():e.altKey?I(1):D(1)},j=e=>{e.preventDefault(),e.metaKey?_(0):e.altKey?I(-1):D(-1)};return o.createElement(ai.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&j(e);break;case"ArrowUp":j(e);break;case"Home":e.preventDefault(),_(0);break;case"End":e.preventDefault(),U();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(Hh);t.dispatchEvent(e)}}}}},o.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:xb},l),yb(e,e=>o.createElement(Qh.Provider,{value:k},o.createElement(Yh.Provider,{value:T},e))))}),rb=o.forwardRef((e,t)=>{var n,r;let a=Cd(),i=o.useRef(null),s=o.useContext(tb),c=Xh(),l=pb(e),d=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==s?void 0:s.forceMount;hb(()=>{if(!d)return c.item(a,null==s?void 0:s.id)},[d]);let u=vb(a,i,[e.value,e.children,i],e.keywords),f=eb(),m=gb(e=>e.value&&e.value===u.current),p=gb(e=>!(!d&&!1!==c.filter())||!e.search||e.filtered.items.get(a)>0);function h(){var e,t;b(),null==(t=(e=l.current).onSelect)||t.call(e,u.current)}function b(){f.setState("value",u.current,!0)}if(o.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(Hh,h),()=>t.removeEventListener(Hh,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:v,onSelect:w,forceMount:y,keywords:x,...A}=e;return o.createElement(ai.div,{ref:ka(i,t),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||c.getDisablePointerSelection()?void 0:b,onClick:g?void 0:h},e.children)}),ob=o.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,s=Cd(),c=o.useRef(null),l=o.useRef(null),d=Cd(),u=Xh(),f=gb(e=>!(!a&&!1!==u.filter())||!e.search||e.filtered.groups.has(s));hb(()=>u.group(s),[]),vb(s,c,[e.value,e.heading,l]);let m=o.useMemo(()=>({id:s,forceMount:a}),[a]);return o.createElement(ai.div,{ref:ka(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&o.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),yb(e,e=>o.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},o.createElement(tb.Provider,{value:m},e))))}),ab=o.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=o.useRef(null),i=gb(e=>!e.search);return n||i?o.createElement(ai.div,{ref:ka(a,t),...r,"cmdk-separator":"",role:"separator"}):null}),ib=o.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=null!=e.value,i=eb(),s=gb(e=>e.search),c=gb(e=>e.selectedItemId),l=Xh();return o.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),o.createElement(ai.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),sb=o.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=o.useRef(null),s=o.useRef(null),c=gb(e=>e.selectedItemId),l=Xh();return o.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,n=i.current,r=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}},[]),o.createElement(ai.div,{ref:ka(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},yb(e,e=>o.createElement("div",{ref:ka(s,l.listInnerRef),"cmdk-list-sizer":""},e)))}),cb=o.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...c}=e;return o.createElement(yf,{open:n,onOpenChange:r},o.createElement(Af,{container:s},o.createElement(Sf,{"cmdk-overlay":"",className:a}),o.createElement(kf,{"aria-label":e.label,"cmdk-dialog":"",className:i},o.createElement(nb,{ref:t,...c}))))}),lb=o.forwardRef((e,t)=>gb(e=>0===e.filtered.count)?o.createElement(ai.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),db=o.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return o.createElement(ai.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},yb(e,e=>o.createElement("div",{"aria-hidden":!0},e)))}),ub=Object.assign(nb,{List:sb,Item:rb,Input:ib,Group:ob,Separator:ab,Dialog:cb,Empty:lb,Loading:db});function fb(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function mb(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pb(e){let t=o.useRef(e);return hb(()=>{t.current=e}),t}var hb="undefined"==typeof window?o.useEffect:o.useLayoutEffect;function bb(e){let t=o.useRef();return void 0===t.current&&(t.current=e()),t}function gb(e){let t=eb(),n=()=>e(t.snapshot());return o.useSyncExternalStore(t.subscribe,n,n)}function vb(e,t,n,r=[]){let a=o.useRef(),i=Xh();return hb(()=>{var o;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),c=r.map(e=>e.trim());i.value(e,s,c),null==(o=t.current)||o.setAttribute(Jh,s),a.current=s}),a}var wb=()=>{let[e,t]=o.useState(),n=bb(()=>new Map);return hb(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function yb({asChild:e,children:t},n){return e&&o.isValidElement(t)?o.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var xb={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ab=o.forwardRef(({className:t,...n},r)=>e.jsx(ub,{ref:r,className:Aa("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));Ab.displayName=ub.displayName;const Sb=o.forwardRef(({className:t,...n},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(Uf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(ub.Input,{ref:r,className:Aa("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...n})]}));Sb.displayName=ub.Input.displayName;const kb=o.forwardRef(({className:t,...n},r)=>e.jsx(ub.List,{ref:r,className:Aa("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...n}));kb.displayName=ub.List.displayName,o.forwardRef((t,n)=>e.jsx(ub.Empty,{ref:n,className:"py-6 text-center text-sm",...t})).displayName=ub.Empty.displayName;const Tb=o.forwardRef(({className:t,...n},r)=>e.jsx(ub.Group,{ref:r,className:Aa("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n}));Tb.displayName=ub.Group.displayName,o.forwardRef(({className:t,...n},r)=>e.jsx(ub.Separator,{ref:r,className:Aa("-mx-1 h-px bg-border",t),...n})).displayName=ub.Separator.displayName;const Cb=o.forwardRef(({className:t,...n},r)=>e.jsx(ub.Item,{ref:r,className:Aa("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n}));Cb.displayName=ub.Item.displayName;const Nb=["top","right","bottom","left"],Eb=Math.min,Pb=Math.max,Mb=Math.round,Ob=Math.floor,Rb=e=>({x:e,y:e}),_b={left:"right",right:"left",bottom:"top",top:"bottom"},Db={start:"end",end:"start"};function Ib(e,t,n){return Pb(e,Eb(t,n))}function Ub(e,t){return"function"==typeof e?e(t):e}function Fb(e){return e.split("-")[0]}function jb(e){return e.split("-")[1]}function Lb(e){return"x"===e?"y":"x"}function Bb(e){return"y"===e?"height":"width"}const $b=new Set(["top","bottom"]);function zb(e){return $b.has(Fb(e))?"y":"x"}function Gb(e){return Lb(zb(e))}function Zb(e){return e.replace(/start|end/g,e=>Db[e])}const Wb=["left","right"],Kb=["right","left"],Vb=["top","bottom"],Hb=["bottom","top"];function Jb(e){return e.replace(/left|right|bottom|top/g,e=>_b[e])}function qb(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Yb(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Xb(e,t,n){let{reference:r,floating:o}=e;const a=zb(t),i=Gb(t),s=Bb(i),c=Fb(t),l="y"===a,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-o.width,y:u};break;default:m={x:r.x,y:r.y}}switch(jb(t)){case"start":m[i]-=f*(n&&l?-1:1);break;case"end":m[i]+=f*(n&&l?-1:1)}return m}async function Qb(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Ub(t,e),p=qb(m),h=s[f?"floating"===u?"reference":"floating":u],b=Yb(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),g="floating"===u?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),w=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},y=Yb(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:c}):g);return{top:(b.top-y.top+p.top)/w.y,bottom:(y.bottom-b.bottom+p.bottom)/w.y,left:(b.left-y.left+p.left)/w.x,right:(y.right-b.right+p.right)/w.x}}function eg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tg(e){return Nb.some(t=>e[t]>=0)}const ng=new Set(["left","top"]);function rg(){return"undefined"!=typeof window}function og(e){return sg(e)?(e.nodeName||"").toLowerCase():"#document"}function ag(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ig(e){var t;return null==(t=(sg(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function sg(e){return!!rg()&&(e instanceof Node||e instanceof ag(e).Node)}function cg(e){return!!rg()&&(e instanceof Element||e instanceof ag(e).Element)}function lg(e){return!!rg()&&(e instanceof HTMLElement||e instanceof ag(e).HTMLElement)}function dg(e){return!(!rg()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ag(e).ShadowRoot)}const ug=new Set(["inline","contents"]);function fg(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ug.has(o)}const mg=new Set(["table","td","th"]);function pg(e){return mg.has(og(e))}const hg=[":popover-open",":modal"];function bg(e){return hg.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const gg=["transform","translate","scale","rotate","perspective"],vg=["transform","translate","scale","rotate","perspective","filter"],wg=["paint","layout","strict","content"];function yg(e){const t=xg(),n=cg(e)?kg(e):e;return gg.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||vg.some(e=>(n.willChange||"").includes(e))||wg.some(e=>(n.contain||"").includes(e))}function xg(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ag=new Set(["html","body","#document"]);function Sg(e){return Ag.has(og(e))}function kg(e){return ag(e).getComputedStyle(e)}function Tg(e){return cg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Cg(e){if("html"===og(e))return e;const t=e.assignedSlot||e.parentNode||dg(e)&&e.host||ig(e);return dg(t)?t.host:t}function Ng(e){const t=Cg(e);return Sg(t)?e.ownerDocument?e.ownerDocument.body:e.body:lg(t)&&fg(t)?t:Ng(t)}function Eg(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ng(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=ag(o);if(a){const e=Pg(i);return t.concat(i,i.visualViewport||[],fg(o)?o:[],e&&n?Eg(e):[])}return t.concat(o,Eg(o,[],n))}function Pg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mg(e){const t=kg(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lg(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=Mb(n)!==a||Mb(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Og(e){return cg(e)?e:e.contextElement}function Rg(e){const t=Og(e);if(!lg(t))return Rb(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Mg(t);let i=(a?Mb(n.width):n.width)/r,s=(a?Mb(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const _g=Rb(0);function Dg(e){const t=ag(e);return xg()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_g}function Ig(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=Og(e);let i=Rb(1);t&&(r?cg(r)&&(i=Rg(r)):i=Rg(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ag(e))&&t}(a,n,r)?Dg(a):Rb(0);let c=(o.left+s.x)/i.x,l=(o.top+s.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const e=ag(a),t=r&&cg(r)?ag(r):r;let n=e,o=Pg(n);for(;o&&r&&t!==n;){const e=Rg(o),t=o.getBoundingClientRect(),r=kg(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,d*=e.x,u*=e.y,c+=a,l+=i,n=ag(o),o=Pg(n)}}return Yb({width:d,height:u,x:c,y:l})}function Ug(e,t){const n=Tg(e).scrollLeft;return t?t.left+n:Ig(ig(e)).left+n}function Fg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ug(e,n),y:n.top+t.scrollTop}}const jg=new Set(["absolute","fixed"]);function Lg(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ag(e),r=ig(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;const e=xg();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=Ug(r);if(l>0)l>25||(a+=l);else{const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i>25||(a-=i)}return{width:a,height:i,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=ig(e),n=Tg(e),r=e.ownerDocument.body,o=Pb(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Pb(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ug(e);const s=-n.scrollTop;return"rtl"===kg(r).direction&&(i+=Pb(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(ig(e));else if(cg(t))r=function(e,t){const n=Ig(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=lg(e)?Rg(e):Rb(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=Dg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yb(r)}function Bg(e,t){const n=Cg(e);return!(n===t||!cg(n)||Sg(n))&&("fixed"===kg(n).position||Bg(n,t))}function $g(e,t,n){const r=lg(t),o=ig(t),a="fixed"===n,i=Ig(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const c=Rb(0);function l(){c.x=Ug(o)}if(r||!r&&!a)if(("body"!==og(t)||fg(o))&&(s=Tg(t)),r){const e=Ig(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();a&&!r&&o&&l();const d=!o||r||a?Rb(0):Fg(o,s);return{x:i.left+s.scrollLeft-c.x-d.x,y:i.top+s.scrollTop-c.y-d.y,width:i.width,height:i.height}}function zg(e){return"static"===kg(e).position}function Gg(e,t){if(!lg(e)||"fixed"===kg(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ig(e)===n&&(n=n.ownerDocument.body),n}function Zg(e,t){const n=ag(e);if(bg(e))return n;if(!lg(e)){let t=Cg(e);for(;t&&!Sg(t);){if(cg(t)&&!zg(t))return t;t=Cg(t)}return n}let r=Gg(e,t);for(;r&&pg(r)&&zg(r);)r=Gg(r,t);return r&&Sg(r)&&zg(r)&&!yg(r)?n:r||function(e){let t=Cg(e);for(;lg(t)&&!Sg(t);){if(yg(t))return t;if(bg(t))return null;t=Cg(t)}return null}(e)||n}const Wg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=ig(r),s=!!t&&bg(t.floating);if(r===i||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Rb(1);const d=Rb(0),u=lg(r);if((u||!u&&!a)&&(("body"!==og(r)||fg(i))&&(c=Tg(r)),lg(r))){const e=Ig(r);l=Rg(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!i||u||a?Rb(0):Fg(i,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+f.x,y:n.y*l.y-c.scrollTop*l.y+d.y+f.y}},getDocumentElement:ig,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a="clippingAncestors"===n?bg(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Eg(e,[],!1).filter(e=>cg(e)&&"body"!==og(e)),o=null;const a="fixed"===kg(e).position;let i=a?Cg(e):e;for(;cg(i)&&!Sg(i);){const t=kg(i),n=yg(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&jg.has(o.position)||fg(i)&&!n&&Bg(e,i))?r=r.filter(e=>e!==i):o=t,i=Cg(i)}return t.set(e,r),r}(t,this.ue):[].concat(n),i=[...a,r],s=i[0],c=i.reduce((e,n)=>{const r=Lg(t,n,o);return e.top=Pb(r.top,e.top),e.right=Eb(r.right,e.right),e.bottom=Eb(r.bottom,e.bottom),e.left=Pb(r.left,e.left),e},Lg(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Zg,getElementRects:async function(e){const t=this.getOffsetParent||Zg,n=this.getDimensions,r=await n(e.floating);return{reference:$g(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Mg(e);return{width:t,height:n}},getScale:Rg,isElement:cg,isRTL:function(e){return"rtl"===kg(e).direction}};function Kg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const Vg=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Fb(n),s=jb(n),c="y"===zb(n),l=ng.has(i)?-1:1,d=a&&c?-1:1,u=Ub(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof p&&(m="end"===s?-1*p:p),c?{x:m*d,y:f*l}:{x:f*l,y:m*d}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Hg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Ub(e,t),l={x:n,y:r},d=await Qb(t,c),u=zb(Fb(o)),f=Lb(u);let m=l[f],p=l[u];if(a){const e="y"===f?"bottom":"right";m=Ib(m+d["y"===f?"top":"left"],m,m-d[e])}if(i){const e="y"===u?"bottom":"right";p=Ib(p+d["y"===u?"top":"left"],p,p-d[e])}const h=s.fn({...t,[f]:m,[u]:p});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[u]:i}}}}}},Jg=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...b}=Ub(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const g=Fb(o),v=zb(s),w=Fb(s)===s,y=await(null==c.isRTL?void 0:c.isRTL(l.floating)),x=f||(w||!h?[Jb(s)]:function(e){const t=Jb(e);return[Zb(e),t,Zb(t)]}(s)),A="none"!==p;!f&&A&&x.push(...function(e,t,n,r){const o=jb(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Kb:Wb:t?Wb:Kb;case"left":case"right":return t?Vb:Hb;default:return[]}}(Fb(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Zb)))),a}(s,h,p,y));const S=[s,...x],k=await Qb(t,b),T=[];let C=(null==(r=a.flip)?void 0:r.overflows)||[];if(d&&T.push(k[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=jb(e),o=Gb(e),a=Bb(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Jb(i)),[i,Jb(i)]}(o,i,y);T.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:T}],!T.every(e=>0>=e)){var N,E;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t&&("alignment"!==u||v===zb(t)||C.every(e=>zb(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(E=C.filter(e=>0>=e.overflows[0]).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:E.placement;if(!n)switch(m){case"bestFit":{var P;const e=null==(P=C.filter(e=>{if(A){const t=zb(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},qg=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:c=()=>{},...l}=Ub(e,t),d=await Qb(t,l),u=Fb(o),f=jb(o),m="y"===zb(o),{width:p,height:h}=a.floating;let b,g;"top"===u||"bottom"===u?(b=u,g=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,b="end"===f?"top":"bottom");const v=h-d.top-d.bottom,w=p-d.left-d.right,y=Eb(h-d[b],v),x=Eb(p-d[g],w),A=!t.middlewareData.shift;let S=y,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=v),A&&!f){const e=Pb(d.left,0),t=Pb(d.right,0),n=Pb(d.top,0),r=Pb(d.bottom,0);m?k=p-2*(0!==e||0!==t?e+t:Pb(d.left,d.right)):S=h-2*(0!==n||0!==r?n+r:Pb(d.top,d.bottom))}await c({...t,availableWidth:k,availableHeight:S});const T=await i.getDimensions(s.floating);return p!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}},Yg=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ub(e,t);switch(r){case"referenceHidden":{const e=eg(await Qb(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tg(e)}}}case"escaped":{const e=eg(await Qb(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:tg(e)}}}default:return{}}}}},Xg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=t,{element:l,padding:d=0}=Ub(e,t)||{};if(null==l)return{};const u=qb(d),f={x:n,y:r},m=Gb(o),p=Bb(m),h=await i.getDimensions(l),b="y"===m,g=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",y=a.reference[p]+a.reference[m]-f[m]-a.floating[p],x=f[m]-a.reference[m],A=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let S=A?A[w]:0;S&&await(null==i.isElement?void 0:i.isElement(A))||(S=s.floating[w]||a.floating[p]);const k=y/2-x/2,T=S/2-h[p]/2-1,C=Eb(u[g],T),N=Eb(u[v],T),E=C,P=S-h[p]-N,M=S/2-h[p]/2+k,O=Ib(E,M,P),R=!c.arrow&&null!=jb(o)&&M!==O&&0>a.reference[p]/2-(E>M?C:N)-h[p]/2,_=R?E>M?M-E:M-P:0;return{[m]:f[m]+_,data:{[m]:O,centerOffset:M-O-_,...R&&{alignmentOffset:_}},reset:R}}}),Qg=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ub(e,t),d={x:n,y:r},u=zb(o),f=Lb(u);let m=d[f],p=d[u];const h=Ub(s,t),b="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+b.mainAxis,n=a.reference[f]+a.reference[e]-b.mainAxis;t>m?m=t:m>n&&(m=n)}if(l){var g,v;const e="y"===f?"width":"height",t=ng.has(Fb(o)),n=a.reference[u]-a.floating[e]+(t&&(null==(g=i.offset)?void 0:g[u])||0)+(t?0:b.crossAxis),r=a.reference[u]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[u])||0)-(t?b.crossAxis:0);n>p?p=n:p>r&&(p=r)}return{[f]:m,[u]:p}}}},ev=(e,t,n)=>{const r=new Map,o={platform:Wg,...n},a={...o.platform,ue:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Xb(l,r,c),f=r,m={},p=0;for(let n=0;n<s.length;n++){const{name:a,fn:h}=s[n],{x:b,y:g,data:v,reset:w}=await h({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:l,platform:i,elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=g?g:u,m={...m,[a]:{...m[a],...v}},w&&50>=p&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(l=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:d,y:u}=Xb(l,f,c))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:m}})(e,t,{...o,platform:a})};var tv="undefined"!=typeof document?t.useLayoutEffect:function(){};function nv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!nv(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||nv(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function rv(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ov(e,t){const n=rv(e);return Math.round(t*n)/n}function av(e){const t=o.useRef(e);return tv(()=>{t.current=e}),t}const iv=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Xg({element:n.current,padding:r}).fn(t):{}:n?Xg({element:n,padding:r}).fn(t):{};var o}}),sv=(e,t)=>({...Vg(e),options:[e,t]}),cv=(e,t)=>({...Hg(e),options:[e,t]}),lv=(e,t)=>({...Qg(e),options:[e,t]}),dv=(e,t)=>({...Jg(e),options:[e,t]}),uv=(e,t)=>({...qg(e),options:[e,t]}),fv=(e,t)=>({...Yg(e),options:[e,t]}),mv=(e,t)=>({...iv(e),options:[e,t]});var pv=o.forwardRef((t,n)=>{const{children:r,width:o=10,height:a=5,...i}=t;return e.jsx(ai.svg,{...i,ref:n,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});pv.displayName="Arrow";var hv=pv,bv="Popper",[gv,vv]=Wl(bv),[wv,yv]=gv(bv),xv=t=>{const{fe:n,children:r}=t,[a,i]=o.useState(null);return e.jsx(wv,{scope:n,anchor:a,onAnchorChange:i,children:r})};xv.displayName=bv;var Av="PopperAnchor",Sv=o.forwardRef((t,n)=>{const{fe:r,virtualRef:a,...i}=t,s=yv(Av,r),c=o.useRef(null),l=Ta(n,c),d=o.useRef(null);return o.useEffect(()=>{const e=d.current;d.current=a?.current||c.current,e!==d.current&&s.onAnchorChange(d.current)}),a?null:e.jsx(ai.div,{...i,ref:l})});Sv.displayName=Av;var kv="PopperContent",[Tv,Cv]=gv(kv),Nv=o.forwardRef((t,n)=>{const{fe:r,side:i="bottom",sideOffset:s=0,align:c="center",alignOffset:l=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:b="optimized",onPlaced:g,...v}=t,w=yv(kv,r),[y,x]=o.useState(null),A=Ta(n,e=>x(e)),[S,k]=o.useState(null),T=fm(S),C=T?.width??0,N=T?.height??0,E=i+("center"!==c?"-"+c:""),P="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(f)?f:[f],O=M.length>0,R={padding:P,boundary:M.filter(Ov),altBoundary:O},{refs:_,floatingStyles:D,placement:I,isPositioned:U,middlewareData:F}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[f,m]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);nv(p,r)||h(r);const[b,g]=o.useState(null),[v,w]=o.useState(null),y=o.useCallback(e=>{e!==k.current&&(k.current=e,g(e))},[]),x=o.useCallback(e=>{e!==T.current&&(T.current=e,w(e))},[]),A=s||b,S=c||v,k=o.useRef(null),T=o.useRef(null),C=o.useRef(f),N=null!=d,E=av(d),P=av(i),M=av(u),O=o.useCallback(()=>{if(!k.current||!T.current)return;const e={placement:t,strategy:n,middleware:p};P.current&&(e.platform=P.current),ev(k.current,T.current,e).then(e=>{const t={...e,isPositioned:!1!==M.current};R.current&&!nv(C.current,t)&&(C.current=t,a.flushSync(()=>{m(t)}))})},[p,t,n,P,M]);tv(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const R=o.useRef(!1);tv(()=>(R.current=!0,()=>{R.current=!1}),[]),tv(()=>{if(A&&(k.current=A),S&&(T.current=S),A&&S){if(E.current)return E.current(A,S,O);O()}},[A,S,O,E,N]);const _=o.useMemo(()=>({reference:k,floating:T,setReference:y,setFloating:x}),[y,x]),D=o.useMemo(()=>({reference:A,floating:S}),[A,S]),I=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=ov(D.floating,f.x),r=ov(D.floating,f.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...rv(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,D.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:O,refs:_,elements:D,floatingStyles:I}),[f,O,_,D,I])}({strategy:"fixed",placement:E,whileElementsMounted:(...e)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=Og(e),d=o||a?[...l?Eg(l):[],...Eg(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const u=l&&s?function(e,t){let n,r=null;const o=ig(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),a();const l=e.getBoundingClientRect(),{left:d,top:u,width:f,height:m}=l;if(s||t(),!f||!m)return;const p={rootMargin:-Ob(u)+"px "+-Ob(o.clientWidth-(d+f))+"px "+-Ob(o.clientHeight-(u+m))+"px "+-Ob(d)+"px",threshold:Pb(0,Eb(1,c))||1};let h=!0;function b(t){const r=t[0].intersectionRatio;if(r!==c){if(!h)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Kg(l,e.getBoundingClientRect())||i(),h=!1}try{r=new IntersectionObserver(b,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(b,p)}r.observe(e)}(!0),a}(l,n):null;let f,m=-1,p=null;i&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let h=c?Ig(e):null;return c&&function t(){const r=Ig(e);h&&!Kg(h,r)&&n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=p)||e.disconnect(),p=null,c&&cancelAnimationFrame(f)}}(...e,{animationFrame:"always"===b}),elements:{reference:w.anchor},middleware:[sv({mainAxis:s+N,alignmentAxis:l}),u&&cv({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?lv():void 0,...R}),u&&dv({...R}),uv({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",n+"px"),i.setProperty("--radix-popper-available-height",r+"px"),i.setProperty("--radix-popper-anchor-width",o+"px"),i.setProperty("--radix-popper-anchor-height",a+"px")}}),S&&mv({element:S,padding:d}),Rv({arrowWidth:C,arrowHeight:N}),h&&fv({strategy:"referenceHidden",...R})]}),[j,L]=_v(I),B=Vl(g);Jl(()=>{U&&B?.()},[U,B]);const $=F.arrow?.x,z=F.arrow?.y,G=0!==F.arrow?.centerOffset,[Z,W]=o.useState();return Jl(()=>{y&&W(window.getComputedStyle(y).zIndex)},[y]),e.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:U?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Tv,{scope:r,placedSide:j,onArrowChange:k,arrowX:$,arrowY:z,shouldHideArrow:G,children:e.jsx(ai.div,{"data-side":j,"data-align":L,...v,ref:A,style:{...v.style,animation:U?void 0:"none"}})})})});Nv.displayName=kv;var Ev="PopperArrow",Pv={top:"bottom",right:"left",bottom:"top",left:"right"},Mv=o.forwardRef(function(t,n){const{fe:r,...o}=t,a=Cv(Ev,r),i=Pv[a.placedSide];return e.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:e.jsx(hv,{...o,ref:n,style:{...o.style,display:"block"}})})});function Ov(e){return null!==e}Mv.displayName=Ev;var Rv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_v(n),d={start:"0%",center:"50%",end:"100%"}[l],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let m="",p="";return"bottom"===c?(m=a?d:u+"px",p=-s+"px"):"top"===c?(m=a?d:u+"px",p=r.floating.height+s+"px"):"right"===c?(m=-s+"px",p=a?d:f+"px"):"left"===c&&(m=r.floating.width+s+"px",p=a?d:f+"px"),{data:{x:m,y:p}}}});function _v(e){const[t,n="center"]=e.split("-");return[t,n]}var Dv=xv,Iv=Sv,Uv=Nv,Fv=Mv,jv="Popover",[Lv,Bv]=Wl(jv,[vv]),$v=vv(),[zv,Gv]=Lv(jv),Zv=t=>{const{he:n,children:r,open:a,defaultOpen:i,onOpenChange:s,modal:c=!1}=t,l=$v(n),d=o.useRef(null),[u,f]=o.useState(!1),[m,p]=Ed({prop:a,defaultProp:i??!1,onChange:s,caller:jv});return e.jsx(Dv,{...l,children:e.jsx(zv,{scope:n,contentId:Cd(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:o.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:o.useCallback(()=>f(!0),[]),onCustomAnchorRemove:o.useCallback(()=>f(!1),[]),modal:c,children:r})})};Zv.displayName=jv;var Wv="PopoverAnchor";o.forwardRef((t,n)=>{const{he:r,...a}=t,i=Gv(Wv,r),s=$v(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return o.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Iv,{...s,...a,ref:n})}).displayName=Wv;var Kv="PopoverTrigger",Vv=o.forwardRef((t,n)=>{const{he:r,...o}=t,a=Gv(Kv,r),i=$v(r),s=Ta(n,a.triggerRef),c=e.jsx(ai.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":aw(a.open),...o,ref:s,onClick:Sd(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:e.jsx(Iv,{asChild:!0,...i,children:c})});Vv.displayName=Kv;var Hv="PopoverPortal",[Jv,qv]=Lv(Hv,{forceMount:void 0}),Yv=t=>{const{he:n,forceMount:r,children:o,container:a}=t,i=Gv(Hv,n);return e.jsx(Jv,{scope:n,forceMount:r,children:e.jsx(Kd,{present:r||i.open,children:e.jsx(Wd,{asChild:!0,container:a,children:o})})})};Yv.displayName=Hv;var Xv="PopoverContent",Qv=o.forwardRef((t,n)=>{const r=qv(Xv,t.he),{forceMount:o=r.forceMount,...a}=t,i=Gv(Xv,t.he);return e.jsx(Kd,{present:o||i.open,children:i.modal?e.jsx(tw,{...a,ref:n}):e.jsx(nw,{...a,ref:n})})});Qv.displayName=Xv;var ew=Ca("PopoverContent.RemoveScroll"),tw=o.forwardRef((t,n)=>{const r=Gv(Xv,t.he),a=o.useRef(null),i=Ta(n,a),s=o.useRef(!1);return o.useEffect(()=>{const e=a.current;if(e)return Lu(e)},[]),e.jsx(_u,{as:ew,allowPinchZoom:!0,children:e.jsx(rw,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sd(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Sd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Sd(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),nw=o.forwardRef((t,n)=>{const r=Gv(Xv,t.he),a=o.useRef(!1),i=o.useRef(!1);return e.jsx(rw,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||r.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,o=r.triggerRef.current?.contains(n);o&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),rw=o.forwardRef((t,n)=>{const{he:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=t,m=Gv(Xv,r),p=$v(r);return Jd(),e.jsx(jd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:e.jsx(Rd,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Uv,{"data-state":aw(m.open),role:"dialog",id:m.contentId,...p,...f,ref:n,style:{...f.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)"}})})})}),ow="PopoverClose";function aw(e){return e?"open":"closed"}o.forwardRef((t,n)=>{const{he:r,...o}=t,a=Gv(ow,r);return e.jsx(ai.button,{type:"button",...o,ref:n,onClick:Sd(t.onClick,()=>a.onOpenChange(!1))})}).displayName=ow,o.forwardRef((t,n)=>{const{he:r,...o}=t,a=$v(r);return e.jsx(Fv,{...a,...o,ref:n})}).displayName="PopoverArrow";var iw=Yv,sw=Qv;const cw=Zv,lw=Vv,dw=o.forwardRef(({className:t,align:n="center",sideOffset:r=4,...a},i)=>{const{container:s}=o.useContext(q);return e.jsx(iw,{container:s,children:e.jsx(sw,{ref:i,align:n,sideOffset:r,className:Aa("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",t),...a})})});dw.displayName=sw.displayName;const uw={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},fw={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},mw=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=fw[e.code]||"USD",n=uw[t]||"";return{value:e.code,flag:(r=e.code,r.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:n};var r});function pw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=mw.find(e=>e.value==r);return e.jsxs(cw,{open:a,onOpenChange:i,children:[e.jsx(lw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&e.jsxs("div",{children:[(s.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&e.jsx("span",{className:"text-muted-foreground",children:"Choose country"}),e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Ab,{children:[e.jsx(Sb,{placeholder:"Choose country..."}),e.jsx(kb,{children:e.jsx(Tb,{children:mw.map(t=>e.jsxs(Cb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const hw=mw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),bw=Array.from(new Set(hw.map(e=>e.value))).map(e=>hw.find(t=>t.value===e)).filter(e=>void 0!==e);function gw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=bw.find(e=>e.value==r);return e.jsxs(cw,{open:a,onOpenChange:i,children:[e.jsx(lw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&e.jsxs("div",{children:[(s.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:s.icon})]}),!s&&e.jsx("span",{className:"text-muted-foreground",children:"Choose Currency"}),e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Ab,{children:[e.jsx(Sb,{placeholder:"Choose currency..."}),e.jsx(kb,{children:e.jsx(Tb,{children:bw.map(t=>e.jsxs(Cb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}let vw=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];vw=vw.filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)),vw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const ww=vw.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function yw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=ww.find(e=>e.value==r);return e.jsxs(cw,{open:a,onOpenChange:i,children:[e.jsx(lw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s&&e.jsxs("div",{children:[(s.label+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&"Choose language",e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Ab,{children:[e.jsx(Sb,{placeholder:"Choose timezone..."}),e.jsx(kb,{children:e.jsx(Tb,{children:ww.map(t=>e.jsxs(Cb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.label+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const xw=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let n=t.utc;for(let r=0;r<n.length;r++){const o=n[r],a=t.text;let i=a.substring(a.indexOf("(")+1,a.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:o,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${o}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,n)=>t===n.findIndex(t=>t.value===e.value));function Aw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=xw.find(e=>e.value==r);return e.jsxs(cw,{open:a,onOpenChange:i,children:[e.jsx(lw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text||"Choose timezone",e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Ab,{children:[e.jsx(Sb,{placeholder:"Choose timezone..."}),e.jsx(kb,{children:e.jsx(Tb,{children:xw.map(t=>e.jsxs(Cb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.text+"").trim()]},t.value))})})]})})]})}const Sw=({workspace:n})=>{const{updateUserProfile:r,getProfile:o}=qy(),[a,i]=t.useState(!1),[s,c]=t.useState(),[l,d]=t.useState(0),u=mt({resolver:mo(hs({name:Gi().min(2,{message:"Name must be at least 2 characters."}),country:Gi().optional(),timezone:Gi().optional(),language:Gi().optional(),currency:Gi().optional()})),defaultValues:{name:s?.name||"",country:s?.country||"",timezone:s?.timezone||"",language:s?.language||"",currency:s?.currency||""}});return t.useEffect(()=>{o().then(e=>{c(e),u.setValue("name",e.name),u.setValue("country",e.country),u.setValue("timezone",e.timezone),u.setValue("language",e.language),u.setValue("currency",e.currency)})},[l]),s?e.jsxs("div",{children:[e.jsx("div",{className:"space-y-4",children:e.jsx(di,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(async function(e){i(!0),await r({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),i(!1)}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e.jsx(yi,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:s?.email})]}),e.jsx(fi,{disabled:a,control:u.control,name:"name",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Name"}),e.jsx(gi,{children:e.jsx(yi,{...t})}),e.jsx(wi,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Language"}),e.jsx(yw,{value:u.getValues("language"),onChange:e=>{u.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Country"}),e.jsx(pw,{value:u.getValues("country"),onChange:e=>{u.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Currency"}),e.jsx(gw,{value:u.getValues("currency"),onChange:e=>{u.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Timezone"}),e.jsx(Aw,{value:u.getValues("timezone"),onChange:e=>{u.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(oi,{type:"submit",progress:a,disabled:a,children:"Save"}),e.jsx(oi,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:a,children:"Reset"})]})]})})}),s?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(gh,{})};var kw=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"});o.forwardRef((t,n)=>e.jsx(ai.span,{...t,ref:n,style:{...kw,...t.style}})).displayName="VisuallyHidden";var Tw=[" ","Enter","ArrowUp","ArrowDown"],Cw=[" ","Enter"],Nw="Select",[Ew,Pw,Mw]=Wf(Nw),[Ow,Rw]=Wl(Nw,[Mw,vv]),_w=vv(),[Dw,Iw]=Ow(Nw),[Uw,Fw]=Ow(Nw),jw=t=>{const{be:n,children:r,open:a,defaultOpen:i,onOpenChange:s,value:c,defaultValue:l,onValueChange:d,dir:u,name:f,autoComplete:m,disabled:p,required:h,form:b}=t,g=_w(n),[v,w]=o.useState(null),[y,x]=o.useState(null),[A,S]=o.useState(!1),k=Vf(u),[T,C]=Ed({prop:a,defaultProp:i??!1,onChange:s,caller:Nw}),[N,E]=Ed({prop:c,defaultProp:l,onChange:d,caller:Nw}),P=o.useRef(null),M=!v||b||!!v.closest("form"),[O,R]=o.useState(new Set),_=Array.from(O).map(e=>e.props.value).join(";");return e.jsx(Dv,{...g,children:e.jsxs(Dw,{required:h,scope:n,trigger:v,onTriggerChange:w,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:A,onValueNodeHasChildrenChange:S,contentId:Cd(),value:N,onValueChange:E,open:T,onOpenChange:C,dir:k,triggerPointerDownPosRef:P,disabled:p,children:[e.jsx(Ew.Provider,{scope:n,children:e.jsx(Uw,{scope:t.be,onNativeOptionAdd:o.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:o.useCallback(e=>{R(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),M?e.jsxs(Ay,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:m,value:N,onChange:e=>E(e.target.value),disabled:p,form:b,children:[void 0===N?e.jsx("option",{value:""}):null,Array.from(O)]},_):null]})})};jw.displayName=Nw;var Lw="SelectTrigger",Bw=o.forwardRef((t,n)=>{const{be:r,disabled:a=!1,...i}=t,s=_w(r),c=Iw(Lw,r),l=c.disabled||a,d=Ta(n,c.onTriggerChange),u=Pw(r),f=o.useRef("touch"),[m,p,h]=ky(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===c.value),r=Ty(t,e,n);void 0!==r&&c.onValueChange(r.value)}),b=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Iv,{asChild:!0,...s,children:e.jsx(ai.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Sy(c.value)?"":void 0,...i,ref:d,onClick:Sd(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&b(e)}),onPointerDown:Sd(i.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(b(e),e.preventDefault())}),onKeyDown:Sd(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Tw.includes(e.key)&&(b(),e.preventDefault())})})})});Bw.displayName=Lw;var $w="SelectValue",zw=o.forwardRef((t,n)=>{const{be:r,className:o,style:a,children:i,placeholder:s="",...c}=t,l=Iw($w,r),{onValueNodeHasChildrenChange:d}=l,u=void 0!==i,f=Ta(n,l.onValueNodeChange);return Jl(()=>{d(u)},[d,u]),e.jsx(ai.span,{...c,ref:f,style:{pointerEvents:"none"},children:Sy(l.value)?e.jsx(e.Fragment,{children:s}):i})});zw.displayName=$w;var Gw=o.forwardRef((t,n)=>{const{be:r,children:o,...a}=t;return e.jsx(ai.span,{"aria-hidden":!0,...a,ref:n,children:o||"▼"})});Gw.displayName="SelectIcon";var Zw=t=>e.jsx(Wd,{asChild:!0,...t});Zw.displayName="SelectPortal";var Ww="SelectContent",Kw=o.forwardRef((t,n)=>{const r=Iw(Ww,t.be),[i,s]=o.useState();if(Jl(()=>{s(new DocumentFragment)},[]),!r.open){const n=i;return n?a.createPortal(e.jsx(Hw,{scope:t.be,children:e.jsx(Ew.Slot,{scope:t.be,children:e.jsx("div",{children:t.children})})}),n):null}return e.jsx(Yw,{...t,ref:n})});Kw.displayName=Ww;var Vw=10,[Hw,Jw]=Ow(Ww),qw=Ca("SelectContent.RemoveScroll"),Yw=o.forwardRef((t,n)=>{const{be:r,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:c,side:l,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:g,avoidCollisions:v,...w}=t,y=Iw(Ww,r),[x,A]=o.useState(null),[S,k]=o.useState(null),T=Ta(n,e=>A(e)),[C,N]=o.useState(null),[E,P]=o.useState(null),M=Pw(r),[O,R]=o.useState(!1),_=o.useRef(!1);o.useEffect(()=>{if(x)return Lu(x)},[x]),Jd();const D=o.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[M,S]),I=o.useCallback(()=>D([C,x]),[D,C,x]);o.useEffect(()=>{O&&I()},[O,I]);const{onOpenChange:U,triggerPointerDownPosRef:F}=y;o.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x>10||e.y>10?x.contains(n.target)||U(!1):n.preventDefault(),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,U,F]),o.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[j,L]=ky(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Ty(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),B=o.useCallback((e,t,n)=>{const r=!_.current&&!n;(void 0!==y.value&&y.value===t||r)&&(N(e),r&&(_.current=!0))},[y.value]),$=o.useCallback(()=>x?.focus(),[x]),z=o.useCallback((e,t,n)=>{const r=!_.current&&!n;(void 0!==y.value&&y.value===t||r)&&P(e)},[y.value]),G="popper"===a?Qw:Xw,Z=G===Qw?{side:l,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:g,avoidCollisions:v}:{};return e.jsx(Hw,{scope:r,content:x,viewport:S,onViewportChange:k,itemRefCallback:B,selectedItem:C,onItemLeave:$,itemTextRefCallback:z,focusSelectedItem:I,selectedItemText:E,position:a,isPositioned:O,searchRef:j,children:e.jsx(_u,{as:qw,allowPinchZoom:!0,children:e.jsx(jd,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Sd(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Rd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:e.jsx(G,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:e=>e.preventDefault(),...w,...Z,onPlaced:()=>R(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Sd(w.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});Yw.displayName="SelectContentImpl";var Xw=o.forwardRef((t,n)=>{const{be:r,onPlaced:a,...i}=t,s=Iw(Ww,r),c=Jw(Ww,r),[l,d]=o.useState(null),[u,f]=o.useState(null),m=Ta(n,e=>f(e)),p=Pw(r),h=o.useRef(!1),b=o.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:w,focusSelectedItem:y}=c,x=o.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&g&&v&&w){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,a=n.left-o,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-Vw,u=$m(a,[Vw,Math.max(Vw,d-c)]);l.style.minWidth=s+"px",l.style.left=u+"px"}else{const o=t.right-r.right,a=window.innerWidth-n.right-o,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-Vw,u=$m(a,[Vw,Math.max(Vw,d-c)]);l.style.minWidth=s+"px",l.style.right=u+"px"}const o=p(),i=window.innerHeight-2*Vw,c=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),y=f+m+c+parseInt(d.paddingBottom,10)+b,x=Math.min(5*v.offsetHeight,y),A=window.getComputedStyle(g),S=parseInt(A.paddingTop,10),k=parseInt(A.paddingBottom,10),T=e.top+e.height/2-Vw,C=i-T,N=v.offsetHeight/2,E=f+m+(v.offsetTop+N),P=y-E;if(E>T){const e=o.length>0&&v===o[0].ref.current;l.style.top="0px";const t=Math.max(T,f+g.offsetTop+(e?S:0)+N)+P;l.style.height=t+"px",g.scrollTop=E-T+g.offsetTop}else{const e=o.length>0&&v===o[o.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=E+Math.max(C,N+(e?k:0)+t+b);l.style.height=n+"px"}l.style.margin=Vw+"px 0",l.style.minHeight=x+"px",l.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,l,u,g,v,w,s.dir,a]);Jl(()=>x(),[x]);const[A,S]=o.useState();Jl(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const k=o.useCallback(e=>{e&&!0===b.current&&(x(),y?.(),b.current=!1)},[x,y]);return e.jsx(ey,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:e.jsx(ai.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Xw.displayName="SelectItemAlignedPosition";var Qw=o.forwardRef((t,n)=>{const{be:r,align:o="start",collisionPadding:a=Vw,...i}=t,s=_w(r);return e.jsx(Uv,{...s,...i,ref:n,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});Qw.displayName="SelectPopperPosition";var[ey,ty]=Ow(Ww,{}),ny="SelectViewport",ry=o.forwardRef((t,n)=>{const{be:r,nonce:a,...i}=t,s=Jw(ny,r),c=ty(ny,r),l=Ta(n,s.onViewportChange),d=o.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{se:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),e.jsx(Ew.Slot,{scope:r,children:e.jsx(ai.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Sd(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Vw,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(r>i){const o=i+e,a=Math.min(r,o),s=o-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});ry.displayName=ny;var oy="SelectGroup",[ay,iy]=Ow(oy);o.forwardRef((t,n)=>{const{be:r,...o}=t,a=Cd();return e.jsx(ay,{scope:r,id:a,children:e.jsx(ai.div,{role:"group","aria-labelledby":a,...o,ref:n})})}).displayName=oy;var sy="SelectLabel",cy=o.forwardRef((t,n)=>{const{be:r,...o}=t,a=iy(sy,r);return e.jsx(ai.div,{id:a.id,...o,ref:n})});cy.displayName=sy;var ly="SelectItem",[dy,uy]=Ow(ly),fy=o.forwardRef((t,n)=>{const{be:r,value:a,disabled:i=!1,textValue:s,...c}=t,l=Iw(ly,r),d=Jw(ly,r),u=l.value===a,[f,m]=o.useState(s??""),[p,h]=o.useState(!1),b=Ta(n,e=>d.itemRefCallback?.(e,a,i)),g=Cd(),v=o.useRef("touch"),w=()=>{i||(l.onValueChange(a),l.onOpenChange(!1))};if(""===a)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(dy,{scope:r,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:o.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Ew.ItemSlot,{scope:r,value:a,disabled:i,textValue:f,children:e.jsx(ai.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:b,onFocus:Sd(c.onFocus,()=>h(!0)),onBlur:Sd(c.onBlur,()=>h(!1)),onClick:Sd(c.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:Sd(c.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:Sd(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Sd(c.onPointerMove,e=>{v.current=e.pointerType,i?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Sd(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Sd(c.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Cw.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});fy.displayName=ly;var my="SelectItemText",py=o.forwardRef((t,n)=>{const{be:r,className:i,style:s,...c}=t,l=Iw(my,r),d=Jw(my,r),u=uy(my,r),f=Fw(my,r),[m,p]=o.useState(null),h=Ta(n,e=>p(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),b=m?.textContent,g=o.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=f;return Jl(()=>(v(g),()=>w(g)),[v,w,g]),e.jsxs(e.Fragment,{children:[e.jsx(ai.span,{id:u.textId,...c,ref:h}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?a.createPortal(c.children,l.valueNode):null]})});py.displayName=my;var hy="SelectItemIndicator",by=o.forwardRef((t,n)=>{const{be:r,...o}=t;return uy(hy,r).isSelected?e.jsx(ai.span,{"aria-hidden":!0,...o,ref:n}):null});by.displayName=hy;var gy="SelectScrollUpButton";o.forwardRef((t,n)=>{const r=Jw(gy,t.be),a=ty(gy,t.be),[i,s]=o.useState(!1),c=Ta(n,a.onScrollButtonChange);return Jl(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?e.jsx(wy,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=gy;var vy="SelectScrollDownButton";o.forwardRef((t,n)=>{const r=Jw(vy,t.be),a=ty(vy,t.be),[i,s]=o.useState(!1),c=Ta(n,a.onScrollButtonChange);return Jl(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?e.jsx(wy,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=vy;var wy=o.forwardRef((t,n)=>{const{be:r,onAutoScroll:a,...i}=t,s=Jw("SelectScrollButton",r),c=o.useRef(null),l=Pw(r),d=o.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return o.useEffect(()=>()=>d(),[d]),Jl(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(ai.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:Sd(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(a,50))}),onPointerMove:Sd(i.onPointerMove,()=>{s.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(a,50))}),onPointerLeave:Sd(i.onPointerLeave,()=>{d()})})}),yy=o.forwardRef((t,n)=>{const{be:r,...o}=t;return e.jsx(ai.div,{"aria-hidden":!0,...o,ref:n})});yy.displayName="SelectSeparator";var xy="SelectArrow";o.forwardRef((t,n)=>{const{be:r,...o}=t,a=_w(r),i=Iw(xy,r),s=Jw(xy,r);return i.open&&"popper"===s.position?e.jsx(Fv,{...a,...o,ref:n}):null}).displayName=xy;var Ay=o.forwardRef(({be:t,value:n,...r},a)=>{const i=o.useRef(null),s=Ta(a,i),c=mm(n);return o.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[c,n]),e.jsx(ai.select,{...r,style:{...kw,...r.style},ref:s,defaultValue:n})});function Sy(e){return""===e||void 0===e}function ky(e){const t=Vl(e),n=o.useRef(""),r=o.useRef(0),a=o.useCallback(e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),i=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function Ty(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=(i=e,s=Math.max(o,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===r.length&&(a=a.filter(e=>e!==n));const c=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Ay.displayName="SelectBubbleInput";var Cy=Bw,Ny=Gw,Ey=Zw,Py=Kw,My=ry,Oy=cy,Ry=fy,_y=py,Dy=by,Iy=yy;const Uy=jw,Fy=o.forwardRef(({className:t,children:n,...r},o)=>e.jsxs(Cy,{ref:o,className:Aa("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:[n,e.jsx(Ny,{asChild:!0,children:e.jsx(Mf,{className:"h-4 w-4 opacity-50"})})]}));Fy.displayName=Cy.displayName;const jy=o.forwardRef(({className:t,children:n,position:r="popper",...a},i)=>{const{container:s}=o.useContext(q);return e.jsx(Ey,{container:s,children:e.jsx(Py,{ref:i,className:Aa("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:e.jsx(My,{className:Aa("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})})});jy.displayName=Py.displayName,o.forwardRef(({className:t,...n},r)=>e.jsx(Oy,{ref:r,className:Aa("px-2 py-1.5 text-sm font-semibold",t),...n})).displayName=Oy.displayName;const Ly=o.forwardRef(({className:t,children:n,...r},o)=>e.jsxs(Ry,{ref:o,className:Aa("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Dy,{children:e.jsx(Rf,{className:"h-4 w-4"})})}),e.jsx(_y,{children:n})]}));Ly.displayName=Ry.displayName,o.forwardRef(({className:t,...n},r)=>e.jsx(Iy,{ref:r,className:Aa("-mx-1 my-1 h-px bg-muted",t),...n})).displayName=Iy.displayName;const By=({workspace:n})=>{const r=W(e=>e.auth.session?.user||null),[o,a]=t.useState(0),[i,s]=t.useState(!1),[c,l]=t.useState([]),{getUsers:d,removeUser:u,updateUser:f}=qy(),{settings:m}=Rp();t.useEffect(()=>{n&&(s(!0),d(n.t).then(e=>{l(e)}).catch(e=>{}).finally(()=>{s(!1)}))},[n,o]);const p=()=>{a(e=>e+1)};if(i||!n)return e.jsx(gh,{});const h=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e.t},b=c.map(e=>({...e,...h(e.user)})),g=c.find(e=>("string"==typeof e.user?e.user:e.user.t)===r?.id)?.role,v="admin"===g,w=(m?.workspace.maxWorkspaceUsers??Number.MAX_VALUE)>(c.length??0);return e.jsxs("div",{children:[!v&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),v&&e.jsxs("div",{className:"mb-4",children:[w&&e.jsx($y,{onInvite:p,workspaceId:n.t}),!w&&e.jsx("div",{className:"text-red-500",children:"You have reached the maximum number of users for this workspace."})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[c.length," member",1!==c.length?"s":""]})}),e.jsx("div",{children:e.jsx(oi,{variant:"ghost",size:"sm",onClick:p,progress:i,startIcon:e.jsx(Va,{}),children:"Refresh"})})]}),e.jsx("ul",{className:"space-y-2",children:b.map((t,o)=>{const a=t.id===r?.id,i=("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)===t.id;return e.jsxs("li",{className:"flex items-center justify-between border rounded p-3",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx("div",{children:e.jsxs(Uy,{disabled:a||!v||i,value:t.role,onValueChange:e=>{return r=n.t,o=t.id,a=e,void(("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)!==o&&f(r,o,{role:a}).then(()=>{p()}));var r,o,a},children:[e.jsx(Fy,{children:e.jsx(zw,{placeholder:"Select a role"})}),e.jsx(jy,{children:n?.roles.map(t=>e.jsx(Ly,{value:t,children:t},t))})]})}),a&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),i&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-1 rounded",children:"Owner"}),!a&&!i&&v&&e.jsx(oi,{variant:"destructive",size:"sm",startIcon:e.jsx(Qa,{}),onClick:()=>{var e;e=t.id,("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)!==e&&u(n.t,e).then(()=>{p()})}})]})]},o)})}),0===c.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function $y({onInvite:n,workspaceId:r}){const[o,a]=t.useState(""),[i,s]=t.useState("admin"),[c,l]=t.useState(!1),[d,u]=t.useState(null),[f,m]=t.useState(null),{addUser:p,getWorkspace:h}=qy(),[b,g]=t.useState(null),{settings:v}=Rp(),w=v?.workspace.roles??b?.roles??[];return t.useEffect(()=>{r&&h(r).then(g)},[r]),e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[d&&e.jsx("div",{className:"text-red-500 capitalize",children:d}),f&&e.jsx("div",{className:"text-green-500 capitalize",children:f}),e.jsxs("div",{children:[e.jsx(li,{children:"Invite member by email"}),e.jsx(yi,{type:"email",value:o,onChange:e=>a(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(li,{children:"Role"}),e.jsxs(Uy,{value:i,onValueChange:s,children:[e.jsx(Fy,{children:e.jsx(zw,{placeholder:"Select a role"})}),e.jsx(jy,{children:w.map(t=>e.jsx(Ly,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(oi,{progress:c,onClick:async()=>{const e=o.trim();e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(l(!0),await p(r,e,i).then(()=>{m("User invited successfully"),n?.()}).catch(e=>{u(e.message||"Failed to invite member")}).finally(()=>{l(!1),setTimeout(()=>{u(null),m(null),a(""),s("admin")},6e3)})):u("Invalid email address format"):u("Email is required")},disabled:c||!o||!i,children:c?"Inviting...":"Invite as "+i})})]})}const zy=({workspace:t,section:n,setSection:r})=>{const o=W(e=>e.auth.session?.user||null),a=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy.t:t.createdBy)===o?.id;return e.jsxs("div",{className:"w-56 h-full flex flex-col space-y-6",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"}})}),e.jsxs("div",{className:Aa("flex-1 min-w-0",t.image?"":"pl-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(Gy,{title:"Account",children:e.jsx(Zy,{activeSection:n,icon:e.jsx(ti,{className:"h-3.5 w-3.5"}),label:"Profile",section:"profile",onClick:()=>r("profile")})}),e.jsxs(Gy,{title:"Workspace",children:[e.jsx(Zy,{activeSection:n,icon:e.jsx(Ja,{className:"h-3.5 w-3.5"}),label:"General",section:"general",onClick:()=>r("general")}),e.jsx(Zy,{activeSection:n,icon:e.jsx(ni,{className:"h-3.5 w-3.5"}),label:"Users",section:"users",onClick:()=>r("users")}),e.jsx(Zy,{activeSection:n,icon:e.jsx(Ya,{className:"h-3.5 w-3.5"}),label:"Features",section:"features",onClick:()=>r("features")}),a&&e.jsx(Zy,{activeSection:n,icon:e.jsx(ei,{className:"h-3.5 w-3.5"}),label:"Danger Zone",section:"danger",onClick:()=>r("danger")})]})]})};function Gy({title:t,children:n}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),n]})}function Zy({icon:t,label:n,section:r,onClick:o,activeSection:a}){return e.jsxs("button",{className:Aa("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-1",r===a?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>o(r),children:[t,n]})}const Wy=({workspace:n,onClose:r})=>{const[o,a]=t.useState(!1),[i,s]=t.useState("profile");return n?e.jsxs(Ff,{open:o,onOpenChange:e=>{a(e),e||r()},children:[e.jsx(jf,{asChild:!0,children:e.jsx(oi,{variant:"outline",size:"icon",children:e.jsx(Ja,{className:"h-4 w-4"})})}),e.jsxs($f,{className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(Zf,{className:"sr-only",children:"Workspace settings dialog"}),e.jsx(zy,{workspace:n,section:i,setSection:s}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsxs(Gf,{className:"text-xl font-bold mb-4 capitalize",children:["profile"===i&&"Account","general"===i&&"Workspace Settings","users"===i&&"Workspace Members","features"===i&&"Workspace Features","danger"===i&&"Danger Zone"]}),e.jsxs("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===i&&e.jsx(Sw,{workspace:n}),"general"===i&&e.jsx(Ih,{workspace:n}),"users"===i&&e.jsx(By,{workspace:n}),"features"===i&&e.jsx(Rh,{workspaceId:n.t?.toString()}),"danger"===i&&e.jsx(vh,{workspace:n})]})]})]})]}):null};function Ky(n){const{workspaces:r,currentWorkspace:o,loading:a,refreshing:i}=W(e=>e.workspaces),s=W(e=>e.auth.session?.user),{settings:c}=Rp(),[l,d]=t.useState(!1),[u,f]=t.useState(0),[m,p]=t.useState(""),{fetchWorkspaces:h,getFeatures:b,refreshWorkspaces:g,setCurrentWorkspace:v,workspaces:w}=qy(),y=a||i;t.useEffect(()=>{0===w.length?(h(),b()):b()},[]),t.useEffect(()=>{u>0&&g()},[u]);const x=w.length>0?w:r,A=x.filter(e=>e.t!==o?.t).filter(e=>e.name.toLowerCase().includes(m.toLowerCase())),S=c?.workspace.maxWorkspaces??Number.MAX_VALUE,k=x?.filter(e=>("object"==typeof e.createdBy?e.createdBy.t?.toString():e.createdBy?.toString())===s?.id?.toString()).length,T=S>(k??0);return e.jsxs(Ff,{open:l,onOpenChange:d,children:[e.jsx(jf,{children:n.trigger?.(y,o)}),e.jsxs($f,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(zf,{children:[e.jsxs(Gf,{className:"flex items-center gap-2",children:[e.jsx($a,{className:"h-5 w-5"}),"Switch Workspace"]}),e.jsx(Zf,{children:"Select a workspace to switch to or create a new one."})]}),!s&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),s&&e.jsxs("div",{className:"flex flex-col gap-4",children:[o&&e.jsx(Vy,{workspace:o,isCurrentWorkspace:!0,onWorkspaceChange:n.onWorkspaceChange,onClose:()=>d(!1),setCurrentWorkspace:v,setOpen:d,workspacesToUse:x}),e.jsx(Op,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",A.length,")"]}),e.jsx("div",{children:e.jsx(oi,{progress:i,disabled:i,variant:"ghost",onClick:function(){f(e=>e+1)},startIcon:e.jsx(Va,{}),children:i?"Refreshing...":"Refresh"})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ha,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(yi,{placeholder:"Search workspaces...",value:m,onChange:e=>p(e.target.value),className:"pl-10"})]}),a?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Wa,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===A.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx($a,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:m?"No workspaces found":"No workspaces available"})]}):e.jsx(Tp,{className:"h-64",children:e.jsx("div",{className:"flex flex-col gap-2 my-2.5",children:A.map(t=>{const r=t.t===o?.t;return e.jsx(Vy,{workspace:t,isCurrentWorkspace:r,onWorkspaceChange:n.onWorkspaceChange,onClose:()=>d(!1),setCurrentWorkspace:v,setOpen:d,workspacesToUse:x},t.t)})})})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx(Op,{}),e.jsx(Hy,{onCreated:()=>{h()}})]})]})]})]})}function Vy(t){const{workspace:n,setCurrentWorkspace:r,setOpen:o,workspacesToUse:a}=t,i=t.isCurrentWorkspace??!1;return e.jsxs("div",{className:Aa("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":i}),children:[e.jsxs(yd,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(xd,{src:n.image})}),e.jsx(Ad,{children:(s=n.name,s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(ni,{className:"h-3 w-3"}),e.jsxs("span",{children:[n.users?.length||0," members"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[i?null:e.jsx(oi,{size:"sm",onClick:()=>{t.onWorkspaceChange(n).then(()=>{r(n),o(!1)})},children:"Switch to"}),e.jsx(Wy,{workspace:n,onClose:()=>{if(i){const e=a.findIndex(e=>e.t?.toString()===n.t?.toString());-1!==e&&r(a[e])}}})]})]});var s}function Hy(n){const[r,o]=t.useState(!1),[a,i]=t.useState("emoji"),[s,c]=t.useState("🏢"),[l,d]=t.useState(!1),{createWorkspace:u}=qy(),f=mt({resolver:mo(hs({name:Gi().min(2,{message:"Workspace name must be at least 2 characters."}),image:Gi().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(Ff,{open:r,onOpenChange:o,children:[e.jsx(jf,{asChild:!0,children:e.jsxs(oi,{className:"w-full rounded-none",children:[e.jsx(Ka,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),e.jsxs($f,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(zf,{children:[e.jsx(Gf,{children:"Create New Workspace"}),e.jsx(Zf,{children:"Create a new workspace to get started."})]}),e.jsx(di,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===a)t=_h(s);else if("url"===a&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:"Please enter a valid URL"})}d(!0);try{await u(e.name,t),o(!1),f.reset(),c("🏢"),i("emoji"),n?.onCreated?.()}catch(e){}finally{d(!1)}}),children:[e.jsx(fi,{control:f.control,name:"name",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Workspace Name"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"My Awesome Workspace",...t})}),e.jsx(wi,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(li,{className:"text-sm font-medium",children:"Workspace Icon"}),e.jsx(vi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(Lm,{value:a,onValueChange:e=>i(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Bm,{value:"emoji",id:"emoji"}),e.jsxs(li,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(qa,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Bm,{value:"url",id:"url"}),e.jsxs(li,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Za,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===a&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:s})]}),e.jsx(Tp,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Dh.map((t,n)=>e.jsx("button",{type:"button",onClick:()=>(e=>{c(e),f.setValue("image",_h(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===a&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(fi,{control:f.control,name:"image",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Image URL"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"https://example.com/image.png",...t})}),e.jsx(vi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(wi,{})]})}),f.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(oi,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),c("🏢"),i("emoji")},disabled:l,children:"Cancel"}),e.jsx(oi,{type:"submit",disabled:l,children:l?e.jsxs(e.Fragment,{children:[e.jsx(Wa,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const Jy=()=>l("saas-workspace-current"),qy=()=>{const e=K(),n=W(e=>e.os),r=t.useMemo(()=>new Zl(n),[n]),o=W(e=>e.workspaces),a=W(e=>e.auth.session?.user),i=t.useCallback(t=>{if(t.t!==o.currentWorkspace?.t&&t){const n=o.currentWorkspace;e.workspaces((e=>({type:"SET_CURRENT_WORKSPACE",payload:e}))(t)),J.emitWorkspaceChanged(t,n).catch(e=>{})}},[o.currentWorkspace,e]);t.useEffect(()=>{if(!o.isInitialized){const t=Jy();if(e.workspaces({type:"SET_IS_INITIALIZED",payload:!0}),t){const e=o.workspaces.find(e=>e.t===t);if(e){if(e.t===o.currentWorkspace?.t)return;i(e)}}}},[o.isInitialized,o.workspaces,o.currentWorkspace,e,i]);const s=t.useCallback(()=>{e.workspaces({type:"RESET_CURRENT_WORKSPACE"})},[e]),c=t.useRef(!1),l=t.useRef(!1),d=t.useCallback(async()=>{if(!o.loading&&!c.current){c.current=!0,e.workspaces(D(!0)),e.workspaces(I(null));try{const n=await r.getWorkspaces();if(e.workspaces(_(n)),n.length>0){const e=Jy();if(e&&((t=e)&&n.some(e=>e.t===t))){const t=n.find(t=>t.t===e);t&&i(t)}else n.length>0&&(o.currentWorkspace||i(n[0]))}}catch(t){e.workspaces(I(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(D(!1)),c.current=!1}}var t},[r,o.loading,o.currentWorkspace,e,i]),u=t.useCallback(async()=>{if(!o.refreshing&&!c.current){c.current=!0,e.workspaces(U(!0));try{const t=await r.getWorkspaces();e.workspaces(_(t))}catch(e){}finally{e.workspaces(U(!1)),c.current=!1}}},[r,o.refreshing,e]),f=t.useCallback(async(t,n)=>{const a=await r.createWorkspace({name:t,image:n});e.workspaces(_([...o.workspaces,a])),J.emitWorkspaceCreated(a).catch(e=>{})},[r,o.workspaces,e]),m=t.useCallback(async(t,n)=>{const a=await r.updateWorkspace(t.t,n);e.workspaces(_(o.workspaces.map(e=>e.t===t.t?a:e))),J.emitWorkspaceUpdated(a).catch(e=>{})},[r,o.workspaces,e]),p=t.useCallback(async()=>{if(l.current)return o.allFeatures.length>0?o.allFeatures:null;if(o.allFeatures.length>0)return o.allFeatures;l.current=!0;try{const t=await r.getFeatures();return e.workspaces({type:"SET_ALL_FEATURES",payload:t}),t}catch(e){return null}finally{l.current=!1}},[r,e,o.allFeatures]),h=t.useCallback(async(e,t,n)=>await r.updateFeature(e,t,n),[r]);t.useEffect(()=>{if(o.currentWorkspace?.t){const e=o.workspaces.find(e=>e.t===o.currentWorkspace?.t);if(e){if(e.t===o.currentWorkspace.t)return;i(e)}else if(o.workspaces.length>0){if(o.workspaces[0].t===o.currentWorkspace.t)return;i(o.workspaces[0])}}},[o.currentWorkspace?.t,o.workspaces,i]);const b=t.useCallback(async e=>await r.getWorkspaceUsers(e),[r]),g=t.useCallback(async(e,t,n)=>{const a=await r.addUser(e,{email:t,role:n}),i=o.workspaces.find(t=>t.t===e);return i&&J.emitWorkspaceUserAdded(a.userId,i,n).catch(e=>{}),a},[r,o.workspaces]),v=t.useCallback(async(e,t)=>{const n=o.workspaces.find(t=>t.t===e);if(n&&("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)===t)throw Error("Cannot remove the workspace owner");const a=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user.t)===t),i=await r.removeUser(e,t);if(n&&a){const e=a.role;J.emitWorkspaceUserRemoved(i.userId,n,e).catch(e=>{})}return i},[r,o.workspaces]),w=t.useCallback(async(e,t,n)=>{if(n.role){const n=o.workspaces.find(t=>t.t===e);if(n&&("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)===t)throw Error("Cannot change the role of the workspace owner")}let a;if(n.role){const n=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user.t)===t);a=n?.role}const i=await r.updateUser(e,t,n);return n.role&&a&&a!==n.role&&J.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,n.role).catch(e=>{}),i},[r,o.workspaces]),y=t.useCallback(async e=>{const t=await r.getProfile().catch(()=>null),n=await r.updateUserProfile(e);return J.emitUserUpdated(n,t||void 0).catch(e=>{}),n},[r]),x=t.useCallback(async()=>await r.getProfile(),[r]),A=t.useCallback(async e=>await r.getWorkspace(e),[r]),S=t.useCallback(async t=>{if(!a)throw Error("User must be authenticated to delete a workspace");const n=o.workspaces.find(e=>e.t===t);if(!n)throw Error("Workspace not found");if(("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)!==a.id)throw Error("Only the workspace creator can delete the workspace");const i=await r.deleteWorkspace(t);return e.workspaces(_(o.workspaces.filter(e=>e.t!==t))),o.currentWorkspace?.t===t&&e.workspaces({type:"RESET_CURRENT_WORKSPACE"}),n&&J.emitWorkspaceDeleted(n).catch(e=>{}),i},[r,o.workspaces,o.currentWorkspace,e,a]);return{workspaces:o.workspaces,loading:o.loading,error:o.error,fetchWorkspaces:d,refreshWorkspaces:u,refreshing:o.refreshing,WorkspaceSwitcher:Ky,currentWorkspace:o.currentWorkspace,setCurrentWorkspace:i,resetCurrentWorkspace:s,createWorkspace:f,allFeatures:o.allFeatures,getFeatures:p,updateFeature:h,getWorkspace:A,switching:o.switching,updateWorkspace:m,getUsers:b,addUser:g,removeUser:v,updateUser:w,getProfile:x,updateUserProfile:y,deleteWorkspace:S}};function Yy(){const e=K(),n=W(e=>e.auth),r=W(e=>e.os),{serverUrl:o,orgId:a,auth:i}=r,{resetCurrentWorkspace:s}=qy(),c=t.useCallback(async()=>{e.auth({type:"AUTHENTICATION_STARTED"});try{const t=await Gl.post(o+"/api/v1/auth/request",{orgId:a,clientId:i?.clientId,redirect:{success:i?.redirectUrl||window.location.href,error:i?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth({type:"AUTHENTICATION_FAILED"}),Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth({type:"AUTHENTICATION_FAILED"}),t}},[o,a,i,e]),l=t.useCallback(async()=>{try{i?.callbacks?.onSignOut&&"function"==typeof i.callbacks.onSignOut&&await i.callbacks.onSignOut(),e.auth({type:"REMOVE_SESSION"}),s(),p()}catch(e){p()}},[e,s,i?.callbacks?.onSignOut]);return t.useMemo(()=>({user:n.session?.user,session:n.session,isLoading:n.isLoading,isAuthenticated:n.isAuthenticated,isRedirecting:n.isRedirecting,status:n.status,signIn:c,signOut:l}),[n,c,l])}exports.BetaForm=({onSuccess:n,onError:r,className:o="w-full",fieldClassName:a="flex flex-col gap-1.5 w-full",language:i,customTexts:s={},autoFocus:c=!0,showSuccessMessage:l=!0,hideLogo:d=!1,hideTitles:u=!1})=>{const[f,m]=t.useState("en"),[p,h]=t.useState(!1),[b,g]=t.useState(!1),{submitBetaForm:v,isLoading:w,isSubmitting:y,error:x,config:A,success:S,message:k}=(()=>{const e=W(e=>e.os),[n,r]=t.useState(null),[o,a]=t.useState(!0),[i,s]=t.useState(!1),[c,l]=t.useState(null),[d,u]=t.useState(!1),[f,m]=t.useState(null);return t.useEffect(()=>{(async()=>{a(!0);const t=new Ai(e),n=await t.fetchConfig();r(n),a(!1)})()},[e]),{isLoading:o,isSubmitting:i,config:n,error:c,success:d,message:f,submitBetaForm:t.useCallback(async t=>{if(!e){const e="SaaS OS context is not initialized";return l(e),{success:!1,message:e}}try{s(!0),l(null),u(!1),m(null);const n=new Ai(e),r=await n.submitBetaUser({name:t.name||"",email:t.email}),o="success"===r.status;return u(o),m(r.message),{success:o,message:r.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return l(t),u(!1),m(t),{success:!1,message:t}}finally{s(!1)}},[e])}})();t.useEffect(()=>{m((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(_s).indexOf(e)?e:"en"})())},[]),t.useEffect(()=>{S&&l&&(h(!0),g(!0)),x&&g(!0)},[S,l,x]);const T={..._s[i||f],...s},C=mt({resolver:mo(Rs),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{c&&C.setFocus("name")},[c,C]);const N=C.formState.isValid&&!y;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?e.jsxs("div",{className:Aa("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",o),children:[e.jsx(xi,{className:"h-24 w-24 rounded-lg"}),e.jsx(xi,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(xi,{className:"h-4 w-16"}),e.jsx(xi,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xi,{className:"h-4 w-16"}),e.jsx(xi,{className:"h-10 w-full"})]}),e.jsx(xi,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!d&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[A?.logo&&e.jsx(Is,{logo:A?.logo}),A?.name&&e.jsx("div",{children:A?.name})]}),e.jsx(Se,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(async e=>{try{const t=await v(e);t.success?(n?.(),C.reset(),l&&h(!0),g(!0)):(r?.(t.message),g(!0))}catch(e){r?.(e instanceof Error?e.message:T.errorMessage),g(!0)}}),className:o,noValidate:!0,"aria-busy":y,children:[!b&&e.jsxs(e.Fragment,{children:[!u&&A?.screen?.register&&e.jsx(Ds,{screen:A?.screen?.register}),e.jsx(fi,{control:C.control,name:"name",render:({field:t})=>e.jsxs(hi,{className:a,children:[e.jsx(bi,{children:T.nameLabel}),e.jsx(gi,{children:e.jsx(yi,{...t})}),e.jsx(vi,{}),e.jsx(wi,{})]})}),e.jsx(fi,{control:C.control,name:"email",render:({field:t})=>e.jsxs(hi,{className:a,children:[e.jsx(bi,{children:T.emailLabel}),e.jsx(gi,{children:e.jsx(yi,{...t})}),e.jsx(vi,{}),e.jsx(wi,{})]})}),e.jsx(oi,{type:"submit",disabled:!N,className:a,children:y?T.submittingText:T.submitText})]}),b&&x&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),x]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(oi,{type:"button",onClick:()=>{g(!1),C.reset()},className:a,children:"Try Again"})})]}),b&&p&&k&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:A?.screen?.thankYou&&e.jsx(Ds,{screen:A?.screen?.thankYou})})]})}),!b&&e.jsx("div",{children:e.jsxs("div",{children:["By submitting this form, you consent to our"," ",e.jsx("a",{href:A?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e.jsx("a",{href:A?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})},exports.SaaSOSProvider=X,exports.WhenAuthenticated=e=>{const{children:t}=e,{status:n}=Yy();return n!==c.authenticated?null:t},exports.WhenRoles=e=>{const{children:t,fallback:n,roles:r}=e,{user:o}=Yy();return r.includes(o?.role??"")?t:n||null},exports.WhenUnauthenticated=e=>{const{children:t}=e,{status:n}=Yy();return n===c.authenticated?null:t},exports.WhenWorkspaceFeatureDisabled=e=>{const{children:t,slug:n}=e,{currentWorkspace:r}=qy(),o=r?.features?.[n];return o?null:t},exports.WhenWorkspaceFeatureEnabled=e=>{const{children:t,slug:n}=e,{currentWorkspace:r}=qy(),o=r?.features?.[n];return o?t:null},exports.WhenWorkspaceRoles=e=>{const{children:t,fallback:n,roles:r}=e,{user:o}=Yy(),{currentWorkspace:a}=qy(),i=a?.users.find(e=>e.t===o?.id);return i&&r.includes(i?.role??"")?t:n||null},exports.WorkspaceSwitcher=Ky,exports.eventEmitter=J,exports.useSaaSAuth=Yy,exports.useSaaSSettings=Rp,exports.useSaaSWorkspaces=qy;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=r(t),a=r(n);exports.ApiVersion=void 0,(exports.ApiVersion||(exports.ApiVersion={})).V1="v1";const i=e=>({type:"SET_SESSION",payload:e});function s({name:n,initialState:r,reducer:o,initializer:a}){const i=t.createContext(null),s=t.createContext(null),c=t.createContext(null),l=t.memo(({children:n})=>{const[l,d]=t.useReducer(o,r,a||(e=>e)),u=t.useMemo(()=>({state:l,dispatch:d}),[l,d]);return e.jsx(c.Provider,{value:u,children:e.jsx(i.Provider,{value:l,children:e.jsx(s.Provider,{value:d,children:n})})})});l.displayName=n+"Provider";const d=()=>{const e=t.useContext(i);if(null===e)throw Error(`use${n}State must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw Error(`use${n}Context must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:d,useDispatch:()=>{const e=t.useContext(s);if(null===e)throw Error(`use${n}Dispatch must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,n)=>{const r=d(),o=e||(e=>e),a=t.useRef(o),i=t.useRef(n),s=t.useRef(void 0),c=t.useRef(r);return e&&(a.current=o),n&&(i.current=n),t.useMemo(()=>{const e=a.current(r);return void 0!==s.current&&(i.current?i.current(s.current,e):Object.is(s.current,e))&&c.current===r?s.current:(s.current=e,c.current=r,e)},[r])}}}var c;function l(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(e){return null}}function d(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(e){}}function u(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(e){}}!function(e){e.loading="loading",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(c||(c={}));const f="code",m="saas-session-id";function p(){u(m)}function h(){if("undefined"==typeof window)return null;try{return l(m)}catch(e){return null}}function b(){const e=h(),t={};return e&&(t["x-session-id"]=e),t}function g(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}const v=()=>({session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:c.unauthenticated}),{Provider:w,useState:y,useDispatch:x}=s({name:"Auth",initialState:v(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:c.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:c.unauthenticated};case"SET_SESSION":{const r=t.payload;return n=r.sessionId,d(m,n),{...e,session:r,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:c.authenticated}}case"REMOVE_SESSION":return p(),{...e,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:c.unauthenticated};default:return e}var n},initializer:v}),A=w,S=y,k=x,T=e=>({type:"SET_SETTINGS",payload:e}),C=()=>({serverUrl:"",version:exports.ApiVersion.V1,orgId:"",settings:null}),{Provider:N,useState:E,useDispatch:P}=s({name:"OS",initialState:C(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return C();case"SET_SETTINGS":return{...e,settings:t.payload};default:return e}}}),M=N,O=E,R=P,_=e=>({type:"SET_WORKSPACES",payload:e}),D=e=>({type:"SET_LOADING",payload:e}),I=e=>({type:"SET_ERROR",payload:e}),U=e=>({type:"SET_REFRESHING",payload:e}),F="saas-workspace-current",{Provider:j,useState:L,useDispatch:B}=s({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switching:!1,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return{...e,workspaces:t.payload};case"SET_ALL_FEATURES":return{...e,allFeatures:t.payload};case"SET_CURRENT_WORKSPACE":return(n=t.payload.t)?d(F,n):u(F),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return u(F),{...e,currentWorkspace:null};case"SET_IS_INITIALIZED":return{...e,isInitialized:t.payload};case"SET_LOADING":return{...e,loading:t.payload};case"SET_ERROR":return{...e,error:t.payload};case"SET_REFRESHING":return{...e,refreshing:t.payload};case"SET_SWITCHING":return{...e,switching:t.payload};default:return e}var n}}),$=j,z=L,G=B,Z=t.memo(({children:t})=>e.jsx(M,{children:e.jsx(A,{children:e.jsx($,{children:t})})}));function W(e,n){const r=O(),o=S(),a=z(),i=t.useMemo(()=>({os:r,auth:o,workspaces:a}),[r,o,a]),s=e||(e=>e),c=t.useRef(s),l=t.useRef(n),d=t.useRef(void 0),u=t.useRef(i);return e&&(c.current=s),t.useMemo(()=>{const e=c.current(i);return void 0!==d.current&&(l.current?l.current(d.current,e):Object.is(d.current,e))&&u.current===i?d.current:(d.current=e,u.current=i,e)},[i])}function K(){const e=k(),n=R(),r=G();return t.useMemo(()=>({auth:e,os:n,workspaces:r}),[e,n,r])}Z.displayName="SDKContextProvider";const V=t.memo(({children:n,callbacks:r})=>{const o=K(),a=W(e=>e.auth),s=W(e=>e.os),c=t.useRef(!1),l=t.useRef(null),d=t.useMemo(()=>r,[r]),u=t.useCallback(async e=>{try{if(d?.handleAuthentication){const{sessionId:t}=await d.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw Error("Invalid sessionId received from authentication callback");const n=s,{serverUrl:r,version:a,orgId:c}=n;if(!r||!a||!c)throw Error("OS configuration is not available");const l=await fetch(`${r}/api/${a}/public/profile`,{headers:{"x-session-id":t,"Content-Type":"application/json"}});if(!l.ok)throw Error("Failed to fetch user profile");let u;try{u=await l.json()}catch(e){throw Error("Failed to parse user profile response")}const m=g({id:u.t||u.id,name:u.name||"",org:c,email:u.email||"",emailVerified:!0,clientId:n.auth?.clientId||"",role:u.role||"",image:u.image},t);o.auth(i(m)),function(){try{const e=new URL(window.location.href);e.searchParams.delete(f),window.history.replaceState({},"",e.toString())}catch(e){}}()}}catch(e){throw o.auth({type:"AUTHENTICATION_FAILED"}),e}},[o,d,s]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(a.isAuthenticated)return;const e=h();e&&(async()=>{try{const{serverUrl:t,version:n,orgId:r}=s;if(!t||!n||!r)return;const a=await fetch(`${t}/api/${n}/public/profile`,{headers:{"x-session-id":e,"Content-Type":"application/json"}});if(!a.ok)return void p();let c;try{c=await a.json()}catch(e){return void p()}const l=g({id:c.t||c.id,name:c.name||"",org:r,email:c.email||"",emailVerified:!0,clientId:s.auth?.clientId||"",role:c.role||"",image:c.image},e);o.auth(i(l))}catch(e){p()}})()},[a.isAuthenticated,o,s]),t.useEffect(()=>{const e=function(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(f)}catch(e){return null}}();if(!e)return;if(c.current||l.current===e)return;const{serverUrl:t,version:n,orgId:r}=s;t&&n&&r&&(c.current=!0,l.current=e,u(e).then(()=>{l.current=null}).catch(e=>{l.current=null}).finally(()=>{c.current=!1}))},[u,s.serverUrl,s.version,s.orgId]),e.jsx(e.Fragment,{children:n})});V.displayName="AuthProviderWrapper";const H=t.memo(({config:n,auth:r,children:o})=>{const a=K(),i=W(e=>e.os),s=t.useMemo(()=>({clientId:r?.clientId||"",redirectUrl:r?.redirectUrl||"",callbacks:r?.callbacks}),[r?.clientId,r?.redirectUrl,r?.callbacks]);t.useEffect(()=>{a.os((e=>({type:"SET_SAAS_OS_CONFIG",payload:e}))({...n,auth:s}))},[n,s,a]),t.useEffect(()=>{const{serverUrl:e,version:t,orgId:n,settings:r}=i;e&&t&&n&&!r&&(async()=>{try{const r=b(),o=await fetch(`${e}/api/${t}/public/${n}/settings`,{headers:r});if(o.ok){const e=await o.json();a.os(T(e))}}catch(e){}})()},[i.serverUrl,i.version,i.orgId,i.settings,a]);const c=t.useMemo(()=>o,[o]);return e.jsx(e.Fragment,{children:c})});H.displayName="ContextConfigProvider";const J=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(e){}}async emitUserCreated(e){await this.emit("user:created",{user:e})}async emitUserUpdated(e,t){await this.emit("user:updated",{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit("workspace:changed",{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit("workspace:updated",{workspace:e})}async emitWorkspaceUserAdded(e,t,n){await this.emit("workspace:user-added",{userId:e,workspace:t,role:n})}async emitWorkspaceUserRemoved(e,t,n){await this.emit("workspace:user-removed",{userId:e,workspace:t,role:n})}async emitWorkspaceUserRoleChanged(e,t,n,r){await this.emit("workspace:user-role-changed",{userId:e,workspace:t,previousRole:n,newRole:r})}async emitWorkspaceCreated(e){await this.emit("workspace:created",{workspace:e})}async emitWorkspaceDeleted(e){await this.emit("workspace:deleted",{workspace:e})}},q=t.createContext({container:null,setContainer:()=>{}}),Y=t.memo(({children:n})=>{const[r,o]=t.useState(null),a=t.useMemo(()=>({container:r,setContainer:o}),[r]),i=t.useMemo(()=>n,[n]);return e.jsxs(q.Provider,{value:a,children:[i,e.jsx("div",{ref:o,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});Y.displayName="PortalProvider";const X=t.memo(({serverUrl:n,version:r,orgId:o,auth:a,children:i})=>{((e,t,n)=>{if(t!==exports.ApiVersion.V1)throw Error(`Invalid version: "${t}". Only "${exports.ApiVersion.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!n||"string"!=typeof n)throw Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(n))throw Error(`Invalid orgId: "${n}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)})(n,r,o);const s=t.useMemo(()=>({serverUrl:n,version:r,orgId:o}),[n,r,o]),c=t.useMemo(()=>a?.callbacks,[a?.callbacks]),l=t.useMemo(()=>a?.callbacks?.handleEvent,[a?.callbacks]);return t.useEffect(()=>(J.setCallbacks(l?{handleEvent:l}:null),()=>{J.setCallbacks(null)}),[l]),e.jsx(Z,{children:e.jsx(V,{callbacks:c,children:e.jsx(Y,{children:e.jsx(H,{config:s,auth:a,children:i})})})})});X.displayName="SaaSOSProvider";var Q=e=>"checkbox"===e.type,ee=e=>e instanceof Date,te=e=>null==e;const ne=e=>"object"==typeof e;var re=e=>!te(e)&&!Array.isArray(e)&&ne(e)&&!ee(e),oe=e=>re(e)&&e.target?Q(e.target)?e.target.checked:e.target.value:e,ae=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),ie="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function se(e){let t;const n=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(ie&&(e instanceof Blob||r)||!n&&!re(e))return e;if(t=n?[]:Object.create(Object.getPrototypeOf(e)),n||(e=>{const t=e.constructor&&e.constructor.prototype;return re(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=se(e[n]));else t=e}return t}var ce=e=>/^\w*$/.test(e),le=e=>void 0===e,de=e=>Array.isArray(e)?e.filter(Boolean):[],ue=e=>de(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,n)=>{if(!t||!re(e))return n;const r=(ce(t)?[t]:ue(t)).reduce((e,t)=>te(e)?e:e[t],e);return le(r)||r===e?le(e[t])?n:e[t]:r},me=e=>"boolean"==typeof e,pe=(e,t,n)=>{let r=-1;const o=ce(t)?[t]:ue(t),a=o.length,i=a-1;for(;++r<a;){const t=o[r];let a=n;if(r!==i){const n=e[t];a=re(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const he="blur",be="onChange",ge="onSubmit",ve="all",we="pattern",ye="required",xe=t.createContext(null);xe.displayName="HookFormContext";const Ae=()=>t.useContext(xe),Se=e=>{const{children:n,...r}=e;return t.createElement(xe.Provider,{value:r},n)};var ke=(e,t,n,r=!0)=>{const o={defaultValues:t.o};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t.i[o]!==ve&&(t.i[o]=!r||ve),n&&(n[o]=!0),e[o]}});return o};const Te="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var Ce=e=>"string"==typeof e,Ne=(e,t,n,r,o)=>Ce(e)?(r&&t.watch.add(e),fe(n,e,o)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),fe(n,e))):(r&&(t.watchAll=!0),n),Ee=e=>te(e)||!ne(e);function Pe(e,t,n=new WeakSet){if(Ee(e)||Ee(t))return e===t;if(ee(e)&&ee(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const a of r){const r=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(ee(r)&&ee(e)||re(r)&&re(e)||Array.isArray(r)&&Array.isArray(e)?!Pe(r,e,n):r!==e)return!1}}return!0}const Me=e=>e.render(function(e){const n=Ae(),{name:r,disabled:o,control:a=n.control,shouldUnregister:i,defaultValue:s}=e,c=ae(a.l.array,r),l=t.useMemo(()=>fe(a.u,r,fe(a.o,r,s)),[a,r,s]),d=function(e){const n=Ae(),{control:r=n.control,name:o,defaultValue:a,disabled:i,exact:s,compute:c}=e||{},l=t.useRef(a),d=t.useRef(c),u=t.useRef(void 0);d.current=c;const f=t.useMemo(()=>r.v(o,l.current),[r,o]),[m,p]=t.useState(d.current?d.current(f):f);return Te(()=>r.A({name:o,formState:{values:!0},exact:s,callback:e=>{if(!i){const t=Ne(o,r.l,e.values||r.u,!1,l.current);if(d.current){const e=d.current(t);Pe(e,u.current)||(p(e),u.current=e)}else p(t)}}}),[r,i,o,s]),t.useEffect(()=>r.S()),m}({control:a,name:r,defaultValue:l,exact:!0}),u=function(e){const n=Ae(),{control:r=n.control,disabled:o,name:a,exact:i}=e||{},[s,c]=t.useState(r.k),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Te(()=>r.A({name:a,formState:l.current,exact:i,callback:e=>{!o&&c({...r.k,...e})}}),[a,o,i]),t.useEffect(()=>{l.current.isValid&&r.T(!0)},[r]),t.useMemo(()=>ke(s,r,l.current,!1),[s,r])}({control:a,name:r,exact:!0}),f=t.useRef(e),m=t.useRef(a.register(r,{...e.rules,value:d,...me(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const p=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!fe(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!fe(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!fe(u.validatingFields,r)},error:{enumerable:!0,get:()=>fe(u.errors,r)}}),[u,r]),h=t.useCallback(e=>m.current.onChange({target:{value:oe(e),name:r},type:"change"}),[r]),b=t.useCallback(()=>m.current.onBlur({target:{value:fe(a.u,r),name:r},type:he}),[r,a.u]),g=t.useCallback(e=>{const t=fe(a.C,r);t&&e&&(t.N.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[a.C,r]),v=t.useMemo(()=>({name:r,value:d,...me(o)||u.disabled?{disabled:u.disabled||o}:{},onChange:h,onBlur:b,ref:g}),[r,o,u.disabled,h,b,g,d]);return t.useEffect(()=>{const e=a.P.shouldUnregister||i;a.register(r,{...f.current.rules,...me(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const n=fe(a.C,e);n&&n.N&&(n.N.mount=t)};if(t(r,!0),e){const e=se(fe(a.P.defaultValues,r));pe(a.o,r,e),le(fe(a.u,r))&&pe(a.u,r,e)}return!c&&a.register(r),()=>{(c?e&&!a.M.action:e)?a.unregister(r):t(r,!1)}},[r,a,c,i]),t.useEffect(()=>{a.O({disabled:o,name:r})},[o,r,a]),t.useMemo(()=>({field:v,formState:u,fieldState:p}),[v,u,p])}(e));var Oe=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Re=e=>Array.isArray(e)?e:[e],_e=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},De=e=>re(e)&&!Object.keys(e).length,Ie=e=>"file"===e.type,Ue=e=>"function"==typeof e,Fe=e=>{if(!ie)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},je=e=>"select-multiple"===e.type,Le=e=>"radio"===e.type,Be=e=>Fe(e)&&e.isConnected;function $e(e,t){const n=Array.isArray(t)?t:ce(t)?[t]:ue(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;n>r;)e=le(e)?r++:e[t[r++]];return e}(e,n),o=n.length-1,a=n[o];return r&&delete r[a],0!==o&&(re(r)&&De(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!le(e[t]))return!1;return!0}(r))&&$e(e,n.slice(0,-1)),e}var ze=e=>{for(const t in e)if(Ue(e[t]))return!0;return!1};function Ge(e,t={}){const n=Array.isArray(e);if(re(e)||n)for(const n in e)Array.isArray(e[n])||re(e[n])&&!ze(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Ge(e[n],t[n])):te(e[n])||(t[n]=!0);return t}function Ze(e,t,n){const r=Array.isArray(e);if(re(e)||r)for(const r in e)Array.isArray(e[r])||re(e[r])&&!ze(e[r])?le(t)||Ee(n[r])?n[r]=Array.isArray(e[r])?Ge(e[r],[]):{...Ge(e[r])}:Ze(e[r],te(t)?{}:t[r],n[r]):n[r]=!Pe(e[r],t[r]);return n}var We=(e,t)=>Ze(e,t,Ge(t));const Ke={value:!1,isValid:!1},Ve={value:!0,isValid:!0};var He=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!le(e[0].attributes.value)?le(e[0].value)||""===e[0].value?Ve:{value:e[0].value,isValid:!0}:Ve:Ke}return Ke},Je=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>le(e)?e:t?""===e?NaN:e?+e:e:n&&Ce(e)?new Date(e):r?r(e):e;const qe={isValid:!1,value:null};var Ye=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,qe):qe;function Xe(e){const t=e.ref;return Ie(t)?t.files:Le(t)?Ye(e.refs).value:je(t)?[...t.selectedOptions].map(({value:e})=>e):Q(t)?He(e.refs).value:Je(le(t.value)?e.ref.value:t.value,e)}var Qe=e=>e instanceof RegExp,et=e=>le(e)?e:Qe(e)?e.source:re(e)?Qe(e.value)?e.value.source:e.value:e,tt=e=>({isOnSubmit:!e||e===ge,isOnBlur:"onBlur"===e,isOnChange:e===be,isOnAll:e===ve,isOnTouch:"onTouched"===e});const nt="AsyncFunction";var rt=e=>!!e&&!!e.validate&&!!(Ue(e.validate)&&e.validate.constructor.name===nt||re(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===nt)),ot=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const at=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const n=fe(e,o);if(n){const{N:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!r)return!0;if(e.ref&&t(e.ref,e.name)&&!r)return!0;if(at(a,t))break}else if(re(a)&&at(a,t))break}}};function it(e,t,n){const r=fe(e,n);if(r||ce(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const r=o.join("."),a=fe(t,r),i=fe(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(i&&i.type)return{name:r,error:i};if(i&&i.root&&i.root.type)return{name:r+".root",error:i.root};o.pop()}return{name:n}}var st=(e,t,n)=>{const r=Re(fe(e,n));return pe(r,"root",t[n]),pe(e,n,r),e},ct=e=>Ce(e);function lt(e,t,n="validate"){if(ct(e)||Array.isArray(e)&&e.every(ct)||me(e)&&!e)return{type:n,message:ct(e)?e:"",ref:t}}var dt=e=>re(e)&&!Qe(e)?e:{value:e,message:""},ut=async(e,t,n,r,o,a)=>{const{ref:i,refs:s,required:c,maxLength:l,minLength:d,min:u,max:f,pattern:m,validate:p,name:h,valueAsNumber:b,mount:g}=e.N,v=fe(n,h);if(!g||t.has(h))return{};const w=s?s[0]:i,y=e=>{o&&w.reportValidity&&(w.setCustomValidity(me(e)?"":e||""),w.reportValidity())},x={},A=Le(i),S=Q(i),k=A||S,T=(b||Ie(i))&&le(i.value)&&le(v)||Fe(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,C=Oe.bind(null,h,r,x),N=(e,t,n,r="maxLength",o="minLength")=>{const a=e?t:n;x[h]={type:e?r:o,message:a,ref:i,...C(e?r:o,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!k&&(T||te(v))||me(v)&&!v||S&&!He(s).isValid||A&&!Ye(s).isValid)){const{value:e,message:t}=ct(c)?{value:!!c,message:c}:dt(c);if(e&&(x[h]={type:ye,message:t,ref:w,...C(ye,t)},!r))return y(t),x}if(!(T||te(u)&&te(f))){let e,t;const n=dt(f),o=dt(u);if(te(v)||isNaN(v)){const r=i.valueAsDate||new Date(v),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,c="week"==i.type;Ce(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),Ce(o.value)&&v&&(t=s?a(v)<a(o.value):c?v<o.value:r<new Date(o.value))}else{const r=i.valueAsNumber||(v?+v:v);te(n.value)||(e=r>n.value),te(o.value)||(t=r<o.value)}if((e||t)&&(N(!!e,n.message,o.message,"max","min"),!r))return y(x[h].message),x}if((l||d)&&!T&&(Ce(v)||a&&Array.isArray(v))){const e=dt(l),t=dt(d),n=!te(e.value)&&v.length>+e.value,o=!te(t.value)&&v.length<+t.value;if((n||o)&&(N(n,e.message,t.message),!r))return y(x[h].message),x}if(m&&!T&&Ce(v)){const{value:e,message:t}=dt(m);if(Qe(e)&&!v.match(e)&&(x[h]={type:we,message:t,ref:i,...C(we,t)},!r))return y(t),x}if(p)if(Ue(p)){const e=lt(await p(v,n),w);if(e&&(x[h]={...e,...C("validate",e.message)},!r))return y(e.message),x}else if(re(p)){let e={};for(const t in p){if(!De(e)&&!r)break;const o=lt(await p[t](v,n),w,t);o&&(e={...o,...C(t,o.message)},y(o.message),r&&(x[h]=e))}if(!De(e)&&(x[h]={ref:w,...e},!r))return x}return y(!0),x};const ft={mode:ge,reValidateMode:be,shouldFocusError:!0};function mt(e={}){const n=t.useRef(void 0),r=t.useRef(void 0),[o,a]=t.useState({isDirty:!1,isValidating:!1,isLoading:Ue(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Ue(e.defaultValues)?void 0:e.defaultValues});if(!n.current)if(e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!Ue(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...r}=function(e={}){let t,n={...ft,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ue(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},o={},a=(re(n.defaultValues)||re(n.values))&&se(n.defaultValues||n.values)||{},i=n.shouldUnregister?{}:se(a),s={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...d};const f={array:_e(),state:_e()},m=n.criteriaMode===ve,p=async e=>{if(!n.disabled&&(d.isValid||u.isValid||e)){const e=n.resolver?De((await v()).errors):await w(o,!0);e!==r.isValid&&f.state.next({isValid:e})}},h=(e,t)=>{!n.disabled&&(d.isValidating||d.validatingFields||u.isValidating||u.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?pe(r.validatingFields,e,t):$e(r.validatingFields,e))}),f.state.next({validatingFields:r.validatingFields,isValidating:!De(r.validatingFields)}))},b=(e,t,n,r)=>{const c=fe(o,e);if(c){const o=fe(i,e,le(n)?fe(a,e):n);le(o)||r&&r.defaultChecked||t?pe(i,e,t?o:Xe(c.N)):A(e,o),s.mount&&p()}},g=(e,t,o,i,s)=>{let c=!1,l=!1;const m={name:e};if(!n.disabled){if(!o||i){(d.isDirty||u.isDirty)&&(l=r.isDirty,r.isDirty=m.isDirty=y(),c=l!==m.isDirty);const n=Pe(fe(a,e),t);l=!!fe(r.dirtyFields,e),n?$e(r.dirtyFields,e):pe(r.dirtyFields,e,!0),m.dirtyFields=r.dirtyFields,c=c||(d.dirtyFields||u.dirtyFields)&&l!==!n}if(o){const t=fe(r.touchedFields,e);t||(pe(r.touchedFields,e,o),m.touchedFields=r.touchedFields,c=c||(d.touchedFields||u.touchedFields)&&t!==o)}c&&s&&f.state.next(m)}return c?m:{}},v=async e=>{h(e,!0);const t=await n.resolver(i,n.context,((e,t,n,r)=>{const o={};for(const n of e){const e=fe(t,n);e&&pe(o,n,e.N)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}})(e||c.mount,o,n.criteriaMode,n.shouldUseNativeValidation));return h(e),t},w=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{N:e,...l}=s;if(e){const l=c.array.has(e.name),u=s.N&&rt(s.N);u&&d.validatingFields&&h([a],!0);const f=await ut(s,c.disabled,i,m,n.shouldUseNativeValidation&&!t,l);if(u&&d.validatingFields&&h([a]),f[e.name]&&(o.valid=!1,t))break;!t&&(fe(f,e.name)?l?st(r.errors,f,e.name):pe(r.errors,e.name,f[e.name]):$e(r.errors,e.name))}!De(l)&&await w(l,t,o)}}return o.valid},y=(e,t)=>!n.disabled&&(e&&t&&pe(i,e,t),!Pe(E(),a)),x=(e,t,n)=>Ne(e,c,{...s.mount?i:le(t)?a:Ce(e)?{[e]:t}:t},n,t),A=(e,t,n={})=>{const r=fe(o,e);let a=t;if(r){const n=r.N;n&&(!n.disabled&&pe(i,e,Je(t,n)),a=Fe(n.ref)&&te(t)?"":t,je(n.ref)?[...n.ref.options].forEach(e=>e.selected=a.includes(e.value)):n.refs?Q(n.ref)?n.refs.forEach(e=>{e.defaultChecked&&e.disabled||(e.checked=Array.isArray(a)?!!a.find(t=>t===e.value):a===e.value||!!a)}):n.refs.forEach(e=>e.checked=e.value===a):Ie(n.ref)?n.ref.value="":(n.ref.value=a,n.ref.type||f.state.next({name:e,values:se(i)})))}(n.shouldDirty||n.shouldTouch)&&g(e,a,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&N(e)},S=(e,t,n)=>{for(const r in t){if(!t.hasOwnProperty(r))return;const a=t[r],i=e+"."+r,s=fe(o,i);(c.array.has(e)||re(a)||s&&!s.N)&&!ee(a)?S(i,a,n):A(i,a,n)}},k=(e,t,n={})=>{const l=fe(o,e),m=c.array.has(e),p=se(t);pe(i,e,p),m?(f.array.next({name:e,values:se(i)}),(d.isDirty||d.dirtyFields||u.isDirty||u.dirtyFields)&&n.shouldDirty&&f.state.next({name:e,dirtyFields:We(a,i),isDirty:y(e,p)})):!l||l.N||te(p)?A(e,p,n):S(e,p,n),ot(e,c)&&f.state.next({...r,name:e}),f.state.next({name:s.mount?e:void 0,values:se(i)})},T=async e=>{s.mount=!0;const a=e.target;let b=a.name,y=!0;const x=fe(o,b),A=e=>{y=Number.isNaN(e)||ee(e)&&isNaN(e.getTime())||Pe(e,fe(i,b,e))},S=tt(n.mode),k=tt(n.reValidateMode);if(x){let s,T;const C=a.type?Xe(x.N):oe(e),E=e.type===he||"focusout"===e.type,P=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(x.N)&&!n.resolver&&!fe(r.errors,b)&&!x.N.deps||((e,t,n,r,o)=>!o.isOnAll&&(!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:!(n?r.isOnChange:o.isOnChange)||e))(E,fe(r.touchedFields,b),r.isSubmitted,k,S),M=ot(b,c,E);pe(i,b,C),E?a&&a.readOnly||(x.N.onBlur&&x.N.onBlur(e),t&&t(0)):x.N.onChange&&x.N.onChange(e);const O=g(b,C,E),R=!De(O)||M;if(!E&&f.state.next({name:b,type:e.type,values:se(i)}),P)return(d.isValid||u.isValid)&&("onBlur"===n.mode?E&&p():E||p()),R&&f.state.next({name:b,...M?{}:O});if(!E&&M&&f.state.next({...r}),n.resolver){const{errors:e}=await v([b]);if(A(C),y){const t=it(r.errors,o,b),n=it(e,o,t.name||b);s=n.error,b=n.name,T=De(e)}}else h([b],!0),s=(await ut(x,c.disabled,i,m,n.shouldUseNativeValidation))[b],h([b]),A(C),y&&(s?T=!1:(d.isValid||u.isValid)&&(T=await w(o,!0)));y&&(x.N.deps&&N(x.N.deps),((e,o,a,i)=>{const s=fe(r.errors,e),c=(d.isValid||u.isValid)&&me(o)&&r.isValid!==o;var m;if(n.delayError&&a?(m=()=>((e,t)=>{pe(r.errors,e,t),f.state.next({errors:r.errors})})(e,a),t=e=>{clearTimeout(l),l=setTimeout(m,e)},t(n.delayError)):(clearTimeout(l),t=null,a?pe(r.errors,e,a):$e(r.errors,e)),(a?!Pe(s,a):s)||!De(i)||c){const t={...i,...c&&me(o)?{isValid:o}:{},errors:r.errors,name:e};r={...r,...t},f.state.next(t)}})(b,T,s,O))}},C=(e,t)=>{if(fe(r.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let a,i;const s=Re(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await v(e);if(e)for(const n of e){const e=fe(t,n);e?pe(r.errors,n,e):$e(r.errors,n)}else r.errors=t;return t})(le(e)?e:s);a=De(t),i=e?!s.some(e=>fe(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=fe(o,e);return await w(t&&t.N?{[e]:t}:t)}))).every(Boolean),(i||r.isValid)&&p()):i=a=await w(o);return f.state.next({...!Ce(e)||(d.isValid||u.isValid)&&a!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:a}:{},errors:r.errors}),t.shouldFocus&&!i&&at(o,C,e?s:c.mount),i},E=e=>{const t={...s.mount?i:a};return le(e)?t:Ce(e)?fe(t,e):e.map(e=>fe(t,e))},P=(e,t)=>({invalid:!!fe((t||r).errors,e),isDirty:!!fe((t||r).dirtyFields,e),error:fe((t||r).errors,e),isValidating:!!fe(r.validatingFields,e),isTouched:!!fe((t||r).touchedFields,e)}),M=(e,t,n)=>{const a=(fe(o,e,{N:{}}).N||{}).ref,i=fe(r.errors,e)||{},{ref:s,message:c,type:l,...d}=i;pe(r.errors,e,{...d,...t,ref:a}),f.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&a&&a.focus&&a.focus()},O=e=>f.state.subscribe({next:t=>{var n,o,s;n=e.name,o=t.name,s=e.exact,n&&o&&n!==o&&!Re(n).some(e=>e&&(s?e===o:e.startsWith(o)||o.startsWith(e)))||!((e,t,n,r)=>{n(e);const{name:o,...a}=e;return De(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||ve))})(t,e.formState||d,L,e.reRenderRoot)||e.callback({values:{...i},...r,...t,defaultValues:a})}}).unsubscribe,R=(e,t={})=>{for(const s of e?Re(e):c.mount)c.mount.delete(s),c.array.delete(s),t.keepValue||($e(o,s),$e(i,s)),!t.keepError&&$e(r.errors,s),!t.keepDirty&&$e(r.dirtyFields,s),!t.keepTouched&&$e(r.touchedFields,s),!t.keepIsValidating&&$e(r.validatingFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&$e(a,s);f.state.next({values:se(i)}),f.state.next({...r,...t.keepDirty?{isDirty:y()}:{}}),!t.keepIsValid&&p()},_=({disabled:e,name:t})=>{(me(e)&&s.mount||e||c.disabled.has(t))&&(e?c.disabled.add(t):c.disabled.delete(t))},D=(e,t={})=>{let r=fe(o,e);const i=me(t.disabled)||me(n.disabled);return pe(o,e,{...r||{},N:{...r&&r.N?r.N:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),r?_({disabled:me(t.disabled)?t.disabled:n.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||n.disabled}:{},...n.progressive?{required:!!t.required,min:et(t.min),max:et(t.max),minLength:et(t.minLength),maxLength:et(t.maxLength),pattern:et(t.pattern)}:{},name:e,onChange:T,onBlur:T,ref:i=>{if(i){D(e,t),r=fe(o,e);const n=le(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>Le(e)||Q(e))(n),c=r.N.refs||[];if(s?c.find(e=>e===n):n===r.N.ref)return;pe(o,e,{N:{...r.N,...s?{refs:[...c.filter(Be),n,...Array.isArray(fe(a,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),b(e,!1,void 0,n)}else r=fe(o,e,{}),r.N&&(r.N.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!ae(c.array,e)||!s.action)&&c.unMount.add(e)}}},I=()=>n.shouldFocusError&&at(o,C,c.mount),U=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let l=se(i);if(f.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await v();r.errors=e,l=se(t)}else await w(o);if(c.disabled.size)for(const e of c.disabled)$e(l,e);if($e(r.errors,"root"),De(r.errors)){f.state.next({errors:{}});try{await e(l,a)}catch(e){s=e}}else t&&await t({...r.errors},a),I(),setTimeout(I);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:De(r.errors)&&!s,submitCount:r.submitCount+1,errors:r.errors}),s)throw s},F=(e,t={})=>{const l=e?se(e):a,u=se(l),m=De(e),p=m?a:u;if(t.keepDefaultValues||(a=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(We(a,i))]);for(const t of Array.from(e))fe(r.dirtyFields,t)?pe(p,t,fe(i,t)):k(t,fe(p,t))}else{if(ie&&le(e))for(const e of c.mount){const t=fe(o,e);if(t&&t.N){const e=Array.isArray(t.N.refs)?t.N.refs[0]:t.N.ref;if(Fe(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)k(e,fe(p,e));else o={}}i=n.shouldUnregister?t.keepDefaultValues?se(a):{}:se(p),f.array.next({values:{...p}}),f.state.next({values:{...p}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!n.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?r.submitCount:0,isDirty:!m&&(t.keepDirty?r.isDirty:!(!t.keepDefaultValues||Pe(e,a))),isSubmitted:!!t.keepIsSubmitted&&r.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&i?We(a,i):r.dirtyFields:t.keepDefaultValues&&e?We(a,e):t.keepDirty?r.dirtyFields:{},touchedFields:t.keepTouched?r.touchedFields:{},errors:t.keepErrors?r.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1,defaultValues:a})},j=(e,t)=>F(Ue(e)?e(i):e,t),L=e=>{r={...r,...e}},B={control:{register:D,unregister:R,getFieldState:P,handleSubmit:U,setError:M,A:O,R:v,_:I,v:x,D:y,T:p,I:(e,t=[],c,l,m=!0,p=!0)=>{if(l&&c&&!n.disabled){if(s.action=!0,p&&Array.isArray(fe(o,e))){const t=c(fe(o,e),l.argA,l.argB);m&&pe(o,e,t)}if(p&&Array.isArray(fe(r.errors,e))){const t=c(fe(r.errors,e),l.argA,l.argB);m&&pe(r.errors,e,t),((e,t)=>{!de(fe(e,t)).length&&$e(e,t)})(r.errors,e)}if((d.touchedFields||u.touchedFields)&&p&&Array.isArray(fe(r.touchedFields,e))){const t=c(fe(r.touchedFields,e),l.argA,l.argB);m&&pe(r.touchedFields,e,t)}(d.dirtyFields||u.dirtyFields)&&(r.dirtyFields=We(a,i)),f.state.next({name:e,isDirty:y(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else pe(i,e,t)},O:_,U:e=>{r.errors=e,f.state.next({errors:r.errors,isValid:!1})},F:e=>de(fe(s.mount?i:a,e,n.shouldUnregister?fe(a,e,[]):[])),j:F,L:()=>Ue(n.defaultValues)&&n.defaultValues().then(e=>{j(e,n.resetOptions),f.state.next({isLoading:!1})}),S:()=>{for(const e of c.unMount){const t=fe(o,e);t&&(t.N.refs?t.N.refs.every(e=>!Be(e)):!Be(t.N.ref))&&R(e)}c.unMount=new Set},B:e=>{me(e)&&(f.state.next({disabled:e}),at(o,(t,n)=>{const r=fe(o,n);r&&(t.disabled=r.N.disabled||e,Array.isArray(r.N.refs)&&r.N.refs.forEach(t=>{t.disabled=r.N.disabled||e}))},0,!1))},G:f,i:d,get C(){return o},get u(){return i},get M(){return s},set M(e){s=e},get o(){return a},get l(){return c},set l(e){c=e},get k(){return r},get P(){return n},set P(e){n={...n,...e}}},subscribe:e=>(s.mount=!0,u={...u,...e.formState},O({...e,formState:u})),trigger:N,register:D,handleSubmit:U,watch:(e,t)=>Ue(e)?f.state.subscribe({next:n=>"values"in n&&e(x(void 0,t),n)}):x(e,t,!0),setValue:k,getValues:E,reset:j,resetField:(e,t={})=>{fe(o,e)&&(le(t.defaultValue)?k(e,se(fe(a,e))):(k(e,t.defaultValue),pe(a,e,se(t.defaultValue))),t.keepTouched||$e(r.touchedFields,e),t.keepDirty||($e(r.dirtyFields,e),r.isDirty=t.defaultValue?y(e,se(fe(a,e))):y()),t.keepError||($e(r.errors,e),d.isValid&&p()),f.state.next({...r}))},clearErrors:e=>{e&&Re(e).forEach(e=>$e(r.errors,e)),f.state.next({errors:e?r.errors:{}})},unregister:R,setError:M,setFocus:(e,t={})=>{const n=fe(o,e),r=n&&n.N;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&Ue(e.select)&&e.select())}},getFieldState:P};return{...B,formControl:B}}(e);n.current={...r,formState:o}}const i=n.current.control;return i.P=e,Te(()=>{const e=i.A({formState:i.i,callback:()=>a({...i.k}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),i.k.isReady=!0,e},[i]),t.useEffect(()=>i.B(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i.P.mode=e.mode),e.reValidateMode&&(i.P.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i.U(e.errors),i._())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i.G.state.next({values:i.v()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i.i.isDirty){const e=i.D();e!==o.isDirty&&i.G.state.next({isDirty:e})}},[i,o.isDirty]),t.useEffect(()=>{e.values&&!Pe(e.values,r.current)?(i.j(e.values,{keepFieldsRef:!0,...i.P.resetOptions}),r.current=e.values,a(e=>({...e}))):i.L()},[i,e.values]),t.useEffect(()=>{i.M.mount||(i.T(),i.M.mount=!0),i.M.watch&&(i.M.watch=!1,i.G.state.next({...i.k})),i.S()}),n.current.formState=ke(o,i),n.current}const pt=(e,t,n)=>{if(e&&"reportValidity"in e){const r=fe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ht=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?pt(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>pt(t,n,e))}},bt=(e,t)=>{t.shouldUseNativeValidation&&ht(e,t);const n={};for(const r in e){const o=fe(t.fields,r),a=Object.assign(e[r]||{},{ref:o&&o.ref});if(gt(t.names||Object.keys(e),r)){const e=Object.assign({},fe(n,r));pe(e,"root",a),pe(n,r,e)}else pe(n,r,a)}return n},gt=(e,t)=>{const n=vt(t);return e.some(e=>vt(e).match(`^${n}\\.\\d+`))};function vt(e){return e.replace(/\]|\[/g,"")}function wt(e,t,n){function r(n,r){var o;Object.defineProperty(n,"Z",{value:n.Z??{},enumerable:!1}),(o=n.Z).traits??(o.traits=new Set),n.Z.traits.add(e),t(n,r);for(const e in i.prototype)e in n||Object.defineProperty(n,e,{value:i.prototype[e].bind(n)});n.Z.constr=i,n.Z.def=r}const o=n?.Parent??Object;class a extends o{}function i(e){var t;const o=n?.Parent?new a:this;r(o,e),(t=o.Z).deferred??(t.deferred=[]);for(const e of o.Z.deferred)e();return o}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?.Z?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class yt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class xt extends Error{constructor(e){super("Encountered unidirectional transform during encode: "+e),this.name="ZodEncodeError"}}const At={};function St(e){return At}function kt(e,t){return"bigint"==typeof t?t.toString():t}function Tt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ct(e){return null==e}function Nt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Et=Symbol("evaluating");function Pt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Et)return void 0===r&&(r=Et,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Mt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Rt(e){return JSON.stringify(e)}const _t="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Dt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const It=Tt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function Ut(e){if(!1===Dt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==Dt(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ft(e){return Ut(e)?{...e}:Array.isArray(e)?[...e]:e}const jt=new Set(["string","number","symbol"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bt(e,t,n){const r=new e.Z.constr(t??e.Z.def);return t&&!n?.parent||(r.Z.parent=e),r}function $t(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function zt(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Gt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Zt(e){return"string"==typeof e?e:e?.message}function Wt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Zt(e.inst?.Z.def?.error?.(e))??Zt(t?.error?.(e))??Zt(n.customError?.(e))??Zt(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Kt(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Vt(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ht=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"Z",{value:e.Z,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jt=wt("$ZodError",Ht),qt=wt("$ZodError",Ht,{Parent:Error}),Yt=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},i=t.Z.run({value:n,issues:[]},a);if(i instanceof Promise)throw new yt;if(i.issues.length){const t=new(o?.Err??e)(i.issues.map(e=>Wt(e,a,St())));throw _t(t,o?.callee),t}return i.value},Xt=Yt(qt),Qt=e=>async(t,n,r,o)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let i=t.Z.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(o?.Err??e)(i.issues.map(e=>Wt(e,a,St())));throw _t(t,o?.callee),t}return i.value},en=Qt(qt),tn=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},a=t.Z.run({value:n,issues:[]},o);if(a instanceof Promise)throw new yt;return a.issues.length?{success:!1,error:new(e??Jt)(a.issues.map(e=>Wt(e,o,St())))}:{success:!0,data:a.value}},nn=tn(qt),rn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t.Z.run({value:n,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Wt(e,o,St())))}:{success:!0,data:a.value}},on=rn(qt),an=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yt(e)(t,n,o)},sn=e=>(t,n,r)=>Yt(e)(t,n,r),cn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qt(e)(t,n,o)},ln=e=>async(t,n,r)=>Qt(e)(t,n,r),dn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tn(e)(t,n,o)},un=e=>(t,n,r)=>tn(e)(t,n,r),fn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return rn(e)(t,n,o)},mn=e=>async(t,n,r)=>rn(e)(t,n,r),pn=/^[cC][^\s-]{8,}$/,hn=/^[0-9a-z]+$/,bn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gn=/^[0-9a-vA-V]{20}$/,vn=/^[A-Za-z0-9]{27}$/,wn=/^[a-zA-Z0-9_-]{21}$/,yn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,An=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Sn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Cn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,En=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pn=/^[A-Za-z0-9_-]*$/,Mn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,On=/^\+(?:[0-9]){6,14}[0-9]$/,Rn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_n=RegExp(`^${Rn}$`);function Dn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?""+t:0===e.precision?t+":[0-5]\\d":`${t}:[0-5]\\d\\.\\d{${e.precision}}`:t+"(?::[0-5]\\d(?:\\.\\d+)?)?"}const In=/^[^A-Z]*$/,Un=/^[^a-z]*$/,Fn=wt("$ZodCheck",(e,t)=>{var n;e.Z??(e.Z={}),e.Z.def=t,(n=e.Z).onattach??(n.onattach=[])}),jn=wt("$ZodCheckMaxLength",(e,t)=>{var n;Fn.init(e,t),(n=e.Z.def).when??(n.when=e=>{const t=e.value;return!Ct(t)&&void 0!==t.length}),e.Z.onattach.push(e=>{const n=e.Z.bag.maximum??1/0;t.maximum<n&&(e.Z.bag.maximum=t.maximum)}),e.Z.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=Kt(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ln=wt("$ZodCheckMinLength",(e,t)=>{var n;Fn.init(e,t),(n=e.Z.def).when??(n.when=e=>{const t=e.value;return!Ct(t)&&void 0!==t.length}),e.Z.onattach.push(e=>{const n=e.Z.bag.minimum??-1/0;t.minimum>n&&(e.Z.bag.minimum=t.minimum)}),e.Z.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=Kt(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bn=wt("$ZodCheckLengthEquals",(e,t)=>{var n;Fn.init(e,t),(n=e.Z.def).when??(n.when=e=>{const t=e.value;return!Ct(t)&&void 0!==t.length}),e.Z.onattach.push(e=>{const n=e.Z.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e.Z.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const a=Kt(r),i=o>t.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$n=wt("$ZodCheckStringFormat",(e,t)=>{var n,r;Fn.init(e,t),e.Z.onattach.push(e=>{const n=e.Z.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e.Z).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e.Z).check??(r.check=()=>{})}),zn=wt("$ZodCheckRegex",(e,t)=>{$n.init(e,t),e.Z.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gn=wt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=In),$n.init(e,t)}),Zn=wt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Un),$n.init(e,t)}),Wn=wt("$ZodCheckIncludes",(e,t)=>{Fn.init(e,t);const n=Lt(t.includes),r=RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e.Z.onattach.push(e=>{const t=e.Z.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e.Z.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Kn=wt("$ZodCheckStartsWith",(e,t)=>{Fn.init(e,t);const n=RegExp(`^${Lt(t.prefix)}.*`);t.pattern??(t.pattern=n),e.Z.onattach.push(e=>{const t=e.Z.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e.Z.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Vn=wt("$ZodCheckEndsWith",(e,t)=>{Fn.init(e,t);const n=RegExp(`.*${Lt(t.suffix)}$`);t.pattern??(t.pattern=n),e.Z.onattach.push(e=>{const t=e.Z.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e.Z.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Hn=wt("$ZodCheckOverwrite",(e,t)=>{Fn.init(e,t),e.Z.check=e=>{e.value=t.tx(e.value)}});class Jn{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>" "+e)].join("\n"))}}const qn={major:4,minor:1,patch:8},Yn=wt("$ZodType",(e,t)=>{var n;e??(e={}),e.Z.def=t,e.Z.bag=e.Z.bag||{},e.Z.version=qn;const r=[...e.Z.def.checks??[]];e.Z.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t.Z.onattach)n(e);if(0===r.length)(n=e.Z).deferred??(n.deferred=[]),e.Z.deferred?.push(()=>{e.Z.run=e.Z.parse});else{const t=(e,t,n)=>{let r,o=zt(e);for(const a of t){if(a.Z.def.when){if(!a.Z.def.when(e))continue}else if(o)continue;const t=e.issues.length,i=a.Z.check(e);if(i instanceof Promise&&!1===n?.async)throw new yt;if(r||i instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await i,e.issues.length!==t&&(o||(o=zt(e,t)))});else{if(e.issues.length===t)continue;o||(o=zt(e,t))}}return r?r.then(()=>e):e},n=(n,o,a)=>{if(zt(n))return n.aborted=!0,n;const i=t(o,r,a);if(i instanceof Promise){if(!1===a.async)throw new yt;return i.then(t=>e.Z.parse(t,a))}return e.Z.parse(i,a)};e.Z.run=(o,a)=>{if(a.skipChecks)return e.Z.parse(o,a);if("backward"===a.direction){const t=e.Z.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,a)):n(t,o,a)}const i=e.Z.parse(o,a);if(i instanceof Promise){if(!1===a.async)throw new yt;return i.then(e=>t(e,r,a))}return t(i,r,a)}}e["~standard"]={validate:t=>{try{const n=nn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return on(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Xn=wt("$ZodString",(e,t)=>{var n;Yn.init(e,t),e.Z.pattern=[...e?.Z.bag?.patterns??[]].pop()??(n=e.Z.bag,RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e.Z.parse=(n,r)=>{if(t.coerce)try{n.value=n.value+""}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Qn=wt("$ZodStringFormat",(e,t)=>{$n.init(e,t),Xn.init(e,t)}),er=wt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xn),Qn.init(e,t)}),tr=wt("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=An(e))}else t.pattern??(t.pattern=An());Qn.init(e,t)}),nr=wt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Sn),Qn.init(e,t)}),rr=wt("$ZodURL",(e,t)=>{Qn.init(e,t),e.Z.check=n=>{try{const r=n.value.trim(),o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Mn.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),or=wt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Qn.init(e,t)}),ar=wt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wn),Qn.init(e,t)}),ir=wt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pn),Qn.init(e,t)}),sr=wt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=hn),Qn.init(e,t)}),cr=wt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bn),Qn.init(e,t)}),lr=wt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=gn),Qn.init(e,t)}),dr=wt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vn),Qn.init(e,t)}),ur=wt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Dn({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return RegExp(`^${Rn}T(?:${r})$`)}(t)),Qn.init(e,t)}),fr=wt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_n),Qn.init(e,t)}),mr=wt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${Dn(t)}$`)),Qn.init(e,t)}),pr=wt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=yn),Qn.init(e,t)}),hr=wt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=kn),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.format="ipv4"})}),br=wt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tn),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.format="ipv6"}),e.Z.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),gr=wt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Cn),Qn.init(e,t)}),vr=wt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nn),Qn.init(e,t),e.Z.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw Error();const[e,t]=r;if(!t)throw Error();const n=+t;if(""+n!==t)throw Error();if(0>n||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function wr(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const yr=wt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=En),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.contentEncoding="base64"}),e.Z.check=n=>{wr(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),xr=wt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Pn),Qn.init(e,t),e.Z.onattach.push(e=>{e.Z.bag.contentEncoding="base64url"}),e.Z.check=n=>{(function(e){if(!Pn.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return wr(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ar=wt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=On),Qn.init(e,t)}),Sr=wt("$ZodJWT",(e,t)=>{Qn.init(e,t),e.Z.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),kr=wt("$ZodUnknown",(e,t)=>{Yn.init(e,t),e.Z.parse=e=>e}),Tr=wt("$ZodNever",(e,t)=>{Yn.init(e,t),e.Z.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Cr(e,t,n){e.issues.length&&t.issues.push(...Gt(n,e.issues)),t.value[n]=e.value}const Nr=wt("$ZodArray",(e,t)=>{Yn.init(e,t),e.Z.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const a=[];for(let e=0;e<o.length;e++){const i=o[e],s=t.element.Z.run({value:i,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Cr(t,n,e))):Cr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Er(e,t,n,r){e.issues.length&&t.issues.push(...Gt(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Pr(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?.Z?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e].Z.optin&&"optional"===r[e].Z.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Mr(e,t,n,r,o,a){const i=[],s=o.keySet,c=o.catchall.Z,l=c.def.type;for(const o of Object.keys(t)){if(s.has(o))continue;if("never"===l){i.push(o);continue}const a=c.run({value:t[o],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Er(e,n,o,t))):Er(a,n,o,t)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Or=wt("$ZodObject",(e,t)=>{Yn.init(e,t);const n=Tt(()=>Pr(t));Pt(e.Z,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t].Z;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const r=Dt,o=t.catchall;let a;e.Z.parse=(t,i)=>{a??(a=n.value);const s=t.value;if(!r(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const c=[],l=a.shape;for(const e of a.keys){const n=l[e].Z.run({value:s[e],issues:[]},i);n instanceof Promise?c.push(n.then(n=>Er(n,t,e,s))):Er(n,t,e,s)}return o?Mr(c,s,t,i,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Rr=wt("$ZodObjectJIT",(e,t)=>{Or.init(e,t);const n=e.Z.parse,r=Tt(()=>Pr(t));let o;const a=Dt,i=!At.jitless,s=i&&It.value,c=t.catchall;let l;e.Z.parse=(d,u)=>{l??(l=r.value);const f=d.value;return a(f)?i&&s&&!1===u?.async&&!0!==u.jitless?(o||(o=(e=>{const t=new Jn(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Rt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const a=Object.create(null);let i=0;for(const e of n.keys)a[e]="key_"+i++;t.write("const newResult = {};");for(const e of n.keys){const n=a[e],r=Rt(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${r}, ...iss.path] : [${r}]\n })));\n }\n \n \n if (${n}.value === undefined) {\n if (${r} in input) {\n newResult[${r}] = undefined;\n }\n } else {\n newResult[${r}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,n)=>s(e,t,n)})(t.shape)),d=o(d,u),c?Mr([],f,d,u,l,e):d):n(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),d)}});function _r(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!zt(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Wt(e,r,St())))}),t)}const Dr=wt("$ZodUnion",(e,t)=>{Yn.init(e,t),Pt(e.Z,"optin",()=>t.options.some(e=>"optional"===e.Z.optin)?"optional":void 0),Pt(e.Z,"optout",()=>t.options.some(e=>"optional"===e.Z.optout)?"optional":void 0),Pt(e.Z,"values",()=>{if(t.options.every(e=>e.Z.values))return new Set(t.options.flatMap(e=>Array.from(e.Z.values)))}),Pt(e.Z,"pattern",()=>{if(t.options.every(e=>e.Z.pattern)){const e=t.options.map(e=>e.Z.pattern);return RegExp(`^(${e.map(e=>Nt(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0].Z.run;e.Z.parse=(o,a)=>{if(n)return r(o,a);let i=!1;const s=[];for(const e of t.options){const t=e.Z.run({value:o.value,issues:[]},a);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>_r(t,o,e,a)):_r(s,o,e,a)}}),Ir=wt("$ZodIntersection",(e,t)=>{Yn.init(e,t),e.Z.parse=(e,n)=>{const r=e.value,o=t.left.Z.run({value:r,issues:[]},n),a=t.right.Z.run({value:r,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([t,n])=>Fr(e,t,n)):Fr(e,o,a)}});function Ur(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ut(e)&&Ut(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=Ur(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=Ur(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fr(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),zt(e))return e;const r=Ur(t.value,n.value);if(!r.valid)throw Error("Unmergable intersection. Error path: "+JSON.stringify(r.mergeErrorPath));return e.value=r.data,e}const jr=wt("$ZodEnum",(e,t)=>{Yn.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e),n=Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t);return n}(t.entries),r=new Set(n);e.Z.values=r,e.Z.pattern=RegExp(`^(${n.filter(e=>jt.has(typeof e)).map(e=>"string"==typeof e?Lt(e):e.toString()).join("|")})$`),e.Z.parse=(t,o)=>{const a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),Lr=wt("$ZodTransform",(e,t)=>{Yn.init(e,t),e.Z.parse=(n,r)=>{if("backward"===r.direction)throw new xt(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new yt;return n.value=o,n}});function Br(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const $r=wt("$ZodOptional",(e,t)=>{Yn.init(e,t),e.Z.optin="optional",e.Z.optout="optional",Pt(e.Z,"values",()=>t.innerType.Z.values?new Set([...t.innerType.Z.values,void 0]):void 0),Pt(e.Z,"pattern",()=>{const e=t.innerType.Z.pattern;return e?RegExp(`^(${Nt(e.source)})?$`):void 0}),e.Z.parse=(e,n)=>{if("optional"===t.innerType.Z.optin){const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(t=>Br(t,e.value)):Br(r,e.value)}return void 0===e.value?e:t.innerType.Z.run(e,n)}}),zr=wt("$ZodNullable",(e,t)=>{Yn.init(e,t),Pt(e.Z,"optin",()=>t.innerType.Z.optin),Pt(e.Z,"optout",()=>t.innerType.Z.optout),Pt(e.Z,"pattern",()=>{const e=t.innerType.Z.pattern;return e?RegExp(`^(${Nt(e.source)}|null)$`):void 0}),Pt(e.Z,"values",()=>t.innerType.Z.values?new Set([...t.innerType.Z.values,null]):void 0),e.Z.parse=(e,n)=>null===e.value?e:t.innerType.Z.run(e,n)}),Gr=wt("$ZodDefault",(e,t)=>{Yn.init(e,t),e.Z.optin="optional",Pt(e.Z,"values",()=>t.innerType.Z.values),e.Z.parse=(e,n)=>{if("backward"===n.direction)return t.innerType.Z.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(e=>Zr(e,t)):Zr(r,t)}});function Zr(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Wr=wt("$ZodPrefault",(e,t)=>{Yn.init(e,t),e.Z.optin="optional",Pt(e.Z,"values",()=>t.innerType.Z.values),e.Z.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType.Z.run(e,n))}),Kr=wt("$ZodNonOptional",(e,t)=>{Yn.init(e,t),Pt(e.Z,"values",()=>{const e=t.innerType.Z.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e.Z.parse=(n,r)=>{const o=t.innerType.Z.run(n,r);return o instanceof Promise?o.then(t=>Vr(t,e)):Vr(o,e)}});function Vr(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Hr=wt("$ZodCatch",(e,t)=>{Yn.init(e,t),Pt(e.Z,"optin",()=>t.innerType.Z.optin),Pt(e.Z,"optout",()=>t.innerType.Z.optout),Pt(e.Z,"values",()=>t.innerType.Z.values),e.Z.parse=(e,n)=>{if("backward"===n.direction)return t.innerType.Z.run(e,n);const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Wt(e,n,St()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Wt(e,n,St()))},input:e.value}),e.issues=[]),e)}}),Jr=wt("$ZodPipe",(e,t)=>{Yn.init(e,t),Pt(e.Z,"values",()=>t.in.Z.values),Pt(e.Z,"optin",()=>t.in.Z.optin),Pt(e.Z,"optout",()=>t.out.Z.optout),Pt(e.Z,"propValues",()=>t.in.Z.propValues),e.Z.parse=(e,n)=>{if("backward"===n.direction){const r=t.out.Z.run(e,n);return r instanceof Promise?r.then(e=>qr(e,t.in,n)):qr(r,t.in,n)}const r=t.in.Z.run(e,n);return r instanceof Promise?r.then(e=>qr(e,t.out,n)):qr(r,t.out,n)}});function qr(e,t,n){return e.issues.length?(e.aborted=!0,e):t.Z.run({value:e.value,issues:e.issues},n)}const Yr=wt("$ZodReadonly",(e,t)=>{Yn.init(e,t),Pt(e.Z,"propValues",()=>t.innerType.Z.propValues),Pt(e.Z,"values",()=>t.innerType.Z.values),Pt(e.Z,"optin",()=>t.innerType.Z.optin),Pt(e.Z,"optout",()=>t.innerType.Z.optout),e.Z.parse=(e,n)=>{if("backward"===n.direction)return t.innerType.Z.run(e,n);const r=t.innerType.Z.run(e,n);return r instanceof Promise?r.then(Xr):Xr(r)}});function Xr(e){return e.value=Object.freeze(e.value),e}const Qr=wt("$ZodCustom",(e,t)=>{Fn.init(e,t),Yn.init(e,t),e.Z.parse=(e,t)=>e,e.Z.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>eo(t,n,r,e));eo(o,n,r,e)}});function eo(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r.Z.def.path??[]],continue:!r.Z.def.abort};r.Z.def.params&&(e.params=r.Z.def.params),t.issues.push(Vt(e))}}class to{constructor(){this.W=new WeakMap,this.K=new Map}add(e,...t){const n=t[0];if(this.W.set(e,n),n&&"object"==typeof n&&"id"in n){if(this.K.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this.K.set(n.id,e)}return this}clear(){return this.W=new WeakMap,this.K=new Map,this}remove(e){const t=this.W.get(e);return t&&"object"==typeof t&&"id"in t&&this.K.delete(t.id),this.W.delete(e),this}get(e){const t=e.Z.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this.W.get(e)};return Object.keys(r).length?r:void 0}return this.W.get(e)}has(e){return this.W.has(e)}}function no(){return new to}const ro=no();function oo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$t(t)})}function ao(e,t){return new jn({check:"max_length",...$t(t),maximum:e})}function io(e,t){return new Ln({check:"min_length",...$t(t),minimum:e})}function so(e,t){return new Bn({check:"length_equals",...$t(t),length:e})}function co(e){return new Hn({check:"overwrite",tx:e})}function lo(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function uo(e,t){for(var n={};e.length;){var r=e[0],o=r.code,a=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[i]={message:s.message,type:s.code}}else n[i]={message:a,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Oe(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function fo(e,t){for(var n={};e.length;){var r=e[0],o=r.code,a=r.message,i=r.path.join(".");if(!n[i])if("invalid_union"===r.code&&r.errors.length>0){var s=r.errors[0][0];n[i]={message:s.message,type:s.code}}else n[i]={message:a,type:o};if("invalid_union"===r.code&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=Oe(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function mo(e,t,n){if(void 0===n&&(n={}),function(e){return"V"in e&&"object"==typeof e.V&&"typeName"in e.V}(e))return function(r,o,a){try{return Promise.resolve(lo(function(){return Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](r,t)).then(function(e){return a.shouldUseNativeValidation&&ht({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:bt(uo(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"Z"in e&&"object"==typeof e.Z}(e))return function(r,o,a){try{return Promise.resolve(lo(function(){return Promise.resolve(("sync"===n.mode?Xt:en)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&ht({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof Jt}(e))return{values:{},errors:bt(fo(e.issues,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error("Invalid input: not a Zod schema")}function po(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;o>t;t++)e[t]&&(n=po(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ho(){for(var e,t,n=0,r="",o=arguments.length;o>n;n++)(e=arguments[n])&&(t=po(e))&&(r&&(r+=" "),r+=t);return r}const bo=e=>{const t=yo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),go(n,t)||wo(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},go=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?go(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},vo=/^\[(.+)\]$/,wo=e=>{if(vo.test(e)){const t=vo.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yo=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const e in n)xo(n[e],r,e,t);return r},xo=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?So(e)?void xo(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{xo(o,Ao(t,e),n,r)});(""===e?t:Ao(t,e)).classGroupId=n})},Ao=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},So=e=>e.isThemeGetter,ko=e=>{if(1>e)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},To=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===r&&0===o){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const i=0===t.length?e:e.substring(a),s=Co(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Co=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,No=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(1>=e.length)return e;const n=[];let r=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...r.sort(),e),r=[]):r.push(e)}),n.push(...r.sort()),n}},Eo=/\s+/;function Po(){let e,t,n=0,r="";for(;arguments.length>n;)(e=arguments[n++])&&(t=Mo(e))&&(r&&(r+=" "),r+=t);return r}const Mo=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mo(e[r]))&&(n&&(n+=" "),n+=t);return n};function Oo(e,...t){let n,r,o,a=function(s){const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:ko(e.cacheSize),parseClassName:To(e),sortModifiers:No(e),...bo(e)}))(c),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(Eo);let c="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:l,modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=n(t);if(l){c=t+(c.length>0?" "+c:c);continue}let p=!!m,h=r(p?f.substring(0,m):f);if(!h){if(!p){c=t+(c.length>0?" "+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?" "+c:c);continue}p=!1}const b=a(d).join(":"),g=u?b+"!":b,v=g+h;if(i.includes(v))continue;i.push(v);const w=o(h,p);for(let e=0;e<w.length;++e){const t=w[e];i.push(g+t)}c=t+(c.length>0?" "+c:c)}return c})(e,n);return o(e,a),a}return function(){return a(Po.apply(null,arguments))}}const Ro=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},_o=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Do=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Io=/^\d+\/\d+$/,Uo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$o=e=>Io.test(e),zo=e=>!!e&&!Number.isNaN(+e),Go=e=>!!e&&Number.isInteger(+e),Zo=e=>e.endsWith("%")&&zo(e.slice(0,-1)),Wo=e=>Uo.test(e),Ko=()=>!0,Vo=e=>Fo.test(e)&&!jo.test(e),Ho=()=>!1,Jo=e=>Lo.test(e),qo=e=>Bo.test(e),Yo=e=>!Qo(e)&&!aa(e),Xo=e=>fa(e,ba,Ho),Qo=e=>_o.test(e),ea=e=>fa(e,ga,Vo),ta=e=>fa(e,va,zo),na=e=>fa(e,pa,Ho),ra=e=>fa(e,ha,qo),oa=e=>fa(e,ya,Jo),aa=e=>Do.test(e),ia=e=>ma(e,ga),sa=e=>ma(e,wa),ca=e=>ma(e,pa),la=e=>ma(e,ba),da=e=>ma(e,ha),ua=e=>ma(e,ya,!0),fa=(e,t,n)=>{const r=_o.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ma=(e,t,n=!1)=>{const r=Do.exec(e);return!!r&&(r[1]?t(r[1]):n)},pa=e=>"position"===e||"percentage"===e,ha=e=>"image"===e||"url"===e,ba=e=>"length"===e||"size"===e||"bg-size"===e,ga=e=>"length"===e,va=e=>"number"===e,wa=e=>"family-name"===e,ya=e=>"shadow"===e,xa=Oo(()=>{const e=Ro("color"),t=Ro("font"),n=Ro("text"),r=Ro("font-weight"),o=Ro("tracking"),a=Ro("leading"),i=Ro("breakpoint"),s=Ro("container"),c=Ro("spacing"),l=Ro("radius"),d=Ro("shadow"),u=Ro("inset-shadow"),f=Ro("text-shadow"),m=Ro("drop-shadow"),p=Ro("blur"),h=Ro("perspective"),b=Ro("aspect"),g=Ro("ease"),v=Ro("animate"),w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",aa,Qo],y=()=>[aa,Qo,c],x=()=>[$o,"full","auto",...y()],A=()=>[Go,"none","subgrid",aa,Qo],S=()=>["auto",{span:["full",Go,aa,Qo]},Go,aa,Qo],k=()=>[Go,"auto",aa,Qo],T=()=>["auto","min","max","fr",aa,Qo],C=()=>["auto",...y()],N=()=>[$o,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],E=()=>[e,aa,Qo],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ca,na,{position:[aa,Qo]}],M=()=>["auto","cover","contain",la,Xo,{size:[aa,Qo]}],O=()=>[Zo,ia,ea],R=()=>["","none","full",l,aa,Qo],_=()=>["",zo,ia,ea],D=()=>[zo,Zo,ca,na],I=()=>["","none",p,aa,Qo],U=()=>["none",zo,aa,Qo],F=()=>["none",zo,aa,Qo],j=()=>[zo,aa,Qo],L=()=>[$o,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wo],breakpoint:[Wo],color:[Ko],container:[Wo],"drop-shadow":[Wo],ease:["in","out","in-out"],font:[Yo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wo],shadow:[Wo],spacing:["px",zo],text:[Wo],"text-shadow":[Wo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$o,Qo,aa,b]}],container:["container"],columns:[{columns:[zo,Qo,aa,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Go,"auto",aa,Qo]}],basis:[{basis:[$o,"full","auto",s,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[zo,$o,"auto","initial","none",Qo]}],grow:[{grow:["",zo,aa,Qo]}],shrink:[{shrink:["",zo,aa,Qo]}],order:[{order:[Go,"first","last","none",aa,Qo]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",n,ia,ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,aa,ta]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zo,Qo]}],"font-family":[{font:[sa,Qo,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,aa,Qo]}],"line-clamp":[{"line-clamp":[zo,"none",aa,ta]}],leading:[{leading:[a,...y()]}],"list-image":[{"list-image":["none",aa,Qo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",aa,Qo]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[zo,"from-font","auto",aa,ea]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[zo,"auto",aa,Qo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",aa,Qo]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",aa,Qo]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Go,aa,Qo],radial:["",aa,Qo],conic:[Go,aa,Qo]},da,ra]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[zo,aa,Qo]}],"outline-w":[{outline:["",zo,ia,ea]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,ua,oa]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,ua,oa]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[zo,ea]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",f,ua,oa]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[zo,aa,Qo]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[zo]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[aa,Qo]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[zo]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",aa,Qo]}],filter:[{filter:["","none",aa,Qo]}],blur:[{blur:I()}],brightness:[{brightness:[zo,aa,Qo]}],contrast:[{contrast:[zo,aa,Qo]}],"drop-shadow":[{"drop-shadow":["","none",m,ua,oa]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",zo,aa,Qo]}],"hue-rotate":[{"hue-rotate":[zo,aa,Qo]}],invert:[{invert:["",zo,aa,Qo]}],saturate:[{saturate:[zo,aa,Qo]}],sepia:[{sepia:["",zo,aa,Qo]}],"backdrop-filter":[{"backdrop-filter":["","none",aa,Qo]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[zo,aa,Qo]}],"backdrop-contrast":[{"backdrop-contrast":[zo,aa,Qo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",zo,aa,Qo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zo,aa,Qo]}],"backdrop-invert":[{"backdrop-invert":["",zo,aa,Qo]}],"backdrop-opacity":[{"backdrop-opacity":[zo,aa,Qo]}],"backdrop-saturate":[{"backdrop-saturate":[zo,aa,Qo]}],"backdrop-sepia":[{"backdrop-sepia":["",zo,aa,Qo]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",aa,Qo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[zo,"initial",aa,Qo]}],ease:[{ease:["linear","initial",g,aa,Qo]}],delay:[{delay:[zo,aa,Qo]}],animate:[{animate:["none",v,aa,Qo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,aa,Qo]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:j()}],"skew-x":[{"skew-x":j()}],"skew-y":[{"skew-y":j()}],transform:[{transform:[aa,Qo,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",aa,Qo]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",aa,Qo]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[zo,ia,ea,ta]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Aa(...e){return xa(ho(e))}function Sa(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ka(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Sa(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Sa(e[t],null)}}}}function Ta(...e){return o.useCallback(ka(...e),e)}function Ca(t){const n=Ea(t),r=o.forwardRef((t,r)=>{const{children:a,...i}=t,s=o.Children.toArray(a),c=s.find(Ma);if(c){const t=c.props.children,a=s.map(e=>e===c?o.Children.count(t)>1?o.Children.only(null):o.isValidElement(t)?t.props.children:null:e);return e.jsx(n,{...i,ref:r,children:o.isValidElement(t)?o.cloneElement(t,void 0,a):null})}return e.jsx(n,{...i,ref:r,children:a})});return r.displayName=t+".Slot",r}var Na=Ca("Slot");function Ea(e){const t=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==o.Fragment&&(a.ref=t?ka(t,e):e),o.cloneElement(n,a)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=e+".SlotClone",t}var Pa=Symbol("radix.slottable");function Ma(e){return o.isValidElement(e)&&"function"==typeof e.type&&"H"in e.type&&e.type.H===Pa}const Oa=e=>"boolean"==typeof e?""+e:0===e?"0":e,Ra=ho,_a=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return Ra(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const i=Oa(t)||Oa(r);return o[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),c=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return Ra(e,i,c,null==n?void 0:n.class,null==n?void 0:n.className)},Da=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ia=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ua=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Fa=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var ja={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const La=t.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:s,...c},l)=>t.createElement("svg",{ref:l,...ja,width:n,height:n,stroke:e,strokeWidth:o?24*+r/+n:r,className:Ua("lucide",a),...!i&&!Fa(c)&&{"aria-hidden":"true"},...c},[...s.map(([e,n])=>t.createElement(e,n)),...Array.isArray(i)?i:[i]])),Ba=(e,n)=>{const r=t.forwardRef(({className:r,...o},a)=>t.createElement(La,{ref:a,iconNode:n,className:Ua("lucide-"+Da(Ia(e)),"lucide-"+e,r),...o}));return r.displayName=Ia(e),r},$a=Ba("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),za=Ba("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Ga=Ba("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Za=Ba("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Wa=Ba("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Ka=Ba("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Va=Ba("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),Ha=Ba("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Ja=Ba("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),qa=Ba("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),Ya=Ba("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),Xa=Ba("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Qa=Ba("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ei=Ba("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ti=Ba("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ni=Ba("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),ri=_a("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),oi=o.forwardRef(({className:t,variant:n,progress:r,size:a,startIcon:i,endIcon:s,asChild:c=!1,...l},d)=>{const u=c?Na:"button",f=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(a);return e.jsxs(u,{disabled:r||l.disabled,className:Aa(ri({variant:n,size:a,withIcon:null!=r||null!=i||null!=s,className:t})),ref:d,...l,children:[r&&e.jsx(Wa,{size:f,className:"animate-spin"}),i&&o.cloneElement(i,{size:f}),l.children,s&&o.cloneElement(s,{size:f})]})});oi.displayName="Button";var ai=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=Ca("Primitive."+n),a=o.forwardRef((t,o)=>{const{asChild:a,...i}=t,s=a?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(s,{...i,ref:o})});return a.displayName="Primitive."+n,{...t,[n]:a}},{}),ii=o.forwardRef((t,n)=>e.jsx(ai.label,{...t,ref:n,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));ii.displayName="Label";var si=ii;const ci=_a("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),li=o.forwardRef(({className:t,...n},r)=>e.jsx(si,{ref:r,className:Aa(ci(),t),...n}));li.displayName=si.displayName;const di=Se,ui=o.createContext({}),fi=({...t})=>e.jsx(ui.Provider,{value:{name:t.name},children:e.jsx(Me,{...t})}),mi=()=>{const e=o.useContext(ui),t=o.useContext(pi),{getFieldState:n,formState:r}=Ae(),a=n(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:i+"-form-item",formDescriptionId:i+"-form-item-description",formMessageId:i+"-form-item-message",...a}},pi=o.createContext({}),hi=o.forwardRef(({className:t,...n},r)=>{const a=o.useId();return e.jsx(pi.Provider,{value:{id:a},children:e.jsx("div",{ref:r,className:Aa("space-y-2",t),...n})})});hi.displayName="FormItem";const bi=o.forwardRef(({className:t,...n},r)=>{const{error:o,formItemId:a}=mi();return e.jsx(li,{ref:r,className:Aa(o&&"text-destructive",t),htmlFor:a,...n})});bi.displayName="FormLabel";const gi=o.forwardRef(({...t},n)=>{const{error:r,formItemId:o,formDescriptionId:a,formMessageId:i}=mi();return e.jsx(Na,{ref:n,id:o,"aria-describedby":r?`${a} ${i}`:""+a,"aria-invalid":!!r,...t})});gi.displayName="FormControl";const vi=o.forwardRef(({className:t,...n},r)=>{const{formDescriptionId:o}=mi();return e.jsx("p",{ref:r,id:o,className:Aa("text-sm text-muted-foreground",t),...n})});vi.displayName="FormDescription";const wi=o.forwardRef(({className:t,children:n,...r},o)=>{const{error:a,formMessageId:i}=mi(),s=a?a?.message+"":n;return s?e.jsx("p",{ref:o,id:i,className:Aa("text-sm font-medium text-destructive",t),...r,children:s}):null});wi.displayName="FormMessage";const yi=o.forwardRef(({className:t,type:n,...r},o)=>e.jsx("input",{type:n,className:Aa("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:o,...r}));function xi({className:t,...n}){return e.jsx("div",{className:Aa("animate-pulse rounded-md bg-primary/10",t),...n})}yi.displayName="Input";let Ai=class{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}async fetchConfig(){const e=await fetch(`${this.serverUrl}/api/${this.version}/beta/config?orgId=${this.orgId}`);if(!e.ok)throw Error("Failed to fetch beta form configuration: "+e.statusText);return e.json()}async submitBetaUser(e){const t=e?.context??{},n=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),r=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),o=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),a=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0),i=await fetch(`${this.serverUrl}/api/${this.version}/beta/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orgId:this.orgId,formData:{...e,country:n,language:r,timezone:o,currency:a}})});if(!i.ok)throw Error("Failed to submit beta user request: "+i.statusText);return i.json()}};const Si=wt("ZodISODateTime",(e,t)=>{ur.init(e,t),Zi.init(e,t)}),ki=wt("ZodISODate",(e,t)=>{fr.init(e,t),Zi.init(e,t)}),Ti=wt("ZodISOTime",(e,t)=>{mr.init(e,t),Zi.init(e,t)}),Ci=wt("ZodISODuration",(e,t)=>{pr.init(e,t),Zi.init(e,t)}),Ni=wt("ZodError",(e,t)=>{Jt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},r={J:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>o({issues:e}));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)r.J.push(n(t));else{let e=r,o=0;for(;o<t.path.length;){const r=t.path[o];o===t.path.length-1?(e[r]=e[r]||{J:[]},e[r].J.push(n(t))):e[r]=e[r]||{J:[]},e=e[r],o++}}};return o(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,kt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,kt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Ei=Yt(Ni),Pi=Qt(Ni),Mi=tn(Ni),Oi=rn(Ni),Ri=an(Ni),_i=sn(Ni),Di=cn(Ni),Ii=ln(Ni),Ui=dn(Ni),Fi=un(Ni),ji=fn(Ni),Li=mn(Ni),Bi=wt("ZodType",(e,t)=>(Yn.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"V",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{Z:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>Bt(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Ei(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Mi(e,t,n),e.parseAsync=async(t,n)=>Pi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Oi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ri(e,t,n),e.decode=(t,n)=>_i(e,t,n),e.encodeAsync=async(t,n)=>Di(e,t,n),e.decodeAsync=async(t,n)=>Ii(e,t,n),e.safeEncode=(t,n)=>Ui(e,t,n),e.safeDecode=(t,n)=>Fi(e,t,n),e.safeEncodeAsync=async(t,n)=>ji(e,t,n),e.safeDecodeAsync=async(t,n)=>Li(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new Os({type:"custom",check:"custom",fn:t,...$t(n)})}(0,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new Fn({check:"custom",...$t(void 0)});return t.Z.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Vt(e,n.value,t.Z.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t.Z.def.abort),n.issues.push(Vt(r))}},e(n.value,n)));return t}(t)),e.overwrite=t=>e.check(co(t)),e.optional=()=>xs(e),e.nullable=()=>Ss(e),e.nullish=()=>xs(Ss(e)),e.nonoptional=t=>function(e,t){return new Cs({type:"nonoptional",innerType:e,...$t(t)})}(e,t),e.array=()=>new ms({type:"array",element:e,...$t(void 0)}),e.or=t=>function(e){return new bs({type:"union",options:e,...$t(void 0)})}([e,t]),e.and=t=>new gs({type:"intersection",left:e,right:t}),e.transform=t=>Ps(e,new ws({type:"transform",transform:t})),e.default=t=>{return n=t,new ks({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Ft(n)}});var n},e.prefault=t=>{return n=t,new Ts({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Ft(n)}});var n},e.catch=t=>{return new Ns({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Ps(e,t),e.readonly=()=>new Ms({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return ro.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>ro.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return ro.get(e);const n=e.clone();return ro.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),$i=wt("_ZodString",(e,t)=>{Xn.init(e,t),Bi.init(e,t);const n=e.Z.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new zn({check:"string_format",format:"regex",...$t(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Wn({check:"string_format",format:"includes",...$t(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Kn({check:"string_format",format:"starts_with",...$t(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Vn({check:"string_format",format:"ends_with",...$t(t),suffix:e})}(...t)),e.min=(...t)=>e.check(io(...t)),e.max=(...t)=>e.check(ao(...t)),e.length=(...t)=>e.check(so(...t)),e.nonempty=(...t)=>e.check(io(1,...t)),e.lowercase=t=>e.check(function(e){return new Gn({check:"string_format",format:"lowercase",...$t(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Zn({check:"string_format",format:"uppercase",...$t(e)})}(t)),e.trim=()=>e.check(co(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return co(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(co(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(co(e=>e.toUpperCase()))}),zi=wt("ZodString",(e,t)=>{Xn.init(e,t),$i.init(e,t),e.email=t=>e.check(function(e,t){return new Wi({type:"string",format:"email",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.url=t=>e.check(function(e,t){return new Hi({type:"string",format:"url",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.jwt=t=>e.check(function(e,t){return new ls({type:"string",format:"jwt",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.emoji=t=>e.check(function(e,t){return new Ji({type:"string",format:"emoji",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.guid=t=>e.check(oo(Ki,t)),e.uuid=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.uuidv4=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$t(t)})}(0,t)),e.uuidv6=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$t(t)})}(0,t)),e.uuidv7=t=>e.check(function(e,t){return new Vi({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$t(t)})}(0,t)),e.nanoid=t=>e.check(function(e,t){return new qi({type:"string",format:"nanoid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.guid=t=>e.check(oo(Ki,t)),e.cuid=t=>e.check(function(e,t){return new Yi({type:"string",format:"cuid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.cuid2=t=>e.check(function(e,t){return new Xi({type:"string",format:"cuid2",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ulid=t=>e.check(function(e,t){return new Qi({type:"string",format:"ulid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.base64=t=>e.check(function(e,t){return new is({type:"string",format:"base64",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.base64url=t=>e.check(function(e,t){return new ss({type:"string",format:"base64url",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.xid=t=>e.check(function(e,t){return new es({type:"string",format:"xid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ksuid=t=>e.check(function(e,t){return new ts({type:"string",format:"ksuid",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ipv4=t=>e.check(function(e,t){return new ns({type:"string",format:"ipv4",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.ipv6=t=>e.check(function(e,t){return new rs({type:"string",format:"ipv6",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.cidrv4=t=>e.check(function(e,t){return new os({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.cidrv6=t=>e.check(function(e,t){return new as({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.e164=t=>e.check(function(e,t){return new cs({type:"string",format:"e164",check:"string_format",abort:!1,...$t(t)})}(0,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new Si({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$t(t)})}(0,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new ki({type:"string",format:"date",check:"string_format",...$t(t)})}(0,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new Ti({type:"string",format:"time",check:"string_format",precision:null,...$t(t)})}(0,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new Ci({type:"string",format:"duration",check:"string_format",...$t(t)})}(0,e)}(t))});function Gi(e){return function(e,t){return new zi({type:"string",...$t(t)})}(0,e)}const Zi=wt("ZodStringFormat",(e,t)=>{Qn.init(e,t),$i.init(e,t)}),Wi=wt("ZodEmail",(e,t)=>{nr.init(e,t),Zi.init(e,t)}),Ki=wt("ZodGUID",(e,t)=>{er.init(e,t),Zi.init(e,t)}),Vi=wt("ZodUUID",(e,t)=>{tr.init(e,t),Zi.init(e,t)}),Hi=wt("ZodURL",(e,t)=>{rr.init(e,t),Zi.init(e,t)}),Ji=wt("ZodEmoji",(e,t)=>{or.init(e,t),Zi.init(e,t)}),qi=wt("ZodNanoID",(e,t)=>{ar.init(e,t),Zi.init(e,t)}),Yi=wt("ZodCUID",(e,t)=>{ir.init(e,t),Zi.init(e,t)}),Xi=wt("ZodCUID2",(e,t)=>{sr.init(e,t),Zi.init(e,t)}),Qi=wt("ZodULID",(e,t)=>{cr.init(e,t),Zi.init(e,t)}),es=wt("ZodXID",(e,t)=>{lr.init(e,t),Zi.init(e,t)}),ts=wt("ZodKSUID",(e,t)=>{dr.init(e,t),Zi.init(e,t)}),ns=wt("ZodIPv4",(e,t)=>{hr.init(e,t),Zi.init(e,t)}),rs=wt("ZodIPv6",(e,t)=>{br.init(e,t),Zi.init(e,t)}),os=wt("ZodCIDRv4",(e,t)=>{gr.init(e,t),Zi.init(e,t)}),as=wt("ZodCIDRv6",(e,t)=>{vr.init(e,t),Zi.init(e,t)}),is=wt("ZodBase64",(e,t)=>{yr.init(e,t),Zi.init(e,t)}),ss=wt("ZodBase64URL",(e,t)=>{xr.init(e,t),Zi.init(e,t)}),cs=wt("ZodE164",(e,t)=>{Ar.init(e,t),Zi.init(e,t)}),ls=wt("ZodJWT",(e,t)=>{Sr.init(e,t),Zi.init(e,t)}),ds=wt("ZodUnknown",(e,t)=>{kr.init(e,t),Bi.init(e,t)});function us(){return new ds({type:"unknown"})}const fs=wt("ZodNever",(e,t)=>{Tr.init(e,t),Bi.init(e,t)}),ms=wt("ZodArray",(e,t)=>{Nr.init(e,t),Bi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(io(t,n)),e.nonempty=t=>e.check(io(1,t)),e.max=(t,n)=>e.check(ao(t,n)),e.length=(t,n)=>e.check(so(t,n)),e.unwrap=()=>e.element}),ps=wt("ZodObject",(e,t)=>{Rr.init(e,t),Bi.init(e,t),Pt(e,"shape",()=>t.shape),e.keyof=()=>function(e){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new vs({type:"enum",entries:t,...$t(void 0)})}(Object.keys(e.Z.def.shape)),e.catchall=t=>e.clone({...e.Z.def,catchall:t}),e.passthrough=()=>e.clone({...e.Z.def,catchall:us()}),e.loose=()=>e.clone({...e.Z.def,catchall:us()}),e.strict=()=>e.clone({...e.Z.def,catchall:function(e,t){return new fs({type:"never",...$t(t)})}(0,undefined)}),e.strip=()=>e.clone({...e.Z.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ut(t))throw Error("Invalid input to extend: expected a plain object");const n=e.Z.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=Ot(e.Z.def,{get shape(){const n={...e.Z.def.shape,...t};return Mt(this,"shape",n),n},checks:[]});return Bt(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Ut(t))throw Error("Invalid input to safeExtend: expected a plain object");const n={...e.Z.def,get shape(){const n={...e.Z.def.shape,...t};return Mt(this,"shape",n),n},checks:e.Z.def.checks};return Bt(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ot(e.Z.def,{get shape(){const n={...e.Z.def.shape,...t.Z.def.shape};return Mt(this,"shape",n),n},get catchall(){return t.Z.def.catchall},checks:[]});return Bt(e,n)}(e,t),e.pick=t=>function(e,t){const n=e.Z.def;return Bt(e,Ot(e.Z.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Mt(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e.Z.def,r=Ot(e.Z.def,{get shape(){const r={...e.Z.def.shape};for(const e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Mt(this,"shape",r),r},checks:[]});return Bt(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const r=Ot(t.Z.def,{get shape(){const r=t.Z.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Mt(this,"shape",o),o},checks:[]});return Bt(t,r)}(ys,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ot(t.Z.def,{get shape(){const r=t.Z.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return Mt(this,"shape",o),o},checks:[]});return Bt(t,r)}(Cs,e,t[0])});function hs(e,t){const n={type:"object",get shape(){var t;return Mt(this,"shape",e?Object.create(Object.getPrototypeOf(t=e),Object.getOwnPropertyDescriptors(t)):{}),this.shape},...$t(t)};return new ps(n)}const bs=wt("ZodUnion",(e,t)=>{Dr.init(e,t),Bi.init(e,t),e.options=t.options}),gs=wt("ZodIntersection",(e,t)=>{Ir.init(e,t),Bi.init(e,t)}),vs=wt("ZodEnum",(e,t)=>{jr.init(e,t),Bi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new vs({...t,checks:[],...$t(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw Error(`Key ${t} not found in enum`);delete o[t]}return new vs({...t,checks:[],...$t(r),entries:o})}}),ws=wt("ZodTransform",(e,t)=>{Lr.init(e,t),Bi.init(e,t),e.Z.parse=(n,r)=>{if("backward"===r.direction)throw new xt(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Vt(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Vt(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n)):(n.value=o,n)}}),ys=wt("ZodOptional",(e,t)=>{$r.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType});function xs(e){return new ys({type:"optional",innerType:e})}const As=wt("ZodNullable",(e,t)=>{zr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType});function Ss(e){return new As({type:"nullable",innerType:e})}const ks=wt("ZodDefault",(e,t)=>{Gr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType,e.removeDefault=e.unwrap}),Ts=wt("ZodPrefault",(e,t)=>{Wr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType}),Cs=wt("ZodNonOptional",(e,t)=>{Kr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType}),Ns=wt("ZodCatch",(e,t)=>{Hr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType,e.removeCatch=e.unwrap}),Es=wt("ZodPipe",(e,t)=>{Jr.init(e,t),Bi.init(e,t),e.in=t.in,e.out=t.out});function Ps(e,t){return new Es({type:"pipe",in:e,out:t})}const Ms=wt("ZodReadonly",(e,t)=>{Yr.init(e,t),Bi.init(e,t),e.unwrap=()=>e.Z.def.innerType}),Os=wt("ZodCustom",(e,t)=>{Qr.init(e,t),Bi.init(e,t)}),Rs=hs({name:Gi().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s]*$/,"Name can only contain letters and spaces"),email:Gi().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),_s={en:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred"},es:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error"},fr:{nameLabel:"Nom",emailLabel:"Email",submitText:"Soumettre",submittingText:"Soumission...",errorMessage:"Une erreur est survenue"},de:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten"},zh:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"提交中...",errorMessage:"发生错误"},ja:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました"},ko:{nameLabel:"이름",emailLabel:"이메일",submitText:"제출",submittingText:"제출 중...",errorMessage:"오류가 발생했습니다"}};function Ds({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function Is({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function Us(e,t){return function(){return e.apply(t,arguments)}}const{toString:Fs}=Object.prototype,{getPrototypeOf:js}=Object,{iterator:Ls,toStringTag:Bs}=Symbol,$s=(zs=Object.create(null),e=>{const t=Fs.call(e);return zs[t]||(zs[t]=t.slice(8,-1).toLowerCase())});var zs;const Gs=e=>(e=e.toLowerCase(),t=>$s(t)===e),Zs=e=>t=>typeof t===e,{isArray:Ws}=Array,Ks=Zs("undefined");function Vs(e){return null!==e&&!Ks(e)&&null!==e.constructor&&!Ks(e.constructor)&&qs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Hs=Gs("ArrayBuffer"),Js=Zs("string"),qs=Zs("function"),Ys=Zs("number"),Xs=e=>null!==e&&"object"==typeof e,Qs=e=>{if("object"!==$s(e))return!1;const t=js(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Bs in e||Ls in e)},ec=Gs("Date"),tc=Gs("File"),nc=Gs("Blob"),rc=Gs("FileList"),oc=Gs("URLSearchParams"),[ac,ic,sc,cc]=["ReadableStream","Request","Response","Headers"].map(Gs);function lc(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Ws(e))for(r=0,o=e.length;o>r;r++)t.call(null,e[r],r,e);else{if(Vs(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(r=0;a>r;r++)i=o[r],t.call(null,e[i],i,e)}}function dc(e,t){if(Vs(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const uc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fc=e=>!Ks(e)&&e!==uc,mc=(pc="undefined"!=typeof Uint8Array&&js(Uint8Array),e=>pc&&e instanceof pc);var pc;const hc=Gs("HTMLFormElement"),bc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gc=Gs("RegExp"),vc=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lc(n,(n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)}),Object.defineProperties(e,r)},wc=Gs("AsyncFunction"),yc=(xc="function"==typeof setImmediate,Ac=qs(uc.postMessage),xc?setImmediate:Ac?(Sc="axios@"+Math.random(),kc=[],uc.addEventListener("message",({source:e,data:t})=>{e===uc&&t===Sc&&kc.length&&kc.shift()()},!1),e=>{kc.push(e),uc.postMessage(Sc,"*")}):e=>setTimeout(e));var xc,Ac,Sc,kc;const Tc="undefined"!=typeof queueMicrotask?queueMicrotask.bind(uc):"undefined"!=typeof process&&process.nextTick||yc;var Cc={isArray:Ws,isArrayBuffer:Hs,isBuffer:Vs,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||qs(e.append)&&("formdata"===(t=$s(e))||"object"===t&&qs(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Hs(e.buffer),t},isString:Js,isNumber:Ys,isBoolean:e=>!0===e||!1===e,isObject:Xs,isPlainObject:Qs,isEmptyObject:e=>{if(!Xs(e)||Vs(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ac,isRequest:ic,isResponse:sc,isHeaders:cc,isUndefined:Ks,isDate:ec,isFile:tc,isBlob:nc,isRegExp:gc,isFunction:qs,isStream:e=>Xs(e)&&qs(e.pipe),isURLSearchParams:oc,isTypedArray:mc,isFileList:rc,forEach:lc,merge:function e(){const{caseless:t,skipUndefined:n}=fc(this)&&this||{},r={},o=(o,a)=>{const i=t&&dc(r,a)||a;Qs(r[i])&&Qs(o)?r[i]=e(r[i],o):Qs(o)?r[i]=e({},o):Ws(o)?r[i]=o.slice():n&&Ks(o)||(r[i]=o)};for(let e=0,t=arguments.length;t>e;e++)arguments[e]&&lc(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(lc(t,(t,r)=>{n&&qs(t)?e[r]=Us(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==n&&js(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:$s,kindOfTest:Gs,endsWith:(e,t,n)=>{e+="",(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ws(e))return e;let t=e.length;if(!Ys(t))return null;const n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ls]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:hc,hasOwnProperty:bc,hasOwnProp:bc,reduceDescriptors:vc,freezeMethods:e=>{vc(e,(t,n)=>{if(qs(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];qs(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ws(e)?r(e):r((e+"").split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:dc,global:uc,isContextDefined:fc,isSpecCompliantForm:function(e){return!!(e&&qs(e.append)&&"FormData"===e[Bs]&&e[Ls])},toJSONObject:e=>{const t=[,,,,,,,,,,],n=(e,r)=>{if(Xs(e)){if(t.indexOf(e)>=0)return;if(Vs(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Ws(e)?[]:{};return lc(e,(e,t)=>{const a=n(e,r+1);!Ks(a)&&(o[t]=a)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:wc,isThenable:e=>e&&(Xs(e)||qs(e))&&qs(e.then)&&qs(e.catch),setImmediate:yc,asap:Tc,isIterable:e=>null!=e&&qs(e[Ls])};function Nc(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Cc.inherits(Nc,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Cc.toJSONObject(this.config),code:this.code,status:this.status}}});const Ec=Nc.prototype,Pc={};function Mc(e){return Cc.isPlainObject(e)||Cc.isArray(e)}function Oc(e){return Cc.endsWith(e,"[]")?e.slice(0,-2):e}function Rc(e,t,n){return e?e.concat(t).map(function(e,t){return e=Oc(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pc[e]={value:e}}),Object.defineProperties(Nc,Pc),Object.defineProperty(Ec,"isAxiosError",{value:!0}),Nc.from=(e,t,n,r,o,a)=>{const i=Object.create(Ec);Cc.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Nc.call(i,s,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",a&&Object.assign(i,a),i};const _c=Cc.toFlatObject(Cc,{},null,function(e){return/^is[A-Z]/.test(e)});function Dc(e,t,n){if(!Cc.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Cc.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Cc.isUndefined(t[e])})).metaTokens,o=n.visitor||l,a=n.dots,i=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Cc.isSpecCompliantForm(t);if(!Cc.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Cc.isDate(e))return e.toISOString();if(Cc.isBoolean(e))return e.toString();if(!s&&Cc.isBlob(e))throw new Nc("Blob is not supported. Use a Buffer instead.");return Cc.isArrayBuffer(e)||Cc.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Cc.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Cc.isArray(e)&&function(e){return Cc.isArray(e)&&!e.some(Mc)}(e)||(Cc.isFileList(e)||Cc.endsWith(n,"[]"))&&(s=Cc.toArray(e)))return n=Oc(n),s.forEach(function(e,r){!Cc.isUndefined(e)&&null!==e&&t.append(!0===i?Rc([n],r,a):null===i?n:n+"[]",c(e))}),!1;return!!Mc(e)||(t.append(Rc(o,n,a),c(e)),!1)}const d=[],u=Object.assign(_c,{defaultVisitor:l,convertValue:c,isVisitable:Mc});if(!Cc.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Cc.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),Cc.forEach(n,function(n,a){!0===(!(Cc.isUndefined(n)||null===n)&&o.call(t,n,Cc.isString(a)?a.trim():a,r,u))&&e(n,r?r.concat(a):[a])}),d.pop()}}(e),t}function Ic(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Uc(e,t){this.q=[],e&&Dc(e,this,t)}const Fc=Uc.prototype;function jc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Lc(e,t,n){if(!t)return e;const r=n&&n.encode||jc;Cc.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(a=o?o(t,n):Cc.isURLSearchParams(t)?t.toString():new Uc(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Fc.append=function(e,t){this.q.push([e,t])},Fc.toString=function(e){const t=e?function(t){return e.call(this,t,Ic)}:Ic;return this.q.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Bc{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Cc.forEach(this.handlers,function(t){null!==t&&e(t)})}}var $c={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Uc,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Gc="undefined"!=typeof window&&"undefined"!=typeof document,Zc="object"==typeof navigator&&navigator||void 0,Wc=Gc&&(!Zc||0>["ReactNative","NativeScript","NS"].indexOf(Zc.product)),Kc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Vc=Gc&&window.location.href||"http://localhost";var Hc={...Object.freeze({__proto__:null,hasBrowserEnv:Gc,hasStandardBrowserEnv:Wc,hasStandardBrowserWebWorkerEnv:Kc,navigator:Zc,origin:Vc}),...zc};function Jc(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;return a=!a&&Cc.isArray(r)?r.length:a,s?(Cc.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i):(r[a]&&Cc.isObject(r[a])||(r[a]=[]),t(e,n,r[a],o)&&Cc.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;o>r;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i)}if(Cc.isFormData(e)&&Cc.isFunction(e.entries)){const n={};return Cc.forEachEntry(e,(e,r)=>{t(function(e){return Cc.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const qc={transitional:$c,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Cc.isObject(e);if(o&&Cc.isHTMLForm(e)&&(e=new FormData(e)),Cc.isFormData(e))return r?JSON.stringify(Jc(e)):e;if(Cc.isArrayBuffer(e)||Cc.isBuffer(e)||Cc.isStream(e)||Cc.isFile(e)||Cc.isBlob(e)||Cc.isReadableStream(e))return e;if(Cc.isArrayBufferView(e))return e.buffer;if(Cc.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Dc(e,new Hc.classes.URLSearchParams,{visitor:function(e,t,n,r){return Hc.isNode&&Cc.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=Cc.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Dc(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(Cc.isString(e))try{return(0,JSON.parse)(e),Cc.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||qc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Cc.isResponse(e)||Cc.isReadableStream(e))return e;if(e&&Cc.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Nc.from(e,Nc.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hc.classes.FormData,Blob:Hc.classes.Blob},validateStatus:function(e){return e>=200&&300>e},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Cc.forEach(["delete","get","head","post","put","patch"],e=>{qc.headers[e]={}});const Yc=Cc.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Xc=Symbol("internals");function Qc(e){return e&&(e+"").trim().toLowerCase()}function el(e){return!1===e||null==e?e:Cc.isArray(e)?e.map(el):e+""}function tl(e,t,n,r,o){return Cc.isFunction(r)?r.call(this,t,n):(o&&(t=n),Cc.isString(t)?Cc.isString(r)?-1!==t.indexOf(r):Cc.isRegExp(r)?r.test(t):void 0:void 0)}class nl{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Qc(t);if(!o)throw Error("header name must be a non-empty string");const a=Cc.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=el(e))}const a=(e,t)=>Cc.forEach(e,(e,n)=>o(e,n,t));if(Cc.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Cc.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Yc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Cc.isObject(e)&&Cc.isIterable(e)){let n,r,o={};for(const t of e){if(!Cc.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Cc.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Qc(e)){const n=Cc.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Cc.isFunction(t))return t.call(this,e,n);if(Cc.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Qc(e)){const n=Cc.findKey(this,e);return!(!n||void 0===this[n]||t&&!tl(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Qc(e)){const o=Cc.findKey(n,e);!o||t&&!tl(0,n[o],o,t)||(delete n[o],r=!0)}}return Cc.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!tl(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Cc.forEach(this,(r,o)=>{const a=Cc.findKey(n,o);if(a)return t[a]=el(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):(o+"").trim();i!==o&&delete t[o],t[i]=el(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Cc.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Cc.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Xc]=this[Xc]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Qc(e);t[r]||(function(e,t){const n=Cc.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Cc.isArray(e)?e.forEach(r):r(e),this}}function rl(e,t){const n=this||qc,r=t||n,o=nl.from(r.headers);let a=r.data;return Cc.forEach(e,function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function ol(e){return!(!e||!e.Y)}function al(e,t,n){Nc.call(this,null==e?"canceled":e,Nc.ERR_CANCELED,t,n),this.name="CanceledError"}function il(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Nc("Request failed with status code "+n.status,[Nc.ERR_BAD_REQUEST,Nc.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}nl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Cc.reduceDescriptors(nl.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Cc.freezeMethods(nl),Cc.inherits(al,Nc,{Y:!0});const sl=(e,t,n=3)=>{let r=0;const o=function(e,t){const n=Array(e=e||10),r=Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=r[i];o||(o=c),n[a]=s,r[a]=c;let d=i,u=0;for(;d!==a;)u+=n[d++],d%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),t>c-o)return;const f=l&&c-l;return f?Math.round(1e3*u/f):void 0}}(50,250);return function(n,a){let i,s,c=0,l=1e3/a;const d=(n,a=Date.now())=>{c=a,i=null,s&&(clearTimeout(s),s=null),(n=>{const a=n.loaded,i=n.lengthComputable?n.total:void 0,s=a-r,c=o(s);r=a,e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:c||void 0,estimated:c&&i&&i>=a?(i-a)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-c;l>n?(i=e,s||(s=setTimeout(()=>{s=null,d(i)},l-n))):d(e,t)},()=>i&&d(i)]}(0,n)},cl=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ll=e=>(...t)=>Cc.asap(()=>e(...t));var dl=Hc.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Hc.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Hc.origin),Hc.navigator&&/(msie|trident)/i.test(Hc.navigator.userAgent)):()=>!0,ul=Hc.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];Cc.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Cc.isString(r)&&i.push("path="+r),Cc.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function fl(e,t,n){return!e||/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)&&0!=n?t:function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)}const ml=e=>e instanceof nl?{...e}:e;function pl(e,t){t=t||{};const n={};function r(e,t,n,r){return Cc.isPlainObject(e)&&Cc.isPlainObject(t)?Cc.merge.call({caseless:r},e,t):Cc.isPlainObject(t)?Cc.merge({},t):Cc.isArray(t)?t.slice():t}function o(e,t,n,o){return Cc.isUndefined(t)?Cc.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function a(e,t){if(!Cc.isUndefined(t))return r(void 0,t)}function i(e,t){return Cc.isUndefined(t)?Cc.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>o(ml(e),ml(t),0,!0)};return Cc.forEach(Object.keys({...e,...t}),function(r){const a=c[r]||o,i=a(e[r],t[r],r);Cc.isUndefined(i)&&a!==s||(n[r]=i)}),n}var hl=e=>{const t=pl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:s}=t;if(t.headers=i=nl.from(i),t.url=Lc(fl(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Cc.isFormData(n))if(Hc.hasStandardBrowserEnv||Hc.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Cc.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(Hc.hasStandardBrowserEnv&&(r&&Cc.isFunction(r)&&(r=r(t)),r||!1!==r&&dl(t.url))){const e=o&&a&&ul.read(a);e&&i.set(o,e)}return t},bl="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=hl(e);let o=r.data;const a=nl.from(r.headers).normalize();let i,s,c,l,d,{responseType:u,onUploadProgress:f,onDownloadProgress:m}=r;function p(){l&&l(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let h=new XMLHttpRequest;function b(){if(!h)return;const r=nl.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());il(function(e){t(e),p()},function(e){n(e),p()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout,"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(b)},h.onabort=function(){h&&(n(new Nc("Request aborted",Nc.ECONNABORTED,e,h)),h=null)},h.onerror=function(t){const r=new Nc(t&&t.message?t.message:"Network Error",Nc.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||$c;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Nc(t,o.clarifyTimeoutError?Nc.ETIMEDOUT:Nc.ECONNABORTED,e,h)),h=null},void 0===o&&a.setContentType(null),"setRequestHeader"in h&&Cc.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),Cc.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),u&&"json"!==u&&(h.responseType=r.responseType),m&&([c,d]=sl(m,!0),h.addEventListener("progress",c)),f&&h.upload&&([s,l]=sl(f),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{h&&(n(!t||t.type?new al(null,e,h):t),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===Hc.protocols.indexOf(g)?n(new Nc("Unsupported protocol "+g+":",Nc.ERR_BAD_REQUEST,e)):h.send(o||null)})};const gl=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Nc?t:new al(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,o(new Nc(`timeout ${t} of ms exceeded`,Nc.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>Cc.asap(i),s}},vl=function*(e,t){let n=e.byteLength;if(t>n)return void(yield e);let r,o=0;for(;n>o;)r=o+t,yield e.slice(o,r),o=r},wl=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*vl(n,t)}(e,t);let a,i=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=i+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:yl}=Cc,xl=(({Request:e,Response:t})=>({Request:e,Response:t}))(Cc.global),{ReadableStream:Al,TextEncoder:Sl}=Cc.global,kl=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Tl=e=>{e=Cc.merge.call({skipUndefined:!0},xl,e);const{fetch:t,Request:n,Response:r}=e,o=t?yl(t):"function"==typeof fetch,a=yl(n),i=yl(r);if(!o)return!1;const s=o&&yl(Al),c=o&&("function"==typeof Sl?(l=new Sl,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const d=a&&s&&kl(()=>{let e=!1;const t=new n(Hc.origin,{body:new Al,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&s&&kl(()=>Cc.isReadableStream(new r("").body)),f={stream:u&&(e=>e.body)};return o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Nc(`Response type '${e}' is not supported`,Nc.ERR_NOT_SUPPORT,n)})}),async e=>{let{url:o,method:i,data:s,signal:l,cancelToken:m,timeout:p,onDownloadProgress:h,onUploadProgress:b,responseType:g,headers:v,withCredentials:w="same-origin",fetchOptions:y}=hl(e),x=t||fetch;g=g?(g+"").toLowerCase():"text";let A=gl([l,m&&m.toAbortSignal()],p),S=null;const k=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let T;try{if(b&&d&&"get"!==i&&"head"!==i&&0!==(T=await(async(e,t)=>{const r=Cc.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Cc.isBlob(e))return e.size;if(Cc.isSpecCompliantForm(e)){const t=new n(Hc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Cc.isArrayBufferView(e)||Cc.isArrayBuffer(e)?e.byteLength:(Cc.isURLSearchParams(e)&&(e+=""),Cc.isString(e)?(await c(e)).byteLength:void 0)})(t):r})(v,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(Cc.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,n]=cl(T,sl(ll(b)));s=wl(t.body,65536,e,n)}}Cc.isString(w)||(w=w?"include":"omit");const t=a&&"credentials"in n.prototype,l={...y,signal:A,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?w:void 0};S=a&&new n(o,l);let m=await(a?x(S,y):x(o,l));const p=u&&("stream"===g||"response"===g);if(u&&(h||p&&k)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=m[t]});const t=Cc.toFiniteNumber(m.headers.get("content-length")),[n,o]=h&&cl(t,sl(ll(h),!0))||[];m=new r(wl(m.body,65536,n,()=>{o&&o(),k&&k()}),e)}g=g||"text";let C=await f[Cc.findKey(f,g)||"text"](m,e);return!p&&k&&k(),await new Promise((t,n)=>{il(t,n,{data:C,headers:nl.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:S})})}catch(t){if(k&&k(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Nc("Network Error",Nc.ERR_NETWORK,e,S),{cause:t.cause||t});throw Nc.from(t,t&&t.code,e,S)}}},Cl=new Map,Nl=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,a=[r,o,n];let i,s,c=a.length,l=Cl;for(;c--;)i=a[c],s=l.get(i),void 0===s&&l.set(i,s=c?new Map:Tl(t)),l=s;return s};Nl();const El={http:null,xhr:bl,fetch:{get:Nl}};Cc.forEach(El,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Pl=e=>"- "+e,Ml=e=>Cc.isFunction(e)||null===e||!1===e;var Ol=(e,t)=>{e=Cc.isArray(e)?e:[e];const{length:n}=e;let r,o;const a={};for(let i=0;n>i;i++){let n;if(r=e[i],o=r,!Ml(r)&&(o=El[(n=r+"").toLowerCase()],void 0===o))throw new Nc(`Unknown adapter '${n}'`);if(o&&(Cc.isFunction(o)||(o=o.get(t))))break;a[n||"#"+i]=o}if(!o){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Nc("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Pl).join("\n"):" "+Pl(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Rl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new al(null,e)}function _l(e){return Rl(e),e.headers=nl.from(e.headers),e.data=rl.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ol(e.adapter||qc.adapter,e)(e).then(function(t){return Rl(e),t.data=rl.call(e,e.transformResponse,t),t.headers=nl.from(t.headers),t},function(t){return ol(t)||(Rl(e),t&&t.response&&(t.response.data=rl.call(e,e.transformResponse,t.response),t.response.headers=nl.from(t.response.headers))),Promise.reject(t)})}const Dl="1.12.2",Il={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Il[e]=function(n){return typeof n===e||"a"+(1>t?"n ":" ")+e}});const Ul={};Il.transitional=function(e,t,n){return(r,o,a)=>{if(!1===e)throw new Nc(function(e,t){return"[Axios v"+Dl+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}(o," has been removed"+(t?" in "+t:"")),Nc.ERR_DEPRECATED);return t&&!Ul[o]&&(Ul[o]=!0),!e||e(r,o,a)}},Il.spelling=function(e){return(e,t)=>!0};var Fl={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Nc("options must be an object",Nc.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new Nc("option "+a+" must be "+n,Nc.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Nc("Unknown option "+a,Nc.ERR_BAD_OPTION)}},validators:Il};const jl=Fl.validators;class Ll{constructor(e){this.defaults=e||{},this.interceptors={request:new Bc,response:new Bc}}async request(e,t){try{return await this.X(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!(e.stack+"").endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}X(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pl(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Fl.assertOptions(n,{silentJSONParsing:jl.transitional(jl.boolean),forcedJSONParsing:jl.transitional(jl.boolean),clarifyTimeoutError:jl.transitional(jl.boolean)},!1),null!=r&&(Cc.isFunction(r)?t.paramsSerializer={serialize:r}:Fl.assertOptions(r,{encode:jl.function,serialize:jl.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Fl.assertOptions(t,{baseUrl:jl.spelling("baseURL"),withXsrfToken:jl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&Cc.merge(o.common,o[t.method]);o&&Cc.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=nl.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d,u=0;if(!s){const e=[_l.bind(this),void 0];for(e.unshift(...i),e.push(...c),d=e.length,l=Promise.resolve(t);d>u;)l=l.then(e[u++],e[u++]);return l}d=i.length;let f=t;for(;d>u;){const e=i[u++],t=i[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=_l(f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;d>u;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Lc(fl((e=pl(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Cc.forEach(["delete","get","head","options"],function(e){Ll.prototype[e]=function(t,n){return this.request(pl(n||{},{method:e,url:t,data:(n||{}).data}))}}),Cc.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(pl(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ll.prototype[e]=t(),Ll.prototype[e+"Form"]=t(!0)});class Bl{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n.ee)return;let t=n.ee.length;for(;t-- >0;)n.ee[t](e);n.ee=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new al(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this.ee?this.ee.push(e):this.ee=[e]}unsubscribe(e){if(!this.ee)return;const t=this.ee.indexOf(e);-1!==t&&this.ee.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Bl(function(t){e=t}),cancel:e}}}const $l={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($l).forEach(([e,t])=>{$l[t]=e});const zl=function e(t){const n=new Ll(t),r=Us(Ll.prototype.request,n);return Cc.extend(r,Ll.prototype,n,{allOwnKeys:!0}),Cc.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(pl(t,n))},r}(qc);zl.Axios=Ll,zl.CanceledError=al,zl.CancelToken=Bl,zl.isCancel=ol,zl.VERSION=Dl,zl.toFormData=Dc,zl.AxiosError=Nc,zl.Cancel=zl.CanceledError,zl.all=function(e){return Promise.all(e)},zl.spread=function(e){return function(t){return e.apply(null,t)}},zl.isAxiosError=function(e){return Cc.isObject(e)&&!0===e.isAxiosError},zl.mergeConfig=pl,zl.AxiosHeaders=nl,zl.formToJSON=e=>Jc(Cc.isHTMLForm(e)?new FormData(e):e),zl.getAdapter=Ol,zl.HttpStatusCode=$l,zl.default=zl;const Gl=new class{constructor(e={}){this.client=zl.create({baseURL:e.baseURL||"https://api.example.com",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json",...e.headers}}),this.client.interceptors.request.use(e=>{const t=h();return t&&(e.headers["x-session-id"]=t),e},e=>Promise.reject(e))}async get(e,t){const n=await this.client.get(e,t);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async post(e,t,n){const r=await this.client.post(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async put(e,t,n){const r=await this.client.put(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async delete(e,t){const n=await this.client.delete(e,t);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async patch(e,t,n){const r=await this.client.patch(e,t,n);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}setBaseURL(e){this.client.defaults.baseURL=e}setHeader(e,t){this.client.defaults.headers.common[e]=t}removeHeader(e){delete this.client.defaults.headers.common[e]}};class Zl{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){return b()}async getWorkspaces(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{headers:this.getAuthHeader()});if(!e.ok)throw Error("Failed to fetch workspaces");return e.json()}async createWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to create workspace");return t.json()}async updateWorkspace(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!n.ok)throw Error("Failed to update workspace");return n.json()}async deleteWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"DELETE",headers:this.getAuthHeader()});if(!t.ok)throw Error("Failed to delete workspace");return t.json()}async getWorkspaceUsers(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users`,{headers:this.getAuthHeader()});if(!t.ok)throw Error("Failed to fetch workspace users");return t.json()}async addUser(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/add`,{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!n.ok){const e=await n.json();throw Error(e.message||"Failed to invite member")}return n.json()}async removeUser(e,t){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"DELETE",headers:this.getAuthHeader()});if(!n.ok){const e=await n.json();throw Error(e.message||"Failed to remove user")}return n.json()}async updateUser(e,t,n){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(n)});if(!r.ok){const e=await r.json();throw Error(e.message||"Failed to update user")}return r.json()}async getFeatures(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/features`,{headers:this.getAuthHeader()});if(!e.ok)throw Error("Failed to fetch features");return e.json()}async updateFeature(e,t,n){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/features`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify({features:{[t]:n}})});if(!r.ok)throw Error("Failed to update feature");return r.json()}async getWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{headers:this.getAuthHeader()});if(!t.ok)throw Error("Failed to fetch workspace");return t.json()}async getProfile(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{headers:this.getAuthHeader()});if(!e.ok)throw Error("Failed to fetch profile");return e.json()}async updateUserProfile(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/profile`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(e)});if(!t.ok)throw Error("Failed to update user profile");return t.json()}}const Wl=()=>l("saas-workspace-current"),Kl=()=>{const e=K(),n=W(e=>e.os),r=t.useMemo(()=>new Zl(n),[n]),o=W(e=>e.workspaces),a=W(e=>e.auth.session?.user),i=t.useCallback(t=>{if(t.t!==o.currentWorkspace?.t&&t){const n=o.currentWorkspace;e.workspaces((e=>({type:"SET_CURRENT_WORKSPACE",payload:e}))(t)),J.emitWorkspaceChanged(t,n).catch(e=>{})}},[o.currentWorkspace,e]);t.useEffect(()=>{if(!o.isInitialized){const t=Wl();if(e.workspaces({type:"SET_IS_INITIALIZED",payload:!0}),t){const e=o.workspaces.find(e=>e.t===t);if(e){if(e.t===o.currentWorkspace?.t)return;i(e)}}}},[o.isInitialized,o.workspaces,o.currentWorkspace,e,i]);const s=t.useCallback(()=>{e.workspaces({type:"RESET_CURRENT_WORKSPACE"})},[e]),c=t.useRef(!1),l=t.useRef(!1),d=t.useCallback(async()=>{if(!o.loading&&!c.current){c.current=!0,e.workspaces(D(!0)),e.workspaces(I(null));try{const n=await r.getWorkspaces();if(e.workspaces(_(n)),n.length>0){const e=Wl();if(e&&((t=e)&&n.some(e=>e.t===t))){const t=n.find(t=>t.t===e);t&&i(t)}else n.length>0&&(o.currentWorkspace||i(n[0]))}}catch(t){e.workspaces(I(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(D(!1)),c.current=!1}}var t},[r,o.loading,o.currentWorkspace,e,i]),u=t.useCallback(async()=>{if(!o.refreshing&&!c.current){c.current=!0,e.workspaces(U(!0));try{const t=await r.getWorkspaces();e.workspaces(_(t))}catch(e){}finally{e.workspaces(U(!1)),c.current=!1}}},[r,o.refreshing,e]),f=t.useCallback(async(t,n)=>{const a=await r.createWorkspace({name:t,image:n});e.workspaces(_([...o.workspaces,a])),J.emitWorkspaceCreated(a).catch(e=>{})},[r,o.workspaces,e]),m=t.useCallback(async(t,n)=>{const a=await r.updateWorkspace(t.t,n);e.workspaces(_(o.workspaces.map(e=>e.t===t.t?a:e))),J.emitWorkspaceUpdated(a).catch(e=>{})},[r,o.workspaces,e]),p=t.useCallback(async()=>{if(l.current)return o.allFeatures.length>0?o.allFeatures:null;if(o.allFeatures.length>0)return o.allFeatures;l.current=!0;try{const t=await r.getFeatures();return e.workspaces({type:"SET_ALL_FEATURES",payload:t}),t}catch(e){return null}finally{l.current=!1}},[r,e,o.allFeatures]),h=t.useCallback(async(e,t,n)=>await r.updateFeature(e,t,n),[r]);t.useEffect(()=>{if(o.currentWorkspace?.t){const e=o.workspaces.find(e=>e.t===o.currentWorkspace?.t);if(e){if(e.t===o.currentWorkspace.t)return;i(e)}else if(o.workspaces.length>0){if(o.workspaces[0].t===o.currentWorkspace.t)return;i(o.workspaces[0])}}},[o.currentWorkspace?.t,o.workspaces,i]);const b=t.useCallback(async e=>await r.getWorkspaceUsers(e),[r]),g=t.useCallback(async(e,t,n)=>{const a=await r.addUser(e,{email:t,role:n}),i=o.workspaces.find(t=>t.t===e);return i&&J.emitWorkspaceUserAdded(a.userId,i,n).catch(e=>{}),a},[r,o.workspaces]),v=t.useCallback(async(e,t)=>{const n=o.workspaces.find(t=>t.t===e);if(n&&("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)===t)throw Error("Cannot remove the workspace owner");const a=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user.t)===t),i=await r.removeUser(e,t);if(n&&a){const e=a.role;J.emitWorkspaceUserRemoved(i.userId,n,e).catch(e=>{})}return i},[r,o.workspaces]),w=t.useCallback(async(e,t,n)=>{if(n.role){const n=o.workspaces.find(t=>t.t===e);if(n&&("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)===t)throw Error("Cannot change the role of the workspace owner")}let a;if(n.role){const n=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user.t)===t);a=n?.role}const i=await r.updateUser(e,t,n);return n.role&&a&&a!==n.role&&J.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,n.role).catch(e=>{}),i},[r,o.workspaces]),y=t.useCallback(async e=>{const t=await r.getProfile().catch(()=>null),n=await r.updateUserProfile(e);return J.emitUserUpdated(n,t||void 0).catch(e=>{}),n},[r]),x=t.useCallback(async()=>await r.getProfile(),[r]),A=t.useCallback(async e=>await r.getWorkspace(e),[r]),S=t.useCallback(async t=>{if(!a)throw Error("User must be authenticated to delete a workspace");const n=o.workspaces.find(e=>e.t===t);if(!n)throw Error("Workspace not found");if(("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)!==a.id)throw Error("Only the workspace creator can delete the workspace");const i=await r.deleteWorkspace(t);return e.workspaces(_(o.workspaces.filter(e=>e.t!==t))),o.currentWorkspace?.t===t&&e.workspaces({type:"RESET_CURRENT_WORKSPACE"}),n&&J.emitWorkspaceDeleted(n).catch(e=>{}),i},[r,o.workspaces,o.currentWorkspace,e,a]);return{workspaces:o.workspaces,loading:o.loading,error:o.error,fetchWorkspaces:d,refreshWorkspaces:u,refreshing:o.refreshing,currentWorkspace:o.currentWorkspace,setCurrentWorkspace:i,resetCurrentWorkspace:s,createWorkspace:f,allFeatures:o.allFeatures,getFeatures:p,updateFeature:h,getWorkspace:A,switching:o.switching,updateWorkspace:m,getUsers:b,addUser:g,removeUser:v,updateUser:w,getProfile:x,updateUserProfile:y,deleteWorkspace:S}};function Vl(){const e=K(),n=W(e=>e.auth),r=W(e=>e.os),{serverUrl:o,orgId:a,auth:i}=r,{resetCurrentWorkspace:s}=Kl(),c=t.useCallback(async()=>{e.auth({type:"AUTHENTICATION_STARTED"});try{const t=await Gl.post(o+"/api/v1/auth/request",{orgId:a,clientId:i?.clientId,redirect:{success:i?.redirectUrl||window.location.href,error:i?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth({type:"AUTHENTICATION_FAILED"}),Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth({type:"AUTHENTICATION_FAILED"}),t}},[o,a,i,e]),l=t.useCallback(async()=>{try{i?.callbacks?.onSignOut&&"function"==typeof i.callbacks.onSignOut&&await i.callbacks.onSignOut(),e.auth({type:"REMOVE_SESSION"}),s(),p()}catch(e){p()}},[e,s,i?.callbacks?.onSignOut]);return t.useMemo(()=>({user:n.session?.user,session:n.session,isLoading:n.isLoading,isAuthenticated:n.isAuthenticated,isRedirecting:n.isRedirecting,status:n.status,signIn:c,signOut:l}),[n,c,l])}function Hl(){const e=K(),n=W(e=>e.os),{serverUrl:r,version:o,orgId:a,settings:i}=n,s=t.useRef(!1),c=t.useCallback(async()=>{if(s.current)return i||null;if(i)return i;if(!r||!o||!a)return null;s.current=!0;try{const t=b(),n=await fetch(`${r}/api/${o}/public/${a}/settings`,{headers:t});if(!n.ok)throw Error("Failed to fetch settings");const i=await n.json();return e.os(T(i)),i}catch(e){return null}finally{s.current=!1}},[r,o,a,i,e]);return t.useEffect(()=>{r&&o&&a&&!i&&!s.current&&c()},[r,o,a]),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function Jl(t,n=[]){let r=[];const a=()=>{const e=r.map(e=>o.createContext(e));return function(n){const r=n?.[t]||e;return o.useMemo(()=>({["__scope"+t]:{...n,[t]:r}}),[n,r])}};return a.scopeName=t,[function(n,a){const i=o.createContext(a),s=r.length;r=[...r,a];const c=n=>{const{scope:r,children:a,...c}=n,l=r?.[t]?.[s]||i,d=o.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,children:a})};return c.displayName=n+"Provider",[c,function(e,r){const c=r?.[t]?.[s]||i,l=o.useContext(c);if(l)return l;if(void 0!==a)return a;throw Error(`\`${e}\` must be used within \`${n}\``)}]},ql(a,...n)]}function ql(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)["__scope"+r]}),{});return o.useMemo(()=>({["__scope"+t.scopeName]:r}),[r])}};return n.scopeName=t.scopeName,n}function Yl(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}var Xl,Ql=globalThis?.document?o.useLayoutEffect:()=>{},ed={exports:{}},td={};function nd(){if(Xl)return td;Xl=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,o=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),c=r({inst:{value:n,getSnapshot:t}}),l=c[0].inst,d=c[1];return a(function(){l.value=n,l.getSnapshot=t,s(l)&&d({inst:l})},[e,n,t]),o(function(){return s(l)&&d({inst:l}),e(function(){s(l)&&d({inst:l})})},[e]),i(n),n};return td.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,td}var rd,od,ad={};function id(){return rd||(rd=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=t,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,c=!1,l=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,d){c||void 0===n.startTransition||(c=!0);var u=d();if(!l){var f=d();r(u,f)||(l=!0)}var m=(f=o({inst:{value:u,getSnapshot:d}}))[0].inst,p=f[1];return i(function(){m.value=u,m.getSnapshot=d,e(m)&&p({inst:m})},[t,u,d]),a(function(){return e(m)&&p({inst:m}),t(function(){e(m)&&p({inst:m})})},[t]),s(u),u};ad.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ad}function sd(){return od||(od=1,"production"===process.env.NODE_ENV?ed.exports=nd():ed.exports=id()),ed.exports}var cd=sd();function ld(){return()=>{}}var dd="Avatar",[ud,fd]=Jl(dd),[md,pd]=ud(dd),hd=o.forwardRef((t,n)=>{const{te:r,...a}=t,[i,s]=o.useState("idle");return e.jsx(md,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:e.jsx(ai.span,{...a,ref:n})})});hd.displayName=dd;var bd="AvatarImage",gd=o.forwardRef((t,n)=>{const{te:r,src:a,onLoadingStatusChange:i=()=>{},...s}=t,c=pd(bd,r),l=function(e,{referrerPolicy:t,crossOrigin:n}){const r=cd.useSyncExternalStore(ld,()=>!0,()=>!1),a=o.useRef(null),i=r?(a.current||(a.current=new window.Image),a.current):null,[s,c]=o.useState(()=>yd(i,e));return Ql(()=>{c(yd(i,e))},[i,e]),Ql(()=>{const e=e=>()=>{c(e)};if(!i)return;const r=e("loaded"),o=e("error");return i.addEventListener("load",r),i.addEventListener("error",o),t&&(i.referrerPolicy=t),"string"==typeof n&&(i.crossOrigin=n),()=>{i.removeEventListener("load",r),i.removeEventListener("error",o)}},[i,n,t]),s}(a,s),d=Yl(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ql(()=>{"idle"!==l&&d(l)},[l,d]),"loaded"===l?e.jsx(ai.img,{...s,ref:n,src:a}):null});gd.displayName=bd;var vd="AvatarFallback",wd=o.forwardRef((t,n)=>{const{te:r,delayMs:a,...i}=t,s=pd(vd,r),[c,l]=o.useState(void 0===a);return o.useEffect(()=>{if(void 0!==a){const e=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(e)}},[a]),c&&"loaded"!==s.imageLoadingStatus?e.jsx(ai.span,{...i,ref:n}):null});function yd(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}wd.displayName=vd;var xd=hd,Ad=gd,Sd=wd;const kd=o.forwardRef(({className:t,...n},r)=>e.jsx(xd,{ref:r,className:Aa("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n}));kd.displayName=xd.displayName;const Td=o.forwardRef(({className:t,...n},r)=>e.jsx(Ad,{ref:r,className:Aa("aspect-square h-full w-full",t),...n}));Td.displayName=Ad.displayName;const Cd=o.forwardRef(({className:t,...n},r)=>e.jsx(Sd,{ref:r,className:Aa("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n}));function Nd(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}Cd.displayName=Sd.displayName;var Ed=o.useId||(()=>{}),Pd=0;function Md(e){const[t,n]=o.useState(Ed());return Ql(()=>{n(e=>e??Pd+++"")},[e]),e||(t?"radix-"+t:"")}var Od=o.useInsertionEffect||Ql;function Rd({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),i=o.useRef(t);return Od(()=>{i.current=t},[t]),o.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}({defaultProp:t,onChange:n}),c=void 0!==e,l=c?e:a;{const t=o.useRef(void 0!==e);o.useEffect(()=>{t.current,t.current=c},[c,r])}const d=o.useCallback(t=>{if(c){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[c,e,i,s]);return[l,d]}var _d,Dd="dismissableLayer.update",Id=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ud=o.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...d}=t,u=o.useContext(Id),[f,m]=o.useState(null),p=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),b=Ta(n,e=>m(e)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),y=f?g.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,A=y>=w,S=function(e,t=globalThis?.document){const n=Yl(e),r=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){jd("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));A&&!n&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},p),k=function(e,t=globalThis?.document){const n=Yl(e),r=o.useRef(!1);return o.useEffect(()=>{const e=e=>{e.target&&!r.current&&jd("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},p);return function(e,t=globalThis?.document){const n=Yl(e);o.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),o.useEffect(()=>{if(f)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(_d=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Fd(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_d)}},[f,p,r,u]),o.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Fd())},[f,u]),o.useEffect(()=>{const e=()=>h({});return document.addEventListener(Dd,e),()=>document.removeEventListener(Dd,e)},[]),e.jsx(ai.div,{...d,ref:b,style:{pointerEvents:x?A?"auto":"none":void 0,...t.style},onFocusCapture:Nd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:Nd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Nd(t.onPointerDownCapture,S.onPointerDownCapture)})});function Fd(){const e=new CustomEvent(Dd);document.dispatchEvent(e)}function jd(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}Ud.displayName="DismissableLayer",o.forwardRef((t,n)=>{const r=o.useContext(Id),a=o.useRef(null),i=Ta(n,a);return o.useEffect(()=>{const e=a.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),e.jsx(ai.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Ld="focusScope.autoFocusOnMount",Bd="focusScope.autoFocusOnUnmount",$d={bubbles:!1,cancelable:!0},zd=o.forwardRef((t,n)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...c}=t,[l,d]=o.useState(null),u=Yl(i),f=Yl(s),m=o.useRef(null),p=Ta(n,e=>d(e)),h=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:Kd(m.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Kd(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Kd(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,l,h.paused]),o.useEffect(()=>{if(l){Vd.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(Ld,$d);l.addEventListener(Ld,u),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Kd(r,{select:t}),document.activeElement!==n)return}(Gd(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&Kd(l))}return()=>{l.removeEventListener(Ld,u),setTimeout(()=>{const t=new CustomEvent(Bd,$d);l.addEventListener(Bd,f),l.dispatchEvent(t),t.defaultPrevented||Kd(e??document.body,{select:!0}),l.removeEventListener(Bd,f),Vd.remove(h)},0)}}},[l,u,f,h]);const b=o.useCallback(e=>{if(!r&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=Gd(e);return[Zd(t,e),Zd(t.reverse(),e)]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&Kd(a,{select:!0})):(e.preventDefault(),r&&Kd(o,{select:!0})):n===t&&e.preventDefault()}},[r,a,h.paused]);return e.jsx(ai.div,{tabIndex:-1,...c,ref:p,onKeyDown:b})});function Gd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t||0>e.tabIndex?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zd(e,t){for(const n of e)if(!Wd(n,{upTo:t}))return n}function Wd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Kd(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}zd.displayName="FocusScope";var Vd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Hd(e,t),e.unshift(t)},remove(t){e=Hd(e,t),e[0]?.resume()}}}();function Hd(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Jd=o.forwardRef((t,r)=>{const{container:a,...i}=t,[s,c]=o.useState(!1);Ql(()=>c(!0),[]);const l=a||s&&globalThis?.document?.body;return l?n.createPortal(e.jsx(ai.div,{...i,ref:r}),l):null});Jd.displayName="Portal";var qd=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=o.useState(),r=o.useRef(null),a=o.useRef(e),i=o.useRef("none"),s=e?"mounted":"unmounted",[c,l]=function(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=Yd(r.current);i.current="mounted"===c?e:"none"},[c]),Ql(()=>{const t=r.current,n=a.current;if(n!==e){const r=i.current,o=Yd(t);l(e?"MOUNT":"none"===o||"none"===t?.display?"UNMOUNT":n&&r!==o?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),Ql(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,o=o=>{const i=Yd(r.current).includes(CSS.escape(o.animationName));if(o.target===t&&i&&(l("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=Yd(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:r.isPresent}):o.Children.only(n),i=Ta(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(a));return"function"==typeof n||r.isPresent?o.cloneElement(a,{ref:i}):null};function Yd(e){return e?.animationName||"none"}qd.displayName="Presence";var Xd=0;function Qd(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??eu()),document.body.insertAdjacentElement("beforeend",e[1]??eu()),Xd++,()=>{1===Xd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Xd--}},[])}function eu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tu=function(){return tu=Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tu.apply(this,arguments)};function nu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var ru="right-scroll-bar-position",ou="width-before-scroll-bar";function au(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var iu="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,su=new WeakMap;function cu(e){return e}var lu=function(e){var t=e.sideCar,n=nu(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return o.createElement(r,tu({},n))};lu.isSideCarExport=!0;var du=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=cu);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}}}();return t.options=tu({async:!0,ssr:!1},e),t}(),uu=function(){},fu=o.forwardRef(function(e,n){var r=o.useRef(null),a=o.useState({onScrollCapture:uu,onWheelCapture:uu,onTouchMoveCapture:uu}),i=a[0],s=a[1],c=e.forwardProps,l=e.children,d=e.className,u=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noRelative,b=e.noIsolation,g=e.inert,v=e.allowPinchZoom,w=e.as,y=void 0===w?"div":w,x=e.gapMode,A=nu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,k=function(e){var n,r,o=(n=function(t){return e.forEach(function(e){return au(e,t)})},(r=t.useState(function(){return{value:null,callback:n,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0]).callback=n,r.facade);return iu(function(){var t=su.get(o);if(t){var n=new Set(t),r=new Set(e),a=o.current;n.forEach(function(e){r.has(e)||au(e,null)}),r.forEach(function(e){n.has(e)||au(e,a)})}su.set(o,e)},[e]),o}([r,n]),T=tu(tu({},A),i);return o.createElement(o.Fragment,null,f&&o.createElement(S,{sideCar:du,removeScrollBar:u,shards:m,noRelative:h,noIsolation:b,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:x}),c?o.cloneElement(o.Children.only(l),tu(tu({},T),{ref:k})):o.createElement(y,tu({},T,{className:d,ref:k}),l))});fu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fu.classNames={fullWidth:ou,zeroRight:ru};var mu=function(){var e,t,n,r=(t=0,n=null,e={add:function(e){var r,o;0==t&&(n=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}())&&(o=e,(r=n).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(n)),t++},remove:function(){! --t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}},function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var t=e.styles,n=e.dynamic;return r(t,n),null}},pu={left:0,top:0,right:0,gap:0},hu=function(e){return parseInt(e||"",10)||0},bu=mu(),gu="data-scroll-locked",vu=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .with-scroll-bars-hidden {\n overflow: hidden ".concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(gu,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(ru," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ou," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ru," .").concat(ru," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ou," .").concat(ou," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(gu,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},wu=function(){var e=parseInt(document.body.getAttribute(gu)||"0",10);return isFinite(e)?e:0},yu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;o.useEffect(function(){return document.body.setAttribute(gu,""+(wu()+1)),function(){var e=wu()-1;e>0?document.body.setAttribute(gu,e.toString()):document.body.removeAttribute(gu)}},[]);var i=o.useMemo(function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return pu;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[hu(n),hu(r),hu(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(a)},[a]);return o.createElement(bu,{styles:vu(i,!t,a,n?"":"!important")})},xu=!1;if("undefined"!=typeof window)try{var Au=Object.defineProperty({},"passive",{get:function(){return xu=!0,!0}});window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch(e){xu=!1}var Su=!!xu&&{passive:!1},ku=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Tu=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Cu(e,r)){var o=Nu(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cu=function(e,t){return"v"===e?function(e){return ku(e,"overflowY")}(t):function(e){return ku(e,"overflowX")}(t)},Nu=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Eu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pu=function(e){return[e.deltaX,e.deltaY]},Mu=function(e){return e&&"current"in e?e.current:e},Ou=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ru=0,_u=[];function Du(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Iu,Uu=(Iu=function(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),a=o.useState(Ru++)[0],i=o.useState(mu)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;a>o;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Mu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=Eu(e),i=n.current,c="deltaX"in e?e.deltaX:i[0]-a[0],l="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var f=Tu(u,d);if(!f)return!0;if(f?o=u:(o="v"===u?"h":"v",f=Tu(u,d)),!f)return!1;if(!r.current&&"changedTouches"in e&&(c||l)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*r,i=n.target,s=t.contains(i),c=!1,l=a>0,d=0,u=0;do{if(!i)break;var f=Nu(e,i),m=f[0],p=f[1]-f[2]-o*m;(m||p)&&Cu(e,i)&&(d+=p,u+=m);var h=i.parentNode;i=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(l&&1>Math.abs(d)||!l&&1>Math.abs(u))&&(c=!0),c}(m,t,e,"h"===m?c:l)},[]),l=o.useCallback(function(e){var n=e;if(_u.length&&_u[_u.length-1]===i){var r="deltaY"in n?Pu(n):Eu(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var a=(s.current.shards||[]).map(Mu).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?c(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),d=o.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Du(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=o.useCallback(function(e){n.current=Eu(e),r.current=void 0},[]),f=o.useCallback(function(t){d(t.type,Pu(t),t.target,c(t,e.lockRef.current))},[]),m=o.useCallback(function(t){d(t.type,Eu(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return _u.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Su),document.addEventListener("touchmove",l,Su),document.addEventListener("touchstart",u,Su),function(){_u=_u.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Su),document.removeEventListener("touchmove",l,Su),document.removeEventListener("touchstart",u,Su)}},[]);var p=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(i,{styles:Ou(a)}):null,p?o.createElement(yu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},du.useMedium(Iu),lu),Fu=o.forwardRef(function(e,t){return o.createElement(fu,tu({},e,{ref:t,sideCar:Uu}))});Fu.classNames=fu.classNames;var ju=new WeakMap,Lu=new WeakMap,Bu={},$u=0,zu=function(e){return e&&(e.host||zu(e.parentNode))},Gu=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=zu(t);return n&&e.contains(n)?n:null}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Bu[n]||(Bu[n]=new WeakMap);var a=Bu[n],i=[],s=new Set,c=new Set(o),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};o.forEach(l);var d=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,c=(ju.get(e)||0)+1,l=(a.get(e)||0)+1;ju.set(e,c),a.set(e,l),i.push(e),1===c&&o&&Lu.set(e,!0),1===l&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(e){}})};return d(t),s.clear(),$u++,function(){i.forEach(function(e){var t=ju.get(e)-1,o=a.get(e)-1;ju.set(e,t),a.set(e,o),t||(Lu.has(e)||e.removeAttribute(r),Lu.delete(e)),o||e.removeAttribute(n)}),--$u||(ju=new WeakMap,ju=new WeakMap,Lu=new WeakMap,Bu={})}}(r,o,n,"aria-hidden")):function(){return null}},Zu="Dialog",[Wu,Ku]=Jl(Zu),[Vu,Hu]=Wu(Zu),Ju=t=>{const{ne:n,children:r,open:a,defaultOpen:i,onOpenChange:s,modal:c=!0}=t,l=o.useRef(null),d=o.useRef(null),[u,f]=Rd({prop:a,defaultProp:i??!1,onChange:s,caller:Zu});return e.jsx(Vu,{scope:n,triggerRef:l,contentRef:d,contentId:Md(),titleId:Md(),descriptionId:Md(),open:u,onOpenChange:f,onOpenToggle:o.useCallback(()=>f(e=>!e),[f]),modal:c,children:r})};Ju.displayName=Zu;var qu="DialogTrigger",Yu=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Hu(qu,r),i=Ta(n,a.triggerRef);return e.jsx(ai.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":vf(a.open),...o,ref:i,onClick:Nd(t.onClick,a.onOpenToggle)})});Yu.displayName=qu;var Xu="DialogPortal",[Qu,ef]=Wu(Xu,{forceMount:void 0}),tf=t=>{const{ne:n,forceMount:r,children:a,container:i}=t,s=Hu(Xu,n);return e.jsx(Qu,{scope:n,forceMount:r,children:o.Children.map(a,t=>e.jsx(qd,{present:r||s.open,children:e.jsx(Jd,{asChild:!0,container:i,children:t})}))})};tf.displayName=Xu;var nf="DialogOverlay",rf=o.forwardRef((t,n)=>{const r=ef(nf,t.ne),{forceMount:o=r.forceMount,...a}=t,i=Hu(nf,t.ne);return i.modal?e.jsx(qd,{present:o||i.open,children:e.jsx(af,{...a,ref:n})}):null});rf.displayName=nf;var of=Ca("DialogOverlay.RemoveScroll"),af=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Hu(nf,r);return e.jsx(Fu,{as:of,allowPinchZoom:!0,shards:[a.contentRef],children:e.jsx(ai.div,{"data-state":vf(a.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),sf="DialogContent",cf=o.forwardRef((t,n)=>{const r=ef(sf,t.ne),{forceMount:o=r.forceMount,...a}=t,i=Hu(sf,t.ne);return e.jsx(qd,{present:o||i.open,children:i.modal?e.jsx(lf,{...a,ref:n}):e.jsx(df,{...a,ref:n})})});cf.displayName=sf;var lf=o.forwardRef((t,n)=>{const r=Hu(sf,t.ne),a=o.useRef(null),i=Ta(n,r.contentRef,a);return o.useEffect(()=>{const e=a.current;if(e)return Gu(e)},[]),e.jsx(uf,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nd(t.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Nd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Nd(t.onFocusOutside,e=>e.preventDefault())})}),df=o.forwardRef((t,n)=>{const r=Hu(sf,t.ne),a=o.useRef(!1),i=o.useRef(!1);return e.jsx(uf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||r.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,o=r.triggerRef.current?.contains(n);o&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),uf=o.forwardRef((t,n)=>{const{ne:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...c}=t,l=Hu(sf,r),d=o.useRef(null),u=Ta(n,d);return Qd(),e.jsxs(e.Fragment,{children:[e.jsx(zd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:e.jsx(Ud,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":vf(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Af,{titleId:l.titleId}),e.jsx(Sf,{contentRef:d,descriptionId:l.descriptionId})]})]})}),ff="DialogTitle",mf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Hu(ff,r);return e.jsx(ai.h2,{id:a.titleId,...o,ref:n})});mf.displayName=ff;var pf="DialogDescription",hf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Hu(pf,r);return e.jsx(ai.p,{id:a.descriptionId,...o,ref:n})});hf.displayName=pf;var bf="DialogClose",gf=o.forwardRef((t,n)=>{const{ne:r,...o}=t,a=Hu(bf,r);return e.jsx(ai.button,{type:"button",...o,ref:n,onClick:Nd(t.onClick,()=>a.onOpenChange(!1))})});function vf(e){return e?"open":"closed"}gf.displayName=bf;var wf="DialogTitleWarning",[yf,xf]=function(t,n){const r=o.createContext(n),a=t=>{const{children:n,...a}=t,i=o.useMemo(()=>a,Object.values(a));return e.jsx(r.Provider,{value:i,children:n})};return a.displayName=t+"Provider",[a,function(e){return o.useContext(r)||n}]}(wf,{contentName:sf,titleName:ff,docsSlug:"dialog"}),Af=({titleId:e})=>{const t=xf(wf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return o.useEffect(()=>{e&&document.getElementById(e)},[n,e]),null},Sf=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xf("DialogDescriptionWarning").contentName}}.`;return o.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");t&&n&&document.getElementById(t)},[n,e,t]),null},kf=Ju,Tf=Yu,Cf=tf,Nf=rf,Ef=cf,Pf=mf,Mf=hf,Of=gf;function Rf(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0>t.indexOf(n)&&(o[n]=e[n]);return o}var _f=["color"],Df=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Rf(e,_f);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),If=["color"],Uf=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Rf(e,If);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Ff=["color"],jf=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Rf(e,Ff);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Lf=["color"],Bf=t.forwardRef(function(e,n){var r=e.color,o=void 0===r?"currentColor":r,a=Rf(e,Lf);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:n}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});const $f=kf,zf=Tf,Gf=Cf,Zf=o.forwardRef(({className:t,...n},r)=>e.jsx(Nf,{ref:r,className:Aa("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n}));Zf.displayName=Nf.displayName;const Wf=o.forwardRef(({className:t,children:n,...r},a)=>{const{container:i}=o.useContext(q);return e.jsxs(Gf,{container:i,children:[e.jsx(Zf,{}),e.jsxs(Ef,{ref:a,className:Aa("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...r,children:[n,e.jsxs(Of,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(jf,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Wf.displayName=Ef.displayName;const Kf=({className:t,...n})=>e.jsx("div",{className:Aa("flex flex-col space-y-1.5 text-center sm:text-left",t),...n});Kf.displayName="DialogHeader";const Vf=o.forwardRef(({className:t,...n},r)=>e.jsx(Pf,{ref:r,className:Aa("text-lg font-semibold leading-none tracking-tight",t),...n}));Vf.displayName=Pf.displayName;const Hf=o.forwardRef(({className:t,...n},r)=>e.jsx(Mf,{ref:r,className:Aa("text-sm text-muted-foreground",t),...n}));function Jf(n){const r=n+"CollectionProvider",[o,a]=Jl(r),[i,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),c=n=>{const{scope:r,children:o}=n,a=t.useRef(null),s=t.useRef(new Map).current;return e.jsx(i,{scope:r,itemMap:s,collectionRef:a,children:o})};c.displayName=r;const l=n+"CollectionSlot",d=Ca(l),u=t.forwardRef((t,n)=>{const{scope:r,children:o}=t,a=Ta(n,s(l,r).collectionRef);return e.jsx(d,{ref:a,children:o})});u.displayName=l;const f=n+"CollectionItemSlot",m="data-radix-collection-item",p=Ca(f),h=t.forwardRef((n,r)=>{const{scope:o,children:a,...i}=n,c=t.useRef(null),l=Ta(r,c),d=s(f,o);return t.useEffect(()=>(d.itemMap.set(c,{ref:c,...i}),()=>{d.itemMap.delete(c)})),e.jsx(p,{[m]:"",ref:l,children:a})});return h.displayName=f,[{Provider:c,Slot:u,ItemSlot:h},function(e){const r=s(n+"CollectionConsumer",e),o=t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return n},[r.collectionRef,r.itemMap]);return o},a]}Hf.displayName=Mf.displayName;var qf=o.createContext(void 0);function Yf(e){const t=o.useContext(qf);return e||t||"ltr"}var Xf="rovingFocusGroup.onEntryFocus",Qf={bubbles:!1,cancelable:!0},em="RovingFocusGroup",[tm,nm,rm]=Jf(em),[om,am]=Jl(em,[rm]),[im,sm]=om(em),cm=o.forwardRef((t,n)=>e.jsx(tm.Provider,{scope:t.re,children:e.jsx(tm.Slot,{scope:t.re,children:e.jsx(lm,{...t,ref:n})})}));cm.displayName=em;var lm=o.forwardRef((t,n)=>{const{re:r,orientation:a,loop:i=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=t,p=o.useRef(null),h=Ta(n,p),b=Yf(s),[g,v]=Rd({prop:c,defaultProp:l??null,onChange:d,caller:em}),[w,y]=o.useState(!1),x=Yl(u),A=nm(r),S=o.useRef(!1),[k,T]=o.useState(0);return o.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(Xf,x),()=>e.removeEventListener(Xf,x)},[x]),e.jsx(im,{scope:r,orientation:a,dir:b,loop:i,currentTabStopId:g,onItemFocus:o.useCallback(e=>v(e),[v]),onItemShiftTab:o.useCallback(()=>y(!0),[]),onFocusableItemAdd:o.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>T(e=>e-1),[]),children:e.jsx(ai.div,{tabIndex:w||0===k?-1:0,"data-orientation":a,...m,ref:h,style:{outline:"none",...t.style},onMouseDown:Nd(t.onMouseDown,()=>{S.current=!0}),onFocus:Nd(t.onFocus,e=>{const t=!S.current;if(e.target===e.currentTarget&&t&&!w){const t=new CustomEvent(Xf,Qf);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=A().filter(e=>e.focusable);mm([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),f)}}S.current=!1}),onBlur:Nd(t.onBlur,()=>y(!1))})})}),dm="RovingFocusGroupItem",um=o.forwardRef((t,n)=>{const{re:r,focusable:a=!0,active:i=!1,tabStopId:s,children:c,...l}=t,d=Md(),u=s||d,f=sm(dm,r),m=f.currentTabStopId===u,p=nm(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:g}=f;return o.useEffect(()=>{if(a)return h(),()=>b()},[a,h,b]),e.jsx(tm.ItemSlot,{scope:r,id:u,focusable:a,active:i,children:e.jsx(ai.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...l,ref:n,onMouseDown:Nd(t.onMouseDown,e=>{a?f.onItemFocus(u):e.preventDefault()}),onFocus:Nd(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:Nd(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:fm[r]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const a=o.indexOf(e.currentTarget);o=f.loop?(r=a+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(a+1)}setTimeout(()=>mm(o))}var n,r}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=g}):c})})});um.displayName=dm;var fm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mm(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var pm=cm,hm=um;function bm(e){const[t,n]=o.useState(void 0);return Ql(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}function gm(e){const t=o.useRef({value:e,previous:e});return o.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var vm="Radio",[wm,ym]=Jl(vm),[xm,Am]=wm(vm),Sm=o.forwardRef((t,n)=>{const{oe:r,name:a,checked:i=!1,required:s,disabled:c,value:l="on",onCheck:d,form:u,...f}=t,[m,p]=o.useState(null),h=Ta(n,e=>p(e)),b=o.useRef(!1),g=!m||u||!!m.closest("form");return e.jsxs(xm,{scope:r,checked:i,disabled:c,children:[e.jsx(ai.button,{type:"button",role:"radio","aria-checked":i,"data-state":Nm(i),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:h,onClick:Nd(t.onClick,e=>{i||d?.(),g&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),g&&e.jsx(Cm,{control:m,bubbles:!b.current,name:a,value:l,checked:i,required:s,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});Sm.displayName=vm;var km="RadioIndicator",Tm=o.forwardRef((t,n)=>{const{oe:r,forceMount:o,...a}=t,i=Am(km,r);return e.jsx(qd,{present:o||i.checked,children:e.jsx(ai.span,{"data-state":Nm(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n})})});Tm.displayName=km;var Cm=o.forwardRef(({oe:t,control:n,checked:r,bubbles:a=!0,...i},s)=>{const c=o.useRef(null),l=Ta(c,s),d=gm(r),u=bm(n);return o.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==r&&n){const t=new Event("click",{bubbles:a});n.call(e,r),e.dispatchEvent(t)}},[d,r,a]),e.jsx(ai.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Nm(e){return e?"checked":"unchecked"}Cm.displayName="RadioBubbleInput";var Em=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Pm="RadioGroup",[Mm,Om]=Jl(Pm,[am,ym]),Rm=am(),_m=ym(),[Dm,Im]=Mm(Pm),Um=o.forwardRef((t,n)=>{const{ae:r,name:o,defaultValue:a,value:i,required:s=!1,disabled:c=!1,orientation:l,dir:d,loop:u=!0,onValueChange:f,...m}=t,p=Rm(r),h=Yf(d),[b,g]=Rd({prop:i,defaultProp:a??null,onChange:f,caller:Pm});return e.jsx(Dm,{scope:r,name:o,required:s,disabled:c,value:b,onValueChange:g,children:e.jsx(pm,{asChild:!0,...p,orientation:l,dir:h,loop:u,children:e.jsx(ai.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":c?"":void 0,dir:h,...m,ref:n})})})});Um.displayName=Pm;var Fm="RadioGroupItem",jm=o.forwardRef((t,n)=>{const{ae:r,disabled:a,...i}=t,s=Im(Fm,r),c=s.disabled||a,l=Rm(r),d=_m(r),u=o.useRef(null),f=Ta(n,u),m=s.value===i.value,p=o.useRef(!1);return o.useEffect(()=>{const e=e=>{Em.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(hm,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(Sm,{disabled:c,required:s.required,checked:m,...d,...i,name:s.name,ref:f,onCheck:()=>s.onValueChange(i.value),onKeyDown:Nd(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Nd(i.onFocus,()=>{p.current&&u.current?.click()})})})});jm.displayName=Fm;var Lm=o.forwardRef((t,n)=>{const{ae:r,...o}=t,a=_m(r);return e.jsx(Tm,{...a,...o,ref:n})});Lm.displayName="RadioGroupIndicator";var Bm=Um,$m=jm,zm=Lm;const Gm=o.forwardRef(({className:t,...n},r)=>e.jsx(Bm,{className:Aa("grid gap-2",t),...n,ref:r}));Gm.displayName=Bm.displayName;const Zm=o.forwardRef(({className:t,...n},r)=>e.jsx($m,{ref:r,className:Aa("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:e.jsx(zm,{className:"flex items-center justify-center",children:e.jsx(Uf,{className:"h-3.5 w-3.5 fill-primary"})})}));function Wm(e,[t,n]){return Math.min(n,Math.max(t,e))}Zm.displayName=$m.displayName;var Km="ScrollArea",[Vm,Hm]=Jl(Km),[Jm,qm]=Vm(Km),Ym=o.forwardRef((t,n)=>{const{ie:r,type:a="hover",dir:i,scrollHideDelay:s=600,...c}=t,[l,d]=o.useState(null),[u,f]=o.useState(null),[m,p]=o.useState(null),[h,b]=o.useState(null),[g,v]=o.useState(null),[w,y]=o.useState(0),[x,A]=o.useState(0),[S,k]=o.useState(!1),[T,C]=o.useState(!1),N=Ta(n,e=>d(e)),E=Yf(i);return e.jsx(Jm,{scope:r,type:a,dir:E,scrollHideDelay:s,scrollArea:l,viewport:u,onViewportChange:f,content:m,onContentChange:p,scrollbarX:h,onScrollbarXChange:b,scrollbarXEnabled:S,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:v,scrollbarYEnabled:T,onScrollbarYEnabledChange:C,onCornerWidthChange:y,onCornerHeightChange:A,children:e.jsx(ai.div,{dir:E,...c,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});Ym.displayName=Km;var Xm="ScrollAreaViewport",Qm=o.forwardRef((t,n)=>{const{ie:r,children:a,nonce:i,...s}=t,c=qm(Xm,r),l=Ta(n,o.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{se:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(ai.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});Qm.displayName=Xm;var ep="ScrollAreaScrollbar",tp=o.forwardRef((t,n)=>{const{forceMount:r,...a}=t,i=qm(ep,t.ie),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return o.useEffect(()=>(l?s(!0):c(!0),()=>{l?s(!1):c(!1)}),[l,s,c]),"hover"===i.type?e.jsx(np,{...a,ref:n,forceMount:r}):"scroll"===i.type?e.jsx(rp,{...a,ref:n,forceMount:r}):"auto"===i.type?e.jsx(op,{...a,ref:n,forceMount:r}):"always"===i.type?e.jsx(ap,{...a,ref:n}):null});tp.displayName=ep;var np=o.forwardRef((t,n)=>{const{forceMount:r,...a}=t,i=qm(ep,t.ie),[s,c]=o.useState(!1);return o.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),c(!0)},r=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(qd,{present:r||s,children:e.jsx(op,{"data-state":s?"visible":"hidden",...a,ref:n})})}),rp=o.forwardRef((t,n)=>{const{forceMount:r,...a}=t,i=qm(ep,t.ie),s="horizontal"===t.orientation,c=kp(()=>d("SCROLL_END"),100),[l,d]=(u={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},o.useReducer((e,t)=>u[e][t]??e,"hidden"));var u;return o.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,d]),o.useEffect(()=>{const e=i.viewport,t=s?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(d("SCROLL"),c()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[i.viewport,s,d,c]),e.jsx(qd,{present:r||"hidden"!==l,children:e.jsx(ap,{"data-state":"hidden"===l?"hidden":"visible",...a,ref:n,onPointerEnter:Nd(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Nd(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),op=o.forwardRef((t,n)=>{const r=qm(ep,t.ie),{forceMount:a,...i}=t,[s,c]=o.useState(!1),l="horizontal"===t.orientation,d=kp(()=>{if(r.viewport){const e=r.viewport.offsetWidth<r.viewport.scrollWidth,t=r.viewport.offsetHeight<r.viewport.scrollHeight;c(l?e:t)}},10);return Tp(r.viewport,d),Tp(r.content,d),e.jsx(qd,{present:a||s,children:e.jsx(ap,{"data-state":s?"visible":"hidden",...i,ref:n})})}),ap=o.forwardRef((t,n)=>{const{orientation:r="vertical",...a}=t,i=qm(ep,t.ie),s=o.useRef(null),c=o.useRef(0),[l,d]=o.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=vp(l.viewport,l.content),f={...a,sizes:l,onSizesChange:d,hasThumb:!(0>=u||u>=1),onThumbChange:e=>s.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,n,r="ltr"){const o=wp(n),a=t||o/2,i=o-a,s=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-i,l=n.content-n.viewport;return xp([s,c],"ltr"===r?[0,l]:[-1*l,0])(e)}(e,c.current,l,t)}return"horizontal"===r?e.jsx(ip,{...f,ref:n,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=yp(i.viewport.scrollLeft,l,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===r?e.jsx(sp,{...f,ref:n,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=yp(i.viewport.scrollTop,l);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),ip=o.forwardRef((t,n)=>{const{sizes:r,onSizesChange:a,...i}=t,s=qm(ep,t.ie),[c,l]=o.useState(),d=o.useRef(null),u=Ta(n,d,s.onScrollbarXChange);return o.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(dp,{"data-orientation":"horizontal",...i,ref:u,sizes:r,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":wp(r)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollLeft+e.deltaX;t.onWheelScroll(r),Ap(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:gp(c.paddingLeft),paddingEnd:gp(c.paddingRight)}})}})}),sp=o.forwardRef((t,n)=>{const{sizes:r,onSizesChange:a,...i}=t,s=qm(ep,t.ie),[c,l]=o.useState(),d=o.useRef(null),u=Ta(n,d,s.onScrollbarYChange);return o.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(dp,{"data-orientation":"vertical",...i,ref:u,sizes:r,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":wp(r)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,n)=>{if(s.viewport){const r=s.viewport.scrollTop+e.deltaY;t.onWheelScroll(r),Ap(r,n)&&e.preventDefault()}},onResize:()=>{d.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:gp(c.paddingTop),paddingEnd:gp(c.paddingBottom)}})}})}),[cp,lp]=Vm(ep),dp=o.forwardRef((t,n)=>{const{ie:r,sizes:a,hasThumb:i,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:f,onResize:m,...p}=t,h=qm(ep,r),[b,g]=o.useState(null),v=Ta(n,e=>g(e)),w=o.useRef(null),y=o.useRef(""),x=h.viewport,A=a.content-a.viewport,S=Yl(f),k=Yl(d),T=kp(m,10);function C(e){if(w.current){const t=e.clientX-w.current.left,n=e.clientY-w.current.top;u({x:t,y:n})}}return o.useEffect(()=>{const e=e=>{const t=e.target,n=b?.contains(t);n&&S(e,A)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,b,A,S]),o.useEffect(k,[a,k]),Tp(b,T),Tp(h.content,T),e.jsx(cp,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:Yl(s),onThumbPointerUp:Yl(c),onThumbPositionChange:k,onThumbPointerDown:Yl(l),children:e.jsx(ai.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:Nd(t.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),w.current=b.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),C(e))}),onPointerMove:Nd(t.onPointerMove,C),onPointerUp:Nd(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),up="ScrollAreaThumb",fp=o.forwardRef((t,n)=>{const{forceMount:r,...o}=t,a=lp(up,t.ie);return e.jsx(qd,{present:r||a.hasThumb,children:e.jsx(mp,{ref:n,...o})})}),mp=o.forwardRef((t,n)=>{const{ie:r,style:a,...i}=t,s=qm(up,r),c=lp(up,r),{onThumbPositionChange:l}=c,d=Ta(n,e=>c.onThumbChange(e)),u=o.useRef(void 0),f=kp(()=>{u.current&&(u.current(),u.current=void 0)},100);return o.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(f(),!u.current){const t=Sp(e,l);u.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,f,l]),e.jsx(ai.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Nd(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;c.onThumbPointerDown({x:n,y:r})}),onPointerUp:Nd(t.onPointerUp,c.onThumbPointerUp)})});fp.displayName=up;var pp="ScrollAreaCorner",hp=o.forwardRef((t,n)=>{const r=qm(pp,t.ie),o=!(!r.scrollbarX||!r.scrollbarY);return"scroll"!==r.type&&o?e.jsx(bp,{...t,ref:n}):null});hp.displayName=pp;var bp=o.forwardRef((t,n)=>{const{ie:r,...a}=t,i=qm(pp,r),[s,c]=o.useState(0),[l,d]=o.useState(0),u=!(!s||!l);return Tp(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),Tp(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),u?e.jsx(ai.div,{...a,ref:n,style:{width:s,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function gp(e){return e?parseInt(e,10):0}function vp(e,t){const n=e/t;return isNaN(n)?0:n}function wp(e){const t=vp(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function yp(e,t,n="ltr"){const r=wp(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-r,c=Wm(e,"ltr"===n?[0,i]:[-1*i,0]);return xp([0,i],[0,s])(c)}function xp(e,t){return n=>{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*(n-e[0])}}function Ap(e,t){return e>0&&t>e}var Sp=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=n.left!==a.left,s=n.top!==a.top;(i||s)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function kp(e,t){const n=Yl(e),r=o.useRef(0);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),o.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Tp(e,t){const n=Yl(t);Ql(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Cp=Ym,Np=Qm,Ep=hp;const Pp=o.forwardRef(({className:t,children:n,...r},o)=>e.jsxs(Cp,{ref:o,className:Aa("relative overflow-hidden",t),...r,children:[e.jsx(Np,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(Mp,{}),e.jsx(Ep,{})]}));Pp.displayName=Cp.displayName;const Mp=o.forwardRef(({className:t,orientation:n="vertical",...r},o)=>e.jsx(tp,{ref:o,orientation:n,className:Aa("flex touch-none select-none transition-colors","vertical"===n&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===n&&"h-2.5 border-t border-t-transparent p-[1px]",t),...r,children:e.jsx(fp,{className:Aa("relative rounded-full bg-border","vertical"===n&&"flex-1")})}));Mp.displayName=tp.displayName;var Op="horizontal",Rp=["horizontal","vertical"],_p=o.forwardRef((t,n)=>{const{decorative:r,orientation:o=Op,...a}=t,i=function(e){return Rp.includes(e)}(o)?o:Op,s=r?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(ai.div,{"data-orientation":i,...s,...a,ref:n})});_p.displayName="Separator";var Dp=_p;const Ip=o.forwardRef(({className:t,orientation:n="horizontal",decorative:r=!0,...o},a)=>e.jsx(Dp,{ref:a,decorative:r,orientation:n,className:Aa("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...o}));Ip.displayName=Dp.displayName;var Up="AlertDialog",[Fp,jp]=Jl(Up,[Ku]),Lp=Ku(),Bp=t=>{const{ce:n,...r}=t,o=Lp(n);return e.jsx(kf,{...o,...r,modal:!0})};Bp.displayName=Up;var $p=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Lp(r);return e.jsx(Tf,{...a,...o,ref:n})});$p.displayName="AlertDialogTrigger";var zp=t=>{const{ce:n,...r}=t,o=Lp(n);return e.jsx(Cf,{...o,...r})};zp.displayName="AlertDialogPortal";var Gp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Lp(r);return e.jsx(Nf,{...a,...o,ref:n})});Gp.displayName="AlertDialogOverlay";var Zp="AlertDialogContent",[Wp,Kp]=Fp(Zp),Vp=function(){const t=({children:t})=>e.jsx(e.Fragment,{children:t});return t.displayName="AlertDialogContent.Slottable",t.H=Pa,t}(),Hp=o.forwardRef((t,n)=>{const{ce:r,children:a,...i}=t,s=Lp(r),c=o.useRef(null),l=Ta(n,c),d=o.useRef(null);return e.jsx(yf,{contentName:Zp,titleName:Jp,docsSlug:"alert-dialog",children:e.jsx(Wp,{scope:r,cancelRef:d,children:e.jsxs(Ef,{role:"alertdialog",...s,...i,ref:l,onOpenAutoFocus:Nd(i.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Vp,{children:a}),e.jsx(nh,{contentRef:c})]})})})});Hp.displayName=Zp;var Jp="AlertDialogTitle",qp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Lp(r);return e.jsx(Pf,{...a,...o,ref:n})});qp.displayName=Jp;var Yp="AlertDialogDescription",Xp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Lp(r);return e.jsx(Mf,{...a,...o,ref:n})});Xp.displayName=Yp;var Qp=o.forwardRef((t,n)=>{const{ce:r,...o}=t,a=Lp(r);return e.jsx(Of,{...a,...o,ref:n})});Qp.displayName="AlertDialogAction";var eh="AlertDialogCancel",th=o.forwardRef((t,n)=>{const{ce:r,...o}=t,{cancelRef:a}=Kp(eh,r),i=Lp(r),s=Ta(n,a);return e.jsx(Of,{...i,...o,ref:s})});th.displayName=eh;var nh=({contentRef:e})=>{const t=`\`${Zp}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Zp}\` by passing a \`${Yp}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Zp}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return o.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))},[t,e]),null},rh=Gp,oh=Hp,ah=Qp,ih=th,sh=qp,ch=Xp;const lh=Bp,dh=$p,uh=zp,fh=o.forwardRef(({className:t,...n},r)=>e.jsx(rh,{className:Aa("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n,ref:r}));fh.displayName=rh.displayName;const mh=o.forwardRef(({className:t,...n},r)=>{const{container:a}=o.useContext(q);return e.jsxs(uh,{container:a,children:[e.jsx(fh,{}),e.jsx(oh,{ref:r,className:Aa("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n})]})});mh.displayName=oh.displayName;const ph=({className:t,...n})=>e.jsx("div",{className:Aa("flex flex-col space-y-2 text-center sm:text-left",t),...n});ph.displayName="AlertDialogHeader";const hh=({className:t,...n})=>e.jsx("div",{className:Aa("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n});hh.displayName="AlertDialogFooter";const bh=o.forwardRef(({className:t,...n},r)=>e.jsx(sh,{ref:r,className:Aa("text-lg font-semibold",t),...n}));bh.displayName=sh.displayName;const gh=o.forwardRef(({className:t,...n},r)=>e.jsx(ch,{ref:r,className:Aa("text-sm text-muted-foreground",t),...n}));gh.displayName=ch.displayName;const vh=o.forwardRef(({className:t,...n},r)=>e.jsx(ah,{ref:r,className:Aa(ri(),t),...n}));vh.displayName=ah.displayName;const wh=o.forwardRef(({className:t,...n},r)=>e.jsx(ih,{ref:r,className:Aa(ri({variant:"outline"}),"mt-2 sm:mt-0",t),...n}));function yh(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(xi,{className:"h-10 w-full"}),e.jsx(xi,{className:"h-10 w-full"}),e.jsx(xi,{className:"h-10 w-full"})]})}wh.displayName=ih.displayName;const xh=({workspace:n})=>{const[r,o]=t.useState(!1),{deleteWorkspace:a}=Kl(),i=W(e=>e.auth.session?.user||null);if(!n)return e.jsx(yh,{});const s=n?.users.find(e=>("object"==typeof e&&null!==e?e.t:e)===i?.id)?.role;return"admin"===s?.toLowerCase()?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:"Delete Workspace"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Once you delete a workspace, there is no going back. This will permanently delete the workspace ",e.jsx("strong",{children:n.name})," and all of its data, including members, settings, and features."]})]}),e.jsxs(lh,{children:[e.jsx(dh,{asChild:!0,children:e.jsxs(oi,{variant:"destructive",disabled:r,children:[e.jsx(Xa,{className:"h-4 w-4 mr-2"}),"Delete Workspace"]})}),e.jsxs(mh,{children:[e.jsxs(ph,{children:[e.jsx(bh,{children:"Are you absolutely sure?"}),e.jsxs(gh,{children:["This action cannot be undone. This will permanently delete the workspace"," ",e.jsx("strong",{children:n.name})," and all of its data."]})]}),e.jsxs(hh,{children:[e.jsx(wh,{children:"Cancel"}),e.jsx(vh,{onClick:async()=>{o(!0);try{await a(n.t)}catch(e){alert(e instanceof Error?e.message:"Failed to delete workspace")}finally{o(!1)}},disabled:r,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:r?"Deleting...":"Delete Workspace"})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:"Only workspace admins can delete workspaces."})})};var Ah="Switch",[Sh,kh]=Jl(Ah),[Th,Ch]=Sh(Ah),Nh=o.forwardRef((t,n)=>{const{le:r,name:a,checked:i,defaultChecked:s,required:c,disabled:l,value:d="on",onCheckedChange:u,form:f,...m}=t,[p,h]=o.useState(null),b=Ta(n,e=>h(e)),g=o.useRef(!1),v=!p||f||!!p.closest("form"),[w,y]=Rd({prop:i,defaultProp:s??!1,onChange:u,caller:Ah});return e.jsxs(Th,{scope:r,checked:w,disabled:l,children:[e.jsx(ai.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":Oh(w),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:b,onClick:Nd(t.onClick,e=>{y(e=>!e),v&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),v&&e.jsx(Mh,{control:p,bubbles:!g.current,name:a,value:d,checked:w,required:c,disabled:l,form:f,style:{transform:"translateX(-100%)"}})]})});Nh.displayName=Ah;var Eh="SwitchThumb",Ph=o.forwardRef((t,n)=>{const{le:r,...o}=t,a=Ch(Eh,r);return e.jsx(ai.span,{"data-state":Oh(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:n})});Ph.displayName=Eh;var Mh=o.forwardRef(({le:t,control:n,checked:r,bubbles:a=!0,...i},s)=>{const c=o.useRef(null),l=Ta(c,s),d=gm(r),u=bm(n);return o.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==r&&n){const t=new Event("click",{bubbles:a});n.call(e,r),e.dispatchEvent(t)}},[d,r,a]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Oh(e){return e?"checked":"unchecked"}Mh.displayName="SwitchBubbleInput";var Rh=Nh,_h=Ph;const Dh=o.forwardRef(({className:t,...n},r)=>e.jsx(Rh,{className:Aa("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...n,ref:r,children:e.jsx(_h,{className:Aa("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Dh.displayName=Rh.displayName;const Ih=({workspaceId:n})=>{const[r,o]=t.useState({}),{allFeatures:a,updateFeature:i,getWorkspace:s}=Kl(),[c,l]=t.useState(null),d=W(e=>e.auth.session?.user||null);if(t.useEffect(()=>{s(n).then(l)},[n]),!c)return e.jsx(yh,{});const u=c?.users.find(e=>("string"==typeof e?e:e.t)===d?.id)?.role,f="admin"===u?.toLowerCase();return e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col gap-y-3.5 pr-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the features."}),!a.length&&e.jsx("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),a.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:a.map(t=>{const n=c?.features?.[t.slug];return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),e.jsx(Dh,{disabled:r[t.slug]||!f,checked:n??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!c)return;o(n=>({...n,[e]:t}));const n=await i(c.t,e,t);l(n),o(t=>({...t,[e]:!1}))}(t.slug,e)})]},t.t)})})]})})};function Uh(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e}</text></svg>`}const Fh=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],jh=({workspace:n})=>{const[r,o]=t.useState(!1),[a,i]=t.useState("emoji"),[s,c]=t.useState(),{updateWorkspace:l}=Kl(),d=W(e=>e.auth.session?.user||null),u=mt({resolver:mo(hs({name:Gi().min(2,{message:"Workspace name must be at least 2 characters."}),image:Gi().optional()})),defaultValues:{name:n.name||"",image:n.image||""}});if(!n)return e.jsx(yh,{});const f=n?.users.find(e=>("object"==typeof e&&null!==e?e.t:e)===d?.id)?.role,m="admin"===f?.toLowerCase();return e.jsxs("div",{children:[!m&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can change the workspace settings."}),e.jsx(di,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(async function(e){o(!0);try{await l(n,e)}catch(e){}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(fi,{control:u.control,name:"name",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Name"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"My Awesome Workspace",...t,disabled:!m})}),e.jsx(wi,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(li,{className:"text-sm font-medium",children:"Icon"}),e.jsx(vi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(Gm,{value:a,disabled:!m,onValueChange:e=>i(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Zm,{value:"emoji",id:"emoji"}),e.jsxs(li,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(qa,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Zm,{value:"url",id:"url"}),e.jsxs(li,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Za,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===a&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[s&&e.jsx("span",{className:"text-2xl",children:s}),!s&&e.jsx("img",{src:u.watch("image")})]})]}),e.jsx(Pp,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Fh.map((t,n)=>e.jsx("button",{type:"button",onClick:()=>(e=>{c(e),u.setValue("image",Uh(e))})(t),disabled:!m,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===a&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(fi,{control:u.control,name:"image",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Image URL"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"https://example.com/image.png",...t,disabled:!m})}),e.jsx(vi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(wi,{})]})}),u.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:u.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:m&&e.jsx(oi,{type:"submit",disabled:r,progress:r,children:"Update Workspace"})})]})})]})};var Lh=.999,Bh=/[\\\/_+.#"@\[\(\{&]/,$h=/[\\\/_+.#"@\[\(\{&]/g,zh=/[\s-]/,Gh=/[\s-]/g;function Zh(e,t,n,r,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var c,l,d,u,f=r.charAt(a),m=n.indexOf(f,o),p=0;m>=0;)(c=Zh(e,t,n,r,m+1,a+1,i))>p&&(m===o?c*=1:Bh.test(e.charAt(m-1))?(c*=.8,(d=e.slice(o,m-1).match($h))&&o>0&&(c*=Math.pow(Lh,d.length))):zh.test(e.charAt(m-1))?(c*=.9,(u=e.slice(o,m-1).match(Gh))&&o>0&&(c*=Math.pow(Lh,u.length))):(c*=.17,o>0&&(c*=Math.pow(Lh,m-o))),e.charAt(m)!==t.charAt(a)&&(c*=.9999)),(.1>c&&n.charAt(m-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(m-1)!==r.charAt(a))&&.1*(l=Zh(e,t,n,r,m+1,a+2,i))>c&&(c=.1*l),c>p&&(p=c),m=n.indexOf(f,m+1);return i[s]=p,p}function Wh(e){return e.toLowerCase().replace(Gh," ")}function Kh(e,t,n){return Zh(e=n&&n.length>0?e+" "+n.join(" "):e,t,Wh(e),Wh(t),0,0,{})}var Vh='[cmdk-group=""]',Hh='[cmdk-group-items=""]',Jh='[cmdk-item=""]',qh=Jh+':not([aria-disabled="true"])',Yh="cmdk-item-select",Xh="data-value",Qh=(e,t,n)=>Kh(e,t,n),eb=o.createContext(void 0),tb=()=>o.useContext(eb),nb=o.createContext(void 0),rb=()=>o.useContext(nb),ob=o.createContext(void 0),ab=o.forwardRef((e,t)=>{let n=wb(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=wb(()=>new Set),a=wb(()=>new Map),i=wb(()=>new Map),s=wb(()=>new Set),c=gb(e),{label:l,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:h,disablePointerSelection:b=!1,vimBindings:g=!0,...v}=e,w=Md(),y=Md(),x=Md(),A=o.useRef(null),S=Ab();vb(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,k.emit()}},[u]),vb(()=>{S(6,M)},[]);let k=o.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)P(),N(),S(1,E);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(o=document.getElementById(w))||o.focus()}if(S(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,k.emit()}),r||S(5,M),void 0!==(null==(a=c.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=c.current).onValueChange)||s.call(i,e))}}k.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),T=o.useMemo(()=>({value:(e,t,r)=>{var o;t!==(null==(o=i.current.get(e))?void 0:o.value)&&(i.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,C(t,r)),S(2,()=>{N(),k.emit()}))},item:(e,t)=>(r.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),S(3,()=>{P(),N(),n.current.value||E(),k.emit()}),()=>{i.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&E(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:w,inputId:x,labelId:y,listInnerRef:A}),[]);function C(e,t){var r,o;let a=null!=(o=null==(r=c.current)?void 0:r.filter)?o:Qh;return e?a(e,n.current.search,t):0}function N(){if(!n.current.search||!1===c.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=a.current.get(n),o=0;r.forEach(t=>{let n=e.get(t);o=Math.max(n,o)}),t.push([n,o])});let r=A.current;R().sort((t,n)=>{var r,o;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(r=e.get(i))?r:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(Hh);t?t.appendChild(e.parentElement===t?e:e.closest(Hh+" > *")):r.appendChild(e.parentElement===r?e:e.closest(Hh+" > *"))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=A.current)?void 0:t.querySelector(`${Vh}[${Xh}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function E(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Xh);k.setState("value",t||void 0)}function P(){var e,t,o,s;if(!n.current.search||!1===c.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let l=0;for(let a of r.current){let r=C(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(o=i.current.get(a))?void 0:o.keywords)?s:[]);n.current.filtered.items.set(a,r),r>0&&l++}for(let[e,t]of a.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=l}function M(){var e,t,n;let r=O();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(Vh))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=A.current)?void 0:e.querySelector(Jh+'[aria-selected="true"]')}function R(){var e;return Array.from((null==(e=A.current)?void 0:e.querySelectorAll(qh))||[])}function _(e){let t=R()[e];t&&k.setState("value",t.getAttribute(Xh))}function D(e){var t;let n=O(),r=R(),o=r.findIndex(e=>e===n),a=r[o+e];null!=(t=c.current)&&t.loop&&(a=0>o+e?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),a&&k.setState("value",a.getAttribute(Xh))}function I(e){let t,n=O(),r=null==n?void 0:n.closest(Vh);for(;r&&!t;)r=e>0?hb(r,Vh):bb(r,Vh),t=null==r?void 0:r.querySelector(qh);t?k.setState("value",t.getAttribute(Xh)):D(e)}let U=()=>_(R().length-1),F=e=>{e.preventDefault(),e.metaKey?U():e.altKey?I(1):D(1)},j=e=>{e.preventDefault(),e.metaKey?_(0):e.altKey?I(-1):D(-1)};return o.createElement(ai.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&j(e);break;case"ArrowUp":j(e);break;case"Home":e.preventDefault(),_(0);break;case"End":e.preventDefault(),U();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(Yh);t.dispatchEvent(e)}}}}},o.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:kb},l),Sb(e,e=>o.createElement(nb.Provider,{value:k},o.createElement(eb.Provider,{value:T},e))))}),ib=o.forwardRef((e,t)=>{var n,r;let a=Md(),i=o.useRef(null),s=o.useContext(ob),c=tb(),l=gb(e),d=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==s?void 0:s.forceMount;vb(()=>{if(!d)return c.item(a,null==s?void 0:s.id)},[d]);let u=xb(a,i,[e.value,e.children,i],e.keywords),f=rb(),m=yb(e=>e.value&&e.value===u.current),p=yb(e=>!(!d&&!1!==c.filter())||!e.search||e.filtered.items.get(a)>0);function h(){var e,t;b(),null==(t=(e=l.current).onSelect)||t.call(e,u.current)}function b(){f.setState("value",u.current,!0)}if(o.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(Yh,h),()=>t.removeEventListener(Yh,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:v,onSelect:w,forceMount:y,keywords:x,...A}=e;return o.createElement(ai.div,{ref:ka(i,t),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||c.getDisablePointerSelection()?void 0:b,onClick:g?void 0:h},e.children)}),sb=o.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,s=Md(),c=o.useRef(null),l=o.useRef(null),d=Md(),u=tb(),f=yb(e=>!(!a&&!1!==u.filter())||!e.search||e.filtered.groups.has(s));vb(()=>u.group(s),[]),xb(s,c,[e.value,e.heading,l]);let m=o.useMemo(()=>({id:s,forceMount:a}),[a]);return o.createElement(ai.div,{ref:ka(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&o.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Sb(e,e=>o.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},o.createElement(ob.Provider,{value:m},e))))}),cb=o.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=o.useRef(null),i=yb(e=>!e.search);return n||i?o.createElement(ai.div,{ref:ka(a,t),...r,"cmdk-separator":"",role:"separator"}):null}),lb=o.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=null!=e.value,i=rb(),s=yb(e=>e.search),c=yb(e=>e.selectedItemId),l=tb();return o.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),o.createElement(ai.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),db=o.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=o.useRef(null),s=o.useRef(null),c=yb(e=>e.selectedItemId),l=tb();return o.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,n=i.current,r=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}},[]),o.createElement(ai.div,{ref:ka(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:l.listId},Sb(e,e=>o.createElement("div",{ref:ka(s,l.listInnerRef),"cmdk-list-sizer":""},e)))}),ub=o.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:s,...c}=e;return o.createElement(kf,{open:n,onOpenChange:r},o.createElement(Cf,{container:s},o.createElement(Nf,{"cmdk-overlay":"",className:a}),o.createElement(Ef,{"aria-label":e.label,"cmdk-dialog":"",className:i},o.createElement(ab,{ref:t,...c}))))}),fb=o.forwardRef((e,t)=>yb(e=>0===e.filtered.count)?o.createElement(ai.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),mb=o.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return o.createElement(ai.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Sb(e,e=>o.createElement("div",{"aria-hidden":!0},e)))}),pb=Object.assign(ab,{List:db,Item:ib,Input:lb,Group:sb,Separator:cb,Dialog:ub,Empty:fb,Loading:mb});function hb(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function bb(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function gb(e){let t=o.useRef(e);return vb(()=>{t.current=e}),t}var vb="undefined"==typeof window?o.useEffect:o.useLayoutEffect;function wb(e){let t=o.useRef();return void 0===t.current&&(t.current=e()),t}function yb(e){let t=rb(),n=()=>e(t.snapshot());return o.useSyncExternalStore(t.subscribe,n,n)}function xb(e,t,n,r=[]){let a=o.useRef(),i=tb();return vb(()=>{var o;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),c=r.map(e=>e.trim());i.value(e,s,c),null==(o=t.current)||o.setAttribute(Xh,s),a.current=s}),a}var Ab=()=>{let[e,t]=o.useState(),n=wb(()=>new Map);return vb(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Sb({asChild:e,children:t},n){return e&&o.isValidElement(t)?o.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var kb={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Tb=o.forwardRef(({className:t,...n},r)=>e.jsx(pb,{ref:r,className:Aa("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));Tb.displayName=pb.displayName;const Cb=o.forwardRef(({className:t,...n},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(Bf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(pb.Input,{ref:r,className:Aa("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...n})]}));Cb.displayName=pb.Input.displayName;const Nb=o.forwardRef(({className:t,...n},r)=>e.jsx(pb.List,{ref:r,className:Aa("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...n}));Nb.displayName=pb.List.displayName,o.forwardRef((t,n)=>e.jsx(pb.Empty,{ref:n,className:"py-6 text-center text-sm",...t})).displayName=pb.Empty.displayName;const Eb=o.forwardRef(({className:t,...n},r)=>e.jsx(pb.Group,{ref:r,className:Aa("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n}));Eb.displayName=pb.Group.displayName,o.forwardRef(({className:t,...n},r)=>e.jsx(pb.Separator,{ref:r,className:Aa("-mx-1 h-px bg-border",t),...n})).displayName=pb.Separator.displayName;const Pb=o.forwardRef(({className:t,...n},r)=>e.jsx(pb.Item,{ref:r,className:Aa("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n}));Pb.displayName=pb.Item.displayName;const Mb=["top","right","bottom","left"],Ob=Math.min,Rb=Math.max,_b=Math.round,Db=Math.floor,Ib=e=>({x:e,y:e}),Ub={left:"right",right:"left",bottom:"top",top:"bottom"},Fb={start:"end",end:"start"};function jb(e,t,n){return Rb(e,Ob(t,n))}function Lb(e,t){return"function"==typeof e?e(t):e}function Bb(e){return e.split("-")[0]}function $b(e){return e.split("-")[1]}function zb(e){return"x"===e?"y":"x"}function Gb(e){return"y"===e?"height":"width"}const Zb=new Set(["top","bottom"]);function Wb(e){return Zb.has(Bb(e))?"y":"x"}function Kb(e){return zb(Wb(e))}function Vb(e){return e.replace(/start|end/g,e=>Fb[e])}const Hb=["left","right"],Jb=["right","left"],qb=["top","bottom"],Yb=["bottom","top"];function Xb(e){return e.replace(/left|right|bottom|top/g,e=>Ub[e])}function Qb(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function eg(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function tg(e,t,n){let{reference:r,floating:o}=e;const a=Wb(t),i=Kb(t),s=Gb(i),c=Bb(t),l="y"===a,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-o.width,y:u};break;default:m={x:r.x,y:r.y}}switch($b(t)){case"start":m[i]-=f*(n&&l?-1:1);break;case"end":m[i]+=f*(n&&l?-1:1)}return m}async function ng(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:m=0}=Lb(t,e),p=Qb(m),h=s[f?"floating"===u?"reference":"floating":u],b=eg(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),g="floating"===u?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),w=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},y=eg(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:c}):g);return{top:(b.top-y.top+p.top)/w.y,bottom:(y.bottom-b.bottom+p.bottom)/w.y,left:(b.left-y.left+p.left)/w.x,right:(y.right-b.right+p.right)/w.x}}function rg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function og(e){return Mb.some(t=>e[t]>=0)}const ag=new Set(["left","top"]);function ig(){return"undefined"!=typeof window}function sg(e){return dg(e)?(e.nodeName||"").toLowerCase():"#document"}function cg(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lg(e){var t;return null==(t=(dg(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function dg(e){return!!ig()&&(e instanceof Node||e instanceof cg(e).Node)}function ug(e){return!!ig()&&(e instanceof Element||e instanceof cg(e).Element)}function fg(e){return!!ig()&&(e instanceof HTMLElement||e instanceof cg(e).HTMLElement)}function mg(e){return!(!ig()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cg(e).ShadowRoot)}const pg=new Set(["inline","contents"]);function hg(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ng(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!pg.has(o)}const bg=new Set(["table","td","th"]);function gg(e){return bg.has(sg(e))}const vg=[":popover-open",":modal"];function wg(e){return vg.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const yg=["transform","translate","scale","rotate","perspective"],xg=["transform","translate","scale","rotate","perspective","filter"],Ag=["paint","layout","strict","content"];function Sg(e){const t=kg(),n=ug(e)?Ng(e):e;return yg.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||xg.some(e=>(n.willChange||"").includes(e))||Ag.some(e=>(n.contain||"").includes(e))}function kg(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Tg=new Set(["html","body","#document"]);function Cg(e){return Tg.has(sg(e))}function Ng(e){return cg(e).getComputedStyle(e)}function Eg(e){return ug(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pg(e){if("html"===sg(e))return e;const t=e.assignedSlot||e.parentNode||mg(e)&&e.host||lg(e);return mg(t)?t.host:t}function Mg(e){const t=Pg(e);return Cg(t)?e.ownerDocument?e.ownerDocument.body:e.body:fg(t)&&hg(t)?t:Mg(t)}function Og(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Mg(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=cg(o);if(a){const e=Rg(i);return t.concat(i,i.visualViewport||[],hg(o)?o:[],e&&n?Og(e):[])}return t.concat(o,Og(o,[],n))}function Rg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _g(e){const t=Ng(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=fg(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=_b(n)!==a||_b(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Dg(e){return ug(e)?e:e.contextElement}function Ig(e){const t=Dg(e);if(!fg(t))return Ib(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=_g(t);let i=(a?_b(n.width):n.width)/r,s=(a?_b(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Ug=Ib(0);function Fg(e){const t=cg(e);return kg()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ug}function jg(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=Dg(e);let i=Ib(1);t&&(r?ug(r)&&(i=Ig(r)):i=Ig(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==cg(e))&&t}(a,n,r)?Fg(a):Ib(0);let c=(o.left+s.x)/i.x,l=(o.top+s.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const e=cg(a),t=r&&ug(r)?cg(r):r;let n=e,o=Rg(n);for(;o&&r&&t!==n;){const e=Ig(o),t=o.getBoundingClientRect(),r=Ng(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,d*=e.x,u*=e.y,c+=a,l+=i,n=cg(o),o=Rg(n)}}return eg({width:d,height:u,x:c,y:l})}function Lg(e,t){const n=Eg(e).scrollLeft;return t?t.left+n:jg(lg(e)).left+n}function Bg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lg(e,n),y:n.top+t.scrollTop}}const $g=new Set(["absolute","fixed"]);function zg(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=cg(e),r=lg(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;const e=kg();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=Lg(r);if(l>0)l>25||(a+=l);else{const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i>25||(a-=i)}return{width:a,height:i,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=lg(e),n=Eg(e),r=e.ownerDocument.body,o=Rb(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Rb(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Lg(e);const s=-n.scrollTop;return"rtl"===Ng(r).direction&&(i+=Rb(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(lg(e));else if(ug(t))r=function(e,t){const n=jg(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=fg(e)?Ig(e):Ib(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=Fg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return eg(r)}function Gg(e,t){const n=Pg(e);return!(n===t||!ug(n)||Cg(n))&&("fixed"===Ng(n).position||Gg(n,t))}function Zg(e,t,n){const r=fg(t),o=lg(t),a="fixed"===n,i=jg(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const c=Ib(0);function l(){c.x=Lg(o)}if(r||!r&&!a)if(("body"!==sg(t)||hg(o))&&(s=Eg(t)),r){const e=jg(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();a&&!r&&o&&l();const d=!o||r||a?Ib(0):Bg(o,s);return{x:i.left+s.scrollLeft-c.x-d.x,y:i.top+s.scrollTop-c.y-d.y,width:i.width,height:i.height}}function Wg(e){return"static"===Ng(e).position}function Kg(e,t){if(!fg(e)||"fixed"===Ng(e).position)return null;if(t)return t(e);let n=e.offsetParent;return lg(e)===n&&(n=n.ownerDocument.body),n}function Vg(e,t){const n=cg(e);if(wg(e))return n;if(!fg(e)){let t=Pg(e);for(;t&&!Cg(t);){if(ug(t)&&!Wg(t))return t;t=Pg(t)}return n}let r=Kg(e,t);for(;r&&gg(r)&&Wg(r);)r=Kg(r,t);return r&&Cg(r)&&Wg(r)&&!Sg(r)?n:r||function(e){let t=Pg(e);for(;fg(t)&&!Cg(t);){if(Sg(t))return t;if(wg(t))return null;t=Pg(t)}return null}(e)||n}const Hg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=lg(r),s=!!t&&wg(t.floating);if(r===i||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ib(1);const d=Ib(0),u=fg(r);if((u||!u&&!a)&&(("body"!==sg(r)||hg(i))&&(c=Eg(r)),fg(r))){const e=jg(r);l=Ig(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const f=!i||u||a?Ib(0):Bg(i,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+f.x,y:n.y*l.y-c.scrollTop*l.y+d.y+f.y}},getDocumentElement:lg,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a="clippingAncestors"===n?wg(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Og(e,[],!1).filter(e=>ug(e)&&"body"!==sg(e)),o=null;const a="fixed"===Ng(e).position;let i=a?Pg(e):e;for(;ug(i)&&!Cg(i);){const t=Ng(i),n=Sg(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&$g.has(o.position)||hg(i)&&!n&&Gg(e,i))?r=r.filter(e=>e!==i):o=t,i=Pg(i)}return t.set(e,r),r}(t,this.ue):[].concat(n),i=[...a,r],s=i[0],c=i.reduce((e,n)=>{const r=zg(t,n,o);return e.top=Rb(r.top,e.top),e.right=Ob(r.right,e.right),e.bottom=Ob(r.bottom,e.bottom),e.left=Rb(r.left,e.left),e},zg(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Vg,getElementRects:async function(e){const t=this.getOffsetParent||Vg,n=this.getDimensions,r=await n(e.floating);return{reference:Zg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=_g(e);return{width:t,height:n}},getScale:Ig,isElement:ug,isRTL:function(e){return"rtl"===Ng(e).direction}};function Jg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const qg=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Bb(n),s=$b(n),c="y"===Wb(n),l=ag.has(i)?-1:1,d=a&&c?-1:1,u=Lb(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof p&&(m="end"===s?-1*p:p),c?{x:m*d,y:f*l}:{x:f*l,y:m*d}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Yg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Lb(e,t),l={x:n,y:r},d=await ng(t,c),u=Wb(Bb(o)),f=zb(u);let m=l[f],p=l[u];if(a){const e="y"===f?"bottom":"right";m=jb(m+d["y"===f?"top":"left"],m,m-d[e])}if(i){const e="y"===u?"bottom":"right";p=jb(p+d["y"===u?"top":"left"],p,p-d[e])}const h=s.fn({...t,[f]:m,[u]:p});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[u]:i}}}}}},Xg=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...b}=Lb(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const g=Bb(o),v=Wb(s),w=Bb(s)===s,y=await(null==c.isRTL?void 0:c.isRTL(l.floating)),x=f||(w||!h?[Xb(s)]:function(e){const t=Xb(e);return[Vb(e),t,Vb(t)]}(s)),A="none"!==p;!f&&A&&x.push(...function(e,t,n,r){const o=$b(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Jb:Hb:t?Hb:Jb;case"left":case"right":return t?qb:Yb;default:return[]}}(Bb(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Vb)))),a}(s,h,p,y));const S=[s,...x],k=await ng(t,b),T=[];let C=(null==(r=a.flip)?void 0:r.overflows)||[];if(d&&T.push(k[g]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=$b(e),o=Kb(e),a=Gb(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Xb(i)),[i,Xb(i)]}(o,i,y);T.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:T}],!T.every(e=>0>=e)){var N,E;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t&&("alignment"!==u||v===Wb(t)||C.every(e=>Wb(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(E=C.filter(e=>0>=e.overflows[0]).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:E.placement;if(!n)switch(m){case"bestFit":{var P;const e=null==(P=C.filter(e=>{if(A){const t=Wb(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Qg=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:c=()=>{},...l}=Lb(e,t),d=await ng(t,l),u=Bb(o),f=$b(o),m="y"===Wb(o),{width:p,height:h}=a.floating;let b,g;"top"===u||"bottom"===u?(b=u,g=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,b="end"===f?"top":"bottom");const v=h-d.top-d.bottom,w=p-d.left-d.right,y=Ob(h-d[b],v),x=Ob(p-d[g],w),A=!t.middlewareData.shift;let S=y,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=v),A&&!f){const e=Rb(d.left,0),t=Rb(d.right,0),n=Rb(d.top,0),r=Rb(d.bottom,0);m?k=p-2*(0!==e||0!==t?e+t:Rb(d.left,d.right)):S=h-2*(0!==n||0!==r?n+r:Rb(d.top,d.bottom))}await c({...t,availableWidth:k,availableHeight:S});const T=await i.getDimensions(s.floating);return p!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}},ev=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Lb(e,t);switch(r){case"referenceHidden":{const e=rg(await ng(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:og(e)}}}case"escaped":{const e=rg(await ng(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:og(e)}}}default:return{}}}}},tv=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=t,{element:l,padding:d=0}=Lb(e,t)||{};if(null==l)return{};const u=Qb(d),f={x:n,y:r},m=Kb(o),p=Gb(m),h=await i.getDimensions(l),b="y"===m,g=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",y=a.reference[p]+a.reference[m]-f[m]-a.floating[p],x=f[m]-a.reference[m],A=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let S=A?A[w]:0;S&&await(null==i.isElement?void 0:i.isElement(A))||(S=s.floating[w]||a.floating[p]);const k=y/2-x/2,T=S/2-h[p]/2-1,C=Ob(u[g],T),N=Ob(u[v],T),E=C,P=S-h[p]-N,M=S/2-h[p]/2+k,O=jb(E,M,P),R=!c.arrow&&null!=$b(o)&&M!==O&&0>a.reference[p]/2-(E>M?C:N)-h[p]/2,_=R?E>M?M-E:M-P:0;return{[m]:f[m]+_,data:{[m]:O,centerOffset:M-O-_,...R&&{alignmentOffset:_}},reset:R}}}),nv=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Lb(e,t),d={x:n,y:r},u=Wb(o),f=zb(u);let m=d[f],p=d[u];const h=Lb(s,t),b="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+b.mainAxis,n=a.reference[f]+a.reference[e]-b.mainAxis;t>m?m=t:m>n&&(m=n)}if(l){var g,v;const e="y"===f?"width":"height",t=ag.has(Bb(o)),n=a.reference[u]-a.floating[e]+(t&&(null==(g=i.offset)?void 0:g[u])||0)+(t?0:b.crossAxis),r=a.reference[u]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[u])||0)-(t?b.crossAxis:0);n>p?p=n:p>r&&(p=r)}return{[f]:m,[u]:p}}}},rv=(e,t,n)=>{const r=new Map,o={platform:Hg,...n},a={...o.platform,ue:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=tg(l,r,c),f=r,m={},p=0;for(let n=0;n<s.length;n++){const{name:a,fn:h}=s[n],{x:b,y:g,data:v,reset:w}=await h({x:d,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:l,platform:i,elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=g?g:u,m={...m,[a]:{...m[a],...v}},w&&50>=p&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(l=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:d,y:u}=tg(l,f,c))),n=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:m}})(e,t,{...o,platform:a})};var ov="undefined"!=typeof document?t.useLayoutEffect:function(){};function av(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!av(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||av(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function iv(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sv(e,t){const n=iv(e);return Math.round(t*n)/n}function cv(e){const t=o.useRef(e);return ov(()=>{t.current=e}),t}const lv=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?tv({element:n.current,padding:r}).fn(t):{}:n?tv({element:n,padding:r}).fn(t):{};var o}}),dv=(e,t)=>({...qg(e),options:[e,t]}),uv=(e,t)=>({...Yg(e),options:[e,t]}),fv=(e,t)=>({...nv(e),options:[e,t]}),mv=(e,t)=>({...Xg(e),options:[e,t]}),pv=(e,t)=>({...Qg(e),options:[e,t]}),hv=(e,t)=>({...ev(e),options:[e,t]}),bv=(e,t)=>({...lv(e),options:[e,t]});var gv=o.forwardRef((t,n)=>{const{children:r,width:o=10,height:a=5,...i}=t;return e.jsx(ai.svg,{...i,ref:n,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});gv.displayName="Arrow";var vv=gv,wv="Popper",[yv,xv]=Jl(wv),[Av,Sv]=yv(wv),kv=t=>{const{fe:n,children:r}=t,[a,i]=o.useState(null);return e.jsx(Av,{scope:n,anchor:a,onAnchorChange:i,children:r})};kv.displayName=wv;var Tv="PopperAnchor",Cv=o.forwardRef((t,n)=>{const{fe:r,virtualRef:a,...i}=t,s=Sv(Tv,r),c=o.useRef(null),l=Ta(n,c),d=o.useRef(null);return o.useEffect(()=>{const e=d.current;d.current=a?.current||c.current,e!==d.current&&s.onAnchorChange(d.current)}),a?null:e.jsx(ai.div,{...i,ref:l})});Cv.displayName=Tv;var Nv="PopperContent",[Ev,Pv]=yv(Nv),Mv=o.forwardRef((t,n)=>{const{fe:r,side:i="bottom",sideOffset:s=0,align:c="center",alignOffset:l=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:b="optimized",onPlaced:g,...v}=t,w=Sv(Nv,r),[y,x]=o.useState(null),A=Ta(n,e=>x(e)),[S,k]=o.useState(null),T=bm(S),C=T?.width??0,N=T?.height??0,E=i+("center"!==c?"-"+c:""),P="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(f)?f:[f],O=M.length>0,R={padding:P,boundary:M.filter(Dv),altBoundary:O},{refs:_,floatingStyles:D,placement:I,isPositioned:U,middlewareData:F}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[f,m]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=o.useState(r);av(p,r)||h(r);const[b,g]=o.useState(null),[v,w]=o.useState(null),y=o.useCallback(e=>{e!==k.current&&(k.current=e,g(e))},[]),x=o.useCallback(e=>{e!==T.current&&(T.current=e,w(e))},[]),A=s||b,S=c||v,k=o.useRef(null),T=o.useRef(null),C=o.useRef(f),N=null!=d,E=cv(d),P=cv(i),M=cv(u),O=o.useCallback(()=>{if(!k.current||!T.current)return;const e={placement:t,strategy:n,middleware:p};P.current&&(e.platform=P.current),rv(k.current,T.current,e).then(e=>{const t={...e,isPositioned:!1!==M.current};R.current&&!av(C.current,t)&&(C.current=t,a.flushSync(()=>{m(t)}))})},[p,t,n,P,M]);ov(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const R=o.useRef(!1);ov(()=>(R.current=!0,()=>{R.current=!1}),[]),ov(()=>{if(A&&(k.current=A),S&&(T.current=S),A&&S){if(E.current)return E.current(A,S,O);O()}},[A,S,O,E,N]);const _=o.useMemo(()=>({reference:k,floating:T,setReference:y,setFloating:x}),[y,x]),D=o.useMemo(()=>({reference:A,floating:S}),[A,S]),I=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=sv(D.floating,f.x),r=sv(D.floating,f.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...iv(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,D.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:O,refs:_,elements:D,floatingStyles:I}),[f,O,_,D,I])}({strategy:"fixed",placement:E,whileElementsMounted:(...e)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=Dg(e),d=o||a?[...l?Og(l):[],...Og(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const u=l&&s?function(e,t){let n,r=null;const o=lg(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),a();const l=e.getBoundingClientRect(),{left:d,top:u,width:f,height:m}=l;if(s||t(),!f||!m)return;const p={rootMargin:-Db(u)+"px "+-Db(o.clientWidth-(d+f))+"px "+-Db(o.clientHeight-(u+m))+"px "+-Db(d)+"px",threshold:Rb(0,Ob(1,c))||1};let h=!0;function b(t){const r=t[0].intersectionRatio;if(r!==c){if(!h)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Jg(l,e.getBoundingClientRect())||i(),h=!1}try{r=new IntersectionObserver(b,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(b,p)}r.observe(e)}(!0),a}(l,n):null;let f,m=-1,p=null;i&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let h=c?jg(e):null;return c&&function t(){const r=jg(e);h&&!Jg(h,r)&&n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=p)||e.disconnect(),p=null,c&&cancelAnimationFrame(f)}}(...e,{animationFrame:"always"===b}),elements:{reference:w.anchor},middleware:[dv({mainAxis:s+N,alignmentAxis:l}),u&&uv({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?fv():void 0,...R}),u&&mv({...R}),pv({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",n+"px"),i.setProperty("--radix-popper-available-height",r+"px"),i.setProperty("--radix-popper-anchor-width",o+"px"),i.setProperty("--radix-popper-anchor-height",a+"px")}}),S&&bv({element:S,padding:d}),Iv({arrowWidth:C,arrowHeight:N}),h&&hv({strategy:"referenceHidden",...R})]}),[j,L]=Uv(I),B=Yl(g);Ql(()=>{U&&B?.()},[U,B]);const $=F.arrow?.x,z=F.arrow?.y,G=0!==F.arrow?.centerOffset,[Z,W]=o.useState();return Ql(()=>{y&&W(window.getComputedStyle(y).zIndex)},[y]),e.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:U?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Ev,{scope:r,placedSide:j,onArrowChange:k,arrowX:$,arrowY:z,shouldHideArrow:G,children:e.jsx(ai.div,{"data-side":j,"data-align":L,...v,ref:A,style:{...v.style,animation:U?void 0:"none"}})})})});Mv.displayName=Nv;var Ov="PopperArrow",Rv={top:"bottom",right:"left",bottom:"top",left:"right"},_v=o.forwardRef(function(t,n){const{fe:r,...o}=t,a=Pv(Ov,r),i=Rv[a.placedSide];return e.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:e.jsx(vv,{...o,ref:n,style:{...o.style,display:"block"}})})});function Dv(e){return null!==e}_v.displayName=Ov;var Iv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Uv(n),d={start:"0%",center:"50%",end:"100%"}[l],u=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let m="",p="";return"bottom"===c?(m=a?d:u+"px",p=-s+"px"):"top"===c?(m=a?d:u+"px",p=r.floating.height+s+"px"):"right"===c?(m=-s+"px",p=a?d:f+"px"):"left"===c&&(m=r.floating.width+s+"px",p=a?d:f+"px"),{data:{x:m,y:p}}}});function Uv(e){const[t,n="center"]=e.split("-");return[t,n]}var Fv=kv,jv=Cv,Lv=Mv,Bv=_v,$v="Popover",[zv,Gv]=Jl($v,[xv]),Zv=xv(),[Wv,Kv]=zv($v),Vv=t=>{const{he:n,children:r,open:a,defaultOpen:i,onOpenChange:s,modal:c=!1}=t,l=Zv(n),d=o.useRef(null),[u,f]=o.useState(!1),[m,p]=Rd({prop:a,defaultProp:i??!1,onChange:s,caller:$v});return e.jsx(Fv,{...l,children:e.jsx(Wv,{scope:n,contentId:Md(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:o.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:o.useCallback(()=>f(!0),[]),onCustomAnchorRemove:o.useCallback(()=>f(!1),[]),modal:c,children:r})})};Vv.displayName=$v;var Hv="PopoverAnchor";o.forwardRef((t,n)=>{const{he:r,...a}=t,i=Kv(Hv,r),s=Zv(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return o.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(jv,{...s,...a,ref:n})}).displayName=Hv;var Jv="PopoverTrigger",qv=o.forwardRef((t,n)=>{const{he:r,...o}=t,a=Kv(Jv,r),i=Zv(r),s=Ta(n,a.triggerRef),c=e.jsx(ai.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":cw(a.open),...o,ref:s,onClick:Nd(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:e.jsx(jv,{asChild:!0,...i,children:c})});qv.displayName=Jv;var Yv="PopoverPortal",[Xv,Qv]=zv(Yv,{forceMount:void 0}),ew=t=>{const{he:n,forceMount:r,children:o,container:a}=t,i=Kv(Yv,n);return e.jsx(Xv,{scope:n,forceMount:r,children:e.jsx(qd,{present:r||i.open,children:e.jsx(Jd,{asChild:!0,container:a,children:o})})})};ew.displayName=Yv;var tw="PopoverContent",nw=o.forwardRef((t,n)=>{const r=Qv(tw,t.he),{forceMount:o=r.forceMount,...a}=t,i=Kv(tw,t.he);return e.jsx(qd,{present:o||i.open,children:i.modal?e.jsx(ow,{...a,ref:n}):e.jsx(aw,{...a,ref:n})})});nw.displayName=tw;var rw=Ca("PopoverContent.RemoveScroll"),ow=o.forwardRef((t,n)=>{const r=Kv(tw,t.he),a=o.useRef(null),i=Ta(n,a),s=o.useRef(!1);return o.useEffect(()=>{const e=a.current;if(e)return Gu(e)},[]),e.jsx(Fu,{as:rw,allowPinchZoom:!0,children:e.jsx(iw,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nd(t.onCloseAutoFocus,e=>{e.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Nd(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;s.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Nd(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),aw=o.forwardRef((t,n)=>{const r=Kv(tw,t.he),a=o.useRef(!1),i=o.useRef(!1);return e.jsx(iw,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||r.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,o=r.triggerRef.current?.contains(n);o&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),iw=o.forwardRef((t,n)=>{const{he:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=t,m=Kv(tw,r),p=Zv(r);return Qd(),e.jsx(zd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:e.jsx(Ud,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Lv,{"data-state":cw(m.open),role:"dialog",id:m.contentId,...p,...f,ref:n,style:{...f.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)"}})})})}),sw="PopoverClose";function cw(e){return e?"open":"closed"}o.forwardRef((t,n)=>{const{he:r,...o}=t,a=Kv(sw,r);return e.jsx(ai.button,{type:"button",...o,ref:n,onClick:Nd(t.onClick,()=>a.onOpenChange(!1))})}).displayName=sw,o.forwardRef((t,n)=>{const{he:r,...o}=t,a=Zv(r);return e.jsx(Bv,{...a,...o,ref:n})}).displayName="PopoverArrow";var lw=ew,dw=nw;const uw=Vv,fw=qv,mw=o.forwardRef(({className:t,align:n="center",sideOffset:r=4,...a},i)=>{const{container:s}=o.useContext(q);return e.jsx(lw,{container:s,children:e.jsx(dw,{ref:i,align:n,sideOffset:r,className:Aa("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",t),...a})})});mw.displayName=dw.displayName;const pw={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},hw={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},bw=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=hw[e.code]||"USD",n=pw[t]||"";return{value:e.code,flag:(r=e.code,r.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:n};var r});function gw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=bw.find(e=>e.value==r);return e.jsxs(uw,{open:a,onOpenChange:i,children:[e.jsx(fw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&e.jsxs("div",{children:[(s.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&e.jsx("span",{className:"text-muted-foreground",children:"Choose country"}),e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(mw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Tb,{children:[e.jsx(Cb,{placeholder:"Choose country..."}),e.jsx(Nb,{children:e.jsx(Eb,{children:bw.map(t=>e.jsxs(Pb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const vw=bw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),ww=Array.from(new Set(vw.map(e=>e.value))).map(e=>vw.find(t=>t.value===e)).filter(e=>void 0!==e);function yw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=ww.find(e=>e.value==r);return e.jsxs(uw,{open:a,onOpenChange:i,children:[e.jsx(fw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text&&e.jsxs("div",{children:[(s.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:s.icon})]}),!s&&e.jsx("span",{className:"text-muted-foreground",children:"Choose Currency"}),e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(mw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Tb,{children:[e.jsx(Cb,{placeholder:"Choose currency..."}),e.jsx(Nb,{children:e.jsx(Eb,{children:ww.map(t=>e.jsxs(Pb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.text+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}let xw=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];xw=xw.filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)),xw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Aw=xw.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function Sw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=Aw.find(e=>e.value==r);return e.jsxs(uw,{open:a,onOpenChange:i,children:[e.jsx(fw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s&&e.jsxs("div",{children:[(s.label+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:s.flag})]}),!s&&"Choose language",e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(mw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Tb,{children:[e.jsx(Cb,{placeholder:"Choose timezone..."}),e.jsx(Nb,{children:e.jsx(Eb,{children:Aw.map(t=>e.jsxs(Pb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.label+"").trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const kw=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let n=t.utc;for(let r=0;r<n.length;r++){const o=n[r],a=t.text;let i=a.substring(a.indexOf("(")+1,a.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:o,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${o}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,n)=>t===n.findIndex(t=>t.value===e.value));function Tw(n){const[r,o]=t.useState(n.value||""),[a,i]=t.useState(!1),s=kw.find(e=>e.value==r);return e.jsxs(uw,{open:a,onOpenChange:i,children:[e.jsx(fw,{asChild:!0,children:e.jsxs(oi,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between overflow-hidden text-ellipsis",children:[s?.text||"Choose timezone",e.jsx(Ga,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(mw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Tb,{children:[e.jsx(Cb,{placeholder:"Choose timezone..."}),e.jsx(Nb,{children:e.jsx(Eb,{children:kw.map(t=>e.jsxs(Pb,{className:Aa("whitespace-nowrap text-left",{"text-green-500":r===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const r=t.value;o(r),n.onChange&&"function"==typeof n.onChange&&n.onChange(r),i(!1)},children:[r===t.value&&e.jsx(za,{className:Aa("mr-2 h-4 w-4 text-green-400",r===t.value?"opacity-100":"opacity-0")}),(t.text+"").trim()]},t.value))})})]})})]})}const Cw=({workspace:n})=>{const{updateUserProfile:r,getProfile:o}=Kl(),[a,i]=t.useState(!1),[s,c]=t.useState(),[l,d]=t.useState(0),u=mt({resolver:mo(hs({name:Gi().min(2,{message:"Name must be at least 2 characters."}),country:Gi().optional(),timezone:Gi().optional(),language:Gi().optional(),currency:Gi().optional()})),defaultValues:{name:s?.name||"",country:s?.country||"",timezone:s?.timezone||"",language:s?.language||"",currency:s?.currency||""}});return t.useEffect(()=>{o().then(e=>{c(e),u.setValue("name",e.name),u.setValue("country",e.country),u.setValue("timezone",e.timezone),u.setValue("language",e.language),u.setValue("currency",e.currency)})},[l]),s?e.jsxs("div",{children:[e.jsx("div",{className:"space-y-4",children:e.jsx(di,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(async function(e){i(!0),await r({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),i(!1)}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e.jsx(yi,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:s?.email})]}),e.jsx(fi,{disabled:a,control:u.control,name:"name",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Name"}),e.jsx(gi,{children:e.jsx(yi,{...t})}),e.jsx(wi,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Language"}),e.jsx(Sw,{value:u.getValues("language"),onChange:e=>{u.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Country"}),e.jsx(gw,{value:u.getValues("country"),onChange:e=>{u.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Currency"}),e.jsx(yw,{value:u.getValues("currency"),onChange:e=>{u.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:"Timezone"}),e.jsx(Tw,{value:u.getValues("timezone"),onChange:e=>{u.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(oi,{type:"submit",progress:a,disabled:a,children:"Save"}),e.jsx(oi,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:a,children:"Reset"})]})]})})}),s?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Profile Image"}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:s.image,alt:s.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(yh,{})};var Nw=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"});o.forwardRef((t,n)=>e.jsx(ai.span,{...t,ref:n,style:{...Nw,...t.style}})).displayName="VisuallyHidden";var Ew=[" ","Enter","ArrowUp","ArrowDown"],Pw=[" ","Enter"],Mw="Select",[Ow,Rw,_w]=Jf(Mw),[Dw,Iw]=Jl(Mw,[_w,xv]),Uw=xv(),[Fw,jw]=Dw(Mw),[Lw,Bw]=Dw(Mw),$w=t=>{const{be:n,children:r,open:a,defaultOpen:i,onOpenChange:s,value:c,defaultValue:l,onValueChange:d,dir:u,name:f,autoComplete:m,disabled:p,required:h,form:b}=t,g=Uw(n),[v,w]=o.useState(null),[y,x]=o.useState(null),[A,S]=o.useState(!1),k=Yf(u),[T,C]=Rd({prop:a,defaultProp:i??!1,onChange:s,caller:Mw}),[N,E]=Rd({prop:c,defaultProp:l,onChange:d,caller:Mw}),P=o.useRef(null),M=!v||b||!!v.closest("form"),[O,R]=o.useState(new Set),_=Array.from(O).map(e=>e.props.value).join(";");return e.jsx(Fv,{...g,children:e.jsxs(Fw,{required:h,scope:n,trigger:v,onTriggerChange:w,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:A,onValueNodeHasChildrenChange:S,contentId:Md(),value:N,onValueChange:E,open:T,onOpenChange:C,dir:k,triggerPointerDownPosRef:P,disabled:p,children:[e.jsx(Ow.Provider,{scope:n,children:e.jsx(Lw,{scope:t.be,onNativeOptionAdd:o.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:o.useCallback(e=>{R(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),M?e.jsxs(Ty,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:m,value:N,onChange:e=>E(e.target.value),disabled:p,form:b,children:[void 0===N?e.jsx("option",{value:""}):null,Array.from(O)]},_):null]})})};$w.displayName=Mw;var zw="SelectTrigger",Gw=o.forwardRef((t,n)=>{const{be:r,disabled:a=!1,...i}=t,s=Uw(r),c=jw(zw,r),l=c.disabled||a,d=Ta(n,c.onTriggerChange),u=Rw(r),f=o.useRef("touch"),[m,p,h]=Ny(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===c.value),r=Ey(t,e,n);void 0!==r&&c.onValueChange(r.value)}),b=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(jv,{asChild:!0,...s,children:e.jsx(ai.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Cy(c.value)?"":void 0,...i,ref:d,onClick:Nd(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&b(e)}),onPointerDown:Nd(i.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(b(e),e.preventDefault())}),onKeyDown:Nd(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Ew.includes(e.key)&&(b(),e.preventDefault())})})})});Gw.displayName=zw;var Zw="SelectValue",Ww=o.forwardRef((t,n)=>{const{be:r,className:o,style:a,children:i,placeholder:s="",...c}=t,l=jw(Zw,r),{onValueNodeHasChildrenChange:d}=l,u=void 0!==i,f=Ta(n,l.onValueNodeChange);return Ql(()=>{d(u)},[d,u]),e.jsx(ai.span,{...c,ref:f,style:{pointerEvents:"none"},children:Cy(l.value)?e.jsx(e.Fragment,{children:s}):i})});Ww.displayName=Zw;var Kw=o.forwardRef((t,n)=>{const{be:r,children:o,...a}=t;return e.jsx(ai.span,{"aria-hidden":!0,...a,ref:n,children:o||"▼"})});Kw.displayName="SelectIcon";var Vw=t=>e.jsx(Jd,{asChild:!0,...t});Vw.displayName="SelectPortal";var Hw="SelectContent",Jw=o.forwardRef((t,n)=>{const r=jw(Hw,t.be),[i,s]=o.useState();if(Ql(()=>{s(new DocumentFragment)},[]),!r.open){const n=i;return n?a.createPortal(e.jsx(Yw,{scope:t.be,children:e.jsx(Ow.Slot,{scope:t.be,children:e.jsx("div",{children:t.children})})}),n):null}return e.jsx(ey,{...t,ref:n})});Jw.displayName=Hw;var qw=10,[Yw,Xw]=Dw(Hw),Qw=Ca("SelectContent.RemoveScroll"),ey=o.forwardRef((t,n)=>{const{be:r,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:c,side:l,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:g,avoidCollisions:v,...w}=t,y=jw(Hw,r),[x,A]=o.useState(null),[S,k]=o.useState(null),T=Ta(n,e=>A(e)),[C,N]=o.useState(null),[E,P]=o.useState(null),M=Rw(r),[O,R]=o.useState(!1),_=o.useRef(!1);o.useEffect(()=>{if(x)return Gu(x)},[x]),Qd();const D=o.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[M,S]),I=o.useCallback(()=>D([C,x]),[D,C,x]);o.useEffect(()=>{O&&I()},[O,I]);const{onOpenChange:U,triggerPointerDownPosRef:F}=y;o.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x>10||e.y>10?x.contains(n.target)||U(!1):n.preventDefault(),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,U,F]),o.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[j,L]=Ny(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Ey(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),B=o.useCallback((e,t,n)=>{const r=!_.current&&!n;(void 0!==y.value&&y.value===t||r)&&(N(e),r&&(_.current=!0))},[y.value]),$=o.useCallback(()=>x?.focus(),[x]),z=o.useCallback((e,t,n)=>{const r=!_.current&&!n;(void 0!==y.value&&y.value===t||r)&&P(e)},[y.value]),G="popper"===a?ny:ty,Z=G===ny?{side:l,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:g,avoidCollisions:v}:{};return e.jsx(Yw,{scope:r,content:x,viewport:S,onViewportChange:k,itemRefCallback:B,selectedItem:C,onItemLeave:$,itemTextRefCallback:z,focusSelectedItem:I,selectedItemText:E,position:a,isPositioned:O,searchRef:j,children:e.jsx(Fu,{as:Qw,allowPinchZoom:!0,children:e.jsx(zd,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Nd(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Ud,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:e.jsx(G,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:e=>e.preventDefault(),...w,...Z,onPlaced:()=>R(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Nd(w.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});ey.displayName="SelectContentImpl";var ty=o.forwardRef((t,n)=>{const{be:r,onPlaced:a,...i}=t,s=jw(Hw,r),c=Xw(Hw,r),[l,d]=o.useState(null),[u,f]=o.useState(null),m=Ta(n,e=>f(e)),p=Rw(r),h=o.useRef(!1),b=o.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:w,focusSelectedItem:y}=c,x=o.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&g&&v&&w){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=w.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,a=n.left-o,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-qw,u=Wm(a,[qw,Math.max(qw,d-c)]);l.style.minWidth=s+"px",l.style.left=u+"px"}else{const o=t.right-r.right,a=window.innerWidth-n.right-o,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-qw,u=Wm(a,[qw,Math.max(qw,d-c)]);l.style.minWidth=s+"px",l.style.right=u+"px"}const o=p(),i=window.innerHeight-2*qw,c=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),y=f+m+c+parseInt(d.paddingBottom,10)+b,x=Math.min(5*v.offsetHeight,y),A=window.getComputedStyle(g),S=parseInt(A.paddingTop,10),k=parseInt(A.paddingBottom,10),T=e.top+e.height/2-qw,C=i-T,N=v.offsetHeight/2,E=f+m+(v.offsetTop+N),P=y-E;if(E>T){const e=o.length>0&&v===o[0].ref.current;l.style.top="0px";const t=Math.max(T,f+g.offsetTop+(e?S:0)+N)+P;l.style.height=t+"px",g.scrollTop=E-T+g.offsetTop}else{const e=o.length>0&&v===o[o.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=E+Math.max(C,N+(e?k:0)+t+b);l.style.height=n+"px"}l.style.margin=qw+"px 0",l.style.minHeight=x+"px",l.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,l,u,g,v,w,s.dir,a]);Ql(()=>x(),[x]);const[A,S]=o.useState();Ql(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const k=o.useCallback(e=>{e&&!0===b.current&&(x(),y?.(),b.current=!1)},[x,y]);return e.jsx(ry,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:e.jsx(ai.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ty.displayName="SelectItemAlignedPosition";var ny=o.forwardRef((t,n)=>{const{be:r,align:o="start",collisionPadding:a=qw,...i}=t,s=Uw(r);return e.jsx(Lv,{...s,...i,ref:n,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});ny.displayName="SelectPopperPosition";var[ry,oy]=Dw(Hw,{}),ay="SelectViewport",iy=o.forwardRef((t,n)=>{const{be:r,nonce:a,...i}=t,s=Xw(ay,r),c=oy(ay,r),l=Ta(n,s.onViewportChange),d=o.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{se:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),e.jsx(Ow.Slot,{scope:r,children:e.jsx(ai.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Nd(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*qw,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(r>i){const o=i+e,a=Math.min(r,o),s=o-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});iy.displayName=ay;var sy="SelectGroup",[cy,ly]=Dw(sy);o.forwardRef((t,n)=>{const{be:r,...o}=t,a=Md();return e.jsx(cy,{scope:r,id:a,children:e.jsx(ai.div,{role:"group","aria-labelledby":a,...o,ref:n})})}).displayName=sy;var dy="SelectLabel",uy=o.forwardRef((t,n)=>{const{be:r,...o}=t,a=ly(dy,r);return e.jsx(ai.div,{id:a.id,...o,ref:n})});uy.displayName=dy;var fy="SelectItem",[my,py]=Dw(fy),hy=o.forwardRef((t,n)=>{const{be:r,value:a,disabled:i=!1,textValue:s,...c}=t,l=jw(fy,r),d=Xw(fy,r),u=l.value===a,[f,m]=o.useState(s??""),[p,h]=o.useState(!1),b=Ta(n,e=>d.itemRefCallback?.(e,a,i)),g=Md(),v=o.useRef("touch"),w=()=>{i||(l.onValueChange(a),l.onOpenChange(!1))};if(""===a)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(my,{scope:r,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:o.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Ow.ItemSlot,{scope:r,value:a,disabled:i,textValue:f,children:e.jsx(ai.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:b,onFocus:Nd(c.onFocus,()=>h(!0)),onBlur:Nd(c.onBlur,()=>h(!1)),onClick:Nd(c.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:Nd(c.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:Nd(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Nd(c.onPointerMove,e=>{v.current=e.pointerType,i?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Nd(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Nd(c.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(Pw.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});hy.displayName=fy;var by="SelectItemText",gy=o.forwardRef((t,n)=>{const{be:r,className:i,style:s,...c}=t,l=jw(by,r),d=Xw(by,r),u=py(by,r),f=Bw(by,r),[m,p]=o.useState(null),h=Ta(n,e=>p(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),b=m?.textContent,g=o.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=f;return Ql(()=>(v(g),()=>w(g)),[v,w,g]),e.jsxs(e.Fragment,{children:[e.jsx(ai.span,{id:u.textId,...c,ref:h}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?a.createPortal(c.children,l.valueNode):null]})});gy.displayName=by;var vy="SelectItemIndicator",wy=o.forwardRef((t,n)=>{const{be:r,...o}=t;return py(vy,r).isSelected?e.jsx(ai.span,{"aria-hidden":!0,...o,ref:n}):null});wy.displayName=vy;var yy="SelectScrollUpButton";o.forwardRef((t,n)=>{const r=Xw(yy,t.be),a=oy(yy,t.be),[i,s]=o.useState(!1),c=Ta(n,a.onScrollButtonChange);return Ql(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?e.jsx(Ay,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=yy;var xy="SelectScrollDownButton";o.forwardRef((t,n)=>{const r=Xw(xy,t.be),a=oy(xy,t.be),[i,s]=o.useState(!1),c=Ta(n,a.onScrollButtonChange);return Ql(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?e.jsx(Ay,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=xy;var Ay=o.forwardRef((t,n)=>{const{be:r,onAutoScroll:a,...i}=t,s=Xw("SelectScrollButton",r),c=o.useRef(null),l=Rw(r),d=o.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return o.useEffect(()=>()=>d(),[d]),Ql(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(ai.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:Nd(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(a,50))}),onPointerMove:Nd(i.onPointerMove,()=>{s.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(a,50))}),onPointerLeave:Nd(i.onPointerLeave,()=>{d()})})}),Sy=o.forwardRef((t,n)=>{const{be:r,...o}=t;return e.jsx(ai.div,{"aria-hidden":!0,...o,ref:n})});Sy.displayName="SelectSeparator";var ky="SelectArrow";o.forwardRef((t,n)=>{const{be:r,...o}=t,a=Uw(r),i=jw(ky,r),s=Xw(ky,r);return i.open&&"popper"===s.position?e.jsx(Bv,{...a,...o,ref:n}):null}).displayName=ky;var Ty=o.forwardRef(({be:t,value:n,...r},a)=>{const i=o.useRef(null),s=Ta(a,i),c=gm(n);return o.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[c,n]),e.jsx(ai.select,{...r,style:{...Nw,...r.style},ref:s,defaultValue:n})});function Cy(e){return""===e||void 0===e}function Ny(e){const t=Yl(e),n=o.useRef(""),r=o.useRef(0),a=o.useCallback(e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),i=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function Ey(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=(i=e,s=Math.max(o,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===r.length&&(a=a.filter(e=>e!==n));const c=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}Ty.displayName="SelectBubbleInput";var Py=Gw,My=Kw,Oy=Vw,Ry=Jw,_y=iy,Dy=uy,Iy=hy,Uy=gy,Fy=wy,jy=Sy;const Ly=$w,By=o.forwardRef(({className:t,children:n,...r},o)=>e.jsxs(Py,{ref:o,className:Aa("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:[n,e.jsx(My,{asChild:!0,children:e.jsx(Df,{className:"h-4 w-4 opacity-50"})})]}));By.displayName=Py.displayName;const $y=o.forwardRef(({className:t,children:n,position:r="popper",...a},i)=>{const{container:s}=o.useContext(q);return e.jsx(Oy,{container:s,children:e.jsx(Ry,{ref:i,className:Aa("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:e.jsx(_y,{className:Aa("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})})});$y.displayName=Ry.displayName,o.forwardRef(({className:t,...n},r)=>e.jsx(Dy,{ref:r,className:Aa("px-2 py-1.5 text-sm font-semibold",t),...n})).displayName=Dy.displayName;const zy=o.forwardRef(({className:t,children:n,...r},o)=>e.jsxs(Iy,{ref:o,className:Aa("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Fy,{children:e.jsx(Uf,{className:"h-4 w-4"})})}),e.jsx(Uy,{children:n})]}));zy.displayName=Iy.displayName,o.forwardRef(({className:t,...n},r)=>e.jsx(jy,{ref:r,className:Aa("-mx-1 my-1 h-px bg-muted",t),...n})).displayName=jy.displayName;const Gy=({workspace:n})=>{const r=W(e=>e.auth.session?.user||null),[o,a]=t.useState(0),[i,s]=t.useState(!1),[c,l]=t.useState([]),{getUsers:d,removeUser:u,updateUser:f}=Kl(),{settings:m}=Hl();t.useEffect(()=>{n&&(s(!0),d(n.t).then(e=>{l(e)}).catch(e=>{}).finally(()=>{s(!1)}))},[n,o]);const p=()=>{a(e=>e+1)};if(i||!n)return e.jsx(yh,{});const h=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e.t},b=c.map(e=>({...e,...h(e.user)})),g=c.find(e=>("string"==typeof e.user?e.user:e.user.t)===r?.id)?.role,v="admin"===g,w=(m?.workspace.maxWorkspaceUsers??Number.MAX_VALUE)>(c.length??0);return e.jsxs("div",{children:[!v&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),v&&e.jsxs("div",{className:"mb-4",children:[w&&e.jsx(Zy,{onInvite:p,workspaceId:n.t}),!w&&e.jsx("div",{className:"text-red-500",children:"You have reached the maximum number of users for this workspace."})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[c.length," member",1!==c.length?"s":""]})}),e.jsx("div",{children:e.jsx(oi,{variant:"ghost",size:"sm",onClick:p,progress:i,startIcon:e.jsx(Va,{}),children:"Refresh"})})]}),e.jsx("ul",{className:"space-y-2",children:b.map((t,o)=>{const a=t.id===r?.id,i=("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)===t.id;return e.jsxs("li",{className:"flex items-center justify-between border rounded p-3",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx("div",{children:e.jsxs(Ly,{disabled:a||!v||i,value:t.role,onValueChange:e=>{return r=n.t,o=t.id,a=e,void(("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)!==o&&f(r,o,{role:a}).then(()=>{p()}));var r,o,a},children:[e.jsx(By,{children:e.jsx(Ww,{placeholder:"Select a role"})}),e.jsx($y,{children:n?.roles.map(t=>e.jsx(zy,{value:t,children:t},t))})]})}),a&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),i&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-1 rounded",children:"Owner"}),!a&&!i&&v&&e.jsx(oi,{variant:"destructive",size:"sm",startIcon:e.jsx(Qa,{}),onClick:()=>{var e;e=t.id,("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy.t:n.createdBy)!==e&&u(n.t,e).then(()=>{p()})}})]})]},o)})}),0===c.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function Zy({onInvite:n,workspaceId:r}){const[o,a]=t.useState(""),[i,s]=t.useState("admin"),[c,l]=t.useState(!1),[d,u]=t.useState(null),[f,m]=t.useState(null),{addUser:p,getWorkspace:h}=Kl(),[b,g]=t.useState(null),{settings:v}=Hl(),w=v?.workspace.roles??b?.roles??[];return t.useEffect(()=>{r&&h(r).then(g)},[r]),e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[d&&e.jsx("div",{className:"text-red-500 capitalize",children:d}),f&&e.jsx("div",{className:"text-green-500 capitalize",children:f}),e.jsxs("div",{children:[e.jsx(li,{children:"Invite member by email"}),e.jsx(yi,{type:"email",value:o,onChange:e=>a(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(li,{children:"Role"}),e.jsxs(Ly,{value:i,onValueChange:s,children:[e.jsx(By,{children:e.jsx(Ww,{placeholder:"Select a role"})}),e.jsx($y,{children:w.map(t=>e.jsx(zy,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(oi,{progress:c,onClick:async()=>{const e=o.trim();e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(l(!0),await p(r,e,i).then(()=>{m("User invited successfully"),n?.()}).catch(e=>{u(e.message||"Failed to invite member")}).finally(()=>{l(!1),setTimeout(()=>{u(null),m(null),a(""),s("admin")},6e3)})):u("Invalid email address format"):u("Email is required")},disabled:c||!o||!i,children:c?"Inviting...":"Invite as "+i})})]})}const Wy=({workspace:t,section:n,setSection:r})=>{const o=W(e=>e.auth.session?.user||null),a=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy.t:t.createdBy)===o?.id;return e.jsxs("div",{className:"w-56 h-full flex flex-col space-y-6",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"}})}),e.jsxs("div",{className:Aa("flex-1 min-w-0",t.image?"":"pl-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(Ky,{title:"Account",children:e.jsx(Vy,{activeSection:n,icon:e.jsx(ti,{className:"h-3.5 w-3.5"}),label:"Profile",section:"profile",onClick:()=>r("profile")})}),e.jsxs(Ky,{title:"Workspace",children:[e.jsx(Vy,{activeSection:n,icon:e.jsx(Ja,{className:"h-3.5 w-3.5"}),label:"General",section:"general",onClick:()=>r("general")}),e.jsx(Vy,{activeSection:n,icon:e.jsx(ni,{className:"h-3.5 w-3.5"}),label:"Users",section:"users",onClick:()=>r("users")}),e.jsx(Vy,{activeSection:n,icon:e.jsx(Ya,{className:"h-3.5 w-3.5"}),label:"Features",section:"features",onClick:()=>r("features")}),a&&e.jsx(Vy,{activeSection:n,icon:e.jsx(ei,{className:"h-3.5 w-3.5"}),label:"Danger Zone",section:"danger",onClick:()=>r("danger")})]})]})};function Ky({title:t,children:n}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),n]})}function Vy({icon:t,label:n,section:r,onClick:o,activeSection:a}){return e.jsxs("button",{className:Aa("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-1",r===a?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>o(r),children:[t,n]})}const Hy=({workspace:n,onClose:r})=>{const[o,a]=t.useState(!1),[i,s]=t.useState("profile");return n?e.jsxs($f,{open:o,onOpenChange:e=>{a(e),e||r()},children:[e.jsx(zf,{asChild:!0,children:e.jsx(oi,{variant:"outline",size:"icon",children:e.jsx(Ja,{className:"h-4 w-4"})})}),e.jsxs(Wf,{className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(Hf,{className:"sr-only",children:"Workspace settings dialog"}),e.jsx(Wy,{workspace:n,section:i,setSection:s}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsxs(Vf,{className:"text-xl font-bold mb-4 capitalize",children:["profile"===i&&"Account","general"===i&&"Workspace Settings","users"===i&&"Workspace Members","features"===i&&"Workspace Features","danger"===i&&"Danger Zone"]}),e.jsxs("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===i&&e.jsx(Cw,{workspace:n}),"general"===i&&e.jsx(jh,{workspace:n}),"users"===i&&e.jsx(Gy,{workspace:n}),"features"===i&&e.jsx(Ih,{workspaceId:n.t?.toString()}),"danger"===i&&e.jsx(xh,{workspace:n})]})]})]})]}):null};function Jy(t){const{workspace:n,setCurrentWorkspace:r,setOpen:o,workspacesToUse:a}=t,i=t.isCurrentWorkspace??!1;return e.jsxs("div",{className:Aa("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":i}),children:[e.jsxs(kd,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(Td,{src:n.image})}),e.jsx(Cd,{children:(s=n.name,s.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(ni,{className:"h-3 w-3"}),e.jsxs("span",{children:[n.users?.length||0," members"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[i?null:e.jsx(oi,{size:"sm",onClick:()=>{t.onWorkspaceChange(n).then(()=>{r(n),o(!1)})},children:"Switch to"}),e.jsx(Hy,{workspace:n,onClose:()=>{if(i){const e=a.findIndex(e=>e.t?.toString()===n.t?.toString());-1!==e&&r(a[e])}}})]})]});var s}function qy(n){const[r,o]=t.useState(!1),[a,i]=t.useState("emoji"),[s,c]=t.useState("🏢"),[l,d]=t.useState(!1),{createWorkspace:u}=Kl(),f=mt({resolver:mo(hs({name:Gi().min(2,{message:"Workspace name must be at least 2 characters."}),image:Gi().optional()})),defaultValues:{name:"",image:""}});return e.jsxs($f,{open:r,onOpenChange:o,children:[e.jsx(zf,{asChild:!0,children:e.jsxs(oi,{className:"w-full rounded-none",children:[e.jsx(Ka,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),e.jsxs(Wf,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(Kf,{children:[e.jsx(Vf,{children:"Create New Workspace"}),e.jsx(Hf,{children:"Create a new workspace to get started."})]}),e.jsx(di,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===a)t=Uh(s);else if("url"===a&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:"Please enter a valid URL"})}d(!0);try{await u(e.name,t),o(!1),f.reset(),c("🏢"),i("emoji"),n?.onCreated?.()}catch(e){}finally{d(!1)}}),children:[e.jsx(fi,{control:f.control,name:"name",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Workspace Name"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"My Awesome Workspace",...t})}),e.jsx(wi,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(li,{className:"text-sm font-medium",children:"Workspace Icon"}),e.jsx(vi,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(Gm,{value:a,onValueChange:e=>i(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Zm,{value:"emoji",id:"emoji"}),e.jsxs(li,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(qa,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Zm,{value:"url",id:"url"}),e.jsxs(li,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Za,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===a&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:s})]}),e.jsx(Pp,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Fh.map((t,n)=>e.jsx("button",{type:"button",onClick:()=>(e=>{c(e),f.setValue("image",Uh(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(s===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===a&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(fi,{control:f.control,name:"image",render:({field:t})=>e.jsxs(hi,{children:[e.jsx(bi,{children:"Image URL"}),e.jsx(gi,{children:e.jsx(yi,{placeholder:"https://example.com/image.png",...t})}),e.jsx(vi,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(wi,{})]})}),f.watch("image")&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Preview:"}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image"),alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(oi,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),c("🏢"),i("emoji")},disabled:l,children:"Cancel"}),e.jsx(oi,{type:"submit",disabled:l,children:l?e.jsxs(e.Fragment,{children:[e.jsx(Wa,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}exports.BetaForm=({onSuccess:n,onError:r,className:o="w-full",fieldClassName:a="flex flex-col gap-1.5 w-full",language:i,customTexts:s={},autoFocus:c=!0,showSuccessMessage:l=!0,hideLogo:d=!1,hideTitles:u=!1})=>{const[f,m]=t.useState("en"),[p,h]=t.useState(!1),[b,g]=t.useState(!1),{submitBetaForm:v,isLoading:w,isSubmitting:y,error:x,config:A,success:S,message:k}=(()=>{const e=W(e=>e.os),[n,r]=t.useState(null),[o,a]=t.useState(!0),[i,s]=t.useState(!1),[c,l]=t.useState(null),[d,u]=t.useState(!1),[f,m]=t.useState(null);return t.useEffect(()=>{(async()=>{a(!0);const t=new Ai(e),n=await t.fetchConfig();r(n),a(!1)})()},[e]),{isLoading:o,isSubmitting:i,config:n,error:c,success:d,message:f,submitBetaForm:t.useCallback(async t=>{if(!e){const e="SaaS OS context is not initialized";return l(e),{success:!1,message:e}}try{s(!0),l(null),u(!1),m(null);const n=new Ai(e),r=await n.submitBetaUser({name:t.name||"",email:t.email}),o="success"===r.status;return u(o),m(r.message),{success:o,message:r.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return l(t),u(!1),m(t),{success:!1,message:t}}finally{s(!1)}},[e])}})();t.useEffect(()=>{m((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(_s).indexOf(e)?e:"en"})())},[]),t.useEffect(()=>{S&&l&&(h(!0),g(!0)),x&&g(!0)},[S,l,x]);const T={..._s[i||f],...s},C=mt({resolver:mo(Rs),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{c&&C.setFocus("name")},[c,C]);const N=C.formState.isValid&&!y;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?e.jsxs("div",{className:Aa("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",o),children:[e.jsx(xi,{className:"h-24 w-24 rounded-lg"}),e.jsx(xi,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(xi,{className:"h-4 w-16"}),e.jsx(xi,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(xi,{className:"h-4 w-16"}),e.jsx(xi,{className:"h-10 w-full"})]}),e.jsx(xi,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!d&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[A?.logo&&e.jsx(Is,{logo:A?.logo}),A?.name&&e.jsx("div",{children:A?.name})]}),e.jsx(Se,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(async e=>{try{const t=await v(e);t.success?(n?.(),C.reset(),l&&h(!0),g(!0)):(r?.(t.message),g(!0))}catch(e){r?.(e instanceof Error?e.message:T.errorMessage),g(!0)}}),className:o,noValidate:!0,"aria-busy":y,children:[!b&&e.jsxs(e.Fragment,{children:[!u&&A?.screen?.register&&e.jsx(Ds,{screen:A?.screen?.register}),e.jsx(fi,{control:C.control,name:"name",render:({field:t})=>e.jsxs(hi,{className:a,children:[e.jsx(bi,{children:T.nameLabel}),e.jsx(gi,{children:e.jsx(yi,{...t})}),e.jsx(vi,{}),e.jsx(wi,{})]})}),e.jsx(fi,{control:C.control,name:"email",render:({field:t})=>e.jsxs(hi,{className:a,children:[e.jsx(bi,{children:T.emailLabel}),e.jsx(gi,{children:e.jsx(yi,{...t})}),e.jsx(vi,{}),e.jsx(wi,{})]})}),e.jsx(oi,{type:"submit",disabled:!N,className:a,children:y?T.submittingText:T.submitText})]}),b&&x&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":"Error",children:"❗"}),x]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(oi,{type:"button",onClick:()=>{g(!1),C.reset()},className:a,children:"Try Again"})})]}),b&&p&&k&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:A?.screen?.thankYou&&e.jsx(Ds,{screen:A?.screen?.thankYou})})]})}),!b&&e.jsx("div",{children:e.jsxs("div",{children:["By submitting this form, you consent to our"," ",e.jsx("a",{href:A?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e.jsx("a",{href:A?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})},exports.SaaSOSProvider=X,exports.WhenAuthenticated=e=>{const{children:t}=e,{status:n}=Vl();return n!==c.authenticated?null:t},exports.WhenRoles=e=>{const{children:t,fallback:n,roles:r}=e,{user:o}=Vl();return r.includes(o?.role??"")?t:n||null},exports.WhenUnauthenticated=e=>{const{children:t}=e,{status:n}=Vl();return n===c.authenticated?null:t},exports.WhenWorkspaceFeatureDisabled=e=>{const{children:t,slug:n}=e,{currentWorkspace:r}=Kl(),o=r?.features?.[n];return o?null:t},exports.WhenWorkspaceFeatureEnabled=e=>{const{children:t,slug:n}=e,{currentWorkspace:r}=Kl(),o=r?.features?.[n];return o?t:null},exports.WhenWorkspaceRoles=e=>{const{children:t,fallback:n,roles:r}=e,{user:o}=Vl(),{currentWorkspace:a}=Kl(),i=a?.users.find(e=>e.t===o?.id);return i&&r.includes(i?.role??"")?t:n||null},exports.WorkspaceSwitcher=function(n){const{workspaces:r,currentWorkspace:o,loading:a,refreshing:i}=W(e=>e.workspaces),s=W(e=>e.auth.session?.user),{settings:c}=Hl(),[l,d]=t.useState(!1),[u,f]=t.useState(0),[m,p]=t.useState(""),{fetchWorkspaces:h,getFeatures:b,refreshWorkspaces:g,setCurrentWorkspace:v,workspaces:w}=Kl(),y=a||i;t.useEffect(()=>{0===w.length?(h(),b()):b()},[]),t.useEffect(()=>{u>0&&g()},[u]);const x=w.length>0?w:r,A=x.filter(e=>e.t!==o?.t).filter(e=>e.name.toLowerCase().includes(m.toLowerCase())),S=c?.workspace.maxWorkspaces??Number.MAX_VALUE,k=x?.filter(e=>("object"==typeof e.createdBy?e.createdBy.t?.toString():e.createdBy?.toString())===s?.id?.toString()).length,T=S>(k??0);return e.jsxs($f,{open:l,onOpenChange:d,children:[e.jsx(zf,{children:n.trigger?.(y,o)}),e.jsxs(Wf,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(Kf,{children:[e.jsxs(Vf,{className:"flex items-center gap-2",children:[e.jsx($a,{className:"h-5 w-5"}),"Switch Workspace"]}),e.jsx(Hf,{children:"Select a workspace to switch to or create a new one."})]}),!s&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Looks like you are not logged in. Please login to continue."})}),s&&e.jsxs("div",{className:"flex flex-col gap-4",children:[o&&e.jsx(Jy,{workspace:o,isCurrentWorkspace:!0,onWorkspaceChange:n.onWorkspaceChange,onClose:()=>d(!1),setCurrentWorkspace:v,setOpen:d,workspacesToUse:x}),e.jsx(Ip,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm font-medium text-muted-foreground",children:["Available Workspaces (",A.length,")"]}),e.jsx("div",{children:e.jsx(oi,{progress:i,disabled:i,variant:"ghost",onClick:function(){f(e=>e+1)},startIcon:e.jsx(Va,{}),children:i?"Refreshing...":"Refresh"})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ha,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(yi,{placeholder:"Search workspaces...",value:m,onChange:e=>p(e.target.value),className:"pl-10"})]}),a?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Wa,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading workspaces..."})]}):0===A.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx($a,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:m?"No workspaces found":"No workspaces available"})]}):e.jsx(Pp,{className:"h-64",children:e.jsx("div",{className:"flex flex-col gap-2 my-2.5",children:A.map(t=>{const r=t.t===o?.t;return e.jsx(Jy,{workspace:t,isCurrentWorkspace:r,onWorkspaceChange:n.onWorkspaceChange,onClose:()=>d(!1),setCurrentWorkspace:v,setOpen:d,workspacesToUse:x},t.t)})})})]}),T&&e.jsxs(e.Fragment,{children:[e.jsx(Ip,{}),e.jsx(qy,{onCreated:()=>{h()}})]})]})]})]})},exports.eventEmitter=J,exports.useSaaSAuth=Vl,exports.useSaaSSettings=Hl,exports.useSaaSWorkspaces=Kl;
2
2
  //# sourceMappingURL=index.js.map