1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32773,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(49521),s="u"<typeof window,i=s?()=>{}:n.useLayoutEffect,a=s?()=>{}:n.useEffect;function o(e){let{headManager:t,reduceComponentsToState:r}=e;function o(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return s&&(t?.mountedInstances?.add(e.children),o()),i(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),i(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},17734,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return m},defaultHead:function(){return d}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(81258),a=e.r(44066),o=e.r(63645),l=a._(e.r(49521)),u=i._(e.r(32773)),c=e.r(37696);function d(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(63516);let f=["name","httpEquiv","charSet","itemProp"];function p(e){let t,r,n,s;return e.reduce(h,[]).reverse().concat(d().reverse()).filter((t=new Set,r=new Set,n=new Set,s={},e=>{let i=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?i=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?i=!1:r.add(e.type);break;case"meta":for(let t=0,r=f.length;t<r;t++){let r=f[t];if(e.props.hasOwnProperty(r))if("charSet"===r)n.has(r)?i=!1:n.add(r);else{let t=e.props[r],n=s[r]||new Set;
1("name"!==r||!a)&&n.has(t)?i=!1:(n.add(t),s[r]=n)}}}return i})).reverse().map((e,t)=>{let r=e.key||t;return l.default.cloneElement(e,{key:r})})}let m=function({children:e}){let t=(0,l.useContext)(c.HeadManagerContext);return(0,o.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},24453,(e,t,r)=>{"use strict";function n({widthInt:e,heightInt:t,blurWidth:r,blurHeight:s,blurDataURL:i,objectFit:a}){let o=r?40*r:e,l=s?40*s:t,u=o&&l?`viewBox='0 0 ${o} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${i}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},95757,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return a}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=["default","imgix","cloudinary","akamai","custom"],a={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},1143,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return u}}),e.r(63516);let n=e.r(61366),s=e.r(24453),i=e.r(95757),a=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:r=!1,priority:c=!1,preload:d=!1,loading:h,className:f,quality:p,width:m,height:g,fill:y=!1,style:b,overrideSrc:v,onLoad:w,onLoadingComplete:_,placeholder:k="empty",blurDataURL:x,fetchPriority:E,decoding:S="async",layout:T,objectFit:R,objectPosition:A,lazyBoundary:O,lazyRoot:C,...j},P){var I;let N,L,$,{imgConf:D,showAltText:U,blurComplete:B,defaultLoader:M}=P,F=D||i.imageConfigDefault;if("allSizes"in F)N=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),r=F.qualities?.sort((e,t)=>e-t);N={...F,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===M)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let z=j.loader||M;delete j.loader,delete j.srcSet;let q="__next_img_default"in z;if(q){if("custom"===N.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop. 2Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=z;z=t=>{let{config:r,...n}=t;return e(n)}}if(T){"fill"===T&&(y=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[T];e&&(b={...b,...e});let r={responsive:"100vw",fill:"100vw"}[T];r&&!t&&(t=r)}let V="",W=l(m),H=l(g);
2if((I=e)&&"object"==typeof I&&(o(I)||void 0!==I.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(L=t.blurWidth,$=t.blurHeight,x=x||t.blurDataURL,V=t.src,!y)if(W||H){if(W&&!H){let e=W/t.width;H=Math.round(t.height*e)}else if(!W&&H){let e=H/t.height;W=Math.round(t.width*e)}}else W=t.width,H=t.height}let K=!c&&!d&&("lazy"===h||void 0===h);(!(e="string"==typeof e?e:V)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,K=!1),N.unoptimized&&(r=!0),q&&!N.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let J=l(p),G=Object.assign(y?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:R,objectPosition:A}:{},U?{}:{color:"transparent"},b),X=B||"empty"===k?null:"blur"===k?`url("data:image/svg+xml;charset=utf-8,${(0,s.getImageBlurSvg)({widthInt:W,heightInt:H,blurWidth:L,blurHeight:$,blurDataURL:x||"",objectFit:G.objectFit})}")`:`url("${k}")`,Y=a.includes(G.objectFit)?"fill"===G.objectFit?"100% 100%":"cover":G.objectFit,Z=X?{backgroundSize:Y,backgroundPosition:G.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},Q=function({config:e,src:t,unoptimized:r,width:s,quality:i,sizes:a,loader:o}){if(r){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,n.getDeploymentId)();if(e){let r=t.indexOf("?");if(-1!==r){let n=new URLSearchParams(t.slice(r+1));n.get("dpl")||(n.append("dpl",e),t=t.slice(0,r)+"?"+n.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:u}=function({deviceSizes:e,allSizes:t},r,n){if(n){let r=/(^|\s)(1?\d?\d)vw/g,s=[];for(let e;e=r.exec(n);)s.push(parseInt(e[2]));if(s.length){let r=.01*Math.min(...s);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,s,a),c=l.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:l.map((r,n)=>`${o({config:e,src:t,quality:i,width:r})} ${"w"===u?r:n+1}${u}`).join(", "),src:o({config:e,src:t,quality:i,width:l[c]})}}({config:N,src:e,unoptimized:r,width:W,quality:J,sizes:t,loader:z}),ee=K?"lazy":h;return{props:{...j,loading:ee,fetchPriority:E,width:W,height:H,decoding:S,className:f,style:{...G,...Z},sizes:Q.sizes,srcSet:Q.srcSet,src:v||Q.src},meta:{unoptimized:r,preload:d||c,placeholder:k,fill:y}}}},87957,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let n=e.r(81258)._(e.r(49521)),s=e.r(95757),i=n.default.createContext(s.imageConfigDefault)},85928,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=e.r(81258)._(e.r(49521)).default.createContext(null)},64047,(e,t,r)=>{"use strict";function n(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,t.qualities[0]):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return n}})},19118,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let n=e.r(64047),s=e.r(61366);function i({config:e,src:t,width:r,quality:a}){let o=(0,s.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")){let e=t.indexOf("?");if(-1!==e){let r=new URLSearchParams(t.slice(e+1)),n=r.get("dpl");if(n){o=n,r.delete("dpl");let s=r.toString();t=t.slice(0,e)+(s?"?"+s:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns. 3Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,
3configurable:!0});let l=(0,n.findClosestQuality)(a,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${l}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}i.__next_img_default=!0;let a=i},75266,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(49521);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=i(e,n)),t&&(s.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},97366,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return w}});let n=e.r(81258),s=e.r(44066),i=e.r(63645),a=s._(e.r(49521)),o=n._(e.r(43614)),l=n._(e.r(17734)),u=e.r(1143),c=e.r(95757),d=e.r(87957);e.r(63516);let h=e.r(85928),f=n._(e.r(19118)),p=e.r(75266),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,r,n,s,i,a){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&s(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,s=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>s,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{s=!0,t.stopPropagation()}})}n?.current&&n.current(e)}}))}function y(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b=(0,a.forwardRef)(({src:e,srcSet:t,sizes:r,height:n,width:s,decoding:o,className:l,style:u,fetchPriority:c,placeholder:d,loading:h,unoptimized:f,fill:m,onLoadRef:b,onLoadingCompleteRef:v,setBlurComplete:w,setShowAltText:_,sizesInput:k,onLoad:x,onError:E,...S},T)=>{let R=(0,a.useCallback)(e=>{e&&(E&&(e.src=e.src),e.complete&&g(e,d,b,v,w,f,k))},[e,d,b,v,w,E,f,k]),A=(0,p.useMergedRef)(T,R);return(0,i.jsx)("img",{...S,...y(c),loading:h,width:s,height:n,decoding:o,"data-nimg":m?"fill":"1",className:l,style:u,sizes:r,srcSet:t,src:e,ref:A,onLoad:e=>{g(e.currentTarget,d,b,v,w,f,k)},onError:e=>{_(!0),"empty"!==d&&w(!0),E&&E(e)}})});function v({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...y(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,r),null):(0,i.jsx)(l.default,{children:(0,i.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let w=(0,a.forwardRef)((e,t)=>{let r=(0,a.useContext)(h.RouterContext),n=(0,a.useContext)(d.ImageConfigContext),s=(0,a.useMemo)(()=>{let e=m||n||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),s=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:s,localPatterns:"u"<typeof window?n?.localPatterns:e.localPatterns}},[n]),{onLoad:o,onLoadingComplete:l}=e,p=(0,a.useRef)(o);(0,a.useEffect)(()=>{p.current=o},[o]);let g=(0,a.useRef)(l);(0,a.useEffect)(()=>{g.current=l},[l]);let[y,w]=(0,a.useState)(!1),[_,k]=(0,a.useState)(!1),{props:x,meta:E}=(0,u.getImgProps)(e,{defaultLoader:f.default,imgConf:s,blurComplete:y,showAltText:_});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b,{...x,unoptimized:E.unoptimized,placeholder:E.placeholder,fill:E.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:w,setShowAltText:k,sizesInput:e.sizes,ref:t}),E.preload?(0,i.jsx)(v,{isAppRouter:!r,imgAttributes:x}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
3dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},31471,(e,t,r)=>{t.exports=e.r(50568)},18938,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(44066)._(e.r(4140)),a=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",o=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),s&&"/"!==s[0]&&(s="/"+s)):u||(u=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),s=s.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${s}${c}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return o(e)}},68605,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(87937),s=e.r(81999);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},91788,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},42908,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return v}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(44066),a=e.r(63645),o=i._(e.r(49521)),l=e.r(18938),u=e.r(32294),c=e.r(75266),d=e.r(87937),h=e.r(95603);e.r(63516);let f=e.r(9581),p=e.r(97762),m=e.r(68605),g=e.r(93803);function y(t){var r,n;let s,i,y,[v,w]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),_=(0,o.useRef)(null),{href:k,as:x,children:E,prefetch:S=null,passHref:T,replace:R,shallow:A,scroll:O,onClick:C,onMouseEnter:j,onTouchStart:P,legacyBehavior:I=!1,onNavigate:N,transitionTypes:L,ref:$,unstable_dynamicOnHover:D,...U}=t;s=E,I&&("string"==typeof s||"number"==typeof s)&&(s=(0,a.jsx)("a",{children:s}));let B=o.default.useContext(u.AppRouterContext),M=!1!==S,F=!1!==S?null===(n=S)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,z="string"==typeof(r=x||k)?r:(0,l.formatUrl)(r);if(I){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=o.default.Children.only(s)}let q=I?i&&"object"==typeof i&&i.ref:$,V=o.default.useCallback(e=>(null!==B&&(_.current=(0,p.mountLinkInstance)(e,z,B,F,M,w)),()=>{_.current&&((0,p.unmountLinkForCurrentNavigation)(_.current),_.current=null),(0,p.unmountPrefetchableInstance)(e)}),[M,z,B,F,w]),W={ref:(0,c.useMergedRef)(V,q),onClick(t){I||"function"!=typeof C||C(t),I&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!B||t.defaultPrevented||function(t,r,n,s,i,a,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(90663);o.default.startTransition(()=>{d(r,s?"replace":"push",!1===i?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,l)})}}(t,z,_,R,O,N,L)},onMouseEnter(e){I||"function"!=typeof j||j(e),I&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),B&&M&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){I||"function"!=typeof P||P(e),I&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),B&&M&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(z)?W.href=z:I&&!T&&("a"!==i.type||"href"in i.props)||(W.href=(0,h.addBasePath)(z)),y=I?o.default.cloneElement(i,W):(0,a.jsx)("a",{...U,...W,children:s}),(0,a.jsx)(b.Provider,{value:v,children:y})}e.r(91788);let b=(0,o.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,o.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
3dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},19455,22353,7284,75157,e=>{"use strict";let t,r,n,s,i;var a=e.i(63645),o=e.i(49521);function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){return t=>{let r=!1,n=e.map(e=>{let n=l(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():l(e[t],null)}}}}e.s(["composeRefs",0,u,"useComposedRefs",0,function(...e){return o.useCallback(u(...e),e)}],22353);var c=Symbol.for("react.lazy"),d=o[" use ".trim().toString()];function h(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===c&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var f=((i=o.forwardRef((e,t)=>{let{children:r,...n}=e;if(h(r)&&"function"==typeof d&&(r=d(r._payload)),o.isValidElement(r)){var s;let e,i,a=(s=r,(i=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(i=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,t){let r={...t};for(let n in t){let s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...e)=>{let t=i(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...i}:"className"===n&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==o.Fragment&&(l.ref=t?u(t,a):a),o.cloneElement(r,l)}return o.Children.count(r)>1?o.Children.only(null):null})).displayName="Slot.SlotClone",t=i,(r=o.forwardRef((e,r)=>{let{children:n,...s}=e;h(n)&&"function"==typeof d&&(n=d(n._payload));let i=o.Children.toArray(n),l=i.find(m);if(l){let e=l.props.children,n=i.map(t=>t!==l?t:o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null);return(0,a.jsx)(t,{...s,ref:r,children:o.isValidElement(e)?o.cloneElement(e,void 0,n):null})}return(0,a.jsx)(t,{...s,ref:r,children:n})})).displayName="Slot.Slot",r),p=Symbol("radix.slottable");function m(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===p}function g(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=function e(t){var r,n,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(r=0;r<i;r++)t[r]&&(n=e(t[r]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}(e))&&(n&&(n+=" "),n+=t);return n}e.s(["clsx",0,g,"default",0,g],7284);let y=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,b=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),v=[],w=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],s=r.nextPart.get(n);if(s){let r=w(e,t+1,s);if(r)return r}let i=r.validators;if(null===i)return;let a=0===t?e.join("-"):e.slice(t).join("-"),o=i.length;for(let e=0;e<o;e++){let t=i[e];if(t.validator(a))return t.classGroupId}},_=(e,t)=>{let r=b();for(let n in e)k(e[n],r,n,t);return r},k=(e,t,r,n)=>{let s=e.length;for(let i=0;i<s;i++)x(e[i],t,r,n)},x=(e,t,r,n)=>{"string"==typeof e?E(e,t,r):"function"==typeof e?S(e,t,r,n):T(e,t,r,n)},E=(e,t,r)=>{(""===e?t:R(t,e)).classGroupId=r},S=(e,t,r,n)=>{A(e)?k(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},T=(e,t,r,n)=>{let s=Object.entries(e),i=s.length;for(let e=0;e<i;e++){let[i,a]=s[e];k(a,R(t,i),r,n)}},R=(e,t)=>{let r=e,n=t.split("-"),s=n.length;for(let e=0;e<s;e++){let t=n[e],s=r.nextPart.get(t);s||(s=b(),r.nextPart.set(t,s)),r=s}return r},A=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,O=[],C=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),j=/\s+/,P=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=P(e[n]))&&(r&&(r+=" "),r+=t);return r},I=[],N=e=>{let t=t=>t[e]||I;return t.isThemeGetter=!0,t},L=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,D=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,U=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B=/\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$/,M=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>D.test(e),V=e=>!!e&&!Number.isNaN(Number(e)),W=e=>!!e&&Number.isInteger(Number(e)),H=e=>e.endsWith("%")&&V(e.slice(0,-1)),K=e=>U.test(e),J=()=>!0,G=e=>B.test(e)&&!M.test(e),X=()=>!1,Y=e=>F.test(e),Z=e=>z.test(e),Q=e=>!et(e)&&!eu(e),ee=e=>ey(e,e_,X),et=e=>L.test(e),er=e=>ey(e,ek,G),en=e=>ey(e,ex,V),es=e=>ey(e,eS,J),ei=e=>ey(e,eE,X),ea=e=>ey(e,ev,X),eo=e=>ey(e,ew,Z),el=e=>ey(e,eT,Y),eu=e=>$.test(e),ec=e=>eb(e,ek),ed=e=>eb(e,eE),eh=e=>eb(e,ev),ef=e=>eb(e,e_),ep=e=>eb(e,ew),em=e=>eb(e,eT,!0),eg=e=>eb(e,eS,!0),ey=(e,t,r)=>{let n=L.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},eb=(e,t,r=!1)=>{let n=$.exec(e);return!!n&&(n[1]?t(n[1]):r)},ev=e=>"position"===e||"percentage"===e,ew=e=>"image"===e||"url"===e,e_=e=>"length"===e||"size"===e||"bg-size"===e,ek=e=>"length"===e,ex=e=>"number"===e,eE=e=>"family-name"===e,eS=e=>"number"===e||"weight"===e,eT=e=>"shadow"===e,eR=((e,...t)=>{let r,n,s,i,a=e=>{let t=n(e);if(t)return t;let i=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:i}=t,a=[],o=e.trim().split(j),l="";for(let e=o.length-1;e>=0;
3e-=1){let t=o[e],{isExternal:u,modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(u){l=t+(l.length>0?" "+l:l);continue}let p=!!f,m=n(p?h.substring(0,f):h);if(!m){if(!p||!(m=n(h))){l=t+(l.length>0?" "+l:l);continue}p=!1}let g=0===c.length?"":1===c.length?c[0]:i(c).join(":"),y=d?g+"!":g,b=y+m;if(a.indexOf(b)>-1)continue;a.push(b);let v=s(m,p);for(let e=0;e<v.length;++e){let t=v[e];a.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return s(e,i),i};return i=o=>{var l;let u;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),s=(s,i)=>{r[s]=i,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(s(e,t),t):void 0},set(e,t){e in r?r[e]=t:s(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,s=0,i=0,a=e.length;for(let o=0;o<a;o++){let a=e[o];if(0===n&&0===s){if(":"===a){r.push(e.slice(i,o)),i=o+1;continue}if("/"===a){t=o;continue}}"["===a?n++:"]"===a?n--:"("===a?s++:")"===a&&s--}let o=0===r.length?e:e.slice(i),l=o,u=!1;return o.endsWith("!")?(l=o.slice(0,-1),u=!0):o.startsWith("!")&&(l=o.slice(1),u=!0),C(r,u,l,t&&t>i?t-i:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):C(O,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(l),sortModifiers:(u=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{u.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let s=e[n],i="["===s[0],a=u.has(s);i||a?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(s)):r.push(s)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return _(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,s;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(s=t.slice(0,n))?"arbitrary.."+s:void 0)}let n=e.split("-"),s=+(""===n[0]&&n.length>1);return w(n,s,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],s=r[e];if(t){if(s){let e=Array(s.length+t.length);for(let t=0;t<s.length;t++)e[t]=s[t];for(let r=0;r<t.length;r++)e[s.length+r]=t[r];return e}return t}return s||v}return r[e]||v}}})(l)}).cache.get,s=r.cache.set,i=a,a(o)},(...e)=>i(((...e)=>{let t,r,n=0,s="";for(;n<e.length;)(t=e[n++])&&(r=P(t))&&(s&&(s+=" "),s+=r);return s})(...e))})(()=>{let e=N("color"),t=N("font"),r=N("text"),n=N("font-weight"),s=N("tracking"),i=N("leading"),a=N("breakpoint"),o=N("container"),l=N("spacing"),u=N("radius"),c=N("shadow"),d=N("inset-shadow"),h=N("text-shadow"),f=N("drop-shadow"),p=N("blur"),m=N("perspective"),g=N("aspect"),y=N("ease"),b=N("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...w(),eu,et],k=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],E=()=>[eu,et,l],S=()=>[q,"full","auto",...E()],T=()=>[W,"none","subgrid",eu,et],R=()=>["auto",{span:["full",W,eu,et]},W,eu,et],A=()=>[W,"auto",eu,et],O=()=>["auto","min","max","fr",eu,et],C=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...E()],I=()=>[q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],L=()=>[q,"screen","full","dvw","lvw","svw","min","max","fit",...E()],$=()=>[q,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],D=()=>[e,eu,et],U=()=>[...w(),eh,ea,{position:[eu,et]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",ef,ee,{size:[eu,et]}],F=()=>[H,ec,er],z=()=>["","none","full",u,eu,et],G=()=>["",V,ec,er],X=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[V,H,eh,ea],ey=()=>["","none",p,eu,et],eb=()=>["none",V,eu,et],ev=()=>["none",V,eu,et],ew=()=>[V,eu,et],e_=()=>[q,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[K],breakpoint:[K],color:[J],container:[K],"drop-shadow":[K],ease:["in","out","in-out"],font:[Q],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[K],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[K],shadow:[K],spacing:["px",V],text:[K],"text-shadow":[K],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",q,et,eu,g]}
vendor: 6,076 bytes, line 3
3],container:["container"],columns:[{columns:[V,et,eu,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"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:_()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{"inset-s":S(),start:S()}],end:[{"inset-e":S(),end:S()}],"inset-bs":[{"inset-bs":S()}],"inset-be":[{"inset-be":S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[W,"auto",eu,et]}],basis:[{basis:[q,"full","auto",o,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[V,q,"auto","initial","none",et]}],grow:[{grow:["",V,eu,et]}],shrink:[{shrink:["",V,eu,et]}],order:[{order:[W,"first","last","none",eu,et]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...C(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...C()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":C()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[o,"screen",...I()]}],"min-w":[{"min-w":[o,"screen","none",...I()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",r,ec,er]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,eg,es]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",H,et]}],"font-family":[{font:[ed,ei,t]}],"font-features":[{"font-features":[et]}],"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:[s,eu,et]}],"line-clamp":[{"line-clamp":[V,"none",eu,en]}],leading:[{leading:[i,...E()]}],"list-image":[{"list-image":["none",eu,et]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",eu,et]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[V,"from-font","auto",eu,er]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[V,"auto",eu,et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",eu,et]}],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",eu,et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},W,eu,et],radial:["",eu,et],conic:[W,eu,et]},ep,eo]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:F()}
3],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-bs":[{"border-bs":G()}],"border-w-be":[{"border-be":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}
vendor: 5,581 bytes, line 3
3],"divide-color":[{divide:D()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[V,eu,et]}],"outline-w":[{outline:["",V,ec,er]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",c,em,el]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",d,em,el]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[V,er]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",h,em,el]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[V,eu,et]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"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":[V]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[eu,et]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[V]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",eu,et]}],filter:[{filter:["","none",eu,et]}],blur:[{blur:ey()}],brightness:[{brightness:[V,eu,et]}],contrast:[{contrast:[V,eu,et]}],"drop-shadow":[{"drop-shadow":["","none",f,em,el]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",V,eu,et]}],"hue-rotate":[{"hue-rotate":[V,eu,et]}],invert:[{invert:["",V,eu,et]}],saturate:[{saturate:[V,eu,et]}],sepia:[{sepia:["",V,eu,et]}],"backdrop-filter":[{"backdrop-filter":["","none",eu,et]}],"backdrop-blur":[{"backdrop-blur":ey()}],"backdrop-brightness":[{"backdrop-brightness":[V,eu,et]}],"backdrop-contrast":[{"backdrop-contrast":[V,eu,et]}],"backdrop-grayscale":[{"backdrop-grayscale":["",V,eu,et]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[V,eu,et]}],"backdrop-invert":[{"backdrop-invert":["",V,eu,et]}],"backdrop-opacity":[{"backdrop-opacity":[V,eu,et]}],"backdrop-saturate":[{"backdrop-saturate":[V,eu,et]}],"backdrop-sepia":[{"backdrop-sepia":["",V,eu,et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",eu,et]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[V,"initial",eu,et]}],ease:[{ease:["linear","initial",y,eu,et]}],delay:[{delay:[V,eu,et]}],animate:[{animate:["none",b,eu,et]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,eu,et]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:eb()}],"rotate-x":[{"rotate-x":eb()}],"rotate-y":[{"rotate-y":eb()}],"rotate-z":[{"rotate-z":eb()}],scale:[{scale:ev()}],"scale-x":[{"scale-x":ev()}],"scale-y":[{"scale-y":ev()}],"scale-z":[{"scale-z":ev()}],"scale-3d":["scale-3d"],skew:[{skew:ew()}],"skew-x":[{"skew-x":ew()}],"skew-y":[{"skew-y":ew()}],transform:[{transform:[eu,et,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:e_()}],"translate-x":[{"translate-x":e_()}],"translate-y":[{"translate-y":e_()}],"translate-z":[{"translate-z":e_()}
3],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"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",eu,et]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",eu,et]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[V,ec,er,en]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function eA(...e){return eR(g(e))}e.s(["cn",0,eA],75157);let eO=(n="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s={variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==s?void 0:s.variants)==null)return g(n,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:r,defaultVariants:i}=s,a=Object.keys(r).map(t=>{let n=null==e?void 0:e[t],s=null==i?void 0:i[t];if(null===n)return null;let a=y(n)||y(s);return r[t][a]}),o=e&&Object.entries(e).reduce((e,t)=>
3{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return g(n,a,null==s||null==(t=s.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...o}[t]):({...i,...o})[t]===r})?[...e,r,n]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)});e.s(["Button",0,function({className:e,variant:t,size:r,asChild:n=!1,...s}){return(0,a.jsx)(n?f:"button",{"data-slot":"button",className:eA(eO({variant:t,size:r,className:e})),...s})},"buttonVariants",0,eO],19455)},14204,e=>{"use strict";var t=e.i(63645),r=e.i(49521),n=e.i(83979),s=e.i(31471),i=r["use".trim()],a=e.i(17210);function o(e){let t;return("object"==typeof e?null==e.host&&null==e.hostname:!/^[a-z]+:/i.test(e))&&(null==(t="object"==typeof e?e.pathname:e)||!!t.startsWith("/"))}function l(e,t){return e.replace(RegExp(`^${t}`),"")||"/"}function u(e,t){return t===e||t.startsWith(`${e}/`)}function c(e,t,r){return"string"==typeof e?e:e[t]||r}function d(e){let t=function(){try{return"true"===a.default.env._next_intl_trailing_slash}catch{return!1}}(),[r,...n]=e.split("#"),s=n.join("#"),i=r;if("/"!==i){let e=i.endsWith("/");t&&!e?i+="/":!t&&e&&(i=i.slice(0,-1))}return s&&(i+="#"+s),i}function h(e,t){let r,n=d(e),s=d(t);return(r=n.replace(/\/\[\[(\.\.\.[^\]]+)\]\]/g,"(?:/(.*))?").replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"(?:/(.*))?").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)"),RegExp(`^${r}$`)).test(s)}function f(e,t){return"never"!==t.mode&&t.prefixes?.[e]||"/"+e}function p(e){return e.includes("[[...")}function m(e){return e.includes("[...")}function g(e){return e.includes("[")}function y(e,t){let r=e.split("/"),n=t.split("/"),s=Math.max(r.length,n.length);for(let e=0;e<s;e++){let t=r[e],s=n[e];if(!t&&s)return -1;if(t&&!s)return 1;if(t||s){if(!g(t)&&g(s))return -1;if(g(t)&&!g(s))return 1;if(!m(t)&&m(s))return -1;if(m(t)&&!m(s))return 1;if(!p(t)&&p(s))return -1;if(p(t)&&!p(s))return 1}}return 0}var b=e.i(42908);function v(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(e=>{t.append(r,String(e))}):t.set(r,String(n));return"?"+t.toString()}function w(e,t,r,n){if(!e||n===r||null==n||!t)return;let s=function(e,t=window.location.pathname){return"/"===e?t:t.replace(e,"")}(t),{name:i,...a}=e;a.path||(a.path=""!==s?s:"/");let o=`${i}=${n};`;for(let[e,t]of Object.entries(a))o+=`${"maxAge"===e?"max-age":e}`,"boolean"!=typeof t&&(o+="="+t),o+=";";document.cookie=o}var _=(0,r.forwardRef)(function({href:e,locale:r,localeCookie:i,onClick:a,prefetch:o,...l},u){let c=(0,n.useLocale)(),d=null!=r&&r!==c,h=(0,s.usePathname)();return d&&(o=!1),(0,t.jsx)(b.default,{ref:u,href:e,hrefLang:d?r:void 0,onClick:function(e){w(i,h,c,r),a&&a(e)},prefetch:o,...l})});let{Link:k,redirect:x,usePathname:E,useRouter:S,getPathname:T}=function(e){let{Link:a,config:p,getPathname:m,...g}=function(e,n){var a,l,u;let h={...a=n||{},localePrefix:"object"==typeof(u=a.localePrefix)?u:{mode:u||"always"},localeCookie:!!((l=a.localeCookie)??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof l&&l},localeDetection:a.localeDetection??!0,alternateLinks:a.alternateLinks??!0},p=h.pathnames,m=(0,r.forwardRef)(function({href:r,locale:n,...s},a){let l,u;"object"==typeof r?(l=r.pathname,u=r.params):l=r;let c=o(r),d=e(),f="function"==typeof d.then?i(d):d,m=c?g({locale:n||f,href:null==p?l:{pathname:l,params:u},forcePrefix:null!=n||void 0}):l;return(0,t.jsx)(_,{ref:a,href:"object"==typeof r?{...r,pathname:m}:m,locale:n,localeCookie:h.localeCookie,...s})});function g(e){let t,{forcePrefix:r,href:n,locale:s}=e;return null==p?"object"==typeof n?(t=n.pathname,n.query&&(t+=v(n.query))):t=n:t=function({pathname:e,locale:t,params:r,pathnames:n,query:s}){function i(e){let i,a=n[e];return a?(i=c(a,t,e),r&&Object.entries(r).forEach(([e,t])=>{let r,n;Array.isArray(t)?(r=`(\\[)?\\[...${e}\\](\\])?`,n=t.map(e=>String(e)).join("/")):(r=`\\[${e}\\]`,n=String(t)),i=i.replace(RegExp(r,"g"),n)}),i=new URL(i=i.replace(/\[\[\.\.\..+\]\]/g,""),"http://l").pathname):i=e,i=d(i),s&&(i+=v(s)),i}if("string"==typeof e)return i(e);{let{pathname:t,...r}=e;return{...r,pathname:i(t)}}}({locale:s,..."string"==typeof n?{pathname:n}:n,pathnames:h.pathnames}),function(e,t,r,n){var s,i;let a,l,{mode:u}=r.localePrefix;return void 0!==n?a=n:o(e)&&("always"===u?a=!0:"as-needed"===u&&(a=r.domains?!r.domains.some(e=>e.defaultLocale===t):t!==r.defaultLocale)),a?(s=f(t,r.localePrefix),i=e,l=s,/^\/(\?.*)?$/.test(i)&&(i=i.slice(1)),l+=i):e}(t,s,h,r)}function y(e){return function(t,...r){return e(g(t),...r)}}return{config:h,Link:m,redirect:y(s.redirect),permanentRedirect:y(s.permanentRedirect),getPathname:g}}(n.useLocale,e);return{...g,Link:a,usePathname:function(){let e,t,i=(e=(0,s.usePathname)(),t=(0,n.useLocale)(),(0,r.useMemo)(()=>
3{if(!e)return e;let r=e,n=f(t,p.localePrefix);if(u(n,e))r=l(e,n);else if("never"!==p.localePrefix.mode&&p.localePrefix.prefixes){let n="/"+t;u(n,e)&&(r=l(e,n))}return r},[p.localePrefix,t,e])),a=(0,n.useLocale)();return(0,r.useMemo)(()=>i&&p.pathnames?function(e,t,r){let n=Object.keys(r).sort(y),s=decodeURI(t);for(let t of n){let n=r[t];if("string"==typeof n){if(h(n,s))return t}else if(h(c(n,e,t),s))return t}return t}(a,i,p.pathnames):i,[a,i])},useRouter:function(){let e=(0,s.useRouter)(),t=(0,n.useLocale)(),i=(0,s.usePathname)();return(0,r.useMemo)(()=>{function r(e){return function(r,n){let{locale:s,...a}=n||{},o=[m({href:r,locale:s||t,forcePrefix:null!=s||void 0})];Object.keys(a).length>0&&o.push(a),w(p.localeCookie,i,t,s),e(...o)}}return{...e,push:r(e.push),replace:r(e.replace),prefetch:r(e.prefetch)}},[t,i,e])},getPathname:m}}({locales:["en","fi"],defaultLocale:"fi",localePrefix:"as-needed",localeDetection:!1});var R=e.i(19455),A=e.i(75157);e.s(["default",0,function(){let[e,s]=r.default.useTransition(),i=S(),a=E(),o=(0,n.useLocale)(),l=e=>{s(()=>{i.replace({pathname:a},{locale:e})})};return(0,t.jsxs)("div",{className:"flex items-center bg-muted rounded-lg p-1 shadow-sm border border-border",children:[(0,t.jsxs)(R.Button,{variant:"ghost",size:"sm",className:(0,A.cn)("relative transition-all duration-200 cursor-pointer","text-xs px-2 py-1 sm:text-sm sm:px-3 sm:py-2","fi"===o?"bg-background text-foreground shadow-sm hover:bg-muted":"hover:bg-[var(--accent-light)]/50"),onClick:()=>l("fi"),disabled:e,"aria-label":"Switch to Finnish",children:["Suomi","fi"===o&&(0,t.jsx)("div",{className:"absolute inset-0 rounded-md ring-2 ring-primary/20 pointer-events-none"})]}),(0,t.jsx)("div",{className:"w-px h-4 bg-border mx-1"}),(0,t.jsxs)(R.Button,{variant:"ghost",size:"sm",className:(0,A.cn)("relative transition-all duration-200 cursor-pointer","text-xs px-2 py-1 sm:text-sm sm:px-3 sm:py-2","en"===o?"bg-background text-foreground shadow-sm hover:bg-muted":"hover:bg-[var(--accent-light)]/50"),onClick:()=>l("en"),disabled:e,"aria-label":"Switch to English",children:["English","en"===o&&(0,t.jsx)("div",{className:"absolute inset-0 rounded-md ring-2 ring-primary/20 pointer-events-none"})]})]})}],14204)},17311,(e,t,r)=>{var n={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,i=l(e),a=i[0],o=i[1],u=new s((a+o)*3/4-o),c=0,d=o>0?a-4:a;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,i=[],a=0,o=n-s;a<o;a+=16383)i.push(function(e,t,n){for(var s,i=[],a=t;a<n;a+=3)s=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(r[s>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}(e,a,a+16383>o?o:a+16383));return 1===s?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===s&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],n=[],s="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=i.length;a<o;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),s=r(783),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,s=t;if(("string"!=typeof s||""===s)&&(s="utf8"),!o.isEncoding(s))throw TypeError("Unknown encoding: "+s);var i=0|f(n,s),l=a(i),u=l.write(n,s);return u!==i&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,r);var p=function(e){if(o.isBuffer(e)){var t=0|h(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');
vendor: 16,509 bytes, line 3
3if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(e).length;default:if(s)return n?-1:S(e).length;t=(""+t).toLowerCase(),s=!0}}function p(e,t,r){var s,i,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var s="",i=t;i<r;++i)s+=C[e[i]];return s}(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var s=t;s<r;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var s=t;s<r;++s)n+=String.fromCharCode(e[s]);return n}(this,t,r);case"base64":return s=this,i=t,a=r,0===i&&a===s.length?n.fromByteArray(s):n.fromByteArray(s.slice(i,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),s="",i=0;i<n.length;i+=2)s+=String.fromCharCode(n[i]+256*n[i+1]);return s}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,s){var i;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(s)return -1;else r=e.length-1;else if(r<0)if(!s)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,s);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,n,s)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,s){var i,a=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var c=-1;for(i=r;i<o;i++)if(u(e,i)===u(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*a}else -1!==c&&(i-=i-c),c=-1}else for(r+l>o&&(r=o-l),i=r;i>=0;i--){for(var d=!0,h=0;h<l;h++)if(u(e,i+h)!==u(t,h)){d=!1;break}if(d)return i}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,s=0,i=Math.min(r,n);s<i;++s)if(e[s]!==t[s]){r=e[s],n=t[s];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),s=0;for(r=0;r<e.length;++r){var i=e[r];if(O(i,Uint8Array)&&(i=o.from(i)),!o.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,s),s+=i.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(o.prototype[i]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,s){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var i=s-n,a=r-t,l=Math.min(i,a),u=this.slice(n,s),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){i=u[d],a=c[d];break}return i<a?-1:+(a<i)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function b(e,t,r){r=Math.min(e.length,r);for(var n=[],s=t;s<r;){var i,a,o,l,u=e[s],c=null,d=u>239?4:u>223?3:u>191?2:1;if(s+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(i=e[s+1]))==128&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[s+1],a=e[s+2],(192&i)==128&&(192&a)==128&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[s+1],a=e[s+2],o=e[s+3],(192&i)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),s+=d}var h=n,f=h.length;if(f<=4096)return String.fromCharCode.apply(String,h);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,h.slice(m,m+=4096));return p}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,s,i){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<i)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function _(e,t,r,n,s,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,i){return t*=1,r>>>=0,i||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,i){return t*=1,r>>>=0,i||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,i,a,o,l,u,c,d,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var o,l=parseInt(t.substr(2*a,2),16);if((o=l)!=o)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return s=t,i=r,A(S(e,this.length-s),this,s,i);case"ascii":return a=t,o=r,A(T(e),this,a,o);case"latin1":case"binary":return function(e,t,r,n){return A(T(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,A(R(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,A(function(e,t){for(var r,n,s=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,s.push(r%256),s.push(n);return s}(e,this.length-c),this,c,d);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],s=1,i=0;++i<t&&(s*=256);)n+=this[e+i]*s;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],s=1,i=0;++i<t&&(s*=256);)n+=this[e+i]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,s=1,i=this[e+--n];n>0&&(s*=256);)i+=this[e+--n]*s;return i>=(s*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),s.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),s.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),s.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),s.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;w(this,e,t,r,s,0)}var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;w(this,e,t,r,s,0)}var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);w(this,e,t,r,s-1,-s)}var i=0,a=1,o=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);w(this,e,t,r,s-1,-s)}var i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var s=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=s-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var s,i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),l=a.length;
3if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=a[s%l]}return this};var E=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,n=e.length,s=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!s){if(r>56319||a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&i.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function T(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function R(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,r,n){for(var s=0;s<n&&!(s+r>=t.length)&&!(s>=e.length);++s)t[s+r]=e[s];return s}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,s=0;s<16;++s)t[n+s]=e[r]+e[s];return t}()},783:function(e,t){t.read=function(e,t,r,n,s){var i,a,o=8*s-n-1,l=(1<<o)-1,u=l>>1,c=-7,d=r?s-1:0,h=r?-1:1,f=e[t+d];for(d+=h,i=f&(1<<-c)-1,f>>=-c,c+=o;c>0;i=256*i+e[t+d],d+=h,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),i-=u}return(f?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,s,i){var a,o,l,u=8*i-s-1,c=(1<<u)-1,d=c>>1,h=5960464477539062e-23*(23===s),f=n?0:i-1,p=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=h/l:t+=h*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=c?(o=0,a=c):a+d>=1?(o=(t*l-1)*Math.pow(2,s),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,s),a=0));s>=8;e[r+f]=255&o,f+=p,o/=256,s-=8);for(a=a<<s|o,u+=s;u>0;e[r+f]=255&a,f+=p,a/=256,u-=8);e[r+f-p]|=128*m}}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},a=!0;try{n[e](r,r.exports,i),a=!1}finally{a&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/buffer/",t.exports=i(72)},22792,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.parseCookie=d,r.parse=d,r.stringifyCookie=function(e,t){let r=t?.encode||encodeURIComponent,n=[];for(let t of Object.keys(e)){let a=e[t];if(void 0===a)continue;if(!s.test(t))throw TypeError(`cookie name is invalid: ${t}`);let o=r(a);if(!i.test(o))throw TypeError(`cookie val is invalid: ${a}`);n.push(`${t}=${o}`)}return n.join("; ")},r.stringifySetCookie=h,r.serialize=h,r.parseSetCookie=function(e,t){let r=t?.decode||g,n=e.length,s=f(e,0,n),i=p(e,0,s),a=-1===i?{name:"",value:r(m(e,0,s))}:{name:m(e,0,i),value:r(m(e,i+1,s))},o=s+1;for(;o<n;){let t=f(e,o,n),r=p(e,o,t),s=-1===r?m(e,o,t):m(e,o,r),i=-1===r?void 0:m(e,r+1,t);switch(s.toLowerCase()){case"httponly":a.httpOnly=!0;break;case"secure":a.secure=!0;break;case"partitioned":a.partitioned=!0;break;case"domain":a.domain=i;break;case"path":a.path=i;break;case"max-age":i&&l.test(i)&&(a.maxAge=Number(i));break;case"expires":if(!i)break;let u=new Date(i);Number.isFinite(u.valueOf())&&(a.expires=u);break;case"priority":if(!i)break;let c=i.toLowerCase();("low"===c||"medium"===c||"high"===c)&&(a.priority=c);break;case"samesite":if(!i)break;let d=i.toLowerCase();("lax"===d||"strict"===d||"none"===d)&&(a.sameSite=d)}o=t+1}return a},r.stringifySetCookie=h,r.serialize=h;let s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,l=/^-?\d+$/,u=Object.prototype.toString,c=((n=function(){}).prototype=Object.create(null),n);function d(e,t){let r=new c,n=e.length;if(n<2)return r;let s=t?.decode||g,i=0;do{let t=p(e,i,n);if(-1===t)break;let a=f(e,i,n);if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}let o=m(e,i,t);void 0===r[o]&&(r[o]=s(m(e,t+1,a))),i=a+1}while(i<n)return r}function h(e,t,r){let n="object"==typeof e?e:{...r,name:e,value:String(t)},l=("object"==typeof t?t:r)?.encode||encodeURIComponent;
3if(!s.test(n.name))throw TypeError(`argument name is invalid: ${n.name}`);let c=n.value?l(n.value):"";if(!i.test(c))throw TypeError(`argument val is invalid: ${n.value}`);let d=n.name+"="+c;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw TypeError(`option maxAge is invalid: ${n.maxAge}`);d+="; Max-Age="+n.maxAge}if(n.domain){if(!a.test(n.domain))throw TypeError(`option domain is invalid: ${n.domain}`);d+="; Domain="+n.domain}if(n.path){if(!o.test(n.path))throw TypeError(`option path is invalid: ${n.path}`);d+="; Path="+n.path}if(n.expires){var h;if(h=n.expires,"[object Date]"!==u.call(h)||!Number.isFinite(n.expires.valueOf()))throw TypeError(`option expires is invalid: ${n.expires}`);d+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(d+="; HttpOnly"),n.secure&&(d+="; Secure"),n.partitioned&&(d+="; Partitioned"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":d+="; Priority=Low";break;case"medium":d+="; Priority=Medium";break;case"high":d+="; Priority=High";break;
3default:throw TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"none":d+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${n.sameSite}`)}return d}function f(e,t,r){let n=e.indexOf(";",t);return -1===n?r:n}function p(e,t,r){let n=e.indexOf("=",t);return n<r?n:-1}function m(e,t,r){let n=t,s=r;do{let t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<s)for(;s>n;){let t=e.charCodeAt(s-1);if(32!==t&&9!==t)break;s--}return e.slice(n,s)}function g(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},81162,e=>{"use strict";let t,r,n,s,i,a,o,l,u,c,d;var h,f,p,m,g,y,b,v,w,_,k,x,E,S,T,R,A,O,C,j,P,I,N,L,$,D=e.i(63645),U=e.i(49521),B=e.i(83979);function M(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let F=M(0,B.useTranslations);M(0,B.useFormatter);var z=e.i(75157);let q=({name:e,value:t})=>{let r=F("Countdown");return(0,D.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,D.jsx)("p",{className:"text-2xl md:text-4xl",children:t>0?t:0}),(0,D.jsx)("p",{className:"mt-1 text-md md:text-xl",children:r(e)})]})},V=({date:e,handleSetView:t,className:r,showDeadlineText:n=!1})=>{let s=F("Countdown"),i=new Date().toISOString(),[a,o,l,u]=(e=>{let t,r=new Date(e).getTime(),[n,s]=U.default.useState(r-new Date().getTime());return U.default.useEffect(()=>{let e=setInterval(()=>{s(r-new Date().getTime())},1e3);return()=>clearInterval(e)},[r]),[Math.floor((t=n)/864e5),Math.floor(t%864e5/36e5),Math.floor(t%36e5/6e4),Math.floor(t%6e4/1e3)]})(e??i);return U.default.useEffect(()=>{a+o+l+u<=0&&t()},[a,o,l,u,t]),(0,D.jsxs)("div",{className:(0,z.cn)("flex items-center gap-2",r),children:[(0,D.jsx)(q,{name:"days",value:a}),(0,D.jsx)(q,{name:"hours",value:o}),(0,D.jsx)(q,{name:"minutes",value:l}),(0,D.jsx)(q,{name:"seconds",value:u}),n?(0,D.jsx)("p",{className:"mt-1 text-md md:text-xl",children:s("time left to submit questions")}):null]})};function W({round:e,competition:t,setView:r}){let n=F("OpeningView"),s="fi"===(0,B.useLocale)()?t?.name_fi:t?.name_en;return t&&e?(0,D.jsx)("main",{className:"flex-1",children:(0,D.jsxs)("div",{className:"flex justify-center items-center flex-col h-full w-full px-6",children:[(0,D.jsx)("h1",{className:"uppercase mb-6 text-2xl md:text-3xl font-bold text-center",children:s}),(0,D.jsx)("p",{className:"mt-8 mb-6 text-xl md:text-2xl",children:n("opening-message")}),(0,D.jsx)(V,{date:e.opened_at??"",handleSetView:()=>{r("main")}})]})}):(0,D.jsx)("main",{className:"flex-1",children:(0,D.jsx)("div",{className:"flex justify-center items-center flex-col h-full w-full px-6",children:(0,D.jsx)("p",{children:"Something went wrong"})})})}function H(){let e=F("DeadlineView");return(0,D.jsx)("main",{className:"flex-1",children:(0,D.jsx)("div",{className:"flex justify-center items-center h-full w-full px-6",children:(0,D.jsx)("p",{className:"mt-8 text-2xl",children:e("deadline-message")})})})}let K=({href:e})=>{let t=F("MainView");return(0,D.jsxs)("a",{href:e,className:"flex items-center gap-4 transition-colors duration-300 ease-in-out",children:[(0,D.jsx)("div",{className:"relative w-6 rotate-[-90deg]",children:(0,D.jsx)("svg",{fill:"none",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:(0,D.jsx)("g",{clipPath:"url(#a)",fill:"#000",children:(0,D.jsx)("path",{d:"m15.528 0.33032 3.9838 0.87719-9.9345 47.873-3.914-0.8772 9.8648-47.873zm9.4863 0 9.8748 47.873-3.9141 0.8772-9.9594-47.873 3.9987-0.87719z"})})})}),(0,D.jsx)("h1",{className:"text-xl md:text-2xl hover:underline",children:t("back-link")})]})};function J(e,t=[]){let r=[],n=()=>{let t=r.map(e=>U.createContext(e));return function(r){let n=r?.[e]||t;return U.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let s=U.createContext(n),i=r.length;r=[...r,n];let a=t=>{let{scope:r,children:n,...a}=t,o=r?.[e]?.[i]||s,l=U.useMemo(()=>a,Object.values(a));return(0,D.jsx)(o.Provider,{value:l,children:n})};return a.displayName=t+"Provider",[a,function(r,a){let o=a?.[e]?.[i]||s,l=U.useContext(o);if(l)return l;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let s=r(e)[`__scope${n}`];return{...t,...s}},{});return U.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}var G=e.i(22353);function X(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}"u">typeof window&&window.document&&window.document.createElement;var Y=globalThis?.document?U.useLayoutEffect:()=>{},Z=U[" useId ".trim().toString()]||(()=>void 0),Q=0;function ee(e){let[t,r]=U.useState(Z());return Y(()=>{e||r(e=>e??String(Q++))},[e]),e||(t?`radix-${t}`:"")}U[" useEffectEvent ".trim().toString()],U[" useInsertionEffect ".trim().toString()];var et=U[" useInsertionEffect ".trim().toString()]||Y;function er({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[s,i,a]=function({defaultProp:e,onChange:t}){let[r,n]=U.useState(e),s=U.useRef(r),i=U.useRef(t);return et(()=>{i.current=t},[t]),U.useEffect(()=>{s.current!==r&&(i.current?.(r),s.current=r)},[r,s]),[r,n,i]}({defaultProp:t,onChange:r}),o=void 0!==e,l=o?e:s;{let t=U.useRef(void 0!==e);U.useEffect(()=>{let e=t.current;
3if(e!==o){let t=o?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. 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=o},[o,n])}return[l,U.useCallback(t=>{if(o){let r="function"==typeof t?t(e):t;r!==e&&a.current?.(r)}else i(t)},[o,e,i,a])]}Symbol("RADIX:SYNC_STATE");var en=e.i(43614);function es(e){var t;let r,n=(t=e,(r=U.forwardRef((e,t)=>{let{children:r,...n}=e;if(U.isValidElement(r)){var s;let e,i,a=(s=r,(i=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(i=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),o=function(e,t){let r={...t};for(let n in t){let s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...e)=>{let t=i(...e);return s(...e),t}:s&&(r[n]=s):"style"===n?r[n]={...s,...i}:"className"===n&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==U.Fragment&&(o.ref=t?(0,G.composeRefs)(t,a):a),U.cloneElement(r,o)}return U.Children.count(r)>1?U.Children.only(null):null})).displayName=`${t}.SlotClone`,r),s=U.forwardRef((e,t)=>{let{children:r,...s}=e,i=U.Children.toArray(r),a=i.find(ea);if(a){let e=a.props.children,r=i.map(t=>t!==a?t:U.Children.count(e)>1?U.Children.only(null):U.isValidElement(e)?e.props.children:null);return(0,D.jsx)(n,{...s,ref:t,children:U.isValidElement(e)?U.cloneElement(e,void 0,r):null})}return(0,D.jsx)(n,{...s,ref:t,children:r})});return s.displayName=`${e}.Slot`,s}var ei=Symbol("radix.slottable");function ea(e){return U.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ei}var eo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=es(`Primitive.${t}`),n=U.forwardRef((e,n)=>{let{asChild:s,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,D.jsx)(s?r:t,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function el(e){let t=U.useRef(e);return U.useEffect(()=>{t.current=e}),U.useMemo(()=>(...e)=>t.current?.(...e),[])}var eu="dismissableLayer.update",ec=U.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ed=U.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...l}=e,u=U.useContext(ec),[c,d]=U.useState(null),h=c?.ownerDocument??globalThis?.document,[,f]=U.useState({}),p=(0,G.useComposedRefs)(t,e=>d(e)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=c?m.indexOf(c):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,w=b>=y,_=function(e,t=globalThis?.document){let r=el(e),n=U.useRef(!1),s=U.useRef(()=>{});return U.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){ef("dismissableLayer.pointerDownOutside",r,i,{discrete:!0})},i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",s.current),s.current=n,t.addEventListener("click",s.current,{once:!0})):n()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let t=e.target,r=[...u.branches].some(e=>e.contains(t));w&&!r&&(s?.(e),a?.(e),e.defaultPrevented||o?.())},h),k=function(e,t=globalThis?.document){let r=el(e),n=U.useRef(!1);return U.useEffect(()=>{let e=e=>{e.target&&!n.current&&ef("dismissableLayer.focusOutside",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=>{let t=e.target;![...u.branches].some(e=>e.contains(t))&&(i?.(e),a?.(e),e.defaultPrevented||o?.())},h);return!function(e,t=globalThis?.document){let r=el(e);U.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&o&&(e.preventDefault(),o()))},h),U.useEffect(()=>{if(c)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(O=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),eh(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=O)}},[c,h,r,u]),U.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),eh())},[c,u]),U.useEffect(()=>{let e=()=>f({});return document.addEventListener(eu,e),()=>document.removeEventListener(eu,e)},[]),(0,D.jsx)(eo.div,{...l,ref:p,style:{pointerEvents:v?w?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,k.onFocusCapture),onBlurCapture:X(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,_.onPointerDownCapture)})});function eh(){let e=new CustomEvent(eu);document.dispatchEvent(e)}function ef(e,t,r,{discrete:n}){let s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&s.addEventListener(e,t,{once:!0}),n)s&&en.flushSync(()=>s.dispatchEvent(i));else s.dispatchEvent(i)}ed.displayName="DismissableLayer",U.forwardRef((e,t)=>
3{let r=U.useContext(ec),n=U.useRef(null),s=(0,G.useComposedRefs)(t,n);return U.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,D.jsx)(eo.div,{...e,ref:s})}).displayName="DismissableLayerBranch";var ep="focusScope.autoFocusOnMount",em="focusScope.autoFocusOnUnmount",eg={bubbles:!1,cancelable:!0},ey=U.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[o,l]=U.useState(null),u=el(s),c=el(i),d=U.useRef(null),h=(0,G.useComposedRefs)(t,e=>l(e)),f=U.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;U.useEffect(()=>{if(n){let e=function(e){if(f.paused||!o)return;let t=e.target;o.contains(t)?d.current=t:ew(d.current,{select:!0})},t=function(e){if(f.paused||!o)return;let t=e.relatedTarget;null!==t&&(o.contains(t)||ew(d.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ew(o)});return o&&r.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,o,f.paused]),U.useEffect(()=>{if(o){e_.add(f);let e=document.activeElement;if(!o.contains(e)){let t=new CustomEvent(ep,eg);o.addEventListener(ep,u),o.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(ew(n,{select:t}),document.activeElement!==r)return}(eb(o).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&ew(o))}return()=>{o.removeEventListener(ep,u),setTimeout(()=>{let t=new CustomEvent(em,eg);o.addEventListener(em,c),o.dispatchEvent(t),t.defaultPrevented||ew(e??document.body,{select:!0}),o.removeEventListener(em,c),e_.remove(f)},0)}}},[o,u,c,f]);let p=U.useCallback(e=>{if(!r&&!n||f.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,s=document.activeElement;if(t&&s){var i;let t,n=e.currentTarget,[a,o]=[ev(t=eb(i=n),i),ev(t.reverse(),i)];a&&o?e.shiftKey||s!==o?e.shiftKey&&s===a&&(e.preventDefault(),r&&ew(o,{select:!0})):(e.preventDefault(),r&&ew(a,{select:!0})):s===n&&e.preventDefault()}},[r,n,f.paused]);return(0,D.jsx)(eo.div,{tabIndex:-1,...a,ref:h,onKeyDown:p})});function eb(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let 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 ev(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function ew(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}ey.displayName="FocusScope";var e_=(d=[],{add(e){let t=d[0];e!==t&&t?.pause(),(d=ek(d,e)).unshift(e)},remove(e){d=ek(d,e),d[0]?.resume()}});function ek(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var ex=U.forwardRef((e,t)=>{let{container:r,...n}=e,[s,i]=U.useState(!1);Y(()=>i(!0),[]);let a=r||s&&globalThis?.document?.body;return a?en.default.createPortal((0,D.jsx)(eo.div,{...n,ref:t}),a):null});ex.displayName="Portal";var eE=e=>{var t;let r,n,{present:s,children:i}=e,a=function(e){var t,r;let[n,s]=U.useState(),i=U.useRef(null),a=U.useRef(e),o=U.useRef("none"),[l,u]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},U.useReducer((e,t)=>r[e][t]??e,t));return U.useEffect(()=>{let e=eS(i.current);o.current="mounted"===l?e:"none"},[l]),Y(()=>{let t=i.current,r=a.current;if(r!==e){let n=o.current,s=eS(t);e?u("MOUNT"):"none"===s||t?.display==="none"?u("UNMOUNT"):r&&n!==s?u("ANIMATION_OUT"):u("UNMOUNT"),a.current=e}},[e,u]),Y(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let s=eS(i.current).includes(CSS.escape(r.animationName));if(r.target===n&&s&&(u("ANIMATION_END"),!a.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(o.current=eS(i.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:U.useCallback(e=>{i.current=e?getComputedStyle(e):null,s(e)},[])}}(s),o="function"==typeof i?i({present:a.isPresent}):U.Children.only(i),l=(0,G.useComposedRefs)(a.ref,(t=o,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof i||a.isPresent?U.cloneElement(o,{ref:l}):null};function eS(e){return e?.animationName||"none"}eE.displayName="Presence";var eT=0;function eR(){U.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??eA()),document.body.insertAdjacentElement("beforeend",e[1]??eA()),eT++,
3()=>{1===eT&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),eT--}},[])}function eA(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var eO=function(){return(eO=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function eC(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>t.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}var ej=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),eP="width-before-scroll-bar";function eI(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var eN="u">typeof window?U.useLayoutEffect:U.useEffect,eL=new WeakMap,e$=(void 0===g&&(g={}),(void 0===y&&(y=function(e){return e}),b=[],v=!1,w={read:function(){if(v)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return b.length?b[b.length-1]:null},useMedium:function(e){var t=y(e,v);return b.push(t),function(){b=b.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(v=!0;b.length;){var t=b;b=[],t.forEach(e)}b={push:function(t){return e(t)},filter:function(){return b}}},assignMedium:function(e){v=!0;var t=[];if(b.length){var r=b;b=[],r.forEach(e),t=b}var n=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(n)};s(),b={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),b}}}}).options=eO({async:!0,ssr:!1},g),w),eD=function(){},eU=U.forwardRef(function(e,t){var r,n,s,i,a=U.useRef(null),o=U.useState({onScrollCapture:eD,onWheelCapture:eD,onTouchMoveCapture:eD}),l=o[0],u=o[1],c=e.forwardProps,d=e.children,h=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,y=e.noRelative,b=e.noIsolation,v=e.inert,w=e.allowPinchZoom,_=e.as,k=e.gapMode,x=eC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=(r=[a,t],n=function(e){return r.forEach(function(t){return eI(t,e)})},(s=(0,U.useState)(function(){return{value:null,callback:n,facade:{get current(){return s.value},set current(value){var e=s.value;e!==value&&(s.value=value,s.callback(value,e))}}}})[0]).callback=n,i=s.facade,eN(function(){var e=eL.get(i);if(e){var t=new Set(e),n=new Set(r),s=i.current;t.forEach(function(e){n.has(e)||eI(e,null)}),n.forEach(function(e){t.has(e)||eI(e,s)})}eL.set(i,r)},[r]),i),S=eO(eO({},x),l);return U.createElement(U.Fragment,null,p&&U.createElement(g,{sideCar:e$,removeScrollBar:f,shards:m,noRelative:y,noIsolation:b,inert:v,setCallbacks:u,allowPinchZoom:!!w,lockRef:a,gapMode:k}),c?U.cloneElement(U.Children.only(d),eO(eO({},S),{ref:E})):U.createElement(void 0===_?"div":_,eO({},S,{className:h,ref:E}),d))});eU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eU.classNames={fullWidth:eP,zeroRight:ej};var eB=function(e){var t=e.sideCar,r=eC(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return U.createElement(n,eO({},r))};eB.isSideCarExport=!0;var eM=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=C||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,s;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),s=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eF=function(){var e=eM();return function(t,r){U.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ez=function(){var e=eF();return function(t){return e(t.styles,t.dynamic),null}},eq={left:0,top:0,right:0,gap:0},eV=function(e){return parseInt(e||"",10)||0},eW=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],s=t["padding"===e?"paddingRight":"marginRight"];return[eV(r),eV(n),eV(s)]},eH=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return eq;var t=eW(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])}},eK=ez(),eJ="data-scroll-locked",eG=function(e,t,r,n){var s=e.left,i=e.top,a=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat(eJ,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(s,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";
3")].filter(Boolean).join(""),"\n }\n \n .").concat(ej," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(eP," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(ej," .").concat(ej," {\n right: 0 ").concat(n,";\n }\n \n .").concat(eP," .").concat(eP," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(eJ,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},eX=function(){var e=parseInt(document.body.getAttribute(eJ)||"0",10);return isFinite(e)?e:0},eY=function(){U.useEffect(function(){return document.body.setAttribute(eJ,(eX()+1).toString()),function(){var e=eX()-1;e<=0?document.body.removeAttribute(eJ):document.body.setAttribute(eJ,e.toString())}},[])},eZ=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=void 0===n?"margin":n;eY();var i=U.useMemo(function(){return eH(s)},[s]);return U.createElement(eK,{styles:eG(i,!t,s,r?"":"!important")})},eQ=!1;if("u">typeof window)try{var e0=Object.defineProperty({},"passive",{get:function(){return eQ=!0,!0}});window.addEventListener("test",e0,e0),window.removeEventListener("test",e0,e0)}catch(e){eQ=!1}var e1=!!eQ&&{passive:!1},e2=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},e5=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),e3(e,n)){var s=e4(e,n);if(s[1]>s[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},e3=function(e,t){return"v"===e?e2(t,"overflowY"):e2(t,"overflowX")},e4=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},e8=function(e,t,r,n,s){var i,a=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),o=a*n,l=r.target,u=t.contains(l),c=!1,d=o>0,h=0,f=0;do{if(!l)break;var p=e4(e,l),m=p[0],g=p[1]-p[2]-a*m;(m||g)&&e3(e,l)&&(h+=g,f+=m);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&l!==document.body||u&&(t.contains(l)||t===l))return d&&(s&&1>Math.abs(h)||!s&&o>h)?c=!0:!d&&(s&&1>Math.abs(f)||!s&&-o>f)&&(c=!0),c},e6=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e9=function(e){return[e.deltaX,e.deltaY]},e7=function(e){return e&&"current"in e?e.current:e},te=0,tt=[];let tr=(_=function(e){var t=U.useRef([]),r=U.useRef([0,0]),n=U.useRef(),s=U.useState(te++)[0],i=U.useState(ez)[0],a=U.useRef(e);U.useEffect(function(){a.current=e},[e]),U.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(e7),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var o=U.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var s,i=e6(e),o=r.current,l="deltaX"in e?e.deltaX:o[0]-i[0],u="deltaY"in e?e.deltaY:o[1]-i[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var h=window.getSelection(),f=h&&h.anchorNode;if(f&&(f===c||f.contains(c)))return!1;var p=e5(d,c);if(!p)return!0;if(p?s=d:(s="v"===d?"h":"v",p=e5(d,c)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||u)&&(n.current=s),!s)return!0;var m=n.current||s;return e8(m,t,e,"h"===m?l:u,!0)},[]),l=U.useCallback(function(e){if(tt.length&&tt[tt.length-1]===i){var r="deltaY"in e?e9(e):e6(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}
3if(!n){var s=(a.current.shards||[]).map(e7).filter(Boolean).filter(function(t){return t.contains(e.target)});(s.length>0?o(e,s[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=U.useCallback(function(e,r,n,s){var i={name:e,delta:r,target:n,should:s,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),c=U.useCallback(function(e){r.current=e6(e),n.current=void 0},[]),d=U.useCallback(function(t){u(t.type,e9(t),t.target,o(t,e.lockRef.current))},[]),h=U.useCallback(function(t){u(t.type,e6(t),t.target,o(t,e.lockRef.current))},[]);U.useEffect(function(){return tt.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,e1),document.addEventListener("touchmove",l,e1),document.addEventListener("touchstart",c,e1),function(){tt=tt.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,e1),document.removeEventListener("touchmove",l,e1),document.removeEventListener("touchstart",c,e1)}},[]);var f=e.removeScrollBar,p=e.inert;return U.createElement(U.Fragment,null,p?U.createElement(i,{styles:"\n .block-interactivity-".concat(s," {pointer-events: none;}\n .allow-interactivity-").concat(s," {pointer-events: all;}\n")}):null,f?U.createElement(eZ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},e$.useMedium(_),eB);var tn=U.forwardRef(function(e,t){return U.createElement(eU,eO({},e,{ref:t,sideCar:tr}))});tn.classNames=eU.classNames;var ts=new WeakMap,ti=new WeakMap,ta={},to=0,tl=function(e){return e&&(e.host||tl(e.parentNode))},tu=function(e,t,r,n){var s=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=tl(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});ta[r]||(ta[r]=new WeakMap);var i=ta[r],a=[],o=new Set,l=new Set(s),u=function(e){!e||o.has(e)||(o.add(e),u(e.parentNode))};s.forEach(u);var c=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(o.has(e))c(e);else try{var t=e.getAttribute(n),s=null!==t&&"false"!==t,l=(ts.get(e)||0)+1,u=(i.get(e)||0)+1;ts.set(e,l),i.set(e,u),a.push(e),1===l&&s&&ti.set(e,!0),1===u&&e.setAttribute(r,"true"),s||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),o.clear(),to++,function(){a.forEach(function(e){var t=ts.get(e)-1,s=i.get(e)-1;ts.set(e,t),i.set(e,s),t||(ti.has(e)||e.removeAttribute(n),ti.delete(e)),s||e.removeAttribute(r)}),--to||(ts=new WeakMap,ts=new WeakMap,ti=new WeakMap,ta={})}},tc=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),tu(n,s,r,"aria-hidden")):function(){return null}},td="Dialog",[th,tf]=J(td),[tp,tm]=th(td),tg=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,o=U.useRef(null),l=U.useRef(null),[u,c]=er({prop:n,defaultProp:s??!1,onChange:i,caller:td});return(0,D.jsx)(tp,{scope:t,triggerRef:o,contentRef:l,contentId:ee(),titleId:ee(),descriptionId:ee(),open:u,onOpenChange:c,onOpenToggle:U.useCallback(()=>c(e=>!e),[c]),modal:a,children:r})};tg.displayName=td;var ty="DialogTrigger",tb=U.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,s=tm(ty,r),i=(0,G.useComposedRefs)(t,s.triggerRef);return(0,D.jsx)(eo.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":tU(s.open),...n,ref:i,onClick:X(e.onClick,s.onOpenToggle)})});tb.displayName=ty;var tv="DialogPortal",[tw,t_]=th(tv,{forceMount:void 0}),tk=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=tm(tv,t);return(0,D.jsx)(tw,{scope:t,forceMount:r,children:U.Children.map(n,e=>(0,D.jsx)(eE,{present:r||i.open,children:(0,D.jsx)(ex,{asChild:!0,container:s,children:e})}))})};tk.displayName=tv;var tx="DialogOverlay",tE=U.forwardRef((e,t)=>
3{let r=t_(tx,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=tm(tx,e.__scopeDialog);return i.modal?(0,D.jsx)(eE,{present:n||i.open,children:(0,D.jsx)(tT,{...s,ref:t})}):null});tE.displayName=tx;var tS=es("DialogOverlay.RemoveScroll"),tT=U.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,s=tm(tx,r);return(0,D.jsx)(tn,{as:tS,allowPinchZoom:!0,shards:[s.contentRef],children:(0,D.jsx)(eo.div,{"data-state":tU(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),tR="DialogContent",tA=U.forwardRef((e,t)=>{let r=t_(tR,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=tm(tR,e.__scopeDialog);return(0,D.jsx)(eE,{present:n||i.open,children:i.modal?(0,D.jsx)(tO,{...s,ref:t}):(0,D.jsx)(tC,{...s,ref:t})})});tA.displayName=tR;var tO=U.forwardRef((e,t)=>{let r=tm(tR,e.__scopeDialog),n=U.useRef(null),s=(0,G.useComposedRefs)(t,r.contentRef,n);return U.useEffect(()=>{let e=n.current;if(e)return tc(e)},[]),(0,D.jsx)(tj,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:X(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:X(e.onFocusOutside,e=>e.preventDefault())})}),tC=U.forwardRef((e,t)=>{let r=tm(tR,e.__scopeDialog),n=U.useRef(!1),s=U.useRef(!1);return(0,D.jsx)(tj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let i=t.target;r.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),tj=U.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,o=tm(tR,r),l=U.useRef(null),u=(0,G.useComposedRefs)(t,l);return eR(),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ey,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:(0,D.jsx)(ed,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":tU(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(tz,{titleId:o.titleId}),(0,D.jsx)(tq,{contentRef:l,descriptionId:o.descriptionId})]})]})}),tP="DialogTitle",tI=U.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,s=tm(tP,r);return(0,D.jsx)(eo.h2,{id:s.titleId,...n,ref:t})});tI.displayName=tP;var tN="DialogDescription",tL=U.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,s=tm(tN,r);return(0,D.jsx)(eo.p,{id:s.descriptionId,...n,ref:t})});tL.displayName=tN;var t$="DialogClose",tD=U.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,s=tm(t$,r);return(0,D.jsx)(eo.button,{type:"button",...n,ref:t,onClick:X(e.onClick,()=>s.onOpenChange(!1))})});function tU(e){return e?"open":"closed"}tD.displayName=t$;var tB="DialogTitleWarning",[tM,tF]=(k={contentName:tR,titleName:tP,docsSlug:"dialog"},s=U.createContext(k),(i=e=>{let{children:t,...r}=e,n=U.useMemo(()=>r,Object.values(r));return(0,D.jsx)(s.Provider,{value:n,children:t})}).displayName=tB+"Provider",[i,function(e){let t=U.useContext(s);if(t)return t;if(void 0!==k)return k;throw Error(`\`${e}\` must be used within \`${tB}\``)}]),tz=({titleId:e})=>{let t=tF(tB),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 4 5If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 6 7For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return U.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},tq=({contentRef:e,descriptionId:t})=>{let r=tF("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return U.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},tV="AlertDialog",[tW,tH]=J(tV,[tf]),tK=tf(),tJ=e=>{let{__scopeAlertDialog:t,...r}=e,n=tK(t);return(0,D.jsx)(tg,{...n,...r,modal:!0})};tJ.displayName=tV;var tG=U.forwardRef((e,t)=>
7{let{__scopeAlertDialog:r,...n}=e,s=tK(r);return(0,D.jsx)(tb,{...s,...n,ref:t})});tG.displayName="AlertDialogTrigger";var tX=e=>{let{__scopeAlertDialog:t,...r}=e,n=tK(t);return(0,D.jsx)(tk,{...n,...r})};tX.displayName="AlertDialogPortal";var tY=U.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,s=tK(r);return(0,D.jsx)(tE,{...s,...n,ref:t})});tY.displayName="AlertDialogOverlay";var tZ="AlertDialogContent",[tQ,t0]=tW(tZ),t1=((a=({children:e})=>(0,D.jsx)(D.Fragment,{children:e})).displayName="AlertDialogContent.Slottable",a.__radixId=ei,a),t2=U.forwardRef((e,t)=>{let{__scopeAlertDialog:r,children:n,...s}=e,i=tK(r),a=U.useRef(null),o=(0,G.useComposedRefs)(t,a),l=U.useRef(null);return(0,D.jsx)(tM,{contentName:tZ,titleName:t5,docsSlug:"alert-dialog",children:(0,D.jsx)(tQ,{scope:r,cancelRef:l,children:(0,D.jsxs)(tA,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:X(s.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,D.jsx)(t1,{children:n}),(0,D.jsx)(t7,{contentRef:a})]})})})});t2.displayName=tZ;var t5="AlertDialogTitle",t3=U.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,s=tK(r);return(0,D.jsx)(tI,{...s,...n,ref:t})});t3.displayName=t5;var t4="AlertDialogDescription",t8=U.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,s=tK(r);return(0,D.jsx)(tL,{...s,...n,ref:t})});t8.displayName=t4,U.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,s=tK(r);return(0,D.jsx)(tD,{...s,...n,ref:t})}).displayName="AlertDialogAction";var t6="AlertDialogCancel",t9=U.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=t0(t6,r),i=tK(r),a=(0,G.useComposedRefs)(t,s);return(0,D.jsx)(tD,{...i,...n,ref:a})});t9.displayName=t6;var t7=({contentRef:e})=>{let t=`\`${tZ}\` requires a description for the component to be accessible for screen reader users. 8 9You can add a description to the \`${tZ}\` by passing a \`${t4}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 10 11Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${tZ}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 12 13For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return U.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},re=e.i(19455);function rt({...e}){return(0,D.jsx)(tJ,{"data-slot":"alert-dialog",...e})}function rr({...e}){return(0,D.jsx)(tG,{"data-slot":"alert-dialog-trigger",...e})}function rn({...e}){return(0,D.jsx)(tX,{"data-slot":"alert-dialog-portal",...e})}function rs({className:e,...t}){return(0,D.jsx)(tY,{"data-slot":"alert-dialog-overlay",className:(0,z.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ri({className:e,...t}){return(0,D.jsxs)(rn,{children:[(0,D.jsx)(rs,{}),(0,D.jsx)(t2,{"data-slot":"alert-dialog-content",className:(0,z.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function ra({className:e,...t}){return(0,D.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,z.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ro({className:e,...t}){return(0,D.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,z.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rl({className:e,...t}){return(0,D.jsx)(t3,{"data-slot":"alert-dialog-title",className:(0,z.cn)("text-lg font-semibold",e),...t})}function ru({className:e,...t}){return(0,D.jsx)(t8,{"data-slot":"alert-dialog-description",className:(0,z.cn)("text-muted-foreground text-sm",e),...t})}function rc({className:e,...t}){return(0,D.jsx)(t9,{className:(0,z.cn)((0,re.buttonVariants)({variant:"outline"}),e),...t})}let rd=U.forwardRef(function({title:e,titleId:t,...r},n){return U.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},r),e?U.createElement("title",{id:t},e):null,U.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))});function rh(){let e=F("Submit-form");return(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)(rt,{children:[(0,D.jsx)(rr,{asChild:!0,children:(0,D.jsx)(rd,{className:"size-6 hover:scale-110 transition-all ease-in-out delay-150 bg-black text-white rounded-full p-0.5 cursor-pointer"})}),(0,D.jsxs)(ri,{children:[(0,D.jsx)(ra,{children:(0,D.jsx)(rl,{children:e("info-dialog-title")})}),(0,D.jsx)(ru,{children:(0,D.jsx)("span",{children:e("info-dialog-1")})}),(0,D.jsx)(ro,{children:(0,D.jsx)(rc,{className:"cursor-pointer",children:e("close-button")})})]})]})})}var rf=e.i(38495),rp=e=>e instanceof Date,rm=e=>null==e,rg=e=>!rm(e)&&!Array.isArray(e)&&"object"==typeof e&&!rp(e),ry=e=>rg(e)&&e.target?"checkbox"===e.target.type?e.target.checked:e.target.value:e,rb=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,rv=(e,t)=>
13e.has(rb(t)),rw="u">typeof window&&void 0!==window.HTMLElement&&"u">typeof document;function r_(e){let t;if(e instanceof Date)return new Date(e);let r="u">typeof FileList&&e instanceof FileList;if(rw&&(e instanceof Blob||r))return e;let n=Array.isArray(e);if(!n&&!(rg(e)&&rg(t=e.constructor&&e.constructor.prototype)&&t.hasOwnProperty("isPrototypeOf")))return e;let s=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(s[t]=r_(e[t]));return s}var rk=e=>void 0===e,rx=e=>Array.isArray(e)?e.filter(Boolean):[],rE=e=>rx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),rS=(e,t,r)=>{if(!t||!rg(e))return r;let n=(/^\w*$/.test(t)?[t]:rE(t)).reduce((e,t)=>rm(e)?e:e[t],e);return rk(n)||n===e?rk(e[t])?r:e[t]:n},rT=e=>"function"==typeof e,rR=(e,t,r)=>{let n=-1,s=/^\w*$/.test(t)?[t]:rE(t),i=s.length,a=i-1;for(;++n<i;){let t=s[n],i=r;if(n!==a){let r=e[t];i=rg(r)||Array.isArray(r)?r:isNaN(+s[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=i,e=e[t]}};let rA="blur",rO="trigger",rC="onChange",rj="onSubmit",rP="maxLength",rI="minLength",rN="pattern",rL="required",r$="validate",rD="form",rU="root",rB=U.default.createContext(null);rB.displayName="HookFormControlContext";var rM=(e,t,r,n=!0)=>{let s={defaultValues:t._defaultValues};for(let i in e)Object.defineProperty(s,i,{get:()=>("all"!==t._proxyFormState[i]&&(t._proxyFormState[i]=!n||"all"),r&&(r[i]=!0),e[i])});return s};let rF="u">typeof window?U.default.useLayoutEffect:U.default.useEffect;var rz=e=>"string"==typeof e,rq=(e,t,r,n,s)=>rz(e)?(n&&t.watch.add(e),rS(r,e,s)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),rS(r,e))):(n&&(t.watchAll=!0),r),rV=e=>rm(e)||"object"!=typeof e;function rW(e,t,r=new WeakSet){if(rV(e)||rV(t))return Object.is(e,t);if(rp(e)&&rp(t))return Object.is(e.getTime(),t.getTime());let n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;for(let i of(r.add(e),r.add(t),n)){let n=e[i];if(!s.includes(i))return!1;if("ref"!==i){let e=t[i];if(rp(n)&&rp(e)||rg(n)&&rg(e)||Array.isArray(n)&&Array.isArray(e)?!rW(n,e,r):!Object.is(n,e))return!1}}return!0}let rH=e=>e.render(function(e){let t=U.default.useContext(rB),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:a,exact:o=!0}=e,l=rv(s._names.array,r),u=U.default.useMemo(()=>rS(s._formValues,r,rS(s._defaultValues,r,a)),[s,r,a]),c=function(e){let t=U.default.useContext(rB),{control:r=t,name:n,defaultValue:s,disabled:i,exact:a,compute:o}=e||{},l=U.default.useRef(s),u=U.default.useRef(o),c=U.default.useRef(void 0),d=U.default.useRef(r),h=U.default.useRef(n);u.current=o;let[f,p]=U.default.useState(()=>{let e=r._getWatch(n,l.current);return u.current?u.current(e):e}),m=U.default.useCallback(e=>{let t=rq(n,r._names,e||r._formValues,!1,l.current);return u.current?u.current(t):t},[r._formValues,r._names,n]),g=U.default.useCallback(e=>{if(!i){let t=rq(n,r._names,e||r._formValues,!1,l.current);if(u.current){let e=u.current(t);rW(e,c.current)||(p(e),c.current=e)}else p(t)}},[r._formValues,r._names,i,n]);rF(()=>(d.current===r&&rW(h.current,n)||(d.current=r,h.current=n,g()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:e=>{g(e.values)}})),[r,a,n,g]),U.default.useEffect(()=>r._removeUnmounted());let y=d.current!==r,b=h.current,v=U.default.useMemo(()=>{if(i)return null;let e=!y&&!rW(b,n);return y||e?m():null},[i,y,n,b,m]);return null!==v?v:f}({control:s,name:r,defaultValue:u,exact:o}),d=function(e){let t=U.default.useContext(rB),{control:r=t,disabled:n,name:s,exact:i}=e||{},[a,o]=U.default.useState(r._formState),l=U.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return rF(()=>r._subscribe({name:s,formState:l.current,exact:i,callback:e=>{n||o({...r._formState,...e})}}),[s,n,i]),U.default.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),U.default.useMemo(()=>rM(a,r,l.current,!1),[a,r])}({control:s,name:r,exact:o}),h=U.default.useRef(e),f=U.default.useRef(void 0),p=U.default.useRef(s.register(r,{...e.rules,value:c,..."boolean"==typeof e.disabled?{disabled:e.disabled}:{}}));h.current=e;let m=U.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!rS(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!rS(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!rS(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>
13!!rS(d.validatingFields,r)},error:{enumerable:!0,get:()=>rS(d.errors,r)}}),[d,r]),g=U.default.useCallback(e=>p.current.onChange({target:{value:ry(e),name:r},type:"change"}),[r]),y=U.default.useCallback(()=>p.current.onBlur({target:{value:rS(s._formValues,r),name:r},type:rA}),[r,s._formValues]),b=U.default.useCallback(e=>{let t=rS(s._fields,r);t&&t._f&&e&&(t._f.ref={focus:()=>rT(e.focus)&&e.focus(),select:()=>rT(e.select)&&e.select(),setCustomValidity:t=>rT(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>rT(e.reportValidity)&&e.reportValidity()})},[s._fields,r]),v=U.default.useMemo(()=>({name:r,value:c,..."boolean"==typeof n||d.disabled?{disabled:d.disabled||n}:{},onChange:g,onBlur:y,ref:b}),[r,n,d.disabled,g,y,b,c]);return U.default.useEffect(()=>{let e=s._options.shouldUnregister||i,t=f.current;t&&t!==r&&!l&&s.unregister(t),s.register(r,{...h.current.rules,..."boolean"==typeof h.current.disabled?{disabled:h.current.disabled}:{}});let n=(e,t)=>{let r=rS(s._fields,e);r&&r._f&&(r._f.mount=t)};if(n(r,!0),e){let e=r_(rS(s._options.defaultValues,r,h.current.defaultValue));rR(s._defaultValues,r,e),rk(rS(s._formValues,r))&&rR(s._formValues,r,e)}return l||s.register(r),f.current=r,()=>{(l?e&&!s._state.action:e)?s.unregister(r):n(r,!1)}},[r,s,l,i]),U.default.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),U.default.useMemo(()=>({field:v,formState:d,fieldState:m}),[v,d,m])}(e));U.default.createContext(null).displayName="HookFormContext";var rK=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},rJ=e=>Array.isArray(e)?e:[e],rG=()=>{let e=[];return{get observers(){return e},next:t=>{for(let r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},rX=e=>rg(e)&&!Object.keys(e).length,rY=e=>{if(!rw)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},rZ=e=>rY(e)&&e.isConnected;function rQ(e,t){let r=Array.isArray(t)?t:/^\w*$/.test(t)?[t]:rE(t),n=1===r.length?e:function(e,t){let r=t.slice(0,-1).length,n=0;for(;n<r;)e=rk(e)?n++:e[t[n++]];return e}(e,r),s=r.length-1,i=r[s];return n&&delete n[i],0!==s&&(rg(n)&&rX(n)||Array.isArray(n)&&function(e){for(let t in e)if(e.hasOwnProperty(t)&&!rk(e[t]))return!1;return!0}(n))&&rQ(e,r.slice(0,-1)),e}function r0(e){return Array.isArray(e)||rg(e)&&!(e=>{for(let t in e)if(rT(e[t]))return!0;return!1})(e)}function r1(e,t={}){for(let r in e){let n=e[r];r0(n)?(t[r]=Array.isArray(n)?[]:{},r1(n,t[r])):rk(n)||(t[r]=!0)}return t}function r2(e,t,r){for(let n in r||(r=r1(t)),e){let s=e[n];if(r0(s))rk(t)||rV(r[n])?r[n]=r1(s,Array.isArray(s)?[]:{}):r2(s,rm(t)?{}:t[n],r[n]);else{let e=t[n];r[n]=!rW(s,e)}}return r}let r5={value:!1,isValid:!1},r3={value:!0,isValid:!0};var r4=e=>{if(Array.isArray(e)){if(e.length>1){let 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&&!rk(e[0].attributes.value)?rk(e[0].value)||""===e[0].value?r3:{value:e[0].value,isValid:!0}:r3:r5}return r5},r8=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>rk(e)?e:t?""===e?NaN:e?+e:e:r&&rz(e)?new Date(e):n?n(e):e;let r6={isValid:!1,value:null};var r9=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,r6):r6;function r7(e){let t=e.ref;return"file"===t.type?t.files:"radio"===t.type?r9(e.refs).value:"select-multiple"===t.type?[...t.selectedOptions].map(({value:e})=>e):"checkbox"===t.type?r4(e.refs).value:r8(rk(t.value)?e.ref.value:t.value,e)}var ne=e=>rk(e)?e:e instanceof RegExp?e.source:rg(e)?e.value instanceof RegExp?e.value.source:e.value:e,nt=e=>({isOnSubmit:!e||e===rj,isOnBlur:"onBlur"===e,isOnChange:e===rC,isOnAll:"all"===e,isOnTouch:"onTouched"===e});let nr="AsyncFunction";var nn=e=>!!e&&!!e.validate&&!!(rT(e.validate)&&e.validate.constructor.name===nr||rg(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===nr)),ns=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));let ni=(e,t,r,n)=>{for(let s of r||Object.keys(e)){let r=rS(e,s);if(r){let{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],s)&&!n)return!0;else if(e.ref&&t(e.ref,e.name)&&!n)return!0;else if(ni(i,t))break}else if(rg(i)&&ni(i,t))break}}};function na(e,t,r){let n=rS(e,r);if(n||/^\w*$/.test(r))return{error:n,name:r};let s=r.split(".");for(;s.length;
13){let n=s.join("."),i=rS(t,n),a=rS(e,n);if(i&&!Array.isArray(i)&&r!==n)break;if(a&&a.type)return{name:n,error:a};if(a&&a.root&&a.root.type)return{name:`${n}.root`,error:a.root};s.pop()}return{name:r}}var no=(e,t,r)=>{let n=rJ(rS(e,r));return rR(n,rU,t[r]),rR(e,r,n),e};function nl(e,t,r="validate"){if(rz(e)||Array.isArray(e)&&e.every(rz)||"boolean"==typeof e&&!e)return{type:r,message:rz(e)?e:"",ref:t}}var nu=e=>!rg(e)||e instanceof RegExp?{value:e,message:""}:e,nc=async(e,t,r,n,s,i)=>{let{ref:a,refs:o,required:l,maxLength:u,minLength:c,min:d,max:h,pattern:f,validate:p,name:m,valueAsNumber:g,mount:y}=e._f,b=rS(r,m);if(!y||t.has(m))return{};let v=o?o[0]:a,w=e=>{s&&v.reportValidity&&(v.setCustomValidity("boolean"==typeof e?"":e||""),v.reportValidity())},_={},k="radio"===a.type,x="checkbox"===a.type,E=(g||"file"===a.type)&&rk(a.value)&&rk(b)||rY(a)&&""===a.value||""===b||Array.isArray(b)&&!b.length,S=rK.bind(null,m,n,_),T=(e,t,r,n=rP,s=rI)=>{let i=e?t:r;_[m]={type:e?n:s,message:i,ref:a,...S(e?n:s,i)}};if(i?!Array.isArray(b)||!b.length:l&&(!(k||x)&&(E||rm(b))||"boolean"==typeof b&&!b||x&&!r4(o).isValid||k&&!r9(o).isValid)){let{value:e,message:t}=rz(l)?{value:!!l,message:l}:nu(l);if(e&&(_[m]={type:rL,message:t,ref:v,...S(rL,t)},!n))return w(t),_}if(!E&&(!rm(d)||!rm(h))){let e,t,r=nu(h),s=nu(d);if(rm(b)||isNaN(b)){let n=a.valueAsDate||new Date(b),i=e=>new Date(new Date().toDateString()+" "+e),o="time"==a.type,l="week"==a.type;rz(r.value)&&b&&(e=o?i(b)>i(r.value):l?b>r.value:n>new Date(r.value)),rz(s.value)&&b&&(t=o?i(b)<i(s.value):l?b<s.value:n<new Date(s.value))}else{let n=a.valueAsNumber||(b?+b:b);rm(r.value)||(e=n>r.value),rm(s.value)||(t=n<s.value)}if((e||t)&&(T(!!e,r.message,s.message,"max","min"),!n))return w(_[m].message),_}if((u||c)&&!E&&(rz(b)||i&&Array.isArray(b))){let e=nu(u),t=nu(c),r=!rm(e.value)&&b.length>+e.value,s=!rm(t.value)&&b.length<+t.value;if((r||s)&&(T(r,e.message,t.message),!n))return w(_[m].message),_}if(f&&!E&&rz(b)){let{value:e,message:t}=nu(f);if(e instanceof RegExp&&!b.match(e)&&(_[m]={type:rN,message:t,ref:a,...S(rN,t)},!n))return w(t),_}if(p){if(rT(p)){let e=nl(await p(b,r),v);if(e&&(_[m]={...e,...S(r$,e.message)},!n))return w(e.message),_}else if(rg(p)){let e={};for(let t in p){if(!rX(e)&&!n)break;let s=nl(await p[t](b,r),v,t);s&&(e={...s,...S(t,s.message)},w(s.message),n&&(_[m]=e))}if(!rX(e)&&(_[m]={ref:v,...e},!n))return _}}return w(!0),_};let nd={mode:rj,reValidateMode:rC,shouldFocusError:!0};var nh=e.i(7284);!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);
13-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}
13.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}
13}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}} 14`);var nf=e=>"number"==typeof e&&!isNaN(e),np=e=>"string"==typeof e||"function"==typeof e?e:null,nm=e=>(0,U.isValidElement)(e)||"string"==typeof e||"function"==typeof e||nf(e);function ng({enter:e,exit:t,appendPosition:r=!1,collapse:n=!0,collapseDuration:s=300}){return function({children:i,position:a,preventExitTransition:o,done:l,nodeRef:u,isIn:c,playToast:d}){let h=r?`${e}--${a}`:e,f=r?`${t}--${a}`:t,p=(0,U.useRef)(0);return(0,U.useLayoutEffect)(()=>{let e=u.current,t=h.split(" "),r=n=>{n.target===u.current&&(d(),e.removeEventListener("animationend",r),e.removeEventListener("animationcancel",r),0===p.current&&"animationcancel"!==n.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)},[]),(0,U.useEffect)(()=>{let e=u.current,t=()=>{e.removeEventListener("animationend",t),n?function(e,t,r=300){let{scrollHeight:n,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=n+"px",s.transition=`all ${r}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,r)})})}(e,l,s):l()};c||(o?t():(p.current=1,e.className+=` ${f}`,e.addEventListener("animationend",t)))},[c]),U.default.createElement(U.default.Fragment,null,i)}}function ny(e,t){return{content:nb(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function nb(e,t,r=!1){return(0,U.isValidElement)(e)&&"string"!=typeof e.type?(0,U.cloneElement)(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:r}):"function"==typeof e?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:r}):e}function nv({delay:e,isRunning:t,closeToast:r,type:n="default",hide:s,className:i,controlledProgress:a,progress:o,rtl:l,isIn:u,theme:c}){let d=s||a&&0===o,h={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};a&&(h.transform=`scaleX(${o})`);let f=(0,nh.default)("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${c}`,`Toastify__progress-bar--${n}`,{"Toastify__progress-bar--rtl":l}),p="function"==typeof i?i({rtl:l,type:n,defaultClassName:f}):(0,nh.default)(f,i);return U.default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":d},U.default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${c} Toastify__progress-bar--${n}`}),U.default.createElement("div",{role:"progressbar","aria-hidden":d?"true":"false","aria-label":"notification timer",className:p,style:h,...{[a&&o>=1?"onTransitionEnd":"onAnimationEnd"]:a&&o<1?null:()=>{u&&r()}}}))}var nw=1,n_=()=>`${nw++}`,nk=new Map,nx=[],nE=new Set,nS=e=>nE.forEach(t=>t(e));function nT(e,t){var r;if(t)return!!(null!=(r=nk.get(t))&&r.isToastActive(e));let n=!1;return nk.forEach(t=>{t.isToastActive(e)&&(n=!0)}),n}function nR(e,t){nm(e)&&(nk.size>0||nx.push({content:e,options:t}),nk.forEach(r=>{r.buildToast(e,t)}))}function nA(e,t){nk.forEach(r=>{null!=t&&null!=t&&t.containerId&&(null==t?void 0:t.containerId)!==r.id||r.toggle(e,null==t?void 0:t.id)})}function nO(e,t){return nR(e,t),t.toastId}function nC(e,t){var r;return{...t,type:t&&t.type||e,toastId:(r=t)&&("string"==typeof r.toastId||nf(r.toastId))?r.toastId:n_()}}function nj(e){return(t,r)=>nO(t,nC(e,r))}function nP(e,t){return nO(e,nC("default",t))}nP.loading=(e,t)=>
14nO(e,nC("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),nP.promise=function(e,{pending:t,error:r,success:n},s){let i;t&&(i="string"==typeof t?nP.loading(t,s):nP.loading(t.render,{...s,...t}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},o=(e,t,r)=>{if(null==t)return void nP.dismiss(i);let n={type:e,...a,...s,data:r},o="string"==typeof t?{render:t}:t;return i?nP.update(i,{...n,...o}):nP(o.render,{...n,...o}),r},l="function"==typeof e?e():e;return l.then(e=>o("success",n,e)).catch(e=>o("error",r,e)),l},nP.success=nj("success"),nP.info=nj("info"),nP.error=nj("error"),nP.warning=nj("warning"),nP.warn=nP.warning,nP.dark=(e,t)=>nO(e,nC("default",{theme:"dark",...t})),nP.dismiss=function(e){!function(e){let t;if(!(nk.size>0)){nx=nx.filter(t=>null!=e&&t.options.toastId!==e);return}if(null==e||"string"==typeof(t=e)||nf(t))nk.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=nk.get(e.containerId);t?t.removeToast(e.id):nk.forEach(t=>{t.removeToast(e.id)})}}(e)},nP.clearWaitingQueue=(e={})=>{nk.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},nP.isActive=nT,nP.update=(e,t={})=>{let r=((e,{containerId:t})=>{var r;return null==(r=nk.get(t||1))?void 0:r.toasts.get(e)})(e,t);if(r){let{props:n,content:s}=r,i={delay:100,...n,...t,toastId:t.toastId||e,updateId:n_()};i.toastId!==e&&(i.staleId=e);let a=i.render||s;delete i.render,nO(a,i)}},nP.done=e=>{nP.update(e,{progress:1})},nP.onChange=function(e){return nE.add(e),()=>{nE.delete(e)}},nP.play=e=>nA(!0,e),nP.pause=e=>nA(!1,e);var nI="u">typeof window?U.useLayoutEffect:U.useEffect,nN=({theme:e,type:t,isLoading:r,...n})=>U.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===e?"currentColor":`var(--toastify-icon-color-${t})`,...n}),nL={info:function(e){return U.default.createElement(nN,{...e},U.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return U.default.createElement(nN,{...e},U.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return U.default.createElement(nN,{...e},U.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return U.default.createElement(nN,{...e},U.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return U.default.createElement("div",{className:"Toastify__spinner"})}},n$=e=>{let{isRunning:t,preventExitTransition:r,toastRef:n,eventHandlers:s,playToast:i}=function(e){var t,r;let[n,s]=(0,U.useState)(!1),[i,a]=(0,U.useState)(!1),o=(0,U.useRef)(null),l=(0,U.useRef)({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:c,closeToast:d,onClick:h,closeOnClick:f}=e;function p(){s(!0)}function m(){s(!1)}function g(t){let r=o.current;if(l.canDrag&&r){l.didMove=!0,n&&m(),"x"===e.draggableDirection?l.delta=t.clientX-l.start:l.delta=t.clientY-l.start,l.start!==t.clientX&&(l.canCloseOnClick=!1);let s="x"===e.draggableDirection?`${l.delta}px, var(--y)`:`0, calc(${l.delta}px + var(--y))`;r.style.transform=`translate3d(${s},0)`,r.style.opacity=`${1-Math.abs(l.delta/l.removalDistance)}`}}function y(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",y);let t=o.current;if(l.canDrag&&l.didMove&&t){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance){a(!0),e.closeToast(!0),e.collapseAll();return}t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}t={id:e.toastId,containerId:e.containerId,fn:s},null==(r=nk.get(t.containerId||1))||r.setToggle(t.id,t.fn),(0,U.useEffect)(()=>
14{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",p),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);let b={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){l.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",y);let r=o.current;l.canCloseOnClick=!0,l.canDrag=!0,r.style.transition="none","x"===e.draggableDirection?(l.start=t.clientX,l.removalDistance=r.offsetWidth*(e.draggablePercent/100)):(l.start=t.clientY,l.removalDistance=r.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(t){let{top:r,bottom:n,left:s,right:i}=o.current.getBoundingClientRect();"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&t.clientX>=s&&t.clientX<=i&&t.clientY>=r&&t.clientY<=n?m():p()}};return u&&c&&(b.onMouseEnter=m,e.stacked||(b.onMouseLeave=p)),f&&(b.onClick=e=>{h&&h(e),l.canCloseOnClick&&d(!0)}),{playToast:p,pauseToast:m,isRunning:n,preventExitTransition:i,toastRef:o,eventHandlers:b}}(e),{closeButton:a,children:o,autoClose:l,onClick:u,type:c,hideProgressBar:d,closeToast:h,transition:f,position:p,className:m,style:g,progressClassName:y,updateId:b,role:v,progress:w,rtl:_,toastId:k,deleteToast:x,isIn:E,isLoading:S,closeOnClick:T,theme:R,ariaLabel:A}=e,O=(0,nh.default)("Toastify__toast",`Toastify__toast-theme--${R}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":_},{"Toastify__toast--close-on-click":T}),C="function"==typeof m?m({rtl:_,position:p,type:c,defaultClassName:O}):(0,nh.default)(O,m),j=function({theme:e,type:t,isLoading:r,icon:n}){let s=null,i={theme:e,type:t};return!1===n||("function"==typeof n?s=n({...i,isLoading:r}):(0,U.isValidElement)(n)?s=(0,U.cloneElement)(n,i):r?s=nL.spinner():t in nL&&(s=nL[t](i))),s}(e),P=!!w||!l,I={closeToast:h,type:c,theme:R},N=null;return!1===a||(N="function"==typeof a?a(I):(0,U.isValidElement)(a)?(0,U.cloneElement)(a,I):function({closeToast:e,theme:t,ariaLabel:r="close"}){return U.default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:t=>{t.stopPropagation(),e(!0)},"aria-label":r},U.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},U.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(I)),U.default.createElement(f,{isIn:E,done:x,position:p,preventExitTransition:r,nodeRef:n,playToast:i},U.default.createElement("div",{id:k,tabIndex:0,onClick:u,"data-in":E,className:C,...s,style:g,ref:n,...E&&{role:v,"aria-label":A}},null!=j&&U.default.createElement("div",{className:(0,nh.default)("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!S})},j),nb(o,e,!t),N,!e.customProgressBar&&U.default.createElement(nv,{...b&&!P?{key:`p-${b}`}:{},rtl:_,theme:R,delay:l,isRunning:t,isIn:E,closeToast:h,hide:d,type:c,className:y,controlledProgress:P,progress:w||0})))},nD=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),nU=ng(nD("bounce",!0));ng(nD("slide",!0)),ng(nD("zoom")),ng(nD("flip"));var nB={position:"top-right",transition:nU,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&"KeyT"===e.code};function nM(e){let t={...nB,...e},r=e.stacked,[n,s]=(0,U.useState)(!0),i=(0,U.useRef)(null),{getToastToRender:a,isToastActive:o,count:l}=function(e){var t;let r,{subscribe:n,getSnapshot:s,setProps:i}=(0,U.useRef)((r=e.containerId||1,{subscribe(t){let n,s,i,a,o,l,u,c,d,h,f,p=(n=1,s=0,i=[],a=[],o=e,l=new Map,u=new Set,c=()=>{a=Array.from(l.values()),u.forEach(e=>e())},d=e=>{var t,r;null==(r=null==(t=e.props)?void 0:t.onClose)||r.call(t,e.removalReason),e.isActive=!1},h=e=>{if(null==e)l.forEach(d);else{let t=l.get(e);t&&d(t)}c()},f=e=>{var t,r;let{toastId:n,updateId:s}=e.props,i=null==s;e.staleId&&l.delete(e.staleId),e.isActive=!0,l.set(n,e),c(),nS(ny(e,i?"added":"updated")),i&&(null==(r=(t=e.props).onOpen)||r.call(t))},{id:r,props:o,observe:e=>(u.add(e),()=>u.delete(e)),toggle:(e,t)=>
14{l.forEach(r=>{var n;(null==t||t===r.props.toastId)&&(null==(n=r.toggle)||n.call(r,e))})},removeToast:h,toasts:l,clearQueue:()=>{s-=i.length,i=[]},buildToast:(e,t)=>{let a,u;if((({containerId:e,toastId:t,updateId:n})=>{let s=l.has(t)&&null==n;return(e?e!==r:1!==r)||s})(t))return;let{toastId:d,updateId:p,data:m,staleId:g,delay:y}=t,b=null==p;b&&s++;let v={...o,style:o.toastStyle,key:n++,...Object.fromEntries(Object.entries(t).filter(([e,t])=>null!=t)),toastId:d,updateId:p,data:m,isIn:!1,className:np(t.className||o.toastClassName),progressClassName:np(t.progressClassName||o.progressClassName),autoClose:!t.isLoading&&(a=t.autoClose,u=o.autoClose,!1===a||nf(a)&&a>0?a:u),closeToast(e){l.get(d).removalReason=e,h(d)},deleteToast(){let e=l.get(d);if(null!=e){if(nS(ny(e,"removed")),l.delete(d),--s<0&&(s=0),i.length>0)return void f(i.shift());c()}}};v.closeButton=o.closeButton,!1===t.closeButton||nm(t.closeButton)?v.closeButton=t.closeButton:!0===t.closeButton&&(v.closeButton=!nm(o.closeButton)||o.closeButton);let w={content:e,props:v,staleId:g};o.limit&&o.limit>0&&s>o.limit&&b?i.push(w):nf(y)?setTimeout(()=>{f(w)},y):f(w)},setProps(e){o=e},setToggle:(e,t)=>{let r=l.get(e);r&&(r.toggle=t)},isToastActive:e=>{var t;return null==(t=l.get(e))?void 0:t.isActive},getSnapshot:()=>a});nk.set(r,p);let m=p.observe(t);return nx.forEach(e=>nR(e.content,e.options)),nx=[],()=>{m(),nk.delete(r)}},setProps(e){var t;null==(t=nk.get(r))||t.setProps(e)},getSnapshot(){var e;return null==(e=nk.get(r))?void 0:e.getSnapshot()}})).current;i(e);let a=null==(t=(0,U.useSyncExternalStore)(n,s,s))?void 0:t.slice();return{getToastToRender:function(t){if(!a)return[];let r=new Map;return e.newestOnTop&&a.reverse(),a.forEach(e=>{let{position:t}=e.props;r.has(t)||r.set(t,[]),r.get(t).push(e)}),Array.from(r,e=>t(e[0],e[1]))},isToastActive:nT,count:null==a?void 0:a.length}}(t),{className:u,style:c,rtl:d,containerId:h,hotKeys:f}=t;function p(){r&&(s(!0),nP.play())}return nI(()=>{var e;if(r){let r=i.current.querySelectorAll('[data-in="true"]'),s=null==(e=t.position)?void 0:e.includes("top"),a=0,o=0;Array.from(r).reverse().forEach((e,t)=>{e.classList.add("Toastify__toast--stacked"),t>0&&(e.dataset.collapsed=`${n}`),e.dataset.pos||(e.dataset.pos=s?"top":"bot");let r=a*(n?.2:1)+(n?0:12*t);e.style.setProperty("--y",`${s?r:-1*r}px`),e.style.setProperty("--g","12"),e.style.setProperty("--s",`${1-(n?o:0)}`),a+=e.offsetHeight,o+=.025})}},[n,l,r]),(0,U.useEffect)(()=>{function e(e){var t;let r=i.current;f(e)&&(null==(t=r.querySelector('[tabIndex="0"]'))||t.focus(),s(!1),nP.pause()),"Escape"===e.key&&(document.activeElement===r||null!=r&&r.contains(document.activeElement))&&(s(!0),nP.play())}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[f]),U.default.createElement("section",{ref:i,className:"Toastify",id:h,onMouseEnter:()=>{r&&(s(!1),nP.pause())},onMouseLeave:p,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},a((e,t)=>{var n;let s,i=t.length?{...c}:{...c,pointerEvents:"none"};return U.default.createElement("div",{tabIndex:-1,className:(n=e,s=(0,nh.default)("Toastify__toast-container",`Toastify__toast-container--${n}`,{"Toastify__toast-container--rtl":d}),"function"==typeof u?u({position:n,rtl:d,defaultClassName:s}):(0,nh.default)(s,np(u))),"data-stacked":r,style:i,key:`c-${e}`},t.map(({content:e,props:t})=>U.default.createElement(n$,{...t,stacked:r,collapseAll:p,isIn:o(t.toastId,t.containerId),key:`t-${t.key}`},e)))}))}function nF(e,[t,r]){return Math.min(r,Math.max(t,e))}var nz=new WeakMap;function nq(e,t){var r,n;let s,i,a;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,n=t,s=r.length,(a=(i=nV(n))>=0?i:s+i)<0||a>=s?-1:a);return -1===o?void 0:e[o]}function nV(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],nz.set(this,!0)}set(e,t){return nz.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,s=this.has(t),i=this.#e.length,a=nV(e),o=a>=0?a:i+a,l=o<0||o>=i?-1:o;if(l===this.size||s&&l===this.size-1||-1===l)return this.set(t,r),this;let u=this.size+ +!s;a<0&&o++;let c=[...this.#e],d=!1;for(let e=o;e<u;e++)if(o===e){let i=c[e];c[e]===t&&(i=c[e+1]),s&&this.delete(t),n=this.get(i),this.set(t,r)}else{d||c[e-1]!==t||(d=!0);let r=c[d?e:e-1],s=n;n=this.get(r),this.delete(r),this.set(r,s)}return this}with(t,r,n){let s=new e(this);return s.insert(t,r,n),s}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);return -1===n?this:this.insert(n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=nq(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=nq(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return nq(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],s=0;for(let e of this)Reflect.apply(t,r,[e,s,this])&&n.push(e),s++;return new e(n)}map(t,r){let n=[],s=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,s,this])]),s++;return new e(n)}reduce(...e){let[t,r]=e,n=0,s=r??this.at(0);for(let r of this)s=0===n&&1===e.length?r:Reflect.apply(t,this,[s,r,n,this]),n++;return s}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let s=this.at(r);n=r===this.size-1&&1===e.length?s:Reflect.apply(t,this,[n,s,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,s=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(s=r-1);for(let e=t;e<=s;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}});var nW=U.createContext(void 0);let nH=["top","right","bottom","left"],nK=Math.min,nJ=Math.max,nG=Math.round,nX=Math.floor,nY=e=>({x:e,y:e}
14),nZ={left:"right",right:"left",bottom:"top",top:"bottom"};function nQ(e,t){return"function"==typeof e?e(t):e}function n0(e){return e.split("-")[0]}function n1(e){return e.split("-")[1]}function n2(e){return"x"===e?"y":"x"}function n5(e){return"y"===e?"height":"width"}function n3(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function n4(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let n8=["left","right"],n6=["right","left"],n9=["top","bottom"],n7=["bottom","top"];function se(e){let t=n0(e);return nZ[t]+e.slice(t.length)}function st(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function sr(e){let{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function sn(e,t,r){let n,{reference:s,floating:i}=e,a=n3(t),o=n2(n3(t)),l=n5(o),u=n0(t),c="y"===a,d=s.x+s.width/2-i.width/2,h=s.y+s.height/2-i.height/2,f=s[l]/2-i[l]/2;switch(u){case"top":n={x:d,y:s.y-i.height};break;case"bottom":n={x:d,y:s.y+s.height};break;case"right":n={x:s.x+s.width,y:h};break;case"left":n={x:s.x-i.width,y:h};break;default:n={x:s.x,y:s.y}}switch(n1(t)){case"start":n[o]-=f*(r&&c?-1:1);break;case"end":n[o]+=f*(r&&c?-1:1)}return n}async function ss(e,t){var r;void 0===t&&(t={});let{x:n,y:s,platform:i,rects:a,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=nQ(t,e),p=st(f),m=o[h?"floating"===d?"reference":"floating":d],g=sr(await i.getClippingRect({element:null==(r=await (null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(o.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===d?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,b=await (null==i.getOffsetParent?void 0:i.getOffsetParent(o.floating)),v=await (null==i.isElement?void 0:i.isElement(b))&&await (null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=sr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-w.top+p.top)/v.y,bottom:(w.bottom-g.bottom+p.bottom)/v.y,left:(g.left-w.left+p.left)/v.x,right:(w.right-g.right+p.right)/v.x}}let si=async(e,t,r)=>{let{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:a}=r,o=a.detectOverflow?a:{...a,detectOverflow:ss},l=await (null==a.isRTL?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:d}=sn(u,n,l),h=n,f=0,p={};for(let r=0;r<i.length;r++){let m=i[r];if(!m)continue;let{name:g,fn:y}=m,{x:b,y:v,data:w,reset:_}=await y({x:c,y:d,initialPlacement:n,placement:h,strategy:s,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});c=null!=b?b:c,d=null!=v?v:d,p[g]={...p[g],...w},_&&f<50&&(f++,"object"==typeof _&&(_.placement&&(h=_.placement),_.rects&&(u=!0===_.rects?await a.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:c,y:d}=sn(u,h,l)),r=-1)}return{x:c,y:d,placement:h,strategy:s,middlewareData:p}};function sa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function so(e){return nH.some(t=>e[t]>=0)}let sl=new Set(["left","top"]);async function su(e,t){let{placement:r,platform:n,elements:s}=e,i=await (null==n.isRTL?void 0:n.isRTL(s.floating)),a=n0(r),o=n1(r),l="y"===n3(r),u=sl.has(a)?-1:1,c=i&&l?-1:1,d=nQ(t,e),{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&"number"==typeof p&&(f="end"===o?-1*p:p),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}function sc(){return"u">typeof window}function sd(e){return sp(e)?(e.nodeName||"").toLowerCase():"#document"}function sh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sf(e){var t;return null==(t=(sp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function sp(e){return!!sc()&&(e instanceof Node||e instanceof sh(e).Node)}function sm(e){return!!sc()&&(e instanceof Element||e instanceof sh(e).Element)}function sg(e){return!!sc()&&(e instanceof HTMLElement||e instanceof sh(e).HTMLElement)}function sy(e){return!(!sc()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof sh(e).ShadowRoot)}
14function sb(e){let{overflow:t,overflowX:r,overflowY:n,display:s}=sT(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==s&&"contents"!==s}function sv(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let sw=/transform|translate|scale|rotate|perspective|filter/,s_=/paint|layout|strict|content/,sk=e=>!!e&&"none"!==e;function sx(e){let t=sm(e)?sT(e):e;return sk(t.transform)||sk(t.translate)||sk(t.scale)||sk(t.rotate)||sk(t.perspective)||!sE()&&(sk(t.backdropFilter)||sk(t.filter))||sw.test(t.willChange||"")||s_.test(t.contain||"")}function sE(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function sS(e){return/^(html|body|#document)$/.test(sd(e))}function sT(e){return sh(e).getComputedStyle(e)}function sR(e){return sm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sA(e){if("html"===sd(e))return e;let t=e.assignedSlot||e.parentNode||sy(e)&&e.host||sf(e);return sy(t)?t.host:t}function sO(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let s=function e(t){let r=sA(t);return sS(r)?t.ownerDocument?t.ownerDocument.body:t.body:sg(r)&&sb(r)?r:e(r)}(e),i=s===(null==(n=e.ownerDocument)?void 0:n.body),a=sh(s);if(!i)return t.concat(s,sO(s,[],r));{let e=sC(a);return t.concat(a,a.visualViewport||[],sb(s)?s:[],e&&r?sO(e):[])}}function sC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sj(e){let t=sT(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,s=sg(e),i=s?e.offsetWidth:r,a=s?e.offsetHeight:n,o=nG(r)!==i||nG(n)!==a;return o&&(r=i,n=a),{width:r,height:n,$:o}}function sP(e){return sm(e)?e:e.contextElement}function sI(e){let t=sP(e);if(!sg(t))return nY(1);let r=t.getBoundingClientRect(),{width:n,height:s,$:i}=sj(t),a=(i?nG(r.width):r.width)/n,o=(i?nG(r.height):r.height)/s;return a&&Number.isFinite(a)||(a=1),o&&Number.isFinite(o)||(o=1),{x:a,y:o}}let sN=nY(0);function sL(e){let t=sh(e);return sE()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sN}function s$(e,t,r,n){var s;void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),a=sP(e),o=nY(1);t&&(n?sm(n)&&(o=sI(n)):o=sI(e));let l=(void 0===(s=r)&&(s=!1),n&&(!s||n===sh(a))&&s)?sL(a):nY(0),u=(i.left+l.x)/o.x,c=(i.top+l.y)/o.y,d=i.width/o.x,h=i.height/o.y;if(a){let e=sh(a),t=n&&sm(n)?sh(n):n,r=e,s=sC(r);for(;s&&n&&t!==r;){let e=sI(s),t=s.getBoundingClientRect(),n=sT(s),i=t.left+(s.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(s.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,h*=e.y,u+=i,c+=a,s=sC(r=sh(s))}}return sr({width:d,height:h,x:u,y:c})}function sD(e,t){let r=sR(e).scrollLeft;return t?t.left+r:s$(sf(e)).left+r}function sU(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-sD(e,r),y:r.top+t.scrollTop}}function sB(e,t,r){var n;let s;if("viewport"===t)s=function(e,t){let r=sh(e),n=sf(e),s=r.visualViewport,i=n.clientWidth,a=n.clientHeight,o=0,l=0;if(s){i=s.width,a=s.height;let e=sE();(!e||e&&"fixed"===t)&&(o=s.offsetLeft,l=s.offsetTop)}let u=sD(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),s="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(n.clientWidth-t.clientWidth-s);a<=25&&(i-=a)}else u<=25&&(i+=u);return{width:i,height:a,x:o,y:l}}(e,r);else if("document"===t){let t,r,i,a,o,l,u;n=sf(e),t=sf(n),r=sR(n),i=n.ownerDocument.body,a=nJ(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=nJ(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),l=-r.scrollLeft+sD(n),u=-r.scrollTop,"rtl"===sT(i).direction&&(l+=nJ(t.clientWidth,i.clientWidth)-a),s={width:a,height:o,x:l,y:u}}else if(sm(t)){let e,n,i,a,o,l;n=(e=s$(t,!0,"fixed"===r)).top+t.clientTop,i=e.left+t.clientLeft,a=sg(t)?sI(t):nY(1),o=t.clientWidth*a.x,l=t.clientHeight*a.y,s={width:o,height:l,x:i*a.x,y:n*a.y}}else{let r=sL(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return sr(s)}function sM(e){return"static"===sT(e).position}function sF(e,t){if(!sg(e)||"fixed"===sT(e).position)return null;if(t)return t(e);let r=e.offsetParent;return sf(e)===r&&(r=r.ownerDocument.body),r}function sz(e,t){var r;let n=sh(e);if(sv(e))return n;if(!sg(e)){let t=sA(e);for(;t&&!sS(t);){if(sm(t)&&!sM(t))return t;t=sA(t)}return n}let s=sF(e,t);for(;s&&(r=s,/^(table|td|th)$/.test(sd(r)))&&sM(s);)s=sF(s,t);return s&&sS(s)&&sM(s)&&!sx(s)?n:s||function(e){let t=sA(e);for(;sg(t)&&!sS(t);){if(sx(t))return t;if(sv(t))break;t=sA(t)}return null}(e)||n}let sq=async function(e){let t=this.getOffsetParent||sz,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=sg(t),s=sf(t),i="fixed"===r,a=s$(e,!0,i,t),o={scrollLeft:0,scrollTop:0},l=nY(0);if(n||!n&&!i)if(("body"!==sd(t)||sb(s))&&(o=sR(t)),n){let e=s$(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else s&&(l.x=sD(s));i&&!n&&s&&(l.x=sD(s));let u=!s||n||i?nY(0):sU(s,o);return{x:a.left+o.scrollLeft-l.x-u.x,y:a.top+o.scrollTop-l.y-u.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},sV={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e,i="fixed"===s,a=sf(n),o=!!t&&sv(t.floating);if(n===a||o&&i)return r;let l={scrollLeft:0,scrollTop:0},u=nY(1),c=nY(0),d=sg(n);
14if((d||!d&&!i)&&(("body"!==sd(n)||sb(a))&&(l=sR(n)),d)){let e=s$(n);u=sI(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let h=!a||d||i?nY(0):sU(a,l);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:r.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:sf,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e,i=[..."clippingAncestors"===r?sv(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=sO(e,[],!1).filter(e=>sm(e)&&"body"!==sd(e)),s=null,i="fixed"===sT(e).position,a=i?sA(e):e;for(;sm(a)&&!sS(a);){let t=sT(a),r=sx(a);r||"fixed"!==t.position||(s=null),(i?r||s:!(!r&&"static"===t.position&&s&&("absolute"===s.position||"fixed"===s.position)||sb(a)&&!r&&function e(t,r){let n=sA(t);return!(n===r||!sm(n)||sS(n))&&("fixed"===sT(n).position||e(n,r))}(e,a)))?s=t:n=n.filter(e=>e!==a),a=sA(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=sB(t,i[0],s),o=a.top,l=a.right,u=a.bottom,c=a.left;for(let e=1;e<i.length;e++){let r=sB(t,i[e],s);o=nJ(r.top,o),l=nK(r.right,l),u=nK(r.bottom,u),c=nJ(r.left,c)}return{width:l-c,height:u-o,x:c,y:o}},getOffsetParent:sz,getElementRects:sq,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=sj(e);return{width:t,height:r}},getScale:sI,isElement:sm,isRTL:function(e){return"rtl"===sT(e).direction}};function sW(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let sH=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:s,rects:i,platform:a,elements:o,middlewareData:l}=t,{element:u,padding:c=0}=nQ(e,t)||{};if(null==u)return{};let d=st(c),h={x:r,y:n},f=n2(n3(s)),p=n5(f),m=await a.getDimensions(u),g="y"===f,y=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[f]-h[f]-i.floating[p],v=h[f]-i.reference[f],w=await (null==a.getOffsetParent?void 0:a.getOffsetParent(u)),_=w?w[y]:0;_&&await (null==a.isElement?void 0:a.isElement(w))||(_=o.floating[y]||i.floating[p]);let k=_/2-m[p]/2-1,x=nK(d[g?"top":"left"],k),E=nK(d[g?"bottom":"right"],k),S=_-m[p]-E,T=_/2-m[p]/2+(b/2-v/2),R=nJ(x,nK(T,S)),A=!l.arrow&&null!=n1(s)&&T!==R&&i.reference[p]/2-(T<x?x:E)-m[p]/2<0,O=A?T<x?T-x:T-S:0;return{[f]:h[f]+O,data:{[f]:R,centerOffset:T-R-O,...A&&{alignmentOffset:O}},reset:A}}});var sK="u">typeof document?U.useLayoutEffect:function(){};function sJ(e,t){let r,n,s;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!sJ(e[n],t[n]))return!1;return!0}if((r=(s=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,s[n]))return!1;for(n=r;0!=n--;){let r=s[n];if(("_owner"!==r||!e.$$typeof)&&!sJ(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function sG(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sX(e,t){let r=sG(e);return Math.round(t*r)/r}function sY(e){let t=U.useRef(e);return sK(()=>{t.current=e}),t}var sZ=U.forwardRef((e,t)=>{let{children:r,width:n=10,height:s=5,...i}=e;return(0,D.jsx)(eo.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,D.jsx)("polygon",{points:"0,0 30,0 15,10"})})});sZ.displayName="Arrow";var sQ="Popper",[s0,s1]=J(sQ),[s2,s5]=s0(sQ),s3=e=>{let{__scopePopper:t,children:r}=e,[n,s]=U.useState(null);return(0,D.jsx)(s2,{scope:t,anchor:n,onAnchorChange:s,children:r})};s3.displayName=sQ;var s4="PopperAnchor",s8=U.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...s}=e,i=s5(s4,r),a=U.useRef(null),o=(0,G.useComposedRefs)(t,a),l=U.useRef(null);return U.useEffect(()=>{let e=l.current;l.current=n?.current||a.current,e!==l.current&&i.onAnchorChange(l.current)}),n?null:(0,D.jsx)(eo.div,{...s,ref:o})});s8.displayName=s4;var s6="PopperContent",[s9,s7]=s0(s6),ie=U.forwardRef((e,t)=>{var r,n,s,i,a,o,l,u,c,d,h,f,p,m,g,y,b,v,w,_,k;let x,E,S,T,R,A,{__scopePopper:O,side:C="bottom",sideOffset:j=0,align:P="center",alignOffset:I=0,arrowPadding:N=0,avoidCollisions:L=!0,collisionBoundary:$=[],collisionPadding:B=0,sticky:M="partial",hideWhenDetached:F=!1,updatePositionStrategy:z="optimized",onPlaced:q,...V}=e,W=s5(s6,O),[H,K]=U.useState(null),J=(0,G.useComposedRefs)(t,e=>K(e)),[X,Z]=U.useState(null),Q=function(e){let[t,r]=U.useState(void 0);return Y(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,s;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,s=t.blockSize}else n=e.offsetWidth,s=e.offsetHeight;r({width:n,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(X),ee=Q?.width??0,et=Q?.height??0,er="number"==typeof B?B:{top:0,right:0,bottom:0,left:0,...B},es=Array.isArray($)?$:[$],ei=es.length>0,ea={padding:er,boundary:es.filter(ii),altBoundary:ei},{refs:eu,floatingStyles:ec,placement:ed,isPositioned:eh,middlewareData:ef}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:l,open:u}=e,[c,d]=U.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=U.useState(n);sJ(h,n)||f(n);let[p,m]=U.useState(null),[g,y]=U.useState(null),b=U.useCallback(e=>
14{e!==k.current&&(k.current=e,m(e))},[]),v=U.useCallback(e=>{e!==x.current&&(x.current=e,y(e))},[]),w=i||p,_=a||g,k=U.useRef(null),x=U.useRef(null),E=U.useRef(c),S=null!=l,T=sY(l),R=sY(s),A=sY(u),O=U.useCallback(()=>{var e,n;let s,i,a;if(!k.current||!x.current)return;let o={placement:t,strategy:r,middleware:h};R.current&&(o.platform=R.current),(e=k.current,n=x.current,s=new Map,a={...(i={platform:sV,...o}).platform,_c:s},si(e,n,{...i,platform:a})).then(e=>{let t={...e,isPositioned:!1!==A.current};C.current&&!sJ(E.current,t)&&(E.current=t,en.flushSync(()=>{d(t)}))})},[h,t,r,R,A]);sK(()=>{!1===u&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let C=U.useRef(!1);sK(()=>(C.current=!0,()=>{C.current=!1}),[]),sK(()=>{if(w&&(k.current=w),_&&(x.current=_),w&&_){if(T.current)return T.current(w,_,O);O()}},[w,_,O,T,S]);let j=U.useMemo(()=>({reference:k,floating:x,setReference:b,setFloating:v}),[b,v]),P=U.useMemo(()=>({reference:w,floating:_}),[w,_]),I=U.useMemo(()=>{let e={position:r,left:0,top:0};if(!P.floating)return e;let t=sX(P.floating,c.x),n=sX(P.floating,c.y);return o?{...e,transform:"translate("+t+"px, "+n+"px)",...sG(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,o,P.floating,c.x,c.y]);return U.useMemo(()=>({...c,update:O,refs:j,elements:P,floatingStyles:I}),[c,O,j,P,I])}({strategy:"fixed",placement:C+("center"!==P?"-"+P:""),whileElementsMounted:(...e)=>(function(e,t,r,n){let s;void 0===n&&(n={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=sP(e),d=i||a?[...c?sO(c):[],...t?sO(t):[]]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let h=c&&l?function(e,t){let r,n=null,s=sf(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),i();let u=e.getBoundingClientRect(),{left:c,top:d,width:h,height:f}=u;if(o||t(),!h||!f)return;let p={rootMargin:-nX(d)+"px "+-nX(s.clientWidth-(c+h))+"px "+-nX(s.clientHeight-(d+f))+"px "+-nX(c)+"px",threshold:nJ(0,nK(1,l))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(n!==l){if(!m)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||sW(u,e.getBoundingClientRect())||a(),m=!1}try{n=new IntersectionObserver(g,{...p,root:s.ownerDocument})}catch(e){n=new IntersectionObserver(g,p)}n.observe(e)}(!0),i}(c,r):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!u&&p.observe(c),t&&p.observe(t));let m=u?s$(e):null;return u&&function t(){let n=s$(e);m&&!sW(m,n)&&r(),m=n,s=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,u&&cancelAnimationFrame(s)}})(...e,{animationFrame:"always"===z}),elements:{reference:W.anchor},middleware:[{name:(x={name:"offset",options:s=r={mainAxis:j+et,alignmentAxis:I},async fn(e){var t,r;let{x:n,y:i,placement:a,middlewareData:o}=e,l=await su(e,s);return a===(null==(t=o.offset)?void 0:t.placement)&&null!=(r=o.arrow)&&r.alignmentOffset?{}:{x:n+l.x,y:i+l.y,data:{...l,placement:a}}}}).name,fn:x.fn,options:[r,n]},L&&{name:(E={name:"shift",options:c=l={mainAxis:!0,crossAxis:!1,limiter:"partial"===M?{fn:(void 0===(o=i)&&(o={}),{options:o,fn(e){let{x:t,y:r,placement:n,rects:s,middlewareData:i}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=nQ(o,e),c={x:t,y:r},d=n3(n),h=n2(d),f=c[h],p=c[d],m=nQ(a,e),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===h?"height":"width",t=s.reference[h]-s.floating[e]+g.mainAxis,r=s.reference[h]+s.reference[e]-g.mainAxis;f<t?f=t:f>r&&(f=r)}if(u){var y,b;let e="y"===h?"width":"height",t=sl.has(n0(n)),r=s.reference[d]-s.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),a=s.reference[d]+s.reference[e]+(t?0:(null==(b=i.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);p<r?p=r:p>a&&(p=a)}return{[h]:f,[d]:p}}}).fn,options:[i,a]}:void 0,...ea},async fn(e){let{x:t,y:r,placement:n,platform:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=nQ(c,e),u={x:t,y:r},d=await s.detectOverflow(e,l),h=n3(n0(n)),f=n2(h),p=u[f],m=u[h];if(i){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=p+d[e],n=p-d[t];p=nJ(r,nK(p,n))}
14if(a){let e="y"===h?"top":"left",t="y"===h?"bottom":"right",r=m+d[e],n=m-d[t];m=nJ(r,nK(m,n))}let g=o.fn({...e,[f]:p,[h]:m});return{...g,data:{x:g.x-t,y:g.y-r,enabled:{[f]:i,[h]:a}}}}}).name,fn:E.fn,options:[l,u]},L&&{name:(S={name:"flip",options:f=d={...ea},async fn(e){var t,r,n,s,i,a,o,l;let u,c,d,{placement:h,middlewareData:p,rects:m,initialPlacement:g,platform:y,elements:b}=e,{mainAxis:v=!0,crossAxis:w=!0,fallbackPlacements:_,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:E=!0,...S}=nQ(f,e);if(null!=(t=p.arrow)&&t.alignmentOffset)return{};let T=n0(h),R=n3(g),A=n0(g)===g,O=await (null==y.isRTL?void 0:y.isRTL(b.floating)),C=_||(A||!E?[se(g)]:(u=se(g),[n4(g),u,n4(u)])),j="none"!==x;!_&&j&&C.push(...(c=n1(g),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?n6:n8;return t?n8:n6;case"left":case"right":return t?n9:n7;default:return[]}}(n0(g),"start"===x,O),c&&(d=d.map(e=>e+"-"+c),E&&(d=d.concat(d.map(n4)))),d));let P=[g,...C],I=await y.detectOverflow(e,S),N=[],L=(null==(r=p.flip)?void 0:r.overflows)||[];if(v&&N.push(I[T]),w){let e,t,r,n,s=(a=h,o=m,void 0===(l=O)&&(l=!1),e=n1(a),r=n5(t=n2(n3(a))),n="x"===t?e===(l?"end":"start")?"right":"left":"start"===e?"bottom":"top",o.reference[r]>o.floating[r]&&(n=se(n)),[n,se(n)]);N.push(I[s[0]],I[s[1]])}if(L=[...L,{placement:h,overflows:N}],!N.every(e=>e<=0)){let e=((null==(n=p.flip)?void 0:n.index)||0)+1,t=P[e];if(t&&("alignment"!==w||R===n3(t)||L.every(e=>n3(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:t}};let r=null==(s=L.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:s.placement;if(!r)switch(k){case"bestFit":{let e=null==(i=L.filter(e=>{if(j){let t=n3(e.placement);return t===R||"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:i[0];e&&(r=e);break}case"initialPlacement":r=g}if(h!==r)return{reset:{placement:r}}}return{}}}).name,fn:S.fn,options:[d,h]},{name:(T={name:"size",options:g=p={...ea,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:s,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${r}px`),a.setProperty("--radix-popper-available-height",`${n}px`),a.setProperty("--radix-popper-anchor-width",`${s}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}},async fn(e){var t,r;let n,s,{placement:i,rects:a,platform:o,elements:l}=e,{apply:u=()=>{},...c}=nQ(g,e),d=await o.detectOverflow(e,c),h=n0(i),f=n1(i),p="y"===n3(i),{width:m,height:y}=a.floating;"top"===h||"bottom"===h?(n=h,s=f===(await (null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(s=h,n="end"===f?"top":"bottom");let b=y-d.top-d.bottom,v=m-d.left-d.right,w=nK(y-d[n],b),_=nK(m-d[s],v),k=!e.middlewareData.shift,x=w,E=_;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=v),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(x=b),k&&!f){let e=nJ(d.left,0),t=nJ(d.right,0),r=nJ(d.top,0),n=nJ(d.bottom,0);p?E=m-2*(0!==e||0!==t?e+t:nJ(d.left,d.right)):x=y-2*(0!==r||0!==n?r+n:nJ(d.top,d.bottom))}await u({...e,availableWidth:E,availableHeight:x});let S=await o.getDimensions(l.floating);return m!==S.width||y!==S.height?{reset:{rects:!0}}:{}}}).name,fn:T.fn,options:[p,m]},X&&{name:(R={name:"arrow",options:v=y={element:X,padding:N},fn(e){let{element:t,padding:r}="function"==typeof v?v(e):v;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?sH({element:t.current,padding:r}).fn(e):{}:t?sH({element:t,padding:r}).fn(e):{}}}).name,fn:R.fn,options:[y,b]},ia({arrowWidth:ee,arrowHeight:et}),F&&{name:(A={name:"hide",options:k=w={strategy:"referenceHidden",...ea},async fn(e){let{rects:t,platform:r}=e,{strategy:n="referenceHidden",...s}=nQ(k,e);switch(n){case"referenceHidden":{let n=sa(await r.detectOverflow(e,{...s,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:so(n)}}}case"escaped":{let n=sa(await r.detectOverflow(e,{...s,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:so(n)}}}default:return{}}}}).name,fn:A.fn,options:[w,_]}]}),[ep,em]=io(ed),eg=el(q);Y(()=>{eh&&eg?.()},[eh,eg]);let ey=ef.arrow?.x,eb=ef.arrow?.y,ev=ef.arrow?.centerOffset!==0,[ew,e_]=U.useState();return Y(()=>{H&&e_(window.getComputedStyle(H).zIndex)},[H]),(0,D.jsx)("div",{ref:eu.setFloating,"data-radix-popper-content-wrapper":"",style:{...ec,transform:eh?ec.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ew,"--radix-popper-transform-origin":[ef.transformOrigin?.x,ef.transformOrigin?.y].join(" "),...ef.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,D.jsx)(s9,{scope:O,placedSide:ep,onArrowChange:Z,arrowX:ey,arrowY:eb,shouldHideArrow:ev,children:(0,D.jsx)(eo.div,{"data-side":ep,"data-align":em,...V,ref:J,style:{...V.style,animation:eh?void 0:"none"}})})})});
14ie.displayName=s6;var it="PopperArrow",ir={top:"bottom",right:"left",bottom:"top",left:"right"},is=U.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,s=s7(it,r),i=ir[s.placedSide];return(0,D.jsx)("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:(0,D.jsx)(sZ,{...n,ref:t,style:{...n.style,display:"block"}})})});function ii(e){return null!==e}is.displayName=it;var ia=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,o=i?0:e.arrowHeight,[l,u]=io(r),c={start:"0%",center:"50%",end:"100%"}[u],d=(s.arrow?.x??0)+a/2,h=(s.arrow?.y??0)+o/2,f="",p="";return"bottom"===l?(f=i?c:`${d}px`,p=`${-o}px`):"top"===l?(f=i?c:`${d}px`,p=`${n.floating.height+o}px`):"right"===l?(f=`${-o}px`,p=i?c:`${h}px`):"left"===l&&(f=`${n.floating.width+o}px`,p=i?c:`${h}px`),{data:{x:f,y:p}}}});function io(e){let[t,r="center"]=e.split("-");return[t,r]}var il=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"});U.forwardRef((e,t)=>(0,D.jsx)(eo.span,{...e,ref:t,style:{...il,...e.style}})).displayName="VisuallyHidden";var iu=[" ","Enter","ArrowUp","ArrowDown"],ic=[" ","Enter"],id="Select",[ih,ip,im]=function(e){let t=e+"CollectionProvider",[r,n]=J(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=e=>{let{scope:t,children:r}=e,n=U.default.useRef(null),i=U.default.useRef(new Map).current;return(0,D.jsx)(s,{scope:t,itemMap:i,collectionRef:n,children:r})};a.displayName=t;let o=e+"CollectionSlot",l=es(o),u=U.default.forwardRef((e,t)=>{let{scope:r,children:n}=e,s=i(o,r),a=(0,G.useComposedRefs)(t,s.collectionRef);return(0,D.jsx)(l,{ref:a,children:n})});u.displayName=o;let c=e+"CollectionItemSlot",d="data-radix-collection-item",h=es(c),f=U.default.forwardRef((e,t)=>{let{scope:r,children:n,...s}=e,a=U.default.useRef(null),o=(0,G.useComposedRefs)(t,a),l=i(c,r);return U.default.useEffect(()=>(l.itemMap.set(a,{ref:a,...s}),()=>void l.itemMap.delete(a))),(0,D.jsx)(h,{...{[d]:""},ref:o,children:n})});return f.displayName=c,[{Provider:a,Slot:u,ItemSlot:f},function(t){let r=i(e+"CollectionConsumer",t);return U.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(id),[ig,iy]=J(id,[im,s1]),ib=s1(),[iv,iw]=ig(id),[i_,ik]=ig(id),ix=e=>{let t,{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:u,dir:c,name:d,autoComplete:h,disabled:f,required:p,form:m}=e,g=ib(r),[y,b]=U.useState(null),[v,w]=U.useState(null),[_,k]=U.useState(!1),x=(t=U.useContext(nW),c||t||"ltr"),[E,S]=er({prop:s,defaultProp:i??!1,onChange:a,caller:id}),[T,R]=er({prop:o,defaultProp:l,onChange:u,caller:id}),A=U.useRef(null),O=!y||m||!!y.closest("form"),[C,j]=U.useState(new Set),P=Array.from(C).map(e=>e.props.value).join(";");return(0,D.jsx)(s3,{...g,children:(0,D.jsxs)(iv,{required:p,scope:r,trigger:y,onTriggerChange:b,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:k,contentId:ee(),value:T,onValueChange:R,open:E,onOpenChange:S,dir:x,triggerPointerDownPosRef:A,disabled:f,children:[(0,D.jsx)(ih.Provider,{scope:r,children:(0,D.jsx)(i_,{scope:e.__scopeSelect,onNativeOptionAdd:U.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:U.useCallback(e=>{j(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:n})}),O?(0,D.jsxs)(i9,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:T,onChange:e=>R(e.target.value),disabled:f,form:m,children:[void 0===T?(0,D.jsx)("option",{value:""}):null,Array.from(C)]},P):null]})})};ix.displayName=id;var iE="SelectTrigger",iS=U.forwardRef((e,t)=>
14{let{__scopeSelect:r,disabled:n=!1,...s}=e,i=ib(r),a=iw(iE,r),o=a.disabled||n,l=(0,G.useComposedRefs)(t,a.onTriggerChange),u=ip(r),c=U.useRef("touch"),[d,h,f]=ae(e=>{let t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===a.value),n=at(t,e,r);void 0!==n&&a.onValueChange(n.value)}),p=e=>{o||(a.onOpenChange(!0),f()),e&&(a.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,D.jsx)(s8,{asChild:!0,...i,children:(0,D.jsx)(eo.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":i7(a.value)?"":void 0,...s,ref:l,onClick:X(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==c.current&&p(e)}),onPointerDown:X(s.onPointerDown,e=>{c.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(p(e),e.preventDefault())}),onKeyDown:X(s.onKeyDown,e=>{let t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),(!t||" "!==e.key)&&iu.includes(e.key)&&(p(),e.preventDefault())})})})});iS.displayName=iE;var iT="SelectValue",iR=U.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:s,children:i,placeholder:a="",...o}=e,l=iw(iT,r),{onValueNodeHasChildrenChange:u}=l,c=void 0!==i,d=(0,G.useComposedRefs)(t,l.onValueNodeChange);return Y(()=>{u(c)},[u,c]),(0,D.jsx)(eo.span,{...o,ref:d,style:{pointerEvents:"none"},children:i7(l.value)?(0,D.jsx)(D.Fragment,{children:a}):i})});iR.displayName=iT;var iA=U.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...s}=e;return(0,D.jsx)(eo.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});iA.displayName="SelectIcon";var iO=e=>(0,D.jsx)(ex,{asChild:!0,...e});iO.displayName="SelectPortal";var iC="SelectContent",ij=U.forwardRef((e,t)=>{let r=iw(iC,e.__scopeSelect),[n,s]=U.useState();return(Y(()=>{s(new DocumentFragment)},[]),r.open)?(0,D.jsx)(iL,{...e,ref:t}):n?en.createPortal((0,D.jsx)(iP,{scope:e.__scopeSelect,children:(0,D.jsx)(ih.Slot,{scope:e.__scopeSelect,children:(0,D.jsx)("div",{children:e.children})})}),n):null});ij.displayName=iC;var[iP,iI]=ig(iC),iN=es("SelectContent.RemoveScroll"),iL=U.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:p,hideWhenDetached:m,avoidCollisions:g,...y}=e,b=iw(iC,r),[v,w]=U.useState(null),[_,k]=U.useState(null),x=(0,G.useComposedRefs)(t,e=>w(e)),[E,S]=U.useState(null),[T,R]=U.useState(null),A=ip(r),[O,C]=U.useState(!1),j=U.useRef(!1);U.useEffect(()=>{if(v)return tc(v)},[v]),eR();let P=U.useCallback(e=>{let[t,...r]=A().map(e=>e.ref.current),[n]=r.slice(-1),s=document.activeElement;for(let r of e)if(r===s||(r?.scrollIntoView({block:"nearest"}),r===t&&_&&(_.scrollTop=0),r===n&&_&&(_.scrollTop=_.scrollHeight),r?.focus(),document.activeElement!==s))return},[A,_]),I=U.useCallback(()=>P([E,v]),[P,E,v]);U.useEffect(()=>{O&&I()},[O,I]);let{onOpenChange:N,triggerPointerDownPosRef:L}=b;U.useEffect(()=>{if(v){let e={x:0,y:0},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():v.contains(r.target)||N(!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})}}},[v,N,L]),U.useEffect(()=>{let e=()=>N(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[N]);let[$,B]=ae(e=>{let t=A().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=at(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),M=U.useCallback((e,t,r)=>{let n=!j.current&&!r;(void 0!==b.value&&b.value===t||n)&&(S(e),n&&(j.current=!0))},[b.value]),F=U.useCallback(()=>v?.focus(),[v]),z=U.useCallback((e,t,r)=>{let n=!j.current&&!r;(void 0!==b.value&&b.value===t||n)&&R(e)},[b.value]),q="popper"===n?iD:i$,V=q===iD?{side:o,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:p,hideWhenDetached:m,avoidCollisions:g}:{};return(0,D.jsx)(iP,{scope:r,content:v,viewport:_,onViewportChange:k,itemRefCallback:M,selectedItem:E,onItemLeave:F,itemTextRefCallback:z,focusSelectedItem:I,selectedItemText:T,position:n,isPositioned:O,searchRef:$,children:(0,D.jsx)(tn,{as:iN,allowPinchZoom:!0,children:(0,D.jsx)(ey,{asChild:!0,trapped:b.o
14pen,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:X(s,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,D.jsx)(ed,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,D.jsx)(q,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...V,onPlaced:()=>C(!0),ref:x,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:X(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});iL.displayName="SelectContentImpl";var i$=U.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...s}=e,i=iw(iC,r),a=iI(iC,r),[o,l]=U.useState(null),[u,c]=U.useState(null),d=(0,G.useComposedRefs)(t,e=>c(e)),h=ip(r),f=U.useRef(!1),p=U.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:b}=a,v=U.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&m&&g&&y){let e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),s=y.getBoundingClientRect();if("rtl"!==i.dir){let n=s.left-t.left,i=r.left-n,a=e.left-i,l=e.width+a,u=Math.max(l,t.width),c=nF(i,[10,Math.max(10,window.innerWidth-10-u)]);o.style.minWidth=l+"px",o.style.left=c+"px"}else{let n=t.right-s.right,i=window.innerWidth-r.right-n,a=window.innerWidth-e.right-i,l=e.width+a,u=Math.max(l,t.width),c=nF(i,[10,Math.max(10,window.innerWidth-10-u)]);o.style.minWidth=l+"px",o.style.right=c+"px"}let a=h(),l=window.innerHeight-20,c=m.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),b=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),w=p+b+c+parseInt(d.paddingBottom,10)+v,_=Math.min(5*g.offsetHeight,w),k=window.getComputedStyle(m),x=parseInt(k.paddingTop,10),E=parseInt(k.paddingBottom,10),S=e.top+e.height/2-10,T=g.offsetHeight/2,R=p+b+(g.offsetTop+T);if(R<=S){let e=a.length>0&&g===a[a.length-1].ref.current;o.style.bottom="0px";let t=Math.max(l-S,T+(e?E:0)+(u.clientHeight-m.offsetTop-m.offsetHeight)+v);o.style.height=R+t+"px"}else{let e=a.length>0&&g===a[0].ref.current;o.style.top="0px";let t=Math.max(S,p+m.offsetTop+(e?x:0)+T);o.style.height=t+(w-R)+"px",m.scrollTop=R-S+m.offsetTop}o.style.margin="10px 0",o.style.minHeight=_+"px",o.style.maxHeight=l+"px",n?.(),requestAnimationFrame(()=>f.current=!0)}},[h,i.trigger,i.valueNode,o,u,m,g,y,i.dir,n]);Y(()=>v(),[v]);let[w,_]=U.useState();Y(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);let k=U.useCallback(e=>{e&&!0===p.current&&(v(),b?.(),p.current=!1)},[v,b]);return(0,D.jsx)(iU,{scope:r,contentWrapper:o,shouldExpandOnScrollRef:f,onScrollButtonChange:k,children:(0,D.jsx)("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,D.jsx)(eo.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});i$.displayName="SelectItemAlignedPosition";var iD=U.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:s=10,...i}=e,a=ib(r);return(0,D.jsx)(ie,{...a,...i,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});iD.displayName="SelectPopperPosition";var[iU,iB]=ig(iC,{}),iM="SelectViewport",iF=U.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...s}=e,i=iI(iM,r),a=iB(iM,r),o=(0,G.useComposedRefs)(t,i.onViewportChange),l=U.useRef(0);return(0,D.jsxs)(D.Fragment,{children:[(0,D.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:n}),(0,D.jsx)(ih.Slot,{scope:r,children:(0,D.jsx)(eo.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:X(s.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=a;if(n?.current&&r){let e=Math.abs(l.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,s=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(s<n){let i=s+e,a=Math.min(n,i),o=i-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}l.current=t.scrollTop})})})]})});iF.displayName=iM;var iz="SelectGroup",[iq,iV]=ig(iz),iW=U.forwardRef((e,t)=>
14{let{__scopeSelect:r,...n}=e,s=ee();return(0,D.jsx)(iq,{scope:r,id:s,children:(0,D.jsx)(eo.div,{role:"group","aria-labelledby":s,...n,ref:t})})});iW.displayName=iz;var iH="SelectLabel",iK=U.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,s=iV(iH,r);return(0,D.jsx)(eo.div,{id:s.id,...n,ref:t})});iK.displayName=iH;var iJ="SelectItem",[iG,iX]=ig(iJ),iY=U.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:s=!1,textValue:i,...a}=e,o=iw(iJ,r),l=iI(iJ,r),u=o.value===n,[c,d]=U.useState(i??""),[h,f]=U.useState(!1),p=(0,G.useComposedRefs)(t,e=>l.itemRefCallback?.(e,n,s)),m=ee(),g=U.useRef("touch"),y=()=>{s||(o.onValueChange(n),o.onOpenChange(!1))};if(""===n)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,D.jsx)(iG,{scope:r,value:n,disabled:s,textId:m,isSelected:u,onItemTextChange:U.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:(0,D.jsx)(ih.ItemSlot,{scope:r,value:n,disabled:s,textValue:c,children:(0,D.jsx)(eo.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:p,onFocus:X(a.onFocus,()=>f(!0)),onBlur:X(a.onBlur,()=>f(!1)),onClick:X(a.onClick,()=>{"mouse"!==g.current&&y()}),onPointerUp:X(a.onPointerUp,()=>{"mouse"===g.current&&y()}),onPointerDown:X(a.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:X(a.onPointerMove,e=>{g.current=e.pointerType,s?l.onItemLeave?.():"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(a.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:X(a.onKeyDown,e=>{(l.searchRef?.current===""||" "!==e.key)&&(ic.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});iY.displayName=iJ;var iZ="SelectItemText",iQ=U.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:s,...i}=e,a=iw(iZ,r),o=iI(iZ,r),l=iX(iZ,r),u=ik(iZ,r),[c,d]=U.useState(null),h=(0,G.useComposedRefs)(t,e=>d(e),l.onItemTextChange,e=>o.itemTextRefCallback?.(e,l.value,l.disabled)),f=c?.textContent,p=U.useMemo(()=>(0,D.jsx)("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Y(()=>(m(p),()=>g(p)),[m,g,p]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(eo.span,{id:l.textId,...i,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?en.createPortal(i.children,a.valueNode):null]})});iQ.displayName=iZ;var i0="SelectItemIndicator",i1=U.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return iX(i0,r).isSelected?(0,D.jsx)(eo.span,{"aria-hidden":!0,...n,ref:t}):null});i1.displayName=i0;var i2="SelectScrollUpButton",i5=U.forwardRef((e,t)=>{let r=iI(i2,e.__scopeSelect),n=iB(i2,e.__scopeSelect),[s,i]=U.useState(!1),a=(0,G.useComposedRefs)(t,n.onScrollButtonChange);return Y(()=>{if(r.viewport&&r.isPositioned){let e=function(){i(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),s?(0,D.jsx)(i8,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});i5.displayName=i2;var i3="SelectScrollDownButton",i4=U.forwardRef((e,t)=>{let r=iI(i3,e.__scopeSelect),n=iB(i3,e.__scopeSelect),[s,i]=U.useState(!1),a=(0,G.useComposedRefs)(t,n.onScrollButtonChange);return Y(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),s?(0,D.jsx)(i8,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});i4.displayName=i3;var i8=U.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...s}=e,i=iI("SelectScrollButton",r),a=U.useRef(null),o=ip(r),l=U.useCallback(()=>{null!==a.current&&(window.clearInterval(a.current),a.current=null)},[]);return U.useEffect(()=>()=>l(),[l]),Y(()=>{let e=o().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[o]),(0,D.jsx)(eo.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:X(s.onPointerDown,()=>{null===a.current&&(a.current=window.setInterval(n,50))}),onPointerMove:X(s.onPointerMove,()=>{i.onItemLeave?.(),null===a.current&&(a.current=window.setInterval(n,50))}),onPointerLeave:X(s.onPointerLeave,()=>{l()})})});U.forwardRef((e,t)=>
14{let{__scopeSelect:r,...n}=e;return(0,D.jsx)(eo.div,{"aria-hidden":!0,...n,ref:t})}).displayName="SelectSeparator";var i6="SelectArrow";U.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,s=ib(r),i=iw(i6,r),a=iI(i6,r);return i.open&&"popper"===a.position?(0,D.jsx)(is,{...s,...n,ref:t}):null}).displayName=i6;var i9=U.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{let s,i=U.useRef(null),a=(0,G.useComposedRefs)(n,i),o=(s=U.useRef({value:t,previous:t}),U.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t]));return U.useEffect(()=>{let e=i.current;if(!e)return;let r=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(o!==t&&r){let n=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,D.jsx)(eo.select,{...r,style:{...il,...r.style},ref:a,defaultValue:t})});function i7(e){return""===e||void 0===e}function ae(e){let t=el(e),r=U.useRef(""),n=U.useRef(0),s=U.useCallback(e=>{let s=r.current+e;t(s),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(s)},[t]),i=U.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return U.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function at(e,t,r){var n,s;let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,o=(n=e,s=Math.max(a,0),n.map((e,t)=>n[(s+t)%n.length]));1===i.length&&(o=o.filter(e=>e!==r));let l=o.find(e=>e.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}i9.displayName="SelectBubbleInput";let ar=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),an=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var as={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"};let ai=(0,U.createContext)({}),aa=(0,U.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:s="",children:i,iconNode:a,...o},l)=>{let{size:u=24,strokeWidth:c=2,absoluteStrokeWidth:d=!1,color:h="currentColor",className:f=""}=(0,U.useContext)(ai)??{},p=n??d?24*Number(r??c)/Number(t??u):r??c;return(0,U.createElement)("svg",{ref:l,...as,width:t??u??as.width,height:t??u??as.height,stroke:e??h,strokeWidth:p,className:ar("lucide",f,s),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(o)&&{"aria-hidden":"true"},...o},[...a.map(([e,t])=>(0,U.createElement)(e,t)),...Array.isArray(i)?i:[i]])}),ao=(e,t)=>{let r=(0,U.forwardRef)(({className:r,...n},s)=>(0,U.createElement)(aa,{ref:s,iconNode:t,className:ar(`lucide-${an(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=an(e),r},al=ao("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),au=ao("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ac=ao("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function ad({...e}){return(0,D.jsx)(ix,{"data-slot":"select",...e})}function ah({...e}){return(0,D.jsx)(iW,{"data-slot":"select-group",...e})}function af({...e}){return(0,D.jsx)(iR,{"data-slot":"select-value",...e})}function ap({className:e,size:t="default",children:r,...n}){return(0,D.jsxs)(iS,{"data-slot":"select-trigger","data-size":t,className:(0,z.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,(0,D.jsx)(iA,{asChild:!0,children:(0,D.jsx)(au,{className:"size-4 opacity-50"})})]})}function am({className:e,children:t,position:r="popper",...n}){return(0,D.jsx)(iO,{children:(0,D.jsxs)(ij,{"data-slot":"select-content",className:(0,z.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
14de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[(0,D.jsx)(ab,{}),(0,D.jsx)(iF,{className:(0,z.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,D.jsx)(av,{})]})})}function ag({className:e,...t}){return(0,D.jsx)(iK,{"data-slot":"select-label",className:(0,z.cn)("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function ay({className:e,children:t,...r}){return(0,D.jsxs)(iY,{"data-slot":"select-item",className:(0,z.cn)('hover:bg-blue-100 hover:text-blue-900 focus:bg-blue-100 focus:text-blue-900 data-[highlighted]:bg-blue-100 data-[highlighted]:text-blue-900 [&_svg:not([class*="text-"])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*="size-"])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',e),...r,children:[(0,D.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,D.jsx)(i1,{children:(0,D.jsx)(al,{className:"size-4"})})}),(0,D.jsx)(iQ,{children:t})]})}function ab({className:e,...t}){return(0,D.jsx)(i5,{"data-slot":"select-scroll-up-button",className:(0,z.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,D.jsx)(ac,{className:"size-4"})})}function av({className:e,...t}){return(0,D.jsx)(i4,{"data-slot":"select-scroll-down-button",className:(0,z.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,D.jsx)(au,{className:"size-4"})})}var aw=e.i(17210);function a_(e,t){return function(){return e.apply(t,arguments)}}let{toString:ak}=Object.prototype,{getPrototypeOf:ax}=Object,{iterator:aE,toStringTag:aS}=Symbol,aT=(o=Object.create(null),e=>{let t=ak.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())}),aR=e=>(e=e.toLowerCase(),t=>aT(t)===e),aA=e=>t=>typeof t===e,{isArray:aO}=Array,aC=aA("undefined");function aj(e){return null!==e&&!aC(e)&&null!==e.constructor&&!aC(e.constructor)&&aN(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let aP=aR("ArrayBuffer"),aI=aA("string"),aN=aA("function"),aL=aA("number"),a$=e=>null!==e&&"object"==typeof e,aD=e=>{if("object"!==aT(e))return!1;let t=ax(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(aS in e)&&!(aE in e)},aU=aR("Date"),aB=aR("File"),aM=aR("Blob"),aF=aR("FileList"),az="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g,aq=void 0!==az.FormData?az.FormData:void 0,aV=aR("URLSearchParams"),[aW,aH,aK,aJ]=["ReadableStream","Request","Response","Headers"].map(aR);function aG(e,t,{allOwnKeys:r=!1}={}){let n,s;if(null!=e)if("object"!=typeof e&&(e=[e]),aO(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{let s;if(aj(e))return;let i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;for(n=0;n<a;n++)s=i[n],t.call(null,e[s],s,e)}}function aX(e,t){let r;if(aj(e))return null;t=t.toLowerCase();let n=Object.keys(e),s=n.length;for(;s-- >0;)if(t===(r=n[s]).toLowerCase())return r;return null}let aY="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g,aZ=e=>!aC(e)&&e!==aY,aQ=(l="u">typeof Uint8Array&&ax(Uint8Array),e=>l&&e instanceof l),a0=aR("HTMLFormElement"),a1=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),a2=aR("RegExp"),a5=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};aG(r,(r,s)=>{let i;!1!==(i=t(r,s,e))&&(n[s]=i||r)}),Object.defineProperties(e,n)},a3=aR("AsyncFunction"),a4=(h="function"==typeof setImmediate,f=aN(aY.postMessage),h?setImmediate:f?(p=`axios@${Math.random()}`,m=[],aY.addEventListener("message",({source:e,data:t})=>{e===aY&&t===p&&m.length&&m.shift()()},!1),e=>{m.push(e),aY.postMessage(p,"*")}):e=>setTimeout(e)),a8="u">typeof queueMicrotask?queueMicrotask.bind(aY):void 0!==aw.default&&aw.default.nextTick||a4,a6={isArray:aO,isArrayBuffer:aP,isBuffer:aj,isFormData:e=>{let t;return e&&(aq&&e instanceof aq||aN(e.append)&&("formdata"===(t=aT(e))||"object"===t&&aN(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&aP(e.buffer)},isString:aI,isNumber:aL,isBoolean:e=>!0===e||!1===e,isObject:a$,isPlainObject:aD,isEmptyObject:e=>{if(!a$(e)||aj(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:aW,isRequest:aH,isResponse:aK,isHeaders:aJ,isUndefined:aC,isDate:aU,isFile:aB,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:aM,isRegExp:a2,isFunction:aN,isStream:e=>a$(e)&&aN(e.pipe),isURLSearchParams:aV,isTypedArray:aQ,isFileList:aF,forEac
14h:aG,merge:function e(){let{caseless:t,skipUndefined:r}=aZ(this)&&this||{},n={},s=(s,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;let a=t&&aX(n,i)||i;aD(n[a])&&aD(s)?n[a]=e(n[a],s):aD(s)?n[a]=e({},s):aO(s)?n[a]=s.slice():r&&aC(s)||(n[a]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&aG(arguments[e],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(aG(t,(t,n)=>{r&&aN(t)?Object.defineProperty(e,n,{value:a_(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})},{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),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,i,a,o={};if(t=t||{},null==e)return t;do{for(i=(s=Object.getOwnPropertyNames(e)).length;i-- >0;)a=s[i],(!n||n(a,e,t))&&!o[a]&&(t[a]=e[a],o[a]=!0);e=!1!==r&&ax(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype)return t},kindOf:aT,kindOfTest:aR,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return -1!==n&&n===r},toArray:e=>{if(!e)return null;if(aO(e))return e;let t=e.length;if(!aL(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r,n=(e&&e[aE]).call(e);for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let r,n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:a0,hasOwnProperty:a1,hasOwnProp:a1,reduceDescriptors:a5,freezeMethods:e=>{a5(e,(t,r)=>{if(aN(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;if(aN(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(aO(e)?e:String(e).split(t)).forEach(e=>{r[e]=!0}),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*=1)?e:t,findKey:aX,global:aY,isContextDefined:aZ,isSpecCompliantForm:function(e){return!!(e&&aN(e.append)&&"FormData"===e[aS]&&e[aE])},toJSONObject:e=>{let t=Array(10),r=(e,n)=>{if(a$(e)){if(t.indexOf(e)>=0)return;if(aj(e))return e;if(!("toJSON"in e)){t[n]=e;let s=aO(e)?[]:{};return aG(e,(e,t)=>{let i=r(e,n+1);aC(i)||(s[t]=i)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:a3,isThenable:e=>e&&(a$(e)||aN(e))&&aN(e.then)&&aN(e.catch),setImmediate:a4,asap:a8,isIterable:e=>null!=e&&aN(e[aE])};var a9=e.i(17311);class a7 extends Error{static from(e,t,r,n,s,i){let a=new a7(e.message,t||e.code,r,n,s);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,r,n,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status)}toJSON(){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:a6.toJSONObject(this.config),code:this.code,status:this.status}}}a7.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",a7.ERR_BAD_OPTION="ERR_BAD_OPTION",a7.ECONNABORTED="ECONNABORTED",a7.ETIMEDOUT="ETIMEDOUT",a7.ERR_NETWORK="ERR_NETWORK",a7.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",a7.ERR_DEPRECATED="ERR_DEPRECATED",a7.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",a7.ERR_BAD_REQUEST="ERR_BAD_REQUEST",a7.ERR_CANCELED="ERR_CANCELED",a7.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",a7.ERR_INVALID_URL="ERR_INVALID_URL";let oe=a7;function ot(e){return a6.isPlainObject(e)||a6.isArray(e)}function or(e){return a6.endsWith(e,"[]")?e.slice(0,-2):e}function on(e,t,r){return e?e.concat(t).map(function(e,t){return e=or(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}let os=a6.toFlatObject(a6,{},null,function(e){return/^is[A-Z]/.test(e)}),oi=function(e,t,r){if(!a6.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(r=a6.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!a6.isUndefined(t[e])})).metaTokens,s=r.visitor||u,i=r.dots,a=r.indexes,o=(r.Blob||"u">typeof Blob&&Blob)&&a6.isSpecCompliantForm(t);if(!a6.isFunction(s))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(a6.isDate(e))return e.toISOString();if(a6.isBoolean(e))return e.toString();if(!o&&a6.isBlob(e))throw new oe("Blob is not supported. Use a Buffer instead.");return a6.isArrayBuffer(e)||a6.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):a9.Buffer.from(e):e}function u(e,r,s){let o=e;if(a6.isReactNative(t)&&a6.isReactNativeBlob(e))return t.append(on(s,r,i),l(e)),!1;if(e&&!s&&"object"==typeof e)if(a6.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else{var u;if(a6.isArray(e)&&(u=e,a6.isArray(u)&&!u.some(ot))||(a6.isFileList(e)||a6.endsWith(r,"[]"))&&(o=a6.toArray(e)))return r=or(r),o.forEach(function(e,n){a6.isUndefined(e)||null===e||t.append(!0===a?on([r],n,i):null===a?r:r+"[]",l(e))}),!1}return!!ot(e)||(t.append(on(s,r,i),l(e)),!1)}let c=[],d=Object.assign(os,{defaultVisitor:u,convertValue:l,isVisitable:ot});if(!a6.isObject(e))throw TypeError("data must be an object");return!function e(r,n){if(!a6.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),a6.forEach(r,function(r,i){!0===(!(a6.isUndefined(r)||null===r)&&s.call(t,r,a6.isString(i)?i.trim():i,n,d))&&e(r,n?n.concat(i):[i])}),c.pop()}}(e),t};
14function oa(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function oo(e,t){this._pairs=[],e&&oi(e,this,t)}let ol=oo.prototype;function ou(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oc(e,t,r){let n;if(!t)return e;let s=r&&r.encode||ou,i=a6.isFunction(r)?{serialize:r}:r,a=i&&i.serialize;if(n=a?a(t,i):a6.isURLSearchParams(t)?t.toString():new oo(t,i).toString(s)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}ol.append=function(e,t){this._pairs.push([e,t])},ol.toString=function(e){let t=e?function(t){return e.call(this,t,oa)}:oa;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let od=class{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){a6.forEach(this.handlers,function(t){null!==t&&e(t)})}},oh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},of="u">typeof URLSearchParams?URLSearchParams:oo,op="u">typeof FormData?FormData:null,om="u">typeof Blob?Blob:null,og="u">typeof window&&"u">typeof document,oy="object"==typeof navigator&&navigator||void 0,ob=og&&(!oy||0>["ReactNative","NativeScript","NS"].indexOf(oy.product)),ov="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ow=og&&window.location.href||"http://localhost";e.s(["hasBrowserEnv",0,og,"hasStandardBrowserEnv",0,ob,"hasStandardBrowserWebWorkerEnv",0,ov,"navigator",0,oy,"origin",0,ow],94537);let o_={...e.i(94537),isBrowser:!0,classes:{URLSearchParams:of,FormData:op,Blob:om},protocols:["http","https","file","blob","url","data"]},ok=function(e){if(a6.isFormData(e)&&a6.isFunction(e.entries)){let t={};return a6.forEachEntry(e,(e,r)=>{!function e(t,r,n,s){let i=t[s++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),o=s>=t.length;return(i=!i&&a6.isArray(n)?n.length:i,o)?a6.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r:(n[i]&&a6.isObject(n[i])||(n[i]=[]),e(t,r,n[i],s)&&a6.isArray(n[i])&&(n[i]=function(e){let t,r,n={},s=Object.keys(e),i=s.length;for(t=0;t<i;t++)n[r=s[t]]=e[r];return n}(n[i]))),!a}(a6.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null},ox={transitional:oh,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r,n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=a6.isObject(e);if(i&&a6.isHTMLForm(e)&&(e=new FormData(e)),a6.isFormData(e))return s?JSON.stringify(ok(e)):e;if(a6.isArrayBuffer(e)||a6.isBuffer(e)||a6.isStream(e)||a6.isFile(e)||a6.isBlob(e)||a6.isReadableStream(e))return e;if(a6.isArrayBufferView(e))return e.buffer;if(a6.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1){var a,o;return(a=e,o=this.formSerializer,oi(a,new o_.classes.URLSearchParams,{visitor:function(e,t,r,n){return o_.isNode&&a6.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...o})).toString()}if((r=a6.isFileList(e))||n.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return oi(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(i||s){t.setContentType("application/json",!1);var l=e;if(a6.isString(l))try{return(0,JSON.parse)(l),a6.trim(l)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(l)}return e}],transformResponse:[function(e){let t=this.transitional||ox.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(a6.isResponse(e)||a6.isReadableStream(e))return e;if(e&&a6.isString(e)&&(r&&!this.responseType||n)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!r&&n){if("SyntaxError"===e.name)throw oe.from(e,oe.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:o_.classes.FormData,Blob:o_.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a6.forEach(["delete","get","head","post","put","patch"],e=>{ox.headers[e]={}});let oE=a6.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"]),oS=Symbol("internals");function oT(e){return e&&String(e).trim().toLowerCase()}function oR(e){return!1===e||null==e?e:a6.isArray(e)?e.map(oR):String(e)}function oA(e,t,r,n,s){if(a6.isFunction(n))return n.call(this,t,r);if(s&&(t=r),a6.isString(t)){if(a6.isString(n))return -1!==t.indexOf(n);if(a6.isRegExp(n))return n.test(t)}}class oO{constructor(e){e&&this.set(e)}set(e,t,r){let n=this;function s(e,t,r){let s=oT(t);if(!s)throw Error("header name must be a non-empty string");let i=a6.findKey(n,s);i&&void 0!==n[i]&&!0!==r&&(void 0!==r||!1===n[i])||(n[i||t]=oR(e))}let i=(e,t)=>a6.forEach(e,(e,r)=>s(e,r,t));if(a6.isPlainObject(e)||e instanceof this.constructor)i(e,t);else{let n;if(a6.isString(e)&&(e=e.trim())&&(n=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var a;let r,n,s,o;i((o={},(a=e)&&a.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||o[r]&&oE[r]||("set-cookie"===r?o[r]?o[r].push(n):o[r]=[n]:o[r]=o[r]?o[r]+", "+n:n)}),o),t)}else if(a6.isObject(e)&&a6.isIterable(e)){let r={},n,s;for(let t of e){if(!a6.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[s=t[0]]=(n=r[s])?a6.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(r,t)}else null!=e&&s(t,e,r)}return this}get(e,t){if(e=oT(e)){let r=a6.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t){let t,r=Object.create(null),n=/([^\s,;
14=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)r[t[1]]=t[2];return r}if(a6.isFunction(t))return t.call(this,e,r);if(a6.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oT(e)){let r=a6.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||oA(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function s(e){if(e=oT(e)){let s=a6.findKey(r,e);s&&(!t||oA(r,r[s],s,t))&&(delete r[s],n=!0)}}return a6.isArray(e)?e.forEach(s):s(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let s=t[r];(!e||oA(this,this[s],s,e,!0))&&(delete this[s],n=!0)}return n}normalize(e){let t=this,r={};return a6.forEach(this,(n,s)=>{let i=a6.findKey(r,s);if(i){t[i]=oR(n),delete t[s];return}let a=e?s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(s).trim();a!==s&&delete t[s],t[a]=oR(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return a6.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&a6.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){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[oS]=this[oS]={accessors:{}}).accessors,r=this.prototype;function n(e){let n=oT(e);if(!t[n]){let s;s=a6.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(r,t+s,{value:function(r,n,s){return this[t].call(this,e,r,n,s)},configurable:!0})}),t[n]=!0}}return a6.isArray(e)?e.forEach(n):n(e),this}}function oC(e,t){let r=this||ox,n=t||r,s=oO.from(n.headers),i=n.data;return a6.forEach(e,function(e){i=e.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function oj(e){return!!(e&&e.__CANCEL__)}oO.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a6.reduceDescriptors(oO.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),a6.freezeMethods(oO);let oP=class extends oe{constructor(e,t,r){super(null==e?"canceled":e,oe.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function oI(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new oe("Request failed with status code "+r.status,[oe.ERR_BAD_REQUEST,oe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}let oN=function(e,t){let r,n=Array(e=e||10),s=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(o){let l=Date.now(),u=s[a];r||(r=l),n[i]=o,s[i]=l;let c=a,d=0;for(;c!==i;)d+=n[c++],c%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),l-r<t)return;let h=u&&l-u;return h?Math.round(1e3*d/h):void 0}},oL=function(e,t){let r,n,s=0,i=1e3/t,a=(t,i=Date.now())=>{s=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{let t=Date.now(),o=t-s;o>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-o)))},()=>r&&a(r)]},o$=(e,t,r=3)=>{let n=0,s=oN(50,250);return oL(r=>{let i=r.loaded,a=r.lengthComputable?r.total:void 0,o=i-n,l=s(o);n=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:o,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},oD=(e,t)=>{let r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},oU=e=>(...t)=>a6.asap(()=>e(...t)),oB=o_.hasStandardBrowserEnv?(u=new URL(o_.origin),c=o_.navigator&&/(msie|trident)/i.test(o_.navigator.userAgent),e=>(e=new URL(e,o_.origin),u.protocol===e.protocol&&u.host===e.host&&(c||u.port===e.port))):()=>!0,oM=o_.hasStandardBrowserEnv?{write(e,t,r,n,s,i,a){if("u"<typeof document)return;let o=[`${e}=${encodeURIComponent(t)}`];a6.isNumber(r)&&o.push(`expires=${new Date(r).toUTCString()}`),a6.isString(n)&&o.push(`path=${n}`),a6.isString(s)&&o.push(`domain=${s}`),!0===i&&o.push("secure"),a6.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function oF(e,t,r){let n=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(n||!1==r)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let oz=e=>e instanceof oO?{...e}:e;function oq(e,t){t=t||{};let r={};function n(e,t,r,n){return a6.isPlainObject(e)&&a6.isPlainObject(t)?a6.merge.call({caseless:n},e,t):a6.isPlainObject(t)?a6.merge({},t):a6.isArray(t)?t.slice():t}function s(e,t,r,s){return a6.isUndefined(t)?a6.isUndefined(e)?void 0:n(void 0,e,r,s):n(e,t,r,s)}function i(e,t){if(!a6.isUndefined(t))return n(void 0,t)}function a(e,t){return a6.isUndefined(t)?a6.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function o(r,s,i){return i in t?n(r,s):i in e?n(void 0,r):void 0}let l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBo
14dyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t,r)=>s(oz(e),oz(t),r,!0)};return a6.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let i=a6.hasOwnProp(l,n)?l[n]:s,a=i(e[n],t[n],n);a6.isUndefined(a)&&i!==o||(r[n]=a)}),r}let oV=e=>{let t=oq({},e),{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:o}=t;if(t.headers=a=oO.from(a),t.url=oc(oF(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),a6.isFormData(r)){if(o_.hasStandardBrowserEnv||o_.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(a6.isFunction(r.getHeaders)){let e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}}if(o_.hasStandardBrowserEnv&&(n&&a6.isFunction(n)&&(n=n(t)),n||!1!==n&&oB(t.url))){let e=s&&i&&oM.read(i);e&&a.set(s,e)}return t},oW="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){var n;let s,i,a,o,l,u,c=oV(e),d=c.data,h=oO.from(c.headers).normalize(),{responseType:f,onUploadProgress:p,onDownloadProgress:m}=c;function g(){o&&o(),l&&l(),c.cancelToken&&c.cancelToken.unsubscribe(s),c.signal&&c.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function b(){if(!y)return;let n=oO.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());oI(function(e){t(e),g()},function(e){r(e),g()},{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y}),y=null}y.open(c.method.toUpperCase(),c.url,!0),y.timeout=c.timeout,"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||4!==y.readyState||(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(b)},y.onabort=function(){y&&(r(new oe("Request aborted",oe.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){let n=new oe(t&&t.message?t.message:"Network Error",oe.ERR_NETWORK,e,y);n.event=t||null,r(n),y=null},y.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",n=c.transitional||oh;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),r(new oe(t,n.clarifyTimeoutError?oe.ETIMEDOUT:oe.ECONNABORTED,e,y)),y=null},void 0===d&&h.setContentType(null),"setRequestHeader"in y&&a6.forEach(h.toJSON(),function(e,t){y.setRequestHeader(t,e)}),a6.isUndefined(c.withCredentials)||(y.withCredentials=!!c.withCredentials),f&&"json"!==f&&(y.responseType=c.responseType),m&&([a,l]=o$(m,!0),y.addEventListener("progress",a)),p&&y.upload&&([i,o]=o$(p),y.upload.addEventListener("progress",i),y.upload.addEventListener("loadend",o)),(c.cancelToken||c.signal)&&(s=t=>{y&&(r(!t||t.type?new oP(null,e,y):t),y.abort(),y=null)},c.cancelToken&&c.cancelToken.subscribe(s),c.signal&&(c.signal.aborted?s():c.signal.addEventListener("abort",s)));let v=(n=c.url,(u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n))&&u[1]||"");v&&-1===o_.protocols.indexOf(v)?r(new oe("Unsupported protocol "+v+":",oe.ERR_BAD_REQUEST,e)):y.send(d||null)})},oH=function*(e,t){let r,n=e.byteLength;if(!t||n<t)return void(yield e);let s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},oK=async function*(e,t){for await(let r of oJ(e))yield*oH(r,t)},oJ=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},oG=(e,t,r,n)=>{let s,i=oK(e,t),a=0,o=e=>{!s&&(s=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await i.next();if(t){o(),e.close();return}let s=n.byteLength;if(r){let e=a+=s;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw o(e),e}},cancel:e=>(o(e),i.return())},{highWaterMark:2})},{isFunction:oX}=a6,oY=(({Request:e,Response:t})=>({Request:e,Response:t}))(a6.global),{ReadableStream:oZ,TextEncoder:oQ}=a6.global,o0=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},o1=e=>{let t,{fetch:r,Request:n,Response:s}=e=a6.merge.call({skipUndefined:!0},oY,e),i=r?oX(r):"function"==typeof fetch,a=oX(n),o=oX(s);if(!i)return!1;let l=i&&oX(oZ),u=i&&("function"==typeof oQ?(t=new oQ,e=>t.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer())),c=a&&l&&o0(()=>{let e=!1,t=new n(o_.origin,{body:new oZ,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=o&&l&&o0(()=>a6.isReadableStream(new s("").body)),h={stream:d&&(e=>e.body)};
14i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{h[e]||(h[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new oe(`Response type '${e}' is not supported`,oe.ERR_NOT_SUPPORT,r)})});let f=async e=>{if(null==e)return 0;if(a6.isBlob(e))return e.size;if(a6.isSpecCompliantForm(e)){let t=new n(o_.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return a6.isArrayBufferView(e)||a6.isArrayBuffer(e)?e.byteLength:(a6.isURLSearchParams(e)&&(e+=""),a6.isString(e))?(await u(e)).byteLength:void 0},p=async(e,t)=>{let r=a6.toFiniteNumber(e.getContentLength());return null==r?f(t):r};return async e=>{let t,{url:i,method:o,data:l,signal:u,cancelToken:f,timeout:m,onDownloadProgress:g,onUploadProgress:y,responseType:b,headers:v,withCredentials:w="same-origin",fetchOptions:_}=oV(e),k=r||fetch;b=b?(b+"").toLowerCase():"text";let x=((e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController,s=function(e){if(!r){r=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof oe?t:new oP(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{i=null,s(new oe(`timeout of ${t}ms exceeded`,oe.ETIMEDOUT))},t),a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));let{signal:o}=n;return o.unsubscribe=()=>a6.asap(a),o}})([u,f&&f.toAbortSignal()],m),E=null,S=x&&x.unsubscribe&&(()=>{x.unsubscribe()});
14try{if(y&&c&&"get"!==o&&"head"!==o&&0!==(t=await p(v,l))){let e,r=new n(i,{method:"POST",body:l,duplex:"half"});if(a6.isFormData(l)&&(e=r.headers.get("content-type"))&&v.setContentType(e),r.body){let[e,n]=oD(t,o$(oU(y)));l=oG(r.body,65536,e,n)}}a6.isString(w)||(w=w?"include":"omit");let r=a&&"credentials"in n.prototype,u={..._,signal:x,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:l,duplex:"half",credentials:r?w:void 0};E=a&&new n(i,u);let f=await (a?k(E,_):k(i,u)),m=d&&("stream"===b||"response"===b);if(d&&(g||m&&S)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});let t=a6.toFiniteNumber(f.headers.get("content-length")),[r,n]=g&&oD(t,o$(oU(g),!0))||[];f=new s(oG(f.body,65536,r,()=>{n&&n(),S&&S()}),e)}b=b||"text";let T=await h[a6.findKey(h,b)||"text"](f,e);return!m&&S&&S(),await new Promise((t,r)=>{oI(t,r,{data:T,headers:oO.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:E})})}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new oe("Network Error",oe.ERR_NETWORK,e,E,t&&t.response),{cause:t.cause||t});throw oe.from(t,t&&t.code,e,E,t&&t.response)}}},o2=new Map,o5=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:s}=t,i=[n,s,r],a=i.length,o,l,u=o2;for(;a--;)o=i[a],void 0===(l=u.get(o))&&u.set(o,l=a?new Map:o1(t)),u=l;return l};o5();let o3={http:null,xhr:oW,fetch:{get:o5}};a6.forEach(o3,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let o4=e=>`- ${e}`,o8=e=>a6.isFunction(e)||null===e||!1===e,o6=function(e,t){let r,n,{length:s}=e=a6.isArray(e)?e:[e],i={};for(let a=0;a<s;a++){let s;if(n=r=e[a],!o8(r)&&void 0===(n=o3[(s=String(r)).toLowerCase()]))throw new oe(`Unknown adapter '${s}'`);if(n&&(a6.isFunction(n)||(n=n.get(t))))break;i[s||"#"+a]=n}if(!n){let e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new oe("There is no suitable adapter to dispatch the request "+(s?e.length>1?"since :\n"+e.map(o4).join("\n"):" "+o4(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function o9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new oP(null,e)}function o7(e){return o9(e),e.headers=oO.from(e.headers),e.data=oC.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),o6(e.adapter||ox.adapter,e)(e).then(function(t){return o9(e),t.data=oC.call(e,e.transformResponse,t),t.headers=oO.from(t.headers),t},function(t){return!oj(t)&&(o9(e),t&&t.response&&(t.response.data=oC.call(e,e.transformResponse,t.response),t.response.headers=oO.from(t.response.headers))),Promise.reject(t)})}let le="1.13.6",lt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let lr={};lt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+le+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,i)=>{if(!1===e)throw new oe(n(s," has been removed"+(t?" in "+t:"")),oe.ERR_DEPRECATED);return t&&!lr[s]&&(lr[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,i)}},lt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};let ln=function(e,t,r){if("object"!=typeof e)throw new oe("options must be an object",oe.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),s=n.length;for(;s-- >0;){let i=n[s],a=t[i];if(a){let t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new oe("option "+i+" must be "+r,oe.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new oe("Unknown option "+i,oe.ERR_BAD_OPTION)}};class ls{constructor(e){this.defaults=e||{},this.interceptors={request:new od,response:new od}}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=Error();let 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){let r,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:s,paramsSerializer:i,headers:a}=t=oq(this.defaults,t);void 0!==s&&ln(s,{silentJSONParsing:lt.transitional(lt.boolean),forcedJSONParsing:lt.transitional(lt.boolean),clarifyTimeoutError:lt.transitional(lt.boolean),legacyInterceptorReqResOrdering:lt.transitional(lt.boolean)}
14,!1),null!=i&&(a6.isFunction(i)?t.paramsSerializer={serialize:i}:ln(i,{encode:lt.function,serialize:lt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ln(t,{baseUrl:lt.spelling("baseURL"),withXsrfToken:lt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&a6.merge(a.common,a[t.method]);a&&a6.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=oO.concat(o,a);let l=[],u=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;u=u&&e.synchronous;let r=t.transitional||oh;r&&r.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d=0;if(!u){let e=[o7.bind(this),void 0];for(e.unshift(...l),e.push(...c),n=e.length,r=Promise.resolve(t);d<n;)r=r.then(e[d++],e[d++]);return r}n=l.length;let h=t;for(;d<n;){let e=l[d++],t=l[d++];try{h=e(h)}catch(e){t.call(this,e);break}}try{r=o7.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,n=c.length;d<n;)r=r.then(c[d++],c[d++]);return r}getUri(e){return oc(oF((e=oq(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}a6.forEach(["delete","get","head","options"],function(e){ls.prototype[e]=function(t,r){return this.request(oq(r||{},{method:e,url:t,data:(r||{}).data}))}}),a6.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(oq(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ls.prototype[e]=t(),ls.prototype[e+"Form"]=t(!0)});class li{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");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,n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new oP(e,n,s),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;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new li(function(t){e=t}),cancel:e}}}let la={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
14alContent: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(la).forEach(([e,t])=>{la[t]=e});let lo=function e(t){let r=new ls(t),n=a_(ls.prototype.request,r);return a6.extend(n,ls.prototype,r,{allOwnKeys:!0}),a6.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(oq(t,r))},n}(ox);lo.Axios=ls,lo.CanceledError=oP,lo.CancelToken=li,lo.isCancel=oj,lo.VERSION=le,lo.toFormData=oi,lo.AxiosError=oe,lo.Cancel=lo.CanceledError,lo.all=function(e){return Promise.all(e)},lo.spread=function(e){return function(t){return e.apply(null,t)}},lo.isAxiosError=function(e){return a6.isObject(e)&&!0===e.isAxiosError},lo.mergeConfig=oq,lo.AxiosHeaders=oO,lo.formToJSON=e=>ok(a6.isHTMLForm(e)?new FormData(e):e),lo.getAdapter=o6,lo.HttpStatusCode=la,lo.default=lo;let ll=async e=>{let t=await e("submit_question");if(t)try{let e=await lo({method:"POST",url:"/api/reCapchaSubmit",data:{gRecaptchaToken:t},headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"}});if(e.data?.success)return!0;nP.error("Recaptcha failed. You must be a bot!")}catch(e){nP.error(`Error while verifying reCaptcha: ${e.message}`)}return!1},lu=async(e,t)=>{try{let{data:r,error:n}=await e.from("questions").insert(t).select();if(n)return nP.error(`Something went wrong: ${n.message}`),!1;if(r&&r[0]?.id)return!0}catch(e){nP.error(`Error while inserting question: ${e.message}`)}return!1};function lc({topics:e,value:t,onValueChange:r}){let n=F("Submit-form"),s=(0,B.useLocale)();return(0,D.jsxs)(ad,{value:t||"",onValueChange:r,children:[(0,D.jsx)(ap,{className:"w-full rounded-lg border border-black hover:border-primary focus:border-primary py-6",children:(0,D.jsx)(af,{placeholder:n("list-box-title")})}),(0,D.jsx)(am,{children:(0,D.jsxs)(ah,{children:[(0,D.jsx)(ag,{children:n("Categories")}),e?.map(e=>(0,D.jsx)(ay,{value:"en"===s?e.name_en:e.name_fi,className:"hover:bg-[var(--primary-light)] hover:text-white focus:bg-[var(--primary-light)] focus:text-white data-[highlighted]:bg-[var(--primary-light)] data-[highlighted]:text-white py-3",children:e[`name_${s}`]},e.id))]})})]})}
14class ld extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}}class lh extends ld{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class lf extends ld{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class lp extends ld{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}(x=j||(j={})).Any="any",x.ApNortheast1="ap-northeast-1",x.ApNortheast2="ap-northeast-2",x.ApSouth1="ap-south-1",x.ApSoutheast1="ap-southeast-1",x.ApSoutheast2="ap-southeast-2",x.CaCentral1="ca-central-1",x.EuCentral1="eu-central-1",x.EuWest1="eu-west-1",x.EuWest2="eu-west-2",x.EuWest3="eu-west-3",x.SaEast1="sa-east-1",x.UsEast1="us-east-1",x.UsWest1="us-west-1",x.UsWest2="us-west-2";class lm{constructor(e,{headers:t={},customFetch:r,region:n=j.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){var t,r,n,s;return t=this,r=arguments,n=void 0,s=function*(e,t={}){var r;let n,s;try{let i,{headers:a,method:o,body:l,signal:u,timeout:c}=t,d={},{region:h}=t;h||(h=this.region);let f=new URL(`${this.url}/${e}`);h&&"any"!==h&&(d["x-region"]=h,f.searchParams.set("forceFunctionRegion",h)),l&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",i=l):"string"==typeof l?(d["Content-Type"]="text/plain",i=l):"u">typeof FormData&&l instanceof FormData?i=l:(d["Content-Type"]="application/json",i=JSON.stringify(l)):i=!l||"string"==typeof l||"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer||"u">typeof FormData&&l instanceof FormData?l:JSON.stringify(l);let p=u;c&&(s=new AbortController,n=setTimeout(()=>s.abort(),c),u?(p=s.signal,u.addEventListener("abort",()=>s.abort())):p=s.signal);let m=yield this.fetch(f.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:i,signal:p}).catch(e=>{throw new lh(e)}),g=m.headers.get("x-relay-error");if(g&&"true"===g)throw new lf(m);if(!m.ok)throw new lp(m);let y=(null!=(r=m.headers.get("Content-Type"))?r:"text/plain").split(";")[0].trim();return{data:"application/json"===y?yield m.json():"application/octet-stream"===y||"application/pdf"===y?yield m.blob():"text/event-stream"===y?m:"multipart/form-data"===y?yield m.formData():yield m.text(),error:null,response:m}}catch(e){return{data:null,error:e,response:e instanceof lp||e instanceof lf?e.context:void 0}}finally{n&&clearTimeout(n)}},new(n||(n=Promise))(function(e,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(a,o)}l((s=s.apply(t,r||[])).next())})}}var lg=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
14de=e.code}},ly=class{constructor(e){var t,r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!=(t=e.shouldThrowOnError)&&t,this.signal=e.signal,this.isMaybeSingle=null!=(r=e.isMaybeSingle)&&r,this.urlLengthLimit=null!=(n=e.urlLengthLimit)?n:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json");let n=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,n,s,i;let a=null,o=null,l=null,u=e.status,c=e.statusText;if(e.ok){if("HEAD"!==r.method){let t=await e.text();""===t||(o="text/csv"===r.headers.get("Accept")||r.headers.get("Accept")&&(null==(s=r.headers.get("Accept"))?void 0:s.includes("application/vnd.pgrst.plan+text"))?t:JSON.parse(t))}let i=null==(t=r.headers.get("Prefer"))?void 0:t.match(/count=(exact|planned|estimated)/),d=null==(n=e.headers.get("content-range"))?void 0:n.split("/");i&&d&&d.length>1&&(l=parseInt(d[1])),r.isMaybeSingle&&"GET"===r.method&&Array.isArray(o)&&(o.length>1?(a={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,l=null,u=406,c="Not Acceptable"):o=1===o.length?o[0]:null)}else{let t=await e.text();try{a=JSON.parse(t),Array.isArray(a)&&404===e.status&&(o=[],a=null,u=200,c="OK")}catch(r){404===e.status&&""===t?(u=204,c="No Content"):a={message:t}}if(a&&r.isMaybeSingle&&(null==a||null==(i=a.details)?void 0:i.includes("0 rows"))&&(a=null,u=200,c="OK"),a&&r.shouldThrowOnError)throw new lg(a)}return{error:a,data:o,count:l,status:u,statusText:c}});return this.shouldThrowOnError||(n=n.catch(e=>{var t,r,n,s,i,a;let o="",l="",u="",c=null==e?void 0:e.cause;if(c){let t=null!=(r=null==c?void 0:c.message)?r:"",a=null!=(n=null==c?void 0:c.code)?n:"";o=`${null!=(s=null==e?void 0:e.name)?s:"FetchError"}: ${null==e?void 0:e.message} 15 16Caused by: ${null!=(i=null==c?void 0:c.name)?i:"Error"}: ${t}`,a&&(o+=` (${a})`),(null==c?void 0:c.stack)&&(o+=` 17${c.stack}`)}else o=null!=(a=null==e?void 0:e.stack)?a:"";let d=this.url.toString().length;return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",d>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${d} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((null==c?void 0:c.name)==="HeadersOverflowError"||(null==c?void 0:c.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",d>this.urlLengthLimit&&(l+=`. Your request URL is ${d} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${null!=(t=null==e?void 0:e.name)?t:"FetchError"}: ${null==e?void 0:e.message}`,details:o,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),n.then(e,t)}returns(){return this}overrideTypes(){return this}},lb=class extends ly{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){let i=s?`${s}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){let s=void 0===n?"offset":`${n}.offset`,i=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return"GET"===this.method?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
17explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var a;let o=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=null!=(a=this.headers.get("Accept"))?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${o};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};let lv=RegExp("[,()]");var lw=class extends lb{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&lv.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&lv.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";"plain"===n?s="pl":"phrase"===n?s="ph":"websearch"===n&&(s="w");let i=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>void 0!==t).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},l_=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:n}=null!=t?t:{},s=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join(""),{url:a,headers:o}=this.cloneRequestState();return a.searchParams.set("select",i),n&&o.append("Prefer",`count=${n}`),new lw({method:r?"HEAD":"GET",url:a,headers:o,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;let{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>
17e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);s.searchParams.set("columns",e.join(","))}}return new lw({method:"POST",url:s,headers:i,schema:this.schema,body:e,fetch:null!=(n=this.fetch)?n:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;let{url:a,headers:o}=this.cloneRequestState();if(o.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),void 0!==t&&a.searchParams.set("on_conflict",t),n&&o.append("Prefer",`count=${n}`),s||o.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set("columns",e.join(","))}}return new lw({method:"POST",url:a,headers:o,schema:this.schema,body:e,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var r;let{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new lw({method:"PATCH",url:n,headers:s,schema:this.schema,body:e,fetch:null!=(r=this.fetch)?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;let{url:r,headers:n}=this.cloneRequestState();return e&&n.append("Prefer",`count=${e}`),new lw({method:"DELETE",url:r,headers:n,schema:this.schema,fetch:null!=(t=this.fetch)?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function lk(e){return(lk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function lE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lx(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=lk(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lk(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==lk(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lx(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var lS=class e{constructor(e,{headers:t={},schema:r,fetch:n,timeout:s,urlLengthLimit:i=8e3}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=i;const a=null!=n?n:globalThis.fetch;void 0!==s&&s>0?this.fetch=(e,t)=>{let r=new AbortController,n=setTimeout(()=>r.abort(),s),i=null==t?void 0:t.signal;if(i){if(i.aborted)return clearTimeout(n),a(e,t);let s=()=>{clearTimeout(n),r.abort()};return i.addEventListener("abort",s,{once:!0}),a(e,lE(lE({},t),{},{signal:r.signal})).finally(()=>{clearTimeout(n),i.removeEventListener("abort",s)})}return a(e,lE(lE({},t),{},{signal:r.signal})).finally(()=>clearTimeout(n))}:this.fetch=a}from(e){if(!e||"string"!=typeof e||""===e.trim())throw Error("Invalid relation name: relation must be a non-empty string.");return new l_(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,t={},{head:r=!1,get:n=!1,count:s}={}){var i;let a,o,l=new URL(`${this.url}/rpc/${e}`),u=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(u)),c=r&&Object.values(t).some(u);c?(a="POST",o=t):r||n?(a=r?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{l.searchParams.append(e,t)})):(a="POST",o=t);let d=new Headers(this.headers);return c?d.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&d.set("Prefer",`count=${s}`),new lw({method:a,url:l,headers:d,schema:this.schemaName,body:o,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit})}};let lT=class{static detectEnvironment(){var t;if("u">typeof WebSocket)return{type:"native",constructor:WebSocket};if("u">typeof globalThis&&void 0!==globalThis.WebSocket)return{type:"native",constructor:globalThis.WebSocket};if(void 0!==e.g.WebSocket)return{type:"native",constructor:e.g.WebSocket};if("u">typeof globalThis&&void 0!==globalThis.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("u">typeof globalThis&&globalThis.EdgeRuntime||"u">typeof navigator&&(null==(t=navigator.userAgent)?void 0:t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let r=globalThis.process;if(r){let e=r.versions;if(e&&e.node){let t=parseInt(e.node.replace(/^v/,"").split(".")[0]);return t>=22?void 0!==globalThis.WebSocket?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${t} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${t} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=` 18 19Suggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}},lR="2.0.0",lA="errored",lO="joined",lC={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"};class lj{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){return e.event!==this.BROADCAST_EVENT||e.payload instanceof ArrayBuffer||"string"!=typeof e.payload.event?t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload])):t(this._binaryEncodeUserBroadcastPush(e))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null==(t=e.payload)?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:{},s=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,t,r){let n=e.topic,s=null!=(f=e.ref)?f:"",i=null!=(p=e.join_ref)?p:"",a=e.payload.event,o=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=0===Object.keys(o).length?"":JSON.stringify(o);if(i.length>255)throw Error(`joinRef length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`ref length ${s.length} exceeds maximum of 255`);if(n.length>255)throw Error(`topic length ${n.length} exceeds maximum of 255`);if(a.length>255)throw Error(`userEvent length ${a.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let u=this.USER_BROADCAST_PUSH_META_LENGTH+i.length+s.length+n.length+a.length+l.length,c=new ArrayBuffer(this.HEADER_LENGTH+u),d=new DataView(c),h=0;d.setUint8(h++,this.KINDS.userBroadcastPush),d.setUint8(h++,i.length),d.setUint8(h++,s.length),d.setUint8(h++,n.length),d.setUint8(h++,a.length),d.setUint8(h++,l.length),d.setUint8(h++,t),Array.from(i,e=>d.setUint8(h++,e.charCodeAt(0))),Array.from(s,e=>d.setUint8(h++,e.charCodeAt(0))),Array.from(n,e=>d.setUint8(h++,e.charCodeAt(0))),Array.from(a,e=>d.setUint8(h++,e.charCodeAt(0))),Array.from(l,e=>d.setUint8(h++,e.charCodeAt(0)));var f,p,m=new Uint8Array(c.byteLength+r.byteLength);return m.set(new Uint8Array(c),0),m.set(new Uint8Array(r),c.byteLength),m.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}return t({})}_binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,n)}_decodeUserBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+4,l=r.decode(e.slice(o,o+n));o+=n;let u=r.decode(e.slice(o,o+s));o+=s;let c=r.decode(e.slice(o,o+i));o+=i;let d=e.slice(o,e.byteLength),h=a===this.JSON_ENCODING?JSON.parse(r.decode(d)):d,f={type:this.BROADCAST_EVENT,event:u,payload:h};return i>0&&(f.meta=JSON.parse(c)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:f}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||(null==(t=null==e?void 0:e.constructor)?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}(E=P||(P={})).abstime="abstime",E.bool="bool",E.date="date",E.daterange="daterange",E.float4="float4",E.float8="float8",E.int2="int2",E.int4="int4",E.int4range="int4range",E.int8="int8",E.int8range="int8range",E.json="json",E.jsonb="jsonb",E.money="money",E.numeric="numeric",E.oid="oid",E.reltime="reltime",E.text="text",E.time="time",E.timestamp="timestamp",E.timestamptz="timestamptz",E.timetz="timetz",E.tsrange="tsrange",E.tstzrange="tstzrange";let lP=(e,t,r={})=>{var n;let s=null!=(n=r.skipTypes)?n:[];return t?Object.keys(t).reduce((r,n)=>(r[n]=lI(n,e,t,s),r),{}):{}},lI=(e,t,r,n)=>{let s=t.find(t=>t.name===e),i=null==s?void 0:s.type,a=r[e];return i&&!n.includes(i)?lN(i,a):lL(a)},lN=(e,t)=>{if("_"===e.charAt(0))return lB(t,e.slice(1,e.length));switch(e){case P.bool:return l$(t);case P.float4:case P.float8:case P.int2:case P.int4:case P.int8:case P.numeric:case P.oid:return lD(t);case P.json:case P.jsonb:return lU(t);case P.timestamp:return lM(t);case P.abstime:case P.date:case P.daterange:case P.int4range:case P.int8range:case P.money:case P.reltime:case P.text:case P.time:case P.timestamptz:case P.timetz:case P.tsrange:case P.tstzrange:default:return lL(t)}},lL=e=>e,l$=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},lD=e=>{if("string"==typeof e){let t=parseFloat(e);
19if(!Number.isNaN(t))return t}return e},lU=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},lB=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch(e){n=s?s.split(","):[]}return n.map(e=>lN(t,e))}return e},lM=e=>"string"==typeof e?e.replace(" ","T"):e,lF=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var lz=e=>"function"==typeof e?e:function(){return e},lq="u">typeof window?window:null,lV=("u">typeof self?self:null)||lq||globalThis,lW="closed",lH="errored",lK="joined",lJ="joining",lG="leaving",lX="phx_close",lY="phx_error",lZ="phx_reply",lQ="phx_leave",l0="websocket",l1="base64url.bearer.phx.",l2=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},l5=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},l3=class{constructor(e,t,r){this.state=lW,this.topic=e,this.params=lz(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new l2(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new l5(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=lK,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=lH,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=lW,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=lH,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new l2(this,lQ,lz({}),this.timeout).send(),this.state=lH,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(lZ,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(!this.joinedOnce)return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush;throw Error("tried to join multiple times. 'join' can only be called a single time per channel instance")}
19teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=lW,this.bindings=[]}onClose(e){this.on(lX,e)}onError(e){return this.on(lY,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>r.event!==e||void 0!==t&&t!==r.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new l2(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=lG;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(lX,"leave")},r=new l2(this,lQ,lz({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic===e&&(!n||n===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=lJ,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(n=>n.event===e&&this.filterBindings(n,t,r));for(let e=0;e<i.length;e++)i[e].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===lW}isErrored(){return this.state===lH}isJoined(){return this.state===lK}isJoining(){return this.state===lJ}isLeaving(){return this.state===lG}},l4=class{static request(e,t,r,n,s,i,a){if(lV.XDomainRequest){let r=new lV.XDomainRequest;return this.xdomainRequest(r,e,t,n,s,i,a)}if(lV.XMLHttpRequest){let o=new lV.XMLHttpRequest;return this.xhrRequest(o,e,t,r,n,s,i,a)}if(lV.fetch&&lV.AbortController)return this.fetchRequest(e,t,r,n,s,i,a);throw Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,r,n,s,i,a){let o={method:e,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),o.signal=l.signal),lV.fetch(t,o).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>a&&a(e)).catch(e=>{"AbortError"===e.name&&i?i():a&&a(null)}),l}static xdomainRequest(e,t,r,n,s,i,a){return e.timeout=s,e.open(t,r),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,i,a,o){for(let[s,a]of(e.open(t,r,!0),e.timeout=i,Object.entries(n)))e.setRequestHeader(s,a);return e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{4===e.readyState&&o&&o(this.parseJSON(e.responseText))},a&&(e.ontimeout=a),e.send(s),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,i=e[n];"object"==typeof i?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},l8=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(l1)&&(this.authToken=atob(t[1].slice(l1.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(RegExp("(.*)/"+l0),"$1/longpoll")}endpointURL(){return l4.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=0}
19ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){let e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(410===t&&null!==this.token){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String.fromCharCode(r[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join("\n"),()=>
19this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,r){for(let e of this.reqs)e.abort();this.readyState=3;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"u">typeof CloseEvent?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let i,a=()=>{this.reqs.delete(i),n()};i=l4.request(e,this.endpointURL(),t,r,this.timeout,a,e=>{this.reqs.delete(i),this.isActive()&&s(e)}),this.reqs.add(i)}},l6=class e{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,r,n),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,r,n)}),this.pendingDiffs=[],s()}),this.channel.on(n.diff,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,r,n),s())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let s=this.clone(e),i={},a={};return this.map(s,(e,r)=>{t[e]||(a[e]=r)}),this.map(t,(e,t)=>{let r=s[e];if(r){let n=t.metas.map(e=>e.phx_ref),s=r.metas.map(e=>e.phx_ref),o=t.metas.filter(e=>0>s.indexOf(e.phx_ref)),l=r.metas.filter(e=>0>n.indexOf(e.phx_ref));o.length>0&&(i[e]=t,i[e].metas=o),l.length>0&&(a[e]=this.clone(r),a[e].metas=l)}else i[e]=t}),this.syncDiff(s,{joins:i,leaves:a},r,n)}static syncDiff(e,t,r,n){let{joins:s,leaves:i}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(s,(t,n)=>{let s=e[t];if(e[t]=this.clone(n),s){let r=e[t].metas.map(e=>e.phx_ref),n=s.metas.filter(e=>0>r.indexOf(e.phx_ref));e[t].metas.unshift(...n)}r(t,s,n)}),this.map(i,(t,r)=>{let s=e[t];if(!s)return;let i=r.metas.map(e=>e.phx_ref);s.metas=s.metas.filter(e=>0>i.indexOf(e.phx_ref)),n(t,s,r),0===s.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,r)=>t(e,r))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},l9={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){return e.payload.constructor===ArrayBuffer?t(this.binaryEncode(e)):t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload]))},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:i}=e,a=this.META_LENGTH+t.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,t.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(t,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(r,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(s,e=>l.setUint8(u++,e.charCodeAt(0))),Array.from(n,e=>l.setUint8(u++,e.charCodeAt(0)));var c=new Uint8Array(o.byteLength+i.byteLength);return c.set(new Uint8Array(o),0),c.set(new Uint8Array(i),o.byteLength),c.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(e.slice(a,a+n));a+=n;let l=r.decode(e.slice(a,a+s));a+=s;let u=r.decode(e.slice(a,a+i));return a+=i,{join_ref:o,ref:null,topic:l,event:u,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(o,o+n));o+=n;let u=r.decode(e.slice(o,o+s));o+=s;let c=r.decode(e.slice(o,o+i));o+=i;let d=r.decode(e.slice(o,o+a));return o+=a,{join_ref:l,ref:u,topic:c,event:lZ,payload:{status:d,response:e.slice(o,e.byteLength)}}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,a=r.decode(e.slice(i,i+n));i+=n;let o=r.decode(e.slice(i,i+s));return i+=s,{join_ref:null,ref:null,topic:a,event:o,payload:e.slice(i,e.byteLength)}}},l7=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||lV.WebSocket||l8,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||lV&&lV.sessionStorage,this.establishedConnections=0,this.defaultEncoder=l9.encode.bind(l9),this.defaultDecoder=l9.decode.bind(l9),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==l8?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;lq&&lq.addEventListener&&(lq.addEventListener("pagehide",e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),lq.addEventListener("pageshow",e=>{r===this.connectClock&&(r=null,this.connect())}),lq.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState?this.pageHidden=!0:(this.pageHidden=!1,this.isConnected()||this.closeWasClean||this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,r)=>{console.log(`${e}: ${t}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=lz(t.params||{}),this.endPoint=`${e}/${l0}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new l5(()=>
19{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return l8}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=l4.appendParams(l4.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=lz(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==l8?this.connectWithF
19allback(l8,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){return e===l8?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix",`${l1}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){let r,n;clearTimeout(this.fallbackTimer);let s=!1,i=!0,a=this.transportName(e),o=t=>{this.log("transport",`falling back to ${a}...`,t),this.off([r,n]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError(e=>{this.log("transport","error",e),i&&!s&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!i){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,"true"),this.log("transport",`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();let n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){5!==r&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r):t()}waitForSocketClosed(e,t,r=1){5===r||3===e.readyState?t():setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError()}
19triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(lY)})}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let r=new l3(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef)return void this.heartbeatTimeout();this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;if(s&&s===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===n.status?"ok":"error",e)}catch(e){this.log("error","error in heartbeat callback",e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${s&&"("+s+")"||""}`.trim(),n);for(let e=0;e<this.channels.length;e++){let a=this.channels[e];a.isMember(t,r,n,i)&&a.trigger(r,n,s,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class ue{constructor(e,t){const r=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(t);this.presence=new l6(e.getChannel(),r),this.presence.onJoin((t,r,n)=>{let s=ue.onJoinPayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onLeave((t,r,n)=>{let s=ue.onLeavePayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ue.transformState(this.presence.state)}static transformState(e){return Object.getOwnPropertyNames(e=JSON.parse(JSON.stringify(e))).reduce((t,r)=>{let n=e[r];return t[r]=ut(n),t},{})}static onJoinPayload(e,t,r){return{event:"join",key:e,currentPresences:ur(t),newPresences:ut(r)}}static onLeavePayload(e,t,r){return{event:"leave",key:e,currentPresences:ur(t),leftPresences:ut(r)}}}function ut(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function ur(e){return(null==e?void 0:e.metas)?ut(e):[]}(S=I||(I={})).SYNC="sync",S.JOIN="join",S.LEAVE="leave";class un{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new ue(this.channel.channelAdapter,t)}}class us{constructor(e,t,r){const n=function(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch(t){throw`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload())}return n}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===lO}isJoined(){return this.state===lO}isJoining(){return"joining"===this.state}isClosed(){return"closed"===this.state}isLeaving(){return"leaving"===this.state}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}(T=N||(N={})).ALL="*",T.INSERT="INSERT",T.UPDATE="UPDATE",T.DELETE="DELETE",(R=L||(L={})).BROADCAST="broadcast",R.PRESENCE="presence",R.POSTGRES_CHANGES="postgres_changes",R.SYSTEM="system",(A=$||($={})).SUBSCRIBED="SUBSCRIBED",A.TIMED_OUT="TIMED_OUT",A.CLOSED="CLOSED",A.CHANNEL_ERROR="CHANNEL_ERROR";class ui{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new us(this.socket.socketAdapter,e,this.params),this.presence=new un(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=lF(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(null==(s=null==(n=this.params.config)?void 0:n.broadcast)?void 0:s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,t=this.timeout){var r,n,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:i,presence:a,private:o}}=this.params,l=null!=(n=null==(r=this.bindings.postgres_changes)?void 0:r.map(e=>e.filter))?n:[],u=!!this.bindings[L.PRESENCE]&&this.bindings[L.PRESENCE].length>0||(null==(s=this.params.config.presence)?void 0:s.enabled)===!0,c={},d={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:l,private:o};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this._onError(t=>{null==e||e($.CHANNEL_ERROR,t)}),this._onClose(()=>null==e?void 0:e($.CLOSED)),this.updateJoinPayload(Object.assign({config:d},c)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),void 0===t){null==e||e($.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive("error",t=>{this.state=lA,null==e||e($.CHANNEL_ERROR,Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{null==e||e($.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;let n=this.bindings.postgres_changes,s=null!=(r=null==n?void 0:n.length)?r:0,i=[];for(let r=0;r<s;r++){let s=n[r],{filter:{event:a,schema:o,table:l,filter:u}}=s,c=e&&e[r];
19if(c&&c.event===a&&ui.isFilterValueEqual(c.schema,o)&&ui.isFilterValueEqual(c.table,l)&&ui.isFilterValueEqual(c.filter,u))i.push(Object.assign(Object.assign({},s),{id:c.id}));else{this.unsubscribe(),this.state=lA,null==t||t($.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=lA&&t&&t($.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){if(this.channelAdapter.isJoined()&&e===L.PRESENCE)throw this.socket.log("channel",`cannot add presence callbacks for ${this.topic} after joining.`),Error("cannot add presence callbacks after joining a channel");return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(null==t)return Promise.reject("Payload is required for httpSend()");let s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);let i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,i,null!=(n=r.timeout)?n:this.timeout);if(202===a.status)return{success:!0};let o=a.statusText;try{let e=await a.json();o=e.error||e.message||o}catch(e){}return Promise.reject(Error(o))}async send(e,t={}){var r,n;if(this.channelAdapter.canPush()||"broadcast"!==e.type)return new Promise(r=>{var n,s,i;let a=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null==(i=null==(s=null==(n=this.params)?void 0:n.config)?void 0:s.broadcast)?void 0:i.ack)||r("ok"),a.receive("ok",()=>r("ok")),a.receive("error",()=>r("error")),a.receive("timeout",()=>r("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
19in the future. Please use httpSend() explicitly for REST delivery.");let{event:s,payload:i}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!=(r=t.timeout)?r:this.timeout);return await (null==(n=e.body)?void 0:n.cancel()),e.ok?"ok":"error"}catch(e){if("AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){let n=new AbortController,s=setTimeout(()=>n.abort(),r),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(s),i}_on(e,t,r){let n=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),i={type:n,filter:t,callback:r,ref:s};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,s,i,a,o,l,u;let c=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(c,r))return!1;let d=null==(n=this.bindings[c])?void 0:n.find(t=>t.ref===e.ref);if(!d)return!0;if(!["broadcast","presence","postgres_changes"].includes(c))return d.type.toLocaleLowerCase()===c;if("id"in d){let e=d.id,r=null==(s=d.filter)?void 0:s.event;return e&&(null==(i=t.ids)?void 0:i.includes(e))&&("*"===r||(null==r?void 0:r.toLocaleLowerCase())===(null==(a=t.data)?void 0:a.type.toLocaleLowerCase()))}{let e=null==(l=null==(o=null==d?void 0:d.filter)?void 0:o.event)?void 0:l.toLocaleLowerCase();return"*"===e||e===(null==(u=null==t?void 0:t.event)?void 0:u.toLocaleLowerCase())}})}_notThisChannelEvent(e,t){let{close:r,error:n,leave:s,join:i}=lC;return t&&[r,n,s,i].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if("object"==typeof t&&"ids"in t){let e=t.data,{schema:r,table:n,commit_timestamp:s,type:i,errors:a}=e;return Object.assign(Object.assign({},{schema:r,table:n,commit_timestamp:s,eventType:i,new:{},old:{},errors:a}),this._getPayloadRecords(e))}return t})}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=lP(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=lP(e.columns,e.old_record)),t}}class ua{constructor(e,t){this.socket=new l7(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),n),this.socket.disconnect(()=>{e(),s("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return"connecting"==this.socket.connectionState()}isDisconnecting(){return"closing"==this.socket.connectionState()}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}let uo=[1e3,2e3,5e3,1e4],ul=` 20 addEventListener("message", (e) => { 21 if (e.data.event === "start") { 22 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 23 } 24 });`;class uu{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){var r;if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
24,this.ref=0,this.serializer=new lj,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null==(r=null==t?void 0:t.params)?void 0:r.apikey))throw Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;const n=this._initializeOptions(t);this.socketAdapter=new ua(e,n),this.httpEndpoint=lF(e),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){let e=t.message;if(e.includes("Node.js"))throw Error(`${e} 25 26To use Realtime in Node.js, you need to provide a WebSocket implementation: 27 28Option 1: Use Node.js 22+ which has native WebSocket support 29Option 2: Install and provide the "ws" package: 30 31 npm install ws 32 33 import ws from "ws" 34 const client = new RealtimeClient(url, { 35 ...options, 36 transport: ws 37 })`);throw Error(`WebSocket not available: ${e}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return"ok"===t&&e.teardown(),0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||"closed"}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let r=`realtime:${e}`,n=this.getChannels().find(e=>e.topic===r);if(n)return n;{let r=new ui(`realtime:${e}`,t,this);return this.channels.push(r),r}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log("error","Error fetching access token from callback",e),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let r={access_token:t,version:"realtime-js/2.100.0"};t&&e.updateJoinPayload(r),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(lC.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log("error","error waiting for auth on connect",e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{"sent"==t&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([ul],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_initializeOptions(e){var t,r,n,s,i,a,o,l,u;let c,d;this.worker=null!=(t=null==e?void 0:e.worker)&&t,this.accessToken=null!=(r=null==e?void 0:e.accessToken)?r:null;let h={};h.timeout=null!=(n=null==e?void 0:e.timeout)?n:1e4,h.heartbeatIntervalMs=null!=(s=null==e?void 0:e.heartbeatIntervalMs)?s:25e3,h.transport=null!=(i=null==e?void 0:e.transport)?i:lT.getWebSocketConstructor(),h.params=null==e?void 0:e.params,h.logger=null==e?void 0:e.logger,h.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),h.reconnectAfterMs=null!=(a=null==e?void 0:e.reconnectAfterMs)?a:e=>uo[e-1]||1e4;let f=null!=(o=null==e?void 0:e.vsn)?o:lR;switch(f){case"1.0.0":c=(e,t)=>t(JSON.stringify(e)),d=(e,t)=>t(JSON.parse(e));break;case lR:c=this.serializer.encode.bind(this.serializer),d=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${h.vsn}`)}if(h.vsn=f,h.encode=null!=(l=null==e?void 0:e.encode)?l:c,h.decode=null!=(u=null==e?void 0:e.decode)?u:d,h.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,h.params=Object.assign(Object.assign({},h.params),{log_level:this.logLevel})),this.worker){if("u">typeof window&&!window.Worker)throw Error("Web Worker is not supported");this.workerUrl=null==e?void 0:e.workerUrl,h.autoSendHeartbeat=!this.worker}return h}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
37var uc=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};async function ud(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}function uh(e){return e.join("\x1f")}var uf=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:uh(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${uh(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${uh(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${uh(e.namespace)}`}),!0}catch(e){if(e instanceof uc&&404===e.status)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof uc&&409===e.status)return;throw e}}};function up(e){return e.join("\x1f")}var um=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${up(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${up(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${up(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${up(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${up(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${up(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof uc&&404===e.status)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof uc&&409===r.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},ug=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=function(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:a}){let o=function(e,t,r){let n=new URL(t,e);if(r)for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);return n.toString()}(e.baseUrl,n,s),l=await ud(e.auth),u=await t(o,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...a},body:i?JSON.stringify(i):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),h=d&&c?JSON.parse(c):c;if(!u.ok){let e=d?h:void 0,t=e?.error;throw new uc(t?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:u.status,headers:u.headers,data:h}}}}({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new uf(this.client,t),this.tableOps=new um(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
37async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},uy=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function ub(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var uv=class extends uy{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name="vectors"===n?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},uw=class extends uy{constructor(e,t,r="storage"){super(e,r),this.name="vectors"===r?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};let u_=e=>{if(Array.isArray(e))return e.map(e=>u_(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,r])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=u_(r)}),t};function uk(e){return(uk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ux(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function uE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ux(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=uk(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uk(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==uk(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ux(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}let uS=e=>{var t;return e.msg||e.message||e.error_description||("string"==typeof e.error?e.error:null==(t=e.error)?void 0:t.message)||JSON.stringify(e)},uT=async(e,t,r,n)=>{if(null!==e&&"object"==typeof e&&"function"==typeof e.json){let r=parseInt(e.status,10);Number.isFinite(r)||(r=500),e.json().then(e=>{let s=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||r+"";t(new uv(uS(e),r,s,n))}).catch(()=>{let s=r+"";t(new uv(e.statusText||`HTTP ${r} error`,r,s,n))})}else t(new uw(uS(e),e,n))};async function uR(e,t,r,n,s,i,a){return new Promise((o,l)=>{let u;e(r,(u={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t||"HEAD"===t||!i||((e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)})(i)?(u.headers=uE({"Content-Type":"application/json"},null==n?void 0:n.headers),u.body=JSON.stringify(i)):u.body=i,(null==n?void 0:n.duplex)&&(u.duplex=n.duplex)),uE(uE({},u),s))).then(e=>{if(!e.ok)throw e;if(null==n?void 0:n.noResolveJson)return e;if("vectors"===a){let t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status||!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>o(e)).catch(e=>uT(e,l,n,a))})}function uA(e="storage"){return{get:async(t,r,n,s)=>uR(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,i)=>uR(t,"POST",r,s,i,n,e),put:async(t,r,n,s,i)=>uR(t,"PUT",r,s,i,n,e),head:async(t,r,n,s)=>uR(t,"HEAD",r,uE(uE({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,i)=>uR(t,"DELETE",r,s,i,n,e)}}let{get:uO,post:uC,put:uj,head:uP,remove:uI}=uA("storage"),uN=uA("vectors");var uL=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=uE(uE({},this.headers),{},{[e]:t}),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ub(e))return{data:null,error:e};throw e}}},u$=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ub(e))return{data:null,error:e};throw e}}};r=Symbol.toStringTag;var uD=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[r]="BlobDownloadBuilder",this.promise=null}asStream(){return new u$(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await (await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ub(e))return{data:null,error:e};throw e}}};let uU={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},uB={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var uM=class extends uL{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let i,a=uE(uE({},uB),n),o=uE(uE({},s.headers),"POST"===e&&{"x-upsert":String(a.upsert)}),l=a.metadata;"u">typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",a.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):"u">typeof FormData&&r instanceof FormData?((i=r).has("cacheControl")||i.append("cacheControl",a.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!a.duplex&&(a.duplex="half")),(null==n?void 0:n.headers)&&(o=uE(uE({},o),n.headers));let u=s._removeEmptyFolders(t),c=s._getFinalPath(u),d=await ("PUT"==e?uj:uC)(s.fetch,`${s.url}/object/${c}`,i,uE({headers:o},(null==a?void 0:a.duplex)?{duplex:a.duplex}:{}));return{path:u,id:d.Id,fullPath:d.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;let i=s._removeEmptyFolders(e),a=s._getFinalPath(i),o=new URL(s.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),s.handleOperation(async()=>{let e,t=uE({upsert:uB.upsert},n),a=uE(uE({},s.headers),{"x-upsert":String(t.upsert)});return"u">typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",r)):"u">typeof FormData&&r instanceof FormData?(e=r).append("cacheControl",t.cacheControl):(e=r,a["cache-control"]=`max-age=${t.cacheControl}`,a["content-type"]=t.contentType),{path:i,fullPath:(await uj(s.fetch,o.toString(),e,{headers:a})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e),s=uE({},r.headers);(null==t?void 0:t.upsert)&&(s["x-upsert"]="true");let i=await uC(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+i.url),o=a.searchParams.get("token");if(!o)throw new uy("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await uC(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
37stinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await uC(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e),i="object"==typeof(null==r?void 0:r.transform)&&null!==r.transform&&Object.keys(r.transform).length>0,a=await uC(n.fetch,`${n.url}/object/sign/${s}`,uE({expiresIn:t},i?{transform:r.transform}:{}),{headers:n.headers}),o=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"",l=i&&a.signedURL.includes("/object/sign/")?a.signedURL.replace("/object/sign/","/render/image/sign/"):a.signedURL;return{signedUrl:encodeURI(`${n.url}${l}${o}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{let s=await uC(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"";return s.map(e=>uE(uE({},e),{},{signedUrl:e.signedURL?encodeURI(`${n.url}${e.signedURL}${i}`):null}))})}download(e,t,r){let n=void 0!==(null==t?void 0:t.transform)?"render/image/authenticated":"object",s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=s?`?${s}`:"",a=this._getFinalPath(e);return new uD(()=>uO(this.fetch,`${this.url}/${n}/${a}${i}`,{headers:this.headers,noResolveJson:!0},r),this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);return t.handleOperation(async()=>u_(await uO(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t;let r=this._getFinalPath(e);try{return await uP(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ub(e)){let r=e instanceof uv?e.status:e instanceof uw?null==(t=e.originalError)?void 0:t.status:void 0;if(void 0!==r&&[400,404].includes(r))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let r=this._getFinalPath(e),n=[],s=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==s&&n.push(s);let i=void 0!==(null==t?void 0:t.transform)?"render/image":"object",a=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==a&&n.push(a);let o=n.join("&");return""!==o&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${o}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await uI(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{let s=uE(uE(uE({},uU),t),{},{prefix:e||""});return await uC(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{let n=uE({},e);return await uC(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return void 0!==a9.Buffer?a9.Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};let uF={"X-Client-Info":"storage-js/2.100.0"};var uz=class extends uL{constructor(e,t={},r,n){const s=new URL(e);(null==n?void 0:n.useNewHostname)&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),super(s.href.replace(/\/$/,""),uE(uE({},uF),t),r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=t.listBucketOptionsToQueryString(e);return await uO(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await uO(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await uC(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await uj(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await uC(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await uI(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},uq=class extends uL{constructor(e,t={},r){super(e.replace(/\/$/,""),uE(uE({},uF),t),r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await uC(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=new URLSearchParams;(null==e?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(null==e?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&r.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&r.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&r.set("search",e.search);let n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await uO(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await uI(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(!(!e||"string"!=typeof e||0===e.length||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\"))&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e)))throw new uy("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new ug({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(e,t){let r=e[t];return"function"!=typeof r?r:async(...t)=>{try{return{data:await r.apply(e,t),error:null}}catch(e){if(n)throw e;return{data:null,error:e}}}}})}},uV=class extends uL{constructor(e,t={},r){super(e.replace(/\/$/,""),uE(uE({},uF),{},{"Content-Type":"application/json"},t),r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await uN.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await uN.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},uW=class extends uL{constructor(e,t={},r){super(e.replace(/\/$/,""),uE(uE({},uF),{},{"Content-Type":"application/json"},t),r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw Error("segmentCount must be between 1 and 16");
37if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},uH=class extends uL{constructor(e,t={},r){super(e.replace(/\/$/,""),uE(uE({},uF),{},{"Content-Type":"application/json"},t),r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await uN.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},uK=class extends uH{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new uJ(this.url,this.headers,e,this.fetch)}async createBucket(e){return super.createBucket.call(this,e)}async getBucket(e){return super.getBucket.call(this,e)}async listBuckets(e={}){return super.listBuckets.call(this,e)}async deleteBucket(e){return super.deleteBucket.call(this,e)}},uJ=class extends uV{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){return super.createIndex.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return super.listIndexes.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return super.getIndex.call(this,this.vectorBucketName,e)}async deleteIndex(e){return super.deleteIndex.call(this,this.vectorBucketName,e)}index(e){return new uG(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},uG=class extends uW{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){return super.putVectors.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async getVectors(e){return super.getVectors.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async listVectors(e={}){return super.listVectors.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async queryVectors(e){return super.queryVectors.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async deleteVectors(e){return super.deleteVectors.call(this,uE(uE({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}},uX=class extends uz{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new uM(this.url,this.headers,e,this.fetch)}get vectors(){return new uK(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new uq(this.url+"/iceberg",this.headers,this.fetch)}};let uY="2.100.0",uZ={"X-Client-Info":`gotrue-js/${uY}`},uQ="X-Supabase-Api-Version",u0={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},u1=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class u2 extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}}function u5(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class u3 extends u2{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}class u4 extends u2{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class u8 extends u2{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class u6 extends u8{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function u9(e){return u5(e)&&"AuthSessionMissingError"===e.name}class u7 extends u8{constructor(){super("Auth session or user missing","AuthInvalidToken
37ResponseError",500,void 0)}}class ce extends u8{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ct extends u8{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class cr extends u8{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class cn extends u8{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class cs extends u8{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function ci(e){return u5(e)&&"AuthRetryableFetchError"===e.name}class ca extends u8{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}}class co extends u8{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let cl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),cu=" \n\r=".split(""),cc=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<cu.length;t+=1)e[cu[t].charCodeAt(0)]=-2;for(let t=0;t<cl.length;t+=1)e[cl[t].charCodeAt(0)]=t;return e})();function cd(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(cl[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)r(cl[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function ch(e,t,r){let n=cc[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===n)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function cf(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}}(e,n,r)};for(let t=0;t<e.length;t+=1)ch(e.charCodeAt(t),s,i);return t.join("")}function cp(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)ch(e.charCodeAt(t),r,n);return new Uint8Array(t)}function cm(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>cd(e,r,n)),cd(null,r,n),t.join("")}let cg=()=>"u">typeof window&&"u">typeof document,cy={tested:!1,writable:!1},cb=()=>{if(!cg())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(cy.tested)return cy.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),cy.tested=!0,cy.writable=!0}catch(e){cy.tested=!0,cy.writable=!1}return cy.writable},cv=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),cw=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},c_=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return r}},ck=async(e,t)=>{await e.removeItem(t)};class cx{constructor(){this.promise=new cx.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function cE(e){let t=e.split(".");if(3!==t.length)throw new co("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!u1.test(t[e]))throw new co("JWT not in base64url format");return{header:JSON.parse(cf(t[0])),payload:JSON.parse(cf(t[1])),signature:cp(t[2]),raw:{header:t[0],payload:t[1]}}}async function cS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function cT(e){return("0"+e.toString(16)).substr(-2)}async function cR(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function cA(e){return"u">typeof crypto&&void 0!==crypto.subtle&&"u">typeof TextEncoder?btoa(await cR(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code
37challenge method will default to use plain instead of sha256."),e)}async function cO(e,t,r=!1){let n=function(){let e=new Uint32Array(56);if("u"<typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,cT).join("")}(),s=n;r&&(s+="/PASSWORD_RECOVERY"),await cw(e,`${t}-code-verifier`,s);let i=await cA(n),a=n===i?"plain":"s256";return[i,a]}cx.promiseConstructor=Promise;let cC=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i,cj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function cP(e){if(!cj.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function cI(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){let e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function cN(e){return JSON.parse(JSON.stringify(e))}let cL=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),c$=[502,503,504];async function cD(e){var t;let r,n;if(!("object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json))throw new cs(cL(e),0);if(c$.includes(e.status))throw new cs(cL(e),e.status);try{r=await e.json()}catch(e){throw new u4(cL(e),e)}let s=function(e){let t=e.headers.get(uQ);if(!t||!t.match(cC))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(s&&s.getTime()>=u0["2024-01-01"].timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?n=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(n=r.error_code),n){if("weak_password"===n)throw new ca(cL(r),e.status,(null==(t=r.weak_password)?void 0:t.reasons)||[]);else if("session_not_found"===n)throw new u6}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new ca(cL(r),e.status,r.weak_password.reasons);throw new u3(cL(r),e.status||500,n)}async function cU(e,t,r,n){var s;let i=Object.assign({},null==n?void 0:n.headers);i[uQ]||(i[uQ]=u0["2024-01-01"].name),(null==n?void 0:n.jwt)&&(i.Authorization=`Bearer ${n.jwt}`);let a=null!=(s=null==n?void 0:n.query)?s:{};(null==n?void 0:n.redirectTo)&&(a.redirect_to=n.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await cB(e,t,r+o,{headers:i,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function cB(e,t,r,n,s,i){let a,o,l=(o={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==n?void 0:n.headers),o.body=JSON.stringify(i),Object.assign(Object.assign({},o),s)));try{a=await e(r,Object.assign({},l))}catch(e){throw console.error(e),new cs(cL(e),0)}if(a.ok||await cD(a),null==n?void 0:n.noResolveJson)return a;try{return await a.json()}catch(e){await cD(e)}}function cM(e){var t,r,n;let s=null;(n=e).access_token&&n.refresh_token&&n.expires_in&&(s=Object.assign({},e),e.expires_at||(s.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:s,user:null!=(t=e.user)?t:e},error:null}}function cF(e){let t=cM(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>
37e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function cz(e){var t;return{data:{user:null!=(t=e.user)?t:e},error:null}}function cq(e){return{data:e,error:null}}function cV(e){let{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},user:Object.assign({},eC(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function cW(e){return e}let cH=["global","local","others"];class cK{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=cv(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,t=cH[0]){if(0>cH.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${cH.join(", ")}`);try{return await cU(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(u5(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await cU(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:cz})}catch(e){if(u5(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=eC(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=null==r?void 0:r.newEmail,delete n.newEmail),await cU(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:cV,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(u5(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await cU(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:cz})}catch(e){if(u5(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},u=await cU(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:cW});if(u.error)throw u.error;let c=await u.json(),d=null!=(i=u.headers.get("x-total-count"))?i:0,h=null!=(o=null==(a=u.headers.get("link"))?void 0:a.split(","))?o:[];return h.length>0&&(h.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(d)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(u5(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){cP(e);try{return await cU(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:cz})}catch(e){if(u5(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){cP(e);try{return await cU(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:cz})}catch(e){if(u5(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){cP(e);try{return await cU(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:cz})}catch(e){if(u5(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){cP(e.userId);try{let{data:t,error:r}=await cU(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _deleteFactor(e){cP(e.userId),cP(e.id);
37try{return{data:await cU(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},u=await cU(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:cW});if(u.error)throw u.error;let c=await u.json(),d=null!=(i=u.headers.get("x-total-count"))?i:0,h=null!=(o=null==(a=u.headers.get("link"))?void 0:a.split(","))?o:[];return h.length>0&&(h.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(d)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(u5(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await cU(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await cU(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await cU(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await cU(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await cU(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return(null==e?void 0:e.type)&&(t.type=e.type),await cU(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!=(t=null==e?void 0:e.providers)?t:[]},error:null}}})}catch(e){if(u5(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await cU(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await cU(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await cU(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(u5(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await cU(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(u5(e))return{data:null,error:e};throw e}}}function cJ(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}let cG={debug:!!(globalThis&&cb()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"))};class cX extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class cY extends cX{}async function cZ(e,t,r){let n;cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let s=new globalThis.AbortController;t>0&&(n=setTimeout(()=>{s.abort(),cG.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async s=>{if(s){clearTimeout(n),cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}if(0===t)throw cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new cY(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(cG.debug)try{let e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(e){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",e)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(n),await r()})}catch(i){if(t>0&&clearTimeout(n),(null==i?void 0:i.name)==="AbortError"&&t>0)if(s.signal.aborted)return cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@
37supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async t=>{if(!t)return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r();cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,t.name);try{return await r()}finally{cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,t.name)}}));else throw cG.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new cY(`Lock "${e}" was released because another request stole it`);throw i}}function cQ(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}class c0 extends Error{constructor({message:e,code:t,cause:r,name:n}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!=(s=null!=n?n:r instanceof Error?r.name:void 0)?s:"Unknown Error",this.code=t}}class c1 extends c0{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}let c2=new class{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function c5(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function c3(){var e,t;return!!(cg()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&"function"==typeof(null==(e=null==navigator?void 0:navigator.credentials)?void 0:e.create)&&"function"==typeof(null==(t=null==navigator?void 0:navigator.credentials)?void 0:t.get))}async function c4(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new c1("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new c1("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){var r,n,s;let{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new c0({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if((null==(r=i.authenticatorSelection)?void 0:r.requireResidentKey)===!0)return new c0({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&(null==(n=i.authenticatorSelection)?void 0:n.userVerification)==="required")return new c0({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if((null==(s=i.authenticatorSelection)?void 0:s.userVerification)==="required")return new c0({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new c0({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new c0({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new c0(0===i.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!c5(t))return new c0({message:`${window.location.hostname}
37 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(i.rp.id!==t)return new c0({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new c0({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new c0({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new c0({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function c8(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new c1("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new c1("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new c0({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new c0({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!c5(t))return new c0({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new c0({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new c0({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new c0({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let c6={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},c9={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function c7(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let s of e)if(s)for(let e in s){let i=s[e];if(void 0!==i)if(Array.isArray(i))n[e]=i;else if(r(i))n[e]=i;else if(t(i)){let r=n[e];t(r)?n[e]=c7(r,i):n[e]=c7(i)}else n[e]=i}return n}class de{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},s){var i,a,o,l,u;try{let{data:c,error:d}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!c)return{data:null,error:d};let h=null!=n?n:c2.createNewAbortSignal();if("create"===c.webauthn.type){let{user:e}=c.webauthn.credential_options.publicKey;if(!e.name)if(r)e.name=`${e.id}:${r}`;else{let t=(await this.client.getUser()).data.user,r=(null==(i=null==t?void 0:t.user_metadata)?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${r}`}e.displayName||(e.displayName=e.name)}switch(c.webauthn.type){case"create":{let t=(a=c.webauthn.credential_options.publicKey,o=null==s?void 0:s.create,c7(c6,a,o||{})),{data:r,error:n}=await c4({publicKey:t,signal:h});if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(l=c.webauthn.credential_options.publicKey,u=null==s?void 0:s.request,c7(c9,l,u||{})),{data:r,error:n}=await c8(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:t,signal:h}));if(r)return{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if(u5(e))return{data:null,error:e};return{data:null,error:new u4("Unexpected error in challenge",e)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t="u">typeof window?window.location.hostname:void 0,rpOrigins:r="u">typeof window?[window.location.origin]:void 0,signal:n}={}},s){if(!t)return{data:null,error:new u2("rpId is required for WebAuthn authentication")};try{if(!c3())return{data:null,error:new u4("Browser does not support WebAuthn",null)};let{data:i,error:a}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:n},{request:s});if(!i)return{data:null,error:a};let{webauthn:o}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:o.type,rpId:t,rpOrigins:r,credential_response:o.credential_response}})}catch(e){if(u5(e))return{data:null,error:e};return{data:null,error:new u4("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t="u">typeof window?window.location.hostname:void 0,rpOrigins:r="u">typeof window?[window.location.origin]:void 0,signal:n}={}},s){if(!t)return{data:null,error:new u2("rpId is required for WebAuthn registration")};try{if(!c3())return{data:null,error:new u4("Browser does not support WebAuthn",null)};let{data:i,error:a}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(t=>{var r;return null==(r=t.data)?void 0:r.all.find(t=>"webauthn"===t.factor_type&&t.friendly_name===e&&"unverified"!==t.status)}).then(e=>e?this.client.mfa.unenroll({factorId:null==e?void 0:e.id}):void 0),{data:null,error:a};let{data:o,error:l}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:n},{create:s});if(!o)return{data:null,error:l};return this._verify({factorId:i.id,challengeId:o.challengeId,webauthn:{rpId:t,rpOrigins:r,type:o.webauthn.type,credential_response:o.webauthn.credential_response}})}catch(e){if(u5(e))return{data:null,error:e};return{data:null,error:new u4("Unexpected error in register",e)}}}}if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"u">typeof self&&(self.globalThis=self)}let dt={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:uZ,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function dr(e,t,r){return await r()}let dn={};class ds{get jwks(){var e,t;
37return null!=(t=null==(e=dn[this.storageKey])?void 0:e.jwks)?t:{keys:[]}}set jwks(e){dn[this.storageKey]=Object.assign(Object.assign({},dn[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!=(t=null==(e=dn[this.storageKey])?void 0:e.cachedAt)?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){dn[this.storageKey]=Object.assign(Object.assign({},dn[this.storageKey]),{cachedAt:e})}constructor(e){var t,r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},dt),e);if(this.storageKey=s.storageKey,this.instanceID=null!=(t=ds.nextInstanceID[this.storageKey])?t:0,ds.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,"function"==typeof s.debug&&(this.logger=s.debug),this.instanceID>0&&cg()){const e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new cK({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=cv(s.fetch),this.lock=s.lock||dr,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&cg()&&(null==(r=null==globalThis?void 0:globalThis.navigator)?void 0:r.locks)?this.lock=cZ:this.lock=dr,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new de(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:cb()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=cJ(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=cJ(this.memoryStorage)),cg()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null==(n=this.broadcastChannel)||n.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug("#broadcastChannel","error",e)}})}s.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${uY}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){var e;try{let t={},r="none";if(cg()&&(t=function(e){let t={},r=new URL(e);if(r.hash&&"#"===r.hash[0])try{new URLSearchParams(r.hash.substring(1)).forEac
37h((e,r)=>{t[r]=e})}catch(e){}return r.searchParams.forEach((e,r)=>{t[r]=e}),t}(window.location.href),this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce")),cg()&&this.detectSessionInUrl&&"none"!==r){let{data:n,error:s}=await this._getSessionFromURL(t,r);if(s){(this._debug("#_initialize()","error detecting session from URL",s),u5(s)&&"AuthImplicitGrantRedirectError"===s.name)&&(null==(e=s.details)||e.code);return{error:s}}let{session:i,redirectType:a}=n;return this._debug("#_initialize()","detected session in URL",i,"redirect type",a),await this._saveSession(i),setTimeout(async()=>{"recovery"===a?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(u5(e))return this._returnResult({error:e});return this._returnResult({error:new u4("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{let{data:s,error:i}=await cU(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!=(r=null==(t=null==e?void 0:e.options)?void 0:t.data)?r:{},gotrue_meta_security:{captcha_token:null==(n=null==e?void 0:e.options)?void 0:n.captchaToken}},xform:cM});if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let a=s.session,o=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,r,n;try{let s;if("email"in e){let{email:r,password:n,options:i}=e,a=null,o=null;"pkce"===this.flowType&&([a,o]=await cO(this.storage,this.storageKey)),s=await cU(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==i?void 0:i.emailRedirectTo,body:{email:r,password:n,data:null!=(t=null==i?void 0:i.data)?t:{},gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:a,code_challenge_method:o},xform:cM})}else if("phone"in e){let{phone:t,password:i,options:a}=e;s=await cU(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!=(r=null==a?void 0:a.data)?r:{},channel:null!=(n=null==a?void 0:a.channel)?n:"sms",gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:cM})}else throw new ce("You must provide either an email or phone number and a password");let{data:i,error:a}=s;
37if(a||!i)return await ck(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});let o=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:r,password:n,options:s}=e;t=await cU(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:cF})}else if("phone"in e){let{phone:r,password:n,options:s}=e;t=await cU(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:cF})}else throw new ce("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){let e=new u7;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,r,n,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null==(t=e.options)?void 0:t.redirectTo,scopes:null==(r=e.options)?void 0:r.scopes,queryParams:null==(n=e.options)?void 0:n.queryParams,skipBrowserRedirect:null==(s=e.options)?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,s,i,a,o,l,u,c,d,h;let f,p;if("message"in e)f=e.message,p=e.signature;else{let c,{chain:d,wallet:m,statement:g,options:y}=e;if(cg())if("object"==typeof m)c=m;else{let e=window;if("ethereum"in e&&"object"==typeof e.ethereum&&"request"in e.ethereum&&"function"==typeof e.ethereum.request)c=e.ethereum;else throw Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if("object"!=typeof m||!(null==y?void 0:y.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");c=m}let b=new URL(null!=(t=null==y?void 0:y.url)?t:window.location.href),v=await c.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!v||0===v.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let w=cQ(v[0]),_=null==(r=null==y?void 0:y.signInWithEthereum)?void 0:r.chainId;_||(_=parseInt(await c.request({method:"eth_chainId"}),16)),f=function(e){var t;let{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:c,uri:d,version:h}=e;if(!Number.isInteger(r))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!d)throw Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==h)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);
37if(null==(t=e.statement)?void 0:t.includes("\n"))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=cQ(e.address),p=c?`${c}://${n}`:n,m=e.statement?`${e.statement} 38`:"",g=`${p} wants you to sign in with your Ethereum account: 39${f} 40 41${m}`,y=`URI: ${d} 42Version: ${h} 43Chain ID: ${r}${a?` 44Nonce: ${a}`:""} 45Issued At: ${i.toISOString()}`;if(s&&(y+=` 46Expiration Time: ${s.toISOString()}`),o&&(y+=` 47Not Before: ${o.toISOString()}`),l&&(y+=` 48Request ID: ${l}`),u){let e="\nResources:";for(let t of u){if(!t||"string"!=typeof t)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=` 49- ${t}`}y+=e}return`${g} 50${y}`}({domain:b.host,address:w,statement:g,uri:b.href,version:"1",chainId:_,nonce:null==(n=null==y?void 0:y.signInWithEthereum)?void 0:n.nonce,issuedAt:null!=(i=null==(s=null==y?void 0:y.signInWithEthereum)?void 0:s.issuedAt)?i:new Date,expirationTime:null==(a=null==y?void 0:y.signInWithEthereum)?void 0:a.expirationTime,notBefore:null==(o=null==y?void 0:y.signInWithEthereum)?void 0:o.notBefore,requestId:null==(l=null==y?void 0:y.signInWithEthereum)?void 0:l.requestId,resources:null==(u=null==y?void 0:y.signInWithEthereum)?void 0:u.resources}),p=await c.request({method:"personal_sign",params:[(h=f,"0x"+Array.from(new TextEncoder().encode(h),e=>e.toString(16).padStart(2,"0")).join("")),w]})}try{let{data:t,error:r}=await cU(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:p},(null==(c=e.options)?void 0:c.captchaToken)?{gotrue_meta_security:{captcha_token:null==(d=e.options)?void 0:d.captchaToken}}:null),xform:cM});if(r)throw r;if(!t||!t.session||!t.user){let e=new u7;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,r,n,s,i,a,o,l,u,c,d,h;let f,p;if("message"in e)f=e.message,p=e.signature;else{let d,{chain:h,wallet:m,statement:g,options:y}=e;if(cg())if("object"==typeof m)d=m;else{let e=window;if("solana"in e&&"object"==typeof e.solana&&("signIn"in e.solana&&"function"==typeof e.solana.signIn||"signMessage"in e.solana&&"function"==typeof e.solana.signMessage))d=e.solana;else throw Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if("object"!=typeof m||!(null==y?void 0:y.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");d=m}let b=new URL(null!=(t=null==y?void 0:y.url)?t:window.location.href);if("signIn"in d&&d.signIn){let e,t=await d.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==y?void 0:y.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),g?{statement:g}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)f="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),p=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in d)||"function"!=typeof d.signMessage||!("publicKey"in d)||"object"!=typeof d||!d.publicKey||!("toBase58"in d.publicKey)||"function"!=typeof d.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");f=[`${b.host} wants you to sign in with your Solana account:`,d.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${null!=(n=null==(r=null==y?void 0:y.signInWithSolana)?void 0:r.issuedAt)?n:new Date().toISOString()}`,...(null==(s=null==y?void 0:y.signInWithSolana)?void 0:s.notBefore)?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...(null==(i=null==y?void 0:y.signInWithSolana)?void 0:i.expirationTime)?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...(null==(a=null==y?void 0:y.signInWithSolana)?void 0:a.chainId)?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...(null==(o=null==y?void 0:y.signInWithSolana)?void 0:o.nonce)?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...(null==(l=null==y?void 0:y.signInWithSolana)?void 0:l.requestId)?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...(null==(c=null==(u=null==y?void 0:y.signInWithSolana)?void 0:u.resources)?void 0:c.length)?["Resources",...y.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await d.signMessage(new TextEncoder().encode(f),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=e}}try{let{data:t,error:r}=await cU(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:f,signature:cm(p)},(null==(d=e.options)?void 0:d.captchaToken)?{gotrue_meta_security:{captcha_token:null==(h=e.options)?void 0:h.captchaToken}}:null),xform:cM});if(r)throw r;if(!t||!t.session||!t.user){let e=new u7;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let t=await c_(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(null!=t?t:"").split("/");try{if(!r&&"pkce"===this.flowType)throw new cn;let{data:t,error:s}=await cU(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:cM});if(await ck(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user){let e=new u7;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=n?n:null}),error:s})}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:r,token:n,access_token:s,nonce:i}=e,{data:a,error:o}=await cU(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:cM});if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let e=new u7;return this._returnResult({data:{user:null,session:null},error:e})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:o})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,r,n,s,i;try{if("email"in e){let{email:n,options:s}=e,i=null,a=null;"pkce"===this.flowType&&([i,a]=await cO(this.storage,this.storageKey));let{error:o}=await cU(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!=(t=null==s?void 0:s.data)?t:{},create_user:null==(r=null==s?void 0:s.shouldCreateUser)||r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}if("phone"in e){let{phone:t,options:r}=e,{data:a,error:o}=await cU(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!=(n=null==r?void 0:r.data)?n:{},create_user:null==(s=null==r?void 0:r.shouldCreateUser)||s,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!=(i=null==r?void 0:r.channel)?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o})}throw new ce("You must provide either an email or phone number.")}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,r;try{let n,s;"options"in e&&(n=null==(t=e.options)?void 0:t.redirectTo,s=null==(r=e.options)?void 0:r.captchaToken);let{data:i,error:a}=await cU(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:n,xform:cM});if(a)throw a;if(!i)throw Error("An error occurred on token verification.");let o=i.session,l=i.user;return(null==o?void 0:o.access_token)&&(await this._saveSession(o),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,r,n,s,i;try{let a=null,o=null;"pkce"===this.flowType&&([a,o]=await cO(this.storage,this.storageKey));let l=await cU(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!=(r=null==(t=e.options)?void 0:t.redirectTo)?r:void 0}),(null==(n=null==e?void 0:e.options)?void 0:n.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:o}),headers:this.headers,xform:cq});
50return(null==(s=l.data)?void 0:s.url)&&cg()&&!(null==(i=e.options)?void 0:i.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new u6;let{error:n}=await cU(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:r,type:n,options:s}=e,{error:i}=await cU(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}if("phone"in e){let{phone:r,type:n,options:s}=e,{data:i,error:a}=await cU(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==i?void 0:i.message_id},error:a})}throw new ce("You must provide either an email or phone number and a type")}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let t=null,r=await c_(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),null!==r&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let n=!!t.expires_at&&1e3*t.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){let e=await c_(this.userStorage,this.storageKey+"-user");(null==e?void 0:e.user)?t.user=e.user:t.user=cI()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){var e;let r={value:this.suppressGetSessionWarning};t.user=(e=t.user,new Proxy(e,{get:(e,t,n)=>{if("__isInsecureUserWarningProxy"===t)return!0;if("symbol"==typeof t){let r=t.toString();if("Symbol(Symbol.toPrimitive)"===r||"Symbol(Symbol.toStringTag)"===r||"Symbol(util.inspect.custom)"===r||"Symbol(nodejs.util.inspect.custom)"===r)return Reflect.get(e,t,n)}return r.value||"string"!=typeof t||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(e,t,n)}})),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:s,error:i}=await this._callRefreshToken(t.refresh_token);if(i)return this._returnResult({data:{session:null},error:i});return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{if(e)return await cU(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:cz});return await this._useSession(async e=>{var t,r,n;let{data:s,error:i}=e;if(i)throw i;return(null==(t=s.session)?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await cU(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0,xform:cz}):{data:{user:null},error:new u6}})}catch(e){if(u5(e))return u9(e)&&(await this._removeSession(),await ck(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:n,error:s}=r;if(s)throw s;
50if(!n.session)throw new u6;let i=n.session,a=null,o=null;"pkce"===this.flowType&&null!=e.email&&([a,o]=await cO(this.storage,this.storageKey));let{data:l,error:u}=await cU(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:o}),jwt:i.access_token,xform:cz});if(u)throw u;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new u6;let t=Date.now()/1e3,r=t,n=!0,s=null,{payload:i}=cE(e.access_token);if(i.exp&&(n=(r=i.exp)<=t),n){let{data:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!t)return{data:{user:null,session:null},error:null};s=t}else{let{data:n,error:i}=await this._getUser(e.access_token);if(i)return this._returnResult({data:{user:null,session:null},error:i});s={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(e){if(u5(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:s}=t;if(s)throw s;e=null!=(r=n.session)?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new u6;let{data:n,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!cg())throw new ct("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ct(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if("pkce"===this.flowType)throw new cr("Not a valid PKCE flow url.");break;case"pkce":if("implicit"===this.flowType)throw new ct("Not a valid implicit grant flow url.")}if("pkce"===t){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new cr("No code detected.");let{data:t,error:r}=await this._exchangeCodeForSession(e.code);if(r)throw r;let n=new URL(window.location.href);return n.searchParams.delete("code"),window.history.replaceState(window.history.state,"",n.toString()),{data:{session:t.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:n,access_token:s,refresh_token:i,expires_in:a,expires_at:o,token_type:l}=e;if(!s||!a||!i||!l)throw new ct("No session defined in URL");let u=Math.round(Date.now()/1e3),c=parseInt(a),d=u+c;o&&(d=parseInt(o));let h=d-u;1e3*h<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${c}s`);let f=d-c;u-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,d,u):u-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",f,d,u);let{data:p,error:m}=await this._getUser(s);if(m)throw m;let g={provider_token:r,provider_refresh_token:n,access_token:s,expires_in:c,expires_at:d,refresh_token:i,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(u5(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await c_(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s&&!u9(s))return this._returnResult({error:s});let i=null==(r=n.session)?void 0:r.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(u5(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status||403===t.status)||u9(t)))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await ck(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=Symbol("auth-callback"),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:s}=t;if(s)throw s;await (null==(r=this.stateChangeEmitters.get(e))?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){await (null==(n=this.stateChangeEmitters.get(e))?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;"pkce"===this.flowType&&([r,n]=await cO(this.storage,this.storageKey,!0));try{return await cU(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:null!=(e=t.user.identities)?e:[]},error:null})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{let{data:r,error:n}=await this._useSession(async t=>{var r,n,s,i,a;let{data:o,error:l}=t;if(l)throw l;let u=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null==(r=e.options)?void 0:r.redirectTo,scopes:null==(n=e.options)?void 0:n.scopes,queryParams:null==(s=e.options)?void 0:s.queryParams,skipBrowserRedirect:!0});return await cU(this.fetch,"GET",u,{headers:this.headers,jwt:null!=(a=null==(i=o.session)?void 0:i.access_token)?a:void 0})});if(n)throw n;return!cg()||(null==(t=e.options)?void 0:t.skipBrowserRedirect)||window.location.assign(null==r?void 0:r.url),this._returnResult({data:{provider:e.provider,url:null==r?void 0:r.url},error:null})}catch(t){if(u5(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{let{error:n,data:{session:s}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:l,nonce:u}=e,{data:c,error:d}=await cU(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!=(r=null==s?void 0:s.access_token)?r:void 0,body:{provider:a,id_token:o,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:cM});if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c||!c.session||!c.user)return this._returnResult({data:{user:null,session:null},error:new u7});return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("USER_UPDATED",c.session)),this._returnResult({data:c,error:d})}catch(e){if(await ck(this.storage,`${this.storageKey}-code-verifier`),u5(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)throw i;
50return await cU(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0})})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{var r,n;let s=Date.now();return await (r=async r=>(r>0&&await cS(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await cU(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:cM})),n=(e,t)=>{let r=200*Math.pow(2,e);return t&&ci(t)&&Date.now()+r-s<3e4},new Promise((e,t)=>{(async()=>{for(let s=0;s<1/0;s++)try{let t=await r(s);if(!n(s,null,t))return void e(t)}catch(e){if(!n(s,e))return void t(e)}})()}))}catch(e){if(this._debug(t,"error",e),u5(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),cg()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await c_(this.storage,this.storageKey);if(n&&this.userStorage){let t=await c_(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:n.user},await cw(this.userStorage,this.storageKey+"-user",t)),n.user=null!=(e=null==t?void 0:t.user)?e:cI()}else if(n&&!n.user&&!n.user){let e=await c_(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(n.user=e.user,await ck(this.storage,this.storageKey+"-user"),await cw(this.storage,this.storageKey,n)):n.user=cI()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),null!==n&&await this._removeSession();return}let s=(null!=(t=n.expires_at)?t:1/0)*1e3-Date.now()<9e4;if(this._debug(r,`session has${s?"":" not"} expired with margin of 90000s`),s){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=await this._callRefreshToken(n.refresh_token);e&&(console.error(e),ci(e)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(n.user&&!0===n.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(n.access_token);!t&&(null==e?void 0:e.user)?(n.user=e.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(r,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(r,"error",e),console.error(e);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new u6;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new cx;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new u6;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let n={data:t.session,error:null};return this.refreshingDeferred.resolve(n),n}catch(e){if(this._debug(n,"error",e),u5(e)){let r={data:null,error:e};return ci(e)||await this._removeSession(),null==(t=this.refreshingDeferred)||t.resolve(r),r}throw null==(r=this.refreshingDeferred)||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(s),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await ck(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),r=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!r&&t.user&&await cw(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let n=cN(e);await cw(this.storage,this.storageKey,n)}else{let e=cN(t);await cw(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ck(this.storage,this.storageKey),await ck(this.storage,this.storageKey+"-code-verifier"),await ck(this.storage,this.storageKey+"-user"),this.userStorage&&await ck(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&cg()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
50catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof cX)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!cg()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"!==document.visibilityState?this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting"):await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let n=[`provider=${encodeURIComponent(t)}`];if((null==r?void 0:r.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),(null==r?void 0:r.scopes)&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),"pkce"===this.flowType){let[e,t]=await cO(this.storage,this.storageKey),r=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});n.push(r.toString())}if(null==r?void 0:r.queryParams){let e=new URLSearchParams(r.queryParams);n.push(e.toString())}return(null==r?void 0:r.skipBrowserRedirect)&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;return s?this._returnResult({data:null,error:s}):await cU(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token})})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:o,error:l}=await cU(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:null==(r=null==s?void 0:s.session)?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===o.type&&(null==(n=null==o?void 0:o.totp)?void 0:n.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),this._returnResult({data:o,error:null}))})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r,n,s;let{data:i,error:a}=t;if(a)return this._returnResult({data:null,error:a});let o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?(n=e.webauthn.credential_response,"toJSON"in n&&"function"==typeof n.toJSON?n.toJSON():{id:n.id,rawId:n.id,response:{attestationObject:cm(new Uint8Array(n.response.attestationObject)),clientDataJSON:cm(new Uint8Array(n.response.clientDataJSON))},type:"public-key",clientExtensionResults:n.getClientExtensionResults(),authenticatorAttachment:null!=(s=n.authenticatorAttachment)?s:void 0}):function(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();let r=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:cm(new Uint8Array(n.authenticatorData)),clientDataJSON:cm(new Uint8Array(n.clientDataJSON)),signature:cm(new Uint8Array(n.signature)),userHandle:n.userHandle?cm(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await cU(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:null==(r=null==i?void 0:i.session)?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=await cU(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});if(i.error)return i;let{data:a}=i;if("webauthn"!==a.type)return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:function(e){if(!e)throw Error("Credential creation options are required");if("u">typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:n}=e,s=eC(e,["challenge","user","excludeCredentials"]),i=cp(t).buffer,a=Object.assign(Object.assign({},r),{id:cp(r.id).buffer}),o=Object.assign(Object.assign({}
50,s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];o.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:cp(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return o}(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:function(e){if(!e)throw Error("Credential request options are required");if("u">typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,n=eC(e,["challenge","allowCredentials"]),s=cp(t).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];i.allowCredentials[e]=Object.assign(Object.assign({},t),{id:cp(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return i}(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};let n={all:[],phone:[],totp:[],webauthn:[]};for(let r of null!=(e=null==t?void 0:t.factors)?e:[])n.all.push(r),"verified"===r.status&&n[r.factor_type].push(r);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,s;if(e)try{let{payload:n}=cE(e),s=null;n.aal&&(s=n.aal);let i=s,{data:{user:a},error:o}=await this.getUser(e);if(o)return this._returnResult({data:null,error:o});(null!=(r=null==(t=null==a?void 0:a.factors)?void 0:t.filter(e=>"verified"===e.status))?r:[]).length>0&&(i="aal2");let l=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:l},error:null}}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:i},error:a}
50=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:o}=cE(i.access_token),l=null;o.aal&&(l=o.aal);let u=l;return(null!=(s=null==(n=i.user.factors)?void 0:n.filter(e=>"verified"===e.status))?s:[]).length>0&&(u="aal2"),{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:o.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await cU(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new u6})})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async r=>{let{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new u6});let i=await cU(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return i.data&&i.data.redirect_url&&cg()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async r=>{let{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new u6});let i=await cU(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return i.data&&i.data.redirect_url&&cg()&&!(null==t?void 0:t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await cU(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new u6})})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await cU(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new u6})})}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(t=>t.kid===e);if(r)return r;let n=Date.now();if((r=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>n)return r;let{data:s,error:i}=await cU(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return s.keys&&0!==s.keys.length&&(this.jwks=s,this.jwks_cached_at=n,r=s.keys.find(t=>t.kid===e))?r:null}async getClaims(e,t={}){try{var r;let n,s=e;if(!s){let{data:e,error:t}
50=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});s=e.session.access_token}let{header:i,payload:a,signature:o,raw:{header:l,payload:u}}=cE(s);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}(a.exp);let c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!c){let{error:e}=await this.getUser(s);if(e)throw e;return{data:{claims:a,header:i,signature:o},error:null}}let d=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}(i.alg),h=await crypto.subtle.importKey("jwk",c,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,(r=`${l}.${u}`,n=[],!function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(r,e=>n.push(e)),new Uint8Array(n))))throw new co("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(e){if(u5(e))return this._returnResult({data:null,error:e});throw e}}}ds.nextInstanceID={};let di=ds,da="";da="u">typeof Deno?"deno":"u">typeof document?"web":"u">typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";let dl={headers:{"X-Client-Info":`supabase-js-${da}/2.100.0`}},du={schema:"public"},dc={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},dd={};function dh(e){return(dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function df(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function dp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?df(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=dh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=dh(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==dh(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):df(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var dm=class extends di{constructor(e){super(e)}},dg=class{constructor(e,t,r){var n,s,i;this.supabaseUrl=e,this.supabaseKey=t;const a=function(e){let t=null==e?void 0:e.trim();if(!t)throw Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(t.endsWith("/")?t:t+"/")}catch(e){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}(e);if(!t)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l=function(e,t){var r,n;let{db:s,auth:i,realtime:a,global:o}=e,{db:l,auth:u,realtime:c,global:d}=t,h={db:dp(dp({},l),s),auth:dp(dp({},u),i),realtime:dp(dp({},c),a),storage:{},global:dp(dp(dp({},d),o),{},{headers:dp(dp({},null!=(r=null==d?void 0:d.headers)?r:{}),null!=(n=null==o?void 0:o.headers)?n:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}(null!=r?r:{},{db:du,realtime:dd,auth:dp(dp({},dc),{},{storageKey:o}),global:dl});this.storageKey=null!=(n=l.auth.storageKey)?n:"",this.headers=null!=(s=l.global.headers)?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!=(i=l.auth)?i:{},this.headers,l.global.fetch),this.fetch=((e,t,r)=>{let n=r?(...e)=>r(...e):(...e)=>fetch(...e),s=Headers;return async(r,i)=>{var a;let o=null!=(a=await t())?a:e,l=new s(null==i?void 0:i.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${o}`),n(r,dp(dp({},i),{},{headers:l}))}})(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(dp({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new lS(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new uX(this.storageUrl.href,this.headers,this.fetch,null==r?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new lm(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
50channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t;if(this.accessToken)return await this.accessToken();let{data:r}=await this.auth.getSession();return null!=(e=null==(t=r.session)?void 0:t.access_token)?e:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:a,lock:o,debug:l,throwOnError:u},c,d){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new dm({url:this.authUrl.href,headers:dp(dp({},h),c),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:o,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new uu(this.realtimeUrl.href,dp(dp({},e),{},{params:dp(dp({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}};(function(){if("u">typeof window)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(null==t)return!1;let r=t.match(/^v(\d+)\./);return!!r&&18>=parseInt(r[1],10)})()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");let dy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),db=" \n\r=".split(""),dv=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<db.length;t+=1)e[db[t].charCodeAt(0)]=-2;for(let t=0;t<dy.length;t+=1)e[dy[t].charCodeAt(0)]=t;return e})();function dw(e){let t=[],r=0,n=0;if(function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(e,e=>{for(r=r<<8|e,n+=8;n>=6;){let e=r>>n-6&63;t.push(dy[e]),n-=6}}),n>0)for(r<<=6-n,n=6;n>=6;){let e=r>>n-6&63;t.push(dy[e]),n-=6}return t.join("")}function d_(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s=0,i=0;for(let t=0;t<e.length;t+=1){let a=dv[e.charCodeAt(t)];if(a>-1)for(s=s<<6|a,i+=6;i>=8;)(function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}})(s>>i-8&255,n,r),i-=8;else if(-2===a)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join("")}var dk=e.i(22792);function dx(){return"u">typeof window&&void 0!==window.document}dk.parse,dk.serialize;let dE={path:"/",sameSite:"lax",httpOnly:!1,maxAge:3456e4},dS=/^(.*)[.](0|[1-9][0-9]*)$/;function dT(e,t){if(e===t)return!0;let r=e.match(dS);return!!r&&r[1]===t}function dR(e,t,r){let n=r??3180,s=encodeURIComponent(t);if(s.length<=n)return[{name:e,value:t}];let i=[];for(;s.length>0;){let e=s.slice(0,n),t=e.lastIndexOf("%");t>n-3&&(e=e.slice(0,t));let r="";for(;e.length>0;)try{r=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&"%"===e.at(-3)&&e.length>3)e=e.slice(0,e.length-3);else throw t}i.push(r),s=s.slice(e.length)}return i.map((t,r)=>({name:`${e}.${r}`,value:t}))}async function dA(e,t){let r=await t(e);if(r)return r;let n=[];for(let r=0;;r++){let s=`${e}.${r}`,i=await t(s);if(!i)break;n.push(i)}return n.length>0?n.join(""):null}let dO="base64-";async function dC({getAll:e,setAll:t,setItems:r,removedItems:n},s){let i=s.cookieEncoding,a=s.cookieOptions??null,o=await e([...r?Object.keys(r):[],...n?Object.keys(n):[]]),l=o?.map(({name:e})=>e)||[],u=Object.keys(n).flatMap(e=>l.filter(t=>dT(t,e))),c=Object.keys(r).flatMap(e=>{let t=new Set(l.filter(t=>dT(t,e))),n=r[e];"base64url"===i&&(n=dO+dw(n));let s=dR(e,n);
50return s.forEach(e=>{t.delete(e.name)}),u.push(...t),s}),d={...dE,...a,maxAge:0},h={...dE,...a,maxAge:dE.maxAge};delete d.name,delete h.name,await t([...u.map(e=>({name:e,value:"",options:d})),...c.map(({name:e,value:t})=>({name:e,value:t,options:h}))])}if(void 0!==aw.default&&aw.default.env?.npm_package_name){let e=aw.default.env.npm_package_name;["@supabase/auth-helpers-nextjs","@supabase/auth-helpers-react","@supabase/auth-helpers-remix","@supabase/auth-helpers-sveltekit"].includes(e)&&console.warn(` 51ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 52â â ï¸ IMPORTANT: Package Consolidation Notice â 53â â 54â The ${e.padEnd(35)} package name is deprecated. â 55â â 56â You are now using @supabase/ssr - a unified solution for all frameworks. â 57â â 58â The auth-helpers packages have been consolidated into @supabase/ssr â 59â to provide better maintenance and consistent APIs across frameworks. â 60â â 61â Please update your package.json to use @supabase/ssr directly: â 62â npm uninstall ${e.padEnd(42)} â 63â npm install @supabase/ssr â 64â â 65â For more information, visit: â 66â https://supabase.com/docs/guides/auth/server-side â 67ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 68 `)}let dj=({round:e,competition:t,topics:r})=>{let{register:s,handleSubmit:i,control:a,reset:o,formState:{errors:l}}=function(e={}){let t=U.default.useRef(void 0),r=U.default.useRef(void 0),[n,s]=U.default.useState({isDirty:!1,isValidating:!1,isLoading:rT(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:rT(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!rT(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:r,...s}=function(e={}){let t,r={...nd,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:rT(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},s={},i=(rg(r.defaultValues)||rg(r.values))&&r_(r.defaultValues||r.values)||{},a=r.shouldUnregister?{}:r_(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0,c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...c},h={...d},f={array:rG(),state:rG()},p="all"===r.criteriaMode,m=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||h.isValid||e)){let e;r.resolver?(e=rX((await v()).errors),g()):e=await k({fields:s,onlyCheckValid:!0,eventType:"valid"}),e!==n.isValid&&f.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?rR(n.validatingFields,e,t):rQ(n.validatingFields,e))}),f.state.next({validatingFields:n.validatingFields,isValidating:!rX(n.validatingFields)}))},y=(e,t,r,n)=>{let l=rS(s,e);if(l){let s=rS(a,e,rk(r)?rS(i,e):r);rk(s)||n&&n.defaultChecked||t?rR(a,e,t?s:r7(l._f)):S(e,s),o.mount&&!o.action&&m()}},b=(e,t,s,a,o)=>
68{let l=!1,u=!1,c={name:e};if(!r.disabled){if(!s||a){(d.isDirty||h.isDirty)&&(u=n.isDirty,n.isDirty=c.isDirty=x(),l=u!==c.isDirty);let r=rW(rS(i,e),t);u=!!rS(n.dirtyFields,e),r?rQ(n.dirtyFields,e):rR(n.dirtyFields,e,!0),c.dirtyFields=n.dirtyFields,l=l||(d.dirtyFields||h.dirtyFields)&&!r!==u}if(s){let t=rS(n.touchedFields,e);t||(rR(n.touchedFields,e,s),c.touchedFields=n.touchedFields,l=l||(d.touchedFields||h.touchedFields)&&t!==s)}l&&o&&f.state.next(c)}return l?c:{}},v=async e=>(g(e,!0),await r.resolver(a,r.context,((e,t,r,n)=>{let s={};for(let r of e){let e=rS(t,r);e&&rR(s,r,e._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}})(e||l.mount,s,r.criteriaMode,r.shouldUseNativeValidation))),w=async e=>{let{errors:t}=await v(e);if(g(e),e)for(let r of e){let e=rS(t,r);e?rR(n.errors,r,e):rQ(n.errors,r)}else n.errors=t;return t},_=async({name:t,eventType:r})=>{if(e.validate){let s=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(rg(s))for(let e in s)s[e]&&N(`${rD}.${e}`,{message:rz(s.message)?s.message:"",type:r$});else rz(s)||!s?N(rD,{message:s||"",type:r$}):I(rD);return s}return!0},k=async({fields:t,onlyCheckValid:s,name:i,eventType:o,context:u={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(u.runRootValidation=!0,!await _({name:i,eventType:o}))&&(u.valid=!1,s))return u.valid;for(let i in t){let c=t[i];if(c){let{_f:t,...h}=c;if(t){let i=l.array.has(t.name),o=c._f&&nn(c._f);o&&d.validatingFields&&g([t.name],!0);let h=await nc(c,l.disabled,a,p,r.shouldUseNativeValidation&&!s,i);if(o&&d.validatingFields&&g([t.name]),h[t.name]&&(u.valid=!1,s)||(s||(rS(h,t.name)?i?no(n.errors,h,t.name):rR(n.errors,t.name,h[t.name]):rQ(n.errors,t.name)),e.shouldUseNativeValidation&&h[t.name]))break}rX(h)||await k({context:u,onlyCheckValid:s,fields:h,name:i,eventType:o})}}return u.valid},x=(e,t)=>!r.disabled&&(e&&t&&rR(a,e,t),!rW(j(),i)),E=(e,t,r)=>rq(e,l,{...o.mount?a:rk(t)?i:rz(e)?{[e]:t}:t},r,t),S=(e,t,r={})=>{let n=rS(s,e),i=t;if(n){let r=n._f;r&&(r.disabled||rR(a,e,r8(t,r)),i=rY(r.ref)&&rm(t)?"":t,"select-multiple"===r.ref.type?[...r.ref.options].forEach(e=>e.selected=i.includes(e.value)):r.refs?"checkbox"===r.ref.type?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(i)?e.checked=!!i.find(t=>t===e.value):e.checked=i===e.value||!!i)}):r.refs.forEach(e=>e.checked=e.value===i):"file"===r.ref.type?r.ref.value="":(r.ref.value=i,r.ref.type||f.state.next({name:e,values:r_(a)})))}(r.shouldDirty||r.shouldTouch)&&b(e,i,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&C(e)},T=(e,t,r)=>{for(let n in t){if(!t.hasOwnProperty(n))return;let i=t[n],a=e+"."+n,o=rS(s,a);(l.array.has(e)||rg(i)||o&&!o._f)&&!rp(i)?T(a,i,r):S(a,i,r)}},R=(e,t,r={})=>{let u=rS(s,e),c=l.array.has(e),p=r_(t);rR(a,e,p),c?(f.array.next({name:e,values:r_(a)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&r.shouldDirty&&f.state.next({name:e,dirtyFields:r2(i,a),isDirty:x(e,p)})):!u||u._f||rm(p)?S(e,p,r):T(e,p,r),ns(e,l)?f.state.next({...n,name:e,values:r_(a)}):f.state.next({name:o.mount?e:void 0,values:r_(a)})},A=async i=>{o.mount=!0;let c=i.target,y=c.name,w=!0,x=rS(s,y),E=e=>{w=Number.isNaN(e)||rp(e)&&isNaN(e.getTime())||rW(e,rS(a,y,e))},S=nt(r.mode),T=nt(r.reValidateMode);if(x){var R,A,O,j,P;let o,$,D,U=c.type?r7(x._f):ry(i),B=i.type===rA||"focusout"===i.type,M=!((D=x._f).mount&&(D.required||D.min||D.max||D.maxLength||D.minLength||D.pattern||D.validate))&&!e.validate&&!r.resolver&&!rS(n.errors,y)&&!x._f.deps||(R=B,A=rS(n.touchedFields,y),O=n.isSubmitted,j=T,!(P=S).isOnAll&&(!O&&P.isOnTouch?!(A||R):(O?j.isOnBlur:P.isOnBlur)?!R:(O?!j.isOnChange:!P.isOnChange)||R)),F=ns(y,l,B);rR(a,y,U),B?c&&c.readOnly||(x._f.onBlur&&x._f.onBlur(i),t&&t(0)):x._f.onChange&&x._f.onChange(i);let z=b(y,U,B),q=!rX(z)||F;if(B||f.state.next({name:y,type:i.type,values:r_(a)}),M)return(d.isValid||h.isValid)&&("onBlur"===r.mode?B&&m():B||m()),q&&f.state.next({name:y,...F?{}:z});if(!r.resolver&&e.validate&&await _({name:y,eventType:i.type}),!B&&F&&f.state.next({...n}),r.resolver){let{errors:e}=await v([y]);if(g([y]),E(U),w){let t=na(n.errors,s,y),r=na(e,s,t.name||y);o=r.error,y=r.name,$=rX(e)}}else g([y],!0),o=(await nc(x,l.disabled,a,p,r.shouldUseNativeValidation))[y],g([y]),E(U),w&&(o?$=!1:(d.isValid||h.isValid)&&($=await k({fields:s,onlyCheckValid:!0,name:y,eventType:i.type})));if(w){x._f.deps&&(!Array.isArray(x._f.deps)||x._f.deps.length>0)&&C(x._f.deps);var I=y,N=$,L=o;let e=rS(n.errors,I),s=(d.isValid||h.isValid)&&"boolean"==typeof N&&n.isValid!==N;if(r.delayError&&L){let e;e=()=>{rR(n.errors,I,L),f.state.next({errors:n.errors})},(t=t=>{clearTimeout(u),u=setTimeout(e,t)})(r.delayError)}else clearTimeout(u),t=null,L?rR(n.errors,I,L):rQ(n.errors,I);if((L?!rW(e,L):e)||!rX(z)||s){let e={...z,...s&&"boolean"==typeof N?{isValid:N}:{},errors:n.errors,name:I};n={...n,...e},f.state.next(e)}}}},O=(e,t)=>{if(rS(n.errors,t)&&e.focus)return e.focus(),1},C=async(e,t={})=>{let i,a,o=rJ(e);if(r.resolver){let t=await w(rk(e)?e:o);
68i=rX(t),a=e?!o.some(e=>rS(t,e)):i}else e?((a=(await Promise.all(o.map(async e=>{let t=rS(s,e);return await k({fields:t&&t._f?{[e]:t}:t,eventType:rO})}))).every(Boolean))||n.isValid)&&m():a=i=await k({fields:s,name:e,eventType:rO});return f.state.next({...!rz(e)||(d.isValid||h.isValid)&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!a&&ni(s,O,e?o:l.mount),a},j=(e,t)=>{let r={...o.mount?a:i};return t&&(r=function e(t,r){let n={};for(let s in t)if(t.hasOwnProperty(s)){let i=t[s],a=r[s];if(i&&rg(i)&&a){let t=e(i,a);rg(t)&&(n[s]=t)}else t[s]&&(n[s]=a)}return n}(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),rk(e)?r:rz(e)?rS(r,e):e.map(e=>rS(r,e))},P=(e,t)=>({invalid:!!rS((t||n).errors,e),isDirty:!!rS((t||n).dirtyFields,e),error:rS((t||n).errors,e),isValidating:!!rS(n.validatingFields,e),isTouched:!!rS((t||n).touchedFields,e)}),I=e=>{let t=e?rJ(e):void 0;null==t||t.forEach(e=>rQ(n.errors,e)),t?t.forEach(e=>{f.state.next({name:e,errors:n.errors})}):f.state.next({errors:{}})},N=(e,t,r)=>{let i=(rS(s,e,{_f:{}})._f||{}).ref,{ref:a,message:o,type:l,...u}=rS(n.errors,e)||{};rR(n.errors,e,{...u,...t,ref:i}),f.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},L=e=>f.state.subscribe({next:t=>{let r,s,o;r=e.name,s=t.name,o=e.exact,(!r||!s||r===s||rJ(r).some(e=>e&&(o?e===s:e.startsWith(s)||s.startsWith(e))))&&((e,t,r,n)=>{r(e);let{name:s,...i}=e;return rX(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>t[e]===(!n||"all"))})(t,e.formState||d,q,e.reRenderRoot)&&e.callback({values:{...a},...n,...t,defaultValues:i})}}).unsubscribe,$=(e,t={})=>{for(let o of e?rJ(e):l.mount)l.mount.delete(o),l.array.delete(o),t.keepValue||(rQ(s,o),rQ(a,o)),t.keepError||rQ(n.errors,o),t.keepDirty||rQ(n.dirtyFields,o),t.keepTouched||rQ(n.touchedFields,o),t.keepIsValidating||rQ(n.validatingFields,o),r.shouldUnregister||t.keepDefaultValue||rQ(i,o);f.state.next({values:r_(a)}),f.state.next({...n,...!t.keepDirty?{}:{isDirty:x()}}),t.keepIsValid||m()},D=({disabled:e,name:t})=>{if("boolean"==typeof e&&o.mount||e||l.disabled.has(t)){let r=l.disabled.has(t);e?l.disabled.add(t):l.disabled.delete(t),!!e!==r&&o.mount&&!o.action&&m()}},U=(e,t={})=>{let n=rS(s,e),a="boolean"==typeof t.disabled||"boolean"==typeof r.disabled;return(rR(s,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n)?D({disabled:"boolean"==typeof t.disabled?t.disabled:r.disabled,name:e}):y(e,!0,t.value),{...a?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:ne(t.min),max:ne(t.max),minLength:ne(t.minLength),maxLength:ne(t.maxLength),pattern:ne(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:a=>{if(a){let r;U(e,t),n=rS(s,e);let o=rk(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,l="radio"===(r=o).type||"checkbox"===r.type,u=n._f.refs||[];(l?u.find(e=>e===o):o===n._f.ref)||(rR(s,e,{_f:{...n._f,...l?{refs:[...u.filter(rZ),o,...Array.isArray(rS(i,e))?[{}]:[]],ref:{type:o.type,name:e}}:{ref:o}}}),y(e,!1,void 0,o))}else(n=rS(s,e,{}))._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&!(rv(l.array,e)&&o.action)&&l.unMount.add(e)}}},B=()=>r.shouldFocusError&&ni(s,O,l.mount),M=(e,t)=>async i=>{let o;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let u=r_(a);if(f.state.next({isSubmitting:!0}),r.resolver){let{errors:e,values:t}=await v();g(),n.errors=e,u=r_(t)}else await k({fields:s,eventType:"submit"});if(l.disabled.size)for(let e of l.disabled)rQ(u,e);if(rQ(n.errors,rU),rX(n.errors)){f.state.next({errors:{}});try{await e(u,i)}catch(e){o=e}}else t&&await t({...n.errors},i),B(),setTimeout(B);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rX(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},F=(e,t={})=>{let u=e?r_(e):i,c=r_(u),h=rX(e),p=h?i:c;if(t.keepDefaultValues||(i=u),!t.keepValues){if(t.keepDirtyValues)for(let e of Array.from(new Set([...l.mount,...Object.keys(r2(i,a))]))){let t=rS(n.dirtyFields,e),r=rS(a,e),s=rS(p,e);t&&!rk(r)?rR(p,e,r):t||rk(s)||R(e,s)}else{if(rw&&rk(e))for(let e of l.mount){let t=rS(s,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(rY(e)){let t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(let e of l.mount)R(e,rS(p,e));else s={}}a=r.shouldUnregister?t.keepDefaultValues?r_(i):{}:r_(p),f.array.next({values:{...p}}),f.state.next({values:{...p}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!rX(p),o.watch=!!r.shouldUnregister,o.keepIsValid=!!t.keepIsValid,o.action=!1,t.keepErrors||(n.errors={}),f.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!!(t.keepDefaultValues&&!rW(e,i))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&a?r2(i,a):n.dirtyFields:t.keepDefaultValues&&e?r2(i,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:i})},z=(e,t)=>F(rT(e)?e(a):e,{...r.resetOptions,...t}),q=e=>{n={...n,...e}},V={control:{register:U,unregister:$,getFieldState:P,handleSubmit:M,setError:N,_subscribe:L,_runSchema:v,_updateIsValidating:g,_focusError:B,_getWatch:E,_getDirty:x,_setValid:m,_setFieldArray:(e,t=[],l,u,c=!0,p=!0)=>
68{if(u&&l&&!r.disabled){if(o.action=!0,p&&Array.isArray(rS(s,e))){let t=l(rS(s,e),u.argA,u.argB);c&&rR(s,e,t)}if(p&&Array.isArray(rS(n.errors,e))){let t,r=l(rS(n.errors,e),u.argA,u.argB);c&&rR(n.errors,e,r),rx(rS(t=n.errors,e)).length||rQ(t,e)}if((d.touchedFields||h.touchedFields)&&p&&Array.isArray(rS(n.touchedFields,e))){let t=l(rS(n.touchedFields,e),u.argA,u.argB);c&&rR(n.touchedFields,e,t)}if(d.dirtyFields||h.dirtyFields){let t=r2(i,a),r=rb(e);rR(n.dirtyFields,r,rS(t,r))}f.state.next({name:e,isDirty:x(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else rR(a,e,t)},_setDisabledField:D,_setErrors:e=>{n.errors=e,f.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>rx(rS(o.mount?a:i,e,r.shouldUnregister?rS(i,e,[]):[])),_reset:F,_resetDefaultValues:()=>rT(r.defaultValues)&&r.defaultValues().then(e=>{z(e,r.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(let e of l.unMount){let t=rS(s,e);t&&(t._f.refs?t._f.refs.every(e=>!rZ(e)):!rZ(t._f.ref))&&$(e)}l.unMount=new Set},_disableForm:e=>{"boolean"==typeof e&&(f.state.next({disabled:e}),ni(s,(t,r)=>{let n=rS(s,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:d,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(value){o=value},get _defaultValues(){return i},get _names(){return l},set _names(value){l=value},get _formState(){return n},get _options(){return r},set _options(value){r={...r,...value}}},subscribe:e=>(o.mount=!0,h={...h,...e.formState},L({...e,formState:{...c,...e.formState}})),trigger:C,register:U,handleSubmit:M,watch:(e,t)=>rT(e)?f.state.subscribe({next:r=>"values"in r&&e(E(void 0,t),r)}):E(e,t,!0),setValue:R,getValues:j,reset:z,resetField:(e,t={})=>{rS(s,e)&&(rk(t.defaultValue)?R(e,r_(rS(i,e))):(R(e,t.defaultValue),rR(i,e,r_(t.defaultValue))),t.keepTouched||rQ(n.touchedFields,e),t.keepDirty||(rQ(n.dirtyFields,e),n.isDirty=t.defaultValue?x(e,r_(rS(i,e))):x()),!t.keepError&&(rQ(n.errors,e),d.isValid&&m()),f.state.next({...n}))},clearErrors:I,unregister:$,setError:N,setFocus:(e,t={})=>{let r=rS(s,e),n=r&&r._f;if(n){let e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&rT(e.select)&&e.select()})}},getFieldState:P};return{...V,formControl:V}}(e);t.current={...s,formState:n}}let i=t.current.control;return i._options=e,rF(()=>{let e=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),U.default.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),U.default.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),U.default.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),U.default.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),U.default.useEffect(()=>{if(i._proxyFormState.isDirty){let e=i._getDirty();e!==n.isDirty&&i._subjects.state.next({isDirty:e})}},[i,n.isDirty]),U.default.useEffect(()=>{var t;e.values&&!rW(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null==(t=i._options.resetOptions)?void 0:t.keepIsValid)||i._setValid(),r.current=e.values,s(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),U.default.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=U.default.useMemo(()=>rM(n,i),[i,n]),t.current}(),u=F("Submit-form"),c=function(e,t){let r=dx();if(r&&n)return n;if(!e||!t)throw Error(`@supabase/ssr: Your project's URL and API key are required to create a Supabase client! 69 70Check your Supabase project's API settings to find these values 71 72https://supabase.com/dashboard/project/_/settings/api`);let{storage:s}=function(e,t){let r,n,s=e.cookies??null,i=e.cookieEncoding,a={},o={};if(s)if("get"in s){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,r)=>`${e}.${r}`)]),r=[];for(let e=0;e<t.length;e+=1){let n=await s.get(t[e]);(n||"string"==typeof n)&&r.push({name:t[e],value:n})}return r};if(r=async t=>await e(t),"set"in s&&"remove"in s)n=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:n,options:i}=e[t];n?await s.set(r,n,i):await s.remove(r,i)}};else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for c
72orrectness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)")}else if("getAll"in s)if(r=async()=>await s.getAll(),"setAll"in s)n=s.setAll;else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)");else throw Error(`@supabase/ssr: ${t?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).${dx()?" As this is called in a browser runtime, consider removing the cookies option object to use the document.cookie API automatically.":""}`);else if(!t&&dx())r=()=>{let e;return Object.keys(e=(0,dk.parse)(document.cookie)).map(t=>({name:t,value:e[t]??""}))},n=e=>{e.forEach(({name:e,value:t,options:r})=>{document.cookie=(0,dk.serialize)(e,t,r)})};else if(t)throw Error("@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)");else r=()=>[],n=()=>{throw Error("@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed")};return t?{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!0,getItem:async e=>{if("string"==typeof a[e])return a[e];if(o[e])return null;let t=await r([e]),n=await dA(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});if(!n)return null;let s=n;return"string"==typeof n&&n.startsWith(dO)&&(s=d_(n.substring(dO.length))),s},setItem:async(t,s)=>{t.endsWith("-code-verifier")&&await dC({getAll:r,setAll:n,setItems:{[t]:s},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:i}),a[t]=s,delete o[t]},removeItem:async e=>{delete a[e],o[e]=!0}}}:{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!1,getItem:async e=>{let t=await r([e]),n=await dA(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});if(!n)return null;let s=n;return n.startsWith(dO)&&(s=d_(n.substring(dO.length))),s},setItem:async(t,s)=>{let a=await r([t]),o=new Set((a?.map(({name:e})=>e)||[]).filter(e=>dT(e,t))),l=s;"base64url"===i&&(l=dO+dw(s));let u=dR(t,l);u.forEach(({name:e})=>{o.delete(e)});let c={...dE,...e?.cookieOptions,maxAge:0},d={...dE,...e?.cookieOptions,maxAge:dE.maxAge};delete c.name,delete d.name;let h=[...[...o].map(e=>({name:e,value:"",options:c})),...u.map(({name:e,value:t})=>({name:e,value:t,options:d}))];h.length>0&&await n(h)},removeItem:async t=>{let s=await r([t]),i=(s?.map(({name:e})=>e)||[]).filter(e=>dT(e,t)),a={...dE,...e?.cookieOptions,maxAge:0};delete a.name,i.length>0&&await n(i.map(e=>({name:e,value:"",options:a})))}}}}({...void 0,cookieEncoding:(void 0)??"base64url"},!1),i=new dg(e,t,{...void 0,global:{...void 0,headers:{...void 0,"X-Client-Info":"supabase-ssr/0.9.0 createBrowserClient"}},auth:{...void 0,...null,flowType:"pkce",autoRefreshToken:dx(),detectSessionInUrl:dx(),persistSession:!0,storage:s,...null}});return r&&(n=i),i}("https://uigcebznftfsumkxjhyh.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpZ2NlYnpuZnRmc3Vta3hqaHloIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzY0OTg4NjMsImV4cCI6MjA1MjA3NDg2M30.9UDfBj_txVJmg2DwDsi8S7A4M2lCI9yGTMcq_gE9COY"),{executeRecaptcha:d}=(0,rf.useGoogleReCaptcha)(),h=async r=>{if(!d||!await ll(d))return;let n={...r,round_id:e?.id,competition_id:t?.id};await lu(c,n)&&(nP.success(u("submit-success-message")),o())};return(0,D.jsxs)("form",{onSubmit:i(h),className:"flex flex-col min-w-[300px] w-full md:w-4/5",children:[(0,D.jsx)(rH,{control:a,name:"topic",rules:{required:!0},render:({field:e})=>(0,D.jsx)(lc,{topics:r,value:e.value,onValueChange:e.onChange})}),l.topic&&(0,D.jsx)(dP,{message:"This field is required"}),(0,D.jsx)("textarea",{rows:6,placeholder:u("placeholder"),className:"w-full px-4 text-base lg:text-xl placeholder:text-sm py-2 mt-4 transition-all duration-300 ease-in-out border border-black hover:border-primary focus:border-primary outline-none rounded-lg",...s("question",{required:!0})}),l.question&&(0,D.jsx)(dP,{message:"This field is required"}),(0,D.jsx)("div",{className:"text-center",children:(0,D.jsx)("input",{type:"submit",className:"w-2/4 md:w-1/4 mt-6 text-md md:text-xl px-4 py-3 hover:bg-primary text-white bg-black align-middle transition-all duration-150 ease-in-out rounded-lg",value:u("submit-button")})}),(0,D.jsx)(nM,{})]})},dP=({message:e})=>(0,D.jsx)("p",{className:"text-red-500 text-xs md:text-md italic mt-2",children:e}),dI=({round:e,competition:t,topics:r})=>{let n=F("Submit-form");return(0,D.jsxs)("div",{className:"flex flex-col items-center px-6 py-8",children:[(0,D.jsxs)("div",{className:"flex items-center gap-3 mb-8",children:[(0,D.jsx)("h2",{className:"text-xl",children:n("description")}),(0,D.jsx)(rh,{})]}),(0,D.jsx)(dj,{round:e,competition:t,topics:r})]})},dN=({round:e,competition:t,setView:r,topics:n})=>{let s=(0,B.useLocale)(),i=t?.url??"https://tietoa.fi",a="fi"===s?t?.name_fi:t?.name_en;return(0,D.jsxs)("main",{className:"flex-1",children:[(0,D.jsx)(V,{date:e.closed_at??"",handleSetVie
72w:()=>{r("deadline")},className:"px-6 py-4 bg-primary text-white flex-wrap justify-center gap-2 md:gap-4",showDeadlineText:!0}),(0,D.jsxs)("div",{className:"max-w-5xl m-auto px-3 py-4 md:px-6 md:py-8",children:[(0,D.jsx)("div",{className:"mb-8",children:(0,D.jsx)(K,{href:i})}),(0,D.jsx)("h1",{className:"uppercase mb-4 text-2xl md:text-3xl font-bold text-center",children:a}),(0,D.jsx)(dI,{round:e,competition:t,topics:n})]})]})};e.s(["ViewController",0,({initialViewState:e,round:t,competition:r,topics:n})=>{let[s,i]=U.default.useState(e),a=U.default.useCallback(e=>{i(e)},[]);switch(s){case"opening":return(0,D.jsx)(W,{round:t,competition:r,setView:a});case"deadline":return(0,D.jsx)(H,{});case"main":return(0,D.jsx)(dN,{round:t,competition:r,setView:a,topics:n});default:return(0,D.jsx)("div",{children:"Invalid view state"})}}],81162)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.