@buildbase/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +304 -0
- package/dist/index.d.ts +310 -0
- package/dist/index.esm.js +30 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/saas-os.css +3 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/types.d.ts +49 -0
- package/dist/types/components/beta/BetaForm.d.ts +24 -0
- package/dist/types/components/beta/api.d.ts +49 -0
- package/dist/types/components/beta/hooks.d.ts +11 -0
- package/dist/types/components/beta/schema.d.ts +6 -0
- package/dist/types/components/beta/types.d.ts +8 -0
- package/dist/types/components/dropdowns/country/countries.d.ts +7 -0
- package/dist/types/components/dropdowns/country/selectCountry.d.ts +6 -0
- package/dist/types/components/dropdowns/currency/currencies.d.ts +6 -0
- package/dist/types/components/dropdowns/currency/selectCurrency.d.ts +6 -0
- package/dist/types/components/dropdowns/language/languages.d.ts +6 -0
- package/dist/types/components/dropdowns/language/selectLanguage.d.ts +6 -0
- package/dist/types/components/dropdowns/timezone/selectTimeZone.d.ts +6 -0
- package/dist/types/components/dropdowns/timezone/timezones.d.ts +8 -0
- package/dist/types/components/features/index.d.ts +7 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +20 -0
- package/dist/types/components/ui/alert.d.ts +8 -0
- package/dist/types/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/button.d.ts +18 -0
- package/dist/types/components/ui/buttonIcon.d.ts +9 -0
- package/dist/types/components/ui/calendar.d.ts +8 -0
- package/dist/types/components/ui/card.d.ts +8 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/command.d.ts +82 -0
- package/dist/types/components/ui/context-menu.d.ts +27 -0
- package/dist/types/components/ui/dateRangePicker.d.ts +9 -0
- package/dist/types/components/ui/dialog.d.ts +19 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/types/components/ui/form.d.ts +23 -0
- package/dist/types/components/ui/heading.d.ts +10 -0
- package/dist/types/components/ui/hover-card.d.ts +6 -0
- package/dist/types/components/ui/input.d.ts +5 -0
- package/dist/types/components/ui/label.d.ts +5 -0
- package/dist/types/components/ui/menubar.d.ts +33 -0
- package/dist/types/components/ui/navigation-menu.d.ts +12 -0
- package/dist/types/components/ui/popover.d.ts +6 -0
- package/dist/types/components/ui/progress.d.ts +4 -0
- package/dist/types/components/ui/radio-group.d.ts +5 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +11 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +28 -0
- package/dist/types/components/ui/skeleton.d.ts +3 -0
- package/dist/types/components/ui/slider.d.ts +4 -0
- package/dist/types/components/ui/switch.d.ts +4 -0
- package/dist/types/components/ui/table.d.ts +10 -0
- package/dist/types/components/ui/tabs.d.ts +7 -0
- package/dist/types/components/ui/textarea.d.ts +5 -0
- package/dist/types/components/ui/toast.d.ts +15 -0
- package/dist/types/components/ui/toaster.d.ts +1 -0
- package/dist/types/components/ui/toggle.d.ts +12 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/components/ui/use-toast.d.ts +44 -0
- package/dist/types/components/user/auth.d.ts +6 -0
- package/dist/types/components/user/role.d.ts +8 -0
- package/dist/types/contexts/AuthContext.d.ts +9 -0
- package/dist/types/contexts/OSContext.d.ts +9 -0
- package/dist/types/contexts/SDKContextProvider.d.ts +15 -0
- package/dist/types/contexts/WorkspaceContext.d.ts +8 -0
- package/dist/types/contexts/actionCreators.d.ts +29 -0
- package/dist/types/contexts/createContext.d.ts +27 -0
- package/dist/types/contexts/index.d.ts +10 -0
- package/dist/types/contexts/reducers/authReducer.d.ts +13 -0
- package/dist/types/contexts/reducers/index.d.ts +3 -0
- package/dist/types/contexts/reducers/osReducer.d.ts +11 -0
- package/dist/types/contexts/reducers/workspaceReducer.d.ts +10 -0
- package/dist/types/contexts/types.d.ts +74 -0
- package/dist/types/contexts/useAppDispatch.d.ts +28 -0
- package/dist/types/contexts/useAppSelector.d.ts +36 -0
- package/dist/types/contexts/utils/reducerHelpers.d.ts +11 -0
- package/dist/types/contexts/utils/storage.d.ts +23 -0
- package/dist/types/hooks/use-mobile.d.ts +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/lib/api-client.d.ts +29 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/providers/ContextConfigProvider.d.ts +15 -0
- package/dist/types/providers/PortalContainer.d.ts +8 -0
- package/dist/types/providers/SaaSOSProvider.d.ts +7 -0
- package/dist/types/providers/auth/hooks.d.ts +10 -0
- package/dist/types/providers/auth/provider.d.ts +8 -0
- package/dist/types/providers/auth/types.d.ts +38 -0
- package/dist/types/providers/auth/utils.d.ts +10 -0
- package/dist/types/providers/os/types.d.ts +9 -0
- package/dist/types/providers/workspace/api.d.ts +33 -0
- package/dist/types/providers/workspace/hooks.d.ts +30 -0
- package/dist/types/providers/workspace/provider.d.ts +9 -0
- package/dist/types/providers/workspace/types.d.ts +38 -0
- package/dist/types/providers/workspace/ui/SettingsDialog.d.ts +8 -0
- package/dist/types/providers/workspace/ui/SettingsFeatures.d.ts +5 -0
- package/dist/types/providers/workspace/ui/SettingsGeneral.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsProfile.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsUsers.d.ts +6 -0
- package/dist/types/providers/workspace/ui/Sidebar.d.ts +10 -0
- package/dist/types/providers/workspace/ui/utils.d.ts +2 -0
- package/dist/types/providers/workspace/utils.d.ts +8 -0
- package/package.json +122 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a,o=n(t),s=n(r);function i({name:r,initialState:n,reducer:a,initializer:o}){const s=t.createContext(null),i=t.createContext(null),l=t.createContext(null),c=()=>{const e=t.useContext(s);if(null===e)throw new Error(`use${r}State must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e};return{Provider:({children:r})=>{const[c,u]=t.useReducer(a,n,o||(e=>e)),d=t.useMemo(()=>({state:c,dispatch:u}),[c,u]);return e.jsx(l.Provider,{value:d,children:e.jsx(s.Provider,{value:c,children:e.jsx(i.Provider,{value:u,children:r})})})},useContext:()=>{const e=t.useContext(l);if(!e)throw new Error(`use${r}Context must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useState:c,useDispatch:()=>{const e=t.useContext(i);if(null===e)throw new Error(`use${r}Dispatch must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`);return e},useSelector:(e,r)=>{const n=c(),a=e||(e=>e),o=t.useRef(a),s=t.useRef(void 0);e&&(o.current=a);const i=t.useMemo(()=>o.current(n),[n]);return void 0!==s.current&&(r||Object.is)(s.current,i)||(s.current=i),void 0!==s.current?s.current:i}}}function l(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return console.warn(`Failed to load ${e} from localStorage:`,t),null}}function c(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}function u(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){console.warn(`Failed to remove ${e} from localStorage:`,t)}}!function(e){e.loading="loading",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(a||(a={}));const d="saas_os_auth_token";function f(){const e=function(e){const t=l(e);if(!t)return null;try{return JSON.parse(t)}catch(t){return console.warn(`Failed to parse ${e} from localStorage:`,t),u(e),null}}(d);return e?new Date(e.expires)>new Date?e:(u(d),null):null}function m(e){!function(e,t){try{c(e,JSON.stringify(t))}catch(t){console.warn(`Failed to save ${e} to localStorage:`,t)}}(d,e)}const h=()=>{const e=f();return{user:e?.user||null,session:e||null,isLoading:!1,isAuthenticated:!!e,isRedirecting:!1,status:e?a.authenticated:a.unauthenticated}},{Provider:p,useState:g,useDispatch:y}=i({name:"Auth",initialState:h(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return{...e,isLoading:!0,isAuthenticated:!1,isRedirecting:!0,status:a.authenticating};case"AUTHENTICATION_FAILED":return{...e,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:a.unauthenticated};case"SET_SESSION":{const r=t.payload;return m(r),{...e,session:r,user:r.user,isAuthenticated:!0,isRedirecting:!1,isLoading:!1,status:a.authenticated}}case"REMOVE_SESSION":return u(d),{...e,user:null,session:null,isLoading:!1,isAuthenticated:!1,isRedirecting:!1,status:a.unauthenticated};default:return e}},initializer:h}),v=p,b=g,w=y,{Provider:x,useState:S,useDispatch:k}=i({name:"OS",initialState:{serverUrl:"",version:"",orgId:""},reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return{...e,...t.payload};case"REMOVE_SAAS_OS_CONFIG":return{serverUrl:"",version:"",orgId:""};default:return e}}}),T=x,A=S,E=k,C="saas-workspace-current";const{Provider:N,useState:j,useDispatch:_}=i({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(r=t.payload._id)?c(C,r):u(C),{...e,currentWorkspace:t.payload};case"RESET_CURRENT_WORKSPACE":return u(C),{...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 r}}),R=N,O=j,D=_,M=({children:t})=>e.jsx(T,{children:e.jsx(v,{children:e.jsx(R,{children:t})})});function P(e,r){const n=A(),a=b(),o=O(),s=t.useMemo(()=>({os:n,auth:a,workspaces:o}),[n,a,o]),i=e||(e=>e),l=t.useRef(i),c=t.useRef(void 0);e&&(l.current=i);const u=t.useMemo(()=>l.current(s),[s]);return void 0!==c.current&&(r||Object.is)(c.current,u)||(c.current=u),void 0!==c.current?c.current:u}function I(){const e=w(),r=E(),n=D();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}const L=()=>({type:"AUTHENTICATION_STARTED"}),F=()=>({type:"AUTHENTICATION_FAILED"}),z=()=>({type:"REMOVE_SESSION"}),U=e=>({type:"SET_WORKSPACES",payload:e}),V=e=>({type:"SET_ALL_FEATURES",payload:e}),$=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),W=()=>({type:"RESET_CURRENT_WORKSPACE"}),B=e=>({type:"SET_IS_INITIALIZED",payload:e}),Z=e=>({type:"SET_LOADING",payload:e}),H=e=>({type:"SET_ERROR",payload:e}),G=e=>({type:"SET_REFRESHING",payload:e}),K=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),q=({config:r,auth:n,children:a})=>{const o=I();return t.useEffect(()=>{o.os(K({...r,auth:{clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||""}}))},[r,n,o]),e.jsx(e.Fragment,{children:a})},J=t.createContext({container:null,setContainer:()=>{}});function Y({children:r}){const[n,a]=t.useState(null);return e.jsxs(J.Provider,{value:{container:n,setContainer:a},children:[r,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})}var X=e=>"checkbox"===e.type,Q=e=>e instanceof Date,ee=e=>null==e;const te=e=>"object"==typeof e;var re=e=>!ee(e)&&!Array.isArray(e)&&te(e)&&!Q(e),ne=e=>re(e)&&e.target?X(e.target)?e.target.checked:e.target.value:e,ae=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),oe="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function se(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(oe&&(e instanceof Blob||n)||!r&&!re(e))return e;if(t=r?[]:Object.create(Object.getPrototypeOf(e)),r||(e=>{const t=e.constructor&&e.constructor.prototype;return re(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=se(e[r]));else t=e}return t}var ie=e=>/^\w*$/.test(e),le=e=>void 0===e,ce=e=>Array.isArray(e)?e.filter(Boolean):[],ue=e=>ce(e.replace(/["|']|\]/g,"").split(/\.|\[/)),de=(e,t,r)=>{if(!t||!re(e))return r;const n=(ie(t)?[t]:ue(t)).reduce((e,t)=>ee(e)?e:e[t],e);return le(n)||n===e?le(e[t])?r:e[t]:n},fe=e=>"boolean"==typeof e,me=(e,t,r)=>{let n=-1;const a=ie(t)?[t]:ue(t),o=a.length,s=o-1;for(;++n<o;){const t=a[n];let o=r;if(n!==s){const r=e[t];o=re(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=o,e=e[t]}};const he="blur",pe="focusout",ge="change",ye="onBlur",ve="onChange",be="onSubmit",we="onTouched",xe="all",Se="max",ke="min",Te="maxLength",Ae="minLength",Ee="pattern",Ce="required",Ne="validate",je=t.createContext(null);je.displayName="HookFormContext";const _e=()=>t.useContext(je),Re=e=>{const{children:r,...n}=e;return t.createElement(je.Provider,{value:n},r)};var Oe=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const a=o;return t._proxyFormState[a]!==xe&&(t._proxyFormState[a]=!n||xe),r&&(r[a]=!0),e[a]}});return a};const De="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var Me=e=>"string"==typeof e,Pe=(e,t,r,n,a)=>Me(e)?(n&&t.watch.add(e),de(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),de(r,e))):(n&&(t.watchAll=!0),r),Ie=e=>ee(e)||!te(e);function Le(e,t,r=new WeakSet){if(Ie(e)||Ie(t))return e===t;if(Q(e)&&Q(t))return e.getTime()===t.getTime();const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!a.includes(o))return!1;if("ref"!==o){const e=t[o];if(Q(n)&&Q(e)||re(n)&&re(e)||Array.isArray(n)&&Array.isArray(e)?!Le(n,e,r):n!==e)return!1}}return!0}function Fe(e){const r=_e(),{name:n,disabled:a,control:o=r.control,shouldUnregister:s,defaultValue:i}=e,l=ae(o._names.array,n),c=t.useMemo(()=>de(o._formValues,n,de(o._defaultValues,n,i)),[o,n,i]),u=function(e){const r=_e(),{control:n=r.control,name:a,defaultValue:o,disabled:s,exact:i,compute:l}=e||{},c=t.useRef(o),u=t.useRef(l),d=t.useRef(void 0);u.current=l;const f=t.useMemo(()=>n._getWatch(a,c.current),[n,a]),[m,h]=t.useState(u.current?u.current(f):f);return De(()=>n._subscribe({name:a,formState:{values:!0},exact:i,callback:e=>{if(!s){const t=Pe(a,n._names,e.values||n._formValues,!1,c.current);if(u.current){const e=u.current(t);Le(e,d.current)||(h(e),d.current=e)}else h(t)}}}),[n,s,a,i]),t.useEffect(()=>n._removeUnmounted()),m}({control:o,name:n,defaultValue:c,exact:!0}),d=function(e){const r=_e(),{control:n=r.control,disabled:a,name:o,exact:s}=e||{},[i,l]=t.useState(n._formState),c=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return De(()=>n._subscribe({name:o,formState:c.current,exact:s,callback:e=>{!a&&l({...n._formState,...e})}}),[o,a,s]),t.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>Oe(i,n,c.current,!1),[i,n])}({control:o,name:n,exact:!0}),f=t.useRef(e),m=t.useRef(o.register(n,{...e.rules,value:u,...fe(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const h=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(d.validatingFields,n)},error:{enumerable:!0,get:()=>de(d.errors,n)}}),[d,n]),p=t.useCallback(e=>m.current.onChange({target:{value:ne(e),name:n},type:ge}),[n]),g=t.useCallback(()=>m.current.onBlur({target:{value:de(o._formValues,n),name:n},type:he}),[n,o._formValues]),y=t.useCallback(e=>{const t=de(o._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,n]),v=t.useMemo(()=>({name:n,value:u,...fe(a)||d.disabled?{disabled:d.disabled||a}:{},onChange:p,onBlur:g,ref:y}),[n,a,d.disabled,p,g,y,u]);return t.useEffect(()=>{const e=o._options.shouldUnregister||s;o.register(n,{...f.current.rules,...fe(f.current.disabled)?{disabled:f.current.disabled}:{}});const t=(e,t)=>{const r=de(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(n,!0),e){const e=se(de(o._options.defaultValues,n));me(o._defaultValues,n,e),le(de(o._formValues,n))&&me(o._formValues,n,e)}return!l&&o.register(n),()=>{(l?e&&!o._state.action:e)?o.unregister(n):t(n,!1)}},[n,o,l,s]),t.useEffect(()=>{o._setDisabledField({disabled:a,name:n})},[a,n,o]),t.useMemo(()=>({field:v,formState:d,fieldState:h}),[v,d,h])}const ze=e=>e.render(Fe(e));var Ue=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Ve=e=>Array.isArray(e)?e:[e],$e=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},We=e=>re(e)&&!Object.keys(e).length,Be=e=>"file"===e.type,Ze=e=>"function"==typeof e,He=e=>{if(!oe)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ge=e=>"select-multiple"===e.type,Ke=e=>"radio"===e.type,qe=e=>He(e)&&e.isConnected;function Je(e,t){const r=Array.isArray(t)?t:ie(t)?[t]:ue(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=le(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,o=r[a];return n&&delete n[o],0!==a&&(re(n)&&We(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!le(e[t]))return!1;return!0}(n))&&Je(e,r.slice(0,-1)),e}var Ye=e=>{for(const t in e)if(Ze(e[t]))return!0;return!1};function Xe(e,t={}){const r=Array.isArray(e);if(re(e)||r)for(const r in e)Array.isArray(e[r])||re(e[r])&&!Ye(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Xe(e[r],t[r])):ee(e[r])||(t[r]=!0);return t}function Qe(e,t,r){const n=Array.isArray(e);if(re(e)||n)for(const n in e)Array.isArray(e[n])||re(e[n])&&!Ye(e[n])?le(t)||Ie(r[n])?r[n]=Array.isArray(e[n])?Xe(e[n],[]):{...Xe(e[n])}:Qe(e[n],ee(t)?{}:t[n],r[n]):r[n]=!Le(e[n],t[n]);return r}var et=(e,t)=>Qe(e,t,Xe(t));const tt={value:!1,isValid:!1},rt={value:!0,isValid:!0};var nt=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?rt:{value:e[0].value,isValid:!0}:rt:tt}return tt},at=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>le(e)?e:t?""===e?NaN:e?+e:e:r&&Me(e)?new Date(e):n?n(e):e;const ot={isValid:!1,value:null};var st=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ot):ot;function it(e){const t=e.ref;return Be(t)?t.files:Ke(t)?st(e.refs).value:Ge(t)?[...t.selectedOptions].map(({value:e})=>e):X(t)?nt(e.refs).value:at(le(t.value)?e.ref.value:t.value,e)}var lt=e=>e instanceof RegExp,ct=e=>le(e)?e:lt(e)?e.source:re(e)?lt(e.value)?e.value.source:e.value:e,ut=e=>({isOnSubmit:!e||e===be,isOnBlur:e===ye,isOnChange:e===ve,isOnAll:e===xe,isOnTouch:e===we});const dt="AsyncFunction";var ft=e=>!!e&&!!e.validate&&!!(Ze(e.validate)&&e.validate.constructor.name===dt||re(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===dt)),mt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const ht=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=de(e,a);if(r){const{_f:e,...o}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(ht(o,t))break}else if(re(o)&&ht(o,t))break}}};function pt(e,t,r){const n=de(e,r);if(n||ie(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),o=de(t,n),s=de(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(s&&s.type)return{name:n,error:s};if(s&&s.root&&s.root.type)return{name:`${n}.root`,error:s.root};a.pop()}return{name:r}}var gt=(e,t,r)=>{const n=Ve(de(e,r));return me(n,"root",t[r]),me(e,r,n),e},yt=e=>Me(e);function vt(e,t,r="validate"){if(yt(e)||Array.isArray(e)&&e.every(yt)||fe(e)&&!e)return{type:r,message:yt(e)?e:"",ref:t}}var bt=e=>re(e)&&!lt(e)?e:{value:e,message:""},wt=async(e,t,r,n,a,o)=>{const{ref:s,refs:i,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:m,validate:h,name:p,valueAsNumber:g,mount:y}=e._f,v=de(r,p);if(!y||t.has(p))return{};const b=i?i[0]:s,w=e=>{a&&b.reportValidity&&(b.setCustomValidity(fe(e)?"":e||""),b.reportValidity())},x={},S=Ke(s),k=X(s),T=S||k,A=(g||Be(s))&&le(s.value)&&le(v)||He(s)&&""===s.value||""===v||Array.isArray(v)&&!v.length,E=Ue.bind(null,p,n,x),C=(e,t,r,n=Te,a=Ae)=>{const o=e?t:r;x[p]={type:e?n:a,message:o,ref:s,...E(e?n:a,o)}};if(o?!Array.isArray(v)||!v.length:l&&(!T&&(A||ee(v))||fe(v)&&!v||k&&!nt(i).isValid||S&&!st(i).isValid)){const{value:e,message:t}=yt(l)?{value:!!l,message:l}:bt(l);if(e&&(x[p]={type:Ce,message:t,ref:b,...E(Ce,t)},!n))return w(t),x}if(!(A||ee(d)&&ee(f))){let e,t;const r=bt(f),a=bt(d);if(ee(v)||isNaN(v)){const n=s.valueAsDate||new Date(v),o=e=>new Date((new Date).toDateString()+" "+e),i="time"==s.type,l="week"==s.type;Me(r.value)&&v&&(e=i?o(v)>o(r.value):l?v>r.value:n>new Date(r.value)),Me(a.value)&&v&&(t=i?o(v)<o(a.value):l?v<a.value:n<new Date(a.value))}else{const n=s.valueAsNumber||(v?+v:v);ee(r.value)||(e=n>r.value),ee(a.value)||(t=n<a.value)}if((e||t)&&(C(!!e,r.message,a.message,Se,ke),!n))return w(x[p].message),x}if((c||u)&&!A&&(Me(v)||o&&Array.isArray(v))){const e=bt(c),t=bt(u),r=!ee(e.value)&&v.length>+e.value,a=!ee(t.value)&&v.length<+t.value;if((r||a)&&(C(r,e.message,t.message),!n))return w(x[p].message),x}if(m&&!A&&Me(v)){const{value:e,message:t}=bt(m);if(lt(e)&&!v.match(e)&&(x[p]={type:Ee,message:t,ref:s,...E(Ee,t)},!n))return w(t),x}if(h)if(Ze(h)){const e=vt(await h(v,r),b);if(e&&(x[p]={...e,...E(Ne,e.message)},!n))return w(e.message),x}else if(re(h)){let e={};for(const t in h){if(!We(e)&&!n)break;const a=vt(await h[t](v,r),b,t);a&&(e={...a,...E(t,a.message)},w(a.message),n&&(x[p]=e))}if(!We(e)&&(x[p]={ref:b,...e},!n))return x}return w(!0),x};const xt={mode:be,reValidateMode:ve,shouldFocusError:!0};function St(e={}){let t,r={...xt,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ze(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},o=(re(r.defaultValues)||re(r.values))&&se(r.defaultValues||r.values)||{},s=r.shouldUnregister?{}:se(o),i={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const f={array:$e(),state:$e()},m=r.criteriaMode===xe,h=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?We((await b()).errors):await w(a,!0);e!==n.isValid&&f.state.next({isValid:e})}},p=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?me(n.validatingFields,e,t):Je(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!We(n.validatingFields)}))},g=(e,t,r,n)=>{const l=de(a,e);if(l){const a=de(s,e,le(r)?de(o,e):r);le(a)||n&&n.defaultChecked||t?me(s,e,t?a:it(l._f)):k(e,a),i.mount&&h()}},y=(e,t,a,s,i)=>{let l=!1,c=!1;const m={name:e};if(!r.disabled){if(!a||s){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=m.isDirty=x(),l=c!==m.isDirty);const r=Le(de(o,e),t);c=!!de(n.dirtyFields,e),r?Je(n.dirtyFields,e):me(n.dirtyFields,e,!0),m.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(a){const t=de(n.touchedFields,e);t||(me(n.touchedFields,e,a),m.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==a)}l&&i&&f.state.next(m)}return l?m:{}},v=(e,a,o,s)=>{const i=de(n.errors,e),l=(u.isValid||d.isValid)&&fe(a)&&n.isValid!==a;var m;if(r.delayError&&o?(m=()=>((e,t)=>{me(n.errors,e,t),f.state.next({errors:n.errors})})(e,o),t=e=>{clearTimeout(c),c=setTimeout(m,e)},t(r.delayError)):(clearTimeout(c),t=null,o?me(n.errors,e,o):Je(n.errors,e)),(o?!Le(i,o):i)||!We(s)||l){const t={...s,...l&&fe(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},f.state.next(t)}},b=async e=>{p(e,!0);const t=await r.resolver(s,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=de(t,r);e&&me(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return p(e),t},w=async(e,t,a={valid:!0})=>{for(const o in e){const i=e[o];if(i){const{_f:e,...c}=i;if(e){const c=l.array.has(e.name),d=i._f&&ft(i._f);d&&u.validatingFields&&p([o],!0);const f=await wt(i,l.disabled,s,m,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&p([o]),f[e.name]&&(a.valid=!1,t))break;!t&&(de(f,e.name)?c?gt(n.errors,f,e.name):me(n.errors,e.name,f[e.name]):Je(n.errors,e.name))}!We(c)&&await w(c,t,a)}}return a.valid},x=(e,t)=>!r.disabled&&(e&&t&&me(s,e,t),!Le(j(),o)),S=(e,t,r)=>Pe(e,l,{...i.mount?s:le(t)?o:Me(e)?{[e]:t}:t},r,t),k=(e,t,r={})=>{const n=de(a,e);let o=t;if(n){const r=n._f;r&&(!r.disabled&&me(s,e,at(t,r)),o=He(r.ref)&&ee(t)?"":t,Ge(r.ref)?[...r.ref.options].forEach(e=>e.selected=o.includes(e.value)):r.refs?X(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(o)?e.checked=!!o.find(t=>t===e.value):e.checked=o===e.value||!!o)}):r.refs.forEach(e=>e.checked=e.value===o):Be(r.ref)?r.ref.value="":(r.ref.value=o,r.ref.type||f.state.next({name:e,values:se(s)})))}(r.shouldDirty||r.shouldTouch)&&y(e,o,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&N(e)},T=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const o=t[n],s=e+"."+n,i=de(a,s);(l.array.has(e)||re(o)||i&&!i._f)&&!Q(o)?T(s,o,r):k(s,o,r)}},A=(e,t,r={})=>{const c=de(a,e),m=l.array.has(e),h=se(t);me(s,e,h),m?(f.array.next({name:e,values:se(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:et(o,s),isDirty:x(e,h)})):!c||c._f||ee(h)?k(e,h,r):T(e,h,r),mt(e,l)&&f.state.next({...n,name:e}),f.state.next({name:i.mount?e:void 0,values:se(s)})},E=async e=>{i.mount=!0;const o=e.target;let c=o.name,g=!0;const x=de(a,c),S=e=>{g=Number.isNaN(e)||Q(e)&&isNaN(e.getTime())||Le(e,de(s,c,e))},k=ut(r.mode),T=ut(r.reValidateMode);if(x){let i,A;const E=o.type?it(x._f):ne(e),C=e.type===he||e.type===pe,j=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(x._f)&&!r.resolver&&!de(n.errors,c)&&!x._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(C,de(n.touchedFields,c),n.isSubmitted,T,k),_=mt(c,l,C);me(s,c,E),C?o&&o.readOnly||(x._f.onBlur&&x._f.onBlur(e),t&&t(0)):x._f.onChange&&x._f.onChange(e);const R=y(c,E,C),O=!We(R)||_;if(!C&&f.state.next({name:c,type:e.type,values:se(s)}),j)return(u.isValid||d.isValid)&&("onBlur"===r.mode?C&&h():C||h()),O&&f.state.next({name:c,..._?{}:R});if(!C&&_&&f.state.next({...n}),r.resolver){const{errors:e}=await b([c]);if(S(E),g){const t=pt(n.errors,a,c),r=pt(e,a,t.name||c);i=r.error,c=r.name,A=We(e)}}else p([c],!0),i=(await wt(x,l.disabled,s,m,r.shouldUseNativeValidation))[c],p([c]),S(E),g&&(i?A=!1:(u.isValid||d.isValid)&&(A=await w(a,!0)));g&&(x._f.deps&&N(x._f.deps),v(c,A,i,R))}},C=(e,t)=>{if(de(n.errors,t)&&e.focus)return e.focus(),1},N=async(e,t={})=>{let o,s;const i=Ve(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await b(e);if(e)for(const r of e){const e=de(t,r);e?me(n.errors,r,e):Je(n.errors,r)}else n.errors=t;return t})(le(e)?e:i);o=We(t),s=e?!i.some(e=>de(t,e)):o}else e?(s=(await Promise.all(i.map(async e=>{const t=de(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||n.isValid)&&h()):s=o=await w(a);return f.state.next({...!Me(e)||(u.isValid||d.isValid)&&o!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:o}:{},errors:n.errors}),t.shouldFocus&&!s&&ht(a,C,e?i:l.mount),s},j=e=>{const t={...i.mount?s:o};return le(e)?t:Me(e)?de(t,e):e.map(e=>de(t,e))},_=(e,t)=>({invalid:!!de((t||n).errors,e),isDirty:!!de((t||n).dirtyFields,e),error:de((t||n).errors,e),isValidating:!!de(n.validatingFields,e),isTouched:!!de((t||n).touchedFields,e)}),R=(e,t,r)=>{const o=(de(a,e,{_f:{}})._f||{}).ref,s=de(n.errors,e)||{},{ref:i,message:l,type:c,...u}=s;me(n.errors,e,{...u,...t,ref:o}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&o&&o.focus&&o.focus()},O=e=>f.state.subscribe({next:t=>{var r,a,i;r=e.name,a=t.name,i=e.exact,r&&a&&r!==a&&!Ve(r).some(e=>e&&(i?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...o}=e;return We(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(e=>t[e]===(!n||xe))})(t,e.formState||u,U,e.reRenderRoot)||e.callback({values:{...s},...n,...t,defaultValues:o})}}).unsubscribe,D=(e,t={})=>{for(const i of e?Ve(e):l.mount)l.mount.delete(i),l.array.delete(i),t.keepValue||(Je(a,i),Je(s,i)),!t.keepError&&Je(n.errors,i),!t.keepDirty&&Je(n.dirtyFields,i),!t.keepTouched&&Je(n.touchedFields,i),!t.keepIsValidating&&Je(n.validatingFields,i),!r.shouldUnregister&&!t.keepDefaultValue&&Je(o,i);f.state.next({values:se(s)}),f.state.next({...n,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&h()},M=({disabled:e,name:t})=>{(fe(e)&&i.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},P=(e,t={})=>{let n=de(a,e);const s=fe(t.disabled)||fe(r.disabled);return me(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?M({disabled:fe(t.disabled)?t.disabled:r.disabled,name:e}):g(e,!0,t.value),{...s?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:ct(t.min),max:ct(t.max),minLength:ct(t.minLength),maxLength:ct(t.maxLength),pattern:ct(t.pattern)}:{},name:e,onChange:E,onBlur:E,ref:s=>{if(s){P(e,t),n=de(a,e);const r=le(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,i=(e=>Ke(e)||X(e))(r),l=n._f.refs||[];if(i?l.find(e=>e===r):r===n._f.ref)return;me(a,e,{_f:{...n._f,...i?{refs:[...l.filter(qe),r,...Array.isArray(de(o,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),g(e,!1,void 0,r)}else n=de(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!ae(l.array,e)||!i.action)&&l.unMount.add(e)}}},I=()=>r.shouldFocusError&&ht(a,C,l.mount),L=(e,t)=>async o=>{let i;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=se(s);if(f.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await b();n.errors=e,c=se(t)}else await w(a);if(l.disabled.size)for(const e of l.disabled)Je(c,e);if(Je(n.errors,"root"),We(n.errors)){f.state.next({errors:{}});try{await e(c,o)}catch(e){i=e}}else t&&await t({...n.errors},o),I(),setTimeout(I);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:We(n.errors)&&!i,submitCount:n.submitCount+1,errors:n.errors}),i)throw i},F=(e,t={})=>{const c=e?se(e):o,d=se(c),m=We(e),h=m?o:d;if(t.keepDefaultValues||(o=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(et(o,s))]);for(const t of Array.from(e))de(n.dirtyFields,t)?me(h,t,de(s,t)):A(t,de(h,t))}else{if(oe&&le(e))for(const e of l.mount){const t=de(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(He(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)A(e,de(h,e));else a={}}s=r.shouldUnregister?t.keepDefaultValues?se(o):{}:se(h),f.array.next({values:{...h}}),f.state.next({values:{...h}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,i.watch=!!r.shouldUnregister,f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!m&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Le(e,o))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&s?et(o,s):n.dirtyFields:t.keepDefaultValues&&e?et(o,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:o})},z=(e,t)=>F(Ze(e)?e(s):e,t),U=e=>{n={...n,...e}},V={control:{register:P,unregister:D,getFieldState:_,handleSubmit:L,setError:R,_subscribe:O,_runSchema:b,_focusError:I,_getWatch:S,_getDirty:x,_setValid:h,_setFieldArray:(e,t=[],l,c,m=!0,h=!0)=>{if(c&&l&&!r.disabled){if(i.action=!0,h&&Array.isArray(de(a,e))){const t=l(de(a,e),c.argA,c.argB);m&&me(a,e,t)}if(h&&Array.isArray(de(n.errors,e))){const t=l(de(n.errors,e),c.argA,c.argB);m&&me(n.errors,e,t),((e,t)=>{!ce(de(e,t)).length&&Je(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&h&&Array.isArray(de(n.touchedFields,e))){const t=l(de(n.touchedFields,e),c.argA,c.argB);m&&me(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=et(o,s)),f.state.next({name:e,isDirty:x(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else me(s,e,t)},_setDisabledField:M,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>ce(de(i.mount?s:o,e,r.shouldUnregister?de(o,e,[]):[])),_reset:F,_resetDefaultValues:()=>Ze(r.defaultValues)&&r.defaultValues().then(e=>{z(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=de(a,e);t&&(t._f.refs?t._f.refs.every(e=>!qe(e)):!qe(t._f.ref))&&D(e)}l.unMount=new Set},_disableForm:e=>{fe(e)&&(f.state.next({disabled:e}),ht(a,(t,r)=>{const n=de(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:f,_proxyFormState:u,get _fields(){return a},get _formValues(){return s},get _state(){return i},set _state(e){i=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(i.mount=!0,d={...d,...e.formState},O({...e,formState:d})),trigger:N,register:P,handleSubmit:L,watch:(e,t)=>Ze(e)?f.state.subscribe({next:r=>"values"in r&&e(S(void 0,t),r)}):S(e,t,!0),setValue:A,getValues:j,reset:z,resetField:(e,t={})=>{de(a,e)&&(le(t.defaultValue)?A(e,se(de(o,e))):(A(e,t.defaultValue),me(o,e,se(t.defaultValue))),t.keepTouched||Je(n.touchedFields,e),t.keepDirty||(Je(n.dirtyFields,e),n.isDirty=t.defaultValue?x(e,se(de(o,e))):x()),t.keepError||(Je(n.errors,e),u.isValid&&h()),f.state.next({...n}))},clearErrors:e=>{e&&Ve(e).forEach(e=>Je(n.errors,e)),f.state.next({errors:e?n.errors:{}})},unregister:D,setError:R,setFocus:(e,t={})=>{const r=de(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&Ze(e.select)&&e.select())}},getFieldState:_};return{...V,formControl:V}}function kt(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,o]=t.useState({isDirty:!1,isValidating:!1,isLoading:Ze(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:Ze(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Ze(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=St(e);r.current={...n,formState:a}}const s=r.current.control;return s._options=e,De(()=>{const e=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),s._formState.isReady=!0,e},[s]),t.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),t.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),t.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),t.useEffect(()=>{if(s._proxyFormState.isDirty){const e=s._getDirty();e!==a.isDirty&&s._subjects.state.next({isDirty:e})}},[s,a.isDirty]),t.useEffect(()=>{e.values&&!Le(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),n.current=e.values,o(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),t.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),r.current.formState=Oe(a,s),r.current}const Tt=(e,t,r)=>{if(e&&"reportValidity"in e){const n=de(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},At=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Tt(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Tt(t,r,e))}},Et=(e,t)=>{t.shouldUseNativeValidation&&At(e,t);const r={};for(const n in e){const a=de(t.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if(Ct(t.names||Object.keys(e),n)){const e=Object.assign({},de(r,n));me(e,"root",o),me(r,n,e)}else me(r,n,o)}return r},Ct=(e,t)=>{const r=Nt(t);return e.some(e=>Nt(e).match(`^${r}\\.\\d+`))};function Nt(e){return e.replace(/\]|\[/g,"")}function jt(e,t,r){function n(r,n){var a;Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(a=r._zod).traits??(a.traits=new Set),r._zod.traits.add(e),t(r,n);for(const e in s.prototype)e in r||Object.defineProperty(r,e,{value:s.prototype[e].bind(r)});r._zod.constr=s,r._zod.def=n}const a=r?.Parent??Object;class o extends a{}function s(e){var t;const a=r?.Parent?new o:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Rt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Ot={};function Dt(e){return Ot}function Mt(e,t){return"bigint"==typeof t?t.toString():t}function Pt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function It(e){return null==e}function Lt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Ft=Symbol("evaluating");function zt(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ft)return void 0===n&&(n=Ft,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ut(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vt(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function $t(e){return JSON.stringify(e)}const Wt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Bt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Zt=Pt(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ht(e){if(!1===Bt(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!1!==Bt(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Gt(e){return Ht(e)?{...e}:Array.isArray(e)?[...e]:e}const Kt=new Set(["string","number","symbol"]);function qt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jt(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Yt(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 new 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 Xt(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function Qt(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function er(e){return"string"==typeof e?e:e?.message}function tr(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=er(e.inst?._zod.def?.error?.(e))??er(t?.error?.(e))??er(r.customError?.(e))??er(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function rr(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function nr(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const ar=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Mt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},or=jt("$ZodError",ar),sr=jt("$ZodError",ar,{Parent:Error});const ir=e=>(t,r,n,a)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new _t;if(s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>tr(e,o,Dt())));throw Wt(t,a?.callee),t}return s.value},lr=ir(sr),cr=e=>async(t,r,n,a)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>tr(e,o,Dt())));throw Wt(t,a?.callee),t}return s.value},ur=cr(sr),dr=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new _t;return o.issues.length?{success:!1,error:new(e??or)(o.issues.map(e=>tr(e,a,Dt())))}:{success:!0,data:o.value}},fr=dr(sr),mr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>tr(e,a,Dt())))}:{success:!0,data:o.value}},hr=mr(sr),pr=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ir(e)(t,r,a)},gr=e=>(t,r,n)=>ir(e)(t,r,n),yr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return cr(e)(t,r,a)},vr=e=>async(t,r,n)=>cr(e)(t,r,n),br=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return dr(e)(t,r,a)},wr=e=>(t,r,n)=>dr(e)(t,r,n),xr=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mr(e)(t,r,a)},Sr=e=>async(t,r,n)=>mr(e)(t,r,n),kr=/^[cC][^\s-]{8,}$/,Tr=/^[0-9a-z]+$/,Ar=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Er=/^[0-9a-vA-V]{20}$/,Cr=/^[A-Za-z0-9]{27}$/,Nr=/^[a-zA-Z0-9_-]{21}$/,jr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_r=/^([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})$/,Rr=e=>e?new 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)$/,Or=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Dr=/^(?:(?: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])$/,Mr=/^(([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}|:))$/,Pr=/^((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])$/,Ir=/^(([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])$/,Lr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fr=/^[A-Za-z0-9_-]*$/,zr=/^(?=.{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])?)*\.?$/,Ur=/^\+(?:[0-9]){6,14}[0-9]$/,Vr="(?:(?:\\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])))",$r=new RegExp(`^${Vr}$`);function Wr(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 Br=/^[^A-Z]*$/,Zr=/^[^a-z]*$/,Hr=jt("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Gr=jt("$ZodCheckMaxLength",(e,t)=>{var r;Hr.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!It(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=rr(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Kr=jt("$ZodCheckMinLength",(e,t)=>{var r;Hr.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!It(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=rr(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qr=jt("$ZodCheckLengthEquals",(e,t)=>{var r;Hr.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!It(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const o=rr(n),s=a>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Jr=jt("$ZodCheckStringFormat",(e,t)=>{var r,n;Hr.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Yr=jt("$ZodCheckRegex",(e,t)=>{Jr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xr=jt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Br),Jr.init(e,t)}),Qr=jt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zr),Jr.init(e,t)}),en=jt("$ZodCheckIncludes",(e,t)=>{Hr.init(e,t);const r=qt(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tn=jt("$ZodCheckStartsWith",(e,t)=>{Hr.init(e,t);const r=new RegExp(`^${qt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),rn=jt("$ZodCheckEndsWith",(e,t)=>{Hr.init(e,t);const r=new RegExp(`.*${qt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),nn=jt("$ZodCheckOverwrite",(e,t)=>{Hr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class an{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),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const on={major:4,minor:1,patch:8},sn=jt("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=on;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=Xt(e);for(const o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&!1===r?.async)throw new _t;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(a||(a=Xt(e,t)))});else{if(e.issues.length===t)continue;a||(a=Xt(e,t))}}return n?n.then(()=>e):e},r=(r,a,o)=>{if(Xt(r))return r.aborted=!0,r;const s=t(a,n,o);if(s instanceof Promise){if(!1===o.async)throw new _t;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if("backward"===o.direction){const t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}const s=e._zod.parse(a,o);if(s instanceof Promise){if(!1===o.async)throw new _t;return s.then(e=>t(e,n,o))}return t(s,n,o)}}e["~standard"]={validate:t=>{try{const r=fr(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return hr(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),ln=jt("$ZodString",(e,t)=>{var r;sn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),cn=jt("$ZodStringFormat",(e,t)=>{Jr.init(e,t),ln.init(e,t)}),un=jt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_r),cn.init(e,t)}),dn=jt("$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 new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Rr(e))}else t.pattern??(t.pattern=Rr());cn.init(e,t)}),fn=jt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Or),cn.init(e,t)}),mn=jt("$ZodURL",(e,t)=>{cn.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:zr.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),hn=jt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),cn.init(e,t)}),pn=jt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Nr),cn.init(e,t)}),gn=jt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=kr),cn.init(e,t)}),yn=jt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Tr),cn.init(e,t)}),vn=jt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ar),cn.init(e,t)}),bn=jt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Er),cn.init(e,t)}),wn=jt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Cr),cn.init(e,t)}),xn=jt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Wr({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Vr}T(?:${n})$`)}(t)),cn.init(e,t)}),Sn=jt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$r),cn.init(e,t)}),kn=jt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Wr(t)}$`)),cn.init(e,t)}),Tn=jt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jr),cn.init(e,t)}),An=jt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dr),cn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),En=jt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Mr),cn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Cn=jt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Pr),cn.init(e,t)}),Nn=jt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ir),cn.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function jn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const _n=jt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Lr),cn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{jn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Rn=jt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fr),cn.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{(function(e){if(!Fr.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return jn(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),On=jt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ur),cn.init(e,t)});const Dn=jt("$ZodJWT",(e,t)=>{cn.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Mn=jt("$ZodUnknown",(e,t)=>{sn.init(e,t),e._zod.parse=e=>e}),Pn=jt("$ZodNever",(e,t)=>{sn.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function In(e,t,r){e.issues.length&&t.issues.push(...Qt(r,e.issues)),t.value[r]=e.value}const Ln=jt("$ZodArray",(e,t)=>{sn.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const o=[];for(let e=0;e<a.length;e++){const s=a[e],i=t.element._zod.run({value:s,issues:[]},n);i instanceof Promise?o.push(i.then(t=>In(t,r,e))):In(i,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function Fn(e,t,r,n){e.issues.length&&t.issues.push(...Qt(r,e.issues)),void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function zn(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Un(e,t,r,n,a,o){const s=[],i=a.keySet,l=a.catchall._zod,c=l.def.type;for(const a of Object.keys(t)){if(i.has(a))continue;if("never"===c){s.push(a);continue}const o=l.run({value:t[a],issues:[]},n);o instanceof Promise?e.push(o.then(e=>Fn(e,r,a,t))):Fn(o,r,a,t)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Vn=jt("$ZodObject",(e,t)=>{sn.init(e,t);const r=Pt(()=>zn(t));zt(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const n=Bt,a=t.catchall;let o;e._zod.parse=(t,s)=>{o??(o=r.value);const i=t.value;if(!n(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value={};const l=[],c=o.shape;for(const e of o.keys){const r=c[e]._zod.run({value:i[e],issues:[]},s);r instanceof Promise?l.push(r.then(r=>Fn(r,t,e,i))):Fn(r,t,e,i)}return a?Un(l,i,t,s,r.value,e):l.length?Promise.all(l).then(()=>t):t}}),$n=jt("$ZodObjectJIT",(e,t)=>{Vn.init(e,t);const r=e._zod.parse,n=Pt(()=>zn(t));let a;const o=Bt,s=!Ot.jitless,i=s&&Zt.value,l=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=n.value);const f=u.value;return o(f)?s&&i&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new an(["shape","payload","ctx"]),r=n.value,a=e=>{const t=$t(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let s=0;for(const e of r.keys)o[e]="key_"+s++;t.write("const newResult = {};");for(const e of r.keys){const r=o[e],n=$t(e);t.write(`const ${r} = ${a(e)};`),t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${n}, ...iss.path] : [${n}]\n })));\n }\n \n \n if (${r}.value === undefined) {\n if (${n} in input) {\n newResult[${n}] = undefined;\n }\n } else {\n newResult[${n}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const i=t.compile();return(t,r)=>i(e,t,r)})(t.shape)),u=a(u,d),l?Un([],f,u,d,c,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u)}});function Wn(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!Xt(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>tr(e,n,Dt())))}),t)}const Bn=jt("$ZodUnion",(e,t)=>{sn.init(e,t),zt(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),zt(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),zt(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),zt(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Lt(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,o)=>{if(r)return n(a,o);let s=!1;const i=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},o);if(t instanceof Promise)i.push(t),s=!0;else{if(0===t.issues.length)return t;i.push(t)}}return s?Promise.all(i).then(t=>Wn(t,a,e,o)):Wn(i,a,e,o)}}),Zn=jt("$ZodIntersection",(e,t)=>{sn.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,r])=>Gn(e,t,r)):Gn(e,a,o)}});function Hn(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(Ht(e)&&Ht(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=Hn(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=Hn(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Gn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Xt(e))return e;const n=Hn(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Kn=jt("$ZodEnum",(e,t)=>{sn.init(e,t);const r=function(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Kt.has(typeof e)).map(e=>"string"==typeof e?qt(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const o=t.value;return n.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),qn=jt("$ZodTransform",(e,t)=>{sn.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Rt(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new _t;return r.value=a,r}});function Jn(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Yn=jt("$ZodOptional",(e,t)=>{sn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",zt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Lt(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>Jn(t,e.value)):Jn(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Xn=jt("$ZodNullable",(e,t)=>{sn.init(e,t),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),zt(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Lt(e.source)}|null)$`):void 0}),zt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),Qn=jt("$ZodDefault",(e,t)=>{sn.init(e,t),e._zod.optin="optional",zt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>ea(e,t)):ea(n,t)}});function ea(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ta=jt("$ZodPrefault",(e,t)=>{sn.init(e,t),e._zod.optin="optional",zt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),ra=jt("$ZodNonOptional",(e,t)=>{sn.init(e,t),zt(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>na(t,e)):na(a,e)}});function na(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 aa=jt("$ZodCatch",(e,t)=>{sn.init(e,t),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),zt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>tr(e,r,Dt()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>tr(e,r,Dt()))},input:e.value}),e.issues=[]),e)}}),oa=jt("$ZodPipe",(e,t)=>{sn.init(e,t),zt(e._zod,"values",()=>t.in._zod.values),zt(e._zod,"optin",()=>t.in._zod.optin),zt(e._zod,"optout",()=>t.out._zod.optout),zt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sa(e,t.in,r)):sa(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sa(e,t.out,r)):sa(n,t.out,r)}});function sa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const ia=jt("$ZodReadonly",(e,t)=>{sn.init(e,t),zt(e._zod,"propValues",()=>t.innerType._zod.propValues),zt(e._zod,"values",()=>t.innerType._zod.values),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(la):la(n)}});function la(e){return e.value=Object.freeze(e.value),e}const ca=jt("$ZodCustom",(e,t)=>{Hr.init(e,t),sn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>ua(t,r,n,e));ua(a,r,n,e)}});function ua(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(nr(e))}}class da{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function fa(){return new da}const ma=fa();function ha(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Yt(t)})}function pa(e,t){return new Gr({check:"max_length",...Yt(t),maximum:e})}function ga(e,t){return new Kr({check:"min_length",...Yt(t),minimum:e})}function ya(e,t){return new qr({check:"length_equals",...Yt(t),length:e})}function va(e){return new nn({check:"overwrite",tx:e})}function ba(e){const t=function(e,t){const r=new Hr({check:"custom",...Yt(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(nr(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(nr(n))}},e(r.value,r)));return t}function wa(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function xa(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[s]={message:i.message,type:i.code}}else r[s]={message:o,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[s].types,c=l&&l[n.code];r[s]=Ue(s,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function Sa(e,t){for(var r={};e.length;){var n=e[0],a=n.code,o=n.message,s=n.path.join(".");if(!r[s])if("invalid_union"===n.code&&n.errors.length>0){var i=n.errors[0][0];r[s]={message:i.message,type:i.code}}else r[s]={message:o,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var l=r[s].types,c=l&&l[n.code];r[s]=Ue(s,t,r,a,c?[].concat(c,n.message):n.message)}e.shift()}return r}function ka(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,o){try{return Promise.resolve(wa(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return o.shouldUseNativeValidation&&At({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:Et(xa(e.errors,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,o){try{return Promise.resolve(wa(function(){return Promise.resolve(("sync"===r.mode?lr:ur)(e,n,t)).then(function(e){return o.shouldUseNativeValidation&&At({},o),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof or}(e))return{values:{},errors:Et(Sa(e.issues,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}function Ta(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Ta(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Aa(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Ta(e))&&(n&&(n+=" "),n+=t);return n}const Ea=e=>{const t=_a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Ca(r,t)||ja(e)},getConflictingClassGroupIds:(e,t)=>{const a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}},Ca=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Ca(e.slice(1),n):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},Na=/^\[(.+)\]$/,ja=e=>{if(Na.test(e)){const t=Na.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},_a=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)Ra(r[e],n,e,t);return n},Ra=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Oa(t,e)).classGroupId=r)}if("function"==typeof e)return Da(e)?void Ra(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{Ra(a,Oa(t,e),r,n)})})},Oa=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Da=e=>e.isThemeGetter,Ma=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(a(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):a(e,t)}}},Pa=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(0===n&&0===a){if(":"===i){t.push(e.slice(o,s)),o=s+1;continue}if("/"===i){r=s;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const s=0===t.length?e:e.substring(o),i=Ia(s);return{modifiers:t,hasImportantModifier:i!==s,baseClassName:i,maybePostfixModifierPosition:r&&r>o?r-o:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},Ia=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,La=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},Fa=/\s+/;function za(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=Ua(e))&&(n&&(n+=" "),n+=t);return n}const Ua=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ua(e[n]))&&(r&&(r+=" "),r+=t);return r};function Va(e,...t){let r,n,a,o=function(i){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Ma(e.cacheSize),parseClassName:Pa(e),sortModifiers:La(e),...Ea(e)}))(l),n=r.cache.get,a=r.cache.set,o=s,s(i)};function s(e){const t=n(e);if(t)return t;const o=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:o}=t,s=[],i=e.trim().split(Fa);let l="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!m,p=n(h?f.substring(0,m):f);if(!p){if(!h){l=t+(l.length>0?" "+l:l);continue}if(p=n(f),!p){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=o(u).join(":"),y=d?g+"!":g,v=y+p;if(s.includes(v))continue;s.push(v);const b=a(p,h);for(let e=0;e<b.length;++e){const t=b[e];s.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return a(e,o),o}return function(){return o(za.apply(null,arguments))}}const $a=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Wa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ba=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Za=/^\d+\/\d+$/,Ha=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ga=/\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$/,Ka=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ja=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ya=e=>Za.test(e),Xa=e=>!!e&&!Number.isNaN(Number(e)),Qa=e=>!!e&&Number.isInteger(Number(e)),eo=e=>e.endsWith("%")&&Xa(e.slice(0,-1)),to=e=>Ha.test(e),ro=()=>!0,no=e=>Ga.test(e)&&!Ka.test(e),ao=()=>!1,oo=e=>qa.test(e),so=e=>Ja.test(e),io=e=>!co(e)&&!go(e),lo=e=>ko(e,Co,ao),co=e=>Wa.test(e),uo=e=>ko(e,No,no),fo=e=>ko(e,jo,Xa),mo=e=>ko(e,Ao,ao),ho=e=>ko(e,Eo,so),po=e=>ko(e,Ro,oo),go=e=>Ba.test(e),yo=e=>To(e,No),vo=e=>To(e,_o),bo=e=>To(e,Ao),wo=e=>To(e,Co),xo=e=>To(e,Eo),So=e=>To(e,Ro,!0),ko=(e,t,r)=>{const n=Wa.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},To=(e,t,r=!1)=>{const n=Ba.exec(e);return!!n&&(n[1]?t(n[1]):r)},Ao=e=>"position"===e||"percentage"===e,Eo=e=>"image"===e||"url"===e,Co=e=>"length"===e||"size"===e||"bg-size"===e,No=e=>"length"===e,jo=e=>"number"===e,_o=e=>"family-name"===e,Ro=e=>"shadow"===e,Oo=Va(()=>{const e=$a("color"),t=$a("font"),r=$a("text"),n=$a("font-weight"),a=$a("tracking"),o=$a("leading"),s=$a("breakpoint"),i=$a("container"),l=$a("spacing"),c=$a("radius"),u=$a("shadow"),d=$a("inset-shadow"),f=$a("text-shadow"),m=$a("drop-shadow"),h=$a("blur"),p=$a("perspective"),g=$a("aspect"),y=$a("ease"),v=$a("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",go,co],w=()=>[go,co,l],x=()=>[Ya,"full","auto",...w()],S=()=>[Qa,"none","subgrid",go,co],k=()=>["auto",{span:["full",Qa,go,co]},Qa,go,co],T=()=>[Qa,"auto",go,co],A=()=>["auto","min","max","fr",go,co],E=()=>["auto",...w()],C=()=>[Ya,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],N=()=>[e,go,co],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",bo,mo,{position:[go,co]}],_=()=>["auto","cover","contain",wo,lo,{size:[go,co]}],R=()=>[eo,yo,uo],O=()=>["","none","full",c,go,co],D=()=>["",Xa,yo,uo],M=()=>[Xa,eo,bo,mo],P=()=>["","none",h,go,co],I=()=>["none",Xa,go,co],L=()=>["none",Xa,go,co],F=()=>[Xa,go,co],z=()=>[Ya,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[to],breakpoint:[to],color:[ro],container:[to],"drop-shadow":[to],ease:["in","out","in-out"],font:[io],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[to],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[to],shadow:[to],spacing:["px",Xa],text:[to],"text-shadow":[to],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ya,co,go,g]}],container:["container"],columns:[{columns:[Xa,co,go,i]}],"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:b()}],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:[Qa,"auto",go,co]}],basis:[{basis:[Ya,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xa,Ya,"auto","initial","none",co]}],grow:[{grow:["",Xa,go,co]}],shrink:[{shrink:["",Xa,go,co]}],order:[{order:[Qa,"first","last","none",go,co]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"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:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[i,"screen",...C()]}],"min-w":[{"min-w":[i,"screen","none",...C()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",r,yo,uo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,go,fo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eo,co]}],"font-family":[{font:[vo,co,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:[a,go,co]}],"line-clamp":[{"line-clamp":[Xa,"none",go,fo]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",go,co]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",go,co]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Xa,"from-font","auto",go,uo]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Xa,"auto",go,co]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",go,co]}],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",go,co]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qa,go,co],radial:["",go,co],conic:[Qa,go,co]},xo,ho]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"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:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Xa,go,co]}],"outline-w":[{outline:["",Xa,yo,uo]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",u,So,po]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",d,So,po]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Xa,uo]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",f,So,po]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Xa,go,co]}],"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":[Xa]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[go,co]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":[Xa]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",go,co]}],filter:[{filter:["","none",go,co]}],blur:[{blur:P()}],brightness:[{brightness:[Xa,go,co]}],contrast:[{contrast:[Xa,go,co]}],"drop-shadow":[{"drop-shadow":["","none",m,So,po]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Xa,go,co]}],"hue-rotate":[{"hue-rotate":[Xa,go,co]}],invert:[{invert:["",Xa,go,co]}],saturate:[{saturate:[Xa,go,co]}],sepia:[{sepia:["",Xa,go,co]}],"backdrop-filter":[{"backdrop-filter":["","none",go,co]}],"backdrop-blur":[{"backdrop-blur":P()}],"backdrop-brightness":[{"backdrop-brightness":[Xa,go,co]}],"backdrop-contrast":[{"backdrop-contrast":[Xa,go,co]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xa,go,co]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xa,go,co]}],"backdrop-invert":[{"backdrop-invert":["",Xa,go,co]}],"backdrop-opacity":[{"backdrop-opacity":[Xa,go,co]}],"backdrop-saturate":[{"backdrop-saturate":[Xa,go,co]}],"backdrop-sepia":[{"backdrop-sepia":["",Xa,go,co]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",go,co]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xa,"initial",go,co]}],ease:[{ease:["linear","initial",y,go,co]}],delay:[{delay:[Xa,go,co]}],animate:[{animate:["none",v,go,co]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,go,co]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:I()}],"rotate-x":[{"rotate-x":I()}],"rotate-y":[{"rotate-y":I()}],"rotate-z":[{"rotate-z":I()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[go,co,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:z()}],"translate-x":[{"translate-x":z()}],"translate-y":[{"translate-y":z()}],"translate-z":[{"translate-z":z()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",go,co]}],"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":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",go,co]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Xa,yo,uo,fo]}],stroke:[{stroke:["none",...N()]}],"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 Do(...e){return Oo(Aa(e))}function Mo(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Po(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Mo(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():Mo(e[t],null)}}}}function Io(...e){return o.useCallback(Po(...e),e)}function Lo(t){const r=zo(t),n=o.forwardRef((t,n)=>{const{children:a,...s}=t,i=o.Children.toArray(a),l=i.find(Vo);if(l){const t=l.props.children,a=i.map(e=>e===l?o.Children.count(t)>1?o.Children.only(null):o.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...s,ref:n,children:o.isValidElement(t)?o.cloneElement(t,void 0,a):null})}return e.jsx(r,{...s,ref:n,children:a})});return n.displayName=`${t}.Slot`,n}var Fo=Lo("Slot");function zo(e){const t=o.forwardRef((e,t)=>{const{children:r,...n}=e;if(o.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{const t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==o.Fragment&&(a.ref=t?Po(t,e):e),o.cloneElement(r,a)}return o.Children.count(r)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Uo=Symbol("radix.slottable");function Vo(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Uo}const $o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Wo=Aa,Bo=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Wo(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;const s=$o(t)||$o(n);return a[e][s]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...i}[t]):{...o,...i}[t]===r})?[...e,r,n]:e},[]);return Wo(e,s,l,null==r?void 0:r.class,null==r?void 0:r.className)},Zo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ho=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Go=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Ko=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.544.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
var qo={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"};
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.544.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/const Jo=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:i,...l},c)=>t.createElement("svg",{ref:c,...qo,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:Go("lucide",o),...!s&&!Ko(l)&&{"aria-hidden":"true"},...l},[...i.map(([e,r])=>t.createElement(e,r)),...Array.isArray(s)?s:[s]])),Yo=(e,r)=>{const n=t.forwardRef(({className:n,...a},o)=>t.createElement(Jo,{ref:o,iconNode:r,className:Go(`lucide-${Zo(Ho(e))}`,`lucide-${e}`,n),...a}));return n.displayName=Ho(e),n},Xo=Yo("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"}]]),Qo=Yo("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),es=Yo("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ts=Yo("crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]),rs=Yo("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"}]]),ns=Yo("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),as=Yo("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),os=Yo("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"}]]),ss=Yo("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),is=Yo("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"}]]),ls=Yo("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"}]]),cs=Yo("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),us=Yo("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"}]]),ds=Yo("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"}]]),fs=Yo("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"}]]),ms=Bo("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"}}),hs=o.forwardRef(({className:t,variant:r,progress:n,size:a,startIcon:s,endIcon:i,asChild:l=!1,...c},u)=>{const d=l?Fo:"button",f=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(a);return e.jsxs(d,{disabled:n||c.disabled,className:Do(ms({variant:r,size:a,withIcon:null!=n||null!=s||null!=i,className:t})),ref:u,...c,children:[n&&e.jsx(ns,{size:f,className:"animate-spin"}),s&&o.cloneElement(s,{size:f}),c.children,i&&o.cloneElement(i,{size:f})]})});
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v0.544.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/hs.displayName="Button";var ps=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=Lo(`Primitive.${r}`),a=o.forwardRef((t,a)=>{const{asChild:o,...s}=t,i=o?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(i,{...s,ref:a})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});var gs=o.forwardRef((t,r)=>e.jsx(ps.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));gs.displayName="Label";var ys=gs;const vs=Bo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),bs=o.forwardRef(({className:t,...r},n)=>e.jsx(ys,{ref:n,className:Do(vs(),t),...r}));bs.displayName=ys.displayName;const ws=Re,xs=o.createContext({}),Ss=({...t})=>e.jsx(xs.Provider,{value:{name:t.name},children:e.jsx(ze,{...t})}),ks=()=>{const e=o.useContext(xs),t=o.useContext(Ts),{getFieldState:r,formState:n}=_e(),a=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...a}},Ts=o.createContext({}),As=o.forwardRef(({className:t,...r},n)=>{const a=o.useId();return e.jsx(Ts.Provider,{value:{id:a},children:e.jsx("div",{ref:n,className:Do("space-y-2",t),...r})})});As.displayName="FormItem";const Es=o.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:o}=ks();return e.jsx(bs,{ref:n,className:Do(a&&"text-destructive",t),htmlFor:o,...r})});Es.displayName="FormLabel";const Cs=o.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:o,formMessageId:s}=ks();return e.jsx(Fo,{ref:r,id:a,"aria-describedby":n?`${o} ${s}`:`${o}`,"aria-invalid":!!n,...t})});Cs.displayName="FormControl";const Ns=o.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=ks();return e.jsx("p",{ref:n,id:a,className:Do("text-sm text-muted-foreground",t),...r})});Ns.displayName="FormDescription";const js=o.forwardRef(({className:t,children:r,...n},a)=>{const{error:o,formMessageId:s}=ks(),i=o?String(o?.message):r;return i?e.jsx("p",{ref:a,id:s,className:Do("text-sm font-medium text-destructive",t),...n,children:i}):null});js.displayName="FormMessage";const _s=o.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Do("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:a,...n}));function Rs({className:t,...r}){return e.jsx("div",{className:Do("animate-pulse rounded-md bg-primary/10",t),...r})}_s.displayName="Input";let Os=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 new Error(`Failed to fetch beta form configuration: ${e.statusText}`);return e.json()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),o=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0),s=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:r,language:n,timezone:a,currency:o}})});if(!s.ok)throw new Error(`Failed to submit beta user request: ${s.statusText}`);return s.json()}};const Ds=jt("ZodISODateTime",(e,t)=>{xn.init(e,t),ai.init(e,t)});function Ms(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Yt(t)})}(Ds,e)}const Ps=jt("ZodISODate",(e,t)=>{Sn.init(e,t),ai.init(e,t)});function Is(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Yt(t)})}(Ps,e)}const Ls=jt("ZodISOTime",(e,t)=>{kn.init(e,t),ai.init(e,t)});function Fs(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Yt(t)})}(Ls,e)}const zs=jt("ZodISODuration",(e,t)=>{Tn.init(e,t),ai.init(e,t)});function Us(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Yt(t)})}(zs,e)}const Vs=jt("ZodError",(e,t)=>{or.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const r=t||function(e){return e.message},n={_errors:[]},a=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)n._errors.push(r(t));else{let e=n,a=0;for(;a<t.path.length;){const n=t.path[a];a===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Mt,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Mt,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),$s=ir(Vs),Ws=cr(Vs),Bs=dr(Vs),Zs=mr(Vs),Hs=pr(Vs),Gs=gr(Vs),Ks=yr(Vs),qs=vr(Vs),Js=br(Vs),Ys=wr(Vs),Xs=xr(Vs),Qs=Sr(Vs),ei=jt("ZodType",(e,t)=>(sn.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>Jt(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>$s(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Bs(e,t,r),e.parseAsync=async(t,r)=>Ws(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Zs(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Hs(e,t,r),e.decode=(t,r)=>Gs(e,t,r),e.encodeAsync=async(t,r)=>Ks(e,t,r),e.decodeAsync=async(t,r)=>qs(e,t,r),e.safeEncode=(t,r)=>Js(e,t,r),e.safeDecode=(t,r)=>Ys(e,t,r),e.safeEncodeAsync=async(t,r)=>Xs(e,t,r),e.safeDecodeAsync=async(t,r)=>Qs(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Yt(r)})}(Hi,e,t)}(t,r)),e.superRefine=t=>e.check(ba(t)),e.overwrite=t=>e.check(va(t)),e.optional=()=>Ii(e),e.nullable=()=>Fi(e),e.nullish=()=>Ii(Fi(e)),e.nonoptional=t=>function(e,t){return new Vi({type:"nonoptional",innerType:e,...Yt(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Yt(r)})}(Ni,e,t);var t},e.or=t=>function(e,t){return new Ri({type:"union",options:e,...Yt(t)})}([e,t]),e.and=t=>new Oi({type:"intersection",left:e,right:t}),e.transform=t=>Bi(e,new Mi({type:"transform",transform:t})),e.default=t=>{return r=t,new zi({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Gt(r)}});var r},e.prefault=t=>{return r=t,new Ui({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Gt(r)}});var r},e.catch=t=>{return new $i({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Bi(e,t),e.readonly=()=>new Zi({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return ma.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>ma.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return ma.get(e);const r=e.clone();return ma.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ti=jt("_ZodString",(e,t)=>{ln.init(e,t),ei.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Yr({check:"string_format",format:"regex",...Yt(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new en({check:"string_format",format:"includes",...Yt(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new tn({check:"string_format",format:"starts_with",...Yt(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new rn({check:"string_format",format:"ends_with",...Yt(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ga(...t)),e.max=(...t)=>e.check(pa(...t)),e.length=(...t)=>e.check(ya(...t)),e.nonempty=(...t)=>e.check(ga(1,...t)),e.lowercase=t=>e.check(function(e){return new Xr({check:"string_format",format:"lowercase",...Yt(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Qr({check:"string_format",format:"uppercase",...Yt(e)})}(t)),e.trim=()=>e.check(va(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return va(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(va(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(va(e=>e.toUpperCase()))}),ri=jt("ZodString",(e,t)=>{ln.init(e,t),ti.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Yt(t)})}(oi,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Yt(t)})}(li,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Yt(t)})}(ki,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Yt(t)})}(ci,t)),e.guid=t=>e.check(ha(si,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Yt(t)})}(ii,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Yt(t)})}(ii,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Yt(t)})}(ii,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Yt(t)})}(ii,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Yt(t)})}(ui,t)),e.guid=t=>e.check(ha(si,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Yt(t)})}(di,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Yt(t)})}(fi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Yt(t)})}(mi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Yt(t)})}(wi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Yt(t)})}(xi,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Yt(t)})}(hi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Yt(t)})}(pi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Yt(t)})}(gi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Yt(t)})}(yi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Yt(t)})}(vi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Yt(t)})}(bi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Yt(t)})}(Si,t)),e.datetime=t=>e.check(Ms(t)),e.date=t=>e.check(Is(t)),e.time=t=>e.check(Fs(t)),e.duration=t=>e.check(Us(t))});function ni(e){return function(e,t){return new e({type:"string",...Yt(t)})}(ri,e)}const ai=jt("ZodStringFormat",(e,t)=>{cn.init(e,t),ti.init(e,t)}),oi=jt("ZodEmail",(e,t)=>{fn.init(e,t),ai.init(e,t)}),si=jt("ZodGUID",(e,t)=>{un.init(e,t),ai.init(e,t)}),ii=jt("ZodUUID",(e,t)=>{dn.init(e,t),ai.init(e,t)}),li=jt("ZodURL",(e,t)=>{mn.init(e,t),ai.init(e,t)}),ci=jt("ZodEmoji",(e,t)=>{hn.init(e,t),ai.init(e,t)}),ui=jt("ZodNanoID",(e,t)=>{pn.init(e,t),ai.init(e,t)}),di=jt("ZodCUID",(e,t)=>{gn.init(e,t),ai.init(e,t)}),fi=jt("ZodCUID2",(e,t)=>{yn.init(e,t),ai.init(e,t)}),mi=jt("ZodULID",(e,t)=>{vn.init(e,t),ai.init(e,t)}),hi=jt("ZodXID",(e,t)=>{bn.init(e,t),ai.init(e,t)}),pi=jt("ZodKSUID",(e,t)=>{wn.init(e,t),ai.init(e,t)}),gi=jt("ZodIPv4",(e,t)=>{An.init(e,t),ai.init(e,t)}),yi=jt("ZodIPv6",(e,t)=>{En.init(e,t),ai.init(e,t)}),vi=jt("ZodCIDRv4",(e,t)=>{Cn.init(e,t),ai.init(e,t)}),bi=jt("ZodCIDRv6",(e,t)=>{Nn.init(e,t),ai.init(e,t)}),wi=jt("ZodBase64",(e,t)=>{_n.init(e,t),ai.init(e,t)}),xi=jt("ZodBase64URL",(e,t)=>{Rn.init(e,t),ai.init(e,t)}),Si=jt("ZodE164",(e,t)=>{On.init(e,t),ai.init(e,t)}),ki=jt("ZodJWT",(e,t)=>{Dn.init(e,t),ai.init(e,t)}),Ti=jt("ZodUnknown",(e,t)=>{Mn.init(e,t),ei.init(e,t)});function Ai(){return new Ti({type:"unknown"})}const Ei=jt("ZodNever",(e,t)=>{Pn.init(e,t),ei.init(e,t)});function Ci(e){return function(e,t){return new e({type:"never",...Yt(t)})}(Ei,e)}const Ni=jt("ZodArray",(e,t)=>{Ln.init(e,t),ei.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(ga(t,r)),e.nonempty=t=>e.check(ga(1,t)),e.max=(t,r)=>e.check(pa(t,r)),e.length=(t,r)=>e.check(ya(t,r)),e.unwrap=()=>e.element});const ji=jt("ZodObject",(e,t)=>{$n.init(e,t),ei.init(e,t),zt(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Di({type:"enum",entries:r,...Yt(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ai()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ai()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ht(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=Vt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Ut(this,"shape",r),r},checks:[]});return Jt(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Ht(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Ut(this,"shape",r),r},checks:e._zod.def.checks};return Jt(e,r)}(e,t),e.merge=t=>function(e,t){const r=Vt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Ut(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Jt(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def;return Jt(e,Vt(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return Ut(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=Vt(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return Ut(this,"shape",n),n},checks:[]});return Jt(e,n)}(e,t),e.partial=(...t)=>function(e,t,r){const n=Vt(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return Ut(this,"shape",a),a},checks:[]});return Jt(t,n)}(Pi,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Vt(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return Ut(this,"shape",a),a},checks:[]});return Jt(t,n)}(Vi,e,t[0])});function _i(e,t){const r={type:"object",get shape(){var t;return Ut(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Yt(t)};return new ji(r)}const Ri=jt("ZodUnion",(e,t)=>{Bn.init(e,t),ei.init(e,t),e.options=t.options});const Oi=jt("ZodIntersection",(e,t)=>{Zn.init(e,t),ei.init(e,t)});const Di=jt("ZodEnum",(e,t)=>{Kn.init(e,t),ei.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new Di({...t,checks:[],...Yt(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new Di({...t,checks:[],...Yt(n),entries:a})}});const Mi=jt("ZodTransform",(e,t)=>{qn.init(e,t),ei.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Rt(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(nr(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(nr(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Pi=jt("ZodOptional",(e,t)=>{Yn.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ii(e){return new Pi({type:"optional",innerType:e})}const Li=jt("ZodNullable",(e,t)=>{Xn.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fi(e){return new Li({type:"nullable",innerType:e})}const zi=jt("ZodDefault",(e,t)=>{Qn.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Ui=jt("ZodPrefault",(e,t)=>{ta.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Vi=jt("ZodNonOptional",(e,t)=>{ra.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType});const $i=jt("ZodCatch",(e,t)=>{aa.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Wi=jt("ZodPipe",(e,t)=>{oa.init(e,t),ei.init(e,t),e.in=t.in,e.out=t.out});function Bi(e,t){return new Wi({type:"pipe",in:e,out:t})}const Zi=jt("ZodReadonly",(e,t)=>{ia.init(e,t),ei.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Hi=jt("ZodCustom",(e,t)=>{ca.init(e,t),ei.init(e,t)});const Gi=_i({name:ni().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:ni().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)")}),Ki={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 qi({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 Ji({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 Yi(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xi}=Object.prototype,{getPrototypeOf:Qi}=Object,{iterator:el,toStringTag:tl}=Symbol,rl=(nl=Object.create(null),e=>{const t=Xi.call(e);return nl[t]||(nl[t]=t.slice(8,-1).toLowerCase())});var nl;const al=e=>(e=e.toLowerCase(),t=>rl(t)===e),ol=e=>t=>typeof t===e,{isArray:sl}=Array,il=ol("undefined");function ll(e){return null!==e&&!il(e)&&null!==e.constructor&&!il(e.constructor)&&dl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const cl=al("ArrayBuffer");const ul=ol("string"),dl=ol("function"),fl=ol("number"),ml=e=>null!==e&&"object"==typeof e,hl=e=>{if("object"!==rl(e))return!1;const t=Qi(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||tl in e||el in e)},pl=al("Date"),gl=al("File"),yl=al("Blob"),vl=al("FileList"),bl=al("URLSearchParams"),[wl,xl,Sl,kl]=["ReadableStream","Request","Response","Headers"].map(al);function Tl(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,a;if("object"!=typeof e&&(e=[e]),sl(e))for(n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else{if(ll(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(n=0;n<o;n++)s=a[n],t.call(null,e[s],s,e)}}function Al(e,t){if(ll(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,a=r.length;for(;a-- >0;)if(n=r[a],t===n.toLowerCase())return n;return null}const El="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cl=e=>!il(e)&&e!==El;const Nl=(jl="undefined"!=typeof Uint8Array&&Qi(Uint8Array),e=>jl&&e instanceof jl);var jl;const _l=al("HTMLFormElement"),Rl=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ol=al("RegExp"),Dl=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Tl(r,(r,a)=>{let o;!1!==(o=t(r,a,e))&&(n[a]=o||r)}),Object.defineProperties(e,n)};const Ml=al("AsyncFunction"),Pl=(Il="function"==typeof setImmediate,Ll=dl(El.postMessage),Il?setImmediate:Ll?(Fl=`axios@${Math.random()}`,zl=[],El.addEventListener("message",({source:e,data:t})=>{e===El&&t===Fl&&zl.length&&zl.shift()()},!1),e=>{zl.push(e),El.postMessage(Fl,"*")}):e=>setTimeout(e));var Il,Ll,Fl,zl;const Ul="undefined"!=typeof queueMicrotask?queueMicrotask.bind(El):"undefined"!=typeof process&&process.nextTick||Pl;var Vl={isArray:sl,isArrayBuffer:cl,isBuffer:ll,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||dl(e.append)&&("formdata"===(t=rl(e))||"object"===t&&dl(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&cl(e.buffer),t},isString:ul,isNumber:fl,isBoolean:e=>!0===e||!1===e,isObject:ml,isPlainObject:hl,isEmptyObject:e=>{if(!ml(e)||ll(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:wl,isRequest:xl,isResponse:Sl,isHeaders:kl,isUndefined:il,isDate:pl,isFile:gl,isBlob:yl,isRegExp:Ol,isFunction:dl,isStream:e=>ml(e)&&dl(e.pipe),isURLSearchParams:bl,isTypedArray:Nl,isFileList:vl,forEach:Tl,merge:function e(){const{caseless:t,skipUndefined:r}=Cl(this)&&this||{},n={},a=(a,o)=>{const s=t&&Al(n,o)||o;hl(n[s])&&hl(a)?n[s]=e(n[s],a):hl(a)?n[s]=e({},a):sl(a)?n[s]=a.slice():r&&il(a)||(n[s]=a)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Tl(arguments[e],a);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(Tl(t,(t,n)=>{r&&dl(t)?e[n]=Yi(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||i[s]||(t[s]=e[s],i[s]=!0);e=!1!==r&&Qi(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:rl,kindOfTest:al,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(sl(e))return e;let t=e.length;if(!fl(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[el]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:_l,hasOwnProperty:Rl,hasOwnProp:Rl,reduceDescriptors:Dl,freezeMethods:e=>{Dl(e,(t,r)=>{if(dl(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];dl(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return sl(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Al,global:El,isContextDefined:Cl,isSpecCompliantForm:function(e){return!!(e&&dl(e.append)&&"FormData"===e[tl]&&e[el])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(ml(e)){if(t.indexOf(e)>=0)return;if(ll(e))return e;if(!("toJSON"in e)){t[n]=e;const a=sl(e)?[]:{};return Tl(e,(e,t)=>{const o=r(e,n+1);!il(o)&&(a[t]=o)}),t[n]=void 0,a}}return e};return r(e,0)},isAsyncFn:Ml,isThenable:e=>e&&(ml(e)||dl(e))&&dl(e.then)&&dl(e.catch),setImmediate:Pl,asap:Ul,isIterable:e=>null!=e&&dl(e[el])};function $l(e,t,r,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),a&&(this.response=a,this.status=a.status?a.status:null)}Vl.inherits($l,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:Vl.toJSONObject(this.config),code:this.code,status:this.status}}});const Wl=$l.prototype,Bl={};["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=>{Bl[e]={value:e}}),Object.defineProperties($l,Bl),Object.defineProperty(Wl,"isAxiosError",{value:!0}),$l.from=(e,t,r,n,a,o)=>{const s=Object.create(Wl);Vl.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const i=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return $l.call(s,i,l,r,n,a),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function Zl(e){return Vl.isPlainObject(e)||Vl.isArray(e)}function Hl(e){return Vl.endsWith(e,"[]")?e.slice(0,-2):e}function Gl(e,t,r){return e?e.concat(t).map(function(e,t){return e=Hl(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Kl=Vl.toFlatObject(Vl,{},null,function(e){return/^is[A-Z]/.test(e)});function ql(e,t,r){if(!Vl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Vl.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Vl.isUndefined(t[e])})).metaTokens,a=r.visitor||c,o=r.dots,s=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Vl.isSpecCompliantForm(t);if(!Vl.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Vl.isDate(e))return e.toISOString();if(Vl.isBoolean(e))return e.toString();if(!i&&Vl.isBlob(e))throw new $l("Blob is not supported. Use a Buffer instead.");return Vl.isArrayBuffer(e)||Vl.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,a){let i=e;if(e&&!a&&"object"==typeof e)if(Vl.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Vl.isArray(e)&&function(e){return Vl.isArray(e)&&!e.some(Zl)}(e)||(Vl.isFileList(e)||Vl.endsWith(r,"[]"))&&(i=Vl.toArray(e)))return r=Hl(r),i.forEach(function(e,n){!Vl.isUndefined(e)&&null!==e&&t.append(!0===s?Gl([r],n,o):null===s?r:r+"[]",l(e))}),!1;return!!Zl(e)||(t.append(Gl(a,r,o),l(e)),!1)}const u=[],d=Object.assign(Kl,{defaultVisitor:c,convertValue:l,isVisitable:Zl});if(!Vl.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Vl.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),Vl.forEach(r,function(r,o){!0===(!(Vl.isUndefined(r)||null===r)&&a.call(t,r,Vl.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t}function Jl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Yl(e,t){this._pairs=[],e&&ql(e,this,t)}const Xl=Yl.prototype;function Ql(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ec(e,t,r){if(!t)return e;const n=r&&r.encode||Ql;Vl.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let o;if(o=a?a(t,r):Vl.isURLSearchParams(t)?t.toString():new Yl(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Xl.append=function(e,t){this._pairs.push([e,t])},Xl.toString=function(e){const t=e?function(t){return e.call(this,t,Jl)}:Jl;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class tc{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Vl.forEach(this.handlers,function(t){null!==t&&e(t)})}}var rc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nc={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Yl,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ac="undefined"!=typeof window&&"undefined"!=typeof document,oc="object"==typeof navigator&&navigator||void 0,sc=ac&&(!oc||["ReactNative","NativeScript","NS"].indexOf(oc.product)<0),ic="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,lc=ac&&window.location.href||"http://localhost";var cc={...Object.freeze({__proto__:null,hasBrowserEnv:ac,hasStandardBrowserEnv:sc,hasStandardBrowserWebWorkerEnv:ic,navigator:oc,origin:lc}),...nc};function uc(e){function t(e,r,n,a){let o=e[a++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),i=a>=e.length;if(o=!o&&Vl.isArray(n)?n.length:o,i)return Vl.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!s;n[o]&&Vl.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],a)&&Vl.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const a=r.length;let o;for(n=0;n<a;n++)o=r[n],t[o]=e[o];return t}(n[o])),!s}if(Vl.isFormData(e)&&Vl.isFunction(e.entries)){const r={};return Vl.forEachEntry(e,(e,n)=>{t(function(e){return Vl.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const dc={transitional:rc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,a=Vl.isObject(e);a&&Vl.isHTMLForm(e)&&(e=new FormData(e));if(Vl.isFormData(e))return n?JSON.stringify(uc(e)):e;if(Vl.isArrayBuffer(e)||Vl.isBuffer(e)||Vl.isStream(e)||Vl.isFile(e)||Vl.isBlob(e)||Vl.isReadableStream(e))return e;if(Vl.isArrayBufferView(e))return e.buffer;if(Vl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ql(e,new cc.classes.URLSearchParams,{visitor:function(e,t,r,n){return cc.isNode&&Vl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=Vl.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ql(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),function(e,t,r){if(Vl.isString(e))try{return(t||JSON.parse)(e),Vl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||dc.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Vl.isResponse(e)||Vl.isReadableStream(e))return e;if(e&&Vl.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw $l.from(e,$l.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:cc.classes.FormData,Blob:cc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vl.forEach(["delete","get","head","post","put","patch"],e=>{dc.headers[e]={}});const fc=Vl.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"]);const mc=Symbol("internals");function hc(e){return e&&String(e).trim().toLowerCase()}function pc(e){return!1===e||null==e?e:Vl.isArray(e)?e.map(pc):String(e)}function gc(e,t,r,n,a){return Vl.isFunction(n)?n.call(this,t,r):(a&&(t=r),Vl.isString(t)?Vl.isString(n)?-1!==t.indexOf(n):Vl.isRegExp(n)?n.test(t):void 0:void 0)}let yc=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function a(e,t,r){const a=hc(t);if(!a)throw new Error("header name must be a non-empty string");const o=Vl.findKey(n,a);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=pc(e))}const o=(e,t)=>Vl.forEach(e,(e,r)=>a(e,r,t));if(Vl.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Vl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,a;return e&&e.split("\n").forEach(function(e){a=e.indexOf(":"),r=e.substring(0,a).trim().toLowerCase(),n=e.substring(a+1).trim(),!r||t[r]&&fc[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Vl.isObject(e)&&Vl.isIterable(e)){let r,n,a={};for(const t of e){if(!Vl.isArray(t))throw TypeError("Object iterator must return a key-value pair");a[n=t[0]]=(r=a[n])?Vl.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(a,t)}else null!=e&&a(t,e,r);return this}get(e,t){if(e=hc(e)){const r=Vl.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Vl.isFunction(t))return t.call(this,e,r);if(Vl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=hc(e)){const r=Vl.findKey(this,e);return!(!r||void 0===this[r]||t&&!gc(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function a(e){if(e=hc(e)){const a=Vl.findKey(r,e);!a||t&&!gc(0,r[a],a,t)||(delete r[a],n=!0)}}return Vl.isArray(e)?e.forEach(a):a(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const a=t[r];e&&!gc(0,this[a],a,e,!0)||(delete this[a],n=!0)}return n}normalize(e){const t=this,r={};return Vl.forEach(this,(n,a)=>{const o=Vl.findKey(r,a);if(o)return t[o]=pc(n),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(a):String(a).trim();s!==a&&delete t[a],t[s]=pc(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Vl.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Vl.isArray(r)?r.join(", "):r)}),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 r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[mc]=this[mc]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=hc(e);t[n]||(!function(e,t){const r=Vl.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,a){return this[n].call(this,t,e,r,a)},configurable:!0})})}(r,e),t[n]=!0)}return Vl.isArray(e)?e.forEach(n):n(e),this}};function vc(e,t){const r=this||dc,n=t||r,a=yc.from(n.headers);let o=n.data;return Vl.forEach(e,function(e){o=e.call(r,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function bc(e){return!(!e||!e.__CANCEL__)}function wc(e,t,r){$l.call(this,null==e?"canceled":e,$l.ERR_CANCELED,t,r),this.name="CanceledError"}function xc(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new $l("Request failed with status code "+r.status,[$l.ERR_BAD_REQUEST,$l.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}yc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vl.reduceDescriptors(yc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Vl.freezeMethods(yc),Vl.inherits(wc,$l,{__CANCEL__:!0});const Sc=(e,t,r=3)=>{let n=0;const a=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a,o=0,s=0;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=n[s];a||(a=l),r[o]=i,n[o]=l;let u=s,d=0;for(;u!==o;)d+=r[u++],u%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),l-a<t)return;const f=c&&l-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let r,n,a=0,o=1e3/t;const s=(t,o=Date.now())=>{a=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=o?s(e,t):(r=e,n||(n=setTimeout(()=>{n=null,s(r)},o-i)))},()=>r&&s(r)]}(r=>{const o=r.loaded,s=r.lengthComputable?r.total:void 0,i=o-n,l=a(i);n=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:i,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})},r)},kc=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Tc=e=>(...t)=>Vl.asap(()=>e(...t));var Ac=cc.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,cc.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(cc.origin),cc.navigator&&/(msie|trident)/i.test(cc.navigator.userAgent)):()=>!0,Ec=cc.hasStandardBrowserEnv?{write(e,t,r,n,a,o){const s=[e+"="+encodeURIComponent(t)];Vl.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Vl.isString(n)&&s.push("path="+n),Vl.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Cc(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Nc=e=>e instanceof yc?{...e}:e;function jc(e,t){t=t||{};const r={};function n(e,t,r,n){return Vl.isPlainObject(e)&&Vl.isPlainObject(t)?Vl.merge.call({caseless:n},e,t):Vl.isPlainObject(t)?Vl.merge({},t):Vl.isArray(t)?t.slice():t}function a(e,t,r,a){return Vl.isUndefined(t)?Vl.isUndefined(e)?void 0:n(void 0,e,0,a):n(e,t,0,a)}function o(e,t){if(!Vl.isUndefined(t))return n(void 0,t)}function s(e,t){return Vl.isUndefined(t)?Vl.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function i(r,a,o){return o in t?n(r,a):o in e?n(void 0,r):void 0}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:i,headers:(e,t,r)=>a(Nc(e),Nc(t),0,!0)};return Vl.forEach(Object.keys({...e,...t}),function(n){const o=l[n]||a,s=o(e[n],t[n],n);Vl.isUndefined(s)&&o!==i||(r[n]=s)}),r}var _c=e=>{const t=jc({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:o,headers:s,auth:i}=t;if(t.headers=s=yc.from(s),t.url=ec(Cc(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&s.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),Vl.isFormData(r))if(cc.hasStandardBrowserEnv||cc.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Vl.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)})}if(cc.hasStandardBrowserEnv&&(n&&Vl.isFunction(n)&&(n=n(t)),n||!1!==n&&Ac(t.url))){const e=a&&o&&Ec.read(o);e&&s.set(a,e)}return t};var Rc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=_c(e);let a=n.data;const o=yc.from(n.headers).normalize();let s,i,l,c,u,{responseType:d,onUploadProgress:f,onDownloadProgress:m}=n;function h(){c&&c(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let p=new XMLHttpRequest;function g(){if(!p)return;const n=yc.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());xc(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p}),p=null}p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(r(new $l("Request aborted",$l.ECONNABORTED,e,p)),p=null)},p.onerror=function(t){const n=new $l(t&&t.message?t.message:"Network Error",$l.ERR_NETWORK,e,p);n.event=t||null,r(n),p=null},p.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const a=n.transitional||rc;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new $l(t,a.clarifyTimeoutError?$l.ETIMEDOUT:$l.ECONNABORTED,e,p)),p=null},void 0===a&&o.setContentType(null),"setRequestHeader"in p&&Vl.forEach(o.toJSON(),function(e,t){p.setRequestHeader(t,e)}),Vl.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),d&&"json"!==d&&(p.responseType=n.responseType),m&&([l,u]=Sc(m,!0),p.addEventListener("progress",l)),f&&p.upload&&([i,c]=Sc(f),p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=t=>{p&&(r(!t||t.type?new wc(null,e,p):t),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);y&&-1===cc.protocols.indexOf(y)?r(new $l("Unsupported protocol "+y+":",$l.ERR_BAD_REQUEST,e)):p.send(a||null)})};const Oc=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const a=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof $l?t:new wc(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,a(new $l(`timeout ${t} of ms exceeded`,$l.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)}),e=null)};e.forEach(e=>e.addEventListener("abort",a));const{signal:i}=n;return i.unsubscribe=()=>Vl.asap(s),i}},Dc=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,a=0;for(;a<r;)n=a+t,yield e.slice(a,n),a=n},Mc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},Pc=(e,t,r,n)=>{const a=async function*(e,t){for await(const r of Mc(e))yield*Dc(r,t)}(e,t);let o,s=0,i=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await a.next();if(t)return i(),void e.close();let o=n.byteLength;if(r){let e=s+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})},{isFunction:Ic}=Vl,Lc=(({Request:e,Response:t})=>({Request:e,Response:t}))(Vl.global),{ReadableStream:Fc,TextEncoder:zc}=Vl.global,Uc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Vc=e=>{e=Vl.merge.call({skipUndefined:!0},Lc,e);const{fetch:t,Request:r,Response:n}=e,a=t?Ic(t):"function"==typeof fetch,o=Ic(r),s=Ic(n);if(!a)return!1;const i=a&&Ic(Fc),l=a&&("function"==typeof zc?(c=new zc,e=>c.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var c;const u=o&&i&&Uc(()=>{let e=!1;const t=new r(cc.origin,{body:new Fc,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=s&&i&&Uc(()=>Vl.isReadableStream(new n("").body)),f={stream:d&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new $l(`Response type '${e}' is not supported`,$l.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=Vl.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Vl.isBlob(e))return e.size;if(Vl.isSpecCompliantForm(e)){const t=new r(cc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Vl.isArrayBufferView(e)||Vl.isArrayBuffer(e)?e.byteLength:(Vl.isURLSearchParams(e)&&(e+=""),Vl.isString(e)?(await l(e)).byteLength:void 0)})(t):n};return async e=>{let{url:a,method:s,data:i,signal:l,cancelToken:c,timeout:h,onDownloadProgress:p,onUploadProgress:g,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:w}=_c(e),x=t||fetch;y=y?(y+"").toLowerCase():"text";let S=Oc([l,c&&c.toAbortSignal()],h),k=null;const T=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let A;try{if(g&&u&&"get"!==s&&"head"!==s&&0!==(A=await m(v,i))){let e,t=new r(a,{method:"POST",body:i,duplex:"half"});if(Vl.isFormData(i)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=kc(A,Sc(Tc(g)));i=Pc(t.body,65536,e,r)}}Vl.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in r.prototype,l={...w,signal:S,method:s.toUpperCase(),headers:v.normalize().toJSON(),body:i,duplex:"half",credentials:t?b:void 0};k=o&&new r(a,l);let c=await(o?x(k,w):x(a,l));const h=d&&("stream"===y||"response"===y);if(d&&(p||h&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=c[t]});const t=Vl.toFiniteNumber(c.headers.get("content-length")),[r,a]=p&&kc(t,Sc(Tc(p),!0))||[];c=new n(Pc(c.body,65536,r,()=>{a&&a(),T&&T()}),e)}y=y||"text";let E=await f[Vl.findKey(f,y)||"text"](c,e);return!h&&T&&T(),await new Promise((t,r)=>{xc(t,r,{data:E,headers:yc.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:k})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $l("Network Error",$l.ERR_NETWORK,e,k),{cause:t.cause||t});throw $l.from(t,t&&t.code,e,k)}}},$c=new Map,Wc=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:a}=t,o=[n,a,r];let s,i,l=o.length,c=$c;for(;l--;)s=o[l],i=c.get(s),void 0===i&&c.set(s,i=l?new Map:Vc(t)),c=i;return i};Wc();const Bc={http:null,xhr:Rc,fetch:{get:Wc}};Vl.forEach(Bc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Zc=e=>`- ${e}`,Hc=e=>Vl.isFunction(e)||null===e||!1===e;var Gc=(e,t)=>{e=Vl.isArray(e)?e:[e];const{length:r}=e;let n,a;const o={};for(let s=0;s<r;s++){let r;if(n=e[s],a=n,!Hc(n)&&(a=Bc[(r=String(n)).toLowerCase()],void 0===a))throw new $l(`Unknown adapter '${r}'`);if(a&&(Vl.isFunction(a)||(a=a.get(t))))break;o[r||"#"+s]=a}if(!a){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new $l("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Zc).join("\n"):" "+Zc(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return a};function Kc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wc(null,e)}function qc(e){Kc(e),e.headers=yc.from(e.headers),e.data=vc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Gc(e.adapter||dc.adapter,e)(e).then(function(t){return Kc(e),t.data=vc.call(e,e.transformResponse,t),t.headers=yc.from(t.headers),t},function(t){return bc(t)||(Kc(e),t&&t.response&&(t.response.data=vc.call(e,e.transformResponse,t.response),t.response.headers=yc.from(t.response.headers))),Promise.reject(t)})}const Jc="1.12.2",Yc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Yc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Xc={};Yc.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Jc+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,a,o)=>{if(!1===e)throw new $l(n(a," has been removed"+(t?" in "+t:"")),$l.ERR_DEPRECATED);return t&&!Xc[a]&&(Xc[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,o)}},Yc.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var Qc={assertOptions:function(e,t,r){if("object"!=typeof e)throw new $l("options must be an object",$l.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const o=n[a],s=t[o];if(s){const t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new $l("option "+o+" must be "+r,$l.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new $l("Unknown option "+o,$l.ERR_BAD_OPTION)}},validators:Yc};const eu=Qc.validators;let tu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new tc,response:new tc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=jc(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:a}=t;void 0!==r&&Qc.assertOptions(r,{silentJSONParsing:eu.transitional(eu.boolean),forcedJSONParsing:eu.transitional(eu.boolean),clarifyTimeoutError:eu.transitional(eu.boolean)},!1),null!=n&&(Vl.isFunction(n)?t.paramsSerializer={serialize:n}:Qc.assertOptions(n,{encode:eu.function,serialize:eu.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Qc.assertOptions(t,{baseUrl:eu.spelling("baseURL"),withXsrfToken:eu.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&Vl.merge(a.common,a[t.method]);a&&Vl.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=yc.concat(o,a);const s=[];let i=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!i){const e=[qc.bind(this),void 0];for(e.unshift(...s),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=s.length;let f=t;for(;d<u;){const e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=qc.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return ec(Cc((e=jc(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Vl.forEach(["delete","get","head","options"],function(e){tu.prototype[e]=function(t,r){return this.request(jc(r||{},{method:e,url:t,data:(r||{}).data}))}}),Vl.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,a){return this.request(jc(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}tu.prototype[e]=t(),tu.prototype[e+"Form"]=t(!0)});const ru={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(ru).forEach(([e,t])=>{ru[t]=e});const nu=function e(t){const r=new tu(t),n=Yi(tu.prototype.request,r);return Vl.extend(n,tu.prototype,r,{allOwnKeys:!0}),Vl.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(jc(t,r))},n}(dc);nu.Axios=tu,nu.CanceledError=wc,nu.CancelToken=class e{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 r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,a){r.reason||(r.reason=new wc(e,n,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.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 t;return{token:new e(function(e){t=e}),cancel:t}}},nu.isCancel=bc,nu.VERSION=Jc,nu.toFormData=ql,nu.AxiosError=$l,nu.Cancel=nu.CanceledError,nu.all=function(e){return Promise.all(e)},nu.spread=function(e){return function(t){return e.apply(null,t)}},nu.isAxiosError=function(e){return Vl.isObject(e)&&!0===e.isAxiosError},nu.mergeConfig=jc,nu.AxiosHeaders=yc,nu.formToJSON=e=>uc(Vl.isHTMLForm(e)?new FormData(e):e),nu.getAdapter=Gc,nu.HttpStatusCode=ru,nu.default=nu;const{Axios:au,AxiosError:ou,CanceledError:su,isCancel:iu,CancelToken:lu,VERSION:cu,all:uu,Cancel:du,isAxiosError:fu,spread:mu,toFormData:hu,AxiosHeaders:pu,HttpStatusCode:gu,formToJSON:yu,getAdapter:vu,mergeConfig:bu}=nu,wu="undefined"!=typeof window;const xu=new class{constructor(e={}){this.client=nu.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=this.getAuthToken();return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>e,e=>(401===e.response?.status&&this.handleUnauthorized(),Promise.reject(e)))}getAuthToken(){return wu?localStorage.getItem("auth_token"):null}handleUnauthorized(){wu&&localStorage.removeItem("auth_token")}async get(e,t){const r=await this.client.get(e,t);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async post(e,t,r){const n=await this.client.post(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async put(e,t,r){const n=await this.client.put(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}async delete(e,t){const r=await this.client.delete(e,t);return{data:r.data,status:r.status,statusText:r.statusText,headers:r.headers}}async patch(e,t,r){const n=await this.client.patch(e,t,r);return{data:n.data,status:n.status,statusText:n.statusText,headers:n.headers}}setAuthToken(e){wu&&localStorage.setItem("auth_token",e)}removeAuthToken(){wu&&localStorage.removeItem("auth_token")}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 Su{constructor(e){this.version=e.version,this.orgId=e.orgId,this.serverUrl=e.serverUrl}getAuthHeader(){const e=function(){if("undefined"==typeof window)return null;const e=localStorage.getItem("saas_os_auth_token");try{return e?JSON.parse(e).accessToken:null}catch(e){return null}}();let t={};return e&&(t.Authorization=`Bearer ${e}`),t}async getWorkspaces(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces`,{headers:this.getAuthHeader()});if(!e.ok)throw new 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 new Error("Failed to create workspace");return t.json()}async updateWorkspace(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(t)});if(!r.ok)throw new Error("Failed to update workspace");return r.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 new 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 new Error("Failed to fetch workspace users");return t.json()}async addUser(e,t){const r=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(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to invite member")}return r.json()}async removeUser(e,t){const r=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"DELETE",headers:this.getAuthHeader()});if(!r.ok){const e=await r.json();throw new Error(e.message||"Failed to remove user")}return r.json()}async updateUser(e,t,r){const n=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",...this.getAuthHeader()},body:JSON.stringify(r)});if(!n.ok){const e=await n.json();throw new Error(e.message||"Failed to update user")}return n.json()}async getFeatures(){const e=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/features`,{headers:this.getAuthHeader()});if(!e.ok)throw new Error("Failed to fetch features");return e.json()}async updateFeature(e,t,r){const n=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]:r}})});if(!n.ok)throw new Error("Failed to update feature");return n.json()}async getWorkspace(e){const t=await fetch(`${this.serverUrl}/api/${this.version}/public/workspaces/${e}`,{headers:this.getAuthHeader()});if(!t.ok)throw new 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 new 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 new Error("Failed to update user profile");return t.json()}}function ku(t,r=[]){let n=[];const a=()=>{const e=n.map(e=>o.createContext(e));return function(r){const n=r?.[t]||e;return o.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return a.scopeName=t,[function(r,a){const s=o.createContext(a),i=n.length;n=[...n,a];const l=r=>{const{scope:n,children:a,...l}=r,c=n?.[t]?.[i]||s,u=o.useMemo(()=>l,Object.values(l));return e.jsx(c.Provider,{value:u,children:a})};return l.displayName=r+"Provider",[l,function(e,n){const l=n?.[t]?.[i]||s,c=o.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Tu(a,...r)]}function Tu(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}function Au(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}var Eu,Cu=globalThis?.document?o.useLayoutEffect:()=>{},Nu={exports:{}},ju={};var _u,Ru,Ou={};
|
|
21
|
+
/**
|
|
22
|
+
* @license React
|
|
23
|
+
* use-sync-external-store-shim.development.js
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/var Du=(Ru||(Ru=1,"production"===process.env.NODE_ENV?Nu.exports=function(){if(Eu)return ju;Eu=1;var e=t,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function i(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),l=n({inst:{value:r,getSnapshot:t}}),c=l[0].inst,u=l[1];return o(function(){c.value=r,c.getSnapshot=t,i(c)&&u({inst:c})},[e,r,t]),a(function(){return i(c)&&u({inst:c}),e(function(){i(c)&&u({inst:c})})},[e]),s(r),r};return ju.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,ju}():Nu.exports=(_u||(_u=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,i=r.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===r.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();n(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var m=(f=a({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return s(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[t,d,u]),o(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),i(d),d};Ou.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ou)),Nu.exports);function Mu(){return()=>{}}var Pu="Avatar",[Iu,Lu]=ku(Pu),[Fu,zu]=Iu(Pu),Uu=o.forwardRef((t,r)=>{const{__scopeAvatar:n,...a}=t,[s,i]=o.useState("idle");return e.jsx(Fu,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:e.jsx(ps.span,{...a,ref:r})})});Uu.displayName=Pu;var Vu="AvatarImage",$u=o.forwardRef((t,r)=>{const{__scopeAvatar:n,src:a,onLoadingStatusChange:s=()=>{},...i}=t,l=zu(Vu,n),c=function(e,{referrerPolicy:t,crossOrigin:r}){const n=Du.useSyncExternalStore(Mu,()=>!0,()=>!1),a=o.useRef(null),s=n?(a.current||(a.current=new window.Image),a.current):null,[i,l]=o.useState(()=>Zu(s,e));return Cu(()=>{l(Zu(s,e))},[s,e]),Cu(()=>{const e=e=>()=>{l(e)};if(!s)return;const n=e("loaded"),a=e("error");return s.addEventListener("load",n),s.addEventListener("error",a),t&&(s.referrerPolicy=t),"string"==typeof r&&(s.crossOrigin=r),()=>{s.removeEventListener("load",n),s.removeEventListener("error",a)}},[s,r,t]),i}(a,i),u=Au(e=>{s(e),l.onImageLoadingStatusChange(e)});return Cu(()=>{"idle"!==c&&u(c)},[c,u]),"loaded"===c?e.jsx(ps.img,{...i,ref:r,src:a}):null});$u.displayName=Vu;var Wu="AvatarFallback",Bu=o.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:a,...s}=t,i=zu(Wu,n),[l,c]=o.useState(void 0===a);return o.useEffect(()=>{if(void 0!==a){const e=window.setTimeout(()=>c(!0),a);return()=>window.clearTimeout(e)}},[a]),l&&"loaded"!==i.imageLoadingStatus?e.jsx(ps.span,{...s,ref:r}):null});function Zu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}Bu.displayName=Wu;var Hu=Uu,Gu=$u,Ku=Bu;const qu=o.forwardRef(({className:t,...r},n)=>e.jsx(Hu,{ref:n,className:Do("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));qu.displayName=Hu.displayName;const Ju=o.forwardRef(({className:t,...r},n)=>e.jsx(Gu,{ref:n,className:Do("aspect-square h-full w-full",t),...r}));Ju.displayName=Gu.displayName;const Yu=o.forwardRef(({className:t,...r},n)=>e.jsx(Ku,{ref:n,className:Do("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));function Xu(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}Yu.displayName=Ku.displayName;var Qu=o[" useId ".trim().toString()]||(()=>{}),ed=0;function td(e){const[t,r]=o.useState(Qu());return Cu(()=>{r(e=>e??String(ed++))},[e]),t?`radix-${t}`:""}var rd=o[" useInsertionEffect ".trim().toString()]||Cu;function nd({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,s,i]=function({defaultProp:e,onChange:t}){const[r,n]=o.useState(e),a=o.useRef(r),s=o.useRef(t);return rd(()=>{s.current=t},[t]),o.useEffect(()=>{a.current!==r&&(s.current?.(r),a.current=r)},[r,a]),[r,n,s]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:a;{const t=o.useRef(void 0!==e);o.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",r=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,n])}const u=o.useCallback(t=>{if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&i.current?.(r)}else s(t)},[l,e,s,i]);return[c,u]}var ad,od="dismissableLayer.update",sd="dismissableLayer.pointerDownOutside",id="dismissableLayer.focusOutside",ld=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cd=o.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...u}=t,d=o.useContext(ld),[f,m]=o.useState(null),h=f?.ownerDocument??globalThis?.document,[,p]=o.useState({}),g=Io(r,e=>m(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,k=function(e,t=globalThis?.document){const r=Au(e),n=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){dd(sd,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(s?.(e),l?.(e),e.defaultPrevented||c?.())},h),T=function(e,t=globalThis?.document){const r=Au(e),n=o.useRef(!1);return o.useEffect(()=>{const e=e=>{if(e.target&&!n.current){dd(id,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(i?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const r=Au(e);o.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),o.useEffect(()=>{if(f)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(ad=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ud(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=ad)}},[f,h,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ud())},[f,d]),o.useEffect(()=>{const e=()=>p({});return document.addEventListener(od,e),()=>document.removeEventListener(od,e)},[]),e.jsx(ps.div,{...u,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:Xu(t.onFocusCapture,T.onFocusCapture),onBlurCapture:Xu(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Xu(t.onPointerDownCapture,k.onPointerDownCapture)})});cd.displayName="DismissableLayer";function ud(){const e=new CustomEvent(od);document.dispatchEvent(e)}function dd(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(a,o):a.dispatchEvent(o)}o.forwardRef((t,r)=>{const n=o.useContext(ld),a=o.useRef(null),s=Io(r,a);return o.useEffect(()=>{const e=a.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(ps.div,{...t,ref:s})}).displayName="DismissableLayerBranch";var fd="focusScope.autoFocusOnMount",md="focusScope.autoFocusOnUnmount",hd={bubbles:!1,cancelable:!0},pd=o.forwardRef((t,r)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=t,[c,u]=o.useState(null),d=Au(s),f=Au(i),m=o.useRef(null),h=Io(r,e=>u(e)),p=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let e=function(e){if(p.paused||!c)return;const t=e.target;c.contains(t)?m.current=t:bd(m.current,{select:!0})},t=function(e){if(p.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||bd(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&bd(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[a,c,p.paused]),o.useEffect(()=>{if(c){wd.add(p);const t=document.activeElement;if(!c.contains(t)){const r=new CustomEvent(fd,hd);c.addEventListener(fd,d),c.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bd(n,{select:t}),document.activeElement!==r)return}((e=gd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&bd(c))}return()=>{c.removeEventListener(fd,d),setTimeout(()=>{const e=new CustomEvent(md,hd);c.addEventListener(md,f),c.dispatchEvent(e),e.defaultPrevented||bd(t??document.body,{select:!0}),c.removeEventListener(md,f),wd.remove(p)},0)}}var e},[c,d,f,p]);const g=o.useCallback(e=>{if(!n&&!a)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[a,o]=function(e){const t=gd(e),r=yd(t,e),n=yd(t.reverse(),e);return[r,n]}(t);a&&o?e.shiftKey||r!==o?e.shiftKey&&r===a&&(e.preventDefault(),n&&bd(o,{select:!0})):(e.preventDefault(),n&&bd(a,{select:!0})):r===t&&e.preventDefault()}},[n,a,p.paused]);return e.jsx(ps.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function gd(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function yd(e,t){for(const r of e)if(!vd(r,{upTo:t}))return r}function vd(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 bd(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}pd.displayName="FocusScope";var wd=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=xd(e,t),e.unshift(t)},remove(t){e=xd(e,t),e[0]?.resume()}}}();function xd(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Sd=o.forwardRef((t,n)=>{const{container:a,...s}=t,[i,l]=o.useState(!1);Cu(()=>l(!0),[]);const c=a||i&&globalThis?.document?.body;return c?r.createPortal(e.jsx(ps.div,{...s,ref:n}),c):null});Sd.displayName="Portal";var kd=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=o.useState(),n=o.useRef(null),a=o.useRef(e),s=o.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return o.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=Td(n.current);s.current="mounted"===l?e:"none"},[l]),Cu(()=>{const t=n.current,r=a.current;if(r!==e){const n=s.current,o=Td(t);if(e)c("MOUNT");else if("none"===o||"none"===t?.display)c("UNMOUNT");else{c(r&&n!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Cu(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,o=o=>{const s=Td(n.current).includes(CSS.escape(o.animationName));if(o.target===t&&s&&(c("ANIMATION_END"),!a.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},i=e=>{e.target===t&&(s.current=Td(n.current))};return t.addEventListener("animationstart",i),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",i),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),a="function"==typeof r?r({present:n.isPresent}):o.Children.only(r),s=Io(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||n.isPresent?o.cloneElement(a,{ref:s}):null};function Td(e){return e?.animationName||"none"}kd.displayName="Presence";var Ad=0;function Ed(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cd()),document.body.insertAdjacentElement("beforeend",e[1]??Cd()),Ad++,()=>{1===Ad&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ad--}},[])}function Cd(){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 Nd=function(){return Nd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Nd.apply(this,arguments)};function jd(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var _d="right-scroll-bar-position",Rd="width-before-scroll-bar";function Od(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Dd="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,Md=new WeakMap;function Pd(e,r){var n,a,o,s=(n=null,a=function(t){return e.forEach(function(e){return Od(e,t)})},(o=t.useState(function(){return{value:n,callback:a,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=a,o.facade);return Dd(function(){var t=Md.get(s);if(t){var r=new Set(t),n=new Set(e),a=s.current;r.forEach(function(e){n.has(e)||Od(e,null)}),n.forEach(function(e){r.has(e)||Od(e,a)})}Md.set(s,e)},[e]),s}function Id(e){return e}var Ld=function(e){var t=e.sideCar,r=jd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return o.createElement(n,Nd({},r))};Ld.isSideCarExport=!0;var Fd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Id);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var o=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(o)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Nd({async:!0,ssr:!1},e),t}(),zd=function(){},Ud=o.forwardRef(function(e,t){var r=o.useRef(null),n=o.useState({onScrollCapture:zd,onWheelCapture:zd,onTouchMoveCapture:zd}),a=n[0],s=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,h=e.noRelative,p=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,x=jd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Pd([r,t]),T=Nd(Nd({},x),a);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Fd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:p,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:r,gapMode:w}),i?o.cloneElement(o.Children.only(l),Nd(Nd({},T),{ref:k})):o.createElement(b,Nd({},T,{className:c,ref:k}),l))});Ud.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ud.classNames={fullWidth:Rd,zeroRight:_d};function Vd(){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}var $d=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Vd())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wd=function(){var e,t=(e=$d(),function(t,r){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Bd={left:0,top:0,right:0,gap:0},Zd=function(e){return parseInt(e||"",10)||0},Hd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Bd;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[Zd(r),Zd(n),Zd(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Gd=Wd(),Kd="data-scroll-locked",qd=function(e,t,r,n){var a=e.left,o=e.top,s=e.right,i=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(i,"px ").concat(n,";\n }\n body[").concat(Kd,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(i,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(_d," {\n right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(Rd," {\n margin-right: ").concat(i,"px ").concat(n,";\n }\n \n .").concat(_d," .").concat(_d," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Rd," .").concat(Rd," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Kd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(i,"px;\n }\n")},Jd=function(){var e=parseInt(document.body.getAttribute(Kd)||"0",10);return isFinite(e)?e:0},Yd=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;o.useEffect(function(){return document.body.setAttribute(Kd,(Jd()+1).toString()),function(){var e=Jd()-1;e<=0?document.body.removeAttribute(Kd):document.body.setAttribute(Kd,e.toString())}},[]);var s=o.useMemo(function(){return Hd(a)},[a]);return o.createElement(Gd,{styles:qd(s,!t,a,r?"":"!important")})},Xd=!1;if("undefined"!=typeof window)try{var Qd=Object.defineProperty({},"passive",{get:function(){return Xd=!0,!0}});window.addEventListener("test",Qd,Qd),window.removeEventListener("test",Qd,Qd)}catch(e){Xd=!1}var ef=!!Xd&&{passive:!1},tf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},rf=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),nf(e,n)){var a=af(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},nf=function(e,t){return"v"===e?function(e){return tf(e,"overflowY")}(t):function(e){return tf(e,"overflowX")}(t)},af=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},of=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sf=function(e){return[e.deltaX,e.deltaY]},lf=function(e){return e&&"current"in e?e.current:e},cf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},uf=0,df=[];function ff(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var mf,hf=(mf=function(e){var t=o.useRef([]),r=o.useRef([0,0]),n=o.useRef(),a=o.useState(uf++)[0],s=o.useState(Wd)[0],i=o.useRef(e);o.useEffect(function(){i.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(lf),!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 l=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=of(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-o[0],c="deltaY"in e?e.deltaY:s[1]-o[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=rf(d,u);if(!f)return!0;if(f?a=d:(a="v"===d?"h":"v",f=rf(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=a),!a)return!0;var m=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=a*n,s=r.target,i=t.contains(s),l=!1,c=o>0,u=0,d=0;do{if(!s)break;var f=af(e,s),m=f[0],h=f[1]-f[2]-a*m;(m||h)&&nf(e,s)&&(u+=h,d+=m);var p=s.parentNode;s=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!i&&s!==document.body||i&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(m,t,e,"h"===m?l:c)},[]),c=o.useCallback(function(e){var r=e;if(df.length&&df[df.length-1]===s){var n="deltaY"in r?sf(r):of(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var o=(i.current.shards||[]).map(lf).filter(Boolean).filter(function(e){return e.contains(r.target)});(o.length>0?l(r,o[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=o.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:ff(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=o.useCallback(function(e){r.current=of(e),n.current=void 0},[]),f=o.useCallback(function(t){u(t.type,sf(t),t.target,l(t,e.lockRef.current))},[]),m=o.useCallback(function(t){u(t.type,of(t),t.target,l(t,e.lockRef.current))},[]);o.useEffect(function(){return df.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,ef),document.addEventListener("touchmove",c,ef),document.addEventListener("touchstart",d,ef),function(){df=df.filter(function(e){return e!==s}),document.removeEventListener("wheel",c,ef),document.removeEventListener("touchmove",c,ef),document.removeEventListener("touchstart",d,ef)}},[]);var h=e.removeScrollBar,p=e.inert;return o.createElement(o.Fragment,null,p?o.createElement(s,{styles:cf(a)}):null,h?o.createElement(Yd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Fd.useMedium(mf),Ld),pf=o.forwardRef(function(e,t){return o.createElement(Ud,Nd({},e,{ref:t,sideCar:hf}))});pf.classNames=Ud.classNames;var gf=new WeakMap,yf=new WeakMap,vf={},bf=0,wf=function(e){return e&&(e.host||wf(e.parentNode))},xf=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=wf(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);vf[r]||(vf[r]=new WeakMap);var o=vf[r],s=[],i=new Set,l=new Set(a),c=function(e){e&&!i.has(e)&&(i.add(e),c(e.parentNode))};a.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(i.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,l=(gf.get(e)||0)+1,c=(o.get(e)||0)+1;gf.set(e,l),o.set(e,c),s.push(e),1===l&&a&&yf.set(e,!0),1===c&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),i.clear(),bf++,function(){s.forEach(function(e){var t=gf.get(e)-1,a=o.get(e)-1;gf.set(e,t),o.set(e,a),t||(yf.has(e)||e.removeAttribute(n),yf.delete(e)),a||e.removeAttribute(r)}),--bf||(gf=new WeakMap,gf=new WeakMap,yf=new WeakMap,vf={})}},Sf=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),xf(n,a,r,"aria-hidden")):function(){return null}},kf="Dialog",[Tf,Af]=ku(kf),[Ef,Cf]=Tf(kf),Nf=t=>{const{__scopeDialog:r,children:n,open:a,defaultOpen:s,onOpenChange:i,modal:l=!0}=t,c=o.useRef(null),u=o.useRef(null),[d,f]=nd({prop:a,defaultProp:s??!1,onChange:i,caller:kf});return e.jsx(Ef,{scope:r,triggerRef:c,contentRef:u,contentId:td(),titleId:td(),descriptionId:td(),open:d,onOpenChange:f,onOpenToggle:o.useCallback(()=>f(e=>!e),[f]),modal:l,children:n})};Nf.displayName=kf;var jf="DialogTrigger",_f=o.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Cf(jf,n),s=Io(r,o.triggerRef);return e.jsx(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Jf(o.open),...a,ref:s,onClick:Xu(t.onClick,o.onOpenToggle)})});_f.displayName=jf;var Rf="DialogPortal",[Of,Df]=Tf(Rf,{forceMount:void 0}),Mf=t=>{const{__scopeDialog:r,forceMount:n,children:a,container:s}=t,i=Cf(Rf,r);return e.jsx(Of,{scope:r,forceMount:n,children:o.Children.map(a,t=>e.jsx(kd,{present:n||i.open,children:e.jsx(Sd,{asChild:!0,container:s,children:t})}))})};Mf.displayName=Rf;var Pf="DialogOverlay",If=o.forwardRef((t,r)=>{const n=Df(Pf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,s=Cf(Pf,t.__scopeDialog);return s.modal?e.jsx(kd,{present:a||s.open,children:e.jsx(Ff,{...o,ref:r})}):null});If.displayName=Pf;var Lf=Lo("DialogOverlay.RemoveScroll"),Ff=o.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Cf(Pf,n);return e.jsx(pf,{as:Lf,allowPinchZoom:!0,shards:[o.contentRef],children:e.jsx(ps.div,{"data-state":Jf(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),zf="DialogContent",Uf=o.forwardRef((t,r)=>{const n=Df(zf,t.__scopeDialog),{forceMount:a=n.forceMount,...o}=t,s=Cf(zf,t.__scopeDialog);return e.jsx(kd,{present:a||s.open,children:s.modal?e.jsx(Vf,{...o,ref:r}):e.jsx($f,{...o,ref:r})})});Uf.displayName=zf;var Vf=o.forwardRef((t,r)=>{const n=Cf(zf,t.__scopeDialog),a=o.useRef(null),s=Io(r,n.contentRef,a);return o.useEffect(()=>{const e=a.current;if(e)return Sf(e)},[]),e.jsx(Wf,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xu(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Xu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Xu(t.onFocusOutside,e=>e.preventDefault())})}),$f=o.forwardRef((t,r)=>{const n=Cf(zf,t.__scopeDialog),a=o.useRef(!1),s=o.useRef(!1);return e.jsx(Wf,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||n.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const r=e.target,o=n.triggerRef.current?.contains(r);o&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}})}),Wf=o.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=t,c=Cf(zf,n),u=o.useRef(null),d=Io(r,u);return Ed(),e.jsxs(e.Fragment,{children:[e.jsx(pd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(cd,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Jf(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(em,{titleId:c.titleId}),e.jsx(tm,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Bf="DialogTitle",Zf=o.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Cf(Bf,n);return e.jsx(ps.h2,{id:o.titleId,...a,ref:r})});Zf.displayName=Bf;var Hf="DialogDescription",Gf=o.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Cf(Hf,n);return e.jsx(ps.p,{id:o.descriptionId,...a,ref:r})});Gf.displayName=Hf;var Kf="DialogClose",qf=o.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,o=Cf(Kf,n);return e.jsx(ps.button,{type:"button",...a,ref:r,onClick:Xu(t.onClick,()=>o.onOpenChange(!1))})});function Jf(e){return e?"open":"closed"}qf.displayName=Kf;var Yf="DialogTitleWarning",[Xf,Qf]=function(t,r){const n=o.createContext(r),a=t=>{const{children:r,...a}=t,s=o.useMemo(()=>a,Object.values(a));return e.jsx(n.Provider,{value:s,children:r})};return a.displayName=t+"Provider",[a,function(e){const a=o.useContext(n);if(a)return a;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(Yf,{contentName:zf,titleName:Bf,docsSlug:"dialog"}),em=({titleId:e})=>{const t=Qf(Yf),r=`\`${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(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},tm=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Qf("DialogDescriptionWarning").contentName}}.`;return o.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},rm=Nf,nm=_f,am=Mf,om=If,sm=Uf,im=Zf,lm=Gf,cm=qf;function um(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var dm=["color"],fm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=um(e,dm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),mm=["color"],hm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=um(e,mm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),pm=["color"],gm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=um(e,pm);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),ym=["color"],vm=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,o=um(e,ym);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:r}),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:a,fillRule:"evenodd",clipRule:"evenodd"}))});const bm=rm,wm=nm,xm=am,Sm=o.forwardRef(({className:t,...r},n)=>e.jsx(om,{ref:n,className:Do("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),...r}));Sm.displayName=om.displayName;const km=o.forwardRef(({className:t,children:r,...n},a)=>{const{container:s}=o.useContext(J);return e.jsxs(xm,{container:s,children:[e.jsx(Sm,{}),e.jsxs(sm,{ref:a,className:Do("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,children:[r,e.jsxs(cm,{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(gm,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});km.displayName=sm.displayName;const Tm=({className:t,...r})=>e.jsx("div",{className:Do("flex flex-col space-y-1.5 text-center sm:text-left",t),...r});Tm.displayName="DialogHeader";const Am=o.forwardRef(({className:t,...r},n)=>e.jsx(im,{ref:n,className:Do("text-lg font-semibold leading-none tracking-tight",t),...r}));Am.displayName=im.displayName;const Em=o.forwardRef(({className:t,...r},n)=>e.jsx(lm,{ref:n,className:Do("text-sm text-muted-foreground",t),...r}));function Cm(r){const n=r+"CollectionProvider",[a,o]=ku(n),[s,i]=a(n,{collectionRef:{current:null},itemMap:new Map}),l=r=>{const{scope:n,children:a}=r,o=t.useRef(null),i=t.useRef(new Map).current;return e.jsx(s,{scope:n,itemMap:i,collectionRef:o,children:a})};l.displayName=n;const c=r+"CollectionSlot",u=Lo(c),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,o=Io(r,i(c,n).collectionRef);return e.jsx(u,{ref:o,children:a})});d.displayName=c;const f=r+"CollectionItemSlot",m="data-radix-collection-item",h=Lo(f),p=t.forwardRef((r,n)=>{const{scope:a,children:o,...s}=r,l=t.useRef(null),c=Io(n,l),u=i(f,a);return t.useEffect(()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)})),e.jsx(h,{[m]:"",ref:c,children:o})});return p.displayName=f,[{Provider:l,Slot:d,ItemSlot:p},function(e){const n=i(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},o]}Em.displayName=lm.displayName;var Nm=o.createContext(void 0);function jm(e){const t=o.useContext(Nm);return e||t||"ltr"}var _m="rovingFocusGroup.onEntryFocus",Rm={bubbles:!1,cancelable:!0},Om="RovingFocusGroup",[Dm,Mm,Pm]=Cm(Om),[Im,Lm]=ku(Om,[Pm]),[Fm,zm]=Im(Om),Um=o.forwardRef((t,r)=>e.jsx(Dm.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Dm.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Vm,{...t,ref:r})})}));Um.displayName=Om;var Vm=o.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=t,h=o.useRef(null),p=Io(r,h),g=jm(i),[y,v]=nd({prop:l,defaultProp:c??null,onChange:u,caller:Om}),[b,w]=o.useState(!1),x=Au(d),S=Mm(n),k=o.useRef(!1),[T,A]=o.useState(0);return o.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(_m,x),()=>e.removeEventListener(_m,x)},[x]),e.jsx(Fm,{scope:n,orientation:a,dir:g,loop:s,currentTabStopId:y,onItemFocus:o.useCallback(e=>v(e),[v]),onItemShiftTab:o.useCallback(()=>w(!0),[]),onFocusableItemAdd:o.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>A(e=>e-1),[]),children:e.jsx(ps.div,{tabIndex:b||0===T?-1:0,"data-orientation":a,...m,ref:p,style:{outline:"none",...t.style},onMouseDown:Xu(t.onMouseDown,()=>{k.current=!0}),onFocus:Xu(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(_m,Rm);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);Zm([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:Xu(t.onBlur,()=>w(!1))})})}),$m="RovingFocusGroupItem",Wm=o.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:s=!1,tabStopId:i,children:l,...c}=t,u=td(),d=i||u,f=zm($m,n),m=f.currentTabStopId===d,h=Mm(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:y}=f;return o.useEffect(()=>{if(a)return p(),()=>g()},[a,p,g]),e.jsx(Dm.ItemSlot,{scope:n,id:d,focusable:a,active:s,children:e.jsx(ps.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...c,ref:r,onMouseDown:Xu(t.onMouseDown,e=>{a?f.onItemFocus(d):e.preventDefault()}),onFocus:Xu(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:Xu(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Bm[n]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=f.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>Zm(r))}}),children:"function"==typeof l?l({isCurrentTabStop:m,hasTabStop:null!=y}):l})})});Wm.displayName=$m;var Bm={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zm(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Hm=Um,Gm=Wm;function Km(e){const[t,r]=o.useState(void 0);return Cu(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,o;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,o=t.blockSize}else a=e.offsetWidth,o=e.offsetHeight;r({width:a,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}function qm(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 Jm="Radio",[Ym,Xm]=ku(Jm),[Qm,eh]=Ym(Jm),th=o.forwardRef((t,r)=>{const{__scopeRadio:n,name:a,checked:s=!1,required:i,disabled:l,value:c="on",onCheck:u,form:d,...f}=t,[m,h]=o.useState(null),p=Io(r,e=>h(e)),g=o.useRef(!1),y=!m||(d||!!m.closest("form"));return e.jsxs(Qm,{scope:n,checked:s,disabled:l,children:[e.jsx(ps.button,{type:"button",role:"radio","aria-checked":s,"data-state":oh(s),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:p,onClick:Xu(t.onClick,e=>{s||u?.(),y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),y&&e.jsx(ah,{control:m,bubbles:!g.current,name:a,value:c,checked:s,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});th.displayName=Jm;var rh="RadioIndicator",nh=o.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...o}=t,s=eh(rh,n);return e.jsx(kd,{present:a||s.checked,children:e.jsx(ps.span,{"data-state":oh(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})})});nh.displayName=rh;var ah=o.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:a=!0,...s},i)=>{const l=o.useRef(null),c=Io(l,i),u=qm(n),d=Km(r);return o.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:a});r.call(e,n),e.dispatchEvent(t)}},[u,n,a]),e.jsx(ps.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function oh(e){return e?"checked":"unchecked"}ah.displayName="RadioBubbleInput";var sh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ih="RadioGroup",[lh,ch]=ku(ih,[Lm,Xm]),uh=Lm(),dh=Xm(),[fh,mh]=lh(ih),hh=o.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:o,value:s,required:i=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=t,h=uh(n),p=jm(u),[g,y]=nd({prop:s,defaultProp:o??null,onChange:f,caller:ih});return e.jsx(fh,{scope:n,name:a,required:i,disabled:l,value:g,onValueChange:y,children:e.jsx(Hm,{asChild:!0,...h,orientation:c,dir:p,loop:d,children:e.jsx(ps.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:p,...m,ref:r})})})});hh.displayName=ih;var ph="RadioGroupItem",gh=o.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:a,...s}=t,i=mh(ph,n),l=i.disabled||a,c=uh(n),u=dh(n),d=o.useRef(null),f=Io(r,d),m=i.value===s.value,h=o.useRef(!1);return o.useEffect(()=>{const e=e=>{sh.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(Gm,{asChild:!0,...c,focusable:!l,active:m,children:e.jsx(th,{disabled:l,required:i.required,checked:m,...u,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:Xu(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Xu(s.onFocus,()=>{h.current&&d.current?.click()})})})});gh.displayName=ph;var yh=o.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,o=dh(n);return e.jsx(nh,{...o,...a,ref:r})});yh.displayName="RadioGroupIndicator";var vh=hh,bh=gh,wh=yh;const xh=o.forwardRef(({className:t,...r},n)=>e.jsx(vh,{className:Do("grid gap-2",t),...r,ref:n}));xh.displayName=vh.displayName;const Sh=o.forwardRef(({className:t,...r},n)=>e.jsx(bh,{ref:n,className:Do("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),...r,children:e.jsx(wh,{className:"flex items-center justify-center",children:e.jsx(hm,{className:"h-3.5 w-3.5 fill-primary"})})}));function kh(e,[t,r]){return Math.min(r,Math.max(t,e))}Sh.displayName=bh.displayName;var Th="ScrollArea",[Ah,Eh]=ku(Th),[Ch,Nh]=Ah(Th),jh=o.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:a="hover",dir:s,scrollHideDelay:i=600,...l}=t,[c,u]=o.useState(null),[d,f]=o.useState(null),[m,h]=o.useState(null),[p,g]=o.useState(null),[y,v]=o.useState(null),[b,w]=o.useState(0),[x,S]=o.useState(0),[k,T]=o.useState(!1),[A,E]=o.useState(!1),C=Io(r,e=>u(e)),N=jm(s);return e.jsx(Ch,{scope:n,type:a,dir:N,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:f,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:T,scrollbarY:y,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:E,onCornerWidthChange:w,onCornerHeightChange:S,children:e.jsx(ps.div,{dir:N,...l,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":x+"px",...t.style}})})});jh.displayName=Th;var _h="ScrollAreaViewport",Rh=o.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:a,nonce:s,...i}=t,l=Nh(_h,n),c=Io(r,o.useRef(null),l.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[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:s}),e.jsx(ps.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});Rh.displayName=_h;var Oh="ScrollAreaScrollbar",Dh=o.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=Nh(Oh,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,c="horizontal"===t.orientation;return o.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===s.type?e.jsx(Mh,{...a,ref:r,forceMount:n}):"scroll"===s.type?e.jsx(Ph,{...a,ref:r,forceMount:n}):"auto"===s.type?e.jsx(Ih,{...a,ref:r,forceMount:n}):"always"===s.type?e.jsx(Lh,{...a,ref:r}):null});Dh.displayName=Oh;var Mh=o.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=Nh(Oh,t.__scopeScrollArea),[i,l]=o.useState(!1);return o.useEffect(()=>{const e=s.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[s.scrollArea,s.scrollHideDelay]),e.jsx(kd,{present:n||i,children:e.jsx(Ih,{"data-state":i?"visible":"hidden",...a,ref:r})})}),Ph=o.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=Nh(Oh,t.__scopeScrollArea),i="horizontal"===t.orientation,l=rp(()=>u("SCROLL_END"),100),[c,u]=(d="hidden",f={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)=>f[e][t]??e,d));var d,f;return o.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,s.scrollHideDelay,u]),o.useEffect(()=>{const e=s.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[s.viewport,i,u,l]),e.jsx(kd,{present:n||"hidden"!==c,children:e.jsx(Lh,{"data-state":"hidden"===c?"hidden":"visible",...a,ref:r,onPointerEnter:Xu(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Xu(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Ih=o.forwardRef((t,r)=>{const n=Nh(Oh,t.__scopeScrollArea),{forceMount:a,...s}=t,[i,l]=o.useState(!1),c="horizontal"===t.orientation,u=rp(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return np(n.viewport,u),np(n.content,u),e.jsx(kd,{present:a||i,children:e.jsx(Lh,{"data-state":i?"visible":"hidden",...s,ref:r})})}),Lh=o.forwardRef((t,r)=>{const{orientation:n="vertical",...a}=t,s=Nh(Oh,t.__scopeScrollArea),i=o.useRef(null),l=o.useRef(0),[c,u]=o.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Jh(c.viewport,c.content),f={...a,sizes:c,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=Yh(r),o=a/2,s=t||o,i=a-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-i,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return Qh([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===n?e.jsx(Fh,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=Xh(s.viewport.scrollLeft,c,s.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=m(e,s.dir))}}):"vertical"===n?e.jsx(zh,{...f,ref:r,onThumbPositionChange:()=>{if(s.viewport&&i.current){const e=Xh(s.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=m(e))}}):null}),Fh=o.forwardRef((t,r)=>{const{sizes:n,onSizesChange:a,...s}=t,i=Nh(Oh,t.__scopeScrollArea),[l,c]=o.useState(),u=o.useRef(null),d=Io(r,u,i.onScrollbarXChange);return o.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e.jsx($h,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Yh(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),ep(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&a({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:qh(l.paddingLeft),paddingEnd:qh(l.paddingRight)}})}})}),zh=o.forwardRef((t,r)=>{const{sizes:n,onSizesChange:a,...s}=t,i=Nh(Oh,t.__scopeScrollArea),[l,c]=o.useState(),u=o.useRef(null),d=Io(r,u,i.onScrollbarYChange);return o.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),e.jsx($h,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Yh(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(i.viewport){const n=i.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),ep(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&a({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:qh(l.paddingTop),paddingEnd:qh(l.paddingBottom)}})}})}),[Uh,Vh]=Ah(Oh),$h=o.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:m,...h}=t,p=Nh(Oh,n),[g,y]=o.useState(null),v=Io(r,e=>y(e)),b=o.useRef(null),w=o.useRef(""),x=p.viewport,S=a.content-a.viewport,k=Au(f),T=Au(u),A=rp(m,10);function E(e){if(b.current){const t=e.clientX-b.current.left,r=e.clientY-b.current.top;d({x:t,y:r})}}return o.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,g,S,k]),o.useEffect(T,[a,T]),np(g,A),np(p.content,A),e.jsx(Uh,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:Au(i),onThumbPointerUp:Au(l),onThumbPositionChange:T,onThumbPointerDown:Au(c),children:e.jsx(ps.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Xu(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),b.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),E(e)}}),onPointerMove:Xu(t.onPointerMove,E),onPointerUp:Xu(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Wh="ScrollAreaThumb",Bh=o.forwardRef((t,r)=>{const{forceMount:n,...a}=t,o=Vh(Wh,t.__scopeScrollArea);return e.jsx(kd,{present:n||o.hasThumb,children:e.jsx(Zh,{ref:r,...a})})}),Zh=o.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:a,...s}=t,i=Nh(Wh,n),l=Vh(Wh,n),{onThumbPositionChange:c}=l,u=Io(r,e=>l.onThumbChange(e)),d=o.useRef(void 0),f=rp(()=>{d.current&&(d.current(),d.current=void 0)},100);return o.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(f(),!d.current){const t=tp(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,f,c]),e.jsx(ps.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Xu(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:Xu(t.onPointerUp,l.onThumbPointerUp)})});Bh.displayName=Wh;var Hh="ScrollAreaCorner",Gh=o.forwardRef((t,r)=>{const n=Nh(Hh,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(Kh,{...t,ref:r}):null});Gh.displayName=Hh;var Kh=o.forwardRef((t,r)=>{const{__scopeScrollArea:n,...a}=t,s=Nh(Hh,n),[i,l]=o.useState(0),[c,u]=o.useState(0),d=Boolean(i&&c);return np(s.scrollbarX,()=>{const e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),u(e)}),np(s.scrollbarY,()=>{const e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),l(e)}),d?e.jsx(ps.div,{...a,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...t.style}}):null});function qh(e){return e?parseInt(e,10):0}function Jh(e,t){const r=e/t;return isNaN(r)?0:r}function Yh(e){const t=Jh(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Xh(e,t,r="ltr"){const n=Yh(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,i=o-n,l=kh(e,"ltr"===r?[0,s]:[-1*s,0]);return Qh([0,s],[0,i])(l)}function Qh(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function ep(e,t){return e>0&&e<t}var tp=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,i=r.top!==o.top;(s||i)&&t(),r=o,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function rp(e,t){const r=Au(e),n=o.useRef(0);return o.useEffect(()=>()=>window.clearTimeout(n.current),[]),o.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function np(e,t){const r=Au(t);Cu(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var ap=jh,op=Rh,sp=Gh;const ip=o.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(ap,{ref:a,className:Do("relative overflow-hidden",t),...n,children:[e.jsx(op,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(lp,{}),e.jsx(sp,{})]}));ip.displayName=ap.displayName;const lp=o.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(Dh,{ref:a,orientation:r,className:Do("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",t),...n,children:e.jsx(Bh,{className:Do("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));lp.displayName=Dh.displayName;var cp="horizontal",up=["horizontal","vertical"],dp=o.forwardRef((t,r)=>{const{decorative:n,orientation:a=cp,...o}=t,s=function(e){return up.includes(e)}(a)?a:cp,i=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return e.jsx(ps.div,{"data-orientation":s,...i,...o,ref:r})});dp.displayName="Separator";var fp=dp;const mp=o.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},o)=>e.jsx(fp,{ref:o,decorative:n,orientation:r,className:Do("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));mp.displayName=fp.displayName;var hp="Switch",[pp,gp]=ku(hp),[yp,vp]=pp(hp),bp=o.forwardRef((t,r)=>{const{__scopeSwitch:n,name:a,checked:s,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:d,form:f,...m}=t,[h,p]=o.useState(null),g=Io(r,e=>p(e)),y=o.useRef(!1),v=!h||(f||!!h.closest("form")),[b,w]=nd({prop:s,defaultProp:i??!1,onChange:d,caller:hp});return e.jsxs(yp,{scope:n,checked:b,disabled:c,children:[e.jsx(ps.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":kp(b),"data-disabled":c?"":void 0,disabled:c,value:u,...m,ref:g,onClick:Xu(t.onClick,e=>{w(e=>!e),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),v&&e.jsx(Sp,{control:h,bubbles:!y.current,name:a,value:u,checked:b,required:l,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});bp.displayName=hp;var wp="SwitchThumb",xp=o.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,o=vp(wp,n);return e.jsx(ps.span,{"data-state":kp(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:r})});xp.displayName=wp;var Sp=o.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:a=!0,...s},i)=>{const l=o.useRef(null),c=Io(l,i),u=qm(n),d=Km(r);return o.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:a});r.call(e,n),e.dispatchEvent(t)}},[u,n,a]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:c,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function kp(e){return e?"checked":"unchecked"}Sp.displayName="SwitchBubbleInput";var Tp=bp,Ap=xp;const Ep=o.forwardRef(({className:t,...r},n)=>e.jsx(Tp,{className:Do("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),...r,ref:n,children:e.jsx(Ap,{className:Do("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")})}));Ep.displayName=Tp.displayName;const Cp=({workspaceId:r})=>{const[n,a]=t.useState({}),{allFeatures:o,updateFeature:s,getWorkspace:i}=cA(),[l,c]=t.useState(null),u=P(e=>e.auth.user);if(t.useEffect(()=>{i(r).then(c)},[r]),!l)return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(Rs,{className:"h-10 w-full"}),e.jsx(Rs,{className:"h-10 w-full"}),e.jsx(Rs,{className:"h-10 w-full"})]});const d=l?.users.find(e=>("string"==typeof e?e:e._id)===u?.id)?.role,f="admin"===d?.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."}),!o.length&&e.jsx("div",{className:"text-muted-foreground",children:"Workspace has no features to manage."}),o.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:o.map(t=>{const r=l?.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(Ep,{disabled:n[t.slug]||!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(!l)return;a(r=>({...r,[e]:t}));const r=await s(l._id,e,t);c(r),a(t=>({...t,[e]:!1}))}(t.slug,e)})]},t._id)})})]})})};function Np(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 jp=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],_p=({workspace:r})=>{const[n,a]=t.useState(!1),[o,s]=t.useState("emoji"),[i,l]=t.useState(),{updateWorkspace:c}=cA(),u=P(e=>e.auth.user),d=kt({resolver:ka(_i({name:ni().min(2,{message:"Workspace name must be at least 2 characters."}),image:ni().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx("div",{children:e.jsx("div",{className:"text-gray-500",children:"Loading workspace settings..."})});const f=r?.users.find(e=>("string"==typeof e?e:e._id)===u?.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(ws,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(async function(e){a(!0);try{await c(r,e)}catch(e){console.error("Failed to update workspace:",e)}finally{a(!1)}}),className:"space-y-6",children:[e.jsx(Ss,{control:d.control,name:"name",render:({field:t})=>e.jsxs(As,{children:[e.jsx(Es,{children:"Name"}),e.jsx(Cs,{children:e.jsx(_s,{placeholder:"My Awesome Workspace",...t,disabled:!m})}),e.jsx(js,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(bs,{className:"text-sm font-medium",children:"Icon"}),e.jsx(Ns,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(xh,{value:o,disabled:!m,onValueChange:e=>s(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Sh,{value:"emoji",id:"emoji"}),e.jsxs(bs,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(ls,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Sh,{value:"url",id:"url"}),e.jsxs(bs,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&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:[i&&e.jsx("span",{className:"text-2xl",children:i}),!i&&e.jsx("img",{src:d.watch("image")})]})]}),e.jsx(ip,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:jp.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{l(e),d.setValue("image",Np(e))})(t),disabled:!m,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(i===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ss,{control:d.control,name:"image",render:({field:t})=>e.jsxs(As,{children:[e.jsx(Es,{children:"Image URL"}),e.jsx(Cs,{children:e.jsx(_s,{placeholder:"https://example.com/image.png",...t,disabled:!m})}),e.jsx(Ns,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(js,{})]})}),d.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:d.watch("image"),className:"w-full h-full object-cover"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:m&&e.jsx(hs,{type:"submit",disabled:n,progress:n,children:"Update Workspace"})})]})})]})};var Rp=.999,Op=/[\\\/_+.#"@\[\(\{&]/,Dp=/[\\\/_+.#"@\[\(\{&]/g,Mp=/[\s-]/,Pp=/[\s-]/g;function Ip(e,t,r,n,a,o,s){if(o===t.length)return a===e.length?1:.99;var i=`${a},${o}`;if(void 0!==s[i])return s[i];for(var l,c,u,d,f=n.charAt(o),m=r.indexOf(f,a),h=0;m>=0;)(l=Ip(e,t,r,n,m+1,o+1,s))>h&&(m===a?l*=1:Op.test(e.charAt(m-1))?(l*=.8,(u=e.slice(a,m-1).match(Dp))&&a>0&&(l*=Math.pow(Rp,u.length))):Mp.test(e.charAt(m-1))?(l*=.9,(d=e.slice(a,m-1).match(Pp))&&a>0&&(l*=Math.pow(Rp,d.length))):(l*=.17,a>0&&(l*=Math.pow(Rp,m-a))),e.charAt(m)!==t.charAt(o)&&(l*=.9999)),(l<.1&&r.charAt(m-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(m-1)!==n.charAt(o))&&(.1*(c=Ip(e,t,r,n,m+1,o+2,s))>l&&(l=.1*c)),l>h&&(h=l),m=r.indexOf(f,m+1);return s[i]=h,h}function Lp(e){return e.toLowerCase().replace(Pp," ")}function Fp(e,t,r){return Ip(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Lp(e),Lp(t),0,0,{})}var zp='[cmdk-group=""]',Up='[cmdk-group-items=""]',Vp='[cmdk-item=""]',$p=`${Vp}:not([aria-disabled="true"])`,Wp="cmdk-item-select",Bp="data-value",Zp=(e,t,r)=>Fp(e,t,r),Hp=o.createContext(void 0),Gp=()=>o.useContext(Hp),Kp=o.createContext(void 0),qp=()=>o.useContext(Kp),Jp=o.createContext(void 0),Yp=o.forwardRef((e,t)=>{let r=dg(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=dg(()=>new Set),a=dg(()=>new Map),s=dg(()=>new Map),i=dg(()=>new Set),l=cg(e),{label:c,children:u,value:d,onValueChange:f,filter:m,shouldFilter:h,loop:p,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,b=td(),w=td(),x=td(),S=o.useRef(null),k=hg();ug(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,T.emit()}},[d]),ug(()=>{k(6,_)},[]);let T=o.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,s,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)j(),C(),k(1,N);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,T.emit()}),n||k(5,_),void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(i=(s=l.current).onValueChange)||i.call(s,e))}}T.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),A=o.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,E(t,n)),k(2,()=>{C(),T.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),k(3,()=>{j(),C(),r.current.value||N(),T.emit()}),()=>{s.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=R();k(4,()=>{j(),(null==t?void 0:t.getAttribute("id"))===e&&N(),T.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{s.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:x,labelId:w,listInnerRef:S}),[]);function E(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:Zp;return e?o(e,r.current.search,t):0}function C(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),o=0;n.forEach(t=>{let r=e.get(t);o=Math.max(r,o)}),t.push([r,o])});let n=S.current;O().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(Up);t?t.appendChild(e.parentElement===t?e:e.closest(`${Up} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Up} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${zp}[${Bp}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function N(){let e=O().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Bp);T.setState("value",t||void 0)}function j(){var e,t,o,i;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let a of n.current){let n=E(null!=(t=null==(e=s.current.get(a))?void 0:e.value)?t:"",null!=(i=null==(o=s.current.get(a))?void 0:o.keywords)?i:[]);r.current.filtered.items.set(a,n),n>0&&c++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function _(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(zp))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Vp}[aria-selected="true"]`)}function O(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll($p))||[])}function D(e){let t=O()[e];t&&T.setState("value",t.getAttribute(Bp))}function M(e){var t;let r=R(),n=O(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&T.setState("value",o.getAttribute(Bp))}function P(e){let t,r=R(),n=null==r?void 0:r.closest(zp);for(;n&&!t;)n=e>0?ig(n,zp):lg(n,zp),t=null==n?void 0:n.querySelector($p);t?T.setState("value",t.getAttribute(Bp)):M(e)}let I=()=>D(O().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?P(1):M(1)},F=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?P(-1):M(-1)};return o.createElement(ps.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":y&&e.ctrlKey&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":y&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(Wp);t.dispatchEvent(e)}}}}},o.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:gg},c),pg(e,e=>o.createElement(Kp.Provider,{value:T},o.createElement(Hp.Provider,{value:A},e))))}),Xp=o.forwardRef((e,t)=>{var r,n;let a=td(),s=o.useRef(null),i=o.useContext(Jp),l=Gp(),c=cg(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;ug(()=>{if(!u)return l.item(a,null==i?void 0:i.id)},[u]);let d=mg(a,s,[e.value,e.children,s],e.keywords),f=qp(),m=fg(e=>e.value&&e.value===d.current),h=fg(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(a)>0));function p(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){f.setState("value",d.current,!0)}if(o.useEffect(()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(Wp,p),()=>t.removeEventListener(Wp,p)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:y,value:v,onSelect:b,forceMount:w,keywords:x,...S}=e;return o.createElement(ps.div,{ref:Po(s,t),...S,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!m,"data-disabled":!!y,"data-selected":!!m,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:p},e.children)}),Qp=o.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...s}=e,i=td(),l=o.useRef(null),c=o.useRef(null),u=td(),d=Gp(),f=fg(e=>!(!a&&!1!==d.filter())||(!e.search||e.filtered.groups.has(i)));ug(()=>d.group(i),[]),mg(i,l,[e.value,e.heading,c]);let m=o.useMemo(()=>({id:i,forceMount:a}),[a]);return o.createElement(ps.div,{ref:Po(l,t),...s,"cmdk-group":"",role:"presentation",hidden:!f||void 0},r&&o.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),pg(e,e=>o.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},o.createElement(Jp.Provider,{value:m},e))))}),eg=o.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=o.useRef(null),s=fg(e=>!e.search);return r||s?o.createElement(ps.div,{ref:Po(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),tg=o.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,s=qp(),i=fg(e=>e.search),l=fg(e=>e.selectedItemId),c=Gp();return o.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),o.createElement(ps.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:i,onChange:e=>{a||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),rg=o.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,s=o.useRef(null),i=o.useRef(null),l=fg(e=>e.selectedItemId),c=Gp();return o.useEffect(()=>{if(i.current&&s.current){let e,t=i.current,r=s.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),o.createElement(ps.div,{ref:Po(s,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},pg(e,e=>o.createElement("div",{ref:Po(i,c.listInnerRef),"cmdk-list-sizer":""},e)))}),ng=o.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:s,container:i,...l}=e;return o.createElement(rm,{open:r,onOpenChange:n},o.createElement(am,{container:i},o.createElement(om,{"cmdk-overlay":"",className:a}),o.createElement(sm,{"aria-label":e.label,"cmdk-dialog":"",className:s},o.createElement(Yp,{ref:t,...l}))))}),ag=o.forwardRef((e,t)=>fg(e=>0===e.filtered.count)?o.createElement(ps.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),og=o.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...s}=e;return o.createElement(ps.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},pg(e,e=>o.createElement("div",{"aria-hidden":!0},e)))}),sg=Object.assign(Yp,{List:rg,Item:Xp,Input:tg,Group:Qp,Separator:eg,Dialog:ng,Empty:ag,Loading:og});function ig(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function lg(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function cg(e){let t=o.useRef(e);return ug(()=>{t.current=e}),t}var ug="undefined"==typeof window?o.useEffect:o.useLayoutEffect;function dg(e){let t=o.useRef();return void 0===t.current&&(t.current=e()),t}function fg(e){let t=qp(),r=()=>e(t.snapshot());return o.useSyncExternalStore(t.subscribe,r,r)}function mg(e,t,r,n=[]){let a=o.useRef(),s=Gp();return ug(()=>{var o;let i=(()=>{var e;for(let t of r){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}})(),l=n.map(e=>e.trim());s.value(e,i,l),null==(o=t.current)||o.setAttribute(Bp,i),a.current=i}),a}var hg=()=>{let[e,t]=o.useState(),r=dg(()=>new Map);return ug(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function pg({asChild:e,children:t},r){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},r(t.props.children)):r(t)}var gg={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const yg=o.forwardRef(({className:t,...r},n)=>e.jsx(sg,{ref:n,className:Do("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));yg.displayName=sg.displayName;const vg=o.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(vm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(sg.Input,{ref:n,className:Do("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),...r})]}));vg.displayName=sg.Input.displayName;const bg=o.forwardRef(({className:t,...r},n)=>e.jsx(sg.List,{ref:n,className:Do("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));bg.displayName=sg.List.displayName;o.forwardRef((t,r)=>e.jsx(sg.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=sg.Empty.displayName;const wg=o.forwardRef(({className:t,...r},n)=>e.jsx(sg.Group,{ref:n,className:Do("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),...r}));wg.displayName=sg.Group.displayName;o.forwardRef(({className:t,...r},n)=>e.jsx(sg.Separator,{ref:n,className:Do("-mx-1 h-px bg-border",t),...r})).displayName=sg.Separator.displayName;const xg=o.forwardRef(({className:t,...r},n)=>e.jsx(sg.Item,{ref:n,className:Do("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),...r}));xg.displayName=sg.Item.displayName;const Sg=["top","right","bottom","left"],kg=Math.min,Tg=Math.max,Ag=Math.round,Eg=Math.floor,Cg=e=>({x:e,y:e}),Ng={left:"right",right:"left",bottom:"top",top:"bottom"},jg={start:"end",end:"start"};function _g(e,t,r){return Tg(e,kg(t,r))}function Rg(e,t){return"function"==typeof e?e(t):e}function Og(e){return e.split("-")[0]}function Dg(e){return e.split("-")[1]}function Mg(e){return"x"===e?"y":"x"}function Pg(e){return"y"===e?"height":"width"}const Ig=new Set(["top","bottom"]);function Lg(e){return Ig.has(Og(e))?"y":"x"}function Fg(e){return Mg(Lg(e))}function zg(e){return e.replace(/start|end/g,e=>jg[e])}const Ug=["left","right"],Vg=["right","left"],$g=["top","bottom"],Wg=["bottom","top"];function Bg(e,t,r,n){const a=Dg(e);let o=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Vg:Ug:t?Ug:Vg;case"left":case"right":return t?$g:Wg;default:return[]}}(Og(e),"start"===r,n);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(zg)))),o}function Zg(e){return e.replace(/left|right|bottom|top/g,e=>Ng[e])}function Hg(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 Gg(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Kg(e,t,r){let{reference:n,floating:a}=e;const o=Lg(t),s=Fg(t),i=Pg(s),l=Og(t),c="y"===o,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,f=n[i]/2-a[i]/2;let m;switch(l){case"top":m={x:u,y:n.y-a.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-a.width,y:d};break;default:m={x:n.x,y:n.y}}switch(Dg(t)){case"start":m[s]-=f*(r&&c?-1:1);break;case"end":m[s]+=f*(r&&c?-1:1)}return m}async function qg(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:o,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=Rg(t,e),h=Hg(m),p=i[f?"floating"===d?"reference":"floating":d],g=Gg(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(p)))||r?p:p.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(i.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(i.floating)),b=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},w=Gg(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function Jg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yg(e){return Sg.some(t=>e[t]>=0)}const Xg=new Set(["left","top"]);function Qg(){return"undefined"!=typeof window}function ey(e){return ny(e)?(e.nodeName||"").toLowerCase():"#document"}function ty(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ry(e){var t;return null==(t=(ny(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ny(e){return!!Qg()&&(e instanceof Node||e instanceof ty(e).Node)}function ay(e){return!!Qg()&&(e instanceof Element||e instanceof ty(e).Element)}function oy(e){return!!Qg()&&(e instanceof HTMLElement||e instanceof ty(e).HTMLElement)}function sy(e){return!(!Qg()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ty(e).ShadowRoot)}const iy=new Set(["inline","contents"]);function ly(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=wy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!iy.has(a)}const cy=new Set(["table","td","th"]);function uy(e){return cy.has(ey(e))}const dy=[":popover-open",":modal"];function fy(e){return dy.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const my=["transform","translate","scale","rotate","perspective"],hy=["transform","translate","scale","rotate","perspective","filter"],py=["paint","layout","strict","content"];function gy(e){const t=yy(),r=ay(e)?wy(e):e;return my.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||hy.some(e=>(r.willChange||"").includes(e))||py.some(e=>(r.contain||"").includes(e))}function yy(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const vy=new Set(["html","body","#document"]);function by(e){return vy.has(ey(e))}function wy(e){return ty(e).getComputedStyle(e)}function xy(e){return ay(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sy(e){if("html"===ey(e))return e;const t=e.assignedSlot||e.parentNode||sy(e)&&e.host||ry(e);return sy(t)?t.host:t}function ky(e){const t=Sy(e);return by(t)?e.ownerDocument?e.ownerDocument.body:e.body:oy(t)&&ly(t)?t:ky(t)}function Ty(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=ky(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),s=ty(a);if(o){const e=Ay(s);return t.concat(s,s.visualViewport||[],ly(a)?a:[],e&&r?Ty(e):[])}return t.concat(a,Ty(a,[],r))}function Ay(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ey(e){const t=wy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=oy(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:n,i=Ag(r)!==o||Ag(n)!==s;return i&&(r=o,n=s),{width:r,height:n,$:i}}function Cy(e){return ay(e)?e:e.contextElement}function Ny(e){const t=Cy(e);if(!oy(t))return Cg(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:o}=Ey(t);let s=(o?Ag(r.width):r.width)/n,i=(o?Ag(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),i&&Number.isFinite(i)||(i=1),{x:s,y:i}}const jy=Cg(0);function _y(e){const t=ty(e);return yy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:jy}function Ry(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),o=Cy(e);let s=Cg(1);t&&(n?ay(n)&&(s=Ny(n)):s=Ny(e));const i=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ty(e))&&t}(o,r,n)?_y(o):Cg(0);let l=(a.left+i.x)/s.x,c=(a.top+i.y)/s.y,u=a.width/s.x,d=a.height/s.y;if(o){const e=ty(o),t=n&&ay(n)?ty(n):n;let r=e,a=Ay(r);for(;a&&n&&t!==r;){const e=Ny(a),t=a.getBoundingClientRect(),n=wy(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=s,r=ty(a),a=Ay(r)}}return Gg({width:u,height:d,x:l,y:c})}function Oy(e,t){const r=xy(e).scrollLeft;return t?t.left+r:Ry(ry(e)).left+r}function Dy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Oy(e,r),y:r.top+t.scrollTop}}const My=new Set(["absolute","fixed"]);function Py(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=ty(e),n=ry(e),a=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,i=0,l=0;if(a){o=a.width,s=a.height;const e=yy();(!e||e&&"fixed"===t)&&(i=a.offsetLeft,l=a.offsetTop)}const c=Oy(n);if(c<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else c<=25&&(o+=c);return{width:o,height:s,x:i,y:l}}(e,r);else if("document"===t)n=function(e){const t=ry(e),r=xy(e),n=e.ownerDocument.body,a=Tg(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Tg(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Oy(e);const i=-r.scrollTop;return"rtl"===wy(n).direction&&(s+=Tg(t.clientWidth,n.clientWidth)-a),{width:a,height:o,x:s,y:i}}(ry(e));else if(ay(t))n=function(e,t){const r=Ry(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,o=oy(e)?Ny(e):Cg(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:n*o.y}}(t,r);else{const r=_y(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Gg(n)}function Iy(e,t){const r=Sy(e);return!(r===t||!ay(r)||by(r))&&("fixed"===wy(r).position||Iy(r,t))}function Ly(e,t,r){const n=oy(t),a=ry(t),o="fixed"===r,s=Ry(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const l=Cg(0);function c(){l.x=Oy(a)}if(n||!n&&!o)if(("body"!==ey(t)||ly(a))&&(i=xy(t)),n){const e=Ry(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!n&&a&&c();const u=!a||n||o?Cg(0):Dy(a,i);return{x:s.left+i.scrollLeft-l.x-u.x,y:s.top+i.scrollTop-l.y-u.y,width:s.width,height:s.height}}function Fy(e){return"static"===wy(e).position}function zy(e,t){if(!oy(e)||"fixed"===wy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return ry(e)===r&&(r=r.ownerDocument.body),r}function Uy(e,t){const r=ty(e);if(fy(e))return r;if(!oy(e)){let t=Sy(e);for(;t&&!by(t);){if(ay(t)&&!Fy(t))return t;t=Sy(t)}return r}let n=zy(e,t);for(;n&&uy(n)&&Fy(n);)n=zy(n,t);return n&&by(n)&&Fy(n)&&!gy(n)?r:n||function(e){let t=Sy(e);for(;oy(t)&&!by(t);){if(gy(t))return t;if(fy(t))return null;t=Sy(t)}return null}(e)||r}const Vy={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const o="fixed"===a,s=ry(n),i=!!t&&fy(t.floating);if(n===s||i&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Cg(1);const u=Cg(0),d=oy(n);if((d||!d&&!o)&&(("body"!==ey(n)||ly(s))&&(l=xy(n)),oy(n))){const e=Ry(n);c=Ny(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const f=!s||d||o?Cg(0):Dy(s,l);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:ry,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o="clippingAncestors"===r?fy(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Ty(e,[],!1).filter(e=>ay(e)&&"body"!==ey(e)),a=null;const o="fixed"===wy(e).position;let s=o?Sy(e):e;for(;ay(s)&&!by(s);){const t=wy(s),r=gy(s);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&a&&My.has(a.position)||ly(s)&&!r&&Iy(e,s))?n=n.filter(e=>e!==s):a=t,s=Sy(s)}return t.set(e,n),n}(t,this._c):[].concat(r),s=[...o,n],i=s[0],l=s.reduce((e,r)=>{const n=Py(t,r,a);return e.top=Tg(n.top,e.top),e.right=kg(n.right,e.right),e.bottom=kg(n.bottom,e.bottom),e.left=Tg(n.left,e.left),e},Py(t,i,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Uy,getElementRects:async function(e){const t=this.getOffsetParent||Uy,r=this.getDimensions,n=await r(e.floating);return{reference:Ly(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ey(e);return{width:t,height:r}},getScale:Ny,isElement:ay,isRTL:function(e){return"rtl"===wy(e).direction}};function $y(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wy(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Cy(e),u=a||o?[...c?Ty(c):[],...Ty(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const d=c&&i?function(e,t){let r,n=null;const a=ry(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(i,l){void 0===i&&(i=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(i||t(),!f||!m)return;const h={rootMargin:-Eg(d)+"px "+-Eg(a.clientWidth-(u+f))+"px "+-Eg(a.clientHeight-(d+m))+"px "+-Eg(u)+"px",threshold:Tg(0,kg(1,l))||1};let p=!0;function g(t){const n=t[0].intersectionRatio;if(n!==l){if(!p)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||$y(c,e.getBoundingClientRect())||s(),p=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),o}(c,r):null;let f,m=-1,h=null;s&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let p=l?Ry(e):null;return l&&function t(){const n=Ry(e);p&&!$y(p,n)&&r();p=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const By=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:o,placement:s,middlewareData:i}=t,l=await async function(e,t){const{placement:r,platform:n,elements:a}=e,o=await(null==n.isRTL?void 0:n.isRTL(a.floating)),s=Og(r),i=Dg(r),l="y"===Lg(r),c=Xg.has(s)?-1:1,u=o&&l?-1:1,d=Rg(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&"number"==typeof h&&(m="end"===i?-1*h:h),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return s===(null==(r=i.offset)?void 0:r.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:s}}}}},Zy=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:i={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Rg(e,t),c={x:r,y:n},u=await qg(t,l),d=Lg(Og(a)),f=Mg(d);let m=c[f],h=c[d];if(o){const e="y"===f?"bottom":"right";m=_g(m+u["y"===f?"top":"left"],m,m-u[e])}if(s){const e="y"===d?"bottom":"right";h=_g(h+u["y"===d?"top":"left"],h,h-u[e])}const p=i.fn({...t,[f]:m,[d]:h});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[f]:o,[d]:s}}}}}},Hy=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...g}=Rg(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const y=Og(a),v=Lg(i),b=Og(i)===i,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!p?[Zg(i)]:function(e){const t=Zg(e);return[zg(e),t,zg(t)]}(i)),S="none"!==h;!f&&S&&x.push(...Bg(i,p,h,w));const k=[i,...x],T=await qg(t,g),A=[];let E=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&A.push(T[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Dg(e),a=Fg(e),o=Pg(a);let s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Zg(s)),[s,Zg(s)]}(a,s,w);A.push(T[e[0]],T[e[1]])}if(E=[...E,{placement:a,overflows:A}],!A.every(e=>e<=0)){var C,N;const e=((null==(C=o.flip)?void 0:C.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==Lg(t))||E.every(e=>Lg(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:E},reset:{placement:t}}}let r=null==(N=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!r)switch(m){case"bestFit":{var j;const e=null==(j=E.filter(e=>{if(S){const t=Lg(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:j[0];e&&(r=e);break}case"initialPlacement":r=i}if(a!==r)return{reset:{placement:r}}}return{}}}},Gy=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:o,platform:s,elements:i}=t,{apply:l=()=>{},...c}=Rg(e,t),u=await qg(t,c),d=Og(a),f=Dg(a),m="y"===Lg(a),{width:h,height:p}=o.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==s.isRTL?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=p-u.top-u.bottom,b=h-u.left-u.right,w=kg(p-u[g],v),x=kg(h-u[y],b),S=!t.middlewareData.shift;let k=w,T=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(T=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!f){const e=Tg(u.left,0),t=Tg(u.right,0),r=Tg(u.top,0),n=Tg(u.bottom,0);m?T=h-2*(0!==e||0!==t?e+t:Tg(u.left,u.right)):k=p-2*(0!==r||0!==n?r+n:Tg(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:k});const A=await s.getDimensions(i.floating);return h!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}},Ky=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Rg(e,t);switch(n){case"referenceHidden":{const e=Jg(await qg(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yg(e)}}}case"escaped":{const e=Jg(await qg(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Yg(e)}}}default:return{}}}}},qy=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:o,platform:s,elements:i,middlewareData:l}=t,{element:c,padding:u=0}=Rg(e,t)||{};if(null==c)return{};const d=Hg(u),f={x:r,y:n},m=Fg(a),h=Pg(m),p=await s.getDimensions(c),g="y"===m,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[m]-f[m]-o.floating[h],x=f[m]-o.reference[m],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=S?S[b]:0;k&&await(null==s.isElement?void 0:s.isElement(S))||(k=i.floating[b]||o.floating[h]);const T=w/2-x/2,A=k/2-p[h]/2-1,E=kg(d[y],A),C=kg(d[v],A),N=E,j=k-p[h]-C,_=k/2-p[h]/2+T,R=_g(N,_,j),O=!l.arrow&&null!=Dg(a)&&_!==R&&o.reference[h]/2-(_<N?E:C)-p[h]/2<0,D=O?_<N?_-N:_-j:0;return{[m]:f[m]+D,data:{[m]:R,centerOffset:_-R-D,...O&&{alignmentOffset:D}},reset:O}}}),Jy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:o,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=Rg(e,t),u={x:r,y:n},d=Lg(a),f=Mg(d);let m=u[f],h=u[d];const p=Rg(i,t),g="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const e="y"===f?"height":"width",t=o.reference[f]-o.floating[e]+g.mainAxis,r=o.reference[f]+o.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(c){var y,v;const e="y"===f?"width":"height",t=Xg.has(Og(a)),r=o.reference[d]-o.floating[e]+(t&&(null==(y=s.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),n=o.reference[d]+o.reference[e]+(t?0:(null==(v=s.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[f]:m,[d]:h}}}},Yy=(e,t,r)=>{const n=new Map,a={platform:Vy,...r},o={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:s}=r,i=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=Kg(c,n,l),f=n,m={},h=0;for(let r=0;r<i.length;r++){const{name:o,fn:p}=i[r],{x:g,y:y,data:v,reset:b}=await p({x:u,y:d,initialPlacement:n,placement:f,strategy:a,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,m={...m,[o]:{...m[o],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):b.rects),({x:u,y:d}=Kg(c,f,l))),r=-1)}return{x:u,y:d,placement:f,strategy:a,middlewareData:m}})(e,t,{...a,platform:o})};var Xy="undefined"!=typeof document?t.useLayoutEffect:function(){};function Qy(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 r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Qy(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Qy(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function ev(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tv(e,t){const r=ev(e);return Math.round(t*r)/r}function rv(e){const t=o.useRef(e);return Xy(()=>{t.current=e}),t}const nv=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?qy({element:r.current,padding:n}).fn(t):{}:r?qy({element:r,padding:n}).fn(t):{};var a}}),av=(e,t)=>({...By(e),options:[e,t]}),ov=(e,t)=>({...Zy(e),options:[e,t]}),sv=(e,t)=>({...Jy(e),options:[e,t]}),iv=(e,t)=>({...Hy(e),options:[e,t]}),lv=(e,t)=>({...Gy(e),options:[e,t]}),cv=(e,t)=>({...Ky(e),options:[e,t]}),uv=(e,t)=>({...nv(e),options:[e,t]});var dv=o.forwardRef((t,r)=>{const{children:n,width:a=10,height:o=5,...s}=t;return e.jsx(ps.svg,{...s,ref:r,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});dv.displayName="Arrow";var fv=dv,mv="Popper",[hv,pv]=ku(mv),[gv,yv]=hv(mv),vv=t=>{const{__scopePopper:r,children:n}=t,[a,s]=o.useState(null);return e.jsx(gv,{scope:r,anchor:a,onAnchorChange:s,children:n})};vv.displayName=mv;var bv="PopperAnchor",wv=o.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:a,...s}=t,i=yv(bv,n),l=o.useRef(null),c=Io(r,l),u=o.useRef(null);return o.useEffect(()=>{const e=u.current;u.current=a?.current||l.current,e!==u.current&&i.onAnchorChange(u.current)}),a?null:e.jsx(ps.div,{...s,ref:c})});wv.displayName=bv;var xv="PopperContent",[Sv,kv]=hv(xv),Tv=o.forwardRef((t,r)=>{const{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=yv(xv,n),[w,x]=o.useState(null),S=Io(r,e=>x(e)),[k,T]=o.useState(null),A=Km(k),E=A?.width??0,C=A?.height??0,N=a+("center"!==l?"-"+l:""),j="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},_=Array.isArray(f)?f:[f],R=_.length>0,O={padding:j,boundary:_.filter(Nv),altBoundary:R},{refs:D,floatingStyles:M,placement:P,isPositioned:I,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,m]=o.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(n);Qy(h,n)||p(n);const[g,y]=o.useState(null),[v,b]=o.useState(null),w=o.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),x=o.useCallback(e=>{e!==A.current&&(A.current=e,b(e))},[]),S=i||g,k=l||v,T=o.useRef(null),A=o.useRef(null),E=o.useRef(f),C=null!=u,N=rv(u),j=rv(a),_=rv(d),R=o.useCallback(()=>{if(!T.current||!A.current)return;const e={placement:t,strategy:r,middleware:h};j.current&&(e.platform=j.current),Yy(T.current,A.current,e).then(e=>{const t={...e,isPositioned:!1!==_.current};O.current&&!Qy(E.current,t)&&(E.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,j,_]);Xy(()=>{!1===d&&E.current.isPositioned&&(E.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const O=o.useRef(!1);Xy(()=>(O.current=!0,()=>{O.current=!1}),[]),Xy(()=>{if(S&&(T.current=S),k&&(A.current=k),S&&k){if(N.current)return N.current(S,k,R);R()}},[S,k,R,N,C]);const D=o.useMemo(()=>({reference:T,floating:A,setReference:w,setFloating:x}),[w,x]),M=o.useMemo(()=>({reference:S,floating:k}),[S,k]),P=o.useMemo(()=>{const e={position:r,left:0,top:0};if(!M.floating)return e;const t=tv(M.floating,f.x),n=tv(M.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ev(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,M.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:R,refs:D,elements:M,floatingStyles:P}),[f,R,D,M,P])}({strategy:"fixed",placement:N,whileElementsMounted:(...e)=>Wy(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[av({mainAxis:i+C,alignmentAxis:c}),d&&ov({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?sv():void 0,...O}),d&&iv({...O}),lv({...O,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),k&&uv({element:k,padding:u}),jv({arrowWidth:E,arrowHeight:C}),p&&cv({strategy:"referenceHidden",...O})]}),[F,z]=_v(P),U=Au(y);Cu(()=>{I&&U?.()},[I,U]);const V=L.arrow?.x,$=L.arrow?.y,W=0!==L.arrow?.centerOffset,[B,Z]=o.useState();return Cu(()=>{w&&Z(window.getComputedStyle(w).zIndex)},[w]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:I?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Sv,{scope:n,placedSide:F,onArrowChange:T,arrowX:V,arrowY:$,shouldHideArrow:W,children:e.jsx(ps.div,{"data-side":F,"data-align":z,...v,ref:S,style:{...v.style,animation:I?void 0:"none"}})})})});Tv.displayName=xv;var Av="PopperArrow",Ev={top:"bottom",right:"left",bottom:"top",left:"right"},Cv=o.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,o=kv(Av,n),s=Ev[o.placedSide];return e.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:e.jsx(fv,{...a,ref:r,style:{...a.style,display:"block"}})})});function Nv(e){return null!==e}Cv.displayName=Av;var jv=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=0!==a.arrow?.centerOffset,s=o?0:e.arrowWidth,i=o?0:e.arrowHeight,[l,c]=_v(r),u={start:"0%",center:"50%",end:"100%"}[c],d=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+i/2;let m="",h="";return"bottom"===l?(m=o?u:`${d}px`,h=-i+"px"):"top"===l?(m=o?u:`${d}px`,h=`${n.floating.height+i}px`):"right"===l?(m=-i+"px",h=o?u:`${f}px`):"left"===l&&(m=`${n.floating.width+i}px`,h=o?u:`${f}px`),{data:{x:m,y:h}}}});function _v(e){const[t,r="center"]=e.split("-");return[t,r]}var Rv=vv,Ov=wv,Dv=Tv,Mv=Cv,Pv="Popover",[Iv,Lv]=ku(Pv,[pv]),Fv=pv(),[zv,Uv]=Iv(Pv),Vv=t=>{const{__scopePopover:r,children:n,open:a,defaultOpen:s,onOpenChange:i,modal:l=!1}=t,c=Fv(r),u=o.useRef(null),[d,f]=o.useState(!1),[m,h]=nd({prop:a,defaultProp:s??!1,onChange:i,caller:Pv});return e.jsx(Rv,{...c,children:e.jsx(zv,{scope:r,contentId:td(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:o.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:o.useCallback(()=>f(!0),[]),onCustomAnchorRemove:o.useCallback(()=>f(!1),[]),modal:l,children:n})})};Vv.displayName=Pv;var $v="PopoverAnchor";o.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Uv($v,n),i=Fv(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return o.useEffect(()=>(l(),()=>c()),[l,c]),e.jsx(Ov,{...i,...a,ref:r})}).displayName=$v;var Wv="PopoverTrigger",Bv=o.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Uv(Wv,n),s=Fv(n),i=Io(r,o.triggerRef),l=e.jsx(ps.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rb(o.open),...a,ref:i,onClick:Xu(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:e.jsx(Ov,{asChild:!0,...s,children:l})});Bv.displayName=Wv;var Zv="PopoverPortal",[Hv,Gv]=Iv(Zv,{forceMount:void 0}),Kv=t=>{const{__scopePopover:r,forceMount:n,children:a,container:o}=t,s=Uv(Zv,r);return e.jsx(Hv,{scope:r,forceMount:n,children:e.jsx(kd,{present:n||s.open,children:e.jsx(Sd,{asChild:!0,container:o,children:a})})})};Kv.displayName=Zv;var qv="PopoverContent",Jv=o.forwardRef((t,r)=>{const n=Gv(qv,t.__scopePopover),{forceMount:a=n.forceMount,...o}=t,s=Uv(qv,t.__scopePopover);return e.jsx(kd,{present:a||s.open,children:s.modal?e.jsx(Xv,{...o,ref:r}):e.jsx(Qv,{...o,ref:r})})});Jv.displayName=qv;var Yv=Lo("PopoverContent.RemoveScroll"),Xv=o.forwardRef((t,r)=>{const n=Uv(qv,t.__scopePopover),a=o.useRef(null),s=Io(r,a),i=o.useRef(!1);return o.useEffect(()=>{const e=a.current;if(e)return Sf(e)},[]),e.jsx(pf,{as:Yv,allowPinchZoom:!0,children:e.jsx(eb,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xu(t.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Xu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Xu(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qv=o.forwardRef((t,r)=>{const n=Uv(qv,t.__scopePopover),a=o.useRef(!1),s=o.useRef(!1);return e.jsx(eb,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(a.current||n.triggerRef.current?.focus(),e.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(a.current=!0,"pointerdown"===e.detail.originalEvent.type&&(s.current=!0));const r=e.target,o=n.triggerRef.current?.contains(r);o&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&s.current&&e.preventDefault()}})}),eb=o.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=t,m=Uv(qv,n),h=Fv(n);return Ed(),e.jsx(pd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:e.jsx(cd,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Dv,{"data-state":rb(m.open),role:"dialog",id:m.contentId,...h,...f,ref:r,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)"}})})})}),tb="PopoverClose";o.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Uv(tb,n);return e.jsx(ps.button,{type:"button",...a,ref:r,onClick:Xu(t.onClick,()=>o.onOpenChange(!1))})}).displayName=tb;function rb(e){return e?"open":"closed"}o.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,o=Fv(n);return e.jsx(Mv,{...o,...a,ref:r})}).displayName="PopoverArrow";var nb=Kv,ab=Jv;const ob=Vv,sb=Bv,ib=o.forwardRef(({className:t,align:r="center",sideOffset:n=4,...a},s)=>{const{container:i}=o.useContext(J);return e.jsx(nb,{container:i,children:e.jsx(ab,{ref:s,align:r,sideOffset:n,className:Do("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})})});ib.displayName=ab.displayName;const lb={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"},cb={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"},ub=[{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=cb[e.code]||"USD",r=lb[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function db(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=ub.find(e=>e.value==n);return e.jsxs(ob,{open:o,onOpenChange:s,children:[e.jsx(sb,{asChild:!0,children:e.jsxs(hs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text&&e.jsxs("div",{children:[String(i.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.flag})]}),!i&&e.jsx("span",{className:"text-muted-foreground",children:"Choose country"}),e.jsx(es,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(ib,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(yg,{children:[e.jsx(vg,{placeholder:"Choose country..."}),e.jsx(bg,{children:e.jsx(wg,{children:ub.map(t=>e.jsxs(xg,{className:Do("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(Qo,{className:Do("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const fb=ub.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),mb=Array.from(new Set(fb.map(e=>e.value))).map(e=>fb.find(t=>t.value===e)).filter(e=>void 0!==e);function hb(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=mb.find(e=>e.value==n);return e.jsxs(ob,{open:o,onOpenChange:s,children:[e.jsx(sb,{asChild:!0,children:e.jsxs(hs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text&&e.jsxs("div",{children:[String(i.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.icon})]}),!i&&e.jsx("span",{className:"text-muted-foreground",children:"Choose Currency"}),e.jsx(es,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(ib,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(yg,{children:[e.jsx(vg,{placeholder:"Choose currency..."}),e.jsx(bg,{children:e.jsx(wg,{children:mb.map(t=>e.jsxs(xg,{className:Do("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(Qo,{className:Do("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}class pb extends Error{}class gb extends pb{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class yb extends pb{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class vb extends pb{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class bb extends pb{}class wb extends pb{constructor(e){super(`Invalid unit ${e}`)}}class xb extends pb{}class Sb extends pb{constructor(){super("Zone is an abstract class")}}const kb="numeric",Tb="short",Ab="long",Eb={year:kb,month:kb,day:kb},Cb={year:kb,month:Tb,day:kb},Nb={year:kb,month:Tb,day:kb,weekday:Tb},jb={year:kb,month:Ab,day:kb},_b={year:kb,month:Ab,day:kb,weekday:Ab},Rb={hour:kb,minute:kb},Ob={hour:kb,minute:kb,second:kb},Db={hour:kb,minute:kb,second:kb,timeZoneName:Tb},Mb={hour:kb,minute:kb,second:kb,timeZoneName:Ab},Pb={hour:kb,minute:kb,hourCycle:"h23"},Ib={hour:kb,minute:kb,second:kb,hourCycle:"h23"},Lb={hour:kb,minute:kb,second:kb,hourCycle:"h23",timeZoneName:Tb},Fb={hour:kb,minute:kb,second:kb,hourCycle:"h23",timeZoneName:Ab},zb={year:kb,month:kb,day:kb,hour:kb,minute:kb},Ub={year:kb,month:kb,day:kb,hour:kb,minute:kb,second:kb},Vb={year:kb,month:Tb,day:kb,hour:kb,minute:kb},$b={year:kb,month:Tb,day:kb,hour:kb,minute:kb,second:kb},Wb={year:kb,month:Tb,day:kb,weekday:Tb,hour:kb,minute:kb},Bb={year:kb,month:Ab,day:kb,hour:kb,minute:kb,timeZoneName:Tb},Zb={year:kb,month:Ab,day:kb,hour:kb,minute:kb,second:kb,timeZoneName:Tb},Hb={year:kb,month:Ab,day:kb,weekday:Ab,hour:kb,minute:kb,timeZoneName:Ab},Gb={year:kb,month:Ab,day:kb,weekday:Ab,hour:kb,minute:kb,second:kb,timeZoneName:Ab};class Kb{get type(){throw new Sb}get name(){throw new Sb}get ianaName(){return this.name}get isUniversal(){throw new Sb}offsetName(e,t){throw new Sb}formatOffset(e,t){throw new Sb}offset(e){throw new Sb}equals(e){throw new Sb}get isValid(){throw new Sb}}let qb=null;class Jb extends Kb{static get instance(){return null===qb&&(qb=new Jb),qb}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return gx(e,t,r)}formatOffset(e,t){return wx(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const Yb=new Map;const Xb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const Qb=new Map;class ew extends Kb{static create(e){let t=Qb.get(e);return void 0===t&&Qb.set(e,t=new ew(e)),t}static resetCache(){Qb.clear(),Yb.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=ew.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return gx(e,t,r,this.name)}formatOffset(e,t){return wx(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=Yb.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Yb.set(e,t)),t}(this.name);let[n,a,o,s,i,l,c]=r.formatToParts?function(e,t){const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const{type:t,value:a}=r[e],o=Xb[t];"era"===t?n[o]=a:qw(o)||(n[o]=parseInt(a,10))}return n}(r,t):function(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,a,o,s,i,l,c,u]=n;return[s,a,o,i,l,c,u]}(r,t);"BC"===s&&(n=1-Math.abs(n));let u=+t;const d=u%1e3;return u-=d>=0?d:1e3+d,(fx({year:n,month:a,day:o,hour:24===i?0:i,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let tw={};const rw=new Map;function nw(e,t={}){const r=JSON.stringify([e,t]);let n=rw.get(r);return void 0===n&&(n=new Intl.DateTimeFormat(e,t),rw.set(r,n)),n}const aw=new Map;const ow=new Map;let sw=null;const iw=new Map;function lw(e){let t=iw.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),iw.set(e,t)),t}const cw=new Map;function uw(e,t,r,n){const a=e.listingMode();return"error"===a?null:"en"===a?r(t):n(t)}class dw{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:a,...o}=r;if(!t||Object.keys(o).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let n=aw.get(r);return void 0===n&&(n=new Intl.NumberFormat(e,t),aw.set(r,n)),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return ax(this.floor?Math.floor(e):lx(e,3),this.padTo)}}class fw{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&ew.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const a={...this.opts};a.timeZone=a.timeZone||n,this.dtf=nw(t,a)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class mw{constructor(e,t,r){this.opts={style:"long",...r},!t&&Xw()&&(this.rtf=function(e,t={}){const{base:r,...n}=t,a=JSON.stringify([e,n]);let o=ow.get(a);return void 0===o&&(o=new Intl.RelativeTimeFormat(e,t),ow.set(a,o)),o}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&o){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${a[e][0]}`;case-1:return r?"yesterday":`last ${a[e][0]}`;case 0:return r?"today":`this ${a[e][0]}`}}const s=Object.is(t,-0)||t<0,i=Math.abs(t),l=1===i,c=a[e],u=n?l?c[1]:c[2]||c[1]:l?a[e][0]:e;return s?`${i} ${u} ago`:`in ${i} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const hw={firstDay:1,minimalDays:4,weekend:[6,7]};class pw{static fromOpts(e){return pw.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,a=!1){const o=e||Dw.defaultLocale,s=o||(a?"en-US":sw||(sw=(new Intl.DateTimeFormat).resolvedOptions().locale,sw)),i=t||Dw.defaultNumberingSystem,l=r||Dw.defaultOutputCalendar,c=rx(n)||Dw.defaultWeekSettings;return new pw(s,i,l,c,o)}static resetCache(){sw=null,rw.clear(),aw.clear(),ow.clear(),iw.clear(),cw.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return pw.create(e,t,r,n)}constructor(e,t,r,n,a){const[o,s,i]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=nw(e).resolvedOptions(),n=e}catch(a){const o=e.substring(0,r);t=nw(o).resolvedOptions(),n=o}const{numberingSystem:a,calendar:o}=t;return[n,a,o]}}(e);this.locale=o,this.numberingSystem=t||s||null,this.outputCalendar=r||i||null,this.weekSettings=n,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===lw(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?pw.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,rx(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return uw(this,e,Ax,()=>{const r="ja"===this.intl||this.intl.startsWith("ja-"),n=(t&=!r)?{month:e,day:"numeric"}:{month:e},a=t?"format":"standalone";if(!this.monthsCache[a][e]){const t=r?e=>this.dtFormatter(e,n).format():e=>this.extract(e,n,"month");this.monthsCache[a][e]=function(e){const t=[];for(let r=1;r<=12;r++){const n=_k.utc(2009,r,1);t.push(e(n))}return t}(t)}return this.monthsCache[a][e]})}weekdays(e,t=!1){return uw(this,e,jx,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let r=1;r<=7;r++){const n=_k.utc(2016,11,13+r);t.push(e(n))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return uw(this,void 0,()=>_x,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[_k.utc(2016,11,13,9),_k.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return uw(this,e,Mx,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[_k.utc(-40,1,1),_k.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){const n=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return n?n.value:null}numberFormatter(e={}){return new dw(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new fw(e,this.intl,t)}relFormatter(e={}){return new mw(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let n=tw[r];return n||(n=new Intl.ListFormat(e,t),tw[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||lw(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Qw()?function(e){let t=cw.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...hw,...t}),cw.set(e,t)}return t}(this.locale):hw}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let gw=null;class yw extends Kb{static get utcInstance(){return null===gw&&(gw=new yw(0)),gw}static instance(e){return 0===e?yw.utcInstance:new yw(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new yw(yx(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${wx(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${wx(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return wx(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class vw extends Kb{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function bw(e,t){if(qw(e)||null===e)return t;if(e instanceof Kb)return e;if(function(e){return"string"==typeof e}(e)){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?Jb.instance:"utc"===r||"gmt"===r?yw.utcInstance:yw.parseSpecifier(r)||ew.create(e)}return Jw(e)?yw.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new vw(e)}const ww={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},xw={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Sw=ww.hanidec.replace(/[\[|\]]/g,"").split("");const kw=new Map;function Tw({numberingSystem:e},t=""){const r=e||"latn";let n=kw.get(r);void 0===n&&(n=new Map,kw.set(r,n));let a=n.get(t);return void 0===a&&(a=new RegExp(`${ww[r]}${t}`),n.set(t,a)),a}let Aw,Ew=()=>Date.now(),Cw="system",Nw=null,jw=null,_w=null,Rw=60,Ow=null;class Dw{static get now(){return Ew}static set now(e){Ew=e}static set defaultZone(e){Cw=e}static get defaultZone(){return bw(Cw,Jb.instance)}static get defaultLocale(){return Nw}static set defaultLocale(e){Nw=e}static get defaultNumberingSystem(){return jw}static set defaultNumberingSystem(e){jw=e}static get defaultOutputCalendar(){return _w}static set defaultOutputCalendar(e){_w=e}static get defaultWeekSettings(){return Ow}static set defaultWeekSettings(e){Ow=rx(e)}static get twoDigitCutoffYear(){return Rw}static set twoDigitCutoffYear(e){Rw=e%100}static get throwOnInvalid(){return Aw}static set throwOnInvalid(e){Aw=e}static resetCaches(){pw.resetCache(),ew.resetCache(),_k.resetCache(),kw.clear()}}class Mw{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Pw=[0,31,59,90,120,151,181,212,243,273,304,334],Iw=[0,31,60,91,121,152,182,213,244,274,305,335];function Lw(e,t){return new Mw("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Fw(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const a=n.getUTCDay();return 0===a?7:a}function zw(e,t,r){return r+(cx(e)?Iw:Pw)[t-1]}function Uw(e,t){const r=cx(e)?Iw:Pw,n=r.findIndex(e=>e<t);return{month:n+1,day:t-r[n]}}function Vw(e,t){return(e-t+7)%7+1}function $w(e,t=4,r=1){const{year:n,month:a,day:o}=e,s=zw(n,a,o),i=Vw(Fw(n,a,o),r);let l,c=Math.floor((s-i+14-t)/7);return c<1?(l=n-1,c=hx(l,t,r)):c>hx(n,t,r)?(l=n+1,c=1):l=n,{weekYear:l,weekNumber:c,weekday:i,...xx(e)}}function Ww(e,t=4,r=1){const{weekYear:n,weekNumber:a,weekday:o}=e,s=Vw(Fw(n,1,t),r),i=ux(n);let l,c=7*a+o-s-7+t;c<1?(l=n-1,c+=ux(l)):c>i?(l=n+1,c-=ux(n)):l=n;const{month:u,day:d}=Uw(l,c);return{year:l,month:u,day:d,...xx(e)}}function Bw(e){const{year:t,month:r,day:n}=e;return{year:t,ordinal:zw(t,r,n),...xx(e)}}function Zw(e){const{year:t,ordinal:r}=e,{month:n,day:a}=Uw(t,r);return{year:t,month:n,day:a,...xx(e)}}function Hw(e,t){if(!qw(e.localWeekday)||!qw(e.localWeekNumber)||!qw(e.localWeekYear)){if(!qw(e.weekday)||!qw(e.weekNumber)||!qw(e.weekYear))throw new bb("Cannot mix locale-based week fields with ISO-based week fields");return qw(e.localWeekday)||(e.weekday=e.localWeekday),qw(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),qw(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function Gw(e){const t=Yw(e.year),r=nx(e.month,1,12),n=nx(e.day,1,dx(e.year,e.month));return t?r?!n&&Lw("day",e.day):Lw("month",e.month):Lw("year",e.year)}function Kw(e){const{hour:t,minute:r,second:n,millisecond:a}=e,o=nx(t,0,23)||24===t&&0===r&&0===n&&0===a,s=nx(r,0,59),i=nx(n,0,59),l=nx(a,0,999);return o?s?i?!l&&Lw("millisecond",a):Lw("second",n):Lw("minute",r):Lw("hour",t)}function qw(e){return void 0===e}function Jw(e){return"number"==typeof e}function Yw(e){return"number"==typeof e&&e%1==0}function Xw(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Qw(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function ex(e,t,r){if(0!==e.length)return e.reduce((e,n)=>{const a=[t(n),n];return e&&r(e[0],a[0])===e[0]?e:a},null)[1]}function tx(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function rx(e){if(null==e)return null;if("object"!=typeof e)throw new xb("Week settings must be an object");if(!nx(e.firstDay,1,7)||!nx(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!nx(e,1,7)))throw new xb("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function nx(e,t,r){return Yw(e)&&e>=t&&e<=r}function ax(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function ox(e){return qw(e)||null===e||""===e?void 0:parseInt(e,10)}function sx(e){return qw(e)||null===e||""===e?void 0:parseFloat(e)}function ix(e){if(!qw(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function lx(e,t,r="round"){const n=10**t;switch(r){case"expand":return e>0?Math.ceil(e*n)/n:Math.floor(e*n)/n;case"trunc":return Math.trunc(e*n)/n;case"round":return Math.round(e*n)/n;case"floor":return Math.floor(e*n)/n;case"ceil":return Math.ceil(e*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function cx(e){return e%4==0&&(e%100!=0||e%400==0)}function ux(e){return cx(e)?366:365}function dx(e,t){const r=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?cx(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function fx(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function mx(e,t,r){return-Vw(Fw(e,1,t),r)+t-1}function hx(e,t=4,r=1){const n=mx(e,t,r),a=mx(e+1,t,r);return(ux(e)-n+a)/7}function px(e){return e>99?e:e>Dw.twoDigitCutoffYear?1900+e:2e3+e}function gx(e,t,r,n=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);const s={timeZoneName:t,...o},i=new Intl.DateTimeFormat(r,s).formatToParts(a).find(e=>"timezonename"===e.type.toLowerCase());return i?i.value:null}function yx(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function vx(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new xb(`Invalid unit value ${e}`);return t}function bx(e,t){const r={};for(const n in e)if(tx(e,n)){const a=e[n];if(null==a)continue;r[t(n)]=vx(a)}return r}function wx(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${ax(r,2)}:${ax(n,2)}`;case"narrow":return`${a}${r}${n>0?`:${n}`:""}`;case"techie":return`${a}${ax(r,2)}${ax(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function xx(e){return function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(e,["hour","minute","second","millisecond"])}const Sx=["January","February","March","April","May","June","July","August","September","October","November","December"],kx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Tx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ax(e){switch(e){case"narrow":return[...Tx];case"short":return[...kx];case"long":return[...Sx];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Ex=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Cx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Nx=["M","T","W","T","F","S","S"];function jx(e){switch(e){case"narrow":return[...Nx];case"short":return[...Cx];case"long":return[...Ex];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const _x=["AM","PM"],Rx=["Before Christ","Anno Domini"],Ox=["BC","AD"],Dx=["B","A"];function Mx(e){switch(e){case"narrow":return[...Dx];case"short":return[...Ox];case"long":return[...Rx];default:return null}}function Px(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const Ix={D:Eb,DD:Cb,DDD:jb,DDDD:_b,t:Rb,tt:Ob,ttt:Db,tttt:Mb,T:Pb,TT:Ib,TTT:Lb,TTTT:Fb,f:zb,ff:Vb,fff:Bb,ffff:Hb,F:Ub,FF:$b,FFF:Zb,FFFF:Gb};class Lx{static create(e,t={}){return new Lx(e,t)}static parseFormat(e){let t=null,r="",n=!1;const a=[];for(let o=0;o<e.length;o++){const s=e.charAt(o);"'"===s?((r.length>0||n)&&a.push({literal:n||/^\s+$/.test(r),val:""===r?"'":r}),t=null,r="",n=!n):n||s===t?r+=s:(r.length>0&&a.push({literal:/^\s+$/.test(r),val:r}),r=s,t=s)}return r.length>0&&a.push({literal:n||/^\s+$/.test(r),val:r}),a}static macroTokenToFormatOpts(e){return Ix[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,r=void 0){if(this.opts.forceSimple)return ax(e,t);const n={...this.opts};return t>0&&(n.padTo=t),r&&(n.signDisplay=r),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,a=(t,r)=>this.loc.extract(e,t,r),o=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",s=()=>r?function(e){return _x[e.hour<12?0:1]}(e):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),i=(t,n)=>r?function(e,t){return Ax(t)[e.month-1]}(e,t):a(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>r?function(e,t){return jx(t)[e.weekday-1]}(e,t):a(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const r=Lx.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},u=t=>r?function(e,t){return Mx(t)[e.year<0?0:1]}(e,t):a({era:t},"era");return Px(Lx.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return n?a({day:"numeric"},"day"):this.num(e.day);case"dd":return n?a({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?a({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?a({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return i("short",!0);case"LLLL":return i("long",!0);case"LLLLL":return i("narrow",!0);case"M":return n?a({month:"numeric"},"month"):this.num(e.month);case"MM":return n?a({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return i("short",!1);case"MMMM":return i("long",!1);case"MMMMM":return i("narrow",!1);case"y":return n?a({year:"numeric"},"year"):this.num(e.year);case"yy":return n?a({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?a({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?a({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}})}formatDurationFromString(e,t){const r="negativeLargestOnly"===this.opts.signMode?-1:1,n=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},a=Lx.parseFormat(t),o=a.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),s=e.shiftTo(...o.map(n).filter(e=>e));return Px(a,((e,t)=>a=>{const o=n(a);if(o){const n=t.isNegativeDuration&&o!==t.largestUnit?r:1;let s;return s="negativeLargestOnly"===this.opts.signMode&&o!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(o)*n,a.length,s)}return a})(s,{isNegativeDuration:s<0,largestUnit:Object.keys(s.values)[0]}))}}const Fx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function zx(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Ux(...e){return t=>e.reduce(([e,r,n],a)=>{const[o,s,i]=a(t,n);return[{...e,...o},s||r,i]},[{},null,1]).slice(0,2)}function Vx(e,...t){if(null==e)return[null,null];for(const[r,n]of t){const t=r.exec(e);if(t)return n(t)}return[null,null]}function $x(...e){return(t,r)=>{const n={};let a;for(a=0;a<e.length;a++)n[e[a]]=ox(t[r+a]);return[n,null,r+a]}}const Wx=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Bx=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Zx=RegExp(`${Bx.source}${`(?:${Wx.source}?(?:\\[(${Fx.source})\\])?)?`}`),Hx=RegExp(`(?:[Tt]${Zx.source})?`),Gx=$x("weekYear","weekNumber","weekDay"),Kx=$x("year","ordinal"),qx=RegExp(`${Bx.source} ?(?:${Wx.source}|(${Fx.source}))?`),Jx=RegExp(`(?: ${qx.source})?`);function Yx(e,t,r){const n=e[t];return qw(n)?r:ox(n)}function Xx(e,t){return[{hours:Yx(e,t,0),minutes:Yx(e,t+1,0),seconds:Yx(e,t+2,0),milliseconds:ix(e[t+3])},null,t+4]}function Qx(e,t){const r=!e[t]&&!e[t+1],n=yx(e[t+1],e[t+2]);return[{},r?null:yw.instance(n),t+3]}function eS(e,t){return[{},e[t]?ew.create(e[t]):null,t+1]}const tS=RegExp(`^T?${Bx.source}$`),rS=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function nS(e){const[t,r,n,a,o,s,i,l,c]=e,u="-"===t[0],d=l&&"-"===l[0],f=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:f(sx(r)),months:f(sx(n)),weeks:f(sx(a)),days:f(sx(o)),hours:f(sx(s)),minutes:f(sx(i)),seconds:f(sx(l),"-0"===l),milliseconds:f(ix(c),d)}]}const aS={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function oS(e,t,r,n,a,o,s){const i={year:2===t.length?px(ox(t)):ox(t),month:kx.indexOf(r)+1,day:ox(n),hour:ox(a),minute:ox(o)};return s&&(i.second=ox(s)),e&&(i.weekday=e.length>3?Ex.indexOf(e)+1:Cx.indexOf(e)+1),i}const sS=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function iS(e){const[,t,r,n,a,o,s,i,l,c,u,d]=e,f=oS(t,a,n,r,o,s,i);let m;return m=l?aS[l]:c?0:yx(u,d),[f,new yw(m)]}const lS=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cS=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,uS=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function dS(e){const[,t,r,n,a,o,s,i]=e;return[oS(t,a,n,r,o,s,i),yw.utcInstance]}function fS(e){const[,t,r,n,a,o,s,i]=e;return[oS(t,i,r,n,a,o,s),yw.utcInstance]}const mS=zx(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Hx),hS=zx(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Hx),pS=zx(/(\d{4})-?(\d{3})/,Hx),gS=zx(Zx),yS=Ux(function(e,t){return[{year:Yx(e,t),month:Yx(e,t+1,1),day:Yx(e,t+2,1)},null,t+3]},Xx,Qx,eS),vS=Ux(Gx,Xx,Qx,eS),bS=Ux(Kx,Xx,Qx,eS),wS=Ux(Xx,Qx,eS);const xS=Ux(Xx);const SS=zx(/(\d{4})-(\d\d)-(\d\d)/,Jx),kS=zx(qx),TS=Ux(Xx,Qx,eS);const AS="Invalid Duration",ES={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},CS={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...ES},NS=365.2425,jS=30.436875,_S={years:{quarters:4,months:12,weeks:52.1775,days:NS,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:jS,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...ES},RS=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],OS=RS.slice(0).reverse();function DS(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new LS(n)}function MS(e,t){let r=t.milliseconds??0;for(const n of OS.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function PS(e,t){const r=MS(e,t)<0?-1:1;RS.reduceRight((n,a)=>{if(qw(t[a]))return n;if(n){const o=t[n]*r,s=e[a][n],i=Math.floor(o/s);t[a]+=i*r,t[n]-=i*s*r}return a},null),RS.reduce((r,n)=>{if(qw(t[n]))return r;if(r){const a=t[r]%1;t[r]-=a,t[n]+=a*e[r][n]}return n},null)}function IS(e){const t={};for(const[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}class LS{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?_S:CS;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||pw.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return LS.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new xb("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new LS({values:bx(e,LS.normalizeUnit),loc:pw.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Jw(e))return LS.fromMillis(e);if(LS.isDuration(e))return e;if("object"==typeof e)return LS.fromObject(e);throw new xb(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=function(e){return Vx(e,[rS,nS])}(e);return r?LS.fromObject(r,t):LS.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=function(e){return Vx(e,[tS,xS])}(e);return r?LS.fromObject(r,t):LS.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new xb("need to specify a reason the Duration is invalid");const r=e instanceof Mw?e:new Mw(e,t);if(Dw.throwOnInvalid)throw new vb(r);return new LS({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new wb(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Lx.create(this.loc,r).formatDurationFromString(this,e):AS}toHuman(e={}){if(!this.isValid)return AS;const t=!1!==e.showZeros,r=RS.map(r=>{const n=this.values[r];return qw(n)||0===n&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=lx(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return _k.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?MS(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=LS.fromDurationLike(e),r={};for(const e of RS)(tx(t.values,e)||tx(this.values,e))&&(r[e]=t.get(e)+this.get(e));return DS(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=LS.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=vx(e(this.values[r],r));return DS(this,{values:t},!0)}get(e){return this[LS.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return DS(this,{values:{...this.values,...bx(e,LS.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){return DS(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return PS(this.matrix,e),DS(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return DS(this,{values:IS(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>LS.normalizeUnit(e));const t={},r={},n=this.toObject();let a;for(const o of RS)if(e.indexOf(o)>=0){a=o;let e=0;for(const t in r)e+=this.matrix[t][o]*r[t],r[t]=0;Jw(n[o])&&(e+=n[o]);const s=Math.trunc(e);t[o]=s,r[o]=(1e3*e-1e3*s)/1e3}else Jw(n[o])&&(r[o]=n[o]);for(const e in r)0!==r[e]&&(t[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return PS(this.matrix,t),DS(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return DS(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return DS(this,{values:IS(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const r of RS)if(!t(this.values[r],e.values[r]))return!1;return!0}}const FS="Invalid Interval";class zS{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new xb("need to specify a reason the Interval is invalid");const r=e instanceof Mw?e:new Mw(e,t);if(Dw.throwOnInvalid)throw new yb(r);return new zS({invalid:r})}static fromDateTimes(e,t){const r=Rk(e),n=Rk(t),a=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?zS.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:zS.invalid("missing or invalid end"):zS.invalid("missing or invalid start")}(r,n);return null==a?new zS({start:r,end:n}):a}static after(e,t){const r=LS.fromDurationLike(t),n=Rk(e);return zS.fromDateTimes(n,n.plus(r))}static before(e,t){const r=LS.fromDurationLike(t),n=Rk(e);return zS.fromDateTimes(n.minus(r),n)}static fromISO(e,t){const[r,n]=(e||"").split("/",2);if(r&&n){let e,a,o,s;try{e=_k.fromISO(r,t),a=e.isValid}catch(n){a=!1}try{o=_k.fromISO(n,t),s=o.isValid}catch(n){s=!1}if(a&&s)return zS.fromDateTimes(e,o);if(a){const r=LS.fromISO(n,t);if(r.isValid)return zS.after(e,r)}else if(s){const e=LS.fromISO(r,t);if(e.isValid)return zS.before(o,e)}}return zS.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let n;return n=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,n=n.startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?zS.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Rk).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let{s:n}=this,a=0;for(;n<this.e;){const e=t[a]||this.e,o=+e>+this.e?this.e:e;r.push(zS.fromDateTimes(n,o)),n=o,a+=1}return r}splitBy(e){const t=LS.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:n}=this,a=1;const o=[];for(;n<this.e;){const e=this.start.plus(t.mapUnits(e=>e*a));r=+e>+this.e?this.e:e,o.push(zS.fromDateTimes(n,r)),n=r,a+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:zS.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return zS.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],a=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(const e of o)r+="s"===e.type?1:-1,1===r?t=e.time:(t&&+t!==+e.time&&n.push(zS.fromDateTimes(t,e.time)),t=null);return zS.merge(n)}difference(...e){return zS.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:FS}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Eb,t={}){return this.isValid?Lx.create(this.s.loc.clone(t),e).formatInterval(this):FS}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:FS}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:FS}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:FS}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:FS}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):LS.invalid(this.invalidReason)}mapEndpoints(e){return zS.fromDateTimes(e(this.s),e(this.e))}}class US{static hasDST(e=Dw.defaultZone){const t=_k.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ew.isValidZone(e)}static normalizeZone(e){return bw(e,Dw.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||pw.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||pw.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||pw.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||pw.create(t,r,a)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:a="gregory"}={}){return(n||pw.create(t,r,a)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||pw.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||pw.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return pw.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return pw.create(t,null,"gregory").eras(e)}static features(){return{relative:Xw(),localeWeek:Qw()}}}function VS(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(LS.fromMillis(n).as("days"))}function $S(e,t,r,n){let[a,o,s,i]=function(e,t,r){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=VS(e,t);return(r-r%7)/7}],["days",VS]],a={},o=e;let s,i;for(const[l,c]of n)r.indexOf(l)>=0&&(s=l,a[l]=c(e,t),i=o.plus(a),i>t?(a[l]--,(e=o.plus(a))>t&&(i=e,a[l]--,e=o.plus(a))):e=i);return[e,a,i,s]}(e,t,r);const l=t-a,c=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(s<t&&(s=a.plus({[i]:1})),s!==a&&(o[i]=(o[i]||0)+l/(s-a)));const u=LS.fromObject(o,n);return c.length>0?LS.fromMillis(l,n).shiftTo(...c).plus(u):u}function WS(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(-1!==e[r].search(ww.hanidec))t+=Sw.indexOf(e[r]);else for(const e in xw){const[r,a]=xw[e];n>=r&&n<=a&&(t+=n-r)}}return parseInt(t,10)}return t}(e))}}const BS=`[ ${String.fromCharCode(160)}]`,ZS=new RegExp(BS,"g");function HS(e){return e.replace(/\./g,"\\.?").replace(ZS,BS)}function GS(e){return e.replace(/\./g,"").replace(ZS," ").toLowerCase()}function KS(e,t){return null===e?null:{regex:RegExp(e.map(HS).join("|")),deser:([r])=>e.findIndex(e=>GS(r)===GS(e))+t}}function qS(e,t){return{regex:e,deser:([,e,t])=>yx(e,t),groups:t}}function JS(e){return{regex:e,deser:([e])=>e}}const YS={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let XS=null;function QS(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const r=rk(Lx.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t)))}class ek{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=QS(Lx.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const r=Tw(t),n=Tw(t,"{2}"),a=Tw(t,"{3}"),o=Tw(t,"{4}"),s=Tw(t,"{6}"),i=Tw(t,"{1,2}"),l=Tw(t,"{1,3}"),c=Tw(t,"{1,6}"),u=Tw(t,"{1,9}"),d=Tw(t,"{2,4}"),f=Tw(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},h=(h=>{if(e.literal)return m(h);switch(h.val){case"G":return KS(t.eras("short"),0);case"GG":return KS(t.eras("long"),0);case"y":return WS(c);case"yy":case"kk":return WS(d,px);case"yyyy":case"kkkk":return WS(o);case"yyyyy":return WS(f);case"yyyyyy":return WS(s);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return WS(i);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return WS(n);case"MMM":return KS(t.months("short",!0),1);case"MMMM":return KS(t.months("long",!0),1);case"LLL":return KS(t.months("short",!1),1);case"LLLL":return KS(t.months("long",!1),1);case"o":case"S":return WS(l);case"ooo":case"SSS":return WS(a);case"u":return JS(u);case"uu":return JS(i);case"uuu":case"E":case"c":return WS(r);case"a":return KS(t.meridiems(),0);case"EEE":return KS(t.weekdays("short",!1),1);case"EEEE":return KS(t.weekdays("long",!1),1);case"ccc":return KS(t.weekdays("short",!0),1);case"cccc":return KS(t.weekdays("long",!0),1);case"Z":case"ZZ":return qS(new RegExp(`([+-]${i.source})(?::(${n.source}))?`),2);case"ZZZ":return qS(new RegExp(`([+-]${i.source})(${n.source})?`),2);case"z":return JS(/[a-z_+-/]{1,256}?/i);case" ":return JS(/[^\S\n\r]/);default:return m(h)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return h.token=e,h}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=function(e){const t=e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"");return[`^${t}$`,e]}(this.units);this.regex=RegExp(e,"i"),this.handlers=t}}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const n=e.match(t);if(n){const e={};let t=1;for(const a in r)if(tx(r,a)){const o=r[a],s=o.groups?o.groups+1:1;!o.literal&&o.token&&(e[o.token.val[0]]=o.deser(n.slice(t,t+s))),t+=s}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,a,o]=r?function(e){let t,r=null;qw(e.z)||(r=ew.create(e.z)),qw(e.Z)||(r||(r=new yw(e.Z)),t=e.Z),qw(e.q)||(e.M=3*(e.q-1)+1),qw(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),qw(e.u)||(e.S=ix(e.u));const n=Object.keys(e).reduce((t,r)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return n&&(t[n]=e[r]),t},{});return[n,r,t]}(r):[null,null,void 0];if(tx(r,"a")&&tx(r,"H"))throw new bb("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:a,specificOffset:o}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function tk(e,t,r){return new ek(e,r).explainFromTokens(t)}function rk(e,t){if(!e)return null;const r=Lx.create(t,e).dtFormatter((XS||(XS=_k.fromMillis(1555555555555)),XS)),n=r.formatToParts(),a=r.resolvedOptions();return n.map(t=>function(e,t,r){const{type:n,value:a}=e;if("literal"===n){const e=/^\s+$/.test(a);return{literal:!e,val:e?" ":a}}const o=t[n];let s=n;"hour"===n&&(s=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let i=YS[s];if("object"==typeof i&&(i=i[o]),i)return{literal:!1,val:i}}(t,e,a))}const nk="Invalid DateTime",ak=864e13;function ok(e){return new Mw("unsupported zone",`the zone "${e.name}" is not supported`)}function sk(e){return null===e.weekData&&(e.weekData=$w(e.c)),e.weekData}function ik(e){return null===e.localWeekData&&(e.localWeekData=$w(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function lk(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new _k({...r,...t,old:r})}function ck(e,t,r){let n=e-60*t*1e3;const a=r.offset(n);if(t===a)return[n,t];n-=60*(a-t)*1e3;const o=r.offset(n);return a===o?[n,a]:[e-60*Math.min(a,o)*1e3,Math.max(a,o)]}function uk(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function dk(e,t,r){return ck(fx(e),t,r)}function fk(e,t){const r=e.o,n=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o={...e.c,year:n,month:a,day:Math.min(e.c.day,dx(n,a))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},s=LS.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),i=fx(o);let[l,c]=ck(i,r,e.zone);return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function mk(e,t,r,n,a,o){const{setZone:s,zone:i}=r;if(e&&0!==Object.keys(e).length||t){const n=t||i,a=_k.fromObject(e,{...r,zone:n,specificOffset:o});return s?a:a.setZone(i)}return _k.invalid(new Mw("unparsable",`the input "${a}" can't be parsed as ${n}`))}function hk(e,t,r=!0){return e.isValid?Lx.create(pw.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function pk(e,t,r){const n=e.c.year>9999||e.c.year<0;let a="";if(n&&e.c.year>=0&&(a+="+"),a+=ax(e.c.year,n?6:4),"year"===r)return a;if(t){if(a+="-",a+=ax(e.c.month),"month"===r)return a;a+="-"}else if(a+=ax(e.c.month),"month"===r)return a;return a+=ax(e.c.day),a}function gk(e,t,r,n,a,o,s){let i=!r||0!==e.c.millisecond||0!==e.c.second,l="";switch(s){case"day":case"month":case"year":break;default:if(l+=ax(e.c.hour),"hour"===s)break;if(t){if(l+=":",l+=ax(e.c.minute),"minute"===s)break;i&&(l+=":",l+=ax(e.c.second))}else{if(l+=ax(e.c.minute),"minute"===s)break;i&&(l+=ax(e.c.second))}if("second"===s)break;!i||n&&0===e.c.millisecond||(l+=".",l+=ax(e.c.millisecond,3))}return a&&(e.isOffsetFixed&&0===e.offset&&!o?l+="Z":e.o<0?(l+="-",l+=ax(Math.trunc(-e.o/60)),l+=":",l+=ax(Math.trunc(-e.o%60))):(l+="+",l+=ax(Math.trunc(e.o/60)),l+=":",l+=ax(Math.trunc(e.o%60)))),o&&(l+="["+e.zone.ianaName+"]"),l}const yk={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vk={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},bk={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wk=["year","month","day","hour","minute","second","millisecond"],xk=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Sk=["year","ordinal","hour","minute","second","millisecond"];function kk(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new wb(e);return t}function Tk(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return kk(e)}}function Ak(e,t){const r=bw(t.zone,Dw.defaultZone);if(!r.isValid)return _k.invalid(ok(r));const n=pw.fromObject(t);let a,o;if(qw(e.year))a=Dw.now();else{for(const t of wk)qw(e[t])&&(e[t]=yk[t]);const t=Gw(e)||Kw(e);if(t)return _k.invalid(t);const n=function(e){if(void 0===Nk&&(Nk=Dw.now()),"iana"!==e.type)return e.offset(Nk);const t=e.name;let r=jk.get(t);return void 0===r&&(r=e.offset(Nk),jk.set(t,r)),r}(r);[a,o]=dk(e,n,r)}return new _k({ts:a,zone:r,loc:n,o:o})}function Ek(e,t,r){const n=!!qw(r.round)||r.round,a=qw(r.rounding)?"trunc":r.rounding,o=(e,o)=>{e=lx(e,n||r.calendary?0:2,r.calendary?"round":a);return t.loc.clone(r).relFormatter(r).format(e,o)},s=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return o(s(r.unit),r.unit);for(const e of r.units){const t=s(e);if(Math.abs(t)>=1)return o(t,e)}return o(e>t?-0:0,r.units[r.units.length-1])}function Ck(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}let Nk;const jk=new Map;class _k{constructor(e){const t=e.zone||Dw.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Mw("invalid input"):null)||(t.isValid?null:ok(t));this.ts=qw(e.ts)?Dw.now():e.ts;let n=null,a=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,a]=[e.old.c,e.old.o];else{const o=Jw(e.o)&&!e.old?e.o:t.offset(this.ts);n=uk(this.ts,o),r=Number.isNaN(n.year)?new Mw("invalid input"):null,n=r?null:n,a=r?null:o}}this._zone=t,this.loc=e.loc||pw.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=a,this.isLuxonDateTime=!0}static now(){return new _k({})}static local(){const[e,t]=Ck(arguments),[r,n,a,o,s,i,l]=t;return Ak({year:r,month:n,day:a,hour:o,minute:s,second:i,millisecond:l},e)}static utc(){const[e,t]=Ck(arguments),[r,n,a,o,s,i,l]=t;return e.zone=yw.utcInstance,Ak({year:r,month:n,day:a,hour:o,minute:s,second:i,millisecond:l},e)}static fromJSDate(e,t={}){const r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return _k.invalid("invalid input");const n=bw(t.zone,Dw.defaultZone);return n.isValid?new _k({ts:r,zone:n,loc:pw.fromObject(t)}):_k.invalid(ok(n))}static fromMillis(e,t={}){if(Jw(e))return e<-ak||e>ak?_k.invalid("Timestamp out of range"):new _k({ts:e,zone:bw(t.zone,Dw.defaultZone),loc:pw.fromObject(t)});throw new xb(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Jw(e))return new _k({ts:1e3*e,zone:bw(t.zone,Dw.defaultZone),loc:pw.fromObject(t)});throw new xb("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=bw(t.zone,Dw.defaultZone);if(!r.isValid)return _k.invalid(ok(r));const n=pw.fromObject(t),a=bx(e,Tk),{minDaysInFirstWeek:o,startOfWeek:s}=Hw(a,n),i=Dw.now(),l=qw(t.specificOffset)?r.offset(i):t.specificOffset,c=!qw(a.ordinal),u=!qw(a.year),d=!qw(a.month)||!qw(a.day),f=u||d,m=a.weekYear||a.weekNumber;if((f||c)&&m)throw new bb("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new bb("Can't mix ordinal dates with month/day");const h=m||a.weekday&&!f;let p,g,y=uk(i,l);h?(p=xk,g=vk,y=$w(y,o,s)):c?(p=Sk,g=bk,y=Bw(y)):(p=wk,g=yk);let v=!1;for(const e of p){qw(a[e])?a[e]=v?g[e]:y[e]:v=!0}const b=h?function(e,t=4,r=1){const n=Yw(e.weekYear),a=nx(e.weekNumber,1,hx(e.weekYear,t,r)),o=nx(e.weekday,1,7);return n?a?!o&&Lw("weekday",e.weekday):Lw("week",e.weekNumber):Lw("weekYear",e.weekYear)}(a,o,s):c?function(e){const t=Yw(e.year),r=nx(e.ordinal,1,ux(e.year));return t?!r&&Lw("ordinal",e.ordinal):Lw("year",e.year)}(a):Gw(a),w=b||Kw(a);if(w)return _k.invalid(w);const x=h?Ww(a,o,s):c?Zw(a):a,[S,k]=dk(x,l,r),T=new _k({ts:S,zone:r,o:k,loc:n});return a.weekday&&f&&e.weekday!==T.weekday?_k.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${T.toISO()}`):T.isValid?T:_k.invalid(T.invalid)}static fromISO(e,t={}){const[r,n]=function(e){return Vx(e,[mS,yS],[hS,vS],[pS,bS],[gS,wS])}(e);return mk(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=function(e){return Vx(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[sS,iS])}(e);return mk(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=function(e){return Vx(e,[lS,dS],[cS,dS],[uS,fS])}(e);return mk(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(qw(e)||qw(t))throw new xb("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:a=null}=r,o=pw.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),[s,i,l,c]=function(e,t,r){const{result:n,zone:a,specificOffset:o,invalidReason:s}=tk(e,t,r);return[n,a,o,s]}(o,e,t);return c?_k.invalid(c):mk(s,i,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return _k.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=function(e){return Vx(e,[SS,yS],[kS,TS])}(e);return mk(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new xb("need to specify a reason the DateTime is invalid");const r=e instanceof Mw?e:new Mw(e,t);if(Dw.throwOnInvalid)throw new gb(r);return new _k({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=rk(e,pw.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return QS(Lx.parseFormat(e),pw.fromObject(t)).map(e=>e.val).join("")}static resetCache(){Nk=void 0,jk.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?sk(this).weekYear:NaN}get weekNumber(){return this.isValid?sk(this).weekNumber:NaN}get weekday(){return this.isValid?sk(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ik(this).weekday:NaN}get localWeekNumber(){return this.isValid?ik(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ik(this).weekYear:NaN}get ordinal(){return this.isValid?Bw(this.c).ordinal:NaN}get monthShort(){return this.isValid?US.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?US.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?US.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?US.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=fx(this.c),n=this.zone.offset(r-e),a=this.zone.offset(r+e),o=this.zone.offset(r-n*t),s=this.zone.offset(r-a*t);if(o===s)return[this];const i=r-o*t,l=r-s*t,c=uk(i,o),u=uk(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[lk(this,{ts:i}),lk(this,{ts:l})]:[this]}get isInLeapYear(){return cx(this.year)}get daysInMonth(){return dx(this.year,this.month)}get daysInYear(){return this.isValid?ux(this.year):NaN}get weeksInWeekYear(){return this.isValid?hx(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?hx(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=Lx.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(yw.instance(e),t)}toLocal(){return this.setZone(Dw.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=bw(e,Dw.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[n]=dk(r,t,e)}return lk(this,{ts:n,zone:e})}return _k.invalid(ok(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return lk(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=bx(e,Tk),{minDaysInFirstWeek:r,startOfWeek:n}=Hw(t,this.loc),a=!qw(t.weekYear)||!qw(t.weekNumber)||!qw(t.weekday),o=!qw(t.ordinal),s=!qw(t.year),i=!qw(t.month)||!qw(t.day),l=s||i,c=t.weekYear||t.weekNumber;if((l||o)&&c)throw new bb("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(i&&o)throw new bb("Can't mix ordinal dates with month/day");let u;a?u=Ww({...$w(this.c,r,n),...t},r,n):qw(t.ordinal)?(u={...this.toObject(),...t},qw(t.day)&&(u.day=Math.min(dx(u.year,u.month),u.day))):u=Zw({...Bw(this.c),...t});const[d,f]=dk(u,this.o,this.zone);return lk(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;return lk(this,fk(this,LS.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return lk(this,fk(this,LS.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=LS.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(r.weekNumber=this.weekNumber-1),r.weekday=e}else r.weekday=1;if("quarters"===n){const e=Math.ceil(this.month/3);r.month=3*(e-1)+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?Lx.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):nk}toLocaleString(e=Eb,t={}){return this.isValid?Lx.create(this.loc.clone(t),e).formatDateTime(this):nk}toLocaleParts(e={}){return this.isValid?Lx.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:a=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;const s="extended"===e;let i=pk(this,s,o=kk(o));return wk.indexOf(o)>=3&&(i+="T"),i+=gk(this,s,t,r,n,a,o),i}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?pk(this,"extended"===e,kk(t)):null}toISOWeekDate(){return hk(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:a=!1,format:o="extended",precision:s="milliseconds"}={}){if(!this.isValid)return null;return s=kk(s),(n&&wk.indexOf(s)>=3?"T":"")+gk(this,"extended"===o,t,e,r,a,s)}toRFC2822(){return hk(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return hk(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pk(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(t||e)&&(r&&(n+=" "),t?n+="z":e&&(n+="ZZ")),hk(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():nk}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return LS.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},a=(i=t,Array.isArray(i)?i:[i]).map(LS.normalizeUnit),o=e.valueOf()>this.valueOf(),s=$S(o?this:e,o?e:this,a,n);var i;return o?s.negate():s}diffNow(e="milliseconds",t={}){return this.diff(_k.now(),e,t)}until(e){return this.isValid?zS.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),a=this.setZone(e.zone,{keepLocalTime:!0});return a.startOf(t,r)<=n&&n<=a.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||_k.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let n=["years","months","days","hours","minutes","seconds"],a=e.unit;return Array.isArray(e.unit)&&(n=e.unit,a=void 0),Ek(t,this.plus(r),{...e,numeric:"always",units:n,unit:a})}toRelativeCalendar(e={}){return this.isValid?Ek(e.base||_k.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(_k.isDateTime))throw new xb("min requires all arguments be DateTimes");return ex(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(_k.isDateTime))throw new xb("max requires all arguments be DateTimes");return ex(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:a=null}=r;return tk(pw.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return _k.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:n=null}=t,a=pw.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0});return new ek(a,e)}static fromFormatParser(e,t,r={}){if(qw(e)||qw(t))throw new xb("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:a=null}=r,o=pw.fromOpts({locale:n,numberingSystem:a,defaultToEN:!0});if(!o.equals(t.locale))throw new xb(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:s,zone:i,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?_k.invalid(c):mk(s,i,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Eb}static get DATE_MED(){return Cb}static get DATE_MED_WITH_WEEKDAY(){return Nb}static get DATE_FULL(){return jb}static get DATE_HUGE(){return _b}static get TIME_SIMPLE(){return Rb}static get TIME_WITH_SECONDS(){return Ob}static get TIME_WITH_SHORT_OFFSET(){return Db}static get TIME_WITH_LONG_OFFSET(){return Mb}static get TIME_24_SIMPLE(){return Pb}static get TIME_24_WITH_SECONDS(){return Ib}static get TIME_24_WITH_SHORT_OFFSET(){return Lb}static get TIME_24_WITH_LONG_OFFSET(){return Fb}static get DATETIME_SHORT(){return zb}static get DATETIME_SHORT_WITH_SECONDS(){return Ub}static get DATETIME_MED(){return Vb}static get DATETIME_MED_WITH_SECONDS(){return $b}static get DATETIME_MED_WITH_WEEKDAY(){return Wb}static get DATETIME_FULL(){return Bb}static get DATETIME_FULL_WITH_SECONDS(){return Zb}static get DATETIME_HUGE(){return Hb}static get DATETIME_HUGE_WITH_SECONDS(){return Gb}}function Rk(e){if(_k.isDateTime(e))return e;if(e&&e.valueOf&&Jw(e.valueOf()))return _k.fromJSDate(e);if(e&&"object"==typeof e)return _k.fromObject(e);throw new xb(`Unknown datetime argument: ${e}, of type ${typeof e}`)}let Ok=[{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:"🇮🇱"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"}];Ok=Ok.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Ok.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Dk=Ok.filter(e=>_k.local().setLocale(e.code).isValid).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function Mk(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=Dk.find(e=>e.value==n);return e.jsxs(ob,{open:o,onOpenChange:s,children:[e.jsx(sb,{asChild:!0,children:e.jsxs(hs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i&&e.jsxs("div",{children:[String(i.label).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:i.flag})]}),!i&&"Choose language",e.jsx(es,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(ib,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(yg,{children:[e.jsx(vg,{placeholder:"Choose timezone..."}),e.jsx(bg,{children:e.jsx(wg,{children:Dk.map(t=>e.jsxs(xg,{className:Do("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(Qo,{className:Do("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:t.flag})]},t.value))})})]})})]})}const Pk=[{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 r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],o=t.text;let s=o.substring(o.indexOf("(")+1,o.indexOf(")"));-1!==s.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${s}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function Ik(r){const[n,a]=t.useState(r.value||""),[o,s]=t.useState(!1),i=Pk.find(e=>e.value==n);return e.jsxs(ob,{open:o,onOpenChange:s,children:[e.jsx(sb,{asChild:!0,children:e.jsxs(hs,{variant:"outline",role:"combobox","aria-expanded":o,className:"justify-between overflow-hidden text-ellipsis",children:[i?.text||"Choose timezone",e.jsx(es,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(ib,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(yg,{children:[e.jsx(vg,{placeholder:"Choose timezone..."}),e.jsx(bg,{children:e.jsx(wg,{children:Pk.map(t=>e.jsxs(xg,{className:Do("whitespace-nowrap text-left",{"text-green-500":n===t.value}),value:t.value,defaultValue:t.value,onSelect:e=>{const n=t.value;a(n),r.onChange&&"function"==typeof r.onChange&&r.onChange(n),s(!1)},children:[n===t.value&&e.jsx(Qo,{className:Do("mr-2 h-4 w-4 text-green-400",n===t.value?"opacity-100":"opacity-0")}),String(t.text).trim()]},t.value))})})]})})]})}const Lk=({workspace:r})=>{const{updateUserProfile:n,getProfile:a}=cA(),[o,s]=t.useState(!1),[i,l]=t.useState(),[c,u]=t.useState(0),d=kt({resolver:ka(_i({name:ni().min(2,{message:"Name must be at least 2 characters."}),country:ni().optional(),timezone:ni().optional(),language:ni().optional(),currency:ni().optional()})),defaultValues:{name:i?.name||"",country:i?.country||"",timezone:i?.timezone||"",language:i?.language||"",currency:i?.currency||""}});return t.useEffect(()=>{a().then(e=>{l(e),d.setValue("name",e.name),d.setValue("country",e.country),d.setValue("timezone",e.timezone),d.setValue("language",e.language),d.setValue("currency",e.currency)})},[c]),i?e.jsxs("div",{children:[e.jsx("div",{className:"space-y-4",children:e.jsx(ws,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(async function(e){s(!0),await n({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),s(!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(_s,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:i?.email})]}),e.jsx(Ss,{disabled:o,control:d.control,name:"name",render:({field:t})=>e.jsxs(As,{children:[e.jsx(Es,{children:"Name"}),e.jsx(Cs,{children:e.jsx(_s,{...t})}),e.jsx(js,{})]})}),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(Mk,{value:d.getValues("language"),onChange:e=>{d.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(db,{value:d.getValues("country"),onChange:e=>{d.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(hb,{value:d.getValues("currency"),onChange:e=>{d.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(Ik,{value:d.getValues("timezone"),onChange:e=>{d.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(hs,{type:"submit",progress:o,disabled:o,children:"Save"}),e.jsx(hs,{type:"button",variant:"outline",onClick:()=>{u(e=>e+1)},disabled:o,children:"Reset"})]})]})})}),i?.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:i.image,alt:i.name,className:"w-full h-full object-cover"})})]})]}):e.jsx("div",{children:"Loading..."})};var Fk=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,r)=>e.jsx(ps.span,{...t,ref:r,style:{...Fk,...t.style}})).displayName="VisuallyHidden";var zk=[" ","Enter","ArrowUp","ArrowDown"],Uk=[" ","Enter"],Vk="Select",[$k,Wk,Bk]=Cm(Vk),[Zk,Hk]=ku(Vk,[Bk,pv]),Gk=pv(),[Kk,qk]=Zk(Vk),[Jk,Yk]=Zk(Vk),Xk=t=>{const{__scopeSelect:r,children:n,open:a,defaultOpen:s,onOpenChange:i,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:m,disabled:h,required:p,form:g}=t,y=Gk(r),[v,b]=o.useState(null),[w,x]=o.useState(null),[S,k]=o.useState(!1),T=jm(d),[A,E]=nd({prop:a,defaultProp:s??!1,onChange:i,caller:Vk}),[C,N]=nd({prop:l,defaultProp:c,onChange:u,caller:Vk}),j=o.useRef(null),_=!v||(g||!!v.closest("form")),[R,O]=o.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return e.jsx(Rv,{...y,children:e.jsxs(Kk,{required:p,scope:r,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:td(),value:C,onValueChange:N,open:A,onOpenChange:E,dir:T,triggerPointerDownPosRef:j,disabled:h,children:[e.jsx($k.Provider,{scope:r,children:e.jsx(Jk,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(e=>{O(t=>new Set(t).add(e))},[]),onNativeOptionRemove:o.useCallback(e=>{O(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),_?e.jsxs(IT,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:m,value:C,onChange:e=>N(e.target.value),disabled:h,form:g,children:[void 0===C?e.jsx("option",{value:""}):null,Array.from(R)]},D):null]})})};Xk.displayName=Vk;var Qk="SelectTrigger",eT=o.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:a=!1,...s}=t,i=Gk(n),l=qk(Qk,n),c=l.disabled||a,u=Io(r,l.onTriggerChange),d=Wk(n),f=o.useRef("touch"),[m,h,p]=FT(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=zT(t,e,r);void 0!==n&&l.onValueChange(n.value)}),g=e=>{c||(l.onOpenChange(!0),p()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Ov,{asChild:!0,...i,children:e.jsx(ps.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":LT(l.value)?"":void 0,...s,ref:u,onClick:Xu(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Xu(s.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&&(g(e),e.preventDefault())}),onKeyDown:Xu(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||zk.includes(e.key)&&(g(),e.preventDefault())})})})});eT.displayName=Qk;var tT="SelectValue",rT=o.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:i="",...l}=t,c=qk(tT,n),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,f=Io(r,c.onValueNodeChange);return Cu(()=>{u(d)},[u,d]),e.jsx(ps.span,{...l,ref:f,style:{pointerEvents:"none"},children:LT(c.value)?e.jsx(e.Fragment,{children:i}):s})});rT.displayName=tT;var nT=o.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...o}=t;return e.jsx(ps.span,{"aria-hidden":!0,...o,ref:r,children:a||"▼"})});nT.displayName="SelectIcon";var aT=t=>e.jsx(Sd,{asChild:!0,...t});aT.displayName="SelectPortal";var oT="SelectContent",sT=o.forwardRef((t,r)=>{const n=qk(oT,t.__scopeSelect),[a,i]=o.useState();if(Cu(()=>{i(new DocumentFragment)},[]),!n.open){const r=a;return r?s.createPortal(e.jsx(lT,{scope:t.__scopeSelect,children:e.jsx($k.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(dT,{...t,ref:r})});sT.displayName=oT;var iT=10,[lT,cT]=Zk(oT),uT=Lo("SelectContent.RemoveScroll"),dT=o.forwardRef((t,r)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=qk(oT,n),[x,S]=o.useState(null),[k,T]=o.useState(null),A=Io(r,e=>S(e)),[E,C]=o.useState(null),[N,j]=o.useState(null),_=Wk(n),[R,O]=o.useState(!1),D=o.useRef(!1);o.useEffect(()=>{if(x)return Sf(x)},[x]),Ed();const M=o.useCallback(e=>{const[t,...r]=_().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[_,k]),P=o.useCallback(()=>M([E,x]),[M,E,x]);o.useEffect(()=>{R&&P()},[R,P]);const{onOpenChange:I,triggerPointerDownPosRef:L}=w;o.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||I(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,I,L]),o.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[F,z]=FT(e=>{const t=_().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=zT(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),U=o.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==w.value&&w.value===t||n)&&(C(e),n&&(D.current=!0))},[w.value]),V=o.useCallback(()=>x?.focus(),[x]),$=o.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==w.value&&w.value===t||n)&&j(e)},[w.value]),W="popper"===a?mT:fT,B=W===mT?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return e.jsx(lT,{scope:n,content:x,viewport:k,onViewportChange:T,itemRefCallback:U,selectedItem:E,onItemLeave:V,itemTextRefCallback:$,focusSelectedItem:P,selectedItemText:N,position:a,isPositioned:R,searchRef:F,children:e.jsx(pf,{as:uT,allowPinchZoom:!0,children:e.jsx(pd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Xu(s,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(cd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:e.jsx(W,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>O(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Xu(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=_().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 r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});dT.displayName="SelectContentImpl";var fT=o.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:a,...s}=t,i=qk(oT,n),l=cT(oT,n),[c,u]=o.useState(null),[d,f]=o.useState(null),m=Io(r,e=>f(e)),h=Wk(n),p=o.useRef(!1),g=o.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,x=o.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&y&&v&&b){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=b.getBoundingClientRect();if("rtl"!==i.dir){const a=n.left-t.left,o=r.left-a,s=e.left-o,i=e.width+s,l=Math.max(i,t.width),u=window.innerWidth-iT,d=kh(o,[iT,Math.max(iT,u-l)]);c.style.minWidth=i+"px",c.style.left=d+"px"}else{const a=t.right-n.right,o=window.innerWidth-r.right-a,s=window.innerWidth-e.right-o,i=e.width+s,l=Math.max(i,t.width),u=window.innerWidth-iT,d=kh(o,[iT,Math.max(iT,u-l)]);c.style.minWidth=i+"px",c.style.right=d+"px"}const o=h(),s=window.innerHeight-2*iT,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+m+l+parseInt(u.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),S=window.getComputedStyle(y),k=parseInt(S.paddingTop,10),T=parseInt(S.paddingBottom,10),A=e.top+e.height/2-iT,E=s-A,C=v.offsetHeight/2,N=f+m+(v.offsetTop+C),j=w-N;if(N<=A){const e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,r=N+Math.max(E,C+(e?T:0)+t+g);c.style.height=r+"px"}else{const e=o.length>0&&v===o[0].ref.current;c.style.top="0px";const t=Math.max(A,f+y.offsetTop+(e?k:0)+C)+j;c.style.height=t+"px",y.scrollTop=N-A+y.offsetTop}c.style.margin=`${iT}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=s+"px",a?.(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,c,d,y,v,b,i.dir,a]);Cu(()=>x(),[x]);const[S,k]=o.useState();Cu(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const T=o.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return e.jsx(hT,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(ps.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});fT.displayName="SelectItemAlignedPosition";var mT=o.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=iT,...s}=t,i=Gk(n);return e.jsx(Dv,{...i,...s,ref:r,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});mT.displayName="SelectPopperPosition";var[hT,pT]=Zk(oT,{}),gT="SelectViewport",yT=o.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:a,...s}=t,i=cT(gT,n),l=pT(gT,n),c=Io(r,i.onViewportChange),u=o.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),e.jsx($k.Slot,{scope:n,children:e.jsx(ps.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Xu(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(n?.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*iT,a=parseFloat(r.style.minHeight),o=parseFloat(r.style.height),s=Math.max(a,o);if(s<n){const a=s+e,o=Math.min(n,a),i=a-o;r.style.height=o+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});yT.displayName=gT;var vT="SelectGroup",[bT,wT]=Zk(vT);o.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=td();return e.jsx(bT,{scope:n,id:o,children:e.jsx(ps.div,{role:"group","aria-labelledby":o,...a,ref:r})})}).displayName=vT;var xT="SelectLabel",ST=o.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=wT(xT,n);return e.jsx(ps.div,{id:o.id,...a,ref:r})});ST.displayName=xT;var kT="SelectItem",[TT,AT]=Zk(kT),ET=o.forwardRef((t,r)=>{const{__scopeSelect:n,value:a,disabled:s=!1,textValue:i,...l}=t,c=qk(kT,n),u=cT(kT,n),d=c.value===a,[f,m]=o.useState(i??""),[h,p]=o.useState(!1),g=Io(r,e=>u.itemRefCallback?.(e,a,s)),y=td(),v=o.useRef("touch"),b=()=>{s||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)throw new 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(TT,{scope:n,value:a,disabled:s,textId:y,isSelected:d,onItemTextChange:o.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx($k.ItemSlot,{scope:n,value:a,disabled:s,textValue:f,children:e.jsx(ps.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Xu(l.onFocus,()=>p(!0)),onBlur:Xu(l.onBlur,()=>p(!1)),onClick:Xu(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Xu(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Xu(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Xu(l.onPointerMove,e=>{v.current=e.pointerType,s?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Xu(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Xu(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Uk.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});ET.displayName=kT;var CT="SelectItemText",NT=o.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:i,...l}=t,c=qk(CT,n),u=cT(CT,n),d=AT(CT,n),f=Yk(CT,n),[m,h]=o.useState(null),p=Io(r,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=m?.textContent,y=o.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return Cu(()=>(v(y),()=>b(y)),[v,b,y]),e.jsxs(e.Fragment,{children:[e.jsx(ps.span,{id:d.textId,...l,ref:p}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})});NT.displayName=CT;var jT="SelectItemIndicator",_T=o.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return AT(jT,n).isSelected?e.jsx(ps.span,{"aria-hidden":!0,...a,ref:r}):null});_T.displayName=jT;var RT="SelectScrollUpButton";o.forwardRef((t,r)=>{const n=cT(RT,t.__scopeSelect),a=pT(RT,t.__scopeSelect),[s,i]=o.useState(!1),l=Io(r,a.onScrollButtonChange);return Cu(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),s?e.jsx(DT,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=RT;var OT="SelectScrollDownButton";o.forwardRef((t,r)=>{const n=cT(OT,t.__scopeSelect),a=pT(OT,t.__scopeSelect),[s,i]=o.useState(!1),l=Io(r,a.onScrollButtonChange);return Cu(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),s?e.jsx(DT,{...t,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=OT;var DT=o.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:a,...s}=t,i=cT("SelectScrollButton",n),l=o.useRef(null),c=Wk(n),u=o.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return o.useEffect(()=>()=>u(),[u]),Cu(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),e.jsx(ps.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:Xu(s.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:Xu(s.onPointerMove,()=>{i.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:Xu(s.onPointerLeave,()=>{u()})})}),MT=o.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(ps.div,{"aria-hidden":!0,...a,ref:r})});MT.displayName="SelectSeparator";var PT="SelectArrow";o.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,o=Gk(n),s=qk(PT,n),i=cT(PT,n);return s.open&&"popper"===i.position?e.jsx(Mv,{...o,...a,ref:r}):null}).displayName=PT;var IT=o.forwardRef(({__scopeSelect:t,value:r,...n},a)=>{const s=o.useRef(null),i=Io(a,s),l=qm(r);return o.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),e.jsx(ps.select,{...n,style:{...Fk,...n.style},ref:i,defaultValue:r})});function LT(e){return""===e||void 0===e}function FT(e){const t=Au(e),r=o.useRef(""),n=o.useRef(0),a=o.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),s=o.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,s]}function zT(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(o=o.filter(e=>e!==r));const s=o.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==r?s:void 0}IT.displayName="SelectBubbleInput";var UT=eT,VT=nT,$T=aT,WT=sT,BT=yT,ZT=ST,HT=ET,GT=NT,KT=_T,qT=MT;const JT=Xk,YT=o.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(UT,{ref:a,className:Do("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),...n,children:[r,e.jsx(VT,{asChild:!0,children:e.jsx(fm,{className:"h-4 w-4 opacity-50"})})]}));YT.displayName=UT.displayName;const XT=o.forwardRef(({className:t,children:r,position:n="popper",...a},s)=>{const{container:i}=o.useContext(J);return e.jsx($T,{container:i,children:e.jsx(WT,{ref:s,className:Do("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"===n&&"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:n,...a,children:e.jsx(BT,{className:Do("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});XT.displayName=WT.displayName;o.forwardRef(({className:t,...r},n)=>e.jsx(ZT,{ref:n,className:Do("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=ZT.displayName;const QT=o.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(HT,{ref:a,className:Do("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),...n,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(KT,{children:e.jsx(hm,{className:"h-4 w-4"})})}),e.jsx(GT,{children:r})]}));QT.displayName=HT.displayName;o.forwardRef(({className:t,...r},n)=>e.jsx(qT,{ref:n,className:Do("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=qT.displayName;const eA=({workspace:r})=>{const n=P(e=>e.auth.user),[a,o]=t.useState(0),[s,i]=t.useState(!1),[l,c]=t.useState([]),{getUsers:u,removeUser:d,updateUser:f}=cA();t.useEffect(()=>{r&&(i(!0),u(r._id).then(e=>{c(e)}).catch(e=>{console.error(e)}).finally(()=>{i(!1)}))},[r,a]);const m=()=>{o(e=>e+1)};if(!r)return e.jsx("div",{children:e.jsx("div",{className:"text-gray-500",children:"Loading workspace members..."})});const h=e=>"string"==typeof e?{name:"Unknown User",email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},p=l.map(e=>({...e,...h(e.user)})),g=l.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,y="admin"===g;return e.jsxs("div",{children:[!y&&e.jsx("div",{className:"text-red-500",children:"Only workspace admin can manage users and roles."}),y&&e.jsx("div",{className:"mb-4",children:e.jsx(tA,{onInvite:m,workspaceId:r._id})}),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:[l.length," member",1!==l.length?"s":""]})}),e.jsx("div",{children:e.jsx(hs,{variant:"ghost",size:"sm",onClick:m,progress:s,startIcon:e.jsx(os,{}),children:"Refresh"})})]}),e.jsx("ul",{className:"space-y-2",children:p.map((t,a)=>{const o=t.id===n?.id;return e.jsxs("li",{className:"flex items-center justify-between border rounded-lg 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(JT,{disabled:o||!y,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,void f(n,a,{role:e}).then(()=>{m()});var n,a},children:[e.jsx(YT,{children:e.jsx(rT,{placeholder:"Select a role"})}),e.jsx(XT,{children:r?.roles.map(t=>e.jsx(QT,{value:t,children:t},t))})]})}),o&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"You"}),!o&&y&&e.jsx(hs,{variant:"destructive",size:"sm",startIcon:e.jsx(us,{}),onClick:()=>{var e;e=t.id,d(r._id,e).then(()=>{m()})}})]})]},a)})}),0===l.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:"No members found in this workspace."})]})};function tA({onInvite:r,workspaceId:n}){const[a,o]=t.useState(""),[s,i]=t.useState("admin"),[l,c]=t.useState(!1),[u,d]=t.useState(null),[f,m]=t.useState(null),{addUser:h,getWorkspace:p}=cA(),[g,y]=t.useState(null);t.useEffect(()=>{n&&p(n).then(y)},[n]);const v=()=>{d(null),m(null),o(""),i("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[u&&e.jsx("div",{className:"text-red-500 capitalize",children:u}),f&&e.jsx("div",{className:"text-green-500 capitalize",children:f}),e.jsxs("div",{children:[e.jsx(bs,{children:"Invite member by email"}),e.jsx(_s,{type:"email",value:a,onChange:e=>o(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(bs,{children:"Role"}),e.jsxs(JT,{value:s,onValueChange:i,children:[e.jsx(YT,{children:e.jsx(rT,{placeholder:"Select a role"})}),e.jsx(XT,{children:g?.roles.map(t=>e.jsx(QT,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(hs,{progress:l,onClick:async()=>{const e=a.trim();if(!e)return void d("Email is required");/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(c(!0),await h(n,e,s).then(()=>{m("User invited successfully"),r?.()}).catch(e=>{console.error(e),d(e.message||"Failed to invite member")}).finally(()=>{c(!1),setTimeout(()=>{v()},6e3)})):d("Invalid email address format")},disabled:l||!a||!s,children:l?"Inviting...":`Invite as ${s}`})})]})}const rA=({workspace:t,section:r,setSection:n})=>e.jsxs("div",{className:"w-56 h-full flex flex-col px-2 py-2",children:[t&&e.jsx("div",{className:"mb-6 pb-4 border-b",children:e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[e.jsx("div",{className:"w-12 h-12 bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:"Account"}),e.jsxs("button",{className:Do("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","profile"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>n("profile"),children:[e.jsx(ds,{className:"h-4 w-4"})," Profile"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:"Workspace"}),e.jsxs("button",{className:Do("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","general"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>n("general"),children:[e.jsx(is,{className:"h-4 w-4"})," General"]}),e.jsxs("button",{className:Do("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","users"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>n("users"),children:[e.jsx(fs,{className:"h-4 w-4"})," Users"]}),e.jsxs("button",{className:Do("flex w-full text-left px-2 py-1 rounded text-sm items-center gap-x-2","features"===r?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-100"),onClick:()=>n("features"),children:[e.jsx(cs,{className:"h-4 w-4"})," Features"]})]})]}),nA=({workspace:r,onClose:n})=>{const[a,o]=t.useState(!1),[s,i]=t.useState("profile");return r?e.jsxs(bm,{open:a,onOpenChange:e=>{o(e),e||n()},children:[e.jsx(wm,{children:e.jsx(hs,{variant:"outline",size:"icon",children:e.jsx(is,{className:"h-4 w-4"})})}),e.jsxs(km,{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",children:[e.jsx(rA,{workspace:r,section:s,setSection:i}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsxs("h2",{className:"text-xl font-bold mb-4 capitalize",children:["profile"===s&&"Account","general"===s&&"Workspace Settings","users"===s&&"Workspace Members","features"===s&&"Workspace Features"]}),e.jsxs("div",{className:"max-h-[500px] overflow-y-auto",children:["profile"===s&&e.jsx(Lk,{workspace:r}),"general"===s&&e.jsx(_p,{workspace:r}),"users"===s&&e.jsx(eA,{workspace:r}),"features"===s&&e.jsx(Cp,{workspaceId:r._id?.toString()})]})]})]})]}):null};function aA(r){const{workspaces:n,currentWorkspace:a,loading:o,refreshing:s}=P(e=>e.workspaces),i=P(e=>e.auth.user),[l,c]=t.useState(!1),[u,d]=t.useState(0),[f,m]=t.useState(""),{fetchWorkspaces:h,getFeatures:p,refreshWorkspaces:g,setCurrentWorkspace:y}=cA();t.useEffect(()=>{h(),p()},[]),t.useEffect(()=>{g(),p()},[u]);const v=n.filter(e=>e.name.toLowerCase().includes(f.toLowerCase())),b=e=>e.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2);return e.jsxs(bm,{open:l,onOpenChange:c,children:[e.jsx(wm,{children:r.trigger?.(a)}),e.jsxs(km,{className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsx(Tm,{children:e.jsxs(Am,{className:"flex items-center gap-2",children:[e.jsx(Xo,{className:"h-5 w-5"}),"Switch Workspace"]})}),!i&&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."})}),i&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ss,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(_s,{placeholder:"Search workspaces...",value:f,onChange:e=>m(e.target.value),className:"pl-10"})]}),a&&e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Current Workspace"}),e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border-2 p-3 border-border bg-muted text-muted-foreground",children:[e.jsxs(qu,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(Ju,{src:a.image})}),e.jsx(Yu,{children:b(a.name)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium truncate",children:a.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(fs,{className:"h-3 w-3"}),e.jsxs("span",{children:[a.users?.length||0," members"]})]})]})]})]}),e.jsx(mp,{}),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 (",v.length,")"]}),e.jsx("div",{children:e.jsx(hs,{progress:s,disabled:s,variant:"outline",onClick:function(){d(e=>e+1)},startIcon:e.jsx(os,{}),children:s?"Refreshing...":"Refresh"})})]}),o?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(ns,{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===v.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Xo,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:f?"No workspaces found":"No workspaces available"})]}):e.jsx(ip,{className:"h-64",children:e.jsx("div",{className:"flex flex-col gap-2 my-2.5",children:v.map(t=>{const o=t?.users?.length||0,s=t.createdBy===i?.id,l=t._id===a?._id;return e.jsxs("div",{className:Do("w-full justify-start h-auto p-3 rounded-none flex border border-border ",l&&"bg-muted"),children:[e.jsxs(qu,{className:"h-8 w-8 mr-3",children:[e.jsx(Ju,{src:t.image}),e.jsx(Yu,{children:b(t.name)})]}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium truncate",children:t.name}),s&&e.jsx(ts,{className:"h-3 w-3 text-amber-500"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(fs,{className:"h-3 w-3"}),e.jsxs("span",{children:[o," member",1!==o?"s":""]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(hs,{size:"sm",disabled:l,onClick:async()=>{await r.onWorkspaceChange(t),y(t),c(!1)},children:l?"Current":"Switch to"}),e.jsx(nA,{workspace:t,onClose:()=>{if(a){const e=n.findIndex(e=>e._id?.toString()===a._id?.toString());-1!==e&&y(n[e])}}})]})]},t._id)})})})]}),e.jsx(mp,{}),e.jsx(oA,{onCreated:()=>{h()}})]})]})]})}function oA(r){const[n,a]=t.useState(!1),[o,s]=t.useState("emoji"),[i,l]=t.useState("🏢"),[c,u]=t.useState(!1),{createWorkspace:d}=cA(),f=kt({resolver:ka(_i({name:ni().min(2,{message:"Workspace name must be at least 2 characters."}),image:ni().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(bm,{open:n,onOpenChange:a,children:[e.jsx(wm,{children:e.jsxs(hs,{className:"w-full rounded-none",children:[e.jsx(as,{className:"h-4 w-4 mr-2"}),"Create New Workspace"]})}),e.jsxs(km,{className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(Tm,{children:[e.jsx(Am,{children:"Create New Workspace"}),e.jsx(Em,{children:"Create a new workspace to get started."})]}),e.jsx(ws,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===o)t=Np(i);else if("url"===o&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:"Please enter a valid URL"})}u(!0);try{await d(e.name,t),a(!1),f.reset(),l("🏢"),s("emoji"),r?.onCreated?.()}catch(e){console.error("Failed to create workspace:",e)}finally{u(!1)}}),children:[e.jsx(Ss,{control:f.control,name:"name",render:({field:t})=>e.jsxs(As,{children:[e.jsx(Es,{children:"Workspace Name"}),e.jsx(Cs,{children:e.jsx(_s,{placeholder:"My Awesome Workspace",...t})}),e.jsx(js,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(bs,{className:"text-sm font-medium",children:"Workspace Icon"}),e.jsx(Ns,{children:"Choose an emoji or upload a custom image for your workspace."})]}),e.jsxs(xh,{value:o,onValueChange:e=>s(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Sh,{value:"emoji",id:"emoji"}),e.jsxs(bs,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(ls,{className:"h-4 w-4"}),"Choose Emoji"]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Sh,{value:"url",id:"url"}),e.jsxs(bs,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-4 w-4"}),"Custom Image URL"]})]})]}),"emoji"===o&&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:i})]}),e.jsx(ip,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:jp.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{l(e),f.setValue("image",Np(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(i===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===o&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Ss,{control:f.control,name:"image",render:({field:t})=>e.jsxs(As,{children:[e.jsx(Es,{children:"Image URL"}),e.jsx(Cs,{children:e.jsx(_s,{placeholder:"https://example.com/image.png",...t})}),e.jsx(Ns,{children:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats."}),e.jsx(js,{})]})}),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(hs,{type:"button",variant:"outline",onClick:()=>{a(!1),f.reset(),l("🏢"),s("emoji")},disabled:c,children:"Cancel"}),e.jsx(hs,{type:"submit",disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(ns,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Workspace"})]})]})})]})]})}const sA="saas-workspace-current",iA=()=>l(sA),lA=(e,t)=>!!e&&t.some(t=>t._id===e),cA=()=>{const e=I(),r=P(e=>e.os),n=t.useMemo(()=>new Su(r),[r]),a=P(e=>e.workspaces);t.useEffect(()=>{if(!a.isInitialized){const t=iA();if(e.workspaces(B(!0)),t){const e=a.workspaces.find(e=>e._id===t);if(e){if(e._id===a.currentWorkspace?._id)return;o(e)}}}},[a.isInitialized,a.workspaces,a.currentWorkspace,e]);const o=t.useCallback(t=>{t._id!==a.currentWorkspace?._id&&t&&e.workspaces($(t))},[a.currentWorkspace,e]),s=t.useCallback(()=>{e.workspaces(W())},[e]),i=t.useCallback(async()=>{if(!a.loading){e.workspaces(Z(!0)),e.workspaces(H(null));try{const t=await n.getWorkspaces();if(e.workspaces(U(t)),t.length>0){const e=iA();if(e&&lA(e,t)){const r=t.find(t=>t._id===e);r&&o(r)}else t.length>0&&(a.currentWorkspace||o(t[0]))}}catch(t){e.workspaces(H(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(Z(!1))}}},[n,a.loading,a.currentWorkspace,e,o]),l=t.useCallback(async()=>{if(!a.refreshing){e.workspaces(G(!0));try{const t=await n.getWorkspaces();e.workspaces(U(t))}catch(e){}finally{e.workspaces(G(!1))}}},[n,a.refreshing,e]),c=t.useCallback(async(t,r)=>{const o=await n.createWorkspace({name:t,image:r});e.workspaces(U([...a.workspaces,o]))},[n,a.workspaces,e]),u=t.useCallback(async(t,r)=>{const o=await n.updateWorkspace(t._id,r);e.workspaces(U(a.workspaces.map(e=>e._id===t._id?o:e)))},[n,a.workspaces,e]),d=t.useCallback(async()=>{const t=await n.getFeatures();return e.workspaces(V(t)),t},[n,e]),f=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]);t.useEffect(()=>{if(a.currentWorkspace?._id){const e=a.workspaces.find(e=>e._id===a.currentWorkspace?._id);if(e){if(e._id===a.currentWorkspace._id)return;o(e)}else if(a.workspaces.length>0){if(a.workspaces[0]._id===a.currentWorkspace._id)return;o(a.workspaces[0])}}},[a.currentWorkspace?._id,a.workspaces,o]);const m=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),h=t.useCallback(async(e,t,r)=>await n.addUser(e,{email:t,role:r}),[n]),p=t.useCallback(async(e,t)=>await n.removeUser(e,t),[n]),g=t.useCallback(async(e,t,r)=>await n.updateUser(e,t,r),[n]),y=t.useCallback(async e=>await n.updateUserProfile(e),[n]),v=t.useCallback(async()=>await n.getProfile(),[n]),b=t.useCallback(async e=>await n.getWorkspace(e),[n]);return{workspaces:a.workspaces,loading:a.loading,error:a.error,fetchWorkspaces:i,refreshWorkspaces:l,refreshing:a.refreshing,WorkspaceSwitcher:aA,currentWorkspace:a.currentWorkspace,setCurrentWorkspace:o,resetCurrentWorkspace:s,createWorkspace:c,allFeatures:a.allFeatures,getFeatures:d,updateFeature:f,getWorkspace:b,switching:a.switching,updateWorkspace:u,getUsers:m,addUser:h,removeUser:p,updateUser:g,getProfile:v,updateUserProfile:y}};function uA(){const e=I(),r=P(e=>e.auth),n=P(e=>e.os),{serverUrl:a,orgId:o,auth:s}=n,{resetCurrentWorkspace:i}=cA(),l=t.useCallback(async()=>{e.auth(L());try{const t=await xu.post(`${a}/api/v1/auth/request`,{orgId:o,clientId:s?.clientId,redirect:{success:s?.redirectUrl||window.location.href,error:s?.redirectUrl||window.location.href}});if(!t.data.success)throw e.auth(F()),new Error(t.data.message||"Authentication failed");window.location.href=t.data.data.redirectUrl}catch(t){throw e.auth(F()),console.error("Sign in error:",t),t}},[a,o,s,e]),c=t.useCallback(async()=>{try{e.auth(z()),i()}catch(e){console.error("Logout error:",e)}},[e,i]);return t.useMemo(()=>({user:r.user,session:r.session,isLoading:r.isLoading,isAuthenticated:r.isAuthenticated,isRedirecting:r.isRedirecting,status:r.status,signIn:l,signOut:c}),[r,l,c])}exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:o="flex flex-col gap-1.5 w-full",language:s,customTexts:i={},autoFocus:l=!0,showSuccessMessage:c=!0,hideLogo:u=!1,hideTitles:d=!1})=>{const[f,m]=t.useState("en"),[h,p]=t.useState(!1),[g,y]=t.useState(!1),{submitBetaForm:v,isLoading:b,isSubmitting:w,error:x,config:S,success:k,message:T}=(()=>{const e=P(e=>e.os),[r,n]=t.useState(null),[a,o]=t.useState(!0),[s,i]=t.useState(!1),[l,c]=t.useState(null),[u,d]=t.useState(!1),[f,m]=t.useState(null);return t.useEffect(()=>{(async()=>{o(!0);const t=new Os(e),r=await t.fetchConfig();n(r),o(!1)})()},[e]),{isLoading:a,isSubmitting:s,config:r,error:l,success:u,message:f,submitBetaForm:t.useCallback(async t=>{if(!e){const e="SaaS OS context is not initialized";return c(e),{success:!1,message:e}}try{i(!0),c(null),d(!1),m(null);const r=new Os(e),n=await r.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return d(a),m(n.message),{success:a,message:n.message}}catch(e){const t=e instanceof Error?e.message:"Failed to submit beta form";return c(t),d(!1),m(t),{success:!1,message:t}}finally{i(!1)}},[e])}})();t.useEffect(()=>{m((()=>{if("undefined"==typeof window)return"en";const e=window.navigator.language.split("-")[0];return-1!==Object.keys(Ki).indexOf(e)?e:"en"})())},[]),t.useEffect(()=>{k&&c&&(p(!0),y(!0)),x&&y(!0)},[k,c,x]);const A={...Ki[s||f],...i},E=kt({resolver:ka(Gi),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{l&&E.setFocus("name")},[l,E]);const C=E.formState.isValid&&!w;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?e.jsxs("div",{className:Do("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",a),children:[e.jsx(Rs,{className:"h-24 w-24 rounded-lg"}),e.jsx(Rs,{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(Rs,{className:"h-4 w-16"}),e.jsx(Rs,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Rs,{className:"h-4 w-16"}),e.jsx(Rs,{className:"h-10 w-full"})]}),e.jsx(Rs,{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:[!u&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[S?.logo&&e.jsx(Ji,{logo:S?.logo}),S?.name&&e.jsx("div",{children:S?.name})]}),e.jsx(Re,{...E,children:e.jsxs("form",{onSubmit:E.handleSubmit(async e=>{try{const t=await v(e);t.success?(r?.(),E.reset(),c&&p(!0),y(!0)):(n?.(t.message),y(!0))}catch(e){n?.(e instanceof Error?e.message:A.errorMessage),y(!0)}}),className:a,noValidate:!0,"aria-busy":w,children:[!g&&e.jsxs(e.Fragment,{children:[!d&&S?.screen?.register&&e.jsx(qi,{screen:S?.screen?.register}),e.jsx(Ss,{control:E.control,name:"name",render:({field:t})=>e.jsxs(As,{className:o,children:[e.jsx(Es,{children:A.nameLabel}),e.jsx(Cs,{children:e.jsx(_s,{...t})}),e.jsx(Ns,{}),e.jsx(js,{})]})}),e.jsx(Ss,{control:E.control,name:"email",render:({field:t})=>e.jsxs(As,{className:o,children:[e.jsx(Es,{children:A.emailLabel}),e.jsx(Cs,{children:e.jsx(_s,{...t})}),e.jsx(Ns,{}),e.jsx(js,{})]})}),e.jsx(hs,{type:"submit",disabled:!C,className:o,children:w?A.submittingText:A.submitText})]}),g&&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(hs,{type:"button",onClick:()=>{y(!1),E.reset()},className:o,children:"Try Again"})})]}),g&&h&&T&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:S?.screen?.thankYou&&e.jsx(qi,{screen:S?.screen?.thankYou})})]})}),!g&&e.jsx("div",{children:e.jsxs("div",{children:["By submitting this form, you consent to our"," ",e.jsx("a",{href:S?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Privacy Policy"})," ","and"," ",e.jsx("a",{href:S?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:"Terms of Service"}),"."]})})]})})},exports.SaaSOSProvider=({serverUrl:t,version:r,orgId:n,auth:a,children:o})=>{const s={serverUrl:t,version:r,orgId:n};return e.jsx(M,{children:e.jsx(Y,{children:e.jsx(q,{config:s,auth:a,children:o})})})},exports.WhenAuthenticated=e=>{const{children:t}=e,{status:r}=uA();return r!==a.authenticated?null:t},exports.WhenRoles=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=uA();return n.includes(a?.role??"")?t:r||null},exports.WhenUnauthenticated=e=>{const{children:t}=e,{status:r}=uA();return r===a.authenticated?null:t},exports.WhenWorkspaceFeatureDisabled=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=cA(),a=n?.features?.[r];return a?null:t},exports.WhenWorkspaceFeatureEnabled=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=cA(),a=n?.features?.[r];return a?t:null},exports.WhenWorkspaceRoles=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=uA(),{currentWorkspace:o}=cA(),s=o?.users.find(e=>e._id===a?.id);return s&&n.includes(s?.role??"")?t:r||null},exports.WorkspaceSwitcher=aA,exports.useAppDispatch=I,exports.useAppSelector=P,exports.useSaaSAuth=uA,exports.useSaaSWorkspaces=cA;
|
|
30
|
+
//# sourceMappingURL=index.js.map
|