@golocalinteractive/golocal-cloud-wrapper 1.0.63 → 1.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(L,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],F):(L=typeof globalThis<"u"?globalThis:L||self,F(L.GoLocalCloudWrapper={},L.React,L.ReactDOM))})(this,function(L,F,jt){"use strict";var wS=Object.defineProperty;var vS=(L,F,jt)=>F in L?wS(L,F,{enumerable:!0,configurable:!0,writable:!0,value:jt}):L[F]=jt;var Le=(L,F,jt)=>vS(L,typeof F!="symbol"?F+"":F,jt);var fo,np,ho,rp;function Di(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const S=Di(F),Mi=Di(jt);var rr={exports:{}},Rn={};/**
1
+ (function(L,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],W):(L=typeof globalThis<"u"?globalThis:L||self,W(L.GoLocalCloudWrapper={},L.React,L.ReactDOM))})(this,function(L,W,jt){"use strict";var E2=Object.defineProperty;var _2=(L,W,jt)=>W in L?E2(L,W,{enumerable:!0,configurable:!0,writable:!0,value:jt}):L[W]=jt;var Le=(L,W,jt)=>_2(L,typeof W!="symbol"?W+"":W,jt);var fo,op,ho,sp;function Di(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const S=Di(W),Mi=Di(jt);var rr={exports:{}},Rn={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Li;function sp(){if(Li)return Rn;Li=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var i in o)i!=="key"&&(s[i]=o[i])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return Rn.Fragment=t,Rn.jsx=n,Rn.jsxs=n,Rn}var Cn={};/**
9
+ */var Li;function ip(){if(Li)return Rn;Li=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var i in o)i!=="key"&&(s[i]=o[i])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return Rn.Fragment=t,Rn.jsx=n,Rn.jsxs=n,Rn}var Cn={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,42 +14,42 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ji;function ap(){return ji||(ji=1,process.env.NODE_ENV!=="production"&&function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===D?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case y:return"Fragment";case p:return"Profiler";case g:return"StrictMode";case E:return"Suspense";case R:return"SuspenseList";case C:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case _:return"Portal";case f:return(T.displayName||"Context")+".Provider";case b:return(T._context.displayName||"Context")+".Consumer";case A:var H=T.render;return T=T.displayName,T||(T=H.displayName||H.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case v:return H=T.displayName||null,H!==null?H:e(T.type)||"Memo";case x:H=T._payload,T=T._init;try{return e(T(H))}catch{}}return null}function t(T){return""+T}function n(T){try{t(T);var H=!1}catch{H=!0}if(H){H=console;var J=H.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return J.call(H,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(T)}}function r(T){if(T===y)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===x)return"<...>";try{var H=e(T);return H?"<"+H+">":"<...>"}catch{return"<...>"}}function o(){var T=I.A;return T===null?null:T.getOwner()}function s(){return Error("react-stack-top-frame")}function a(T){if(P.call(T,"key")){var H=Object.getOwnPropertyDescriptor(T,"key").get;if(H&&H.isReactWarning)return!1}return T.key!==void 0}function i(T,H){function J(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",H))}J.isReactWarning=!0,Object.defineProperty(T,"key",{get:J,configurable:!0})}function c(){var T=e(this.type);return V[T]||(V[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function u(T,H,J,X,se,fe,we,te){return J=fe.ref,T={$$typeof:m,type:T,key:H,props:fe,_owner:se},(J!==void 0?J:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:c}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:we}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function l(T,H,J,X,se,fe,we,te){var le=H.children;if(le!==void 0)if(X)if(U(le)){for(X=0;X<le.length;X++)d(le[X]);Object.freeze&&Object.freeze(le)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(le);if(P.call(H,"key")){le=e(T);var ue=Object.keys(H).filter(function(k){return k!=="key"});X=0<ue.length?"{key: someKey, "+ue.join(": ..., ")+": ...}":"{key: someKey}",j[le+X]||(ue=0<ue.length?"{"+ue.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ji;function cp(){return ji||(ji=1,process.env.NODE_ENV!=="production"&&function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===D?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case y:return"Fragment";case p:return"Profiler";case g:return"StrictMode";case E:return"Suspense";case R:return"SuspenseList";case C:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case _:return"Portal";case f:return(T.displayName||"Context")+".Provider";case b:return(T._context.displayName||"Context")+".Consumer";case A:var H=T.render;return T=T.displayName,T||(T=H.displayName||H.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case v:return H=T.displayName||null,H!==null?H:e(T.type)||"Memo";case x:H=T._payload,T=T._init;try{return e(T(H))}catch{}}return null}function t(T){return""+T}function n(T){try{t(T);var H=!1}catch{H=!0}if(H){H=console;var J=H.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return J.call(H,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(T)}}function r(T){if(T===y)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===x)return"<...>";try{var H=e(T);return H?"<"+H+">":"<...>"}catch{return"<...>"}}function o(){var T=I.A;return T===null?null:T.getOwner()}function s(){return Error("react-stack-top-frame")}function a(T){if(P.call(T,"key")){var H=Object.getOwnPropertyDescriptor(T,"key").get;if(H&&H.isReactWarning)return!1}return T.key!==void 0}function i(T,H){function J(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",H))}J.isReactWarning=!0,Object.defineProperty(T,"key",{get:J,configurable:!0})}function c(){var T=e(this.type);return V[T]||(V[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function u(T,H,J,X,se,fe,we,te){return J=fe.ref,T={$$typeof:m,type:T,key:H,props:fe,_owner:se},(J!==void 0?J:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:c}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:we}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function l(T,H,J,X,se,fe,we,te){var le=H.children;if(le!==void 0)if(X)if(U(le)){for(X=0;X<le.length;X++)d(le[X]);Object.freeze&&Object.freeze(le)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(le);if(P.call(H,"key")){le=e(T);var ue=Object.keys(H).filter(function(k){return k!=="key"});X=0<ue.length?"{key: someKey, "+ue.join(": ..., ")+": ...}":"{key: someKey}",j[le+X]||(ue=0<ue.length?"{"+ue.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,X,le,ue,le),j[le+X]=!0)}if(le=null,J!==void 0&&(n(J),le=""+J),a(H)&&(n(H.key),le=""+H.key),"key"in H){J={};for(var ye in H)ye!=="key"&&(J[ye]=H[ye])}else J=H;return le&&i(J,typeof T=="function"?T.displayName||T.name||"Unknown":T),u(T,le,fe,se,o(),J,we,te)}function d(T){typeof T=="object"&&T!==null&&T.$$typeof===m&&T._store&&(T._store.validated=1)}var h=F,m=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),f=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),I=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,U=Array.isArray,G=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(T){return T()}};var oe,V={},Y=h["react-stack-bottom-frame"].bind(h,s)(),O=G(r(s)),j={};Cn.Fragment=y,Cn.jsx=function(T,H,J,X,se){var fe=1e4>I.recentlyCreatedOwnerStacks++;return l(T,H,J,!1,X,se,fe?Error("react-stack-top-frame"):Y,fe?G(r(T)):O)},Cn.jsxs=function(T,H,J,X,se){var fe=1e4>I.recentlyCreatedOwnerStacks++;return l(T,H,J,!0,X,se,fe?Error("react-stack-top-frame"):Y,fe?G(r(T)):O)}}()),Cn}var Hi;function ip(){return Hi||(Hi=1,process.env.NODE_ENV==="production"?rr.exports=sp():rr.exports=ap()),rr.exports}var w=ip();function Ui(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function or(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ui(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ui(e[o],null)}}}}function Te(...e){return S.useCallback(or(...e),e)}function Qt(e){const t=cp(e),n=S.forwardRef((r,o)=>{const{children:s,...a}=r,i=S.Children.toArray(s),c=i.find(lp);if(c){const u=c.props.children,l=i.map(d=>d===c?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...a,ref:o,children:S.isValidElement(u)?S.cloneElement(u,void 0,l):null})}return w.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var en=Qt("Slot");function cp(e){const t=S.forwardRef((n,r)=>{const{children:o,...s}=n;if(S.isValidElement(o)){const a=fp(o),i=dp(s,o.props);return o.type!==S.Fragment&&(i.ref=r?or(r,a):a),S.cloneElement(o,i)}return S.Children.count(o)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $i=Symbol("radix.slottable");function up(e){const t=({children:n})=>w.jsx(w.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$i,t}function lp(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$i}function dp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function fp(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=hp.reduce((e,t)=>{const n=Qt(`Primitive.${t}`),r=S.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wi(e,t){e&&Mi.flushSync(()=>e.dispatchEvent(t))}var pp="Separator",Fi="horizontal",mp=["horizontal","vertical"],Ki=S.forwardRef((e,t)=>{const{decorative:n,orientation:r=Fi,...o}=e,s=gp(r)?r:Fi,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return w.jsx(xe.div,{"data-orientation":s,...i,...o,ref:t})});Ki.displayName=pp;function gp(e){return mp.includes(e)}var qi=Ki;function zi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=zi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gi(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=zi(e))&&(r&&(r+=" "),r+=t);return r}const mo="-",bp=e=>{const t=wp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const i=a.split(mo);return i[0]===""&&i.length!==1&&i.shift(),Bi(i,t)||yp(a)},getConflictingClassGroupIds:(a,i)=>{const c=n[a]||[];return i&&r[a]?[...c,...r[a]]:c}}},Bi=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Bi(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(mo);return(a=t.validators.find(({validator:i})=>i(s)))==null?void 0:a.classGroupId},Vi=/^\[(.+)\]$/,yp=e=>{if(Vi.test(e)){const t=Vi.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},wp=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)go(n[o],r,o,t);return r},go=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ji(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(vp(o)){go(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,a])=>{go(a,Ji(t,s),n,r)})})},Ji=(e,t)=>{let n=e;return t.split(mo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vp=e=>e.isThemeGetter,Ep=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return o(s,a),a},set(s,a){n.has(s)?n.set(s,a):o(s,a)}}},bo="!",yo=":",_p=yo.length,Sp=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,c=0,u;for(let _=0;_<o.length;_++){let y=o[_];if(a===0&&i===0){if(y===yo){s.push(o.slice(c,_)),c=_+_p;continue}if(y==="/"){u=_;continue}}y==="["?a++:y==="]"?a--:y==="("?i++:y===")"&&i--}const l=s.length===0?o:o.substring(c),d=xp(l),h=d!==l,m=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:m}};if(t){const o=t+yo,s=r;r=a=>a.startsWith(o)?s(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},xp=e=>e.endsWith(bo)?e.substring(0,e.length-1):e.startsWith(bo)?e.substring(1):e,Ap=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(a=>{a[0]==="["||t[a]?(o.push(...s.sort(),a),s=[]):s.push(a)}),o.push(...s.sort()),o}},Rp=e=>({cache:Ep(e.cacheSize),parseClassName:Sp(e),sortModifiers:Ap(e),...bp(e)}),Cp=/\s+/,Tp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(Cp);let c="";for(let u=i.length-1;u>=0;u-=1){const l=i[u],{isExternal:d,modifiers:h,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:y}=n(l);if(d){c=l+(c.length>0?" "+c:c);continue}let g=!!y,p=r(g?_.substring(0,y):_);if(!p){if(!g){c=l+(c.length>0?" "+c:c);continue}if(p=r(_),!p){c=l+(c.length>0?" "+c:c);continue}g=!1}const b=s(h).join(":"),f=m?b+bo:b,A=f+p;if(a.includes(A))continue;a.push(A);const E=o(p,g);for(let R=0;R<E.length;++R){const v=E[R];a.push(f+v)}c=l+(c.length>0?" "+c:c)}return c};function Pp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xi(t))&&(r&&(r+=" "),r+=n);return r}const Xi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xi(e[r]))&&(n&&(n+=" "),n+=t);return n};function Op(e,...t){let n,r,o,s=a;function a(c){const u=t.reduce((l,d)=>d(l),e());return n=Rp(u),r=n.cache.get,o=n.cache.set,s=i,i(c)}function i(c){const u=r(c);if(u)return u;const l=Tp(c,n);return o(c,l),l}return function(){return s(Pp.apply(null,arguments))}}const Pe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Yi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kp=/^\d+\/\d+$/,Np=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ip=/\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$/,Dp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mp=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=e=>kp.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),St=e=>!!e&&Number.isInteger(Number(e)),wo=e=>e.endsWith("%")&&ae(e.slice(0,-1)),pt=e=>Np.test(e),jp=()=>!0,Hp=e=>Ip.test(e)&&!Dp.test(e),Qi=()=>!1,Up=e=>Mp.test(e),$p=e=>Lp.test(e),Wp=e=>!K(e)&&!q(e),Fp=e=>nn(e,oc,Qi),K=e=>Yi.test(e),Ht=e=>nn(e,sc,Hp),vo=e=>nn(e,Bp,ae),ec=e=>nn(e,nc,Qi),Kp=e=>nn(e,rc,$p),sr=e=>nn(e,ac,Up),q=e=>Zi.test(e),Tn=e=>rn(e,sc),qp=e=>rn(e,Vp),tc=e=>rn(e,nc),zp=e=>rn(e,oc),Gp=e=>rn(e,rc),ar=e=>rn(e,ac,!0),nn=(e,t,n)=>{const r=Yi.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rn=(e,t,n=!1)=>{const r=Zi.exec(e);return r?r[1]?t(r[1]):n:!1},nc=e=>e==="position"||e==="percentage",rc=e=>e==="image"||e==="url",oc=e=>e==="length"||e==="size"||e==="bg-size",sc=e=>e==="length",Bp=e=>e==="number",Vp=e=>e==="family-name",ac=e=>e==="shadow",Jp=Op(()=>{const e=Pe("color"),t=Pe("font"),n=Pe("text"),r=Pe("font-weight"),o=Pe("tracking"),s=Pe("leading"),a=Pe("breakpoint"),i=Pe("container"),c=Pe("spacing"),u=Pe("radius"),l=Pe("shadow"),d=Pe("inset-shadow"),h=Pe("text-shadow"),m=Pe("drop-shadow"),_=Pe("blur"),y=Pe("perspective"),g=Pe("aspect"),p=Pe("ease"),b=Pe("animate"),f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...A(),q,K],R=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],x=()=>[q,K,c],C=()=>[tn,"full","auto",...x()],D=()=>[St,"none","subgrid",q,K],I=()=>["auto",{span:["full",St,q,K]},St,q,K],P=()=>[St,"auto",q,K],U=()=>["auto","min","max","fr",q,K],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],oe=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...x()],Y=()=>[tn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],O=()=>[e,q,K],j=()=>[...A(),tc,ec,{position:[q,K]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",zp,Fp,{size:[q,K]}],J=()=>[wo,Tn,Ht],X=()=>["","none","full",u,q,K],se=()=>["",ae,Tn,Ht],fe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[ae,wo,tc,ec],le=()=>["","none",_,q,K],ue=()=>["none",ae,q,K],ye=()=>["none",ae,q,K],k=()=>[ae,q,K],N=()=>[tn,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pt],breakpoint:[pt],color:[jp],container:[pt],"drop-shadow":[pt],ease:["in","out","in-out"],font:[Wp],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pt],shadow:[pt],spacing:["px",ae],text:[pt],"text-shadow":[pt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",tn,K,q,g]}],container:["container"],columns:[{columns:[ae,K,q,i]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"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:E()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[St,"auto",q,K]}],basis:[{basis:[tn,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,tn,"auto","initial","none",K]}],grow:[{grow:["",ae,q,K]}],shrink:[{shrink:["",ae,q,K]}],order:[{order:[St,"first","last","none",q,K]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...oe()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...oe(),"baseline"]}],"place-self":[{"place-self":["auto",...oe()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[i,"screen",...Y()]}],"min-w":[{"min-w":[i,"screen","none",...Y()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Tn,Ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,q,vo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wo,K]}],"font-family":[{font:[qp,K,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,q,K]}],"line-clamp":[{"line-clamp":[ae,"none",q,vo]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",q,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",q,Ht]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[ae,"auto",q,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,K]}],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",q,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},St,q,K],radial:["",q,K],conic:[St,q,K]},Gp,Kp]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,q,K]}],"outline-w":[{outline:["",ae,Tn,Ht]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",l,ar,sr]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,ar,sr]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[ae,Ht]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",h,ar,sr]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[ae,q,K]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[q,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,K]}],filter:[{filter:["","none",q,K]}],blur:[{blur:le()}],brightness:[{brightness:[ae,q,K]}],contrast:[{contrast:[ae,q,K]}],"drop-shadow":[{"drop-shadow":["","none",m,ar,sr]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",ae,q,K]}],"hue-rotate":[{"hue-rotate":[ae,q,K]}],invert:[{invert:["",ae,q,K]}],saturate:[{saturate:[ae,q,K]}],sepia:[{sepia:["",ae,q,K]}],"backdrop-filter":[{"backdrop-filter":["","none",q,K]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ae,q,K]}],"backdrop-contrast":[{"backdrop-contrast":[ae,q,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,q,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,q,K]}],"backdrop-invert":[{"backdrop-invert":["",ae,q,K]}],"backdrop-opacity":[{"backdrop-opacity":[ae,q,K]}],"backdrop-saturate":[{"backdrop-saturate":[ae,q,K]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,q,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",q,K]}],ease:[{ease:["linear","initial",p,q,K]}],delay:[{delay:[ae,q,K]}],animate:[{animate:["none",b,q,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,q,K]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:k()}],"skew-x":[{"skew-x":k()}],"skew-y":[{"skew-y":k()}],transform:[{transform:[q,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",q,K]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",q,K]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[ae,Tn,Ht,vo]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function W(...e){return Jp(Gi(e))}const ir=S.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>w.jsx(qi,{ref:o,decorative:n,orientation:t,className:W("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ir.displayName=qi.displayName;const ic=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cc=Gi,Eo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return cc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(u=>{const l=n==null?void 0:n[u],d=s==null?void 0:s[u];if(l===null)return null;const h=ic(l)||ic(d);return o[u][h]}),i=n&&Object.entries(n).reduce((u,l)=>{let[d,h]=l;return h===void 0||(u[d]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:d,className:h,...m}=l;return Object.entries(m).every(_=>{let[y,g]=_;return Array.isArray(g)?g.includes({...s,...i}[y]):{...s,...i}[y]===g})?[...u,d,h]:u},[]);return cc(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
22
+ <%s key={someKey} {...props} />`,X,le,ue,le),j[le+X]=!0)}if(le=null,J!==void 0&&(n(J),le=""+J),a(H)&&(n(H.key),le=""+H.key),"key"in H){J={};for(var ye in H)ye!=="key"&&(J[ye]=H[ye])}else J=H;return le&&i(J,typeof T=="function"?T.displayName||T.name||"Unknown":T),u(T,le,fe,se,o(),J,we,te)}function d(T){typeof T=="object"&&T!==null&&T.$$typeof===m&&T._store&&(T._store.validated=1)}var h=W,m=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),f=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),I=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,U=Array.isArray,G=console.createTask?console.createTask:function(){return null};h={"react-stack-bottom-frame":function(T){return T()}};var oe,V={},Y=h["react-stack-bottom-frame"].bind(h,s)(),O=G(r(s)),j={};Cn.Fragment=y,Cn.jsx=function(T,H,J,X,se){var fe=1e4>I.recentlyCreatedOwnerStacks++;return l(T,H,J,!1,X,se,fe?Error("react-stack-top-frame"):Y,fe?G(r(T)):O)},Cn.jsxs=function(T,H,J,X,se){var fe=1e4>I.recentlyCreatedOwnerStacks++;return l(T,H,J,!0,X,se,fe?Error("react-stack-top-frame"):Y,fe?G(r(T)):O)}}()),Cn}var Hi;function up(){return Hi||(Hi=1,process.env.NODE_ENV==="production"?rr.exports=ip():rr.exports=cp()),rr.exports}var w=up();function Ui(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function or(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ui(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ui(e[o],null)}}}}function Te(...e){return S.useCallback(or(...e),e)}function Qt(e){const t=lp(e),n=S.forwardRef((r,o)=>{const{children:s,...a}=r,i=S.Children.toArray(s),c=i.find(fp);if(c){const u=c.props.children,l=i.map(d=>d===c?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...a,ref:o,children:S.isValidElement(u)?S.cloneElement(u,void 0,l):null})}return w.jsx(t,{...a,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var en=Qt("Slot");function lp(e){const t=S.forwardRef((n,r)=>{const{children:o,...s}=n;if(S.isValidElement(o)){const a=pp(o),i=hp(s,o.props);return o.type!==S.Fragment&&(i.ref=r?or(r,a):a),S.cloneElement(o,i)}return S.Children.count(o)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $i=Symbol("radix.slottable");function dp(e){const t=({children:n})=>w.jsx(w.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$i,t}function fp(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$i}function hp(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...i)=>{const c=s(...i);return o(...i),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function pp(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=mp.reduce((e,t)=>{const n=Qt(`Primitive.${t}`),r=S.forwardRef((o,s)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wi(e,t){e&&Mi.flushSync(()=>e.dispatchEvent(t))}var gp="Separator",Fi="horizontal",bp=["horizontal","vertical"],Ki=S.forwardRef((e,t)=>{const{decorative:n,orientation:r=Fi,...o}=e,s=yp(r)?r:Fi,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return w.jsx(xe.div,{"data-orientation":s,...i,...o,ref:t})});Ki.displayName=gp;function yp(e){return bp.includes(e)}var qi=Ki;function zi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=zi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gi(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=zi(e))&&(r&&(r+=" "),r+=t);return r}const mo="-",wp=e=>{const t=Ep(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const i=a.split(mo);return i[0]===""&&i.length!==1&&i.shift(),Bi(i,t)||vp(a)},getConflictingClassGroupIds:(a,i)=>{const c=n[a]||[];return i&&r[a]?[...c,...r[a]]:c}}},Bi=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Bi(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(mo);return(a=t.validators.find(({validator:i})=>i(s)))==null?void 0:a.classGroupId},Vi=/^\[(.+)\]$/,vp=e=>{if(Vi.test(e)){const t=Vi.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ep=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)go(n[o],r,o,t);return r},go=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Ji(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(_p(o)){go(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,a])=>{go(a,Ji(t,s),n,r)})})},Ji=(e,t)=>{let n=e;return t.split(mo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},_p=e=>e.isThemeGetter,Sp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return o(s,a),a},set(s,a){n.has(s)?n.set(s,a):o(s,a)}}},bo="!",yo=":",xp=yo.length,Ap=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,i=0,c=0,u;for(let _=0;_<o.length;_++){let y=o[_];if(a===0&&i===0){if(y===yo){s.push(o.slice(c,_)),c=_+xp;continue}if(y==="/"){u=_;continue}}y==="["?a++:y==="]"?a--:y==="("?i++:y===")"&&i--}const l=s.length===0?o:o.substring(c),d=Rp(l),h=d!==l,m=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:m}};if(t){const o=t+yo,s=r;r=a=>a.startsWith(o)?s(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Rp=e=>e.endsWith(bo)?e.substring(0,e.length-1):e.startsWith(bo)?e.substring(1):e,Cp=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(a=>{a[0]==="["||t[a]?(o.push(...s.sort(),a),s=[]):s.push(a)}),o.push(...s.sort()),o}},Tp=e=>({cache:Sp(e.cacheSize),parseClassName:Ap(e),sortModifiers:Cp(e),...wp(e)}),Pp=/\s+/,Op=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],i=e.trim().split(Pp);let c="";for(let u=i.length-1;u>=0;u-=1){const l=i[u],{isExternal:d,modifiers:h,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:y}=n(l);if(d){c=l+(c.length>0?" "+c:c);continue}let g=!!y,p=r(g?_.substring(0,y):_);if(!p){if(!g){c=l+(c.length>0?" "+c:c);continue}if(p=r(_),!p){c=l+(c.length>0?" "+c:c);continue}g=!1}const b=s(h).join(":"),f=m?b+bo:b,A=f+p;if(a.includes(A))continue;a.push(A);const E=o(p,g);for(let R=0;R<E.length;++R){const v=E[R];a.push(f+v)}c=l+(c.length>0?" "+c:c)}return c};function kp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xi(t))&&(r&&(r+=" "),r+=n);return r}const Xi=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xi(e[r]))&&(n&&(n+=" "),n+=t);return n};function Np(e,...t){let n,r,o,s=a;function a(c){const u=t.reduce((l,d)=>d(l),e());return n=Tp(u),r=n.cache.get,o=n.cache.set,s=i,i(c)}function i(c){const u=r(c);if(u)return u;const l=Op(c,n);return o(c,l),l}return function(){return s(kp.apply(null,arguments))}}const Pe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Yi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ip=/^\d+\/\d+$/,Dp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mp=/\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$/,Lp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jp=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=e=>Ip.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),St=e=>!!e&&Number.isInteger(Number(e)),wo=e=>e.endsWith("%")&&ae(e.slice(0,-1)),pt=e=>Dp.test(e),Up=()=>!0,$p=e=>Mp.test(e)&&!Lp.test(e),Qi=()=>!1,Wp=e=>jp.test(e),Fp=e=>Hp.test(e),Kp=e=>!K(e)&&!q(e),qp=e=>nn(e,oc,Qi),K=e=>Yi.test(e),Ht=e=>nn(e,sc,$p),vo=e=>nn(e,Jp,ae),ec=e=>nn(e,nc,Qi),zp=e=>nn(e,rc,Fp),sr=e=>nn(e,ac,Wp),q=e=>Zi.test(e),Tn=e=>rn(e,sc),Gp=e=>rn(e,Xp),tc=e=>rn(e,nc),Bp=e=>rn(e,oc),Vp=e=>rn(e,rc),ar=e=>rn(e,ac,!0),nn=(e,t,n)=>{const r=Yi.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rn=(e,t,n=!1)=>{const r=Zi.exec(e);return r?r[1]?t(r[1]):n:!1},nc=e=>e==="position"||e==="percentage",rc=e=>e==="image"||e==="url",oc=e=>e==="length"||e==="size"||e==="bg-size",sc=e=>e==="length",Jp=e=>e==="number",Xp=e=>e==="family-name",ac=e=>e==="shadow",Yp=Np(()=>{const e=Pe("color"),t=Pe("font"),n=Pe("text"),r=Pe("font-weight"),o=Pe("tracking"),s=Pe("leading"),a=Pe("breakpoint"),i=Pe("container"),c=Pe("spacing"),u=Pe("radius"),l=Pe("shadow"),d=Pe("inset-shadow"),h=Pe("text-shadow"),m=Pe("drop-shadow"),_=Pe("blur"),y=Pe("perspective"),g=Pe("aspect"),p=Pe("ease"),b=Pe("animate"),f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...A(),q,K],R=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],x=()=>[q,K,c],C=()=>[tn,"full","auto",...x()],D=()=>[St,"none","subgrid",q,K],I=()=>["auto",{span:["full",St,q,K]},St,q,K],P=()=>[St,"auto",q,K],U=()=>["auto","min","max","fr",q,K],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],oe=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...x()],Y=()=>[tn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],O=()=>[e,q,K],j=()=>[...A(),tc,ec,{position:[q,K]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",Bp,qp,{size:[q,K]}],J=()=>[wo,Tn,Ht],X=()=>["","none","full",u,q,K],se=()=>["",ae,Tn,Ht],fe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[ae,wo,tc,ec],le=()=>["","none",_,q,K],ue=()=>["none",ae,q,K],ye=()=>["none",ae,q,K],k=()=>[ae,q,K],N=()=>[tn,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pt],breakpoint:[pt],color:[Up],container:[pt],"drop-shadow":[pt],ease:["in","out","in-out"],font:[Kp],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pt],shadow:[pt],spacing:["px",ae],text:[pt],"text-shadow":[pt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",tn,K,q,g]}],container:["container"],columns:[{columns:[ae,K,q,i]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"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:E()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[St,"auto",q,K]}],basis:[{basis:[tn,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,tn,"auto","initial","none",K]}],grow:[{grow:["",ae,q,K]}],shrink:[{shrink:["",ae,q,K]}],order:[{order:[St,"first","last","none",q,K]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...oe()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...oe(),"baseline"]}],"place-self":[{"place-self":["auto",...oe()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[i,"screen",...Y()]}],"min-w":[{"min-w":[i,"screen","none",...Y()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Tn,Ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,q,vo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wo,K]}],"font-family":[{font:[Gp,K,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,q,K]}],"line-clamp":[{"line-clamp":[ae,"none",q,vo]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",q,K]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,K]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",q,Ht]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[ae,"auto",q,K]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,K]}],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",q,K]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},St,q,K],radial:["",q,K],conic:[St,q,K]},Vp,zp]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,q,K]}],"outline-w":[{outline:["",ae,Tn,Ht]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",l,ar,sr]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,ar,sr]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[ae,Ht]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",h,ar,sr]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[ae,q,K]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[q,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,K]}],filter:[{filter:["","none",q,K]}],blur:[{blur:le()}],brightness:[{brightness:[ae,q,K]}],contrast:[{contrast:[ae,q,K]}],"drop-shadow":[{"drop-shadow":["","none",m,ar,sr]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",ae,q,K]}],"hue-rotate":[{"hue-rotate":[ae,q,K]}],invert:[{invert:["",ae,q,K]}],saturate:[{saturate:[ae,q,K]}],sepia:[{sepia:["",ae,q,K]}],"backdrop-filter":[{"backdrop-filter":["","none",q,K]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[ae,q,K]}],"backdrop-contrast":[{"backdrop-contrast":[ae,q,K]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,q,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,q,K]}],"backdrop-invert":[{"backdrop-invert":["",ae,q,K]}],"backdrop-opacity":[{"backdrop-opacity":[ae,q,K]}],"backdrop-saturate":[{"backdrop-saturate":[ae,q,K]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,q,K]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,K]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",q,K]}],ease:[{ease:["linear","initial",p,q,K]}],delay:[{delay:[ae,q,K]}],animate:[{animate:["none",b,q,K]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,q,K]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:k()}],"skew-x":[{"skew-x":k()}],"skew-y":[{"skew-y":k()}],transform:[{transform:[q,K,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",q,K]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",q,K]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[ae,Tn,Ht,vo]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function F(...e){return Yp(Gi(e))}const ir=S.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>w.jsx(qi,{ref:o,decorative:n,orientation:t,className:F("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ir.displayName=qi.displayName;const ic=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cc=Gi,Eo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return cc(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(u=>{const l=n==null?void 0:n[u],d=s==null?void 0:s[u];if(l===null)return null;const h=ic(l)||ic(d);return o[u][h]}),i=n&&Object.entries(n).reduce((u,l)=>{let[d,h]=l;return h===void 0||(u[d]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,l)=>{let{class:d,className:h,...m}=l;return Object.entries(m).every(_=>{let[y,g]=_;return Array.isArray(g)?g.includes({...s,...i}[y]):{...s,...i}[y]===g})?[...u,d,h]:u},[]);return cc(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
23
23
  * @license lucide-react v0.522.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */const Xp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),uc=e=>{const t=Yp(e);return t.charAt(0).toUpperCase()+t.slice(1)},lc=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Zp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
27
+ */const Zp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),uc=e=>{const t=Qp(e);return t.charAt(0).toUpperCase()+t.slice(1)},lc=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),em=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
28
28
  * @license lucide-react v0.522.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */var Qp={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"};/**
32
+ */var tm={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"};/**
33
33
  * @license lucide-react v0.522.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
- */const em=F.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},c)=>F.createElement("svg",{ref:c,...Qp,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lc("lucide",o),...!s&&!Zp(i)&&{"aria-hidden":"true"},...i},[...a.map(([u,l])=>F.createElement(u,l)),...Array.isArray(s)?s:[s]]));/**
37
+ */const nm=W.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...i},c)=>W.createElement("svg",{ref:c,...tm,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lc("lucide",o),...!s&&!em(i)&&{"aria-hidden":"true"},...i},[...a.map(([u,l])=>W.createElement(u,l)),...Array.isArray(s)?s:[s]]));/**
38
38
  * @license lucide-react v0.522.0 - ISC
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const je=(e,t)=>{const n=F.forwardRef(({className:r,...o},s)=>F.createElement(em,{ref:s,iconNode:t,className:lc(`lucide-${Xp(uc(e))}`,`lucide-${e}`,r),...o}));return n.displayName=uc(e),n};/**
42
+ */const je=(e,t)=>{const n=W.forwardRef(({className:r,...o},s)=>W.createElement(nm,{ref:s,iconNode:t,className:lc(`lucide-${Zp(uc(e))}`,`lucide-${e}`,r),...o}));return n.displayName=uc(e),n};/**
43
43
  * @license lucide-react v0.522.0 - ISC
44
44
  *
45
45
  * This source code is licensed under the ISC license.
46
46
  * See the LICENSE file in the root directory of this source tree.
47
- */const tm=je("book-open-text",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
47
+ */const rm=je("book-open-text",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
48
48
  * @license lucide-react v0.522.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const nm=je("calendar-sync",[["path",{d:"M11 10v4h4",key:"172dkj"}],["path",{d:"m11 14 1.535-1.605a5 5 0 0 1 8 1.5",key:"vu0qm5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"m21 18-1.535 1.605a5 5 0 0 1-8-1.5",key:"1qgeyt"}],["path",{d:"M21 22v-4h-4",key:"hrummi"}],["path",{d:"M21 8.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h4.3",key:"mctw84"}],["path",{d:"M3 10h4",key:"1el30a"}],["path",{d:"M8 2v4",key:"1cmpym"}]]);/**
52
+ */const om=je("calendar-sync",[["path",{d:"M11 10v4h4",key:"172dkj"}],["path",{d:"m11 14 1.535-1.605a5 5 0 0 1 8 1.5",key:"vu0qm5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"m21 18-1.535 1.605a5 5 0 0 1-8-1.5",key:"1qgeyt"}],["path",{d:"M21 22v-4h-4",key:"hrummi"}],["path",{d:"M21 8.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h4.3",key:"mctw84"}],["path",{d:"M3 10h4",key:"1el30a"}],["path",{d:"M8 2v4",key:"1cmpym"}]]);/**
53
53
  * @license lucide-react v0.522.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
@@ -59,7 +59,7 @@ React keys must be passed directly to JSX without using spread:
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const rm=je("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
62
+ */const sm=je("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
63
63
  * @license lucide-react v0.522.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
@@ -69,17 +69,17 @@ React keys must be passed directly to JSX without using spread:
69
69
  *
70
70
  * This source code is licensed under the ISC license.
71
71
  * See the LICENSE file in the root directory of this source tree.
72
- */const om=je("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
72
+ */const am=je("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
73
73
  * @license lucide-react v0.522.0 - ISC
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const sm=je("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
77
+ */const im=je("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
78
78
  * @license lucide-react v0.522.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
81
81
  * See the LICENSE file in the root directory of this source tree.
82
- */const am=je("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
82
+ */const cm=je("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
83
83
  * @license lucide-react v0.522.0 - ISC
84
84
  *
85
85
  * This source code is licensed under the ISC license.
@@ -89,12 +89,12 @@ React keys must be passed directly to JSX without using spread:
89
89
  *
90
90
  * This source code is licensed under the ISC license.
91
91
  * See the LICENSE file in the root directory of this source tree.
92
- */const im=je("circle-dollar-sign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/**
92
+ */const um=je("circle-dollar-sign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/**
93
93
  * @license lucide-react v0.522.0 - ISC
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
- */const cm=je("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
97
+ */const lm=je("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
98
98
  * @license lucide-react v0.522.0 - ISC
99
99
  *
100
100
  * This source code is licensed under the ISC license.
@@ -104,12 +104,12 @@ React keys must be passed directly to JSX without using spread:
104
104
  *
105
105
  * This source code is licensed under the ISC license.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
- */const um=je("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);/**
107
+ */const dm=je("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);/**
108
108
  * @license lucide-react v0.522.0 - ISC
109
109
  *
110
110
  * This source code is licensed under the ISC license.
111
111
  * See the LICENSE file in the root directory of this source tree.
112
- */const lm=je("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
112
+ */const fm=je("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
113
113
  * @license lucide-react v0.522.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
@@ -119,8 +119,8 @@ React keys must be passed directly to JSX without using spread:
119
119
  *
120
120
  * This source code is licensed under the ISC license.
121
121
  * See the LICENSE file in the root directory of this source tree.
122
- */const dm=je("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function mc(){const[e,t]=F.useState(!1);return F.useEffect(()=>{const n=()=>{t(window.innerWidth<768)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const gc=Eo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ur=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const a=r?en:"button";return w.jsx(a,{className:W(gc({variant:t,size:n,className:e})),ref:s,...o})});ur.displayName="Button";const _o=S.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:W("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));_o.displayName="Input";function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function fm(e,t){const n=S.createContext(t),r=s=>{const{children:a,...i}=s,c=S.useMemo(()=>i,Object.values(i));return w.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function o(s){const a=S.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ut(e,t=[]){let n=[];function r(s,a){const i=S.createContext(a),c=n.length;n=[...n,a];const u=d=>{var p;const{scope:h,children:m,..._}=d,y=((p=h==null?void 0:h[e])==null?void 0:p[c])||i,g=S.useMemo(()=>_,Object.values(_));return w.jsx(y.Provider,{value:g,children:m})};u.displayName=s+"Provider";function l(d,h){var y;const m=((y=h==null?void 0:h[e])==null?void 0:y[c])||i,_=S.useContext(m);if(_)return _;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,l]}const o=()=>{const s=n.map(a=>S.createContext(a));return function(i){const c=(i==null?void 0:i[e])||s;return S.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,hm(o,...t)]}function hm(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...i,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var xt=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},pm=S[" useId ".trim().toString()]||(()=>{}),mm=0;function mt(e){const[t,n]=S.useState(pm());return xt(()=>{n(r=>r??String(mm++))},[e]),e||(t?`radix-${t}`:"")}var gm=S[" useInsertionEffect ".trim().toString()]||xt;function Pn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=bm({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o;{const l=S.useRef(e!==void 0);S.useEffect(()=>{const d=l.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. 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.`),l.current=i},[i,r])}const u=S.useCallback(l=>{var d;if(i){const h=ym(l)?l(e):l;h!==e&&((d=a.current)==null||d.call(a,h))}else s(l)},[i,e,s,a]);return[c,u]}function bm({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),o=S.useRef(n),s=S.useRef(t);return gm(()=>{s.current=t},[t]),S.useEffect(()=>{var a;o.current!==n&&((a=s.current)==null||a.call(s,n),o.current=n)},[n,o]),[n,r,s]}function ym(e){return typeof e=="function"}function ot(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function wm(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var vm="DismissableLayer",So="dismissableLayer.update",Em="dismissableLayer.pointerDownOutside",_m="dismissableLayer.focusOutside",bc,yc=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lr=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,u=S.useContext(yc),[l,d]=S.useState(null),h=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),_=Te(t,v=>d(v)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(g),b=l?y.indexOf(l):-1,f=u.layersWithOutsidePointerEventsDisabled.size>0,A=b>=p,E=Am(v=>{const x=v.target,C=[...u.branches].some(D=>D.contains(x));!A||C||(o==null||o(v),a==null||a(v),v.defaultPrevented||i==null||i())},h),R=Rm(v=>{const x=v.target;[...u.branches].some(D=>D.contains(x))||(s==null||s(v),a==null||a(v),v.defaultPrevented||i==null||i())},h);return wm(v=>{b===u.layers.size-1&&(r==null||r(v),!v.defaultPrevented&&i&&(v.preventDefault(),i()))},h),S.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),wc(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=bc)}},[l,h,n,u]),S.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),wc())},[l,u]),S.useEffect(()=>{const v=()=>m({});return document.addEventListener(So,v),()=>document.removeEventListener(So,v)},[]),w.jsx(xe.div,{...c,ref:_,style:{pointerEvents:f?A?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,E.onPointerDownCapture)})});lr.displayName=vm;var Sm="DismissableLayerBranch",xm=S.forwardRef((e,t)=>{const n=S.useContext(yc),r=S.useRef(null),o=Te(t,r);return S.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w.jsx(xe.div,{...e,ref:o})});xm.displayName=Sm;function Am(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let c=function(){vc(Em,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Rm(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=S.useRef(!1);return S.useEffect(()=>{const o=s=>{s.target&&!r.current&&vc(_m,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wc(){const e=new CustomEvent(So);document.dispatchEvent(e)}function vc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Wi(o,s):o.dispatchEvent(s)}var xo="focusScope.autoFocusOnMount",Ao="focusScope.autoFocusOnUnmount",Ec={bubbles:!1,cancelable:!0},Cm="FocusScope",Ro=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,c]=S.useState(null),u=ot(o),l=ot(s),d=S.useRef(null),h=Te(t,y=>c(y)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let y=function(f){if(m.paused||!i)return;const A=f.target;i.contains(A)?d.current=A:At(d.current,{select:!0})},g=function(f){if(m.paused||!i)return;const A=f.relatedTarget;A!==null&&(i.contains(A)||At(d.current,{select:!0}))},p=function(f){if(document.activeElement===document.body)for(const E of f)E.removedNodes.length>0&&At(i)};document.addEventListener("focusin",y),document.addEventListener("focusout",g);const b=new MutationObserver(p);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",g),b.disconnect()}}},[r,i,m.paused]),S.useEffect(()=>{if(i){xc.add(m);const y=document.activeElement;if(!i.contains(y)){const p=new CustomEvent(xo,Ec);i.addEventListener(xo,u),i.dispatchEvent(p),p.defaultPrevented||(Tm(Im(_c(i)),{select:!0}),document.activeElement===y&&At(i))}return()=>{i.removeEventListener(xo,u),setTimeout(()=>{const p=new CustomEvent(Ao,Ec);i.addEventListener(Ao,l),i.dispatchEvent(p),p.defaultPrevented||At(y??document.body,{select:!0}),i.removeEventListener(Ao,l),xc.remove(m)},0)}}},[i,u,l,m]);const _=S.useCallback(y=>{if(!n&&!r||m.paused)return;const g=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(g&&p){const b=y.currentTarget,[f,A]=Pm(b);f&&A?!y.shiftKey&&p===A?(y.preventDefault(),n&&At(f,{select:!0})):y.shiftKey&&p===f&&(y.preventDefault(),n&&At(A,{select:!0})):p===b&&y.preventDefault()}},[n,r,m.paused]);return w.jsx(xe.div,{tabIndex:-1,...a,ref:h,onKeyDown:_})});Ro.displayName=Cm;function Tm(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(At(r,{select:t}),document.activeElement!==n)return}function Pm(e){const t=_c(e),n=Sc(t,e),r=Sc(t.reverse(),e);return[n,r]}function _c(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sc(e,t){for(const n of e)if(!Om(n,{upTo:t}))return n}function Om(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function km(e){return e instanceof HTMLInputElement&&"select"in e}function At(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&km(e)&&t&&e.select()}}var xc=Nm();function Nm(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ac(e,t),e.unshift(t)},remove(t){var n;e=Ac(e,t),(n=e[0])==null||n.resume()}}}function Ac(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Im(e){return e.filter(t=>t.tagName!=="A")}var Dm="Portal",Co=S.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,s]=S.useState(!1);xt(()=>s(!0),[]);const a=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?jt.createPortal(w.jsx(xe.div,{...r,ref:t}),a):null});Co.displayName=Dm;function Mm(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var gt=e=>{const{present:t,children:n}=e,r=Lm(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),s=Te(r.ref,jm(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:s}):null};gt.displayName="Presence";function Lm(e){const[t,n]=S.useState(),r=S.useRef(null),o=S.useRef(e),s=S.useRef("none"),a=e?"mounted":"unmounted",[i,c]=Mm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=dr(r.current);s.current=i==="mounted"?u:"none"},[i]),xt(()=>{const u=r.current,l=o.current;if(l!==e){const h=s.current,m=dr(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(l&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),xt(()=>{if(t){let u;const l=t.ownerDocument.defaultView??window,d=m=>{const y=dr(r.current).includes(m.animationName);if(m.target===t&&y&&(c("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(s.current=dr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{l.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:S.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function dr(e){return(e==null?void 0:e.animationName)||"none"}function jm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var To=0;function Rc(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cc()),document.body.insertAdjacentElement("beforeend",e[1]??Cc()),To++,()=>{To===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),To--}},[])}function Cc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var st=function(){return st=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},st.apply(this,arguments)};function Tc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Hm(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var fr="right-scroll-bar-position",hr="width-before-scroll-bar",Um="with-scroll-bars-hidden",$m="--removed-body-scroll-bar-size";function Po(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Wm(e,t){var n=F.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Fm=typeof window<"u"?S.useLayoutEffect:S.useEffect,Pc=new WeakMap;function Km(e,t){var n=Wm(null,function(r){return e.forEach(function(o){return Po(o,r)})});return Fm(function(){var r=Pc.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||Po(i,null)}),s.forEach(function(i){o.has(i)||Po(i,a)})}Pc.set(n,e)},[e]),n}function qm(e){return e}function zm(e,t){t===void 0&&(t=qm);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var c=function(){var l=a;a=[],l.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(l){a.push(l),u()},filter:function(l){return a=a.filter(l),n}}}};return o}function Gm(e){e===void 0&&(e={});var t=zm(null);return t.options=st({async:!0,ssr:!1},e),t}var Oc=function(e){var t=e.sideCar,n=Tc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,st({},n))};Oc.isSideCarExport=!0;function Bm(e,t){return e.useMedium(t),Oc}var kc=Gm(),Oo=function(){},pr=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Oo,onWheelCapture:Oo,onTouchMoveCapture:Oo}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,l=e.enabled,d=e.shards,h=e.sideCar,m=e.noRelative,_=e.noIsolation,y=e.inert,g=e.allowPinchZoom,p=e.as,b=p===void 0?"div":p,f=e.gapMode,A=Tc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,R=Km([n,t]),v=st(st({},A),o);return S.createElement(S.Fragment,null,l&&S.createElement(E,{sideCar:kc,removeScrollBar:u,shards:d,noRelative:m,noIsolation:_,inert:y,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:f}),a?S.cloneElement(S.Children.only(i),st(st({},v),{ref:R})):S.createElement(b,st({},v,{className:c,ref:R}),i))});pr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pr.classNames={fullWidth:hr,zeroRight:fr};var Vm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Vm();return t&&e.setAttribute("nonce",t),e}function Xm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ym(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Zm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jm())&&(Xm(t,n),Ym(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Qm=function(){var e=Zm();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nc=function(){var e=Qm(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},eg={left:0,top:0,right:0,gap:0},ko=function(e){return parseInt(e||"",10)||0},tg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ko(n),ko(r),ko(o)]},ng=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eg;var t=tg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rg=Nc(),on="data-scroll-locked",og=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
123
- .`.concat(Um,` {
122
+ */const hm=je("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function mc(){const[e,t]=W.useState(!1);return W.useEffect(()=>{const n=()=>{t(window.innerWidth<768)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const gc=Eo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ur=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const a=r?en:"button";return w.jsx(a,{className:F(gc({variant:t,size:n,className:e})),ref:s,...o})});ur.displayName="Button";const _o=S.forwardRef(({className:e,type:t,...n},r)=>w.jsx("input",{type:t,className:F("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));_o.displayName="Input";function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function pm(e,t){const n=S.createContext(t),r=s=>{const{children:a,...i}=s,c=S.useMemo(()=>i,Object.values(i));return w.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function o(s){const a=S.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ut(e,t=[]){let n=[];function r(s,a){const i=S.createContext(a),c=n.length;n=[...n,a];const u=d=>{var p;const{scope:h,children:m,..._}=d,y=((p=h==null?void 0:h[e])==null?void 0:p[c])||i,g=S.useMemo(()=>_,Object.values(_));return w.jsx(y.Provider,{value:g,children:m})};u.displayName=s+"Provider";function l(d,h){var y;const m=((y=h==null?void 0:h[e])==null?void 0:y[c])||i,_=S.useContext(m);if(_)return _;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,l]}const o=()=>{const s=n.map(a=>S.createContext(a));return function(i){const c=(i==null?void 0:i[e])||s;return S.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return o.scopeName=e,[r,mm(o,...t)]}function mm(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((i,{useScope:c,scopeName:u})=>{const d=c(s)[`__scope${u}`];return{...i,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var xt=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},gm=S[" useId ".trim().toString()]||(()=>{}),bm=0;function mt(e){const[t,n]=S.useState(gm());return xt(()=>{n(r=>r??String(bm++))},[e]),e||(t?`radix-${t}`:"")}var ym=S[" useInsertionEffect ".trim().toString()]||xt;function Pn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=wm({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o;{const l=S.useRef(e!==void 0);S.useEffect(()=>{const d=l.current;d!==i&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. 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.`),l.current=i},[i,r])}const u=S.useCallback(l=>{var d;if(i){const h=vm(l)?l(e):l;h!==e&&((d=a.current)==null||d.call(a,h))}else s(l)},[i,e,s,a]);return[c,u]}function wm({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),o=S.useRef(n),s=S.useRef(t);return ym(()=>{s.current=t},[t]),S.useEffect(()=>{var a;o.current!==n&&((a=s.current)==null||a.call(s,n),o.current=n)},[n,o]),[n,r,s]}function vm(e){return typeof e=="function"}function ot(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Em(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var _m="DismissableLayer",So="dismissableLayer.update",Sm="dismissableLayer.pointerDownOutside",xm="dismissableLayer.focusOutside",bc,yc=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lr=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...c}=e,u=S.useContext(yc),[l,d]=S.useState(null),h=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),_=Te(t,v=>d(v)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(g),b=l?y.indexOf(l):-1,f=u.layersWithOutsidePointerEventsDisabled.size>0,A=b>=p,E=Cm(v=>{const x=v.target,C=[...u.branches].some(D=>D.contains(x));!A||C||(o==null||o(v),a==null||a(v),v.defaultPrevented||i==null||i())},h),R=Tm(v=>{const x=v.target;[...u.branches].some(D=>D.contains(x))||(s==null||s(v),a==null||a(v),v.defaultPrevented||i==null||i())},h);return Em(v=>{b===u.layers.size-1&&(r==null||r(v),!v.defaultPrevented&&i&&(v.preventDefault(),i()))},h),S.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),wc(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=bc)}},[l,h,n,u]),S.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),wc())},[l,u]),S.useEffect(()=>{const v=()=>m({});return document.addEventListener(So,v),()=>document.removeEventListener(So,v)},[]),w.jsx(xe.div,{...c,ref:_,style:{pointerEvents:f?A?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,E.onPointerDownCapture)})});lr.displayName=_m;var Am="DismissableLayerBranch",Rm=S.forwardRef((e,t)=>{const n=S.useContext(yc),r=S.useRef(null),o=Te(t,r);return S.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w.jsx(xe.div,{...e,ref:o})});Rm.displayName=Am;function Cm(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let c=function(){vc(Sm,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Tm(e,t=globalThis==null?void 0:globalThis.document){const n=ot(e),r=S.useRef(!1);return S.useEffect(()=>{const o=s=>{s.target&&!r.current&&vc(xm,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wc(){const e=new CustomEvent(So);document.dispatchEvent(e)}function vc(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Wi(o,s):o.dispatchEvent(s)}var xo="focusScope.autoFocusOnMount",Ao="focusScope.autoFocusOnUnmount",Ec={bubbles:!1,cancelable:!0},Pm="FocusScope",Ro=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=e,[i,c]=S.useState(null),u=ot(o),l=ot(s),d=S.useRef(null),h=Te(t,y=>c(y)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let y=function(f){if(m.paused||!i)return;const A=f.target;i.contains(A)?d.current=A:At(d.current,{select:!0})},g=function(f){if(m.paused||!i)return;const A=f.relatedTarget;A!==null&&(i.contains(A)||At(d.current,{select:!0}))},p=function(f){if(document.activeElement===document.body)for(const E of f)E.removedNodes.length>0&&At(i)};document.addEventListener("focusin",y),document.addEventListener("focusout",g);const b=new MutationObserver(p);return i&&b.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",g),b.disconnect()}}},[r,i,m.paused]),S.useEffect(()=>{if(i){xc.add(m);const y=document.activeElement;if(!i.contains(y)){const p=new CustomEvent(xo,Ec);i.addEventListener(xo,u),i.dispatchEvent(p),p.defaultPrevented||(Om(Mm(_c(i)),{select:!0}),document.activeElement===y&&At(i))}return()=>{i.removeEventListener(xo,u),setTimeout(()=>{const p=new CustomEvent(Ao,Ec);i.addEventListener(Ao,l),i.dispatchEvent(p),p.defaultPrevented||At(y??document.body,{select:!0}),i.removeEventListener(Ao,l),xc.remove(m)},0)}}},[i,u,l,m]);const _=S.useCallback(y=>{if(!n&&!r||m.paused)return;const g=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(g&&p){const b=y.currentTarget,[f,A]=km(b);f&&A?!y.shiftKey&&p===A?(y.preventDefault(),n&&At(f,{select:!0})):y.shiftKey&&p===f&&(y.preventDefault(),n&&At(A,{select:!0})):p===b&&y.preventDefault()}},[n,r,m.paused]);return w.jsx(xe.div,{tabIndex:-1,...a,ref:h,onKeyDown:_})});Ro.displayName=Pm;function Om(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(At(r,{select:t}),document.activeElement!==n)return}function km(e){const t=_c(e),n=Sc(t,e),r=Sc(t.reverse(),e);return[n,r]}function _c(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sc(e,t){for(const n of e)if(!Nm(n,{upTo:t}))return n}function Nm(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Im(e){return e instanceof HTMLInputElement&&"select"in e}function At(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Im(e)&&t&&e.select()}}var xc=Dm();function Dm(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ac(e,t),e.unshift(t)},remove(t){var n;e=Ac(e,t),(n=e[0])==null||n.resume()}}}function Ac(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mm(e){return e.filter(t=>t.tagName!=="A")}var Lm="Portal",Co=S.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,s]=S.useState(!1);xt(()=>s(!0),[]);const a=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?jt.createPortal(w.jsx(xe.div,{...r,ref:t}),a):null});Co.displayName=Lm;function jm(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var gt=e=>{const{present:t,children:n}=e,r=Hm(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),s=Te(r.ref,Um(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:s}):null};gt.displayName="Presence";function Hm(e){const[t,n]=S.useState(),r=S.useRef(null),o=S.useRef(e),s=S.useRef("none"),a=e?"mounted":"unmounted",[i,c]=jm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=dr(r.current);s.current=i==="mounted"?u:"none"},[i]),xt(()=>{const u=r.current,l=o.current;if(l!==e){const h=s.current,m=dr(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(l&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),xt(()=>{if(t){let u;const l=t.ownerDocument.defaultView??window,d=m=>{const y=dr(r.current).includes(m.animationName);if(m.target===t&&y&&(c("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=m=>{m.target===t&&(s.current=dr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{l.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:S.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function dr(e){return(e==null?void 0:e.animationName)||"none"}function Um(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var To=0;function Rc(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Cc()),document.body.insertAdjacentElement("beforeend",e[1]??Cc()),To++,()=>{To===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),To--}},[])}function Cc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var st=function(){return st=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},st.apply(this,arguments)};function Tc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function $m(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var fr="right-scroll-bar-position",hr="width-before-scroll-bar",Wm="with-scroll-bars-hidden",Fm="--removed-body-scroll-bar-size";function Po(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Km(e,t){var n=W.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var qm=typeof window<"u"?S.useLayoutEffect:S.useEffect,Pc=new WeakMap;function zm(e,t){var n=Km(null,function(r){return e.forEach(function(o){return Po(o,r)})});return qm(function(){var r=Pc.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(i){s.has(i)||Po(i,null)}),s.forEach(function(i){o.has(i)||Po(i,a)})}Pc.set(n,e)},[e]),n}function Gm(e){return e}function Bm(e,t){t===void 0&&(t=Gm);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var c=function(){var l=a;a=[],l.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(l){a.push(l),u()},filter:function(l){return a=a.filter(l),n}}}};return o}function Vm(e){e===void 0&&(e={});var t=Bm(null);return t.options=st({async:!0,ssr:!1},e),t}var Oc=function(e){var t=e.sideCar,n=Tc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,st({},n))};Oc.isSideCarExport=!0;function Jm(e,t){return e.useMedium(t),Oc}var kc=Vm(),Oo=function(){},pr=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Oo,onWheelCapture:Oo,onTouchMoveCapture:Oo}),o=r[0],s=r[1],a=e.forwardProps,i=e.children,c=e.className,u=e.removeScrollBar,l=e.enabled,d=e.shards,h=e.sideCar,m=e.noRelative,_=e.noIsolation,y=e.inert,g=e.allowPinchZoom,p=e.as,b=p===void 0?"div":p,f=e.gapMode,A=Tc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,R=zm([n,t]),v=st(st({},A),o);return S.createElement(S.Fragment,null,l&&S.createElement(E,{sideCar:kc,removeScrollBar:u,shards:d,noRelative:m,noIsolation:_,inert:y,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:f}),a?S.cloneElement(S.Children.only(i),st(st({},v),{ref:R})):S.createElement(b,st({},v,{className:c,ref:R}),i))});pr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pr.classNames={fullWidth:hr,zeroRight:fr};var Xm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ym(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xm();return t&&e.setAttribute("nonce",t),e}function Zm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ym())&&(Zm(t,n),Qm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tg=function(){var e=eg();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nc=function(){var e=tg(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ng={left:0,top:0,right:0,gap:0},ko=function(e){return parseInt(e||"",10)||0},rg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ko(n),ko(r),ko(o)]},og=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ng;var t=rg(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},sg=Nc(),on="data-scroll-locked",ag=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
123
+ .`.concat(Wm,` {
124
124
  overflow: hidden `).concat(r,`;
125
125
  padding-right: `).concat(i,"px ").concat(r,`;
126
126
  }
@@ -154,16 +154,16 @@ React keys must be passed directly to JSX without using spread:
154
154
  }
155
155
 
156
156
  body[`).concat(on,`] {
157
- `).concat($m,": ").concat(i,`px;
157
+ `).concat(Fm,": ").concat(i,`px;
158
158
  }
159
- `)},Ic=function(){var e=parseInt(document.body.getAttribute(on)||"0",10);return isFinite(e)?e:0},sg=function(){S.useEffect(function(){return document.body.setAttribute(on,(Ic()+1).toString()),function(){var e=Ic()-1;e<=0?document.body.removeAttribute(on):document.body.setAttribute(on,e.toString())}},[])},ag=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;sg();var s=S.useMemo(function(){return ng(o)},[o]);return S.createElement(rg,{styles:og(s,!t,o,n?"":"!important")})},No=!1;if(typeof window<"u")try{var mr=Object.defineProperty({},"passive",{get:function(){return No=!0,!0}});window.addEventListener("test",mr,mr),window.removeEventListener("test",mr,mr)}catch{No=!1}var sn=No?{passive:!1}:!1,ig=function(e){return e.tagName==="TEXTAREA"},Dc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ig(e)&&n[t]==="visible")},cg=function(e){return Dc(e,"overflowY")},ug=function(e){return Dc(e,"overflowX")},Mc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Lc(e,r);if(o){var s=jc(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lg=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dg=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Lc=function(e,t){return e==="v"?cg(t):ug(t)},jc=function(e,t){return e==="v"?lg(t):dg(t)},fg=function(e,t){return e==="h"&&t==="rtl"?-1:1},hg=function(e,t,n,r,o){var s=fg(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,c=t.contains(i),u=!1,l=a>0,d=0,h=0;do{if(!i)break;var m=jc(e,i),_=m[0],y=m[1],g=m[2],p=y-g-s*_;(_||p)&&Lc(e,i)&&(d+=p,h+=_);var b=i.parentNode;i=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(l&&Math.abs(d)<1||!l&&Math.abs(h)<1)&&(u=!0),u},gr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hc=function(e){return[e.deltaX,e.deltaY]},Uc=function(e){return e&&"current"in e?e.current:e},pg=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mg=function(e){return`
159
+ `)},Ic=function(){var e=parseInt(document.body.getAttribute(on)||"0",10);return isFinite(e)?e:0},ig=function(){S.useEffect(function(){return document.body.setAttribute(on,(Ic()+1).toString()),function(){var e=Ic()-1;e<=0?document.body.removeAttribute(on):document.body.setAttribute(on,e.toString())}},[])},cg=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ig();var s=S.useMemo(function(){return og(o)},[o]);return S.createElement(sg,{styles:ag(s,!t,o,n?"":"!important")})},No=!1;if(typeof window<"u")try{var mr=Object.defineProperty({},"passive",{get:function(){return No=!0,!0}});window.addEventListener("test",mr,mr),window.removeEventListener("test",mr,mr)}catch{No=!1}var sn=No?{passive:!1}:!1,ug=function(e){return e.tagName==="TEXTAREA"},Dc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ug(e)&&n[t]==="visible")},lg=function(e){return Dc(e,"overflowY")},dg=function(e){return Dc(e,"overflowX")},Mc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Lc(e,r);if(o){var s=jc(e,r),a=s[1],i=s[2];if(a>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fg=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hg=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Lc=function(e,t){return e==="v"?lg(t):dg(t)},jc=function(e,t){return e==="v"?fg(t):hg(t)},pg=function(e,t){return e==="h"&&t==="rtl"?-1:1},mg=function(e,t,n,r,o){var s=pg(e,window.getComputedStyle(t).direction),a=s*r,i=n.target,c=t.contains(i),u=!1,l=a>0,d=0,h=0;do{if(!i)break;var m=jc(e,i),_=m[0],y=m[1],g=m[2],p=y-g-s*_;(_||p)&&Lc(e,i)&&(d+=p,h+=_);var b=i.parentNode;i=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(l&&Math.abs(d)<1||!l&&Math.abs(h)<1)&&(u=!0),u},gr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hc=function(e){return[e.deltaX,e.deltaY]},Uc=function(e){return e&&"current"in e?e.current:e},gg=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bg=function(e){return`
160
160
  .block-interactivity-`.concat(e,` {pointer-events: none;}
161
161
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
162
- `)},gg=0,an=[];function bg(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(gg++)[0],s=S.useState(Nc)[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=Hm([e.lockRef.current],(e.shards||[]).map(Uc),!0).filter(Boolean);return y.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=S.useCallback(function(y,g){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var p=gr(y),b=n.current,f="deltaX"in y?y.deltaX:b[0]-p[0],A="deltaY"in y?y.deltaY:b[1]-p[1],E,R=y.target,v=Math.abs(f)>Math.abs(A)?"h":"v";if("touches"in y&&v==="h"&&R.type==="range")return!1;var x=Mc(v,R);if(!x)return!0;if(x?E=v:(E=v==="v"?"h":"v",x=Mc(v,R)),!x)return!1;if(!r.current&&"changedTouches"in y&&(f||A)&&(r.current=E),!E)return!0;var C=r.current||E;return hg(C,g,y,C==="h"?f:A)},[]),c=S.useCallback(function(y){var g=y;if(!(!an.length||an[an.length-1]!==s)){var p="deltaY"in g?Hc(g):gr(g),b=t.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&pg(E.delta,p)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var f=(a.current.shards||[]).map(Uc).filter(Boolean).filter(function(E){return E.contains(g.target)}),A=f.length>0?i(g,f[0]):!a.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=S.useCallback(function(y,g,p,b){var f={name:y,delta:g,target:p,should:b,shadowParent:yg(p)};t.current.push(f),setTimeout(function(){t.current=t.current.filter(function(A){return A!==f})},1)},[]),l=S.useCallback(function(y){n.current=gr(y),r.current=void 0},[]),d=S.useCallback(function(y){u(y.type,Hc(y),y.target,i(y,e.lockRef.current))},[]),h=S.useCallback(function(y){u(y.type,gr(y),y.target,i(y,e.lockRef.current))},[]);S.useEffect(function(){return an.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,sn),document.addEventListener("touchmove",c,sn),document.addEventListener("touchstart",l,sn),function(){an=an.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,sn),document.removeEventListener("touchmove",c,sn),document.removeEventListener("touchstart",l,sn)}},[]);var m=e.removeScrollBar,_=e.inert;return S.createElement(S.Fragment,null,_?S.createElement(s,{styles:mg(o)}):null,m?S.createElement(ag,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yg(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wg=Bm(kc,bg);var Io=S.forwardRef(function(e,t){return S.createElement(pr,st({},e,{ref:t,sideCar:wg}))});Io.classNames=pr.classNames;var vg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cn=new WeakMap,br=new WeakMap,yr={},Do=0,$c=function(e){return e&&(e.host||$c(e.parentNode))},Eg=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$c(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_g=function(e,t,n,r){var o=Eg(t,Array.isArray(e)?e:[e]);yr[n]||(yr[n]=new WeakMap);var s=yr[n],a=[],i=new Set,c=new Set(o),u=function(d){!d||i.has(d)||(i.add(d),u(d.parentNode))};o.forEach(u);var l=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(i.has(h))l(h);else try{var m=h.getAttribute(r),_=m!==null&&m!=="false",y=(cn.get(h)||0)+1,g=(s.get(h)||0)+1;cn.set(h,y),s.set(h,g),a.push(h),y===1&&_&&br.set(h,!0),g===1&&h.setAttribute(n,"true"),_||h.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",h,p)}})};return l(t),i.clear(),Do++,function(){a.forEach(function(d){var h=cn.get(d)-1,m=s.get(d)-1;cn.set(d,h),s.set(d,m),h||(br.has(d)||d.removeAttribute(r),br.delete(d)),m||d.removeAttribute(n)}),Do--,Do||(cn=new WeakMap,cn=new WeakMap,br=new WeakMap,yr={})}},Wc=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=vg(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),_g(r,o,n,"aria-hidden")):function(){return null}},wr="Dialog",[Fc,HS]=Ut(wr),[Sg,et]=Fc(wr),Kc=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=S.useRef(null),c=S.useRef(null),[u,l]=Pn({prop:r,defaultProp:o??!1,onChange:s,caller:wr});return w.jsx(Sg,{scope:t,triggerRef:i,contentRef:c,contentId:mt(),titleId:mt(),descriptionId:mt(),open:u,onOpenChange:l,onOpenToggle:S.useCallback(()=>l(d=>!d),[l]),modal:a,children:n})};Kc.displayName=wr;var qc="DialogTrigger",zc=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(qc,n),s=Te(t,o.triggerRef);return w.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":jo(o.open),...r,ref:s,onClick:Z(e.onClick,o.onOpenToggle)})});zc.displayName=qc;var Mo="DialogPortal",[xg,Gc]=Fc(Mo,{forceMount:void 0}),Bc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=et(Mo,t);return w.jsx(xg,{scope:t,forceMount:n,children:S.Children.map(r,a=>w.jsx(gt,{present:n||s.open,children:w.jsx(Co,{asChild:!0,container:o,children:a})}))})};Bc.displayName=Mo;var vr="DialogOverlay",Vc=S.forwardRef((e,t)=>{const n=Gc(vr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=et(vr,e.__scopeDialog);return s.modal?w.jsx(gt,{present:r||s.open,children:w.jsx(Rg,{...o,ref:t})}):null});Vc.displayName=vr;var Ag=Qt("DialogOverlay.RemoveScroll"),Rg=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(vr,n);return w.jsx(Io,{as:Ag,allowPinchZoom:!0,shards:[o.contentRef],children:w.jsx(xe.div,{"data-state":jo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$t="DialogContent",Jc=S.forwardRef((e,t)=>{const n=Gc($t,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=et($t,e.__scopeDialog);return w.jsx(gt,{present:r||s.open,children:s.modal?w.jsx(Cg,{...o,ref:t}):w.jsx(Tg,{...o,ref:t})})});Jc.displayName=$t;var Cg=S.forwardRef((e,t)=>{const n=et($t,e.__scopeDialog),r=S.useRef(null),o=Te(t,n.contentRef,r);return S.useEffect(()=>{const s=r.current;if(s)return Wc(s)},[]),w.jsx(Xc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault())})}),Tg=S.forwardRef((e,t)=>{const n=et($t,e.__scopeDialog),r=S.useRef(!1),o=S.useRef(!1);return w.jsx(Xc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Xc=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=et($t,n),c=S.useRef(null),u=Te(t,c);return Rc(),w.jsxs(w.Fragment,{children:[w.jsx(Ro,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:w.jsx(lr,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":jo(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(Pg,{titleId:i.titleId}),w.jsx(kg,{contentRef:c,descriptionId:i.descriptionId})]})]})}),Lo="DialogTitle",Yc=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(Lo,n);return w.jsx(xe.h2,{id:o.titleId,...r,ref:t})});Yc.displayName=Lo;var Zc="DialogDescription",Qc=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(Zc,n);return w.jsx(xe.p,{id:o.descriptionId,...r,ref:t})});Qc.displayName=Zc;var eu="DialogClose",tu=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(eu,n);return w.jsx(xe.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});tu.displayName=eu;function jo(e){return e?"open":"closed"}var nu="DialogTitleWarning",[US,ru]=fm(nu,{contentName:$t,titleName:Lo,docsSlug:"dialog"}),Pg=({titleId:e})=>{const t=ru(nu),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
162
+ `)},yg=0,an=[];function wg(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(yg++)[0],s=S.useState(Nc)[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=$m([e.lockRef.current],(e.shards||[]).map(Uc),!0).filter(Boolean);return y.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=S.useCallback(function(y,g){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var p=gr(y),b=n.current,f="deltaX"in y?y.deltaX:b[0]-p[0],A="deltaY"in y?y.deltaY:b[1]-p[1],E,R=y.target,v=Math.abs(f)>Math.abs(A)?"h":"v";if("touches"in y&&v==="h"&&R.type==="range")return!1;var x=Mc(v,R);if(!x)return!0;if(x?E=v:(E=v==="v"?"h":"v",x=Mc(v,R)),!x)return!1;if(!r.current&&"changedTouches"in y&&(f||A)&&(r.current=E),!E)return!0;var C=r.current||E;return mg(C,g,y,C==="h"?f:A)},[]),c=S.useCallback(function(y){var g=y;if(!(!an.length||an[an.length-1]!==s)){var p="deltaY"in g?Hc(g):gr(g),b=t.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&gg(E.delta,p)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var f=(a.current.shards||[]).map(Uc).filter(Boolean).filter(function(E){return E.contains(g.target)}),A=f.length>0?i(g,f[0]):!a.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=S.useCallback(function(y,g,p,b){var f={name:y,delta:g,target:p,should:b,shadowParent:vg(p)};t.current.push(f),setTimeout(function(){t.current=t.current.filter(function(A){return A!==f})},1)},[]),l=S.useCallback(function(y){n.current=gr(y),r.current=void 0},[]),d=S.useCallback(function(y){u(y.type,Hc(y),y.target,i(y,e.lockRef.current))},[]),h=S.useCallback(function(y){u(y.type,gr(y),y.target,i(y,e.lockRef.current))},[]);S.useEffect(function(){return an.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,sn),document.addEventListener("touchmove",c,sn),document.addEventListener("touchstart",l,sn),function(){an=an.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,sn),document.removeEventListener("touchmove",c,sn),document.removeEventListener("touchstart",l,sn)}},[]);var m=e.removeScrollBar,_=e.inert;return S.createElement(S.Fragment,null,_?S.createElement(s,{styles:bg(o)}):null,m?S.createElement(cg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vg(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Eg=Jm(kc,wg);var Io=S.forwardRef(function(e,t){return S.createElement(pr,st({},e,{ref:t,sideCar:Eg}))});Io.classNames=pr.classNames;var _g=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cn=new WeakMap,br=new WeakMap,yr={},Do=0,$c=function(e){return e&&(e.host||$c(e.parentNode))},Sg=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$c(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xg=function(e,t,n,r){var o=Sg(t,Array.isArray(e)?e:[e]);yr[n]||(yr[n]=new WeakMap);var s=yr[n],a=[],i=new Set,c=new Set(o),u=function(d){!d||i.has(d)||(i.add(d),u(d.parentNode))};o.forEach(u);var l=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(i.has(h))l(h);else try{var m=h.getAttribute(r),_=m!==null&&m!=="false",y=(cn.get(h)||0)+1,g=(s.get(h)||0)+1;cn.set(h,y),s.set(h,g),a.push(h),y===1&&_&&br.set(h,!0),g===1&&h.setAttribute(n,"true"),_||h.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",h,p)}})};return l(t),i.clear(),Do++,function(){a.forEach(function(d){var h=cn.get(d)-1,m=s.get(d)-1;cn.set(d,h),s.set(d,m),h||(br.has(d)||d.removeAttribute(r),br.delete(d)),m||d.removeAttribute(n)}),Do--,Do||(cn=new WeakMap,cn=new WeakMap,br=new WeakMap,yr={})}},Wc=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=_g(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),xg(r,o,n,"aria-hidden")):function(){return null}},wr="Dialog",[Fc,$2]=Ut(wr),[Ag,et]=Fc(wr),Kc=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,i=S.useRef(null),c=S.useRef(null),[u,l]=Pn({prop:r,defaultProp:o??!1,onChange:s,caller:wr});return w.jsx(Ag,{scope:t,triggerRef:i,contentRef:c,contentId:mt(),titleId:mt(),descriptionId:mt(),open:u,onOpenChange:l,onOpenToggle:S.useCallback(()=>l(d=>!d),[l]),modal:a,children:n})};Kc.displayName=wr;var qc="DialogTrigger",zc=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(qc,n),s=Te(t,o.triggerRef);return w.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":jo(o.open),...r,ref:s,onClick:Z(e.onClick,o.onOpenToggle)})});zc.displayName=qc;var Mo="DialogPortal",[Rg,Gc]=Fc(Mo,{forceMount:void 0}),Bc=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=et(Mo,t);return w.jsx(Rg,{scope:t,forceMount:n,children:S.Children.map(r,a=>w.jsx(gt,{present:n||s.open,children:w.jsx(Co,{asChild:!0,container:o,children:a})}))})};Bc.displayName=Mo;var vr="DialogOverlay",Vc=S.forwardRef((e,t)=>{const n=Gc(vr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=et(vr,e.__scopeDialog);return s.modal?w.jsx(gt,{present:r||s.open,children:w.jsx(Tg,{...o,ref:t})}):null});Vc.displayName=vr;var Cg=Qt("DialogOverlay.RemoveScroll"),Tg=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(vr,n);return w.jsx(Io,{as:Cg,allowPinchZoom:!0,shards:[o.contentRef],children:w.jsx(xe.div,{"data-state":jo(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$t="DialogContent",Jc=S.forwardRef((e,t)=>{const n=Gc($t,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=et($t,e.__scopeDialog);return w.jsx(gt,{present:r||s.open,children:s.modal?w.jsx(Pg,{...o,ref:t}):w.jsx(Og,{...o,ref:t})})});Jc.displayName=$t;var Pg=S.forwardRef((e,t)=>{const n=et($t,e.__scopeDialog),r=S.useRef(null),o=Te(t,n.contentRef,r);return S.useEffect(()=>{const s=r.current;if(s)return Wc(s)},[]),w.jsx(Xc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault())})}),Og=S.forwardRef((e,t)=>{const n=et($t,e.__scopeDialog),r=S.useRef(!1),o=S.useRef(!1);return w.jsx(Xc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Xc=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...a}=e,i=et($t,n),c=S.useRef(null),u=Te(t,c);return Rc(),w.jsxs(w.Fragment,{children:[w.jsx(Ro,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:w.jsx(lr,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":jo(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(kg,{titleId:i.titleId}),w.jsx(Ig,{contentRef:c,descriptionId:i.descriptionId})]})]})}),Lo="DialogTitle",Yc=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(Lo,n);return w.jsx(xe.h2,{id:o.titleId,...r,ref:t})});Yc.displayName=Lo;var Zc="DialogDescription",Qc=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(Zc,n);return w.jsx(xe.p,{id:o.descriptionId,...r,ref:t})});Qc.displayName=Zc;var eu="DialogClose",tu=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=et(eu,n);return w.jsx(xe.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});tu.displayName=eu;function jo(e){return e?"open":"closed"}var nu="DialogTitleWarning",[W2,ru]=pm(nu,{contentName:$t,titleName:Lo,docsSlug:"dialog"}),kg=({titleId:e})=>{const t=ru(nu),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
163
163
 
164
164
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
165
165
 
166
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Og="DialogDescriptionWarning",kg=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ru(Og).contentName}}.`;return S.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ng=Kc,Ig=zc,Dg=Bc,ou=Vc,su=Jc,au=Yc,iu=Qc,cu=tu;const uu=Ng,Mg=Ig,Lg=cu,lu=Dg,Ho=S.forwardRef(({className:e,...t},n)=>w.jsx(ou,{className:W("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Ho.displayName=ou.displayName;const jg=Eo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Uo=S.forwardRef(({side:e="right",className:t,children:n,...r},o)=>w.jsxs(lu,{children:[w.jsx(Ho,{}),w.jsxs(su,{ref:o,className:W(jg({side:e}),t),...r,children:[n,w.jsxs(cu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[w.jsx(dm,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Uo.displayName=su.displayName;const $o=({className:e,...t})=>w.jsx("div",{className:W("flex flex-col space-y-2 text-center sm:text-left",e),...t});$o.displayName="SheetHeader";const du=({className:e,...t})=>w.jsx("div",{className:W("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});du.displayName="SheetFooter";const Wo=S.forwardRef(({className:e,...t},n)=>w.jsx(au,{ref:n,className:W("text-lg font-semibold text-foreground",e),...t}));Wo.displayName=au.displayName;const Fo=S.forwardRef(({className:e,...t},n)=>w.jsx(iu,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));Fo.displayName=iu.displayName;function Ko({className:e,...t}){return w.jsx("div",{className:W("animate-pulse rounded-md bg-muted",e),...t})}const Hg=["top","right","bottom","left"],Rt=Math.min,ze=Math.max,Er=Math.round,_r=Math.floor,at=e=>({x:e,y:e}),Ug={left:"right",right:"left",bottom:"top",top:"bottom"},$g={start:"end",end:"start"};function qo(e,t,n){return ze(e,Rt(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function Go(e){return e==="y"?"height":"width"}function it(e){return["top","bottom"].includes(yt(e))?"y":"x"}function Bo(e){return zo(it(e))}function Wg(e,t,n){n===void 0&&(n=!1);const r=un(e),o=Bo(e),s=Go(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Sr(a)),[a,Sr(a)]}function Fg(e){const t=Sr(e);return[Vo(e),t,Vo(t)]}function Vo(e){return e.replace(/start|end/g,t=>$g[t])}function Kg(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:a;default:return[]}}function qg(e,t,n,r){const o=un(e);let s=Kg(yt(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(Vo)))),s}function Sr(e){return e.replace(/left|right|bottom|top/g,t=>Ug[t])}function zg(e){return{top:0,right:0,bottom:0,left:0,...e}}function fu(e){return typeof e!="number"?zg(e):{top:e,right:e,bottom:e,left:e}}function xr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function hu(e,t,n){let{reference:r,floating:o}=e;const s=it(t),a=Bo(t),i=Go(a),c=yt(t),u=s==="y",l=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[i]/2-o[i]/2;let m;switch(c){case"top":m={x:l,y:r.y-o.height};break;case"bottom":m={x:l,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(un(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const Gg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=hu(u,r,c),h=r,m={},_=0;for(let y=0;y<i.length;y++){const{name:g,fn:p}=i[y],{x:b,y:f,data:A,reset:E}=await p({x:l,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});l=b??l,d=f??d,m={...m,[g]:{...m[g],...A}},E&&_<=50&&(_++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:l,y:d}=hu(u,h,c)),y=-1)}return{x:l,y:d,placement:h,strategy:o,middlewareData:m}};async function On(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=bt(t,e),_=fu(m),g=i[h?d==="floating"?"reference":"floating":d],p=xr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,f=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),A=await(s.isElement==null?void 0:s.isElement(f))?await(s.getScale==null?void 0:s.getScale(f))||{x:1,y:1}:{x:1,y:1},E=xr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:f,strategy:c}):b);return{top:(p.top-E.top+_.top)/A.y,bottom:(E.bottom-p.bottom+_.bottom)/A.y,left:(p.left-E.left+_.left)/A.x,right:(E.right-p.right+_.right)/A.x}}const Bg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=bt(e,t)||{};if(u==null)return{};const d=fu(l),h={x:n,y:r},m=Bo(o),_=Go(m),y=await a.getDimensions(u),g=m==="y",p=g?"top":"left",b=g?"bottom":"right",f=g?"clientHeight":"clientWidth",A=s.reference[_]+s.reference[m]-h[m]-s.floating[_],E=h[m]-s.reference[m],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let v=R?R[f]:0;(!v||!await(a.isElement==null?void 0:a.isElement(R)))&&(v=i.floating[f]||s.floating[_]);const x=A/2-E/2,C=v/2-y[_]/2-1,D=Rt(d[p],C),I=Rt(d[b],C),P=D,U=v-y[_]-I,G=v/2-y[_]/2+x,oe=qo(P,G,U),V=!c.arrow&&un(o)!=null&&G!==oe&&s.reference[_]/2-(G<P?D:I)-y[_]/2<0,Y=V?G<P?G-P:G-U:0;return{[m]:h[m]+Y,data:{[m]:oe,centerOffset:G-oe-Y,...V&&{alignmentOffset:Y}},reset:V}}}),Vg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:y=!0,...g}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=yt(o),b=it(i),f=yt(i)===i,A=await(c.isRTL==null?void 0:c.isRTL(u.floating)),E=h||(f||!y?[Sr(i)]:Fg(i)),R=_!=="none";!h&&R&&E.push(...qg(i,y,_,A));const v=[i,...E],x=await On(t,g),C=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&C.push(x[p]),d){const G=Wg(o,a,A);C.push(x[G[0]],x[G[1]])}if(D=[...D,{placement:o,overflows:C}],!C.every(G=>G<=0)){var I,P;const G=(((I=s.flip)==null?void 0:I.index)||0)+1,oe=v[G];if(oe&&(!(d==="alignment"?b!==it(oe):!1)||D.every(O=>O.overflows[0]>0&&it(O.placement)===b)))return{data:{index:G,overflows:D},reset:{placement:oe}};let V=(P=D.filter(Y=>Y.overflows[0]<=0).sort((Y,O)=>Y.overflows[1]-O.overflows[1])[0])==null?void 0:P.placement;if(!V)switch(m){case"bestFit":{var U;const Y=(U=D.filter(O=>{if(R){const j=it(O.placement);return j===b||j==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(j=>j>0).reduce((j,T)=>j+T,0)]).sort((O,j)=>O[1]-j[1])[0])==null?void 0:U[0];Y&&(V=Y);break}case"initialPlacement":V=i;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function pu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mu(e){return Hg.some(t=>e[t]>=0)}const Jg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await On(t,{...o,elementContext:"reference"}),a=pu(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:mu(a)}}}case"escaped":{const s=await On(t,{...o,altBoundary:!0}),a=pu(s,n.floating);return{data:{escapedOffsets:a,escaped:mu(a)}}}default:return{}}}}};async function Xg(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=yt(n),i=un(n),c=it(n)==="y",u=["left","top"].includes(a)?-1:1,l=s&&c?-1:1,d=bt(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof _=="number"&&(m=i==="end"?_*-1:_),c?{x:m*l,y:h*u}:{x:h*u,y:m*l}}const Yg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,c=await Xg(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:a}}}}},Zg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x:p,y:b}=g;return{x:p,y:b}}},...c}=bt(e,t),u={x:n,y:r},l=await On(t,c),d=it(yt(o)),h=zo(d);let m=u[h],_=u[d];if(s){const g=h==="y"?"top":"left",p=h==="y"?"bottom":"right",b=m+l[g],f=m-l[p];m=qo(b,m,f)}if(a){const g=d==="y"?"top":"left",p=d==="y"?"bottom":"right",b=_+l[g],f=_-l[p];_=qo(b,_,f)}const y=i.fn({...t,[h]:m,[d]:_});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:s,[d]:a}}}}}},Qg=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:u=!0}=bt(e,t),l={x:n,y:r},d=it(o),h=zo(d);let m=l[h],_=l[d];const y=bt(i,t),g=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const f=h==="y"?"height":"width",A=s.reference[h]-s.floating[f]+g.mainAxis,E=s.reference[h]+s.reference[f]-g.mainAxis;m<A?m=A:m>E&&(m=E)}if(u){var p,b;const f=h==="y"?"width":"height",A=["top","left"].includes(yt(o)),E=s.reference[d]-s.floating[f]+(A&&((p=a.offset)==null?void 0:p[d])||0)+(A?0:g.crossAxis),R=s.reference[d]+s.reference[f]+(A?0:((b=a.offset)==null?void 0:b[d])||0)-(A?g.crossAxis:0);_<E?_=E:_>R&&(_=R)}return{[h]:m,[d]:_}}}},eb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...u}=bt(e,t),l=await On(t,u),d=yt(o),h=un(o),m=it(o)==="y",{width:_,height:y}=s.floating;let g,p;d==="top"||d==="bottom"?(g=d,p=h===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(p=d,g=h==="end"?"top":"bottom");const b=y-l.top-l.bottom,f=_-l.left-l.right,A=Rt(y-l[g],b),E=Rt(_-l[p],f),R=!t.middlewareData.shift;let v=A,x=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(x=f),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(v=b),R&&!h){const D=ze(l.left,0),I=ze(l.right,0),P=ze(l.top,0),U=ze(l.bottom,0);m?x=_-2*(D!==0||I!==0?D+I:ze(l.left,l.right)):v=y-2*(P!==0||U!==0?P+U:ze(l.top,l.bottom))}await c({...t,availableWidth:x,availableHeight:v});const C=await a.getDimensions(i.floating);return _!==C.width||y!==C.height?{reset:{rects:!0}}:{}}}};function Ar(){return typeof window<"u"}function ln(e){return gu(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ct(e){var t;return(t=(gu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gu(e){return Ar()?e instanceof Node||e instanceof Ge(e).Node:!1}function tt(e){return Ar()?e instanceof Element||e instanceof Ge(e).Element:!1}function ut(e){return Ar()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function bu(e){return!Ar()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}function kn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function tb(e){return["table","td","th"].includes(ln(e))}function Rr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Jo(e){const t=Xo(),n=tt(e)?nt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function nb(e){let t=Ct(e);for(;ut(t)&&!dn(t);){if(Jo(t))return t;if(Rr(t))return null;t=Ct(t)}return null}function Xo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dn(e){return["html","body","#document"].includes(ln(e))}function nt(e){return Ge(e).getComputedStyle(e)}function Cr(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bu(e)&&e.host||ct(e);return bu(t)?t.host:t}function yu(e){const t=Ct(e);return dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ut(t)&&kn(t)?t:yu(t)}function Nn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=yu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ge(o);if(s){const i=Yo(a);return t.concat(a,a.visualViewport||[],kn(o)?o:[],i&&n?Nn(i):[])}return t.concat(o,Nn(o,[],n))}function Yo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wu(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ut(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=Er(n)!==s||Er(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function Zo(e){return tt(e)?e:e.contextElement}function fn(e){const t=Zo(e);if(!ut(t))return at(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=wu(t);let a=(s?Er(n.width):n.width)/r,i=(s?Er(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const rb=at(0);function vu(e){const t=Ge(e);return!Xo()||!t.visualViewport?rb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ob(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ge(e)?!1:t}function Wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zo(e);let a=at(1);t&&(r?tt(r)&&(a=fn(r)):a=fn(e));const i=ob(s,n,r)?vu(s):at(0);let c=(o.left+i.x)/a.x,u=(o.top+i.y)/a.y,l=o.width/a.x,d=o.height/a.y;if(s){const h=Ge(s),m=r&&tt(r)?Ge(r):r;let _=h,y=Yo(_);for(;y&&r&&m!==_;){const g=fn(y),p=y.getBoundingClientRect(),b=nt(y),f=p.left+(y.clientLeft+parseFloat(b.paddingLeft))*g.x,A=p.top+(y.clientTop+parseFloat(b.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,d*=g.y,c+=f,u+=A,_=Ge(y),y=Yo(_)}}return xr({width:l,height:d,x:c,y:u})}function Qo(e,t){const n=Cr(e).scrollLeft;return t?t.left+n:Wt(ct(e)).left+n}function Eu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Qo(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function sb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=ct(r),i=t?Rr(t.floating):!1;if(r===a||i&&s)return n;let c={scrollLeft:0,scrollTop:0},u=at(1);const l=at(0),d=ut(r);if((d||!d&&!s)&&((ln(r)!=="body"||kn(a))&&(c=Cr(r)),ut(r))){const m=Wt(r);u=fn(r),l.x=m.x+r.clientLeft,l.y=m.y+r.clientTop}const h=a&&!d&&!s?Eu(a,c,!0):at(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+h.x,y:n.y*u.y-c.scrollTop*u.y+l.y+h.y}}function ab(e){return Array.from(e.getClientRects())}function ib(e){const t=ct(e),n=Cr(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Qo(e);const i=-n.scrollTop;return nt(r).direction==="rtl"&&(a+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}function cb(e,t){const n=Ge(e),r=ct(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,c=0;if(o){s=o.width,a=o.height;const u=Xo();(!u||u&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}return{width:s,height:a,x:i,y:c}}function ub(e,t){const n=Wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ut(e)?fn(e):at(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:a,height:i,x:c,y:u}}function _u(e,t,n){let r;if(t==="viewport")r=cb(e,n);else if(t==="document")r=ib(ct(e));else if(tt(t))r=ub(t,n);else{const o=vu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xr(r)}function Su(e,t){const n=Ct(e);return n===t||!tt(n)||dn(n)?!1:nt(n).position==="fixed"||Su(n,t)}function lb(e,t){const n=t.get(e);if(n)return n;let r=Nn(e,[],!1).filter(i=>tt(i)&&ln(i)!=="body"),o=null;const s=nt(e).position==="fixed";let a=s?Ct(e):e;for(;tt(a)&&!dn(a);){const i=nt(a),c=Jo(a);!c&&i.position==="fixed"&&(o=null),(s?!c&&!o:!c&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||kn(a)&&!c&&Su(e,a))?r=r.filter(l=>l!==a):o=i,a=Ct(a)}return t.set(e,r),r}function db(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Rr(t)?[]:lb(t,this._c):[].concat(n),r],i=a[0],c=a.reduce((u,l)=>{const d=_u(t,l,o);return u.top=ze(d.top,u.top),u.right=Rt(d.right,u.right),u.bottom=Rt(d.bottom,u.bottom),u.left=ze(d.left,u.left),u},_u(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fb(e){const{width:t,height:n}=wu(e);return{width:t,height:n}}function hb(e,t,n){const r=ut(t),o=ct(t),s=n==="fixed",a=Wt(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=at(0);function u(){c.x=Qo(o)}if(r||!r&&!s)if((ln(t)!=="body"||kn(o))&&(i=Cr(t)),r){const m=Wt(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&u();s&&!r&&o&&u();const l=o&&!r&&!s?Eu(o,i):at(0),d=a.left+i.scrollLeft-c.x-l.x,h=a.top+i.scrollTop-c.y-l.y;return{x:d,y:h,width:a.width,height:a.height}}function es(e){return nt(e).position==="static"}function xu(e,t){if(!ut(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ct(e)===n&&(n=n.ownerDocument.body),n}function Au(e,t){const n=Ge(e);if(Rr(e))return n;if(!ut(e)){let o=Ct(e);for(;o&&!dn(o);){if(tt(o)&&!es(o))return o;o=Ct(o)}return n}let r=xu(e,t);for(;r&&tb(r)&&es(r);)r=xu(r,t);return r&&dn(r)&&es(r)&&!Jo(r)?n:r||nb(e)||n}const pb=async function(e){const t=this.getOffsetParent||Au,n=this.getDimensions,r=await n(e.floating);return{reference:hb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mb(e){return nt(e).direction==="rtl"}const gb={convertOffsetParentRelativeRectToViewportRelativeRect:sb,getDocumentElement:ct,getClippingRect:db,getOffsetParent:Au,getElementRects:pb,getClientRects:ab,getDimensions:fb,getScale:fn,isElement:tt,isRTL:mb};function Ru(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bb(e,t){let n=null,r;const o=ct(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:l,top:d,width:h,height:m}=u;if(i||t(),!h||!m)return;const _=_r(d),y=_r(o.clientWidth-(l+h)),g=_r(o.clientHeight-(d+m)),p=_r(l),f={rootMargin:-_+"px "+-y+"px "+-g+"px "+-p+"px",threshold:ze(0,Rt(1,c))||1};let A=!0;function E(R){const v=R[0].intersectionRatio;if(v!==c){if(!A)return a();v?a(!1,v):r=setTimeout(()=>{a(!1,1e-7)},1e3)}v===1&&!Ru(u,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(E,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,f)}n.observe(e)}return a(!0),s}function yb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Zo(e),l=o||s?[...u?Nn(u):[],...Nn(t)]:[];l.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=u&&i?bb(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(p=>{let[b]=p;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var f;(f=m)==null||f.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let _,y=c?Wt(e):null;c&&g();function g(){const p=Wt(e);y&&!Ru(y,p)&&n(),y=p,_=requestAnimationFrame(g)}return n(),()=>{var p;l.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(_)}}const wb=Yg,vb=Zg,Eb=Vg,_b=eb,Sb=Jg,Cu=Bg,xb=Qg,Ab=(e,t,n)=>{const r=new Map,o={platform:gb,...n},s={...o.platform,_c:r};return Gg(e,t,{...o,platform:s})};var Rb=typeof document<"u",Cb=function(){},Tr=Rb?F.useLayoutEffect:Cb;function Pr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Pr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Tu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pu(e,t){const n=Tu(e);return Math.round(t*n)/n}function ts(e){const t=S.useRef(e);return Tr(()=>{t.current=e}),t}function Tb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=S.useState(r);Pr(h,r)||m(r);const[_,y]=S.useState(null),[g,p]=S.useState(null),b=S.useCallback(O=>{O!==R.current&&(R.current=O,y(O))},[]),f=S.useCallback(O=>{O!==v.current&&(v.current=O,p(O))},[]),A=s||_,E=a||g,R=S.useRef(null),v=S.useRef(null),x=S.useRef(l),C=c!=null,D=ts(c),I=ts(o),P=ts(u),U=S.useCallback(()=>{if(!R.current||!v.current)return;const O={placement:t,strategy:n,middleware:h};I.current&&(O.platform=I.current),Ab(R.current,v.current,O).then(j=>{const T={...j,isPositioned:P.current!==!1};G.current&&!Pr(x.current,T)&&(x.current=T,Mi.flushSync(()=>{d(T)}))})},[h,t,n,I,P]);Tr(()=>{u===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const G=S.useRef(!1);Tr(()=>(G.current=!0,()=>{G.current=!1}),[]),Tr(()=>{if(A&&(R.current=A),E&&(v.current=E),A&&E){if(D.current)return D.current(A,E,U);U()}},[A,E,U,D,C]);const oe=S.useMemo(()=>({reference:R,floating:v,setReference:b,setFloating:f}),[b,f]),V=S.useMemo(()=>({reference:A,floating:E}),[A,E]),Y=S.useMemo(()=>{const O={position:n,left:0,top:0};if(!V.floating)return O;const j=Pu(V.floating,l.x),T=Pu(V.floating,l.y);return i?{...O,transform:"translate("+j+"px, "+T+"px)",...Tu(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:T}},[n,i,V.floating,l.x,l.y]);return S.useMemo(()=>({...l,update:U,refs:oe,elements:V,floatingStyles:Y}),[l,U,oe,V,Y])}const Pb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Cu({element:r.current,padding:o}).fn(n):{}:r?Cu({element:r,padding:o}).fn(n):{}}}},Ob=(e,t)=>({...wb(e),options:[e,t]}),kb=(e,t)=>({...vb(e),options:[e,t]}),Nb=(e,t)=>({...xb(e),options:[e,t]}),Ib=(e,t)=>({...Eb(e),options:[e,t]}),Db=(e,t)=>({..._b(e),options:[e,t]}),Mb=(e,t)=>({...Sb(e),options:[e,t]}),Lb=(e,t)=>({...Pb(e),options:[e,t]});var jb="Arrow",Ou=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return w.jsx(xe.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ou.displayName=jb;var Hb=Ou;function Ub(e){const[t,n]=S.useState(void 0);return xt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ns="Popper",[ku,Or]=Ut(ns),[$b,Nu]=ku(ns),Iu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=S.useState(null);return w.jsx($b,{scope:t,anchor:r,onAnchorChange:o,children:n})};Iu.displayName=ns;var Du="PopperAnchor",Mu=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Nu(Du,n),a=S.useRef(null),i=Te(t,a);return S.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.jsx(xe.div,{...o,ref:i})});Mu.displayName=Du;var rs="PopperContent",[Wb,Fb]=ku(rs),Lu=S.forwardRef((e,t)=>{var te,le,ue,ye,k,N;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:l=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:_,...y}=e,g=Nu(rs,n),[p,b]=S.useState(null),f=Te(t,M=>b(M)),[A,E]=S.useState(null),R=Ub(A),v=(R==null?void 0:R.width)??0,x=(R==null?void 0:R.height)??0,C=r+(s!=="center"?"-"+s:""),D=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},I=Array.isArray(u)?u:[u],P=I.length>0,U={padding:D,boundary:I.filter(qb),altBoundary:P},{refs:G,floatingStyles:oe,placement:V,isPositioned:Y,middlewareData:O}=Tb({strategy:"fixed",placement:C,whileElementsMounted:(...M)=>yb(...M,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[Ob({mainAxis:o+x,alignmentAxis:a}),c&&kb({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Nb():void 0,...U}),c&&Ib({...U}),Db({...U,apply:({elements:M,rects:z,availableWidth:ne,availableHeight:$})=>{const{width:_e,height:Ce}=z.reference,pe=M.floating.style;pe.setProperty("--radix-popper-available-width",`${ne}px`),pe.setProperty("--radix-popper-available-height",`${$}px`),pe.setProperty("--radix-popper-anchor-width",`${_e}px`),pe.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),A&&Lb({element:A,padding:i}),zb({arrowWidth:v,arrowHeight:x}),h&&Mb({strategy:"referenceHidden",...U})]}),[j,T]=Uu(V),H=ot(_);xt(()=>{Y&&(H==null||H())},[Y,H]);const J=(te=O.arrow)==null?void 0:te.x,X=(le=O.arrow)==null?void 0:le.y,se=((ue=O.arrow)==null?void 0:ue.centerOffset)!==0,[fe,we]=S.useState();return xt(()=>{p&&we(window.getComputedStyle(p).zIndex)},[p]),w.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:Y?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ye=O.transformOrigin)==null?void 0:ye.x,(k=O.transformOrigin)==null?void 0:k.y].join(" "),...((N=O.hide)==null?void 0:N.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(Wb,{scope:n,placedSide:j,onArrowChange:E,arrowX:J,arrowY:X,shouldHideArrow:se,children:w.jsx(xe.div,{"data-side":j,"data-align":T,...y,ref:f,style:{...y.style,animation:Y?void 0:"none"}})})})});Lu.displayName=rs;var ju="PopperArrow",Kb={top:"bottom",right:"left",bottom:"top",left:"right"},Hu=S.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Fb(ju,r),a=Kb[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]: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:w.jsx(Hb,{...o,ref:n,style:{...o.style,display:"block"}})})});Hu.displayName=ju;function qb(e){return e!==null}var zb=e=>({name:"transformOrigin",options:e,fn(t){var g,p,b;const{placement:n,rects:r,middlewareData:o}=t,a=((g=o.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,l]=Uu(n),d={start:"0%",center:"50%",end:"100%"}[l],h=(((p=o.arrow)==null?void 0:p.x)??0)+i/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let _="",y="";return u==="bottom"?(_=a?d:`${h}px`,y=`${-c}px`):u==="top"?(_=a?d:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(_=`${-c}px`,y=a?d:`${m}px`):u==="left"&&(_=`${r.floating.width+c}px`,y=a?d:`${m}px`),{data:{x:_,y}}}});function Uu(e){const[t,n="center"]=e.split("-");return[t,n]}var os=Iu,$u=Mu,Wu=Lu,Fu=Hu,Gb=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"}),Bb="VisuallyHidden",Ku=S.forwardRef((e,t)=>w.jsx(xe.span,{...e,ref:t,style:{...Gb,...e.style}}));Ku.displayName=Bb;var Vb=Ku,[kr,$S]=Ut("Tooltip",[Or]),Nr=Or(),qu="TooltipProvider",Jb=700,ss="tooltip.open",[Xb,as]=kr(qu),zu=e=>{const{__scopeTooltip:t,delayDuration:n=Jb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,a=S.useRef(!0),i=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),w.jsx(Xb,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:S.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:s})};zu.displayName=qu;var In="Tooltip",[Yb,Ir]=kr(In),Gu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,c=as(In,e.__scopeTooltip),u=Nr(t),[l,d]=S.useState(null),h=mt(),m=S.useRef(0),_=a??c.disableHoverableContent,y=i??c.delayDuration,g=S.useRef(!1),[p,b]=Pn({prop:r,defaultProp:o??!1,onChange:v=>{v?(c.onOpen(),document.dispatchEvent(new CustomEvent(ss))):c.onClose(),s==null||s(v)},caller:In}),f=S.useMemo(()=>p?g.current?"delayed-open":"instant-open":"closed",[p]),A=S.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,b(!0)},[b]),E=S.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),R=S.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,b(!0),m.current=0},y)},[y,b]);return S.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(os,{...u,children:w.jsx(Yb,{scope:t,contentId:h,open:p,stateAttribute:f,trigger:l,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayedRef.current?R():A()},[c.isOpenDelayedRef,R,A]),onTriggerLeave:S.useCallback(()=>{_?E():(window.clearTimeout(m.current),m.current=0)},[E,_]),onOpen:A,onClose:E,disableHoverableContent:_,children:n})})};Gu.displayName=In;var is="TooltipTrigger",Bu=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ir(is,n),s=as(is,n),a=Nr(n),i=S.useRef(null),c=Te(t,i,o.onTriggerChange),u=S.useRef(!1),l=S.useRef(!1),d=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx($u,{asChild:!0,...a,children:w.jsx(xe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:Z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!l.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),l.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),l.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});Bu.displayName=is;var Zb="TooltipPortal",[WS,Qb]=kr(Zb,{forceMount:void 0}),hn="TooltipContent",Vu=S.forwardRef((e,t)=>{const n=Qb(hn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,a=Ir(hn,e.__scopeTooltip);return w.jsx(gt,{present:r||a.open,children:a.disableHoverableContent?w.jsx(Ju,{side:o,...s,ref:t}):w.jsx(ey,{side:o,...s,ref:t})})}),ey=S.forwardRef((e,t)=>{const n=Ir(hn,e.__scopeTooltip),r=as(hn,e.__scopeTooltip),o=S.useRef(null),s=Te(t,o),[a,i]=S.useState(null),{trigger:c,onClose:u}=n,l=o.current,{onPointerInTransitChange:d}=r,h=S.useCallback(()=>{i(null),d(!1)},[d]),m=S.useCallback((_,y)=>{const g=_.currentTarget,p={x:_.clientX,y:_.clientY},b=sy(p,g.getBoundingClientRect()),f=ay(p,b),A=iy(y.getBoundingClientRect()),E=uy([...f,...A]);i(E),d(!0)},[d]);return S.useEffect(()=>()=>h(),[h]),S.useEffect(()=>{if(c&&l){const _=g=>m(g,l),y=g=>m(g,c);return c.addEventListener("pointerleave",_),l.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",_),l.removeEventListener("pointerleave",y)}}},[c,l,m,h]),S.useEffect(()=>{if(a){const _=y=>{const g=y.target,p={x:y.clientX,y:y.clientY},b=(c==null?void 0:c.contains(g))||(l==null?void 0:l.contains(g)),f=!cy(p,a);b?h():f&&(h(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[c,l,a,u,h]),w.jsx(Ju,{...e,ref:s})}),[ty,ny]=kr(In,{isInside:!1}),ry=up("TooltipContent"),Ju=S.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,c=Ir(hn,n),u=Nr(n),{onClose:l}=c;return S.useEffect(()=>(document.addEventListener(ss,l),()=>document.removeEventListener(ss,l)),[l]),S.useEffect(()=>{if(c.trigger){const d=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&l()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,l]),w.jsx(lr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:l,children:w.jsxs(Wu,{"data-state":c.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(ry,{children:r}),w.jsx(ty,{scope:n,isInside:!0,children:w.jsx(Vb,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Vu.displayName=hn;var Xu="TooltipArrow",oy=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Nr(n);return ny(Xu,n).isInside?null:w.jsx(Fu,{...o,...r,ref:t})});oy.displayName=Xu;function sy(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ay(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function iy(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function cy(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],u=i.x,l=i.y,d=c.x,h=c.y;l>r!=h>r&&n<(d-u)*(r-l)/(h-l)+u&&(o=!o)}return o}function uy(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ly(t)}function ly(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var dy=zu,fy=Gu,hy=Bu,Yu=Vu;const cs=dy,us=fy,ls=hy,Dr=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(Yu,{ref:r,sideOffset:t,className:W("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Dr.displayName=Yu.displayName;const py="sidebar_state",my=60*60*24*7,gy="16rem",by="18rem",yy="3rem",wy="b",Zu=S.createContext(null);function Dn(){const e=S.useContext(Zu);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Qu({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...a}){const i=mc(),[c,u]=S.useState(!1),[l,d]=S.useState(e),h=t??l,m=S.useCallback(p=>{const b=typeof p=="function"?p(h):p;n?n(b):d(b),document.cookie=`${py}=${b}; path=/; max-age=${my}`},[n,h]),_=S.useCallback(()=>i?u(p=>!p):m(p=>!p),[i,m,u]);S.useEffect(()=>{const p=b=>{b.key===wy&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),_())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[_]);const y=h?"expanded":"collapsed",g=S.useMemo(()=>({state:y,open:h,setOpen:m,isMobile:i,openMobile:c,setOpenMobile:u,toggleSidebar:_}),[y,h,m,i,c,u,_]);return w.jsx(Zu.Provider,{value:g,children:w.jsx(cs,{delayDuration:0,children:w.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":gy,"--sidebar-width-icon":yy,...o},className:W("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...a,children:s})})})}function el({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...s}){const{isMobile:a,state:i,openMobile:c,setOpenMobile:u}=Dn();return n==="none"?w.jsx("div",{"data-slot":"sidebar",className:W("bg-white text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...s,children:o}):a?w.jsx(uu,{open:c,onOpenChange:u,...s,children:w.jsxs(Uo,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-white text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":by},side:e,children:[w.jsxs($o,{className:"sr-only",children:[w.jsx(Wo,{children:"Sidebar"}),w.jsx(Fo,{children:"Displays the mobile sidebar."})]}),w.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):w.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":i,"data-collapsible":i==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[w.jsx("div",{"data-slot":"sidebar-gap",className:W("relative w-(--sidebar-width) bg-white transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),w.jsx("div",{"data-slot":"sidebar-container",className:W("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:w.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-white group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col px-1 py-2 group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function tl({className:e,onClick:t,...n}){const{toggleSidebar:r}=Dn();return w.jsxs(ur,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:W("size-7",e),onClick:o=>{t==null||t(o),r()},...n,children:[w.jsx(lm,{}),w.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function nl({className:e,...t}){const{toggleSidebar:n}=Dn();return w.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:W("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function rl({className:e,...t}){return w.jsx("main",{"data-slot":"sidebar-inset",className:W("bg-white relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function vy({className:e,...t}){return w.jsx(_o,{"data-slot":"sidebar-input","data-sidebar":"input",className:W("bg-background h-8 w-full shadow-none",e),...t})}function ol({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:W("flex flex-col gap-2 p-2",e),...t})}function Ey({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:W("flex flex-col gap-2 p-2",e),...t})}function _y({className:e,...t}){return w.jsx(ir,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:W("bg-sidebar-border mx-2 w-auto",e),...t})}function sl({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:W("flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function al({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:W("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function Sy({className:e,asChild:t=!1,...n}){const r=t?en:"div";return w.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:W("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})}function xy({className:e,asChild:t=!1,...n}){const r=t?en:"button";return w.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:W("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...n})}function il({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:W("w-full text-sm",e),...t})}function Ay({className:e,...t}){return w.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:W("flex w-full min-w-0 flex-col gap-1",e),...t})}function Ry({className:e,...t}){return w.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:W("group/menu-item relative",e),...t})}const Cy=Eo("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ty({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...a}){const i=e?en:"button",{isMobile:c,state:u}=Dn(),l=w.jsx(i,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:W(Cy({variant:n,size:r}),s),...a});return o?(typeof o=="string"&&(o={children:o}),w.jsxs(us,{children:[w.jsx(ls,{asChild:!0,children:l}),w.jsx(Dr,{side:"right",align:"center",hidden:u!=="collapsed"||c,...o})]})):l}function Py({className:e,asChild:t=!1,showOnHover:n=!1,...r}){const o=t?en:"button";return w.jsx(o,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:W("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function Oy({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:W("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function ky({className:e,showIcon:t=!1,...n}){const r=S.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return w.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:W("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&w.jsx(Ko,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),w.jsx(Ko,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function cl({className:e,...t}){return w.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:W("border-sidebar-border mx-3 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function ul({className:e,...t}){return w.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:W("group/menu-sub-item relative",e),...t})}function ll({asChild:e=!1,size:t="md",isActive:n=!1,className:r,...o}){const s=e?en:"a";return w.jsx(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:W("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})}var Mr={exports:{}},ds={};/**
166
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ng="DialogDescriptionWarning",Ig=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ru(Ng).contentName}}.`;return S.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Dg=Kc,Mg=zc,Lg=Bc,ou=Vc,su=Jc,au=Yc,iu=Qc,cu=tu;const uu=Dg,jg=Mg,Hg=cu,lu=Lg,Ho=S.forwardRef(({className:e,...t},n)=>w.jsx(ou,{className:F("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Ho.displayName=ou.displayName;const Ug=Eo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Uo=S.forwardRef(({side:e="right",className:t,children:n,...r},o)=>w.jsxs(lu,{children:[w.jsx(Ho,{}),w.jsxs(su,{ref:o,className:F(Ug({side:e}),t),...r,children:[n,w.jsxs(cu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[w.jsx(hm,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Uo.displayName=su.displayName;const $o=({className:e,...t})=>w.jsx("div",{className:F("flex flex-col space-y-2 text-center sm:text-left",e),...t});$o.displayName="SheetHeader";const du=({className:e,...t})=>w.jsx("div",{className:F("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});du.displayName="SheetFooter";const Wo=S.forwardRef(({className:e,...t},n)=>w.jsx(au,{ref:n,className:F("text-lg font-semibold text-foreground",e),...t}));Wo.displayName=au.displayName;const Fo=S.forwardRef(({className:e,...t},n)=>w.jsx(iu,{ref:n,className:F("text-sm text-muted-foreground",e),...t}));Fo.displayName=iu.displayName;function Ko({className:e,...t}){return w.jsx("div",{className:F("animate-pulse rounded-md bg-muted",e),...t})}const $g=["top","right","bottom","left"],Rt=Math.min,ze=Math.max,Er=Math.round,_r=Math.floor,at=e=>({x:e,y:e}),Wg={left:"right",right:"left",bottom:"top",top:"bottom"},Fg={start:"end",end:"start"};function qo(e,t,n){return ze(e,Rt(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function yt(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function Go(e){return e==="y"?"height":"width"}function it(e){return["top","bottom"].includes(yt(e))?"y":"x"}function Bo(e){return zo(it(e))}function Kg(e,t,n){n===void 0&&(n=!1);const r=un(e),o=Bo(e),s=Go(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Sr(a)),[a,Sr(a)]}function qg(e){const t=Sr(e);return[Vo(e),t,Vo(t)]}function Vo(e){return e.replace(/start|end/g,t=>Fg[t])}function zg(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:a;default:return[]}}function Gg(e,t,n,r){const o=un(e);let s=zg(yt(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(Vo)))),s}function Sr(e){return e.replace(/left|right|bottom|top/g,t=>Wg[t])}function Bg(e){return{top:0,right:0,bottom:0,left:0,...e}}function fu(e){return typeof e!="number"?Bg(e):{top:e,right:e,bottom:e,left:e}}function xr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function hu(e,t,n){let{reference:r,floating:o}=e;const s=it(t),a=Bo(t),i=Go(a),c=yt(t),u=s==="y",l=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[i]/2-o[i]/2;let m;switch(c){case"top":m={x:l,y:r.y-o.height};break;case"bottom":m={x:l,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(un(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const Vg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=hu(u,r,c),h=r,m={},_=0;for(let y=0;y<i.length;y++){const{name:g,fn:p}=i[y],{x:b,y:f,data:A,reset:E}=await p({x:l,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});l=b??l,d=f??d,m={...m,[g]:{...m[g],...A}},E&&_<=50&&(_++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:l,y:d}=hu(u,h,c)),y=-1)}return{x:l,y:d,placement:h,strategy:o,middlewareData:m}};async function On(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:i,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=bt(t,e),_=fu(m),g=i[h?d==="floating"?"reference":"floating":d],p=xr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:l,strategy:c})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,f=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),A=await(s.isElement==null?void 0:s.isElement(f))?await(s.getScale==null?void 0:s.getScale(f))||{x:1,y:1}:{x:1,y:1},E=xr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:b,offsetParent:f,strategy:c}):b);return{top:(p.top-E.top+_.top)/A.y,bottom:(E.bottom-p.bottom+_.bottom)/A.y,left:(p.left-E.left+_.left)/A.x,right:(E.right-p.right+_.right)/A.x}}const Jg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:i,middlewareData:c}=t,{element:u,padding:l=0}=bt(e,t)||{};if(u==null)return{};const d=fu(l),h={x:n,y:r},m=Bo(o),_=Go(m),y=await a.getDimensions(u),g=m==="y",p=g?"top":"left",b=g?"bottom":"right",f=g?"clientHeight":"clientWidth",A=s.reference[_]+s.reference[m]-h[m]-s.floating[_],E=h[m]-s.reference[m],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let v=R?R[f]:0;(!v||!await(a.isElement==null?void 0:a.isElement(R)))&&(v=i.floating[f]||s.floating[_]);const x=A/2-E/2,C=v/2-y[_]/2-1,D=Rt(d[p],C),I=Rt(d[b],C),P=D,U=v-y[_]-I,G=v/2-y[_]/2+x,oe=qo(P,G,U),V=!c.arrow&&un(o)!=null&&G!==oe&&s.reference[_]/2-(G<P?D:I)-y[_]/2<0,Y=V?G<P?G-P:G-U:0;return{[m]:h[m]+Y,data:{[m]:oe,centerOffset:G-oe-Y,...V&&{alignmentOffset:Y}},reset:V}}}),Xg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:i,platform:c,elements:u}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:y=!0,...g}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=yt(o),b=it(i),f=yt(i)===i,A=await(c.isRTL==null?void 0:c.isRTL(u.floating)),E=h||(f||!y?[Sr(i)]:qg(i)),R=_!=="none";!h&&R&&E.push(...Gg(i,y,_,A));const v=[i,...E],x=await On(t,g),C=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&C.push(x[p]),d){const G=Kg(o,a,A);C.push(x[G[0]],x[G[1]])}if(D=[...D,{placement:o,overflows:C}],!C.every(G=>G<=0)){var I,P;const G=(((I=s.flip)==null?void 0:I.index)||0)+1,oe=v[G];if(oe&&(!(d==="alignment"?b!==it(oe):!1)||D.every(O=>O.overflows[0]>0&&it(O.placement)===b)))return{data:{index:G,overflows:D},reset:{placement:oe}};let V=(P=D.filter(Y=>Y.overflows[0]<=0).sort((Y,O)=>Y.overflows[1]-O.overflows[1])[0])==null?void 0:P.placement;if(!V)switch(m){case"bestFit":{var U;const Y=(U=D.filter(O=>{if(R){const j=it(O.placement);return j===b||j==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(j=>j>0).reduce((j,T)=>j+T,0)]).sort((O,j)=>O[1]-j[1])[0])==null?void 0:U[0];Y&&(V=Y);break}case"initialPlacement":V=i;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function pu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mu(e){return $g.some(t=>e[t]>=0)}const Yg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await On(t,{...o,elementContext:"reference"}),a=pu(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:mu(a)}}}case"escaped":{const s=await On(t,{...o,altBoundary:!0}),a=pu(s,n.floating);return{data:{escapedOffsets:a,escaped:mu(a)}}}default:return{}}}}};async function Zg(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=yt(n),i=un(n),c=it(n)==="y",u=["left","top"].includes(a)?-1:1,l=s&&c?-1:1,d=bt(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof _=="number"&&(m=i==="end"?_*-1:_),c?{x:m*l,y:h*u}:{x:h*u,y:m*l}}const Qg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:i}=t,c=await Zg(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:a}}}}},eb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x:p,y:b}=g;return{x:p,y:b}}},...c}=bt(e,t),u={x:n,y:r},l=await On(t,c),d=it(yt(o)),h=zo(d);let m=u[h],_=u[d];if(s){const g=h==="y"?"top":"left",p=h==="y"?"bottom":"right",b=m+l[g],f=m-l[p];m=qo(b,m,f)}if(a){const g=d==="y"?"top":"left",p=d==="y"?"bottom":"right",b=_+l[g],f=_-l[p];_=qo(b,_,f)}const y=i.fn({...t,[h]:m,[d]:_});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:s,[d]:a}}}}}},tb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:c=!0,crossAxis:u=!0}=bt(e,t),l={x:n,y:r},d=it(o),h=zo(d);let m=l[h],_=l[d];const y=bt(i,t),g=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const f=h==="y"?"height":"width",A=s.reference[h]-s.floating[f]+g.mainAxis,E=s.reference[h]+s.reference[f]-g.mainAxis;m<A?m=A:m>E&&(m=E)}if(u){var p,b;const f=h==="y"?"width":"height",A=["top","left"].includes(yt(o)),E=s.reference[d]-s.floating[f]+(A&&((p=a.offset)==null?void 0:p[d])||0)+(A?0:g.crossAxis),R=s.reference[d]+s.reference[f]+(A?0:((b=a.offset)==null?void 0:b[d])||0)-(A?g.crossAxis:0);_<E?_=E:_>R&&(_=R)}return{[h]:m,[d]:_}}}},nb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:a,elements:i}=t,{apply:c=()=>{},...u}=bt(e,t),l=await On(t,u),d=yt(o),h=un(o),m=it(o)==="y",{width:_,height:y}=s.floating;let g,p;d==="top"||d==="bottom"?(g=d,p=h===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(p=d,g=h==="end"?"top":"bottom");const b=y-l.top-l.bottom,f=_-l.left-l.right,A=Rt(y-l[g],b),E=Rt(_-l[p],f),R=!t.middlewareData.shift;let v=A,x=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(x=f),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(v=b),R&&!h){const D=ze(l.left,0),I=ze(l.right,0),P=ze(l.top,0),U=ze(l.bottom,0);m?x=_-2*(D!==0||I!==0?D+I:ze(l.left,l.right)):v=y-2*(P!==0||U!==0?P+U:ze(l.top,l.bottom))}await c({...t,availableWidth:x,availableHeight:v});const C=await a.getDimensions(i.floating);return _!==C.width||y!==C.height?{reset:{rects:!0}}:{}}}};function Ar(){return typeof window<"u"}function ln(e){return gu(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ct(e){var t;return(t=(gu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gu(e){return Ar()?e instanceof Node||e instanceof Ge(e).Node:!1}function tt(e){return Ar()?e instanceof Element||e instanceof Ge(e).Element:!1}function ut(e){return Ar()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function bu(e){return!Ar()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}function kn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function rb(e){return["table","td","th"].includes(ln(e))}function Rr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Jo(e){const t=Xo(),n=tt(e)?nt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ob(e){let t=Ct(e);for(;ut(t)&&!dn(t);){if(Jo(t))return t;if(Rr(t))return null;t=Ct(t)}return null}function Xo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dn(e){return["html","body","#document"].includes(ln(e))}function nt(e){return Ge(e).getComputedStyle(e)}function Cr(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bu(e)&&e.host||ct(e);return bu(t)?t.host:t}function yu(e){const t=Ct(e);return dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:ut(t)&&kn(t)?t:yu(t)}function Nn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=yu(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=Ge(o);if(s){const i=Yo(a);return t.concat(a,a.visualViewport||[],kn(o)?o:[],i&&n?Nn(i):[])}return t.concat(o,Nn(o,[],n))}function Yo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wu(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ut(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,i=Er(n)!==s||Er(r)!==a;return i&&(n=s,r=a),{width:n,height:r,$:i}}function Zo(e){return tt(e)?e:e.contextElement}function fn(e){const t=Zo(e);if(!ut(t))return at(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=wu(t);let a=(s?Er(n.width):n.width)/r,i=(s?Er(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const sb=at(0);function vu(e){const t=Ge(e);return!Xo()||!t.visualViewport?sb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ab(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ge(e)?!1:t}function Wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zo(e);let a=at(1);t&&(r?tt(r)&&(a=fn(r)):a=fn(e));const i=ab(s,n,r)?vu(s):at(0);let c=(o.left+i.x)/a.x,u=(o.top+i.y)/a.y,l=o.width/a.x,d=o.height/a.y;if(s){const h=Ge(s),m=r&&tt(r)?Ge(r):r;let _=h,y=Yo(_);for(;y&&r&&m!==_;){const g=fn(y),p=y.getBoundingClientRect(),b=nt(y),f=p.left+(y.clientLeft+parseFloat(b.paddingLeft))*g.x,A=p.top+(y.clientTop+parseFloat(b.paddingTop))*g.y;c*=g.x,u*=g.y,l*=g.x,d*=g.y,c+=f,u+=A,_=Ge(y),y=Yo(_)}}return xr({width:l,height:d,x:c,y:u})}function Qo(e,t){const n=Cr(e).scrollLeft;return t?t.left+n:Wt(ct(e)).left+n}function Eu(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Qo(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function ib(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=ct(r),i=t?Rr(t.floating):!1;if(r===a||i&&s)return n;let c={scrollLeft:0,scrollTop:0},u=at(1);const l=at(0),d=ut(r);if((d||!d&&!s)&&((ln(r)!=="body"||kn(a))&&(c=Cr(r)),ut(r))){const m=Wt(r);u=fn(r),l.x=m.x+r.clientLeft,l.y=m.y+r.clientTop}const h=a&&!d&&!s?Eu(a,c,!0):at(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+h.x,y:n.y*u.y-c.scrollTop*u.y+l.y+h.y}}function cb(e){return Array.from(e.getClientRects())}function ub(e){const t=ct(e),n=Cr(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Qo(e);const i=-n.scrollTop;return nt(r).direction==="rtl"&&(a+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:a,y:i}}function lb(e,t){const n=Ge(e),r=ct(e),o=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,i=0,c=0;if(o){s=o.width,a=o.height;const u=Xo();(!u||u&&t==="fixed")&&(i=o.offsetLeft,c=o.offsetTop)}return{width:s,height:a,x:i,y:c}}function db(e,t){const n=Wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ut(e)?fn(e):at(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:a,height:i,x:c,y:u}}function _u(e,t,n){let r;if(t==="viewport")r=lb(e,n);else if(t==="document")r=ub(ct(e));else if(tt(t))r=db(t,n);else{const o=vu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xr(r)}function Su(e,t){const n=Ct(e);return n===t||!tt(n)||dn(n)?!1:nt(n).position==="fixed"||Su(n,t)}function fb(e,t){const n=t.get(e);if(n)return n;let r=Nn(e,[],!1).filter(i=>tt(i)&&ln(i)!=="body"),o=null;const s=nt(e).position==="fixed";let a=s?Ct(e):e;for(;tt(a)&&!dn(a);){const i=nt(a),c=Jo(a);!c&&i.position==="fixed"&&(o=null),(s?!c&&!o:!c&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||kn(a)&&!c&&Su(e,a))?r=r.filter(l=>l!==a):o=i,a=Ct(a)}return t.set(e,r),r}function hb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Rr(t)?[]:fb(t,this._c):[].concat(n),r],i=a[0],c=a.reduce((u,l)=>{const d=_u(t,l,o);return u.top=ze(d.top,u.top),u.right=Rt(d.right,u.right),u.bottom=Rt(d.bottom,u.bottom),u.left=ze(d.left,u.left),u},_u(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function pb(e){const{width:t,height:n}=wu(e);return{width:t,height:n}}function mb(e,t,n){const r=ut(t),o=ct(t),s=n==="fixed",a=Wt(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const c=at(0);function u(){c.x=Qo(o)}if(r||!r&&!s)if((ln(t)!=="body"||kn(o))&&(i=Cr(t)),r){const m=Wt(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&u();s&&!r&&o&&u();const l=o&&!r&&!s?Eu(o,i):at(0),d=a.left+i.scrollLeft-c.x-l.x,h=a.top+i.scrollTop-c.y-l.y;return{x:d,y:h,width:a.width,height:a.height}}function es(e){return nt(e).position==="static"}function xu(e,t){if(!ut(e)||nt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ct(e)===n&&(n=n.ownerDocument.body),n}function Au(e,t){const n=Ge(e);if(Rr(e))return n;if(!ut(e)){let o=Ct(e);for(;o&&!dn(o);){if(tt(o)&&!es(o))return o;o=Ct(o)}return n}let r=xu(e,t);for(;r&&rb(r)&&es(r);)r=xu(r,t);return r&&dn(r)&&es(r)&&!Jo(r)?n:r||ob(e)||n}const gb=async function(e){const t=this.getOffsetParent||Au,n=this.getDimensions,r=await n(e.floating);return{reference:mb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bb(e){return nt(e).direction==="rtl"}const yb={convertOffsetParentRelativeRectToViewportRelativeRect:ib,getDocumentElement:ct,getClippingRect:hb,getOffsetParent:Au,getElementRects:gb,getClientRects:cb,getDimensions:pb,getScale:fn,isElement:tt,isRTL:bb};function Ru(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wb(e,t){let n=null,r;const o=ct(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function a(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:l,top:d,width:h,height:m}=u;if(i||t(),!h||!m)return;const _=_r(d),y=_r(o.clientWidth-(l+h)),g=_r(o.clientHeight-(d+m)),p=_r(l),f={rootMargin:-_+"px "+-y+"px "+-g+"px "+-p+"px",threshold:ze(0,Rt(1,c))||1};let A=!0;function E(R){const v=R[0].intersectionRatio;if(v!==c){if(!A)return a();v?a(!1,v):r=setTimeout(()=>{a(!1,1e-7)},1e3)}v===1&&!Ru(u,e.getBoundingClientRect())&&a(),A=!1}try{n=new IntersectionObserver(E,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,f)}n.observe(e)}return a(!0),s}function vb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Zo(e),l=o||s?[...u?Nn(u):[],...Nn(t)]:[];l.forEach(p=>{o&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=u&&i?wb(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(p=>{let[b]=p;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var f;(f=m)==null||f.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let _,y=c?Wt(e):null;c&&g();function g(){const p=Wt(e);y&&!Ru(y,p)&&n(),y=p,_=requestAnimationFrame(g)}return n(),()=>{var p;l.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(_)}}const Eb=Qg,_b=eb,Sb=Xg,xb=nb,Ab=Yg,Cu=Jg,Rb=tb,Cb=(e,t,n)=>{const r=new Map,o={platform:yb,...n},s={...o.platform,_c:r};return Vg(e,t,{...o,platform:s})};var Tb=typeof document<"u",Pb=function(){},Tr=Tb?W.useLayoutEffect:Pb;function Pr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Pr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Tu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pu(e,t){const n=Tu(e);return Math.round(t*n)/n}function ts(e){const t=S.useRef(e);return Tr(()=>{t.current=e}),t}function Ob(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[l,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=S.useState(r);Pr(h,r)||m(r);const[_,y]=S.useState(null),[g,p]=S.useState(null),b=S.useCallback(O=>{O!==R.current&&(R.current=O,y(O))},[]),f=S.useCallback(O=>{O!==v.current&&(v.current=O,p(O))},[]),A=s||_,E=a||g,R=S.useRef(null),v=S.useRef(null),x=S.useRef(l),C=c!=null,D=ts(c),I=ts(o),P=ts(u),U=S.useCallback(()=>{if(!R.current||!v.current)return;const O={placement:t,strategy:n,middleware:h};I.current&&(O.platform=I.current),Cb(R.current,v.current,O).then(j=>{const T={...j,isPositioned:P.current!==!1};G.current&&!Pr(x.current,T)&&(x.current=T,Mi.flushSync(()=>{d(T)}))})},[h,t,n,I,P]);Tr(()=>{u===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const G=S.useRef(!1);Tr(()=>(G.current=!0,()=>{G.current=!1}),[]),Tr(()=>{if(A&&(R.current=A),E&&(v.current=E),A&&E){if(D.current)return D.current(A,E,U);U()}},[A,E,U,D,C]);const oe=S.useMemo(()=>({reference:R,floating:v,setReference:b,setFloating:f}),[b,f]),V=S.useMemo(()=>({reference:A,floating:E}),[A,E]),Y=S.useMemo(()=>{const O={position:n,left:0,top:0};if(!V.floating)return O;const j=Pu(V.floating,l.x),T=Pu(V.floating,l.y);return i?{...O,transform:"translate("+j+"px, "+T+"px)",...Tu(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:T}},[n,i,V.floating,l.x,l.y]);return S.useMemo(()=>({...l,update:U,refs:oe,elements:V,floatingStyles:Y}),[l,U,oe,V,Y])}const kb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Cu({element:r.current,padding:o}).fn(n):{}:r?Cu({element:r,padding:o}).fn(n):{}}}},Nb=(e,t)=>({...Eb(e),options:[e,t]}),Ib=(e,t)=>({..._b(e),options:[e,t]}),Db=(e,t)=>({...Rb(e),options:[e,t]}),Mb=(e,t)=>({...Sb(e),options:[e,t]}),Lb=(e,t)=>({...xb(e),options:[e,t]}),jb=(e,t)=>({...Ab(e),options:[e,t]}),Hb=(e,t)=>({...kb(e),options:[e,t]});var Ub="Arrow",Ou=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return w.jsx(xe.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ou.displayName=Ub;var $b=Ou;function Wb(e){const[t,n]=S.useState(void 0);return xt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,i;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,i=u.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ns="Popper",[ku,Or]=Ut(ns),[Fb,Nu]=ku(ns),Iu=e=>{const{__scopePopper:t,children:n}=e,[r,o]=S.useState(null);return w.jsx(Fb,{scope:t,anchor:r,onAnchorChange:o,children:n})};Iu.displayName=ns;var Du="PopperAnchor",Mu=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Nu(Du,n),a=S.useRef(null),i=Te(t,a);return S.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.jsx(xe.div,{...o,ref:i})});Mu.displayName=Du;var rs="PopperContent",[Kb,qb]=ku(rs),Lu=S.forwardRef((e,t)=>{var te,le,ue,ye,k,N;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:l=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:_,...y}=e,g=Nu(rs,n),[p,b]=S.useState(null),f=Te(t,M=>b(M)),[A,E]=S.useState(null),R=Wb(A),v=(R==null?void 0:R.width)??0,x=(R==null?void 0:R.height)??0,C=r+(s!=="center"?"-"+s:""),D=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},I=Array.isArray(u)?u:[u],P=I.length>0,U={padding:D,boundary:I.filter(Gb),altBoundary:P},{refs:G,floatingStyles:oe,placement:V,isPositioned:Y,middlewareData:O}=Ob({strategy:"fixed",placement:C,whileElementsMounted:(...M)=>vb(...M,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[Nb({mainAxis:o+x,alignmentAxis:a}),c&&Ib({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Db():void 0,...U}),c&&Mb({...U}),Lb({...U,apply:({elements:M,rects:z,availableWidth:ne,availableHeight:$})=>{const{width:_e,height:Ce}=z.reference,pe=M.floating.style;pe.setProperty("--radix-popper-available-width",`${ne}px`),pe.setProperty("--radix-popper-available-height",`${$}px`),pe.setProperty("--radix-popper-anchor-width",`${_e}px`),pe.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),A&&Hb({element:A,padding:i}),Bb({arrowWidth:v,arrowHeight:x}),h&&jb({strategy:"referenceHidden",...U})]}),[j,T]=Uu(V),H=ot(_);xt(()=>{Y&&(H==null||H())},[Y,H]);const J=(te=O.arrow)==null?void 0:te.x,X=(le=O.arrow)==null?void 0:le.y,se=((ue=O.arrow)==null?void 0:ue.centerOffset)!==0,[fe,we]=S.useState();return xt(()=>{p&&we(window.getComputedStyle(p).zIndex)},[p]),w.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:Y?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(ye=O.transformOrigin)==null?void 0:ye.x,(k=O.transformOrigin)==null?void 0:k.y].join(" "),...((N=O.hide)==null?void 0:N.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(Kb,{scope:n,placedSide:j,onArrowChange:E,arrowX:J,arrowY:X,shouldHideArrow:se,children:w.jsx(xe.div,{"data-side":j,"data-align":T,...y,ref:f,style:{...y.style,animation:Y?void 0:"none"}})})})});Lu.displayName=rs;var ju="PopperArrow",zb={top:"bottom",right:"left",bottom:"top",left:"right"},Hu=S.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=qb(ju,r),a=zb[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]: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:w.jsx($b,{...o,ref:n,style:{...o.style,display:"block"}})})});Hu.displayName=ju;function Gb(e){return e!==null}var Bb=e=>({name:"transformOrigin",options:e,fn(t){var g,p,b;const{placement:n,rects:r,middlewareData:o}=t,a=((g=o.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,l]=Uu(n),d={start:"0%",center:"50%",end:"100%"}[l],h=(((p=o.arrow)==null?void 0:p.x)??0)+i/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let _="",y="";return u==="bottom"?(_=a?d:`${h}px`,y=`${-c}px`):u==="top"?(_=a?d:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(_=`${-c}px`,y=a?d:`${m}px`):u==="left"&&(_=`${r.floating.width+c}px`,y=a?d:`${m}px`),{data:{x:_,y}}}});function Uu(e){const[t,n="center"]=e.split("-");return[t,n]}var os=Iu,$u=Mu,Wu=Lu,Fu=Hu,Vb=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"}),Jb="VisuallyHidden",Ku=S.forwardRef((e,t)=>w.jsx(xe.span,{...e,ref:t,style:{...Vb,...e.style}}));Ku.displayName=Jb;var Xb=Ku,[kr,F2]=Ut("Tooltip",[Or]),Nr=Or(),qu="TooltipProvider",Yb=700,ss="tooltip.open",[Zb,as]=kr(qu),zu=e=>{const{__scopeTooltip:t,delayDuration:n=Yb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,a=S.useRef(!0),i=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),w.jsx(Zb,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:i,onPointerInTransitChange:S.useCallback(u=>{i.current=u},[]),disableHoverableContent:o,children:s})};zu.displayName=qu;var In="Tooltip",[Qb,Ir]=kr(In),Gu=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,c=as(In,e.__scopeTooltip),u=Nr(t),[l,d]=S.useState(null),h=mt(),m=S.useRef(0),_=a??c.disableHoverableContent,y=i??c.delayDuration,g=S.useRef(!1),[p,b]=Pn({prop:r,defaultProp:o??!1,onChange:v=>{v?(c.onOpen(),document.dispatchEvent(new CustomEvent(ss))):c.onClose(),s==null||s(v)},caller:In}),f=S.useMemo(()=>p?g.current?"delayed-open":"instant-open":"closed",[p]),A=S.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,b(!0)},[b]),E=S.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),R=S.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,b(!0),m.current=0},y)},[y,b]);return S.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),w.jsx(os,{...u,children:w.jsx(Qb,{scope:t,contentId:h,open:p,stateAttribute:f,trigger:l,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{c.isOpenDelayedRef.current?R():A()},[c.isOpenDelayedRef,R,A]),onTriggerLeave:S.useCallback(()=>{_?E():(window.clearTimeout(m.current),m.current=0)},[E,_]),onOpen:A,onClose:E,disableHoverableContent:_,children:n})})};Gu.displayName=In;var is="TooltipTrigger",Bu=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ir(is,n),s=as(is,n),a=Nr(n),i=S.useRef(null),c=Te(t,i,o.onTriggerChange),u=S.useRef(!1),l=S.useRef(!1),d=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx($u,{asChild:!0,...a,children:w.jsx(xe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:Z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!l.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),l.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),l.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});Bu.displayName=is;var ey="TooltipPortal",[K2,ty]=kr(ey,{forceMount:void 0}),hn="TooltipContent",Vu=S.forwardRef((e,t)=>{const n=ty(hn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,a=Ir(hn,e.__scopeTooltip);return w.jsx(gt,{present:r||a.open,children:a.disableHoverableContent?w.jsx(Ju,{side:o,...s,ref:t}):w.jsx(ny,{side:o,...s,ref:t})})}),ny=S.forwardRef((e,t)=>{const n=Ir(hn,e.__scopeTooltip),r=as(hn,e.__scopeTooltip),o=S.useRef(null),s=Te(t,o),[a,i]=S.useState(null),{trigger:c,onClose:u}=n,l=o.current,{onPointerInTransitChange:d}=r,h=S.useCallback(()=>{i(null),d(!1)},[d]),m=S.useCallback((_,y)=>{const g=_.currentTarget,p={x:_.clientX,y:_.clientY},b=iy(p,g.getBoundingClientRect()),f=cy(p,b),A=uy(y.getBoundingClientRect()),E=dy([...f,...A]);i(E),d(!0)},[d]);return S.useEffect(()=>()=>h(),[h]),S.useEffect(()=>{if(c&&l){const _=g=>m(g,l),y=g=>m(g,c);return c.addEventListener("pointerleave",_),l.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",_),l.removeEventListener("pointerleave",y)}}},[c,l,m,h]),S.useEffect(()=>{if(a){const _=y=>{const g=y.target,p={x:y.clientX,y:y.clientY},b=(c==null?void 0:c.contains(g))||(l==null?void 0:l.contains(g)),f=!ly(p,a);b?h():f&&(h(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[c,l,a,u,h]),w.jsx(Ju,{...e,ref:s})}),[ry,oy]=kr(In,{isInside:!1}),sy=dp("TooltipContent"),Ju=S.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,c=Ir(hn,n),u=Nr(n),{onClose:l}=c;return S.useEffect(()=>(document.addEventListener(ss,l),()=>document.removeEventListener(ss,l)),[l]),S.useEffect(()=>{if(c.trigger){const d=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&l()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,l]),w.jsx(lr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:l,children:w.jsxs(Wu,{"data-state":c.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(sy,{children:r}),w.jsx(ry,{scope:n,isInside:!0,children:w.jsx(Xb,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Vu.displayName=hn;var Xu="TooltipArrow",ay=S.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Nr(n);return oy(Xu,n).isInside?null:w.jsx(Fu,{...o,...r,ref:t})});ay.displayName=Xu;function iy(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function cy(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function uy(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ly(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],u=i.x,l=i.y,d=c.x,h=c.y;l>r!=h>r&&n<(d-u)*(r-l)/(h-l)+u&&(o=!o)}return o}function dy(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),fy(t)}function fy(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var hy=zu,py=Gu,my=Bu,Yu=Vu;const cs=hy,us=py,ls=my,Dr=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(Yu,{ref:r,sideOffset:t,className:F("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Dr.displayName=Yu.displayName;const gy="sidebar_state",by=60*60*24*7,yy="16rem",wy="18rem",vy="3rem",Ey="b",Zu=S.createContext(null);function Dn(){const e=S.useContext(Zu);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Qu({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...a}){const i=mc(),[c,u]=S.useState(!1),[l,d]=S.useState(e),h=t??l,m=S.useCallback(p=>{const b=typeof p=="function"?p(h):p;n?n(b):d(b),document.cookie=`${gy}=${b}; path=/; max-age=${by}`},[n,h]),_=S.useCallback(()=>i?u(p=>!p):m(p=>!p),[i,m,u]);S.useEffect(()=>{const p=b=>{b.key===Ey&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),_())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[_]);const y=h?"expanded":"collapsed",g=S.useMemo(()=>({state:y,open:h,setOpen:m,isMobile:i,openMobile:c,setOpenMobile:u,toggleSidebar:_}),[y,h,m,i,c,u,_]);return w.jsx(Zu.Provider,{value:g,children:w.jsx(cs,{delayDuration:0,children:w.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":yy,"--sidebar-width-icon":vy,...o},className:F("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...a,children:s})})})}function el({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...s}){const{isMobile:a,state:i,openMobile:c,setOpenMobile:u}=Dn();return n==="none"?w.jsx("div",{"data-slot":"sidebar",className:F("bg-white text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...s,children:o}):a?w.jsx(uu,{open:c,onOpenChange:u,...s,children:w.jsxs(Uo,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-white text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":wy},side:e,children:[w.jsxs($o,{className:"sr-only",children:[w.jsx(Wo,{children:"Sidebar"}),w.jsx(Fo,{children:"Displays the mobile sidebar."})]}),w.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):w.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":i,"data-collapsible":i==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[w.jsx("div",{"data-slot":"sidebar-gap",className:F("relative w-(--sidebar-width) bg-white transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),w.jsx("div",{"data-slot":"sidebar-container",className:F("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:w.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-white group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col px-1 py-2 group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function tl({className:e,onClick:t,...n}){const{toggleSidebar:r}=Dn();return w.jsxs(ur,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:F("size-7",e),onClick:o=>{t==null||t(o),r()},...n,children:[w.jsx(fm,{}),w.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function nl({className:e,...t}){const{toggleSidebar:n}=Dn();return w.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:F("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function rl({className:e,...t}){return w.jsx("main",{"data-slot":"sidebar-inset",className:F("bg-white relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function _y({className:e,...t}){return w.jsx(_o,{"data-slot":"sidebar-input","data-sidebar":"input",className:F("bg-background h-8 w-full shadow-none",e),...t})}function ol({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:F("flex flex-col gap-2 p-2",e),...t})}function Sy({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:F("flex flex-col gap-2 p-2",e),...t})}function xy({className:e,...t}){return w.jsx(ir,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:F("bg-sidebar-border mx-2 w-auto",e),...t})}function sl({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:F("flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function al({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:F("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function Ay({className:e,asChild:t=!1,...n}){const r=t?en:"div";return w.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:F("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})}function Ry({className:e,asChild:t=!1,...n}){const r=t?en:"button";return w.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:F("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...n})}function il({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:F("w-full text-sm",e),...t})}function Cy({className:e,...t}){return w.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:F("flex w-full min-w-0 flex-col gap-1",e),...t})}function Ty({className:e,...t}){return w.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:F("group/menu-item relative",e),...t})}const Py=Eo("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Oy({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...a}){const i=e?en:"button",{isMobile:c,state:u}=Dn(),l=w.jsx(i,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:F(Py({variant:n,size:r}),s),...a});return o?(typeof o=="string"&&(o={children:o}),w.jsxs(us,{children:[w.jsx(ls,{asChild:!0,children:l}),w.jsx(Dr,{side:"right",align:"center",hidden:u!=="collapsed"||c,...o})]})):l}function ky({className:e,asChild:t=!1,showOnHover:n=!1,...r}){const o=t?en:"button";return w.jsx(o,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:F("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...r})}function Ny({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:F("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function Iy({className:e,showIcon:t=!1,...n}){const r=S.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return w.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:F("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&w.jsx(Ko,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),w.jsx(Ko,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function cl({className:e,...t}){return w.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:F("border-sidebar-border mx-3 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function ul({className:e,...t}){return w.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:F("group/menu-sub-item relative",e),...t})}function ll({asChild:e=!1,size:t="md",isActive:n=!1,className:r,...o}){const s=e?en:"a";return w.jsx(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:F("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})}var Mr={exports:{}},ds={};/**
167
167
  * @license React
168
168
  * use-sync-external-store-shim.production.js
169
169
  *
@@ -171,7 +171,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
171
171
  *
172
172
  * This source code is licensed under the MIT license found in the
173
173
  * LICENSE file in the root directory of this source tree.
174
- */var dl;function Ny(){if(dl)return ds;dl=1;var e=F;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(d,h){var m=h(),_=r({inst:{value:m,getSnapshot:h}}),y=_[0].inst,g=_[1];return s(function(){y.value=m,y.getSnapshot=h,c(y)&&g({inst:y})},[d,m,h]),o(function(){return c(y)&&g({inst:y}),d(function(){c(y)&&g({inst:y})})},[d]),a(m),m}function c(d){var h=d.getSnapshot;d=d.value;try{var m=h();return!n(d,m)}catch{return!0}}function u(d,h){return h()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:i;return ds.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,ds}var fs={};/**
174
+ */var dl;function Dy(){if(dl)return ds;dl=1;var e=W;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(d,h){var m=h(),_=r({inst:{value:m,getSnapshot:h}}),y=_[0].inst,g=_[1];return s(function(){y.value=m,y.getSnapshot=h,c(y)&&g({inst:y})},[d,m,h]),o(function(){return c(y)&&g({inst:y}),d(function(){c(y)&&g({inst:y})})},[d]),a(m),m}function c(d){var h=d.getSnapshot;d=d.value;try{var m=h();return!n(d,m)}catch{return!0}}function u(d,h){return h()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:i;return ds.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,ds}var fs={};/**
175
175
  * @license React
176
176
  * use-sync-external-store-shim.development.js
177
177
  *
@@ -179,19 +179,19 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
179
179
  *
180
180
  * This source code is licensed under the MIT license found in the
181
181
  * LICENSE file in the root directory of this source tree.
182
- */var fl;function Iy(){return fl||(fl=1,process.env.NODE_ENV!=="production"&&function(){function e(m,_){return m===_&&(m!==0||1/m===1/_)||m!==m&&_!==_}function t(m,_){l||o.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=_();if(!d){var g=_();s(y,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}g=a({inst:{value:y,getSnapshot:_}});var p=g[0].inst,b=g[1];return c(function(){p.value=y,p.getSnapshot=_,n(p)&&b({inst:p})},[m,y,_]),i(function(){return n(p)&&b({inst:p}),m(function(){n(p)&&b({inst:p})})},[m]),u(y),y}function n(m){var _=m.getSnapshot;m=m.value;try{var y=_();return!s(m,y)}catch{return!0}}function r(m,_){return _()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=F,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,l=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;fs.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),fs}var hl;function Dy(){return hl||(hl=1,process.env.NODE_ENV==="production"?Mr.exports=Ny():Mr.exports=Iy()),Mr.exports}var My=Dy();const pl=0,ml=1,gl=2,bl=3;var yl=Object.prototype.hasOwnProperty;function hs(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&hs(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(yl.call(e,n)&&++r&&!yl.call(t,n)||!(n in t)||!hs(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const wt=new WeakMap,Tt=()=>{},He=Tt(),Lr=Object,de=e=>e===He,rt=e=>typeof e=="function",vt=(e,t)=>({...e,...t}),wl=e=>rt(e.then),ps={},jr={},ms="undefined",Mn=typeof window!=ms,gs=typeof document!=ms,Ly=Mn&&"Deno"in window,jy=()=>Mn&&typeof window.requestAnimationFrame!=ms,vl=(e,t)=>{const n=wt.get(e);return[()=>!de(t)&&e.get(t)||ps,r=>{if(!de(t)){const o=e.get(t);t in jr||(jr[t]=o),n[5](t,vt(o,r),o||ps)}},n[6],()=>!de(t)&&t in jr?jr[t]:!de(t)&&e.get(t)||ps]};let bs=!0;const Hy=()=>bs,[ys,ws]=Mn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Tt,Tt],Uy=()=>{const e=gs&&document.visibilityState;return de(e)||e!=="hidden"},$y=e=>(gs&&document.addEventListener("visibilitychange",e),ys("focus",e),()=>{gs&&document.removeEventListener("visibilitychange",e),ws("focus",e)}),Wy=e=>{const t=()=>{bs=!0,e()},n=()=>{bs=!1};return ys("online",t),ys("offline",n),()=>{ws("online",t),ws("offline",n)}},Fy={isOnline:Hy,isVisible:Uy},Ky={initFocus:$y,initReconnect:Wy},El=!F.useId,Ln=!Mn||Ly,qy=e=>jy()?window.requestAnimationFrame(e):setTimeout(e,1),Hr=Ln?F.useEffect:F.useLayoutEffect,vs=typeof navigator<"u"&&navigator.connection,_l=!Ln&&vs&&(["slow-2g","2g"].includes(vs.effectiveType)||vs.saveData),Ur=new WeakMap,Es=(e,t)=>Lr.prototype.toString.call(e)===`[object ${t}]`;let zy=0;const _s=e=>{const t=typeof e,n=Es(e,"Date"),r=Es(e,"RegExp"),o=Es(e,"Object");let s,a;if(Lr(e)===e&&!n&&!r){if(s=Ur.get(e),s)return s;if(s=++zy+"~",Ur.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=_s(e[a])+",";Ur.set(e,s)}if(o){s="#";const i=Lr.keys(e).sort();for(;!de(a=i.pop());)de(e[a])||(s+=a+":"+_s(e[a])+",");Ur.set(e,s)}}else s=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},Ss=e=>{if(rt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?_s(e):"",[e,t]};let Gy=0;const xs=()=>++Gy;async function Sl(...e){const[t,n,r,o]=e,s=vt({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=s.populateCache;const i=s.rollbackOnError;let c=s.optimisticData;const u=h=>typeof i=="function"?i(h):i!==!1,l=s.throwOnError;if(rt(n)){const h=n,m=[],_=t.keys();for(const y of _)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&m.push(y);return Promise.all(m.map(d))}return d(n);async function d(h){const[m]=Ss(h);if(!m)return;const[_,y]=vl(t,m),[g,p,b,f]=wt.get(t),A=()=>{const U=g[m];return(rt(s.revalidate)?s.revalidate(_().data,h):s.revalidate!==!1)&&(delete b[m],delete f[m],U&&U[0])?U[0](gl).then(()=>_().data):_().data};if(e.length<3)return A();let E=r,R;const v=xs();p[m]=[v,0];const x=!de(c),C=_(),D=C.data,I=C._c,P=de(I)?D:I;if(x&&(c=rt(c)?c(P,D):c,y({data:c,_c:P})),rt(E))try{E=E(P)}catch(U){R=U}if(E&&wl(E))if(E=await E.catch(U=>{R=U}),v!==p[m][0]){if(R)throw R;return E}else R&&x&&u(R)&&(a=!0,y({data:P,_c:He}));if(a&&!R)if(rt(a)){const U=a(E,P);y({data:U,error:He,_c:He})}else y({data:E,error:He,_c:He});if(p[m][1]=xs(),Promise.resolve(A()).then(()=>{y({_c:He})}),R){if(l)throw R;return}return E}}const xl=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Al=(e,t)=>{if(!wt.has(e)){const n=vt(Ky,t),r=Object.create(null),o=Sl.bind(He,e);let s=Tt;const a=Object.create(null),i=(l,d)=>{const h=a[l]||[];return a[l]=h,h.push(d),()=>h.splice(h.indexOf(d),1)},c=(l,d,h)=>{e.set(l,d);const m=a[l];if(m)for(const _ of m)_(d,h)},u=()=>{if(!wt.has(e)&&(wt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,c,i]),!Ln)){const l=n.initFocus(setTimeout.bind(He,xl.bind(He,r,pl))),d=n.initReconnect(setTimeout.bind(He,xl.bind(He,r,ml)));s=()=>{l&&l(),d&&d(),wt.delete(e)}}};return u(),[e,o,u,s]}return[e,wt.get(e)[4]]},By=(e,t,n,r,o)=>{const s=n.errorRetryCount,a=o.retryCount,i=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!de(s)&&a>s||setTimeout(r,i,o)},Vy=hs,[As,Jy]=Al(new Map),Rl=vt({onLoadingSlow:Tt,onSuccess:Tt,onError:Tt,onErrorRetry:By,onDiscarded:Tt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_l?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_l?5e3:3e3,compare:Vy,isPaused:()=>!1,cache:As,mutate:Jy,fallback:{}},Fy),Cl=(e,t)=>{const n=vt(e,t);if(t){const{use:r,fallback:o}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),o&&a&&(n.fallback=vt(o,a))}return n},Rs=F.createContext({}),Xy=e=>{const{value:t}=e,n=F.useContext(Rs),r=rt(t),o=F.useMemo(()=>r?t(n):t,[r,n,t]),s=F.useMemo(()=>r?o:Cl(n,o),[r,n,o]),a=o&&o.provider,i=F.useRef(He);a&&!i.current&&(i.current=Al(a(s.cache||As),o));const c=i.current;return c&&(s.cache=c[0],s.mutate=c[1]),Hr(()=>{if(c)return c[2]&&c[2](),c[3]},[]),F.createElement(Rs.Provider,vt(e,{value:s}))},Yy="$inf$",Tl=Mn&&window.__SWR_DEVTOOLS_USE__,Zy=Tl?window.__SWR_DEVTOOLS_USE__:[],Qy=()=>{Tl&&(window.__SWR_DEVTOOLS_REACT__=F)},ew=e=>rt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],tw=()=>vt(Rl,F.useContext(Rs)),nw=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=Ss(t),[,,,i]=wt.get(As);if(a.startsWith(Yy))return n(...s);const c=i[a];return de(c)?n(...s):(delete i[a],c)}),r),rw=Zy.concat(nw),ow=e=>function(...n){const r=tw(),[o,s,a]=ew(n),i=Cl(r,a);let c=e;const{use:u}=i,l=(u||[]).concat(rw);for(let d=l.length;d--;)c=l[d](c);return c(o,s||i.fetcher||null,i)},sw=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};Qy();const Cs=F.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ts={dedupe:!0},aw=(e,t,n)=>{const{cache:r,compare:o,suspense:s,fallbackData:a,revalidateOnMount:i,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:l,refreshWhenOffline:d,keepPreviousData:h}=n,[m,_,y,g]=wt.get(r),[p,b]=Ss(e),f=F.useRef(!1),A=F.useRef(!1),E=F.useRef(p),R=F.useRef(t),v=F.useRef(n),x=()=>v.current,C=()=>x().isVisible()&&x().isOnline(),[D,I,P,U]=vl(r,p),G=F.useRef({}).current,oe=de(a)?de(n.fallback)?He:n.fallback[p]:a,V=(M,z)=>{for(const ne in G){const $=ne;if($==="data"){if(!o(M[$],z[$])&&(!de(M[$])||!o(fe,z[$])))return!1}else if(z[$]!==M[$])return!1}return!0},Y=F.useMemo(()=>{const M=!p||!t?!1:de(i)?x().isPaused()||s?!1:c!==!1:i,z=Ae=>{const De=vt(Ae);return delete De._k,M?{isValidating:!0,isLoading:!0,...De}:De},ne=D(),$=U(),_e=z(ne),Ce=ne===$?_e:z($);let pe=_e;return[()=>{const Ae=z(D());return V(Ae,pe)?(pe.data=Ae.data,pe.isLoading=Ae.isLoading,pe.isValidating=Ae.isValidating,pe.error=Ae.error,pe):(pe=Ae,Ae)},()=>Ce]},[r,p]),O=My.useSyncExternalStore(F.useCallback(M=>P(p,(z,ne)=>{V(ne,z)||M()}),[r,p]),Y[0],Y[1]),j=!f.current,T=m[p]&&m[p].length>0,H=O.data,J=de(H)?oe&&wl(oe)?Cs(oe):oe:H,X=O.error,se=F.useRef(J),fe=h?de(H)?de(se.current)?J:se.current:H:J,we=T&&!de(X)?!1:j&&!de(i)?i:x().isPaused()?!1:s?de(J)?!1:c:de(J)||c,te=!!(p&&t&&j&&we),le=de(O.isValidating)?te:O.isValidating,ue=de(O.isLoading)?te:O.isLoading,ye=F.useCallback(async M=>{const z=R.current;if(!p||!z||A.current||x().isPaused())return!1;let ne,$,_e=!0;const Ce=M||{},pe=!y[p]||!Ce.dedupe,Ae=()=>El?!A.current&&p===E.current&&f.current:p===E.current,De={isValidating:!1,isLoading:!1},xn=()=>{I(De)},po=()=>{const Ke=y[p];Ke&&Ke[1]===$&&delete y[p]},nr={isValidating:!0};de(D().data)&&(nr.isLoading=!0);try{if(pe&&(I(nr),n.loadingTimeout&&de(D().data)&&setTimeout(()=>{_e&&Ae()&&x().onLoadingSlow(p,n)},n.loadingTimeout),y[p]=[z(b),xs()]),[ne,$]=y[p],ne=await ne,pe&&setTimeout(po,n.dedupingInterval),!y[p]||y[p][1]!==$)return pe&&Ae()&&x().onDiscarded(p),!1;De.error=He;const Ke=_[p];if(!de(Ke)&&($<=Ke[0]||$<=Ke[1]||Ke[1]===0))return xn(),pe&&Ae()&&x().onDiscarded(p),!1;const Re=D().data;De.data=o(Re,ne)?Re:ne,pe&&Ae()&&x().onSuccess(ne,p,n)}catch(Ke){po();const Re=x(),{shouldRetryOnError:dt}=Re;Re.isPaused()||(De.error=Ke,pe&&Ae()&&(Re.onError(Ke,p,Re),(dt===!0||rt(dt)&&dt(Ke))&&(!x().revalidateOnFocus||!x().revalidateOnReconnect||C())&&Re.onErrorRetry(Ke,p,Re,An=>{const ie=m[p];ie&&ie[0]&&ie[0](bl,An)},{retryCount:(Ce.retryCount||0)+1,dedupe:!0})))}return _e=!1,xn(),!0},[p,r]),k=F.useCallback((...M)=>Sl(r,E.current,...M),[]);if(Hr(()=>{R.current=t,v.current=n,de(H)||(se.current=H)}),Hr(()=>{if(!p)return;const M=ye.bind(He,Ts);let z=0;x().revalidateOnFocus&&(z=Date.now()+x().focusThrottleInterval);const $=sw(p,m,(_e,Ce={})=>{if(_e==pl){const pe=Date.now();x().revalidateOnFocus&&pe>z&&C()&&(z=pe+x().focusThrottleInterval,M())}else if(_e==ml)x().revalidateOnReconnect&&C()&&M();else{if(_e==gl)return ye();if(_e==bl)return ye(Ce)}});return A.current=!1,E.current=p,f.current=!0,I({_k:b}),we&&(de(J)||Ln?M():qy(M)),()=>{A.current=!0,$()}},[p]),Hr(()=>{let M;function z(){const $=rt(u)?u(D().data):u;$&&M!==-1&&(M=setTimeout(ne,$))}function ne(){!D().error&&(l||x().isVisible())&&(d||x().isOnline())?ye(Ts).then(z):z()}return z(),()=>{M&&(clearTimeout(M),M=-1)}},[u,l,d,p]),F.useDebugValue(fe),s&&de(J)&&p){if(!El&&Ln)throw new Error("Fallback data is required when using Suspense in SSR.");R.current=t,v.current=n,A.current=!1;const M=g[p];if(!de(M)){const z=k(M);Cs(z)}if(de(X)){const z=ye(Ts);de(fe)||(z.status="fulfilled",z.value=!0),Cs(z)}else throw X}return{mutate:k,get data(){return G.data=!0,fe},get error(){return G.error=!0,X},get isValidating(){return G.isValidating=!0,le},get isLoading(){return G.isLoading=!0,ue}}},iw=Lr.defineProperty(Xy,"defaultValue",{value:Rl}),cw=ow(aw);function uw(e){return e&&!e.startsWith("/")?`/${e}`:e}function Pl(e){return e&&!e.endsWith("/")?`${e}/`:e}function Ol(e){return e&&e.startsWith("/")?e.substring(1,e.length):e}const lw=e=>e.endsWith("/")?e.slice(0,-1):e,kl=e=>{const t=process.env.NEXT_PUBLIC_BASE_PATH;if(!t)return e;const n=uw(t);return Pl(n)+Ol(e)};function dw(){const{data:e,error:t,isLoading:n,mutate:r}=cw(kl(process.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile"),(...o)=>fetch(...o).then(s=>{if(!s.ok)throw new Error("Unauthorized");return s.status===204?null:s.json()}));return t?{user:null,isLoading:!1,error:t,invalidate:()=>r()}:e?{user:e,isLoading:!1,error:null,invalidate:()=>r()}:{user:e,isLoading:n,error:t,invalidate:()=>r()}}class lt extends Error{}class jn extends lt{constructor({code:t,message:n}){super(n??"An error occured while interacting with the authorization server."),this.name="OAuth2Error",this.code=t}}class fw extends lt{constructor(t){super(t??"Discovery failed for the OpenID Connect configuration."),this.code="discovery_error",this.name="DiscoveryError"}}class hw extends lt{constructor(t){super(t??"The state parameter is missing."),this.code="missing_state",this.name="MissingStateError"}}class pw extends lt{constructor(t){super(t??"The state parameter is invalid."),this.code="invalid_state",this.name="InvalidStateError"}}class Nl extends lt{constructor({cause:t,message:n}){super(n??"An error occured during the authorization flow."),this.code="authorization_error",this.cause=t,this.name="AuthorizationError"}}class mw extends lt{constructor(t){super(t??"An error occured while preparing or performing the authorization code grant request."),this.code="authorization_code_grant_request_error",this.name="AuthorizationCodeGrantRequestError"}}class gw extends lt{constructor({cause:t,message:n}){super(n??"An error occured while trying to exchange the authorization code."),this.code="authorization_code_grant_error",this.cause=t,this.name="AuthorizationCodeGrantError"}}class Pt extends lt{constructor(t){super(t??"An error occured while completing the backchannel logout request."),this.code="backchannel_logout_error",this.name="BackchannelLogoutError"}}var pn;(function(e){e.MISSING_SESSION="missing_session",e.MISSING_REFRESH_TOKEN="missing_refresh_token",e.FAILED_TO_REFRESH_TOKEN="failed_to_refresh_token"})(pn||(pn={}));class Ps extends lt{constructor(t,n,r){super(n),this.name="AccessTokenError",this.code=t,this.cause=r}}var Hn;(function(e){e.MISSING_SESSION="missing_session",e.MISSING_REFRESH_TOKEN="missing_refresh_token",e.FAILED_TO_EXCHANGE="failed_to_exchange_refresh_token"})(Hn||(Hn={}));class Os extends lt{constructor(t,n,r){super(n),this.name="AccessTokenForConnectionError",this.code=t,this.cause=r}}function bw({user:e,children:t}){return F.createElement(iw,{value:{fallback:{[process.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile"]:e}}},t)}function Il(e){const t=e+"CollectionProvider",[n,r]=Ut(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:g,children:p}=y,b=F.useRef(null),f=F.useRef(new Map).current;return w.jsx(o,{scope:g,itemMap:f,collectionRef:b,children:p})};a.displayName=t;const i=e+"CollectionSlot",c=Qt(i),u=F.forwardRef((y,g)=>{const{scope:p,children:b}=y,f=s(i,p),A=Te(g,f.collectionRef);return w.jsx(c,{ref:A,children:b})});u.displayName=i;const l=e+"CollectionItemSlot",d="data-radix-collection-item",h=Qt(l),m=F.forwardRef((y,g)=>{const{scope:p,children:b,...f}=y,A=F.useRef(null),E=Te(g,A),R=s(l,p);return F.useEffect(()=>(R.itemMap.set(A,{ref:A,...f}),()=>void R.itemMap.delete(A))),w.jsx(h,{[d]:"",ref:E,children:b})});m.displayName=l;function _(y){const g=s(e+"CollectionConsumer",y);return F.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const f=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((R,v)=>f.indexOf(R.ref.current)-f.indexOf(v.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},_,r]}var yw=S.createContext(void 0);function Dl(e){const t=S.useContext(yw);return e||t||"ltr"}var ks="rovingFocusGroup.onEntryFocus",ww={bubbles:!1,cancelable:!0},Un="RovingFocusGroup",[Ns,Ml,vw]=Il(Un),[Ew,Ll]=Ut(Un,[vw]),[_w,Sw]=Ew(Un),jl=S.forwardRef((e,t)=>w.jsx(Ns.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ns.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(xw,{...e,ref:t})})}));jl.displayName=Un;var xw=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:l=!1,...d}=e,h=S.useRef(null),m=Te(t,h),_=Dl(s),[y,g]=Pn({prop:a,defaultProp:i??null,onChange:c,caller:Un}),[p,b]=S.useState(!1),f=ot(u),A=Ml(n),E=S.useRef(!1),[R,v]=S.useState(0);return S.useEffect(()=>{const x=h.current;if(x)return x.addEventListener(ks,f),()=>x.removeEventListener(ks,f)},[f]),w.jsx(_w,{scope:n,orientation:r,dir:_,loop:o,currentTabStopId:y,onItemFocus:S.useCallback(x=>g(x),[g]),onItemShiftTab:S.useCallback(()=>b(!0),[]),onFocusableItemAdd:S.useCallback(()=>v(x=>x+1),[]),onFocusableItemRemove:S.useCallback(()=>v(x=>x-1),[]),children:w.jsx(xe.div,{tabIndex:p||R===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{E.current=!0}),onFocus:Z(e.onFocus,x=>{const C=!E.current;if(x.target===x.currentTarget&&C&&!p){const D=new CustomEvent(ks,ww);if(x.currentTarget.dispatchEvent(D),!D.defaultPrevented){const I=A().filter(V=>V.focusable),P=I.find(V=>V.active),U=I.find(V=>V.id===y),oe=[P,U,...I].filter(Boolean).map(V=>V.ref.current);$l(oe,l)}}E.current=!1}),onBlur:Z(e.onBlur,()=>b(!1))})})}),Hl="RovingFocusGroupItem",Ul=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,c=mt(),u=s||c,l=Sw(Hl,n),d=l.currentTabStopId===u,h=Ml(n),{onFocusableItemAdd:m,onFocusableItemRemove:_,currentTabStopId:y}=l;return S.useEffect(()=>{if(r)return m(),()=>_()},[r,m,_]),w.jsx(Ns.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:w.jsx(xe.span,{tabIndex:d?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:Z(e.onMouseDown,g=>{r?l.onItemFocus(u):g.preventDefault()}),onFocus:Z(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){l.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const p=Cw(g,l.orientation,l.dir);if(p!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let f=h().filter(A=>A.focusable).map(A=>A.ref.current);if(p==="last")f.reverse();else if(p==="prev"||p==="next"){p==="prev"&&f.reverse();const A=f.indexOf(g.currentTarget);f=l.loop?Tw(f,A+1):f.slice(A+1)}setTimeout(()=>$l(f))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:y!=null}):a})})});Ul.displayName=Hl;var Aw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Rw(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Cw(e,t,n){const r=Rw(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Aw[r]}function $l(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Tw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pw=jl,Ow=Ul,Is=["Enter"," "],kw=["ArrowDown","PageUp","Home"],Wl=["ArrowUp","PageDown","End"],Nw=[...kw,...Wl],Iw={ltr:[...Is,"ArrowRight"],rtl:[...Is,"ArrowLeft"]},Dw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$n="Menu",[Wn,Mw,Lw]=Il($n),[Ft,Fl]=Ut($n,[Lw,Or,Ll]),Fn=Or(),Kl=Ll(),[ql,Ot]=Ft($n),[jw,Kn]=Ft($n),zl=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,i=Fn(t),[c,u]=S.useState(null),l=S.useRef(!1),d=ot(s),h=Dl(o);return S.useEffect(()=>{const m=()=>{l.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>l.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(os,{...i,children:w.jsx(ql,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:u,children:w.jsx(jw,{scope:t,onClose:S.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:l,dir:h,modal:a,children:r})})})};zl.displayName=$n;var Hw="MenuAnchor",Ds=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fn(n);return w.jsx($u,{...o,...r,ref:t})});Ds.displayName=Hw;var Ms="MenuPortal",[Uw,Gl]=Ft(Ms,{forceMount:void 0}),Bl=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Ot(Ms,t);return w.jsx(Uw,{scope:t,forceMount:n,children:w.jsx(gt,{present:n||s.open,children:w.jsx(Co,{asChild:!0,container:o,children:r})})})};Bl.displayName=Ms;var Ye="MenuContent",[$w,Ls]=Ft(Ye),Vl=S.forwardRef((e,t)=>{const n=Gl(Ye,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ot(Ye,e.__scopeMenu),a=Kn(Ye,e.__scopeMenu);return w.jsx(Wn.Provider,{scope:e.__scopeMenu,children:w.jsx(gt,{present:r||s.open,children:w.jsx(Wn.Slot,{scope:e.__scopeMenu,children:a.modal?w.jsx(Ww,{...o,ref:t}):w.jsx(Fw,{...o,ref:t})})})})}),Ww=S.forwardRef((e,t)=>{const n=Ot(Ye,e.__scopeMenu),r=S.useRef(null),o=Te(t,r);return S.useEffect(()=>{const s=r.current;if(s)return Wc(s)},[]),w.jsx(js,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Fw=S.forwardRef((e,t)=>{const n=Ot(Ye,e.__scopeMenu);return w.jsx(js,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Kw=Qt("MenuContent.ScrollLock"),js=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:_,...y}=e,g=Ot(Ye,n),p=Kn(Ye,n),b=Fn(n),f=Kl(n),A=Mw(n),[E,R]=S.useState(null),v=S.useRef(null),x=Te(t,v,g.onContentChange),C=S.useRef(0),D=S.useRef(""),I=S.useRef(0),P=S.useRef(null),U=S.useRef("right"),G=S.useRef(0),oe=_?Io:S.Fragment,V=_?{as:Kw,allowPinchZoom:!0}:void 0,Y=j=>{var te,le;const T=D.current+j,H=A().filter(ue=>!ue.disabled),J=document.activeElement,X=(te=H.find(ue=>ue.ref.current===J))==null?void 0:te.textValue,se=H.map(ue=>ue.textValue),fe=tv(se,T,X),we=(le=H.find(ue=>ue.textValue===fe))==null?void 0:le.ref.current;(function ue(ye){D.current=ye,window.clearTimeout(C.current),ye!==""&&(C.current=window.setTimeout(()=>ue(""),1e3))})(T),we&&setTimeout(()=>we.focus())};S.useEffect(()=>()=>window.clearTimeout(C.current),[]),Rc();const O=S.useCallback(j=>{var H,J;return U.current===((H=P.current)==null?void 0:H.side)&&rv(j,(J=P.current)==null?void 0:J.area)},[]);return w.jsx($w,{scope:n,searchRef:D,onItemEnter:S.useCallback(j=>{O(j)&&j.preventDefault()},[O]),onItemLeave:S.useCallback(j=>{var T;O(j)||((T=v.current)==null||T.focus(),R(null))},[O]),onTriggerLeave:S.useCallback(j=>{O(j)&&j.preventDefault()},[O]),pointerGraceTimerRef:I,onPointerGraceIntentChange:S.useCallback(j=>{P.current=j},[]),children:w.jsx(oe,{...V,children:w.jsx(Ro,{asChild:!0,trapped:o,onMountAutoFocus:Z(s,j=>{var T;j.preventDefault(),(T=v.current)==null||T.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:w.jsx(lr,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,onDismiss:m,children:w.jsx(Pw,{asChild:!0,...f,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:R,onEntryFocus:Z(c,j=>{p.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Wu,{role:"menu","aria-orientation":"vertical","data-state":fd(g.open),"data-radix-menu-content":"",dir:p.dir,...b,...y,ref:x,style:{outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,j=>{const H=j.target.closest("[data-radix-menu-content]")===j.currentTarget,J=j.ctrlKey||j.altKey||j.metaKey,X=j.key.length===1;H&&(j.key==="Tab"&&j.preventDefault(),!J&&X&&Y(j.key));const se=v.current;if(j.target!==se||!Nw.includes(j.key))return;j.preventDefault();const we=A().filter(te=>!te.disabled).map(te=>te.ref.current);Wl.includes(j.key)&&we.reverse(),Qw(we)}),onBlur:Z(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(C.current),D.current="")}),onPointerMove:Z(e.onPointerMove,zn(j=>{const T=j.target,H=G.current!==j.clientX;if(j.currentTarget.contains(T)&&H){const J=j.clientX>G.current?"right":"left";U.current=J,G.current=j.clientX}}))})})})})})})});Vl.displayName=Ye;var qw="MenuGroup",Hs=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{role:"group",...r,ref:t})});Hs.displayName=qw;var zw="MenuLabel",Jl=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{...r,ref:t})});Jl.displayName=zw;var $r="MenuItem",Xl="menu.itemSelect",Wr=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=S.useRef(null),a=Kn($r,e.__scopeMenu),i=Ls($r,e.__scopeMenu),c=Te(t,s),u=S.useRef(!1),l=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(Xl,{bubbles:!0,cancelable:!0});d.addEventListener(Xl,m=>r==null?void 0:r(m),{once:!0}),Wi(d,h),h.defaultPrevented?u.current=!1:a.onClose()}};return w.jsx(Yl,{...o,ref:c,disabled:n,onClick:Z(e.onClick,l),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:Z(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:Z(e.onKeyDown,d=>{const h=i.searchRef.current!=="";n||h&&d.key===" "||Is.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Wr.displayName=$r;var Yl=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=Ls($r,n),i=Kl(n),c=S.useRef(null),u=Te(t,c),[l,d]=S.useState(!1),[h,m]=S.useState("");return S.useEffect(()=>{const _=c.current;_&&m((_.textContent??"").trim())},[s.children]),w.jsx(Wn.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:w.jsx(Ow,{asChild:!0,...i,focusable:!r,children:w.jsx(xe.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:Z(e.onPointerMove,zn(_=>{r?a.onItemLeave(_):(a.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,zn(_=>a.onItemLeave(_))),onFocus:Z(e.onFocus,()=>d(!0)),onBlur:Z(e.onBlur,()=>d(!1))})})})}),Gw="MenuCheckboxItem",Zl=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return w.jsx(rd,{scope:e.__scopeMenu,checked:n,children:w.jsx(Wr,{role:"menuitemcheckbox","aria-checked":Fr(n)?"mixed":n,...o,ref:t,"data-state":Ws(n),onSelect:Z(o.onSelect,()=>r==null?void 0:r(Fr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Zl.displayName=Gw;var Ql="MenuRadioGroup",[Bw,Vw]=Ft(Ql,{value:void 0,onValueChange:()=>{}}),ed=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=ot(r);return w.jsx(Bw,{scope:e.__scopeMenu,value:n,onValueChange:s,children:w.jsx(Hs,{...o,ref:t})})});ed.displayName=Ql;var td="MenuRadioItem",nd=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=Vw(td,e.__scopeMenu),s=n===o.value;return w.jsx(rd,{scope:e.__scopeMenu,checked:s,children:w.jsx(Wr,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Ws(s),onSelect:Z(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});nd.displayName=td;var Us="MenuItemIndicator",[rd,Jw]=Ft(Us,{checked:!1}),od=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Jw(Us,n);return w.jsx(gt,{present:r||Fr(s.checked)||s.checked===!0,children:w.jsx(xe.span,{...o,ref:t,"data-state":Ws(s.checked)})})});od.displayName=Us;var Xw="MenuSeparator",sd=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});sd.displayName=Xw;var Yw="MenuArrow",ad=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fn(n);return w.jsx(Fu,{...o,...r,ref:t})});ad.displayName=Yw;var $s="MenuSub",[Zw,id]=Ft($s),cd=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Ot($s,t),a=Fn(t),[i,c]=S.useState(null),[u,l]=S.useState(null),d=ot(o);return S.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),w.jsx(os,{...a,children:w.jsx(ql,{scope:t,open:r,onOpenChange:d,content:u,onContentChange:l,children:w.jsx(Zw,{scope:t,contentId:mt(),triggerId:mt(),trigger:i,onTriggerChange:c,children:n})})})};cd.displayName=$s;var qn="MenuSubTrigger",ud=S.forwardRef((e,t)=>{const n=Ot(qn,e.__scopeMenu),r=Kn(qn,e.__scopeMenu),o=id(qn,e.__scopeMenu),s=Ls(qn,e.__scopeMenu),a=S.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},l=S.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return S.useEffect(()=>l,[l]),S.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),c(null)}},[i,c]),w.jsx(Ds,{asChild:!0,...u,children:w.jsx(Yl,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fd(n.open),...e,ref:or(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(e.onPointerMove,zn(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),l()},100))})),onPointerLeave:Z(e.onPointerLeave,zn(d=>{var m,_;l();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const y=(_=n.content)==null?void 0:_.dataset.side,g=y==="right",p=g?-5:5,b=h[g?"left":"right"],f=h[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:b,y:h.top},{x:f,y:h.top},{x:f,y:h.bottom},{x:b,y:h.bottom}],side:y}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Z(e.onKeyDown,d=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||Iw[r.dir].includes(d.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),d.preventDefault())})})})});ud.displayName=qn;var ld="MenuSubContent",dd=S.forwardRef((e,t)=>{const n=Gl(Ye,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ot(Ye,e.__scopeMenu),a=Kn(Ye,e.__scopeMenu),i=id(ld,e.__scopeMenu),c=S.useRef(null),u=Te(t,c);return w.jsx(Wn.Provider,{scope:e.__scopeMenu,children:w.jsx(gt,{present:r||s.open,children:w.jsx(Wn.Slot,{scope:e.__scopeMenu,children:w.jsx(js,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{var d;a.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:Z(e.onFocusOutside,l=>{l.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Z(e.onEscapeKeyDown,l=>{a.onClose(),l.preventDefault()}),onKeyDown:Z(e.onKeyDown,l=>{var m;const d=l.currentTarget.contains(l.target),h=Dw[a.dir].includes(l.key);d&&h&&(s.onOpenChange(!1),(m=i.trigger)==null||m.focus(),l.preventDefault())})})})})})});dd.displayName=ld;function fd(e){return e?"open":"closed"}function Fr(e){return e==="indeterminate"}function Ws(e){return Fr(e)?"indeterminate":e?"checked":"unchecked"}function Qw(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ev(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tv(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=ev(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function nv(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],u=i.x,l=i.y,d=c.x,h=c.y;l>r!=h>r&&n<(d-u)*(r-l)/(h-l)+u&&(o=!o)}return o}function rv(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nv(n,t)}function zn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ov=zl,sv=Ds,av=Bl,iv=Vl,cv=Hs,uv=Jl,lv=Wr,dv=Zl,fv=ed,hv=nd,pv=od,mv=sd,gv=ad,bv=cd,yv=ud,wv=dd,Kr="DropdownMenu",[vv,FS]=Ut(Kr,[Fl]),Ue=Fl(),[Ev,hd]=vv(Kr),pd=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,c=Ue(t),u=S.useRef(null),[l,d]=Pn({prop:o,defaultProp:s??!1,onChange:a,caller:Kr});return w.jsx(Ev,{scope:t,triggerId:mt(),triggerRef:u,contentId:mt(),open:l,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(h=>!h),[d]),modal:i,children:w.jsx(ov,{...c,open:l,onOpenChange:d,dir:r,modal:i,children:n})})};pd.displayName=Kr;var md="DropdownMenuTrigger",gd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=hd(md,n),a=Ue(n);return w.jsx(sv,{asChild:!0,...a,children:w.jsx(xe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:or(t,s.triggerRef),onPointerDown:Z(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:Z(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});gd.displayName=md;var _v="DropdownMenuPortal",bd=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ue(t);return w.jsx(av,{...r,...n})};bd.displayName=_v;var yd="DropdownMenuContent",wd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hd(yd,n),s=Ue(n),a=S.useRef(!1);return w.jsx(iv,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:Z(e.onCloseAutoFocus,i=>{var c;a.current||(c=o.triggerRef.current)==null||c.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:Z(e.onInteractOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,l=c.button===2||u;(!o.modal||l)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wd.displayName=yd;var Sv="DropdownMenuGroup",vd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(cv,{...o,...r,ref:t})});vd.displayName=Sv;var xv="DropdownMenuLabel",Ed=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(uv,{...o,...r,ref:t})});Ed.displayName=xv;var Av="DropdownMenuItem",_d=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(lv,{...o,...r,ref:t})});_d.displayName=Av;var Rv="DropdownMenuCheckboxItem",Sd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(dv,{...o,...r,ref:t})});Sd.displayName=Rv;var Cv="DropdownMenuRadioGroup",xd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(fv,{...o,...r,ref:t})});xd.displayName=Cv;var Tv="DropdownMenuRadioItem",Ad=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(hv,{...o,...r,ref:t})});Ad.displayName=Tv;var Pv="DropdownMenuItemIndicator",Rd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(pv,{...o,...r,ref:t})});Rd.displayName=Pv;var Ov="DropdownMenuSeparator",Cd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(mv,{...o,...r,ref:t})});Cd.displayName=Ov;var kv="DropdownMenuArrow",Nv=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(gv,{...o,...r,ref:t})});Nv.displayName=kv;var Iv=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,a=Ue(t),[i,c]=Pn({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return w.jsx(bv,{...a,open:i,onOpenChange:c,children:n})},Dv="DropdownMenuSubTrigger",Td=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(yv,{...o,...r,ref:t})});Td.displayName=Dv;var Mv="DropdownMenuSubContent",Pd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(wv,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pd.displayName=Mv;var Lv=pd,jv=gd,Od=bd,Hv=wd,Uv=vd,$v=Ed,Wv=_d,Fv=Sd,Kv=xd,qv=Ad,kd=Rd,zv=Cd,Gv=Iv,Bv=Td,Vv=Pd;function Nd({...e}){return w.jsx(Lv,{"data-slot":"dropdown-menu",...e})}function Jv({...e}){return w.jsx(Od,{"data-slot":"dropdown-menu-portal",...e})}function Id({...e}){return w.jsx(jv,{"data-slot":"dropdown-menu-trigger",...e})}function Dd({className:e,sideOffset:t=4,...n}){return w.jsx(Od,{children:w.jsx(Hv,{"data-slot":"dropdown-menu-content",sideOffset:t,className:W("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Xv({...e}){return w.jsx(Uv,{"data-slot":"dropdown-menu-group",...e})}function Fs({className:e,inset:t,variant:n="default",...r}){return w.jsx(Wv,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:W("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Yv({className:e,children:t,checked:n,...r}){return w.jsxs(Fv,{"data-slot":"dropdown-menu-checkbox-item",className:W("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[w.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:w.jsx(kd,{children:w.jsx(sm,{className:"size-4"})})}),t]})}function Zv({...e}){return w.jsx(Kv,{"data-slot":"dropdown-menu-radio-group",...e})}function Qv({className:e,children:t,...n}){return w.jsxs(qv,{"data-slot":"dropdown-menu-radio-item",className:W("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[w.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:w.jsx(kd,{children:w.jsx(cm,{className:"size-2 fill-current"})})}),t]})}function Md({className:e,inset:t,...n}){return w.jsx($v,{"data-slot":"dropdown-menu-label","data-inset":t,className:W("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function Ld({className:e,...t}){return w.jsx(zv,{"data-slot":"dropdown-menu-separator",className:W("bg-border -mx-1 my-1 h-px",e),...t})}function e0({className:e,...t}){return w.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:W("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function t0({...e}){return w.jsx(Gv,{"data-slot":"dropdown-menu-sub",...e})}function n0({className:e,inset:t,children:n,...r}){return w.jsxs(Bv,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:W("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,w.jsx(fc,{className:"ml-auto size-4"})]})}function r0({className:e,...t}){return w.jsx(Vv,{"data-slot":"dropdown-menu-sub-content",className:W("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}const jd=({onLogout:e})=>{const{user:t,error:n,isLoading:r}=dw(),o=async()=>{try{e&&await e(),window.location.href="/auth/logout"}catch(s){console.error("Error during logout:",s),window.location.href="/auth/logout"}};return r?w.jsx("div",{className:"h-10 w-10 animate-pulse rounded-full bg-gray-200"}):n?w.jsxs("div",{children:["Error: ",n.message]}):t?w.jsx("div",{className:"relative flex items-center gap-3",children:w.jsxs(Nd,{children:[w.jsx(Id,{asChild:!0,children:w.jsx(ur,{variant:"ghost",size:"lg",className:"rounded-full cursor-pointer p-0",children:t.picture?w.jsx("img",{src:t.picture,alt:t.name||"User profile",width:40,height:40,className:"rounded-full"}):w.jsx(pc,{className:"h-5 w-5 text-gray-500"})})}),w.jsxs(Dd,{align:"end",className:"w-72",children:[w.jsx(Md,{children:w.jsx("div",{className:"flex flex-col space-y-1",children:w.jsxs("div",{className:"flex flex-col space-y-1",children:[w.jsx("p",{className:"text-xs text-gray-500",children:t.name}),w.jsx("p",{className:"truncate text-xs text-gray-500",children:t.email})]})})}),w.jsx(Ld,{}),w.jsx(Fs,{asChild:!0,children:w.jsxs("a",{href:"/profile",className:"flex w-full cursor-default",children:[w.jsx(pc,{className:"mr-2 h-4 w-4"}),w.jsx("span",{children:"Profile"})]})}),w.jsxs(Fs,{onClick:o,children:[w.jsx(um,{className:"mr-2 h-4 w-4"}),w.jsx("span",{children:"Sign out"})]})]})]})}):null},Hd=({onLogout:e})=>w.jsx("div",{className:"sticky top-0 z-50 bg-white",children:w.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-white px-4",children:[w.jsxs("div",{className:"flex h-full items-center gap-4 flex-1 min-w-0 overflow-hidden",children:[w.jsx(tl,{}),w.jsx(ir,{orientation:"vertical"})]}),w.jsx("div",{className:"flex-shrink-0",children:w.jsx(jd,{onLogout:e})})]})});function o0({className:e,...t}){return w.jsx("div",{"data-slot":"card",className:W("bg-card text-card-foreground flex flex-col gap-4 rounded-xl py-6 shadow-sm",e),...t})}function s0({className:e,...t}){return w.jsx("div",{"data-slot":"card-header",className:W("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function a0({className:e,...t}){return w.jsx("div",{"data-slot":"card-title",className:W("leading-none font-semibold",e),...t})}function i0({className:e,...t}){return w.jsx("div",{"data-slot":"card-description",className:W("text-muted-foreground text-sm",e),...t})}function c0({className:e,...t}){return w.jsx("div",{"data-slot":"card-action",className:W("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function u0({className:e,...t}){return w.jsx("div",{"data-slot":"card-content",className:W("px-6",e),...t})}function l0({className:e,...t}){return w.jsx("div",{"data-slot":"card-footer",className:W("flex items-center px-6 [.border-t]:pt-6",e),...t})}function Ud({title:e,url:t,children:n,defaultOpen:r=!1,icon:o,isActive:s=!1,className:a,disabled:i=!1}){const[c,u]=S.useState(r);S.useEffect(()=>{s&&u(!0)},[s]);const l=!i&&t;return w.jsx(al,{className:a,children:w.jsxs("div",{className:"flex flex-col",children:[w.jsxs("div",{className:"flex flex-row items-center justify-between",children:[l?w.jsxs("a",{href:t,className:W("flex flex-1 cursor-pointer items-center gap-2 rounded-lg p-2 transition-colors hover:bg-gray-100"),children:[o&&w.jsx("span",{className:W("text-gray-600"),children:o}),w.jsx("span",{className:W("text-gray-600"),children:e})]}):w.jsxs("div",{className:W("flex flex-1 items-center gap-2 rounded-lg p-2",i&&"cursor-default"),children:[o&&w.jsx("span",{className:W("text-gray-600"),children:o}),w.jsx("span",{className:W("text-gray-600"),children:e})]}),w.jsx("button",{type:"button",className:W("mr-3 rounded-lg p-2 text-gray-500",i?"cursor-default opacity-50":"hover:bg-gray-100 hover:text-gray-700"),onClick:d=>{d.preventDefault(),d.stopPropagation(),i||u(!c)},disabled:i,"aria-label":c?"Collapse section":"Expand section",children:c?w.jsx(am,{className:"h-4 w-4"}):w.jsx(fc,{className:"h-4 w-4"})})]}),w.jsx("div",{className:W("overflow-hidden transition-all",c&&!i?"max-h-96":"max-h-0"),children:n})]})})}const d0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20141%2060'%3e%3cpath%20d='M0.059%2019.711V59.673H19.509V49.95H9.779V19.711H0.059Z'%20fill='%2385B9D1'%3e%3c/path%3e%3cpath%20d='M0%200L0.056%204.915V19.715H9.776V9.715H19.5V59.673H29.22V0H0Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M23.49%2019.717H9.776V29.439H23.49V19.717Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M0.0580006%2019.718L9.785%2029.445V19.718H0.0580006Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M9.777%2049.953L19.504%2059.679V49.953H9.777Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M50.213%2021.331C50.1839%2019.244%2050.325%2017.1581%2050.635%2015.094C50.8293%2013.6891%2051.2694%2012.3294%2051.935%2011.077C52.4295%2010.1519%2053.1979%209.4023%2054.135%208.93101C55.1033%208.49691%2056.1561%208.28375%2057.217%208.307C58.2628%208.27673%2059.3024%208.47715%2060.262%208.894C61.1441%209.33605%2061.8541%2010.059%2062.28%2010.949C62.8725%2012.1976%2063.2507%2013.5369%2063.399%2014.911C63.6554%2016.9922%2063.7717%2019.0882%2063.747%2021.185C63.7759%2023.338%2063.6421%2025.4901%2063.347%2027.623C63.1657%2029.0675%2062.7378%2030.4702%2062.082%2031.77C61.6022%2032.7122%2060.8471%2033.4862%2059.917%2033.989C58.9503%2034.4507%2057.888%2034.6768%2056.817%2034.649C55.7687%2034.6771%2054.7258%2034.4896%2053.753%2034.098C52.8534%2033.6775%2052.1275%2032.9579%2051.699%2032.062C51.0884%2030.7803%2050.7037%2029.4027%2050.562%2027.99C50.3018%2025.7802%2050.1852%2023.5559%2050.213%2021.331ZM54.913%2022.248C54.913%2023.6913%2054.9377%2024.9267%2054.987%2025.954C55.0147%2026.8043%2055.1127%2027.6509%2055.28%2028.485C55.3666%2029.0149%2055.5877%2029.5138%2055.922%2029.934C56.0643%2030.0868%2056.238%2030.207%2056.4312%2030.2862C56.6244%2030.3655%2056.8324%2030.4019%2057.041%2030.393C57.25%2030.3964%2057.4571%2030.3533%2057.6473%2030.2668C57.8375%2030.1803%2058.0062%2030.0526%2058.141%2029.893C58.4964%2029.4241%2058.7297%2028.8744%2058.82%2028.293C59.0025%2027.3609%2059.1128%2026.4161%2059.15%2025.467C59.2107%2024.3177%2059.2414%2022.936%2059.242%2021.322C59.242%2019.732%2059.224%2018.3747%2059.188%2017.25C59.169%2016.3373%2059.0736%2015.4278%2058.903%2014.531C58.8198%2013.9744%2058.5923%2013.4493%2058.243%2013.008C58.0929%2012.8491%2057.9104%2012.7244%2057.7078%2012.6422C57.5053%2012.5601%2057.2874%2012.5225%2057.069%2012.532C56.8667%2012.5304%2056.6668%2012.576%2056.4852%2012.6652C56.3036%2012.7544%2056.1453%2012.8848%2056.023%2013.046C55.6766%2013.5389%2055.4446%2014.103%2055.344%2014.697C55.1442%2015.6885%2055.0277%2016.695%2054.996%2017.706C54.9347%2018.9533%2054.904%2020.4697%2054.904%2022.255'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M83.329%2021.331C83.2999%2019.244%2083.441%2017.1581%2083.751%2015.094C83.9453%2013.6891%2084.3854%2012.3294%2085.051%2011.077C85.5455%2010.1519%2086.3139%209.40235%2087.251%208.93105C89.2087%208.112%2091.4106%208.09871%2093.378%208.89405C94.2601%209.33609%2094.9701%2010.0591%2095.396%2010.949C95.9885%2012.1976%2096.3667%2013.537%2096.515%2014.911C96.7714%2016.9922%2096.8877%2019.0883%2096.863%2021.185C96.8919%2023.3381%2096.7581%2025.4902%2096.463%2027.6231C96.2817%2029.0676%2095.8538%2030.4703%2095.198%2031.77C94.7182%2032.7123%2093.9631%2033.4862%2093.033%2033.989C92.0663%2034.4507%2091.004%2034.6769%2089.933%2034.649C88.8847%2034.6772%2087.8418%2034.4896%2086.869%2034.098C85.9694%2033.6775%2085.2435%2032.9579%2084.815%2032.062C84.2044%2030.7803%2083.8197%2029.4027%2083.678%2027.99C83.4178%2025.7803%2083.3012%2023.5559%2083.329%2021.331ZM88.029%2022.2481C88.029%2023.6914%2088.0537%2024.9267%2088.103%2025.954C88.1307%2026.8044%2088.2287%2027.6509%2088.396%2028.4851C88.4826%2029.015%2088.7037%2029.5139%2089.038%2029.934C89.1803%2030.0869%2089.354%2030.207%2089.5472%2030.2863C89.7404%2030.3655%2089.9484%2030.4019%2090.157%2030.393C90.366%2030.3964%2090.573%2030.3533%2090.7633%2030.2669C90.9535%2030.1804%2091.1222%2030.0527%2091.257%2029.893C91.6124%2029.4242%2091.8458%2028.8744%2091.936%2028.2931C92.1185%2027.3609%2092.2288%2026.4161%2092.266%2025.467C92.3267%2024.3177%2092.3574%2022.936%2092.358%2021.322C92.358%2019.732%2092.34%2018.3747%2092.304%2017.2501C92.2887%2016.3329%2092.1964%2015.4187%2092.028%2014.517C91.9448%2013.9605%2091.7173%2013.4354%2091.368%2012.994C91.2162%2012.8368%2091.0323%2012.7141%2090.8289%2012.6343C90.6255%2012.5544%2090.4072%2012.5192%2090.189%2012.531C89.9867%2012.5294%2089.7868%2012.575%2089.6052%2012.6643C89.4236%2012.7535%2089.2653%2012.8839%2089.143%2013.045C88.7966%2013.5379%2088.5646%2014.102%2088.464%2014.6961C88.2642%2015.6876%2088.1477%2016.6941%2088.116%2017.705C88.0547%2018.9524%2088.024%2020.4687%2088.024%2022.254'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M131.349%2034.65V8.32202H135.458V30.797H140.631V34.649L131.349%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M71.95%2034.65V8.33203H76.059V30.796H81.232V34.648L71.95%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M104.833%2014.692C104.934%2014.098%20105.166%2013.534%20105.512%2013.041C105.634%2012.8798%20105.793%2012.7494%20105.974%2012.6602C106.156%2012.571%20106.356%2012.5253%20106.558%2012.527H110.103V8.30798H106.703C105.642%208.2848%20104.589%208.49794%20103.621%208.93197C102.684%209.40306%20101.915%2010.1527%20101.421%2011.078C100.756%2012.3304%20100.316%2013.6901%20100.121%2015.095C99.8114%2017.1591%2099.6706%2019.245%2099.7%2021.332C99.6722%2023.5568%2099.7885%2025.7811%20100.048%2027.991C100.19%2029.4037%20100.574%2030.7812%20101.185%2032.063C101.614%2032.9584%20102.34%2033.6778%20103.239%2034.099C104.212%2034.4899%20105.255%2034.6771%20106.303%2034.649L110.103%2034.613V30.393H106.522C106.313%2030.402%20106.105%2030.3657%20105.912%2030.2866C105.719%2030.2076%20105.545%2030.0876%20105.403%2029.935C105.069%2029.5144%20104.848%2029.0152%20104.761%2028.485C104.594%2027.6509%20104.496%2026.8043%20104.468%2025.954C104.419%2024.9266%20104.394%2023.6916%20104.394%2022.249C104.394%2020.4636%20104.425%2018.9473%20104.486%2017.7C104.518%2016.6894%20104.633%2015.6832%20104.833%2014.692Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M46.728%2019.247H42.878V30.395H41.828C41.6182%2030.4039%2041.409%2030.3669%2041.2149%2030.2868C41.0208%2030.2067%2040.8465%2030.0853%2040.704%2029.931C40.3695%2029.5106%2040.1485%2029.0113%2040.062%2028.481C39.894%2027.647%2039.7956%2026.8004%2039.768%2025.95C39.7187%2024.9227%2039.6944%2023.6877%2039.695%2022.245C39.695%2020.4597%2039.7257%2018.9434%2039.787%2017.696C39.8191%2016.6854%2039.9355%2015.6792%2040.135%2014.688C40.2357%2014.094%2040.4677%2013.53%2040.814%2013.037C40.9376%2012.8768%2041.0968%2012.7476%2041.2791%2012.6598C41.4614%2012.5719%2041.6617%2012.5278%2041.864%2012.531H45.904V8.31202H42.012C40.9511%208.28877%2039.8983%208.50191%2038.93%208.93601C37.9927%209.40699%2037.2241%2010.1567%2036.73%2011.082C36.0644%2012.3344%2035.6243%2013.6941%2035.43%2015.099C35.1189%2017.1613%2034.9764%2019.2456%2035.004%2021.331C34.9762%2023.5559%2035.0925%2025.7802%2035.352%2027.99C35.494%2029.4026%2035.8787%2030.7802%2036.489%2032.062C36.9179%2032.9579%2037.6442%2033.6775%2038.544%2034.098C39.517%2034.4891%2040.5598%2034.6763%2041.608%2034.648L43.587%2034.629H46.727L46.728%2019.247Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M123.653%2029.87H118L116.691%2034.65H112.797L120.939%208L128.793%2034.65H124.856L123.653%2029.87ZM122.587%2026.212L120.893%2019.982L119.085%2026.212H122.587Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M39.016%2041.436H37.059V54.507H39.016V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M44.559%2041.436H46.384L48.331%2046.651C48.919%2048.1937%2049.4198%2049.7682%2049.831%2051.367C49.6744%2050.357%2049.5584%2049.4427%2049.483%2048.624C49.4077%2047.8054%2049.37%2047.0347%2049.37%2046.312V41.436H51.336V54.511H49.495L47.303%2048.627C47.103%2048.0797%2046.9134%2047.518%2046.734%2046.942C46.5547%2046.366%2046.39%2045.762%2046.24%2045.13C46.2274%2045.0507%2046.207%2044.9547%2046.179%2044.842C46.151%2044.7293%2046.1177%2044.5997%2046.079%2044.453C46.098%2044.6%2046.114%2044.725%2046.126%2044.829C46.138%2044.933%2046.148%2045.022%2046.154%2045.095L46.254%2046.424L46.354%2048.041C46.36%2048.131%2046.365%2048.241%2046.368%2048.371C46.371%2048.501%2046.368%2048.648%2046.368%2048.811L46.468%2054.511H44.559V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M55.493%2041.436H61.861V42.977H59.67V54.511H57.751V42.977H55.493V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M65.828%2041.436H71.028V42.926H67.787V47.065H70.665V48.555H67.787V53.016H71.028V54.506H65.828V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M75.906%2041.436H78.483C79.3332%2041.3696%2080.1787%2041.6132%2080.863%2042.122C81.2131%2042.4774%2081.4826%2042.904%2081.6531%2043.3729C81.8236%2043.8417%2081.8911%2044.3418%2081.851%2044.839C81.8876%2045.6248%2081.7066%2046.4055%2081.328%2047.095C81.1685%2047.3665%2080.9531%2047.6008%2080.696%2047.7826C80.4389%2047.9643%2080.1461%2048.0892%2079.837%2048.149L82.509%2054.507H80.525L77.863%2048.107V54.507H75.906V41.436ZM77.863%2047.227C78.1485%2047.2893%2078.4451%2047.279%2078.7256%2047.1969C79.0061%2047.1148%2079.2615%2046.9637%2079.4684%2046.7573C79.6753%2046.5509%2079.8271%2046.2959%2079.9098%2046.0156C79.9926%2045.7353%2080.0036%2045.4387%2079.942%2045.153C79.9472%2044.8034%2079.9137%2044.4543%2079.842%2044.112C79.7909%2043.8589%2079.6851%2043.62%2079.532%2043.412C79.3909%2043.2304%2079.2018%2043.0918%2078.986%2043.012C78.7308%2042.9221%2078.4615%2042.8791%2078.191%2042.885H77.862L77.863%2047.227Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M90.046%2041.06L85.913%2054.514H87.745L88.45%2051.974H91.496L92.135%2054.531H94.028L90.046%2041.06ZM88.876%2050.403L90.013%2046.703L91.048%2050.415L88.876%2050.403Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M106.344%2041.436H112.712V42.977H110.52V54.511H108.602V42.977H106.344V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M118.865%2041.462H116.908V54.533H118.865V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M134.181%2041.462H139.381V42.952H136.136V47.093H139.014V48.583H136.136V53.044H139.381V54.534H134.181V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M99.749%2044.338C99.8046%2044.0109%2099.9338%2043.7008%20100.127%2043.431C100.202%2043.3322%20100.3%2043.2523%20100.411%2043.1976C100.523%2043.1429%20100.646%2043.115%20100.77%2043.116H102.464V41.207H100.846C100.318%2041.1955%2099.7949%2041.3011%2099.313%2041.516C98.8543%2041.748%2098.4782%2042.1157%2098.236%2042.569C97.9008%2043.2016%2097.6788%2043.888%2097.58%2044.597C97.4215%2045.6561%2097.3493%2046.7263%2097.364%2047.797C97.3503%2048.9393%2097.4101%2050.0814%2097.543%2051.216C97.6145%2051.9294%2097.808%2052.6252%2098.115%2053.273C98.3244%2053.7086%2098.6776%2054.0586%2099.115%2054.264C99.6001%2054.458%20100.12%2054.5509%20100.642%2054.537L102.469%2054.52V52.61H100.755C100.629%2052.6147%20100.503%2052.592%20100.386%2052.5435C100.269%2052.495%20100.164%2052.4218%20100.078%2052.329C99.8888%2052.0951%2099.7637%2051.816%2099.715%2051.519C99.6273%2051.081%2099.5758%2050.6365%2099.561%2050.19C99.536%2049.66%2099.523%2049.014%2099.523%2048.27C99.523%2047.349%2099.539%2046.557%2099.57%2045.916C99.5873%2045.3865%2099.6485%2044.8594%2099.753%2044.34'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M128.799%2041.466L126.671%2048.91L124.671%2041.466H122.679L126.654%2054.953L130.774%2041.466H128.799Z'%20fill='%230A3763'%3e%3c/path%3e%3c/svg%3e";function $d(){const[e,t]=F.useState("");return F.useEffect(()=>{t(window.location.pathname);const r=()=>{t(window.location.pathname)},o=()=>{t(window.location.pathname)};return window.addEventListener("popstate",r),window.addEventListener("pushstate",o),window.addEventListener("replacestate",o),()=>{window.removeEventListener("popstate",r),window.removeEventListener("pushstate",o),window.removeEventListener("replacestate",o)}},[]),{currentPath:e,isActiveRoute:r=>!!(e===r||r!=="/"&&e.startsWith(r))}}var Gn={},Ks={},qs={},zs={},Gs,Wd;function f0(){if(Wd)return Gs;Wd=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(E,R)=>{for(var v in R)e(E,v,{get:R[v],enumerable:!0})},s=(E,R,v,x)=>{if(R&&typeof R=="object"||typeof R=="function")for(let C of n(R))!r.call(E,C)&&C!==v&&e(E,C,{get:()=>R[C],enumerable:!(x=t(R,C))||x.enumerable});return E},a=E=>s(e({},"__esModule",{value:!0}),E),i={};o(i,{RequestCookies:()=>p,ResponseCookies:()=>b,parseCookie:()=>u,parseSetCookie:()=>l,stringifyCookie:()=>c}),Gs=a(i);function c(E){var R;const v=["path"in E&&E.path&&`Path=${E.path}`,"expires"in E&&(E.expires||E.expires===0)&&`Expires=${(typeof E.expires=="number"?new Date(E.expires):E.expires).toUTCString()}`,"maxAge"in E&&typeof E.maxAge=="number"&&`Max-Age=${E.maxAge}`,"domain"in E&&E.domain&&`Domain=${E.domain}`,"secure"in E&&E.secure&&"Secure","httpOnly"in E&&E.httpOnly&&"HttpOnly","sameSite"in E&&E.sameSite&&`SameSite=${E.sameSite}`,"partitioned"in E&&E.partitioned&&"Partitioned","priority"in E&&E.priority&&`Priority=${E.priority}`].filter(Boolean),x=`${E.name}=${encodeURIComponent((R=E.value)!=null?R:"")}`;return v.length===0?x:`${x}; ${v.join("; ")}`}function u(E){const R=new Map;for(const v of E.split(/; */)){if(!v)continue;const x=v.indexOf("=");if(x===-1){R.set(v,"true");continue}const[C,D]=[v.slice(0,x),v.slice(x+1)];try{R.set(C,decodeURIComponent(D??"true"))}catch{}}return R}function l(E){if(!E)return;const[[R,v],...x]=u(E),{domain:C,expires:D,httponly:I,maxage:P,path:U,samesite:G,secure:oe,partitioned:V,priority:Y}=Object.fromEntries(x.map(([j,T])=>[j.toLowerCase().replace(/-/g,""),T])),O={name:R,value:decodeURIComponent(v),domain:C,...D&&{expires:new Date(D)},...I&&{httpOnly:!0},...typeof P=="string"&&{maxAge:Number(P)},path:U,...G&&{sameSite:m(G)},...oe&&{secure:!0},...Y&&{priority:y(Y)},...V&&{partitioned:!0}};return d(O)}function d(E){const R={};for(const v in E)E[v]&&(R[v]=E[v]);return R}var h=["strict","lax","none"];function m(E){return E=E.toLowerCase(),h.includes(E)?E:void 0}var _=["low","medium","high"];function y(E){return E=E.toLowerCase(),_.includes(E)?E:void 0}function g(E){if(!E)return[];var R=[],v=0,x,C,D,I,P;function U(){for(;v<E.length&&/\s/.test(E.charAt(v));)v+=1;return v<E.length}function G(){return C=E.charAt(v),C!=="="&&C!==";"&&C!==","}for(;v<E.length;){for(x=v,P=!1;U();)if(C=E.charAt(v),C===","){for(D=v,v+=1,U(),I=v;v<E.length&&G();)v+=1;v<E.length&&E.charAt(v)==="="?(P=!0,v=I,R.push(E.substring(x,D)),x=v):v=D+1}else v+=1;(!P||v>=E.length)&&R.push(E.substring(x,E.length))}return R}var p=class{constructor(E){this._parsed=new Map,this._headers=E;const R=E.get("cookie");if(R){const v=u(R);for(const[x,C]of v)this._parsed.set(x,{name:x,value:C})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...E){const R=typeof E[0]=="string"?E[0]:E[0].name;return this._parsed.get(R)}getAll(...E){var R;const v=Array.from(this._parsed);if(!E.length)return v.map(([C,D])=>D);const x=typeof E[0]=="string"?E[0]:(R=E[0])==null?void 0:R.name;return v.filter(([C])=>C===x).map(([C,D])=>D)}has(E){return this._parsed.has(E)}set(...E){const[R,v]=E.length===1?[E[0].name,E[0].value]:E,x=this._parsed;return x.set(R,{name:R,value:v}),this._headers.set("cookie",Array.from(x).map(([C,D])=>c(D)).join("; ")),this}delete(E){const R=this._parsed,v=Array.isArray(E)?E.map(x=>R.delete(x)):R.delete(E);return this._headers.set("cookie",Array.from(R).map(([x,C])=>c(C)).join("; ")),v}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(E=>`${E.name}=${encodeURIComponent(E.value)}`).join("; ")}},b=class{constructor(E){this._parsed=new Map;var R,v,x;this._headers=E;const C=(x=(v=(R=E.getSetCookie)==null?void 0:R.call(E))!=null?v:E.get("set-cookie"))!=null?x:[],D=Array.isArray(C)?C:g(C);for(const I of D){const P=l(I);P&&this._parsed.set(P.name,P)}}get(...E){const R=typeof E[0]=="string"?E[0]:E[0].name;return this._parsed.get(R)}getAll(...E){var R;const v=Array.from(this._parsed.values());if(!E.length)return v;const x=typeof E[0]=="string"?E[0]:(R=E[0])==null?void 0:R.name;return v.filter(C=>C.name===x)}has(E){return this._parsed.has(E)}set(...E){const[R,v,x]=E.length===1?[E[0].name,E[0].value,E[0]]:E,C=this._parsed;return C.set(R,A({name:R,value:v,...x})),f(C,this._headers),this}delete(...E){const[R,v]=typeof E[0]=="string"?[E[0]]:[E[0].name,E[0]];return this.set({...v,name:R,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}};function f(E,R){R.delete("set-cookie");for(const[,v]of E){const x=c(v);R.append("set-cookie",x)}}function A(E={name:"",value:""}){return typeof E.expires=="number"&&(E.expires=new Date(E.expires)),E.maxAge&&(E.expires=new Date(Date.now()+E.maxAge*1e3)),(E.path===null||E.path===void 0)&&(E.path="/"),E}return Gs}var Fd;function Bn(){return Fd||(Fd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(r,o){for(var s in o)Object.defineProperty(r,s,{enumerable:!0,get:o[s]})}t(e,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});const n=f0()}(zs)),zs}var Bs={},Kd;function Vs(){return Kd||(Kd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ReflectAdapter",{enumerable:!0,get:function(){return t}});class t{static get(r,o,s){const a=Reflect.get(r,o,s);return typeof a=="function"?a.bind(r):a}static set(r,o,s,a){return Reflect.set(r,o,s,a)}static has(r,o){return Reflect.has(r,o)}static deleteProperty(r,o){return Reflect.deleteProperty(r,o)}}}(Bs)),Bs}var Js={},Xs={},Ys={},qd;function Zs(){return qd||(qd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return i}});const n=Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(u){return u}}const o=typeof globalThis<"u"&&globalThis.AsyncLocalStorage;function s(){return o?new o:new r}function a(c){return o?o.bind(c):r.bind(c)}function i(){return o?o.snapshot():function(c,...u){return c(...u)}}}(Ys)),Ys}var zd;function h0(){return zd||(zd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,Zs().createAsyncLocalStorage)()}(Xs)),Xs}var Gd;function kt(){return Gd||(Gd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});const t=h0()}(Js)),Js}var Qs={},ea={},Bd;function p0(){return Bd||(Bd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workUnitAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,Zs().createAsyncLocalStorage)()}(ea)),ea}var qr={exports:{}},Vd;function m0(){return Vd||(Vd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(f,A){for(var E in A)Object.defineProperty(f,E,{enumerable:!0,get:A[E]})}n(t,{ACTION_HEADER:function(){return o},FLIGHT_HEADERS:function(){return h},NEXT_DID_POSTPONE_HEADER:function(){return y},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return u},NEXT_HMR_REFRESH_HEADER:function(){return c},NEXT_IS_PRERENDER_HEADER:function(){return b},NEXT_REWRITTEN_PATH_HEADER:function(){return g},NEXT_REWRITTEN_QUERY_HEADER:function(){return p},NEXT_ROUTER_PREFETCH_HEADER:function(){return a},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return i},NEXT_ROUTER_STALE_TIME_HEADER:function(){return _},NEXT_ROUTER_STATE_TREE_HEADER:function(){return s},NEXT_RSC_UNION_QUERY:function(){return m},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return d},RSC_HEADER:function(){return r}});const r="RSC",o="Next-Action",s="Next-Router-State-Tree",a="Next-Router-Prefetch",i="Next-Router-Segment-Prefetch",c="Next-HMR-Refresh",u="__next_hmr_refresh_hash__",l="Next-Url",d="text/x-component",h=[r,s,a,c,i],m="_rsc",_="x-nextjs-stale-time",y="x-nextjs-postponed",g="x-nextjs-rewritten-path",p="x-nextjs-rewritten-query",b="x-nextjs-prerender";(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(qr,qr.exports)),qr.exports}var Jd;function Kt(){return Jd||(Jd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,d){for(var h in d)Object.defineProperty(l,h,{enumerable:!0,get:d[h]})}t(e,{getDraftModeProviderForCacheScope:function(){return u},getExpectedRequestStore:function(){return o},getHmrRefreshHash:function(){return c},getPrerenderResumeDataCache:function(){return a},getRenderResumeDataCache:function(){return i},throwForMissingRequestStore:function(){return s},workUnitAsyncStorage:function(){return n.workUnitAsyncStorageInstance}});const n=p0(),r=m0();function o(l){const d=n.workUnitAsyncStorageInstance.getStore();switch(d||s(l),d.type){case"request":return d;case"prerender":case"prerender-ppr":case"prerender-legacy":throw Object.defineProperty(new Error(`\`${l}\` cannot be called inside a prerender. This is a bug in Next.js.`),"__NEXT_ERROR_CODE",{value:"E401",enumerable:!1,configurable:!0});case"cache":throw Object.defineProperty(new Error(`\`${l}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E37",enumerable:!1,configurable:!0});case"unstable-cache":throw Object.defineProperty(new Error(`\`${l}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E69",enumerable:!1,configurable:!0});default:return d}}function s(l){throw Object.defineProperty(new Error(`\`${l}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E251",enumerable:!1,configurable:!0})}function a(l){return l.type==="prerender"||l.type==="prerender-ppr"?l.prerenderResumeDataCache:null}function i(l){return l.type!=="prerender-legacy"&&l.type!=="cache"&&l.type!=="unstable-cache"?l.type==="request"?l.renderResumeDataCache:l.prerenderResumeDataCache:null}function c(l,d){var h;if(l.dev)return d.type==="cache"||d.type==="prerender"?d.hmrRefreshHash:d.type==="request"?(h=d.cookies.get(r.NEXT_HMR_REFRESH_HASH_COOKIE))==null?void 0:h.value:void 0}function u(l,d){if(l.isDraftMode)switch(d.type){case"cache":case"unstable-cache":case"request":return d.draftMode;default:return}}}(Qs)),Qs}var Xd;function g0(){return Xd||(Xd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,p){for(var b in p)Object.defineProperty(g,b,{enumerable:!0,get:p[b]})}t(e,{MutableRequestCookiesAdapter:function(){return d},ReadonlyRequestCookiesError:function(){return a},RequestCookiesAdapter:function(){return i},appendMutableCookies:function(){return l},areCookiesMutableInCurrentPhase:function(){return m},getModifiedCookieValues:function(){return u},responseCookiesToRequestCookies:function(){return y},wrapWithMutableAccessCheck:function(){return h}});const n=Bn(),r=Vs(),o=kt(),s=Kt();class a extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new a}}class i{static seal(p){return new Proxy(p,{get(b,f,A){switch(f){case"clear":case"delete":case"set":return a.callable;default:return r.ReflectAdapter.get(b,f,A)}}})}}const c=Symbol.for("next.mutated.cookies");function u(g){const p=g[c];return!p||!Array.isArray(p)||p.length===0?[]:p}function l(g,p){const b=u(p);if(b.length===0)return!1;const f=new n.ResponseCookies(g),A=f.getAll();for(const E of b)f.set(E);for(const E of A)f.set(E);return!0}class d{static wrap(p,b){const f=new n.ResponseCookies(new Headers);for(const x of p.getAll())f.set(x);let A=[];const E=new Set,R=()=>{const x=o.workAsyncStorage.getStore();if(x&&(x.pathWasRevalidated=!0),A=f.getAll().filter(D=>E.has(D.name)),b){const D=[];for(const I of A){const P=new n.ResponseCookies(new Headers);P.set(I),D.push(P.toString())}b(D)}},v=new Proxy(f,{get(x,C,D){switch(C){case c:return A;case"delete":return function(...I){E.add(typeof I[0]=="string"?I[0]:I[0].name);try{return x.delete(...I),v}finally{R()}};case"set":return function(...I){E.add(typeof I[0]=="string"?I[0]:I[0].name);try{return x.set(...I),v}finally{R()}};default:return r.ReflectAdapter.get(x,C,D)}}});return v}}function h(g){const p=new Proxy(g,{get(b,f,A){switch(f){case"delete":return function(...E){return _("cookies().delete"),b.delete(...E),p};case"set":return function(...E){return _("cookies().set"),b.set(...E),p};default:return r.ReflectAdapter.get(b,f,A)}}});return p}function m(g){return g.phase==="action"}function _(g){const p=(0,s.getExpectedRequestStore)(g);if(!m(p))throw new a}function y(g){const p=new n.RequestCookies(new Headers);for(const b of g.getAll())p.set(b);return p}}(qs)),qs}var ta={},zr={exports:{}},Yd;function Zd(){return Yd||(Yd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}n(t,{DynamicServerError:function(){return o},isDynamicServerError:function(){return s}});const r="DYNAMIC_SERVER_USAGE";class o extends Error{constructor(i){super("Dynamic server usage: "+i),this.description=i,this.digest=r}}function s(a){return typeof a!="object"||a===null||!("digest"in a)||typeof a.digest!="string"?!1:a.digest===r}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(zr,zr.exports)),zr.exports}var Gr={exports:{}},Qd;function mn(){return Qd||(Qd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}n(t,{StaticGenBailoutError:function(){return o},isStaticGenBailoutError:function(){return s}});const r="NEXT_STATIC_GEN_BAILOUT";class o extends Error{constructor(...i){super(...i),this.code=r}}function s(a){return typeof a!="object"||a===null||!("code"in a)?!1:a.code===r}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Gr,Gr.exports)),Gr.exports}var na={},ef;function Vn(){return ef||(ef=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{isHangingPromiseRejectionError:function(){return n},makeHangingPromise:function(){return a}});function n(c){return typeof c!="object"||c===null||!("digest"in c)?!1:c.digest===r}const r="HANGING_PROMISE_REJECTION";class o extends Error{constructor(u){super(`During prerendering, ${u} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${u} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context.`),this.expression=u,this.digest=r}}const s=new WeakMap;function a(c,u){if(c.aborted)return Promise.reject(new o(u));{const l=new Promise((d,h)=>{const m=h.bind(null,new o(u));let _=s.get(c);if(_)_.push(m);else{const y=[m];s.set(c,y),c.addEventListener("abort",()=>{for(let g=0;g<y.length;g++)y[g]()},{once:!0})}});return l.catch(i),l}}function i(){}}(na)),na}var ra={},tf;function b0(){return tf||(tf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var i in a)Object.defineProperty(s,i,{enumerable:!0,get:a[i]})}t(e,{METADATA_BOUNDARY_NAME:function(){return n},OUTLET_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return r}});const n="__next_metadata_boundary__",r="__next_viewport_boundary__",o="__next_outlet_boundary__"}(ra)),ra}var oa={},nf;function sa(){return nf||(nf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}t(e,{atLeastOneTask:function(){return o},scheduleImmediate:function(){return r},scheduleOnNextTick:function(){return n},waitAtLeastOneReactRenderTask:function(){return s}});const n=a=>{Promise.resolve().then(()=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(a,0):process.nextTick(a)})},r=a=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(a,0):setImmediate(a)};function o(){return new Promise(a=>r(a))}function s(){return process.env.NEXT_RUNTIME==="edge"?new Promise(a=>setTimeout(a,0)):new Promise(a=>setImmediate(a))}}(oa)),oa}var rf;function Jn(){return rf||(rf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(k,N){for(var M in N)Object.defineProperty(k,M,{enumerable:!0,get:N[M]})}t(e,{Postpone:function(){return x},abortAndThrowOnSynchronousRequestDataAccess:function(){return R},abortOnSynchronousPlatformIOAccess:function(){return A},accessedDynamicData:function(){return V},annotateDynamicAccess:function(){return J},consumeDynamicAccess:function(){return Y},createDynamicTrackingState:function(){return h},createDynamicValidationState:function(){return m},createHangingInputAbortSignal:function(){return H},createPostponedAbortSignal:function(){return T},formatDynamicAPIAccesses:function(){return O},getFirstDynamicReason:function(){return _},isDynamicPostpone:function(){return I},isPrerenderInterruptedError:function(){return oe},markCurrentScopeAsDynamic:function(){return y},postponeWithTracking:function(){return C},throwIfDisallowedDynamic:function(){return ye},throwToInterruptStaticGeneration:function(){return p},trackAllowedDynamicAccess:function(){return le},trackDynamicDataInDynamicRender:function(){return b},trackFallbackParamAccessed:function(){return g},trackSynchronousPlatformIOAccessInDev:function(){return E},trackSynchronousRequestDataAccessInDev:function(){return v},useDynamicRouteParams:function(){return X}});const n=l(F),r=Zd(),o=mn(),s=Kt(),a=kt(),i=Vn(),c=b0(),u=sa();function l(k){return k&&k.__esModule?k:{default:k}}const d=typeof n.default.unstable_postpone=="function";function h(k){return{isDebugDynamicAccesses:k,dynamicAccesses:[],syncDynamicExpression:void 0,syncDynamicErrorWithStack:null}}function m(){return{hasSuspendedDynamic:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasSyncDynamicErrors:!1,dynamicErrors:[]}}function _(k){var N;return(N=k.dynamicAccesses[0])==null?void 0:N.expression}function y(k,N,M){if(!(N&&(N.type==="cache"||N.type==="unstable-cache"))&&!(k.forceDynamic||k.forceStatic)){if(k.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${k.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${M}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(N)if(N.type==="prerender-ppr")C(k.route,M,N.dynamicTracking);else if(N.type==="prerender-legacy"){N.revalidate=0;const z=Object.defineProperty(new r.DynamicServerError(`Route ${k.route} couldn't be rendered statically because it used ${M}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw k.dynamicUsageDescription=M,k.dynamicUsageStack=z.stack,z}else process.env.NODE_ENV==="development"&&N&&N.type==="request"&&(N.usedDynamic=!0)}}function g(k,N){const M=s.workUnitAsyncStorage.getStore();!M||M.type!=="prerender-ppr"||C(k.route,N,M.dynamicTracking)}function p(k,N,M){const z=Object.defineProperty(new r.DynamicServerError(`Route ${N.route} couldn't be rendered statically because it used \`${k}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw M.revalidate=0,N.dynamicUsageDescription=k,N.dynamicUsageStack=z.stack,z}function b(k,N){if(N){if(N.type==="cache"||N.type==="unstable-cache")return;(N.type==="prerender"||N.type==="prerender-legacy")&&(N.revalidate=0),process.env.NODE_ENV==="development"&&N.type==="request"&&(N.usedDynamic=!0)}}function f(k,N,M){const z=`Route ${k} needs to bail out of prerendering at this point because it used ${N}.`,ne=G(z);M.controller.abort(ne);const $=M.dynamicTracking;$&&$.dynamicAccesses.push({stack:$.isDebugDynamicAccesses?new Error().stack:void 0,expression:N})}function A(k,N,M,z){const ne=z.dynamicTracking;ne&&ne.syncDynamicErrorWithStack===null&&(ne.syncDynamicExpression=N,ne.syncDynamicErrorWithStack=M),f(k,N,z)}function E(k){k.prerenderPhase=!1}function R(k,N,M,z){if(z.controller.signal.aborted===!1){const $=z.dynamicTracking;$&&$.syncDynamicErrorWithStack===null&&($.syncDynamicExpression=N,$.syncDynamicErrorWithStack=M,z.validating===!0&&($.syncDynamicLogged=!0)),f(k,N,z)}throw G(`Route ${k} needs to bail out of prerendering at this point because it used ${N}.`)}const v=E;function x({reason:k,route:N}){const M=s.workUnitAsyncStorage.getStore(),z=M&&M.type==="prerender-ppr"?M.dynamicTracking:null;C(N,k,z)}function C(k,N,M){j(),M&&M.dynamicAccesses.push({stack:M.isDebugDynamicAccesses?new Error().stack:void 0,expression:N}),n.default.unstable_postpone(D(k,N))}function D(k,N){return`Route ${k} needs to bail out of prerendering at this point because it used ${N}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function I(k){return typeof k=="object"&&k!==null&&typeof k.message=="string"?P(k.message):!1}function P(k){return k.includes("needs to bail out of prerendering at this point because it used")&&k.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(P(D("%%%","^^^"))===!1)throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});const U="NEXT_PRERENDER_INTERRUPTED";function G(k){const N=Object.defineProperty(new Error(k),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return N.digest=U,N}function oe(k){return typeof k=="object"&&k!==null&&k.digest===U&&"name"in k&&"message"in k&&k instanceof Error}function V(k){return k.length>0}function Y(k,N){return k.dynamicAccesses.push(...N.dynamicAccesses),k.dynamicAccesses}function O(k){return k.filter(N=>typeof N.stack=="string"&&N.stack.length>0).map(({expression:N,stack:M})=>(M=M.split(`
182
+ */var fl;function My(){return fl||(fl=1,process.env.NODE_ENV!=="production"&&function(){function e(m,_){return m===_&&(m!==0||1/m===1/_)||m!==m&&_!==_}function t(m,_){l||o.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=_();if(!d){var g=_();s(y,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}g=a({inst:{value:y,getSnapshot:_}});var p=g[0].inst,b=g[1];return c(function(){p.value=y,p.getSnapshot=_,n(p)&&b({inst:p})},[m,y,_]),i(function(){return n(p)&&b({inst:p}),m(function(){n(p)&&b({inst:p})})},[m]),u(y),y}function n(m){var _=m.getSnapshot;m=m.value;try{var y=_();return!s(m,y)}catch{return!0}}function r(m,_){return _()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=W,s=typeof Object.is=="function"?Object.is:e,a=o.useState,i=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,l=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;fs.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),fs}var hl;function Ly(){return hl||(hl=1,process.env.NODE_ENV==="production"?Mr.exports=Dy():Mr.exports=My()),Mr.exports}var jy=Ly();const pl=0,ml=1,gl=2,bl=3;var yl=Object.prototype.hasOwnProperty;function hs(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&hs(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(yl.call(e,n)&&++r&&!yl.call(t,n)||!(n in t)||!hs(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const wt=new WeakMap,Tt=()=>{},He=Tt(),Lr=Object,de=e=>e===He,rt=e=>typeof e=="function",vt=(e,t)=>({...e,...t}),wl=e=>rt(e.then),ps={},jr={},ms="undefined",Mn=typeof window!=ms,gs=typeof document!=ms,Hy=Mn&&"Deno"in window,Uy=()=>Mn&&typeof window.requestAnimationFrame!=ms,vl=(e,t)=>{const n=wt.get(e);return[()=>!de(t)&&e.get(t)||ps,r=>{if(!de(t)){const o=e.get(t);t in jr||(jr[t]=o),n[5](t,vt(o,r),o||ps)}},n[6],()=>!de(t)&&t in jr?jr[t]:!de(t)&&e.get(t)||ps]};let bs=!0;const $y=()=>bs,[ys,ws]=Mn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Tt,Tt],Wy=()=>{const e=gs&&document.visibilityState;return de(e)||e!=="hidden"},Fy=e=>(gs&&document.addEventListener("visibilitychange",e),ys("focus",e),()=>{gs&&document.removeEventListener("visibilitychange",e),ws("focus",e)}),Ky=e=>{const t=()=>{bs=!0,e()},n=()=>{bs=!1};return ys("online",t),ys("offline",n),()=>{ws("online",t),ws("offline",n)}},qy={isOnline:$y,isVisible:Wy},zy={initFocus:Fy,initReconnect:Ky},El=!W.useId,Ln=!Mn||Hy,Gy=e=>Uy()?window.requestAnimationFrame(e):setTimeout(e,1),Hr=Ln?W.useEffect:W.useLayoutEffect,vs=typeof navigator<"u"&&navigator.connection,_l=!Ln&&vs&&(["slow-2g","2g"].includes(vs.effectiveType)||vs.saveData),Ur=new WeakMap,Es=(e,t)=>Lr.prototype.toString.call(e)===`[object ${t}]`;let By=0;const _s=e=>{const t=typeof e,n=Es(e,"Date"),r=Es(e,"RegExp"),o=Es(e,"Object");let s,a;if(Lr(e)===e&&!n&&!r){if(s=Ur.get(e),s)return s;if(s=++By+"~",Ur.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=_s(e[a])+",";Ur.set(e,s)}if(o){s="#";const i=Lr.keys(e).sort();for(;!de(a=i.pop());)de(e[a])||(s+=a+":"+_s(e[a])+",");Ur.set(e,s)}}else s=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},Ss=e=>{if(rt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?_s(e):"",[e,t]};let Vy=0;const xs=()=>++Vy;async function Sl(...e){const[t,n,r,o]=e,s=vt({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=s.populateCache;const i=s.rollbackOnError;let c=s.optimisticData;const u=h=>typeof i=="function"?i(h):i!==!1,l=s.throwOnError;if(rt(n)){const h=n,m=[],_=t.keys();for(const y of _)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&m.push(y);return Promise.all(m.map(d))}return d(n);async function d(h){const[m]=Ss(h);if(!m)return;const[_,y]=vl(t,m),[g,p,b,f]=wt.get(t),A=()=>{const U=g[m];return(rt(s.revalidate)?s.revalidate(_().data,h):s.revalidate!==!1)&&(delete b[m],delete f[m],U&&U[0])?U[0](gl).then(()=>_().data):_().data};if(e.length<3)return A();let E=r,R;const v=xs();p[m]=[v,0];const x=!de(c),C=_(),D=C.data,I=C._c,P=de(I)?D:I;if(x&&(c=rt(c)?c(P,D):c,y({data:c,_c:P})),rt(E))try{E=E(P)}catch(U){R=U}if(E&&wl(E))if(E=await E.catch(U=>{R=U}),v!==p[m][0]){if(R)throw R;return E}else R&&x&&u(R)&&(a=!0,y({data:P,_c:He}));if(a&&!R)if(rt(a)){const U=a(E,P);y({data:U,error:He,_c:He})}else y({data:E,error:He,_c:He});if(p[m][1]=xs(),Promise.resolve(A()).then(()=>{y({_c:He})}),R){if(l)throw R;return}return E}}const xl=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Al=(e,t)=>{if(!wt.has(e)){const n=vt(zy,t),r=Object.create(null),o=Sl.bind(He,e);let s=Tt;const a=Object.create(null),i=(l,d)=>{const h=a[l]||[];return a[l]=h,h.push(d),()=>h.splice(h.indexOf(d),1)},c=(l,d,h)=>{e.set(l,d);const m=a[l];if(m)for(const _ of m)_(d,h)},u=()=>{if(!wt.has(e)&&(wt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,c,i]),!Ln)){const l=n.initFocus(setTimeout.bind(He,xl.bind(He,r,pl))),d=n.initReconnect(setTimeout.bind(He,xl.bind(He,r,ml)));s=()=>{l&&l(),d&&d(),wt.delete(e)}}};return u(),[e,o,u,s]}return[e,wt.get(e)[4]]},Jy=(e,t,n,r,o)=>{const s=n.errorRetryCount,a=o.retryCount,i=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!de(s)&&a>s||setTimeout(r,i,o)},Xy=hs,[As,Yy]=Al(new Map),Rl=vt({onLoadingSlow:Tt,onSuccess:Tt,onError:Tt,onErrorRetry:Jy,onDiscarded:Tt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_l?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_l?5e3:3e3,compare:Xy,isPaused:()=>!1,cache:As,mutate:Yy,fallback:{}},qy),Cl=(e,t)=>{const n=vt(e,t);if(t){const{use:r,fallback:o}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),o&&a&&(n.fallback=vt(o,a))}return n},Rs=W.createContext({}),Zy=e=>{const{value:t}=e,n=W.useContext(Rs),r=rt(t),o=W.useMemo(()=>r?t(n):t,[r,n,t]),s=W.useMemo(()=>r?o:Cl(n,o),[r,n,o]),a=o&&o.provider,i=W.useRef(He);a&&!i.current&&(i.current=Al(a(s.cache||As),o));const c=i.current;return c&&(s.cache=c[0],s.mutate=c[1]),Hr(()=>{if(c)return c[2]&&c[2](),c[3]},[]),W.createElement(Rs.Provider,vt(e,{value:s}))},Qy="$inf$",Tl=Mn&&window.__SWR_DEVTOOLS_USE__,ew=Tl?window.__SWR_DEVTOOLS_USE__:[],tw=()=>{Tl&&(window.__SWR_DEVTOOLS_REACT__=W)},nw=e=>rt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],rw=()=>vt(Rl,W.useContext(Rs)),ow=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=Ss(t),[,,,i]=wt.get(As);if(a.startsWith(Qy))return n(...s);const c=i[a];return de(c)?n(...s):(delete i[a],c)}),r),sw=ew.concat(ow),aw=e=>function(...n){const r=rw(),[o,s,a]=nw(n),i=Cl(r,a);let c=e;const{use:u}=i,l=(u||[]).concat(sw);for(let d=l.length;d--;)c=l[d](c);return c(o,s||i.fetcher||null,i)},iw=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};tw();const Cs=W.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ts={dedupe:!0},cw=(e,t,n)=>{const{cache:r,compare:o,suspense:s,fallbackData:a,revalidateOnMount:i,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:l,refreshWhenOffline:d,keepPreviousData:h}=n,[m,_,y,g]=wt.get(r),[p,b]=Ss(e),f=W.useRef(!1),A=W.useRef(!1),E=W.useRef(p),R=W.useRef(t),v=W.useRef(n),x=()=>v.current,C=()=>x().isVisible()&&x().isOnline(),[D,I,P,U]=vl(r,p),G=W.useRef({}).current,oe=de(a)?de(n.fallback)?He:n.fallback[p]:a,V=(M,z)=>{for(const ne in G){const $=ne;if($==="data"){if(!o(M[$],z[$])&&(!de(M[$])||!o(fe,z[$])))return!1}else if(z[$]!==M[$])return!1}return!0},Y=W.useMemo(()=>{const M=!p||!t?!1:de(i)?x().isPaused()||s?!1:c!==!1:i,z=Ae=>{const De=vt(Ae);return delete De._k,M?{isValidating:!0,isLoading:!0,...De}:De},ne=D(),$=U(),_e=z(ne),Ce=ne===$?_e:z($);let pe=_e;return[()=>{const Ae=z(D());return V(Ae,pe)?(pe.data=Ae.data,pe.isLoading=Ae.isLoading,pe.isValidating=Ae.isValidating,pe.error=Ae.error,pe):(pe=Ae,Ae)},()=>Ce]},[r,p]),O=jy.useSyncExternalStore(W.useCallback(M=>P(p,(z,ne)=>{V(ne,z)||M()}),[r,p]),Y[0],Y[1]),j=!f.current,T=m[p]&&m[p].length>0,H=O.data,J=de(H)?oe&&wl(oe)?Cs(oe):oe:H,X=O.error,se=W.useRef(J),fe=h?de(H)?de(se.current)?J:se.current:H:J,we=T&&!de(X)?!1:j&&!de(i)?i:x().isPaused()?!1:s?de(J)?!1:c:de(J)||c,te=!!(p&&t&&j&&we),le=de(O.isValidating)?te:O.isValidating,ue=de(O.isLoading)?te:O.isLoading,ye=W.useCallback(async M=>{const z=R.current;if(!p||!z||A.current||x().isPaused())return!1;let ne,$,_e=!0;const Ce=M||{},pe=!y[p]||!Ce.dedupe,Ae=()=>El?!A.current&&p===E.current&&f.current:p===E.current,De={isValidating:!1,isLoading:!1},xn=()=>{I(De)},po=()=>{const Ke=y[p];Ke&&Ke[1]===$&&delete y[p]},nr={isValidating:!0};de(D().data)&&(nr.isLoading=!0);try{if(pe&&(I(nr),n.loadingTimeout&&de(D().data)&&setTimeout(()=>{_e&&Ae()&&x().onLoadingSlow(p,n)},n.loadingTimeout),y[p]=[z(b),xs()]),[ne,$]=y[p],ne=await ne,pe&&setTimeout(po,n.dedupingInterval),!y[p]||y[p][1]!==$)return pe&&Ae()&&x().onDiscarded(p),!1;De.error=He;const Ke=_[p];if(!de(Ke)&&($<=Ke[0]||$<=Ke[1]||Ke[1]===0))return xn(),pe&&Ae()&&x().onDiscarded(p),!1;const Re=D().data;De.data=o(Re,ne)?Re:ne,pe&&Ae()&&x().onSuccess(ne,p,n)}catch(Ke){po();const Re=x(),{shouldRetryOnError:dt}=Re;Re.isPaused()||(De.error=Ke,pe&&Ae()&&(Re.onError(Ke,p,Re),(dt===!0||rt(dt)&&dt(Ke))&&(!x().revalidateOnFocus||!x().revalidateOnReconnect||C())&&Re.onErrorRetry(Ke,p,Re,An=>{const ie=m[p];ie&&ie[0]&&ie[0](bl,An)},{retryCount:(Ce.retryCount||0)+1,dedupe:!0})))}return _e=!1,xn(),!0},[p,r]),k=W.useCallback((...M)=>Sl(r,E.current,...M),[]);if(Hr(()=>{R.current=t,v.current=n,de(H)||(se.current=H)}),Hr(()=>{if(!p)return;const M=ye.bind(He,Ts);let z=0;x().revalidateOnFocus&&(z=Date.now()+x().focusThrottleInterval);const $=iw(p,m,(_e,Ce={})=>{if(_e==pl){const pe=Date.now();x().revalidateOnFocus&&pe>z&&C()&&(z=pe+x().focusThrottleInterval,M())}else if(_e==ml)x().revalidateOnReconnect&&C()&&M();else{if(_e==gl)return ye();if(_e==bl)return ye(Ce)}});return A.current=!1,E.current=p,f.current=!0,I({_k:b}),we&&(de(J)||Ln?M():Gy(M)),()=>{A.current=!0,$()}},[p]),Hr(()=>{let M;function z(){const $=rt(u)?u(D().data):u;$&&M!==-1&&(M=setTimeout(ne,$))}function ne(){!D().error&&(l||x().isVisible())&&(d||x().isOnline())?ye(Ts).then(z):z()}return z(),()=>{M&&(clearTimeout(M),M=-1)}},[u,l,d,p]),W.useDebugValue(fe),s&&de(J)&&p){if(!El&&Ln)throw new Error("Fallback data is required when using Suspense in SSR.");R.current=t,v.current=n,A.current=!1;const M=g[p];if(!de(M)){const z=k(M);Cs(z)}if(de(X)){const z=ye(Ts);de(fe)||(z.status="fulfilled",z.value=!0),Cs(z)}else throw X}return{mutate:k,get data(){return G.data=!0,fe},get error(){return G.error=!0,X},get isValidating(){return G.isValidating=!0,le},get isLoading(){return G.isLoading=!0,ue}}},uw=Lr.defineProperty(Zy,"defaultValue",{value:Rl}),lw=aw(cw);function dw(e){return e&&!e.startsWith("/")?`/${e}`:e}function Pl(e){return e&&!e.endsWith("/")?`${e}/`:e}function Ol(e){return e&&e.startsWith("/")?e.substring(1,e.length):e}const fw=e=>e.endsWith("/")?e.slice(0,-1):e,kl=e=>{const t=process.env.NEXT_PUBLIC_BASE_PATH;if(!t)return e;const n=dw(t);return Pl(n)+Ol(e)};function hw(){const{data:e,error:t,isLoading:n,mutate:r}=lw(kl(process.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile"),(...o)=>fetch(...o).then(s=>{if(!s.ok)throw new Error("Unauthorized");return s.status===204?null:s.json()}));return t?{user:null,isLoading:!1,error:t,invalidate:()=>r()}:e?{user:e,isLoading:!1,error:null,invalidate:()=>r()}:{user:e,isLoading:n,error:t,invalidate:()=>r()}}class lt extends Error{}class jn extends lt{constructor({code:t,message:n}){super(n??"An error occured while interacting with the authorization server."),this.name="OAuth2Error",this.code=t}}class pw extends lt{constructor(t){super(t??"Discovery failed for the OpenID Connect configuration."),this.code="discovery_error",this.name="DiscoveryError"}}class mw extends lt{constructor(t){super(t??"The state parameter is missing."),this.code="missing_state",this.name="MissingStateError"}}class gw extends lt{constructor(t){super(t??"The state parameter is invalid."),this.code="invalid_state",this.name="InvalidStateError"}}class Nl extends lt{constructor({cause:t,message:n}){super(n??"An error occured during the authorization flow."),this.code="authorization_error",this.cause=t,this.name="AuthorizationError"}}class bw extends lt{constructor(t){super(t??"An error occured while preparing or performing the authorization code grant request."),this.code="authorization_code_grant_request_error",this.name="AuthorizationCodeGrantRequestError"}}class yw extends lt{constructor({cause:t,message:n}){super(n??"An error occured while trying to exchange the authorization code."),this.code="authorization_code_grant_error",this.cause=t,this.name="AuthorizationCodeGrantError"}}class Pt extends lt{constructor(t){super(t??"An error occured while completing the backchannel logout request."),this.code="backchannel_logout_error",this.name="BackchannelLogoutError"}}var pn;(function(e){e.MISSING_SESSION="missing_session",e.MISSING_REFRESH_TOKEN="missing_refresh_token",e.FAILED_TO_REFRESH_TOKEN="failed_to_refresh_token"})(pn||(pn={}));class Ps extends lt{constructor(t,n,r){super(n),this.name="AccessTokenError",this.code=t,this.cause=r}}var Hn;(function(e){e.MISSING_SESSION="missing_session",e.MISSING_REFRESH_TOKEN="missing_refresh_token",e.FAILED_TO_EXCHANGE="failed_to_exchange_refresh_token"})(Hn||(Hn={}));class Os extends lt{constructor(t,n,r){super(n),this.name="AccessTokenForConnectionError",this.code=t,this.cause=r}}function ww({user:e,children:t}){return W.createElement(uw,{value:{fallback:{[process.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile"]:e}}},t)}function Il(e){const t=e+"CollectionProvider",[n,r]=Ut(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:g,children:p}=y,b=W.useRef(null),f=W.useRef(new Map).current;return w.jsx(o,{scope:g,itemMap:f,collectionRef:b,children:p})};a.displayName=t;const i=e+"CollectionSlot",c=Qt(i),u=W.forwardRef((y,g)=>{const{scope:p,children:b}=y,f=s(i,p),A=Te(g,f.collectionRef);return w.jsx(c,{ref:A,children:b})});u.displayName=i;const l=e+"CollectionItemSlot",d="data-radix-collection-item",h=Qt(l),m=W.forwardRef((y,g)=>{const{scope:p,children:b,...f}=y,A=W.useRef(null),E=Te(g,A),R=s(l,p);return W.useEffect(()=>(R.itemMap.set(A,{ref:A,...f}),()=>void R.itemMap.delete(A))),w.jsx(h,{[d]:"",ref:E,children:b})});m.displayName=l;function _(y){const g=s(e+"CollectionConsumer",y);return W.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const f=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((R,v)=>f.indexOf(R.ref.current)-f.indexOf(v.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},_,r]}var vw=S.createContext(void 0);function Dl(e){const t=S.useContext(vw);return e||t||"ltr"}var ks="rovingFocusGroup.onEntryFocus",Ew={bubbles:!1,cancelable:!0},Un="RovingFocusGroup",[Ns,Ml,_w]=Il(Un),[Sw,Ll]=Ut(Un,[_w]),[xw,Aw]=Sw(Un),jl=S.forwardRef((e,t)=>w.jsx(Ns.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ns.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Rw,{...e,ref:t})})}));jl.displayName=Un;var Rw=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:l=!1,...d}=e,h=S.useRef(null),m=Te(t,h),_=Dl(s),[y,g]=Pn({prop:a,defaultProp:i??null,onChange:c,caller:Un}),[p,b]=S.useState(!1),f=ot(u),A=Ml(n),E=S.useRef(!1),[R,v]=S.useState(0);return S.useEffect(()=>{const x=h.current;if(x)return x.addEventListener(ks,f),()=>x.removeEventListener(ks,f)},[f]),w.jsx(xw,{scope:n,orientation:r,dir:_,loop:o,currentTabStopId:y,onItemFocus:S.useCallback(x=>g(x),[g]),onItemShiftTab:S.useCallback(()=>b(!0),[]),onFocusableItemAdd:S.useCallback(()=>v(x=>x+1),[]),onFocusableItemRemove:S.useCallback(()=>v(x=>x-1),[]),children:w.jsx(xe.div,{tabIndex:p||R===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{E.current=!0}),onFocus:Z(e.onFocus,x=>{const C=!E.current;if(x.target===x.currentTarget&&C&&!p){const D=new CustomEvent(ks,Ew);if(x.currentTarget.dispatchEvent(D),!D.defaultPrevented){const I=A().filter(V=>V.focusable),P=I.find(V=>V.active),U=I.find(V=>V.id===y),oe=[P,U,...I].filter(Boolean).map(V=>V.ref.current);$l(oe,l)}}E.current=!1}),onBlur:Z(e.onBlur,()=>b(!1))})})}),Hl="RovingFocusGroupItem",Ul=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...i}=e,c=mt(),u=s||c,l=Aw(Hl,n),d=l.currentTabStopId===u,h=Ml(n),{onFocusableItemAdd:m,onFocusableItemRemove:_,currentTabStopId:y}=l;return S.useEffect(()=>{if(r)return m(),()=>_()},[r,m,_]),w.jsx(Ns.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:w.jsx(xe.span,{tabIndex:d?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:Z(e.onMouseDown,g=>{r?l.onItemFocus(u):g.preventDefault()}),onFocus:Z(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){l.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const p=Pw(g,l.orientation,l.dir);if(p!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let f=h().filter(A=>A.focusable).map(A=>A.ref.current);if(p==="last")f.reverse();else if(p==="prev"||p==="next"){p==="prev"&&f.reverse();const A=f.indexOf(g.currentTarget);f=l.loop?Ow(f,A+1):f.slice(A+1)}setTimeout(()=>$l(f))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:y!=null}):a})})});Ul.displayName=Hl;var Cw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Tw(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pw(e,t,n){const r=Tw(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Cw[r]}function $l(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ow(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kw=jl,Nw=Ul,Is=["Enter"," "],Iw=["ArrowDown","PageUp","Home"],Wl=["ArrowUp","PageDown","End"],Dw=[...Iw,...Wl],Mw={ltr:[...Is,"ArrowRight"],rtl:[...Is,"ArrowLeft"]},Lw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$n="Menu",[Wn,jw,Hw]=Il($n),[Ft,Fl]=Ut($n,[Hw,Or,Ll]),Fn=Or(),Kl=Ll(),[ql,Ot]=Ft($n),[Uw,Kn]=Ft($n),zl=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=e,i=Fn(t),[c,u]=S.useState(null),l=S.useRef(!1),d=ot(s),h=Dl(o);return S.useEffect(()=>{const m=()=>{l.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>l.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(os,{...i,children:w.jsx(ql,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:u,children:w.jsx(Uw,{scope:t,onClose:S.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:l,dir:h,modal:a,children:r})})})};zl.displayName=$n;var $w="MenuAnchor",Ds=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fn(n);return w.jsx($u,{...o,...r,ref:t})});Ds.displayName=$w;var Ms="MenuPortal",[Ww,Gl]=Ft(Ms,{forceMount:void 0}),Bl=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Ot(Ms,t);return w.jsx(Ww,{scope:t,forceMount:n,children:w.jsx(gt,{present:n||s.open,children:w.jsx(Co,{asChild:!0,container:o,children:r})})})};Bl.displayName=Ms;var Ye="MenuContent",[Fw,Ls]=Ft(Ye),Vl=S.forwardRef((e,t)=>{const n=Gl(Ye,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ot(Ye,e.__scopeMenu),a=Kn(Ye,e.__scopeMenu);return w.jsx(Wn.Provider,{scope:e.__scopeMenu,children:w.jsx(gt,{present:r||s.open,children:w.jsx(Wn.Slot,{scope:e.__scopeMenu,children:a.modal?w.jsx(Kw,{...o,ref:t}):w.jsx(qw,{...o,ref:t})})})})}),Kw=S.forwardRef((e,t)=>{const n=Ot(Ye,e.__scopeMenu),r=S.useRef(null),o=Te(t,r);return S.useEffect(()=>{const s=r.current;if(s)return Wc(s)},[]),w.jsx(js,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),qw=S.forwardRef((e,t)=>{const n=Ot(Ye,e.__scopeMenu);return w.jsx(js,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zw=Qt("MenuContent.ScrollLock"),js=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:_,...y}=e,g=Ot(Ye,n),p=Kn(Ye,n),b=Fn(n),f=Kl(n),A=jw(n),[E,R]=S.useState(null),v=S.useRef(null),x=Te(t,v,g.onContentChange),C=S.useRef(0),D=S.useRef(""),I=S.useRef(0),P=S.useRef(null),U=S.useRef("right"),G=S.useRef(0),oe=_?Io:S.Fragment,V=_?{as:zw,allowPinchZoom:!0}:void 0,Y=j=>{var te,le;const T=D.current+j,H=A().filter(ue=>!ue.disabled),J=document.activeElement,X=(te=H.find(ue=>ue.ref.current===J))==null?void 0:te.textValue,se=H.map(ue=>ue.textValue),fe=rv(se,T,X),we=(le=H.find(ue=>ue.textValue===fe))==null?void 0:le.ref.current;(function ue(ye){D.current=ye,window.clearTimeout(C.current),ye!==""&&(C.current=window.setTimeout(()=>ue(""),1e3))})(T),we&&setTimeout(()=>we.focus())};S.useEffect(()=>()=>window.clearTimeout(C.current),[]),Rc();const O=S.useCallback(j=>{var H,J;return U.current===((H=P.current)==null?void 0:H.side)&&sv(j,(J=P.current)==null?void 0:J.area)},[]);return w.jsx(Fw,{scope:n,searchRef:D,onItemEnter:S.useCallback(j=>{O(j)&&j.preventDefault()},[O]),onItemLeave:S.useCallback(j=>{var T;O(j)||((T=v.current)==null||T.focus(),R(null))},[O]),onTriggerLeave:S.useCallback(j=>{O(j)&&j.preventDefault()},[O]),pointerGraceTimerRef:I,onPointerGraceIntentChange:S.useCallback(j=>{P.current=j},[]),children:w.jsx(oe,{...V,children:w.jsx(Ro,{asChild:!0,trapped:o,onMountAutoFocus:Z(s,j=>{var T;j.preventDefault(),(T=v.current)==null||T.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:w.jsx(lr,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,onDismiss:m,children:w.jsx(kw,{asChild:!0,...f,dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:R,onEntryFocus:Z(c,j=>{p.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Wu,{role:"menu","aria-orientation":"vertical","data-state":fd(g.open),"data-radix-menu-content":"",dir:p.dir,...b,...y,ref:x,style:{outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,j=>{const H=j.target.closest("[data-radix-menu-content]")===j.currentTarget,J=j.ctrlKey||j.altKey||j.metaKey,X=j.key.length===1;H&&(j.key==="Tab"&&j.preventDefault(),!J&&X&&Y(j.key));const se=v.current;if(j.target!==se||!Dw.includes(j.key))return;j.preventDefault();const we=A().filter(te=>!te.disabled).map(te=>te.ref.current);Wl.includes(j.key)&&we.reverse(),tv(we)}),onBlur:Z(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(C.current),D.current="")}),onPointerMove:Z(e.onPointerMove,zn(j=>{const T=j.target,H=G.current!==j.clientX;if(j.currentTarget.contains(T)&&H){const J=j.clientX>G.current?"right":"left";U.current=J,G.current=j.clientX}}))})})})})})})});Vl.displayName=Ye;var Gw="MenuGroup",Hs=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{role:"group",...r,ref:t})});Hs.displayName=Gw;var Bw="MenuLabel",Jl=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{...r,ref:t})});Jl.displayName=Bw;var $r="MenuItem",Xl="menu.itemSelect",Wr=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=S.useRef(null),a=Kn($r,e.__scopeMenu),i=Ls($r,e.__scopeMenu),c=Te(t,s),u=S.useRef(!1),l=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(Xl,{bubbles:!0,cancelable:!0});d.addEventListener(Xl,m=>r==null?void 0:r(m),{once:!0}),Wi(d,h),h.defaultPrevented?u.current=!1:a.onClose()}};return w.jsx(Yl,{...o,ref:c,disabled:n,onClick:Z(e.onClick,l),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:Z(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:Z(e.onKeyDown,d=>{const h=i.searchRef.current!=="";n||h&&d.key===" "||Is.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Wr.displayName=$r;var Yl=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,a=Ls($r,n),i=Kl(n),c=S.useRef(null),u=Te(t,c),[l,d]=S.useState(!1),[h,m]=S.useState("");return S.useEffect(()=>{const _=c.current;_&&m((_.textContent??"").trim())},[s.children]),w.jsx(Wn.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:w.jsx(Nw,{asChild:!0,...i,focusable:!r,children:w.jsx(xe.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:Z(e.onPointerMove,zn(_=>{r?a.onItemLeave(_):(a.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,zn(_=>a.onItemLeave(_))),onFocus:Z(e.onFocus,()=>d(!0)),onBlur:Z(e.onBlur,()=>d(!1))})})})}),Vw="MenuCheckboxItem",Zl=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return w.jsx(rd,{scope:e.__scopeMenu,checked:n,children:w.jsx(Wr,{role:"menuitemcheckbox","aria-checked":Fr(n)?"mixed":n,...o,ref:t,"data-state":Ws(n),onSelect:Z(o.onSelect,()=>r==null?void 0:r(Fr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Zl.displayName=Vw;var Ql="MenuRadioGroup",[Jw,Xw]=Ft(Ql,{value:void 0,onValueChange:()=>{}}),ed=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=ot(r);return w.jsx(Jw,{scope:e.__scopeMenu,value:n,onValueChange:s,children:w.jsx(Hs,{...o,ref:t})})});ed.displayName=Ql;var td="MenuRadioItem",nd=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=Xw(td,e.__scopeMenu),s=n===o.value;return w.jsx(rd,{scope:e.__scopeMenu,checked:s,children:w.jsx(Wr,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Ws(s),onSelect:Z(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});nd.displayName=td;var Us="MenuItemIndicator",[rd,Yw]=Ft(Us,{checked:!1}),od=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Yw(Us,n);return w.jsx(gt,{present:r||Fr(s.checked)||s.checked===!0,children:w.jsx(xe.span,{...o,ref:t,"data-state":Ws(s.checked)})})});od.displayName=Us;var Zw="MenuSeparator",sd=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});sd.displayName=Zw;var Qw="MenuArrow",ad=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fn(n);return w.jsx(Fu,{...o,...r,ref:t})});ad.displayName=Qw;var $s="MenuSub",[ev,id]=Ft($s),cd=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Ot($s,t),a=Fn(t),[i,c]=S.useState(null),[u,l]=S.useState(null),d=ot(o);return S.useEffect(()=>(s.open===!1&&d(!1),()=>d(!1)),[s.open,d]),w.jsx(os,{...a,children:w.jsx(ql,{scope:t,open:r,onOpenChange:d,content:u,onContentChange:l,children:w.jsx(ev,{scope:t,contentId:mt(),triggerId:mt(),trigger:i,onTriggerChange:c,children:n})})})};cd.displayName=$s;var qn="MenuSubTrigger",ud=S.forwardRef((e,t)=>{const n=Ot(qn,e.__scopeMenu),r=Kn(qn,e.__scopeMenu),o=id(qn,e.__scopeMenu),s=Ls(qn,e.__scopeMenu),a=S.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},l=S.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return S.useEffect(()=>l,[l]),S.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),c(null)}},[i,c]),w.jsx(Ds,{asChild:!0,...u,children:w.jsx(Yl,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fd(n.open),...e,ref:or(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(e.onPointerMove,zn(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),l()},100))})),onPointerLeave:Z(e.onPointerLeave,zn(d=>{var m,_;l();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const y=(_=n.content)==null?void 0:_.dataset.side,g=y==="right",p=g?-5:5,b=h[g?"left":"right"],f=h[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:b,y:h.top},{x:f,y:h.top},{x:f,y:h.bottom},{x:b,y:h.bottom}],side:y}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Z(e.onKeyDown,d=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||Mw[r.dir].includes(d.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),d.preventDefault())})})})});ud.displayName=qn;var ld="MenuSubContent",dd=S.forwardRef((e,t)=>{const n=Gl(Ye,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ot(Ye,e.__scopeMenu),a=Kn(Ye,e.__scopeMenu),i=id(ld,e.__scopeMenu),c=S.useRef(null),u=Te(t,c);return w.jsx(Wn.Provider,{scope:e.__scopeMenu,children:w.jsx(gt,{present:r||s.open,children:w.jsx(Wn.Slot,{scope:e.__scopeMenu,children:w.jsx(js,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{var d;a.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:Z(e.onFocusOutside,l=>{l.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Z(e.onEscapeKeyDown,l=>{a.onClose(),l.preventDefault()}),onKeyDown:Z(e.onKeyDown,l=>{var m;const d=l.currentTarget.contains(l.target),h=Lw[a.dir].includes(l.key);d&&h&&(s.onOpenChange(!1),(m=i.trigger)==null||m.focus(),l.preventDefault())})})})})})});dd.displayName=ld;function fd(e){return e?"open":"closed"}function Fr(e){return e==="indeterminate"}function Ws(e){return Fr(e)?"indeterminate":e?"checked":"unchecked"}function tv(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function nv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function rv(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=nv(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function ov(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],c=t[a],u=i.x,l=i.y,d=c.x,h=c.y;l>r!=h>r&&n<(d-u)*(r-l)/(h-l)+u&&(o=!o)}return o}function sv(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ov(n,t)}function zn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var av=zl,iv=Ds,cv=Bl,uv=Vl,lv=Hs,dv=Jl,fv=Wr,hv=Zl,pv=ed,mv=nd,gv=od,bv=sd,yv=ad,wv=cd,vv=ud,Ev=dd,Kr="DropdownMenu",[_v,q2]=Ut(Kr,[Fl]),Ue=Fl(),[Sv,hd]=_v(Kr),pd=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,c=Ue(t),u=S.useRef(null),[l,d]=Pn({prop:o,defaultProp:s??!1,onChange:a,caller:Kr});return w.jsx(Sv,{scope:t,triggerId:mt(),triggerRef:u,contentId:mt(),open:l,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(h=>!h),[d]),modal:i,children:w.jsx(av,{...c,open:l,onOpenChange:d,dir:r,modal:i,children:n})})};pd.displayName=Kr;var md="DropdownMenuTrigger",gd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=hd(md,n),a=Ue(n);return w.jsx(iv,{asChild:!0,...a,children:w.jsx(xe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:or(t,s.triggerRef),onPointerDown:Z(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:Z(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});gd.displayName=md;var xv="DropdownMenuPortal",bd=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ue(t);return w.jsx(cv,{...r,...n})};bd.displayName=xv;var yd="DropdownMenuContent",wd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hd(yd,n),s=Ue(n),a=S.useRef(!1);return w.jsx(uv,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:Z(e.onCloseAutoFocus,i=>{var c;a.current||(c=o.triggerRef.current)==null||c.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:Z(e.onInteractOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,l=c.button===2||u;(!o.modal||l)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wd.displayName=yd;var Av="DropdownMenuGroup",vd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(lv,{...o,...r,ref:t})});vd.displayName=Av;var Rv="DropdownMenuLabel",Ed=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(dv,{...o,...r,ref:t})});Ed.displayName=Rv;var Cv="DropdownMenuItem",_d=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(fv,{...o,...r,ref:t})});_d.displayName=Cv;var Tv="DropdownMenuCheckboxItem",Sd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(hv,{...o,...r,ref:t})});Sd.displayName=Tv;var Pv="DropdownMenuRadioGroup",xd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(pv,{...o,...r,ref:t})});xd.displayName=Pv;var Ov="DropdownMenuRadioItem",Ad=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(mv,{...o,...r,ref:t})});Ad.displayName=Ov;var kv="DropdownMenuItemIndicator",Rd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(gv,{...o,...r,ref:t})});Rd.displayName=kv;var Nv="DropdownMenuSeparator",Cd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(bv,{...o,...r,ref:t})});Cd.displayName=Nv;var Iv="DropdownMenuArrow",Dv=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(yv,{...o,...r,ref:t})});Dv.displayName=Iv;var Mv=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,a=Ue(t),[i,c]=Pn({prop:r,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return w.jsx(wv,{...a,open:i,onOpenChange:c,children:n})},Lv="DropdownMenuSubTrigger",Td=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(vv,{...o,...r,ref:t})});Td.displayName=Lv;var jv="DropdownMenuSubContent",Pd=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ue(n);return w.jsx(Ev,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pd.displayName=jv;var Hv=pd,Uv=gd,Od=bd,$v=wd,Wv=vd,Fv=Ed,Kv=_d,qv=Sd,zv=xd,Gv=Ad,kd=Rd,Bv=Cd,Vv=Mv,Jv=Td,Xv=Pd;function Nd({...e}){return w.jsx(Hv,{"data-slot":"dropdown-menu",...e})}function Yv({...e}){return w.jsx(Od,{"data-slot":"dropdown-menu-portal",...e})}function Id({...e}){return w.jsx(Uv,{"data-slot":"dropdown-menu-trigger",...e})}function Dd({className:e,sideOffset:t=4,...n}){return w.jsx(Od,{children:w.jsx($v,{"data-slot":"dropdown-menu-content",sideOffset:t,className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Zv({...e}){return w.jsx(Wv,{"data-slot":"dropdown-menu-group",...e})}function Fs({className:e,inset:t,variant:n="default",...r}){return w.jsx(Kv,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:F("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Qv({className:e,children:t,checked:n,...r}){return w.jsxs(qv,{"data-slot":"dropdown-menu-checkbox-item",className:F("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[w.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:w.jsx(kd,{children:w.jsx(im,{className:"size-4"})})}),t]})}function e0({...e}){return w.jsx(zv,{"data-slot":"dropdown-menu-radio-group",...e})}function t0({className:e,children:t,...n}){return w.jsxs(Gv,{"data-slot":"dropdown-menu-radio-item",className:F("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[w.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:w.jsx(kd,{children:w.jsx(lm,{className:"size-2 fill-current"})})}),t]})}function Md({className:e,inset:t,...n}){return w.jsx(Fv,{"data-slot":"dropdown-menu-label","data-inset":t,className:F("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function Ld({className:e,...t}){return w.jsx(Bv,{"data-slot":"dropdown-menu-separator",className:F("bg-border -mx-1 my-1 h-px",e),...t})}function n0({className:e,...t}){return w.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:F("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function r0({...e}){return w.jsx(Vv,{"data-slot":"dropdown-menu-sub",...e})}function o0({className:e,inset:t,children:n,...r}){return w.jsxs(Jv,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:F("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,w.jsx(fc,{className:"ml-auto size-4"})]})}function s0({className:e,...t}){return w.jsx(Xv,{"data-slot":"dropdown-menu-sub-content",className:F("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}const jd=({onLogout:e})=>{const{user:t,error:n,isLoading:r}=hw(),o=async()=>{try{e&&await e(),window.location.href="/auth/logout"}catch(s){console.error("Error during logout:",s),window.location.href="/auth/logout"}};return r?w.jsx("div",{className:"h-10 w-10 animate-pulse rounded-full bg-gray-200"}):n?w.jsxs("div",{children:["Error: ",n.message]}):t?w.jsx("div",{className:"relative flex items-center gap-3",children:w.jsxs(Nd,{children:[w.jsx(Id,{asChild:!0,children:w.jsx(ur,{variant:"ghost",size:"lg",className:"rounded-full cursor-pointer p-0",children:t.picture?w.jsx("img",{src:t.picture,alt:t.name||"User profile",width:40,height:40,className:"rounded-full"}):w.jsx(pc,{className:"h-5 w-5 text-gray-500"})})}),w.jsxs(Dd,{align:"end",className:"w-72",children:[w.jsx(Md,{children:w.jsx("div",{className:"flex flex-col space-y-1",children:w.jsxs("div",{className:"flex flex-col space-y-1",children:[w.jsx("p",{className:"text-xs text-gray-500",children:t.name}),w.jsx("p",{className:"truncate text-xs text-gray-500",children:t.email})]})})}),w.jsx(Ld,{}),w.jsx(Fs,{asChild:!0,children:w.jsxs("a",{href:"/profile",className:"flex w-full cursor-default",children:[w.jsx(pc,{className:"mr-2 h-4 w-4"}),w.jsx("span",{children:"Profile"})]})}),w.jsxs(Fs,{onClick:o,children:[w.jsx(dm,{className:"mr-2 h-4 w-4"}),w.jsx("span",{children:"Sign out"})]})]})]})}):null},Hd=({onLogout:e})=>w.jsx("div",{className:"sticky top-0 z-50 bg-white",children:w.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-white px-4",children:[w.jsxs("div",{className:"flex h-full items-center gap-4 flex-1 min-w-0 overflow-hidden",children:[w.jsx(tl,{}),w.jsx(ir,{orientation:"vertical"})]}),w.jsx("div",{className:"flex-shrink-0",children:w.jsx(jd,{onLogout:e})})]})});function a0({className:e,...t}){return w.jsx("div",{"data-slot":"card",className:F("bg-card text-card-foreground flex flex-col gap-4 rounded-xl py-6 shadow-sm",e),...t})}function i0({className:e,...t}){return w.jsx("div",{"data-slot":"card-header",className:F("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function c0({className:e,...t}){return w.jsx("div",{"data-slot":"card-title",className:F("leading-none font-semibold",e),...t})}function u0({className:e,...t}){return w.jsx("div",{"data-slot":"card-description",className:F("text-muted-foreground text-sm",e),...t})}function l0({className:e,...t}){return w.jsx("div",{"data-slot":"card-action",className:F("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function d0({className:e,...t}){return w.jsx("div",{"data-slot":"card-content",className:F("px-6",e),...t})}function f0({className:e,...t}){return w.jsx("div",{"data-slot":"card-footer",className:F("flex items-center px-6 [.border-t]:pt-6",e),...t})}function Ud({title:e,url:t,children:n,defaultOpen:r=!1,icon:o,isActive:s=!1,className:a,disabled:i=!1}){const[c,u]=S.useState(r);S.useEffect(()=>{s&&u(!0)},[s]);const l=!i&&t;return w.jsx(al,{className:a,children:w.jsxs("div",{className:"flex flex-col",children:[w.jsxs("div",{className:"flex flex-row items-center justify-between",children:[l?w.jsxs("a",{href:t,className:F("flex flex-1 cursor-pointer items-center gap-2 rounded-lg p-2 transition-colors hover:bg-gray-100"),children:[o&&w.jsx("span",{className:F("text-gray-600"),children:o}),w.jsx("span",{className:F("text-gray-600"),children:e})]}):w.jsxs("div",{className:F("flex flex-1 items-center gap-2 rounded-lg p-2",i&&"cursor-default"),children:[o&&w.jsx("span",{className:F("text-gray-600"),children:o}),w.jsx("span",{className:F("text-gray-600"),children:e})]}),w.jsx("button",{type:"button",className:F("mr-3 rounded-lg p-2 text-gray-500",i?"cursor-default opacity-50":"hover:bg-gray-100 hover:text-gray-700"),onClick:d=>{d.preventDefault(),d.stopPropagation(),i||u(!c)},disabled:i,"aria-label":c?"Collapse section":"Expand section",children:c?w.jsx(cm,{className:"h-4 w-4"}):w.jsx(fc,{className:"h-4 w-4"})})]}),w.jsx("div",{className:F("overflow-hidden transition-all",c&&!i?"max-h-96":"max-h-0"),children:n})]})})}const h0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20141%2060'%3e%3cpath%20d='M0.059%2019.711V59.673H19.509V49.95H9.779V19.711H0.059Z'%20fill='%2385B9D1'%3e%3c/path%3e%3cpath%20d='M0%200L0.056%204.915V19.715H9.776V9.715H19.5V59.673H29.22V0H0Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M23.49%2019.717H9.776V29.439H23.49V19.717Z'%20fill='%23F68029'%3e%3c/path%3e%3cpath%20d='M0.0580006%2019.718L9.785%2029.445V19.718H0.0580006Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M9.777%2049.953L19.504%2059.679V49.953H9.777Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M50.213%2021.331C50.1839%2019.244%2050.325%2017.1581%2050.635%2015.094C50.8293%2013.6891%2051.2694%2012.3294%2051.935%2011.077C52.4295%2010.1519%2053.1979%209.4023%2054.135%208.93101C55.1033%208.49691%2056.1561%208.28375%2057.217%208.307C58.2628%208.27673%2059.3024%208.47715%2060.262%208.894C61.1441%209.33605%2061.8541%2010.059%2062.28%2010.949C62.8725%2012.1976%2063.2507%2013.5369%2063.399%2014.911C63.6554%2016.9922%2063.7717%2019.0882%2063.747%2021.185C63.7759%2023.338%2063.6421%2025.4901%2063.347%2027.623C63.1657%2029.0675%2062.7378%2030.4702%2062.082%2031.77C61.6022%2032.7122%2060.8471%2033.4862%2059.917%2033.989C58.9503%2034.4507%2057.888%2034.6768%2056.817%2034.649C55.7687%2034.6771%2054.7258%2034.4896%2053.753%2034.098C52.8534%2033.6775%2052.1275%2032.9579%2051.699%2032.062C51.0884%2030.7803%2050.7037%2029.4027%2050.562%2027.99C50.3018%2025.7802%2050.1852%2023.5559%2050.213%2021.331ZM54.913%2022.248C54.913%2023.6913%2054.9377%2024.9267%2054.987%2025.954C55.0147%2026.8043%2055.1127%2027.6509%2055.28%2028.485C55.3666%2029.0149%2055.5877%2029.5138%2055.922%2029.934C56.0643%2030.0868%2056.238%2030.207%2056.4312%2030.2862C56.6244%2030.3655%2056.8324%2030.4019%2057.041%2030.393C57.25%2030.3964%2057.4571%2030.3533%2057.6473%2030.2668C57.8375%2030.1803%2058.0062%2030.0526%2058.141%2029.893C58.4964%2029.4241%2058.7297%2028.8744%2058.82%2028.293C59.0025%2027.3609%2059.1128%2026.4161%2059.15%2025.467C59.2107%2024.3177%2059.2414%2022.936%2059.242%2021.322C59.242%2019.732%2059.224%2018.3747%2059.188%2017.25C59.169%2016.3373%2059.0736%2015.4278%2058.903%2014.531C58.8198%2013.9744%2058.5923%2013.4493%2058.243%2013.008C58.0929%2012.8491%2057.9104%2012.7244%2057.7078%2012.6422C57.5053%2012.5601%2057.2874%2012.5225%2057.069%2012.532C56.8667%2012.5304%2056.6668%2012.576%2056.4852%2012.6652C56.3036%2012.7544%2056.1453%2012.8848%2056.023%2013.046C55.6766%2013.5389%2055.4446%2014.103%2055.344%2014.697C55.1442%2015.6885%2055.0277%2016.695%2054.996%2017.706C54.9347%2018.9533%2054.904%2020.4697%2054.904%2022.255'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M83.329%2021.331C83.2999%2019.244%2083.441%2017.1581%2083.751%2015.094C83.9453%2013.6891%2084.3854%2012.3294%2085.051%2011.077C85.5455%2010.1519%2086.3139%209.40235%2087.251%208.93105C89.2087%208.112%2091.4106%208.09871%2093.378%208.89405C94.2601%209.33609%2094.9701%2010.0591%2095.396%2010.949C95.9885%2012.1976%2096.3667%2013.537%2096.515%2014.911C96.7714%2016.9922%2096.8877%2019.0883%2096.863%2021.185C96.8919%2023.3381%2096.7581%2025.4902%2096.463%2027.6231C96.2817%2029.0676%2095.8538%2030.4703%2095.198%2031.77C94.7182%2032.7123%2093.9631%2033.4862%2093.033%2033.989C92.0663%2034.4507%2091.004%2034.6769%2089.933%2034.649C88.8847%2034.6772%2087.8418%2034.4896%2086.869%2034.098C85.9694%2033.6775%2085.2435%2032.9579%2084.815%2032.062C84.2044%2030.7803%2083.8197%2029.4027%2083.678%2027.99C83.4178%2025.7803%2083.3012%2023.5559%2083.329%2021.331ZM88.029%2022.2481C88.029%2023.6914%2088.0537%2024.9267%2088.103%2025.954C88.1307%2026.8044%2088.2287%2027.6509%2088.396%2028.4851C88.4826%2029.015%2088.7037%2029.5139%2089.038%2029.934C89.1803%2030.0869%2089.354%2030.207%2089.5472%2030.2863C89.7404%2030.3655%2089.9484%2030.4019%2090.157%2030.393C90.366%2030.3964%2090.573%2030.3533%2090.7633%2030.2669C90.9535%2030.1804%2091.1222%2030.0527%2091.257%2029.893C91.6124%2029.4242%2091.8458%2028.8744%2091.936%2028.2931C92.1185%2027.3609%2092.2288%2026.4161%2092.266%2025.467C92.3267%2024.3177%2092.3574%2022.936%2092.358%2021.322C92.358%2019.732%2092.34%2018.3747%2092.304%2017.2501C92.2887%2016.3329%2092.1964%2015.4187%2092.028%2014.517C91.9448%2013.9605%2091.7173%2013.4354%2091.368%2012.994C91.2162%2012.8368%2091.0323%2012.7141%2090.8289%2012.6343C90.6255%2012.5544%2090.4072%2012.5192%2090.189%2012.531C89.9867%2012.5294%2089.7868%2012.575%2089.6052%2012.6643C89.4236%2012.7535%2089.2653%2012.8839%2089.143%2013.045C88.7966%2013.5379%2088.5646%2014.102%2088.464%2014.6961C88.2642%2015.6876%2088.1477%2016.6941%2088.116%2017.705C88.0547%2018.9524%2088.024%2020.4687%2088.024%2022.254'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M131.349%2034.65V8.32202H135.458V30.797H140.631V34.649L131.349%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M71.95%2034.65V8.33203H76.059V30.796H81.232V34.648L71.95%2034.65Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M104.833%2014.692C104.934%2014.098%20105.166%2013.534%20105.512%2013.041C105.634%2012.8798%20105.793%2012.7494%20105.974%2012.6602C106.156%2012.571%20106.356%2012.5253%20106.558%2012.527H110.103V8.30798H106.703C105.642%208.2848%20104.589%208.49794%20103.621%208.93197C102.684%209.40306%20101.915%2010.1527%20101.421%2011.078C100.756%2012.3304%20100.316%2013.6901%20100.121%2015.095C99.8114%2017.1591%2099.6706%2019.245%2099.7%2021.332C99.6722%2023.5568%2099.7885%2025.7811%20100.048%2027.991C100.19%2029.4037%20100.574%2030.7812%20101.185%2032.063C101.614%2032.9584%20102.34%2033.6778%20103.239%2034.099C104.212%2034.4899%20105.255%2034.6771%20106.303%2034.649L110.103%2034.613V30.393H106.522C106.313%2030.402%20106.105%2030.3657%20105.912%2030.2866C105.719%2030.2076%20105.545%2030.0876%20105.403%2029.935C105.069%2029.5144%20104.848%2029.0152%20104.761%2028.485C104.594%2027.6509%20104.496%2026.8043%20104.468%2025.954C104.419%2024.9266%20104.394%2023.6916%20104.394%2022.249C104.394%2020.4636%20104.425%2018.9473%20104.486%2017.7C104.518%2016.6894%20104.633%2015.6832%20104.833%2014.692Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M46.728%2019.247H42.878V30.395H41.828C41.6182%2030.4039%2041.409%2030.3669%2041.2149%2030.2868C41.0208%2030.2067%2040.8465%2030.0853%2040.704%2029.931C40.3695%2029.5106%2040.1485%2029.0113%2040.062%2028.481C39.894%2027.647%2039.7956%2026.8004%2039.768%2025.95C39.7187%2024.9227%2039.6944%2023.6877%2039.695%2022.245C39.695%2020.4597%2039.7257%2018.9434%2039.787%2017.696C39.8191%2016.6854%2039.9355%2015.6792%2040.135%2014.688C40.2357%2014.094%2040.4677%2013.53%2040.814%2013.037C40.9376%2012.8768%2041.0968%2012.7476%2041.2791%2012.6598C41.4614%2012.5719%2041.6617%2012.5278%2041.864%2012.531H45.904V8.31202H42.012C40.9511%208.28877%2039.8983%208.50191%2038.93%208.93601C37.9927%209.40699%2037.2241%2010.1567%2036.73%2011.082C36.0644%2012.3344%2035.6243%2013.6941%2035.43%2015.099C35.1189%2017.1613%2034.9764%2019.2456%2035.004%2021.331C34.9762%2023.5559%2035.0925%2025.7802%2035.352%2027.99C35.494%2029.4026%2035.8787%2030.7802%2036.489%2032.062C36.9179%2032.9579%2037.6442%2033.6775%2038.544%2034.098C39.517%2034.4891%2040.5598%2034.6763%2041.608%2034.648L43.587%2034.629H46.727L46.728%2019.247Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M123.653%2029.87H118L116.691%2034.65H112.797L120.939%208L128.793%2034.65H124.856L123.653%2029.87ZM122.587%2026.212L120.893%2019.982L119.085%2026.212H122.587Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M39.016%2041.436H37.059V54.507H39.016V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M44.559%2041.436H46.384L48.331%2046.651C48.919%2048.1937%2049.4198%2049.7682%2049.831%2051.367C49.6744%2050.357%2049.5584%2049.4427%2049.483%2048.624C49.4077%2047.8054%2049.37%2047.0347%2049.37%2046.312V41.436H51.336V54.511H49.495L47.303%2048.627C47.103%2048.0797%2046.9134%2047.518%2046.734%2046.942C46.5547%2046.366%2046.39%2045.762%2046.24%2045.13C46.2274%2045.0507%2046.207%2044.9547%2046.179%2044.842C46.151%2044.7293%2046.1177%2044.5997%2046.079%2044.453C46.098%2044.6%2046.114%2044.725%2046.126%2044.829C46.138%2044.933%2046.148%2045.022%2046.154%2045.095L46.254%2046.424L46.354%2048.041C46.36%2048.131%2046.365%2048.241%2046.368%2048.371C46.371%2048.501%2046.368%2048.648%2046.368%2048.811L46.468%2054.511H44.559V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M55.493%2041.436H61.861V42.977H59.67V54.511H57.751V42.977H55.493V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M65.828%2041.436H71.028V42.926H67.787V47.065H70.665V48.555H67.787V53.016H71.028V54.506H65.828V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M75.906%2041.436H78.483C79.3332%2041.3696%2080.1787%2041.6132%2080.863%2042.122C81.2131%2042.4774%2081.4826%2042.904%2081.6531%2043.3729C81.8236%2043.8417%2081.8911%2044.3418%2081.851%2044.839C81.8876%2045.6248%2081.7066%2046.4055%2081.328%2047.095C81.1685%2047.3665%2080.9531%2047.6008%2080.696%2047.7826C80.4389%2047.9643%2080.1461%2048.0892%2079.837%2048.149L82.509%2054.507H80.525L77.863%2048.107V54.507H75.906V41.436ZM77.863%2047.227C78.1485%2047.2893%2078.4451%2047.279%2078.7256%2047.1969C79.0061%2047.1148%2079.2615%2046.9637%2079.4684%2046.7573C79.6753%2046.5509%2079.8271%2046.2959%2079.9098%2046.0156C79.9926%2045.7353%2080.0036%2045.4387%2079.942%2045.153C79.9472%2044.8034%2079.9137%2044.4543%2079.842%2044.112C79.7909%2043.8589%2079.6851%2043.62%2079.532%2043.412C79.3909%2043.2304%2079.2018%2043.0918%2078.986%2043.012C78.7308%2042.9221%2078.4615%2042.8791%2078.191%2042.885H77.862L77.863%2047.227Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M90.046%2041.06L85.913%2054.514H87.745L88.45%2051.974H91.496L92.135%2054.531H94.028L90.046%2041.06ZM88.876%2050.403L90.013%2046.703L91.048%2050.415L88.876%2050.403Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M106.344%2041.436H112.712V42.977H110.52V54.511H108.602V42.977H106.344V41.436Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M118.865%2041.462H116.908V54.533H118.865V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M134.181%2041.462H139.381V42.952H136.136V47.093H139.014V48.583H136.136V53.044H139.381V54.534H134.181V41.462Z'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M99.749%2044.338C99.8046%2044.0109%2099.9338%2043.7008%20100.127%2043.431C100.202%2043.3322%20100.3%2043.2523%20100.411%2043.1976C100.523%2043.1429%20100.646%2043.115%20100.77%2043.116H102.464V41.207H100.846C100.318%2041.1955%2099.7949%2041.3011%2099.313%2041.516C98.8543%2041.748%2098.4782%2042.1157%2098.236%2042.569C97.9008%2043.2016%2097.6788%2043.888%2097.58%2044.597C97.4215%2045.6561%2097.3493%2046.7263%2097.364%2047.797C97.3503%2048.9393%2097.4101%2050.0814%2097.543%2051.216C97.6145%2051.9294%2097.808%2052.6252%2098.115%2053.273C98.3244%2053.7086%2098.6776%2054.0586%2099.115%2054.264C99.6001%2054.458%20100.12%2054.5509%20100.642%2054.537L102.469%2054.52V52.61H100.755C100.629%2052.6147%20100.503%2052.592%20100.386%2052.5435C100.269%2052.495%20100.164%2052.4218%20100.078%2052.329C99.8888%2052.0951%2099.7637%2051.816%2099.715%2051.519C99.6273%2051.081%2099.5758%2050.6365%2099.561%2050.19C99.536%2049.66%2099.523%2049.014%2099.523%2048.27C99.523%2047.349%2099.539%2046.557%2099.57%2045.916C99.5873%2045.3865%2099.6485%2044.8594%2099.753%2044.34'%20fill='%230A3763'%3e%3c/path%3e%3cpath%20d='M128.799%2041.466L126.671%2048.91L124.671%2041.466H122.679L126.654%2054.953L130.774%2041.466H128.799Z'%20fill='%230A3763'%3e%3c/path%3e%3c/svg%3e";function $d(){const[e,t]=W.useState("");return W.useEffect(()=>{t(window.location.pathname);const r=()=>{t(window.location.pathname)},o=()=>{t(window.location.pathname)};return window.addEventListener("popstate",r),window.addEventListener("pushstate",o),window.addEventListener("replacestate",o),()=>{window.removeEventListener("popstate",r),window.removeEventListener("pushstate",o),window.removeEventListener("replacestate",o)}},[]),{currentPath:e,isActiveRoute:r=>!!(e===r||r!=="/"&&e.startsWith(r))}}const Wd=W.createContext(void 0),Fd=()=>{const e=W.useContext(Wd);if(e===void 0)throw new Error("usePermissions must be used within PermissionsProvider");return e};function p0({children:e,fetchPermissionsEndpoint:t="/api/auth/permissions",initialPermissions:n}){const[r,o]=W.useState(n||{essentialInsights:!1,priceMonster:!1,web:!1}),[s,a]=W.useState(!n),[i,c]=W.useState(null),u=async()=>{try{a(!0),c(null);const l=await fetch(t);if(!l.ok)throw new Error(`Failed to fetch permissions: ${l.statusText}`);const d=await l.json();o(d)}catch(l){console.error("Error fetching product access:",l),c(l instanceof Error?l:new Error("Unknown error"))}finally{a(!1)}};return W.useEffect(()=>{n||u()},[]),w.jsx(Wd.Provider,{value:{permissions:r,loading:s,error:i,fetchPermissions:u},children:e})}const m0={navMain:[{title:"Essential Insights",key:"essentialInsights",url:"/essential-insights/overall-performance",icon:w.jsx(am,{className:"h-5 w-5"}),items:[{title:"Overall Performance",url:"/essential-insights/overall-performance",icon:w.jsx(hc,{className:"h-4 w-4"})},{title:"Organic Performance",url:"/essential-insights/organic-performance",icon:w.jsx(dc,{className:"h-4 w-4"})},{title:"Paid Performance",url:"/essential-insights/paid-performance",icon:w.jsx(sm,{className:"h-4 w-4"})},{title:"Keyword Performance",url:"/essential-insights/keyword-performance",icon:w.jsx(dc,{className:"h-4 w-4"})},{title:"More Components",url:"/essential-insights/more-components",icon:w.jsx(cr,{className:"h-4 w-4"})}]},{title:"Price Monster",key:"priceMonster",url:"/price-monster",icon:w.jsx(um,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/price-monster/dashboard",icon:w.jsx(cr,{className:"h-4 w-4"})},{title:"Documentation",url:"/price-monster/documentation",icon:w.jsx(rm,{className:"h-4 w-4"})},{title:"Subscriptions",url:"/price-monster/subscriptions",icon:w.jsx(om,{className:"h-4 w-4"})}]},{title:"CMS",key:"web",url:"/cms",icon:w.jsx(cr,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/cms/dashboard",icon:w.jsx(cr,{className:"h-4 w-4"})}]}]};function Kd({...e}){const{isActiveRoute:t}=$d(),n=Fd();return w.jsxs(el,{...e,children:[w.jsx(ol,{children:w.jsx("div",{className:"relative h-12 w-32 overflow-hidden",children:w.jsx("img",{src:h0,alt:"GLI Logo",className:"h-full w-full object-contain"})})}),w.jsxs(sl,{children:[w.jsx("div",{className:"relative flex w-full min-w-0 flex-col px-2 py-1",children:w.jsxs("a",{href:"/",className:F("flex cursor-pointer items-center gap-2 rounded-lg px-2 py-2 transition-colors hover:bg-gray-100",t("/")&&"bg-blue-50 text-gli-bluedark font-medium"),children:[w.jsx(hc,{className:F("h-5 w-5",t("/")?"text-gli-bluedark":"text-gray-500")}),w.jsx("span",{children:"Home"})]})}),w.jsx(cs,{delayDuration:150,children:m0.navMain.map(r=>{const o=!r.key||n[r.key],s=o&&(t(r.url)||r.items.some(i=>t(i.url))),a=w.jsx(Ud,{url:o?r.url:void 0,title:r.title,icon:r.icon,isActive:!!s,disabled:!o,className:F(!o&&"opacity-50"),children:o&&w.jsx(il,{children:w.jsx(cl,{children:r.items.map(i=>{const c=t(i.url);return w.jsx(ul,{children:w.jsx(ll,{asChild:!0,children:w.jsxs("a",{href:i.url,className:F("flex items-center gap-2 pl-4 transition-colors text-muted-foreground hover:bg-muted hover:text-foreground",c&&"bg-blue-50 text-gli-bluedark font-medium"),children:[w.jsx("span",{className:F(c?"text-gli-bluedark":"text-muted-foreground"),children:i.icon}),w.jsx("span",{className:F(c?"text-gli-bluedark":"text-muted-foreground"),children:i.title})]})})},i.title)})})})},r.title);return r.key==="priceMonster"&&!o?w.jsxs(us,{children:[w.jsx(ls,{asChild:!0,children:w.jsx("div",{children:a})}),w.jsx(Dr,{side:"top",align:"center",children:"Coming soon"})]},r.title):a})})]}),w.jsx(nl,{})]})}var Gn={},Ks={},qs={},zs={},Gs,qd;function g0(){if(qd)return Gs;qd=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o=(E,R)=>{for(var v in R)e(E,v,{get:R[v],enumerable:!0})},s=(E,R,v,x)=>{if(R&&typeof R=="object"||typeof R=="function")for(let C of n(R))!r.call(E,C)&&C!==v&&e(E,C,{get:()=>R[C],enumerable:!(x=t(R,C))||x.enumerable});return E},a=E=>s(e({},"__esModule",{value:!0}),E),i={};o(i,{RequestCookies:()=>p,ResponseCookies:()=>b,parseCookie:()=>u,parseSetCookie:()=>l,stringifyCookie:()=>c}),Gs=a(i);function c(E){var R;const v=["path"in E&&E.path&&`Path=${E.path}`,"expires"in E&&(E.expires||E.expires===0)&&`Expires=${(typeof E.expires=="number"?new Date(E.expires):E.expires).toUTCString()}`,"maxAge"in E&&typeof E.maxAge=="number"&&`Max-Age=${E.maxAge}`,"domain"in E&&E.domain&&`Domain=${E.domain}`,"secure"in E&&E.secure&&"Secure","httpOnly"in E&&E.httpOnly&&"HttpOnly","sameSite"in E&&E.sameSite&&`SameSite=${E.sameSite}`,"partitioned"in E&&E.partitioned&&"Partitioned","priority"in E&&E.priority&&`Priority=${E.priority}`].filter(Boolean),x=`${E.name}=${encodeURIComponent((R=E.value)!=null?R:"")}`;return v.length===0?x:`${x}; ${v.join("; ")}`}function u(E){const R=new Map;for(const v of E.split(/; */)){if(!v)continue;const x=v.indexOf("=");if(x===-1){R.set(v,"true");continue}const[C,D]=[v.slice(0,x),v.slice(x+1)];try{R.set(C,decodeURIComponent(D??"true"))}catch{}}return R}function l(E){if(!E)return;const[[R,v],...x]=u(E),{domain:C,expires:D,httponly:I,maxage:P,path:U,samesite:G,secure:oe,partitioned:V,priority:Y}=Object.fromEntries(x.map(([j,T])=>[j.toLowerCase().replace(/-/g,""),T])),O={name:R,value:decodeURIComponent(v),domain:C,...D&&{expires:new Date(D)},...I&&{httpOnly:!0},...typeof P=="string"&&{maxAge:Number(P)},path:U,...G&&{sameSite:m(G)},...oe&&{secure:!0},...Y&&{priority:y(Y)},...V&&{partitioned:!0}};return d(O)}function d(E){const R={};for(const v in E)E[v]&&(R[v]=E[v]);return R}var h=["strict","lax","none"];function m(E){return E=E.toLowerCase(),h.includes(E)?E:void 0}var _=["low","medium","high"];function y(E){return E=E.toLowerCase(),_.includes(E)?E:void 0}function g(E){if(!E)return[];var R=[],v=0,x,C,D,I,P;function U(){for(;v<E.length&&/\s/.test(E.charAt(v));)v+=1;return v<E.length}function G(){return C=E.charAt(v),C!=="="&&C!==";"&&C!==","}for(;v<E.length;){for(x=v,P=!1;U();)if(C=E.charAt(v),C===","){for(D=v,v+=1,U(),I=v;v<E.length&&G();)v+=1;v<E.length&&E.charAt(v)==="="?(P=!0,v=I,R.push(E.substring(x,D)),x=v):v=D+1}else v+=1;(!P||v>=E.length)&&R.push(E.substring(x,E.length))}return R}var p=class{constructor(E){this._parsed=new Map,this._headers=E;const R=E.get("cookie");if(R){const v=u(R);for(const[x,C]of v)this._parsed.set(x,{name:x,value:C})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...E){const R=typeof E[0]=="string"?E[0]:E[0].name;return this._parsed.get(R)}getAll(...E){var R;const v=Array.from(this._parsed);if(!E.length)return v.map(([C,D])=>D);const x=typeof E[0]=="string"?E[0]:(R=E[0])==null?void 0:R.name;return v.filter(([C])=>C===x).map(([C,D])=>D)}has(E){return this._parsed.has(E)}set(...E){const[R,v]=E.length===1?[E[0].name,E[0].value]:E,x=this._parsed;return x.set(R,{name:R,value:v}),this._headers.set("cookie",Array.from(x).map(([C,D])=>c(D)).join("; ")),this}delete(E){const R=this._parsed,v=Array.isArray(E)?E.map(x=>R.delete(x)):R.delete(E);return this._headers.set("cookie",Array.from(R).map(([x,C])=>c(C)).join("; ")),v}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(E=>`${E.name}=${encodeURIComponent(E.value)}`).join("; ")}},b=class{constructor(E){this._parsed=new Map;var R,v,x;this._headers=E;const C=(x=(v=(R=E.getSetCookie)==null?void 0:R.call(E))!=null?v:E.get("set-cookie"))!=null?x:[],D=Array.isArray(C)?C:g(C);for(const I of D){const P=l(I);P&&this._parsed.set(P.name,P)}}get(...E){const R=typeof E[0]=="string"?E[0]:E[0].name;return this._parsed.get(R)}getAll(...E){var R;const v=Array.from(this._parsed.values());if(!E.length)return v;const x=typeof E[0]=="string"?E[0]:(R=E[0])==null?void 0:R.name;return v.filter(C=>C.name===x)}has(E){return this._parsed.has(E)}set(...E){const[R,v,x]=E.length===1?[E[0].name,E[0].value,E[0]]:E,C=this._parsed;return C.set(R,A({name:R,value:v,...x})),f(C,this._headers),this}delete(...E){const[R,v]=typeof E[0]=="string"?[E[0]]:[E[0].name,E[0]];return this.set({...v,name:R,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}};function f(E,R){R.delete("set-cookie");for(const[,v]of E){const x=c(v);R.append("set-cookie",x)}}function A(E={name:"",value:""}){return typeof E.expires=="number"&&(E.expires=new Date(E.expires)),E.maxAge&&(E.expires=new Date(Date.now()+E.maxAge*1e3)),(E.path===null||E.path===void 0)&&(E.path="/"),E}return Gs}var zd;function Bn(){return zd||(zd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(r,o){for(var s in o)Object.defineProperty(r,s,{enumerable:!0,get:o[s]})}t(e,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});const n=g0()}(zs)),zs}var Bs={},Gd;function Vs(){return Gd||(Gd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ReflectAdapter",{enumerable:!0,get:function(){return t}});class t{static get(r,o,s){const a=Reflect.get(r,o,s);return typeof a=="function"?a.bind(r):a}static set(r,o,s,a){return Reflect.set(r,o,s,a)}static has(r,o){return Reflect.has(r,o)}static deleteProperty(r,o){return Reflect.deleteProperty(r,o)}}}(Bs)),Bs}var Js={},Xs={},Ys={},Bd;function Zs(){return Bd||(Bd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return i}});const n=Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(u){return u}}const o=typeof globalThis<"u"&&globalThis.AsyncLocalStorage;function s(){return o?new o:new r}function a(c){return o?o.bind(c):r.bind(c)}function i(){return o?o.snapshot():function(c,...u){return c(...u)}}}(Ys)),Ys}var Vd;function b0(){return Vd||(Vd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,Zs().createAsyncLocalStorage)()}(Xs)),Xs}var Jd;function kt(){return Jd||(Jd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workAsyncStorage",{enumerable:!0,get:function(){return t.workAsyncStorageInstance}});const t=b0()}(Js)),Js}var Qs={},ea={},Xd;function y0(){return Xd||(Xd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"workUnitAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,Zs().createAsyncLocalStorage)()}(ea)),ea}var qr={exports:{}},Yd;function w0(){return Yd||(Yd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(f,A){for(var E in A)Object.defineProperty(f,E,{enumerable:!0,get:A[E]})}n(t,{ACTION_HEADER:function(){return o},FLIGHT_HEADERS:function(){return h},NEXT_DID_POSTPONE_HEADER:function(){return y},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return u},NEXT_HMR_REFRESH_HEADER:function(){return c},NEXT_IS_PRERENDER_HEADER:function(){return b},NEXT_REWRITTEN_PATH_HEADER:function(){return g},NEXT_REWRITTEN_QUERY_HEADER:function(){return p},NEXT_ROUTER_PREFETCH_HEADER:function(){return a},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return i},NEXT_ROUTER_STALE_TIME_HEADER:function(){return _},NEXT_ROUTER_STATE_TREE_HEADER:function(){return s},NEXT_RSC_UNION_QUERY:function(){return m},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return d},RSC_HEADER:function(){return r}});const r="RSC",o="Next-Action",s="Next-Router-State-Tree",a="Next-Router-Prefetch",i="Next-Router-Segment-Prefetch",c="Next-HMR-Refresh",u="__next_hmr_refresh_hash__",l="Next-Url",d="text/x-component",h=[r,s,a,c,i],m="_rsc",_="x-nextjs-stale-time",y="x-nextjs-postponed",g="x-nextjs-rewritten-path",p="x-nextjs-rewritten-query",b="x-nextjs-prerender";(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(qr,qr.exports)),qr.exports}var Zd;function Kt(){return Zd||(Zd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,d){for(var h in d)Object.defineProperty(l,h,{enumerable:!0,get:d[h]})}t(e,{getDraftModeProviderForCacheScope:function(){return u},getExpectedRequestStore:function(){return o},getHmrRefreshHash:function(){return c},getPrerenderResumeDataCache:function(){return a},getRenderResumeDataCache:function(){return i},throwForMissingRequestStore:function(){return s},workUnitAsyncStorage:function(){return n.workUnitAsyncStorageInstance}});const n=y0(),r=w0();function o(l){const d=n.workUnitAsyncStorageInstance.getStore();switch(d||s(l),d.type){case"request":return d;case"prerender":case"prerender-ppr":case"prerender-legacy":throw Object.defineProperty(new Error(`\`${l}\` cannot be called inside a prerender. This is a bug in Next.js.`),"__NEXT_ERROR_CODE",{value:"E401",enumerable:!1,configurable:!0});case"cache":throw Object.defineProperty(new Error(`\`${l}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E37",enumerable:!1,configurable:!0});case"unstable-cache":throw Object.defineProperty(new Error(`\`${l}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E69",enumerable:!1,configurable:!0});default:return d}}function s(l){throw Object.defineProperty(new Error(`\`${l}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E251",enumerable:!1,configurable:!0})}function a(l){return l.type==="prerender"||l.type==="prerender-ppr"?l.prerenderResumeDataCache:null}function i(l){return l.type!=="prerender-legacy"&&l.type!=="cache"&&l.type!=="unstable-cache"?l.type==="request"?l.renderResumeDataCache:l.prerenderResumeDataCache:null}function c(l,d){var h;if(l.dev)return d.type==="cache"||d.type==="prerender"?d.hmrRefreshHash:d.type==="request"?(h=d.cookies.get(r.NEXT_HMR_REFRESH_HASH_COOKIE))==null?void 0:h.value:void 0}function u(l,d){if(l.isDraftMode)switch(d.type){case"cache":case"unstable-cache":case"request":return d.draftMode;default:return}}}(Qs)),Qs}var Qd;function v0(){return Qd||(Qd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(g,p){for(var b in p)Object.defineProperty(g,b,{enumerable:!0,get:p[b]})}t(e,{MutableRequestCookiesAdapter:function(){return d},ReadonlyRequestCookiesError:function(){return a},RequestCookiesAdapter:function(){return i},appendMutableCookies:function(){return l},areCookiesMutableInCurrentPhase:function(){return m},getModifiedCookieValues:function(){return u},responseCookiesToRequestCookies:function(){return y},wrapWithMutableAccessCheck:function(){return h}});const n=Bn(),r=Vs(),o=kt(),s=Kt();class a extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new a}}class i{static seal(p){return new Proxy(p,{get(b,f,A){switch(f){case"clear":case"delete":case"set":return a.callable;default:return r.ReflectAdapter.get(b,f,A)}}})}}const c=Symbol.for("next.mutated.cookies");function u(g){const p=g[c];return!p||!Array.isArray(p)||p.length===0?[]:p}function l(g,p){const b=u(p);if(b.length===0)return!1;const f=new n.ResponseCookies(g),A=f.getAll();for(const E of b)f.set(E);for(const E of A)f.set(E);return!0}class d{static wrap(p,b){const f=new n.ResponseCookies(new Headers);for(const x of p.getAll())f.set(x);let A=[];const E=new Set,R=()=>{const x=o.workAsyncStorage.getStore();if(x&&(x.pathWasRevalidated=!0),A=f.getAll().filter(D=>E.has(D.name)),b){const D=[];for(const I of A){const P=new n.ResponseCookies(new Headers);P.set(I),D.push(P.toString())}b(D)}},v=new Proxy(f,{get(x,C,D){switch(C){case c:return A;case"delete":return function(...I){E.add(typeof I[0]=="string"?I[0]:I[0].name);try{return x.delete(...I),v}finally{R()}};case"set":return function(...I){E.add(typeof I[0]=="string"?I[0]:I[0].name);try{return x.set(...I),v}finally{R()}};default:return r.ReflectAdapter.get(x,C,D)}}});return v}}function h(g){const p=new Proxy(g,{get(b,f,A){switch(f){case"delete":return function(...E){return _("cookies().delete"),b.delete(...E),p};case"set":return function(...E){return _("cookies().set"),b.set(...E),p};default:return r.ReflectAdapter.get(b,f,A)}}});return p}function m(g){return g.phase==="action"}function _(g){const p=(0,s.getExpectedRequestStore)(g);if(!m(p))throw new a}function y(g){const p=new n.RequestCookies(new Headers);for(const b of g.getAll())p.set(b);return p}}(qs)),qs}var ta={},zr={exports:{}},ef;function tf(){return ef||(ef=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}n(t,{DynamicServerError:function(){return o},isDynamicServerError:function(){return s}});const r="DYNAMIC_SERVER_USAGE";class o extends Error{constructor(i){super("Dynamic server usage: "+i),this.description=i,this.digest=r}}function s(a){return typeof a!="object"||a===null||!("digest"in a)||typeof a.digest!="string"?!1:a.digest===r}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(zr,zr.exports)),zr.exports}var Gr={exports:{}},nf;function mn(){return nf||(nf=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}n(t,{StaticGenBailoutError:function(){return o},isStaticGenBailoutError:function(){return s}});const r="NEXT_STATIC_GEN_BAILOUT";class o extends Error{constructor(...i){super(...i),this.code=r}}function s(a){return typeof a!="object"||a===null||!("code"in a)?!1:a.code===r}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Gr,Gr.exports)),Gr.exports}var na={},rf;function Vn(){return rf||(rf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{isHangingPromiseRejectionError:function(){return n},makeHangingPromise:function(){return a}});function n(c){return typeof c!="object"||c===null||!("digest"in c)?!1:c.digest===r}const r="HANGING_PROMISE_REJECTION";class o extends Error{constructor(u){super(`During prerendering, ${u} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${u} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context.`),this.expression=u,this.digest=r}}const s=new WeakMap;function a(c,u){if(c.aborted)return Promise.reject(new o(u));{const l=new Promise((d,h)=>{const m=h.bind(null,new o(u));let _=s.get(c);if(_)_.push(m);else{const y=[m];s.set(c,y),c.addEventListener("abort",()=>{for(let g=0;g<y.length;g++)y[g]()},{once:!0})}});return l.catch(i),l}}function i(){}}(na)),na}var ra={},of;function E0(){return of||(of=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var i in a)Object.defineProperty(s,i,{enumerable:!0,get:a[i]})}t(e,{METADATA_BOUNDARY_NAME:function(){return n},OUTLET_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return r}});const n="__next_metadata_boundary__",r="__next_viewport_boundary__",o="__next_outlet_boundary__"}(ra)),ra}var oa={},sf;function sa(){return sf||(sf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}t(e,{atLeastOneTask:function(){return o},scheduleImmediate:function(){return r},scheduleOnNextTick:function(){return n},waitAtLeastOneReactRenderTask:function(){return s}});const n=a=>{Promise.resolve().then(()=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(a,0):process.nextTick(a)})},r=a=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(a,0):setImmediate(a)};function o(){return new Promise(a=>r(a))}function s(){return process.env.NEXT_RUNTIME==="edge"?new Promise(a=>setTimeout(a,0)):new Promise(a=>setImmediate(a))}}(oa)),oa}var af;function Jn(){return af||(af=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(k,N){for(var M in N)Object.defineProperty(k,M,{enumerable:!0,get:N[M]})}t(e,{Postpone:function(){return x},abortAndThrowOnSynchronousRequestDataAccess:function(){return R},abortOnSynchronousPlatformIOAccess:function(){return A},accessedDynamicData:function(){return V},annotateDynamicAccess:function(){return J},consumeDynamicAccess:function(){return Y},createDynamicTrackingState:function(){return h},createDynamicValidationState:function(){return m},createHangingInputAbortSignal:function(){return H},createPostponedAbortSignal:function(){return T},formatDynamicAPIAccesses:function(){return O},getFirstDynamicReason:function(){return _},isDynamicPostpone:function(){return I},isPrerenderInterruptedError:function(){return oe},markCurrentScopeAsDynamic:function(){return y},postponeWithTracking:function(){return C},throwIfDisallowedDynamic:function(){return ye},throwToInterruptStaticGeneration:function(){return p},trackAllowedDynamicAccess:function(){return le},trackDynamicDataInDynamicRender:function(){return b},trackFallbackParamAccessed:function(){return g},trackSynchronousPlatformIOAccessInDev:function(){return E},trackSynchronousRequestDataAccessInDev:function(){return v},useDynamicRouteParams:function(){return X}});const n=l(W),r=tf(),o=mn(),s=Kt(),a=kt(),i=Vn(),c=E0(),u=sa();function l(k){return k&&k.__esModule?k:{default:k}}const d=typeof n.default.unstable_postpone=="function";function h(k){return{isDebugDynamicAccesses:k,dynamicAccesses:[],syncDynamicExpression:void 0,syncDynamicErrorWithStack:null}}function m(){return{hasSuspendedDynamic:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasSyncDynamicErrors:!1,dynamicErrors:[]}}function _(k){var N;return(N=k.dynamicAccesses[0])==null?void 0:N.expression}function y(k,N,M){if(!(N&&(N.type==="cache"||N.type==="unstable-cache"))&&!(k.forceDynamic||k.forceStatic)){if(k.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${k.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${M}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(N)if(N.type==="prerender-ppr")C(k.route,M,N.dynamicTracking);else if(N.type==="prerender-legacy"){N.revalidate=0;const z=Object.defineProperty(new r.DynamicServerError(`Route ${k.route} couldn't be rendered statically because it used ${M}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw k.dynamicUsageDescription=M,k.dynamicUsageStack=z.stack,z}else process.env.NODE_ENV==="development"&&N&&N.type==="request"&&(N.usedDynamic=!0)}}function g(k,N){const M=s.workUnitAsyncStorage.getStore();!M||M.type!=="prerender-ppr"||C(k.route,N,M.dynamicTracking)}function p(k,N,M){const z=Object.defineProperty(new r.DynamicServerError(`Route ${N.route} couldn't be rendered statically because it used \`${k}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw M.revalidate=0,N.dynamicUsageDescription=k,N.dynamicUsageStack=z.stack,z}function b(k,N){if(N){if(N.type==="cache"||N.type==="unstable-cache")return;(N.type==="prerender"||N.type==="prerender-legacy")&&(N.revalidate=0),process.env.NODE_ENV==="development"&&N.type==="request"&&(N.usedDynamic=!0)}}function f(k,N,M){const z=`Route ${k} needs to bail out of prerendering at this point because it used ${N}.`,ne=G(z);M.controller.abort(ne);const $=M.dynamicTracking;$&&$.dynamicAccesses.push({stack:$.isDebugDynamicAccesses?new Error().stack:void 0,expression:N})}function A(k,N,M,z){const ne=z.dynamicTracking;ne&&ne.syncDynamicErrorWithStack===null&&(ne.syncDynamicExpression=N,ne.syncDynamicErrorWithStack=M),f(k,N,z)}function E(k){k.prerenderPhase=!1}function R(k,N,M,z){if(z.controller.signal.aborted===!1){const $=z.dynamicTracking;$&&$.syncDynamicErrorWithStack===null&&($.syncDynamicExpression=N,$.syncDynamicErrorWithStack=M,z.validating===!0&&($.syncDynamicLogged=!0)),f(k,N,z)}throw G(`Route ${k} needs to bail out of prerendering at this point because it used ${N}.`)}const v=E;function x({reason:k,route:N}){const M=s.workUnitAsyncStorage.getStore(),z=M&&M.type==="prerender-ppr"?M.dynamicTracking:null;C(N,k,z)}function C(k,N,M){j(),M&&M.dynamicAccesses.push({stack:M.isDebugDynamicAccesses?new Error().stack:void 0,expression:N}),n.default.unstable_postpone(D(k,N))}function D(k,N){return`Route ${k} needs to bail out of prerendering at this point because it used ${N}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function I(k){return typeof k=="object"&&k!==null&&typeof k.message=="string"?P(k.message):!1}function P(k){return k.includes("needs to bail out of prerendering at this point because it used")&&k.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(P(D("%%%","^^^"))===!1)throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});const U="NEXT_PRERENDER_INTERRUPTED";function G(k){const N=Object.defineProperty(new Error(k),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return N.digest=U,N}function oe(k){return typeof k=="object"&&k!==null&&k.digest===U&&"name"in k&&"message"in k&&k instanceof Error}function V(k){return k.length>0}function Y(k,N){return k.dynamicAccesses.push(...N.dynamicAccesses),k.dynamicAccesses}function O(k){return k.filter(N=>typeof N.stack=="string"&&N.stack.length>0).map(({expression:N,stack:M})=>(M=M.split(`
183
183
  `).slice(4).filter(z=>!(z.includes("node_modules/next/")||z.includes(" (<anonymous>)")||z.includes(" (node:"))).join(`
184
184
  `),`Dynamic API Usage Debug - ${N}:
185
- ${M}`))}function j(){if(!d)throw Object.defineProperty(new Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})}function T(k){j();const N=new AbortController;try{n.default.unstable_postpone(k)}catch(M){N.abort(M)}return N.signal}function H(k){const N=new AbortController;return k.cacheSignal?k.cacheSignal.inputReady().then(()=>{N.abort()}):(0,u.scheduleOnNextTick)(()=>N.abort()),N.signal}function J(k,N){const M=N.dynamicTracking;M&&M.dynamicAccesses.push({stack:M.isDebugDynamicAccesses?new Error().stack:void 0,expression:k})}function X(k){const N=a.workAsyncStorage.getStore();if(N&&N.isStaticGeneration&&N.fallbackRouteParams&&N.fallbackRouteParams.size>0){const M=s.workUnitAsyncStorage.getStore();M&&(M.type==="prerender"?n.default.use((0,i.makeHangingPromise)(M.renderSignal,k)):M.type==="prerender-ppr"?C(N.route,k,M.dynamicTracking):M.type==="prerender-legacy"&&p(k,N,M))}}const se=/\n\s+at Suspense \(<anonymous>\)/,fe=new RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`),we=new RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),te=new RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function le(k,N,M,z,ne){if(!te.test(N))if(fe.test(N)){M.hasDynamicMetadata=!0;return}else if(we.test(N)){M.hasDynamicViewport=!0;return}else if(se.test(N)){M.hasSuspendedDynamic=!0;return}else if(z.syncDynamicErrorWithStack||ne.syncDynamicErrorWithStack){M.hasSyncDynamicErrors=!0;return}else{const $=`Route "${k}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`,_e=ue($,N);M.dynamicErrors.push(_e);return}}function ue(k,N){const M=Object.defineProperty(new Error(k),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return M.stack="Error: "+k+N,M}function ye(k,N,M,z){let ne,$,_e;if(M.syncDynamicErrorWithStack?(ne=M.syncDynamicErrorWithStack,$=M.syncDynamicExpression,_e=M.syncDynamicLogged===!0):z.syncDynamicErrorWithStack?(ne=z.syncDynamicErrorWithStack,$=z.syncDynamicExpression,_e=z.syncDynamicLogged===!0):(ne=null,$=void 0,_e=!1),N.hasSyncDynamicErrors&&ne)throw _e||console.error(ne),new o.StaticGenBailoutError;const Ce=N.dynamicErrors;if(Ce.length){for(let pe=0;pe<Ce.length;pe++)console.error(Ce[pe]);throw new o.StaticGenBailoutError}if(!N.hasSuspendedDynamic){if(N.hasDynamicMetadata)throw ne?(console.error(ne),Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateMetadata\` that could not finish rendering before ${$} was used. Follow the instructions in the error for this expression to resolve.`),"__NEXT_ERROR_CODE",{value:"E608",enumerable:!1,configurable:!0})):Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateMetadata\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`),"__NEXT_ERROR_CODE",{value:"E534",enumerable:!1,configurable:!0});if(N.hasDynamicViewport)throw ne?(console.error(ne),Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateViewport\` that could not finish rendering before ${$} was used. Follow the instructions in the error for this expression to resolve.`),"__NEXT_ERROR_CODE",{value:"E573",enumerable:!1,configurable:!0})):Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateViewport\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`),"__NEXT_ERROR_CODE",{value:"E590",enumerable:!1,configurable:!0})}}}(ta)),ta}var aa={},of;function ia(){return of||(of=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return c}});const t=r(F);function n(u){if(typeof WeakMap!="function")return null;var l=new WeakMap,d=new WeakMap;return(n=function(h){return h?d:l})(u)}function r(u,l){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var d=n(l);if(d&&d.has(u))return d.get(u);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in u)if(_!=="default"&&Object.prototype.hasOwnProperty.call(u,_)){var y=m?Object.getOwnPropertyDescriptor(u,_):null;y&&(y.get||y.set)?Object.defineProperty(h,_,y):h[_]=u[_]}return h.default=u,d&&d.set(u,h),h}const o={current:null},s=typeof t.cache=="function"?t.cache:u=>u,a=process.env.__NEXT_DYNAMIC_IO?console.error:console.warn,i=s(u=>{try{a(o.current)}finally{o.current=null}});function c(u){return function(...d){const h=u(...d);if(process.env.NODE_ENV!=="production"){var m;const _=(m=new Error().stack)==null?void 0:m.split(`
186
- `);if(_===void 0||_.length<4)a(h);else{const y=_[4];o.current=h,i(y)}}else a(h)}}}(aa)),aa}var ca={},ua={},la={},sf;function y0(){return sf||(sf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"afterTaskAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,Zs().createAsyncLocalStorage)()}(la)),la}var af;function w0(){return af||(af=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"afterTaskAsyncStorage",{enumerable:!0,get:function(){return t.afterTaskAsyncStorageInstance}});const t=y0()}(ua)),ua}var cf;function da(){return cf||(cf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{isRequestAPICallableInsideAfter:function(){return i},throwForSearchParamsAccessInUseCache:function(){return a},throwWithStaticGenerationBailoutError:function(){return o},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return s}});const n=mn(),r=w0();function o(c,u){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${c} couldn't be rendered statically because it used ${u}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function s(c,u){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${c} with \`dynamic = "error"\` couldn't be rendered statically because it used ${u}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function a(c){const u=Object.defineProperty(new Error(`Route ${c.route} used "searchParams" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "searchParams" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E634",enumerable:!1,configurable:!0});throw c.invalidUsageError??(c.invalidUsageError=u),u}function i(){const c=r.afterTaskAsyncStorage.getStore();return(c==null?void 0:c.rootTaskSpawnPhase)==="action"}}(ca)),ca}var uf;function v0(){return uf||(uf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cookies",{enumerable:!0,get:function(){return d}});const t=g0(),n=Bn(),r=kt(),o=Kt(),s=Jn(),a=mn(),i=Vn(),c=ia(),u=sa(),l=da();function d(){const v="cookies",x=r.workAsyncStorage.getStore(),C=o.workUnitAsyncStorage.getStore();if(x){if(C&&C.phase==="after"&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${x.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E88",enumerable:!1,configurable:!0});if(x.forceStatic){const P=h();return y(P)}if(C){if(C.type==="cache")throw Object.defineProperty(new Error(`Route ${x.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E398",enumerable:!1,configurable:!0});if(C.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${x.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E157",enumerable:!1,configurable:!0})}if(x.dynamicShouldError)throw Object.defineProperty(new a.StaticGenBailoutError(`Route ${x.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E549",enumerable:!1,configurable:!0});if(C){if(C.type==="prerender")return _(x.route,C);C.type==="prerender-ppr"?(0,s.postponeWithTracking)(x.route,v,C.dynamicTracking):C.type==="prerender-legacy"&&(0,s.throwToInterruptStaticGeneration)(v,x,C)}(0,s.trackDynamicDataInDynamicRender)(x,C)}const D=(0,o.getExpectedRequestStore)(v);let I;return(0,t.areCookiesMutableInCurrentPhase)(D)?I=D.userspaceMutableCookies:I=D.cookies,process.env.NODE_ENV==="development"&&!(x!=null&&x.isPrefetchRequest)?g(I,x==null?void 0:x.route):y(I)}function h(){return t.RequestCookiesAdapter.seal(new n.RequestCookies(new Headers({})))}const m=new WeakMap;function _(v,x){const C=m.get(x);if(C)return C;const D=(0,i.makeHangingPromise)(x.renderSignal,"`cookies()`");return m.set(x,D),Object.defineProperties(D,{[Symbol.iterator]:{value:function(){const I="`cookies()[Symbol.iterator]()`",P=A(v,I);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,I,P,x)}},size:{get(){const I="`cookies().size`",P=A(v,I);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,I,P,x)}},get:{value:function(){let P;arguments.length===0?P="`cookies().get()`":P=`\`cookies().get(${p(arguments[0])})\``;const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},getAll:{value:function(){let P;arguments.length===0?P="`cookies().getAll()`":P=`\`cookies().getAll(${p(arguments[0])})\``;const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},has:{value:function(){let P;arguments.length===0?P="`cookies().has()`":P=`\`cookies().has(${p(arguments[0])})\``;const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},set:{value:function(){let P;if(arguments.length===0)P="`cookies().set()`";else{const G=arguments[0];G?P=`\`cookies().set(${p(G)}, ...)\``:P="`cookies().set(...)`"}const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},delete:{value:function(){let I;arguments.length===0?I="`cookies().delete()`":arguments.length===1?I=`\`cookies().delete(${p(arguments[0])})\``:I=`\`cookies().delete(${p(arguments[0])}, ...)\``;const P=A(v,I);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,I,P,x)}},clear:{value:function(){const P="`cookies().clear()`",U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},toString:{value:function(){const P="`cookies().toString()`",U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}}}),D}function y(v){const x=m.get(v);if(x)return x;const C=Promise.resolve(v);return m.set(v,C),Object.defineProperties(C,{[Symbol.iterator]:{value:v[Symbol.iterator]?v[Symbol.iterator].bind(v):E.bind(v)},size:{get(){return v.size}},get:{value:v.get.bind(v)},getAll:{value:v.getAll.bind(v)},has:{value:v.has.bind(v)},set:{value:v.set.bind(v)},delete:{value:v.delete.bind(v)},clear:{value:typeof v.clear=="function"?v.clear.bind(v):R.bind(v,C)},toString:{value:v.toString.bind(v)}}),C}function g(v,x){const C=m.get(v);if(C)return C;const D=new Promise(I=>(0,u.scheduleImmediate)(()=>I(v)));return m.set(v,D),Object.defineProperties(D,{[Symbol.iterator]:{value:function(){return b(x,"`...cookies()` or similar iteration"),v[Symbol.iterator]?v[Symbol.iterator].apply(v,arguments):E.call(v)},writable:!1},size:{get(){return b(x,"`cookies().size`"),v.size}},get:{value:function(){let P;return arguments.length===0?P="`cookies().get()`":P=`\`cookies().get(${p(arguments[0])})\``,b(x,P),v.get.apply(v,arguments)},writable:!1},getAll:{value:function(){let P;return arguments.length===0?P="`cookies().getAll()`":P=`\`cookies().getAll(${p(arguments[0])})\``,b(x,P),v.getAll.apply(v,arguments)},writable:!1},has:{value:function(){let P;return arguments.length===0?P="`cookies().has()`":P=`\`cookies().has(${p(arguments[0])})\``,b(x,P),v.has.apply(v,arguments)},writable:!1},set:{value:function(){let P;if(arguments.length===0)P="`cookies().set()`";else{const U=arguments[0];U?P=`\`cookies().set(${p(U)}, ...)\``:P="`cookies().set(...)`"}return b(x,P),v.set.apply(v,arguments)},writable:!1},delete:{value:function(){let I;return arguments.length===0?I="`cookies().delete()`":arguments.length===1?I=`\`cookies().delete(${p(arguments[0])})\``:I=`\`cookies().delete(${p(arguments[0])}, ...)\``,b(x,I),v.delete.apply(v,arguments)},writable:!1},clear:{value:function(){return b(x,"`cookies().clear()`"),typeof v.clear=="function"?v.clear.apply(v,arguments):R.call(v,D)},writable:!1},toString:{value:function(){return b(x,"`cookies().toString()` or implicit casting"),v.toString.apply(v,arguments)},writable:!1}}),D}function p(v){return typeof v=="object"&&v!==null&&typeof v.name=="string"?`'${v.name}'`:typeof v=="string"?`'${v}'`:"..."}function b(v,x){const C=o.workUnitAsyncStorage.getStore();if(C&&C.type==="request"&&C.prerenderPhase===!0){const D=C;(0,s.trackSynchronousRequestDataAccessInDev)(D)}f(v,x)}const f=(0,c.createDedupedByCallsiteServerErrorLoggerDev)(A);function A(v,x){const C=v?`Route "${v}" `:"This route ";return Object.defineProperty(new Error(`${C}used ${x}. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E223",enumerable:!1,configurable:!0})}function E(){return this.getAll().map(v=>[v.name,v]).values()}function R(v){for(const x of this.getAll())this.delete(x.name);return v}}(Ks)),Ks}var fa={},ha={},lf;function E0(){return lf||(lf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var i in a)Object.defineProperty(s,i,{enumerable:!0,get:a[i]})}t(e,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return r}});const n=Vs();class r extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new r}}class o extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(i,c,u){if(typeof c=="symbol")return n.ReflectAdapter.get(i,c,u);const l=c.toLowerCase(),d=Object.keys(a).find(h=>h.toLowerCase()===l);if(!(typeof d>"u"))return n.ReflectAdapter.get(i,d,u)},set(i,c,u,l){if(typeof c=="symbol")return n.ReflectAdapter.set(i,c,u,l);const d=c.toLowerCase(),h=Object.keys(a).find(m=>m.toLowerCase()===d);return n.ReflectAdapter.set(i,h??c,u,l)},has(i,c){if(typeof c=="symbol")return n.ReflectAdapter.has(i,c);const u=c.toLowerCase(),l=Object.keys(a).find(d=>d.toLowerCase()===u);return typeof l>"u"?!1:n.ReflectAdapter.has(i,l)},deleteProperty(i,c){if(typeof c=="symbol")return n.ReflectAdapter.deleteProperty(i,c);const u=c.toLowerCase(),l=Object.keys(a).find(d=>d.toLowerCase()===u);return typeof l>"u"?!0:n.ReflectAdapter.deleteProperty(i,l)}})}static seal(a){return new Proxy(a,{get(i,c,u){switch(c){case"append":case"delete":case"set":return r.callable;default:return n.ReflectAdapter.get(i,c,u)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new o(a)}append(a,i){const c=this.headers[a];typeof c=="string"?this.headers[a]=[c,i]:Array.isArray(c)?c.push(i):this.headers[a]=i}delete(a){delete this.headers[a]}get(a){const i=this.headers[a];return typeof i<"u"?this.merge(i):null}has(a){return typeof this.headers[a]<"u"}set(a,i){this.headers[a]=i}forEach(a,i){for(const[c,u]of this.entries())a.call(i,u,c,this)}*entries(){for(const a of Object.keys(this.headers)){const i=a.toLowerCase(),c=this.get(i);yield[i,c]}}*keys(){for(const a of Object.keys(this.headers))yield a.toLowerCase()}*values(){for(const a of Object.keys(this.headers))yield this.get(a)}[Symbol.iterator](){return this.entries()}}}(ha)),ha}var df;function _0(){return df||(df=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"headers",{enumerable:!0,get:function(){return l}});const t=E0(),n=kt(),r=Kt(),o=Jn(),s=mn(),a=Vn(),i=ia(),c=sa(),u=da();function l(){const f=n.workAsyncStorage.getStore(),A=r.workUnitAsyncStorage.getStore();if(f){if(A&&A.phase==="after"&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${f.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E367",enumerable:!1,configurable:!0});if(f.forceStatic){const R=t.HeadersAdapter.seal(new Headers({}));return m(R)}if(A){if(A.type==="cache")throw Object.defineProperty(new Error(`Route ${f.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E304",enumerable:!1,configurable:!0});if(A.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${f.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E127",enumerable:!1,configurable:!0})}if(f.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${f.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E525",enumerable:!1,configurable:!0});if(A){if(A.type==="prerender")return h(f.route,A);A.type==="prerender-ppr"?(0,o.postponeWithTracking)(f.route,"headers",A.dynamicTracking):A.type==="prerender-legacy"&&(0,o.throwToInterruptStaticGeneration)("headers",f,A)}(0,o.trackDynamicDataInDynamicRender)(f,A)}const E=(0,r.getExpectedRequestStore)("headers");return process.env.NODE_ENV==="development"&&!(f!=null&&f.isPrefetchRequest)?_(E.headers,f==null?void 0:f.route):m(E.headers)}const d=new WeakMap;function h(f,A){const E=d.get(A);if(E)return E;const R=(0,a.makeHangingPromise)(A.renderSignal,"`headers()`");return d.set(A,R),Object.defineProperties(R,{append:{value:function(){const x=`\`headers().append(${y(arguments[0])}, ...)\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},delete:{value:function(){const x=`\`headers().delete(${y(arguments[0])})\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},get:{value:function(){const x=`\`headers().get(${y(arguments[0])})\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},has:{value:function(){const x=`\`headers().has(${y(arguments[0])})\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},set:{value:function(){const x=`\`headers().set(${y(arguments[0])}, ...)\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},getSetCookie:{value:function(){const x="`headers().getSetCookie()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},forEach:{value:function(){const x="`headers().forEach(...)`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},keys:{value:function(){const x="`headers().keys()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},values:{value:function(){const x="`headers().values()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},entries:{value:function(){const x="`headers().entries()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},[Symbol.iterator]:{value:function(){const v="`headers()[Symbol.iterator]()`",x=b(f,v);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,v,x,A)}}}),R}function m(f){const A=d.get(f);if(A)return A;const E=Promise.resolve(f);return d.set(f,E),Object.defineProperties(E,{append:{value:f.append.bind(f)},delete:{value:f.delete.bind(f)},get:{value:f.get.bind(f)},has:{value:f.has.bind(f)},set:{value:f.set.bind(f)},getSetCookie:{value:f.getSetCookie.bind(f)},forEach:{value:f.forEach.bind(f)},keys:{value:f.keys.bind(f)},values:{value:f.values.bind(f)},entries:{value:f.entries.bind(f)},[Symbol.iterator]:{value:f[Symbol.iterator].bind(f)}}),E}function _(f,A){const E=d.get(f);if(E)return E;const R=new Promise(v=>(0,c.scheduleImmediate)(()=>v(f)));return d.set(f,R),Object.defineProperties(R,{append:{value:function(){const x=`\`headers().append(${y(arguments[0])}, ...)\``;return g(A,x),f.append.apply(f,arguments)}},delete:{value:function(){const x=`\`headers().delete(${y(arguments[0])})\``;return g(A,x),f.delete.apply(f,arguments)}},get:{value:function(){const x=`\`headers().get(${y(arguments[0])})\``;return g(A,x),f.get.apply(f,arguments)}},has:{value:function(){const x=`\`headers().has(${y(arguments[0])})\``;return g(A,x),f.has.apply(f,arguments)}},set:{value:function(){const x=`\`headers().set(${y(arguments[0])}, ...)\``;return g(A,x),f.set.apply(f,arguments)}},getSetCookie:{value:function(){return g(A,"`headers().getSetCookie()`"),f.getSetCookie.apply(f,arguments)}},forEach:{value:function(){return g(A,"`headers().forEach(...)`"),f.forEach.apply(f,arguments)}},keys:{value:function(){return g(A,"`headers().keys()`"),f.keys.apply(f,arguments)}},values:{value:function(){return g(A,"`headers().values()`"),f.values.apply(f,arguments)}},entries:{value:function(){return g(A,"`headers().entries()`"),f.entries.apply(f,arguments)}},[Symbol.iterator]:{value:function(){return g(A,"`...headers()` or similar iteration"),f[Symbol.iterator].apply(f,arguments)}}}),R}function y(f){return typeof f=="string"?`'${f}'`:"..."}function g(f,A){const E=r.workUnitAsyncStorage.getStore();if(E&&E.type==="request"&&E.prerenderPhase===!0){const R=E;(0,o.trackSynchronousRequestDataAccessInDev)(R)}p(f,A)}const p=(0,i.createDedupedByCallsiteServerErrorLoggerDev)(b);function b(f,A){const E=f?`Route "${f}" `:"This route ";return Object.defineProperty(new Error(`${E}used ${A}. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E277",enumerable:!1,configurable:!0})}}(fa)),fa}var pa={},ff;function S0(){return ff||(ff=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"draftMode",{enumerable:!0,get:function(){return i}});const t=Kt(),n=kt(),r=Jn(),o=ia(),s=mn(),a=Zd();function i(){const p="draftMode",b=n.workAsyncStorage.getStore(),f=t.workUnitAsyncStorage.getStore();switch((!b||!f)&&(0,t.throwForMissingRequestStore)(p),f.type){case"request":return c(f.draftMode,b);case"cache":case"unstable-cache":const A=(0,t.getDraftModeProviderForCacheScope)(b,f);if(A)return c(A,b);case"prerender":case"prerender-ppr":case"prerender-legacy":if(process.env.NODE_ENV==="development"&&!(b!=null&&b.isPrefetchRequest)){const R=b==null?void 0:b.route;return d(null,R)}else return l(null);default:return f}}function c(p,b){const f=u.get(i);if(f)return f;let A;if(process.env.NODE_ENV==="development"&&!(b!=null&&b.isPrefetchRequest)){const E=b==null?void 0:b.route;A=d(p,E)}else A=l(p);return u.set(p,A),A}const u=new WeakMap;function l(p){const b=new h(p),f=Promise.resolve(b);return Object.defineProperty(f,"isEnabled",{get(){return b.isEnabled},set(A){Object.defineProperty(f,"isEnabled",{value:A,writable:!0,enumerable:!0})},enumerable:!0,configurable:!0}),f.enable=b.enable.bind(b),f.disable=b.disable.bind(b),f}function d(p,b){const f=new h(p),A=Promise.resolve(f);return Object.defineProperty(A,"isEnabled",{get(){return m(b,"`draftMode().isEnabled`"),f.isEnabled},set(E){Object.defineProperty(A,"isEnabled",{value:E,writable:!0,enumerable:!0})},enumerable:!0,configurable:!0}),Object.defineProperty(A,"enable",{value:function(){return m(b,"`draftMode().enable()`"),f.enable.apply(f,arguments)}}),Object.defineProperty(A,"disable",{value:function(){return m(b,"`draftMode().disable()`"),f.disable.apply(f,arguments)}}),A}class h{constructor(b){this._provider=b}get isEnabled(){return this._provider!==null?this._provider.isEnabled:!1}enable(){g("draftMode().enable()"),this._provider!==null&&this._provider.enable()}disable(){g("draftMode().disable()"),this._provider!==null&&this._provider.disable()}}function m(p,b){const f=t.workUnitAsyncStorage.getStore();if(f&&f.type==="request"&&f.prerenderPhase===!0){const A=f;(0,r.trackSynchronousRequestDataAccessInDev)(A)}_(p,b)}const _=(0,o.createDedupedByCallsiteServerErrorLoggerDev)(y);function y(p,b){const f=p?`Route "${p}" `:"This route ";return Object.defineProperty(new Error(`${f}used ${b}. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E377",enumerable:!1,configurable:!0})}function g(p){const b=n.workAsyncStorage.getStore(),f=t.workUnitAsyncStorage.getStore();if(b){if(f){if(f.type==="cache")throw Object.defineProperty(new Error(`Route ${b.route} used "${p}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E246",enumerable:!1,configurable:!0});if(f.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${b.route} used "${p}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E259",enumerable:!1,configurable:!0});if(f.phase==="after")throw Object.defineProperty(new Error(`Route ${b.route} used "${p}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E348",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${p}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(f)if(f.type==="prerender"){const A=Object.defineProperty(new Error(`Route ${b.route} used ${p} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});(0,r.abortAndThrowOnSynchronousRequestDataAccess)(b.route,p,A,f)}else if(f.type==="prerender-ppr")(0,r.postponeWithTracking)(b.route,p,f.dynamicTracking);else if(f.type==="prerender-legacy"){f.revalidate=0;const A=Object.defineProperty(new a.DynamicServerError(`Route ${b.route} couldn't be rendered statically because it used \`${p}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw b.dynamicUsageDescription=p,b.dynamicUsageStack=A.stack,A}else process.env.NODE_ENV==="development"&&f&&f.type==="request"&&(f.usedDynamic=!0)}}}(pa)),pa}var hf;function x0(){return hf||(hf=1,Gn.cookies=v0().cookies,Gn.headers=_0().headers,Gn.draftMode=S0().draftMode),Gn}var Xn=x0(),Br={exports:{}},ma={},ga={},ba={},pf;function A0(){return pf||(pf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return t}});function t(n,r,o){if(n){o&&(o=o.toLowerCase());for(const i of n){var s,a;const c=(s=i.domain)==null?void 0:s.split(":",1)[0].toLowerCase();if(r===c||o===i.defaultLocale.toLowerCase()||(a=i.locales)!=null&&a.some(u=>u.toLowerCase()===o))return i}}}}(ba)),ba}var ya={},wa={},mf;function R0(){return mf||(mf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeTrailingSlash",{enumerable:!0,get:function(){return t}});function t(n){return n.replace(/\/$/,"")||"/"}}(wa)),wa}var va={},Ea={},gf;function _a(){return gf||(gf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t}});function t(n){const r=n.indexOf("#"),o=n.indexOf("?"),s=o>-1&&(r<0||o<r);return s||r>-1?{pathname:n.substring(0,s?o:r),query:s?n.substring(o,r>-1?r:void 0):"",hash:r>-1?n.slice(r):""}:{pathname:n,query:"",hash:""}}}(Ea)),Ea}var bf;function yf(){return bf||(bf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathPrefix",{enumerable:!0,get:function(){return n}});const t=_a();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:s,query:a,hash:i}=(0,t.parsePath)(r);return""+o+s+a+i}}(va)),va}var Sa={},wf;function C0(){return wf||(wf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathSuffix",{enumerable:!0,get:function(){return n}});const t=_a();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:s,query:a,hash:i}=(0,t.parsePath)(r);return""+s+o+a+i}}(Sa)),Sa}var xa={},Aa={},vf;function Ra(){return vf||(vf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"pathHasPrefix",{enumerable:!0,get:function(){return n}});const t=_a();function n(r,o){if(typeof r!="string")return!1;const{pathname:s}=(0,t.parsePath)(r);return s===o||s.startsWith(o+"/")}}(Aa)),Aa}var Ef;function T0(){return Ef||(Ef=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const t=yf(),n=Ra();function r(o,s,a,i){if(!s||s===a)return o;const c=o.toLowerCase();return!i&&((0,n.pathHasPrefix)(c,"/api")||(0,n.pathHasPrefix)(c,"/"+s.toLowerCase()))?o:(0,t.addPathPrefix)(o,"/"+s)}}(xa)),xa}var _f;function P0(){return _f||(_f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});const t=R0(),n=yf(),r=C0(),o=T0();function s(a){let i=(0,o.addLocale)(a.pathname,a.locale,a.buildId?void 0:a.defaultLocale,a.ignorePrefix);return(a.buildId||!a.trailingSlash)&&(i=(0,t.removeTrailingSlash)(i)),a.buildId&&(i=(0,r.addPathSuffix)((0,n.addPathPrefix)(i,"/_next/data/"+a.buildId),a.pathname==="/"?"index.json":".json")),i=(0,n.addPathPrefix)(i,a.basePath),!a.buildId&&a.trailingSlash?i.endsWith("/")?i:(0,r.addPathSuffix)(i,"/"):(0,t.removeTrailingSlash)(i)}}(ya)),ya}var Ca={},Sf;function O0(){return Sf||(Sf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getHostname",{enumerable:!0,get:function(){return t}});function t(n,r){let o;if(r!=null&&r.host&&!Array.isArray(r.host))o=r.host.toString().split(":",1)[0];else if(n.hostname)o=n.hostname;else return;return o.toLowerCase()}}(Ca)),Ca}var Ta={},Pa={},xf;function k0(){return xf||(xf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});const t=new WeakMap;function n(r,o){if(!o)return{pathname:r};let s=t.get(o);s||(s=o.map(l=>l.toLowerCase()),t.set(o,s));let a;const i=r.split("/",2);if(!i[1])return{pathname:r};const c=i[1].toLowerCase(),u=s.indexOf(c);return u<0?{pathname:r}:(a=o[u],r=r.slice(a.length+1)||"/",{pathname:r,detectedLocale:a})}}(Pa)),Pa}var Oa={},Af;function N0(){return Af||(Af=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removePathPrefix",{enumerable:!0,get:function(){return n}});const t=Ra();function n(r,o){if(!(0,t.pathHasPrefix)(r,o))return r;const s=r.slice(o.length);return s.startsWith("/")?s:"/"+s}}(Oa)),Oa}var Rf;function I0(){return Rf||(Rf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});const t=k0(),n=N0(),r=Ra();function o(s,a){var i;const{basePath:c,i18n:u,trailingSlash:l}=(i=a.nextConfig)!=null?i:{},d={pathname:s,trailingSlash:s!=="/"?s.endsWith("/"):l};c&&(0,r.pathHasPrefix)(d.pathname,c)&&(d.pathname=(0,n.removePathPrefix)(d.pathname,c),d.basePath=c);let h=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const _=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),y=_[0];d.buildId=y,h=_[1]!=="index"?"/"+_.slice(1).join("/"):"/",a.parseData===!0&&(d.pathname=h)}if(u){let _=a.i18nProvider?a.i18nProvider.analyze(d.pathname):(0,t.normalizeLocalePath)(d.pathname,u.locales);d.locale=_.detectedLocale;var m;d.pathname=(m=_.pathname)!=null?m:d.pathname,!_.detectedLocale&&d.buildId&&(_=a.i18nProvider?a.i18nProvider.analyze(h):(0,t.normalizeLocalePath)(h,u.locales),_.detectedLocale&&(d.locale=_.detectedLocale))}return d}}(Ta)),Ta}var Cf;function Tf(){return Cf||(Cf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextURL",{enumerable:!0,get:function(){return c}});const t=A0(),n=P0(),r=O0(),o=I0(),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function a(u,l){return new URL(String(u).replace(s,"localhost"),l&&String(l).replace(s,"localhost"))}const i=Symbol("NextURLInternal");class c{constructor(l,d,h){let m,_;typeof d=="object"&&"pathname"in d||typeof d=="string"?(m=d,_=h||{}):_=h||d||{},this[i]={url:a(l,m??_.base),options:_,basePath:""},this.analyze()}analyze(){var l,d,h,m,_;const y=(0,o.getNextPathnameInfo)(this[i].url.pathname,{nextConfig:this[i].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[i].options.i18nProvider}),g=(0,r.getHostname)(this[i].url,this[i].options.headers);this[i].domainLocale=this[i].options.i18nProvider?this[i].options.i18nProvider.detectDomainLocale(g):(0,t.detectDomainLocale)((d=this[i].options.nextConfig)==null||(l=d.i18n)==null?void 0:l.domains,g);const p=((h=this[i].domainLocale)==null?void 0:h.defaultLocale)||((_=this[i].options.nextConfig)==null||(m=_.i18n)==null?void 0:m.defaultLocale);this[i].url.pathname=y.pathname,this[i].defaultLocale=p,this[i].basePath=y.basePath??"",this[i].buildId=y.buildId,this[i].locale=y.locale??p,this[i].trailingSlash=y.trailingSlash}formatPathname(){return(0,n.formatNextPathnameInfo)({basePath:this[i].basePath,buildId:this[i].buildId,defaultLocale:this[i].options.forceLocale?void 0:this[i].defaultLocale,locale:this[i].locale,pathname:this[i].url.pathname,trailingSlash:this[i].trailingSlash})}formatSearch(){return this[i].url.search}get buildId(){return this[i].buildId}set buildId(l){this[i].buildId=l}get locale(){return this[i].locale??""}set locale(l){var d,h;if(!this[i].locale||!(!((h=this[i].options.nextConfig)==null||(d=h.i18n)==null)&&d.locales.includes(l)))throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale "${l}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[i].locale=l}get defaultLocale(){return this[i].defaultLocale}get domainLocale(){return this[i].domainLocale}get searchParams(){return this[i].url.searchParams}get host(){return this[i].url.host}set host(l){this[i].url.host=l}get hostname(){return this[i].url.hostname}set hostname(l){this[i].url.hostname=l}get port(){return this[i].url.port}set port(l){this[i].url.port=l}get protocol(){return this[i].url.protocol}set protocol(l){this[i].url.protocol=l}get href(){const l=this.formatPathname(),d=this.formatSearch();return`${this.protocol}//${this.host}${l}${d}${this.hash}`}set href(l){this[i].url=a(l),this.analyze()}get origin(){return this[i].url.origin}get pathname(){return this[i].url.pathname}set pathname(l){this[i].url.pathname=l}get hash(){return this[i].url.hash}set hash(l){this[i].url.hash=l}get search(){return this[i].url.search}set search(l){this[i].url.search=l}get password(){return this[i].url.password}set password(l){this[i].url.password=l}get username(){return this[i].url.username}set username(l){this[i].url.username=l}get basePath(){return this[i].basePath}set basePath(l){this[i].basePath=l.startsWith("/")?l:`/${l}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new c(String(this),this[i].options)}}}(ga)),ga}var ka={},Na={},Pf;function D0(){return Pf||(Pf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(pe,Ae){for(var De in Ae)Object.defineProperty(pe,De,{enumerable:!0,get:Ae[De]})}t(e,{ACTION_SUFFIX:function(){return d},APP_DIR_ALIAS:function(){return oe},CACHE_ONE_YEAR:function(){return v},DOT_NEXT_ALIAS:function(){return U},ESLINT_DEFAULT_DIRS:function(){return z},GSP_NO_RETURNED_VALUE:function(){return le},GSSP_COMPONENT_MEMBER_ERROR:function(){return k},GSSP_NO_RETURNED_VALUE:function(){return ue},INFINITE_CACHE:function(){return x},INSTRUMENTATION_HOOK_FILENAME:function(){return I},MATCHED_PATH_HEADER:function(){return o},MIDDLEWARE_FILENAME:function(){return C},MIDDLEWARE_LOCATION_REGEXP:function(){return D},NEXT_BODY_SUFFIX:function(){return _},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return R},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return g},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return p},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return E},NEXT_CACHE_TAGS_HEADER:function(){return y},NEXT_CACHE_TAG_MAX_ITEMS:function(){return f},NEXT_CACHE_TAG_MAX_LENGTH:function(){return A},NEXT_DATA_SUFFIX:function(){return h},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return r},NEXT_META_SUFFIX:function(){return m},NEXT_QUERY_PARAM_PREFIX:function(){return n},NEXT_RESUME_HEADER:function(){return b},NON_STANDARD_NODE_ENV:function(){return N},PAGES_DIR_ALIAS:function(){return P},PRERENDER_REVALIDATE_HEADER:function(){return s},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return J},ROOT_DIR_ALIAS:function(){return G},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return H},RSC_ACTION_ENCRYPTION_ALIAS:function(){return T},RSC_ACTION_PROXY_ALIAS:function(){return O},RSC_ACTION_VALIDATE_ALIAS:function(){return Y},RSC_CACHE_WRAPPER_ALIAS:function(){return j},RSC_MOD_REF_PROXY_ALIAS:function(){return V},RSC_PREFETCH_SUFFIX:function(){return i},RSC_SEGMENTS_DIR_SUFFIX:function(){return c},RSC_SEGMENT_SUFFIX:function(){return u},RSC_SUFFIX:function(){return l},SERVER_PROPS_EXPORT_ERROR:function(){return te},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return se},SERVER_PROPS_SSG_CONFLICT:function(){return fe},SERVER_RUNTIME:function(){return ne},SSG_FALLBACK_EXPORT_ERROR:function(){return M},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return X},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return we},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return ye},WEBPACK_LAYERS:function(){return _e},WEBPACK_RESOURCE_QUERIES:function(){return Ce}});const n="nxtP",r="nxtI",o="x-matched-path",s="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",i=".prefetch.rsc",c=".segments",u=".segment.rsc",l=".rsc",d=".action",h=".json",m=".meta",_=".body",y="x-next-cache-tags",g="x-next-revalidated-tags",p="x-next-revalidate-tag-token",b="next-resume",f=128,A=256,E=1024,R="_N_T_",v=31536e3,x=4294967294,C="middleware",D=`(?:src/)?${C}`,I="instrumentation",P="private-next-pages",U="private-dot-next",G="private-next-root-dir",oe="private-next-app-dir",V="private-next-rsc-mod-ref-proxy",Y="private-next-rsc-action-validate",O="private-next-rsc-server-reference",j="private-next-rsc-cache-wrapper",T="private-next-rsc-action-encryption",H="private-next-rsc-action-client-wrapper",J="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",X="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",se="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",fe="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",we="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",te="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",le="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",ue="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",ye="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",k="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",N='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',M="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",z=["app","pages","components","lib","src"],ne={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},$={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"},_e={...$,GROUP:{builtinReact:[$.reactServerComponents,$.actionBrowser],serverOnly:[$.reactServerComponents,$.actionBrowser,$.instrument,$.middleware],neutralTarget:[$.apiNode,$.apiEdge],clientOnly:[$.serverSideRendering,$.appPagesBrowser],bundled:[$.reactServerComponents,$.actionBrowser,$.serverSideRendering,$.appPagesBrowser,$.shared,$.instrument,$.middleware],appPages:[$.reactServerComponents,$.serverSideRendering,$.appPagesBrowser,$.actionBrowser]}},Ce={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}}(Na)),Na}var Of;function kf(){return Of||(Of=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return r},normalizeNextQueryParam:function(){return i},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return s},validateURL:function(){return a}});const n=D0();function r(c){const u=new Headers;for(let[l,d]of Object.entries(c)){const h=Array.isArray(d)?d:[d];for(let m of h)typeof m>"u"||(typeof m=="number"&&(m=m.toString()),u.append(l,m))}return u}function o(c){var u=[],l=0,d,h,m,_,y;function g(){for(;l<c.length&&/\s/.test(c.charAt(l));)l+=1;return l<c.length}function p(){return h=c.charAt(l),h!=="="&&h!==";"&&h!==","}for(;l<c.length;){for(d=l,y=!1;g();)if(h=c.charAt(l),h===","){for(m=l,l+=1,g(),_=l;l<c.length&&p();)l+=1;l<c.length&&c.charAt(l)==="="?(y=!0,l=_,u.push(c.substring(d,m)),d=l):l=m+1}else l+=1;(!y||l>=c.length)&&u.push(c.substring(d,c.length))}return u}function s(c){const u={},l=[];if(c)for(const[d,h]of c.entries())d.toLowerCase()==="set-cookie"?(l.push(...o(h)),u[d]=l.length===1?l[0]:l):u[d]=h;return u}function a(c){try{return String(new URL(String(c)))}catch(u){throw Object.defineProperty(new Error(`URL is malformed "${String(c)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:u}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function i(c){const u=[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX];for(const l of u)if(c!==l&&c.startsWith(l))return c.substring(l.length);return null}}(ka)),ka}var Ia={},Nf;function M0(){return Nf||(Nf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var i in a)Object.defineProperty(s,i,{enumerable:!0,get:a[i]})}t(e,{PageSignatureError:function(){return n},RemovedPageError:function(){return r},RemovedUAError:function(){return o}});class n extends Error{constructor({page:a}){super(`The middleware "${a}" accepts an async API directly with the form:
185
+ ${M}`))}function j(){if(!d)throw Object.defineProperty(new Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})}function T(k){j();const N=new AbortController;try{n.default.unstable_postpone(k)}catch(M){N.abort(M)}return N.signal}function H(k){const N=new AbortController;return k.cacheSignal?k.cacheSignal.inputReady().then(()=>{N.abort()}):(0,u.scheduleOnNextTick)(()=>N.abort()),N.signal}function J(k,N){const M=N.dynamicTracking;M&&M.dynamicAccesses.push({stack:M.isDebugDynamicAccesses?new Error().stack:void 0,expression:k})}function X(k){const N=a.workAsyncStorage.getStore();if(N&&N.isStaticGeneration&&N.fallbackRouteParams&&N.fallbackRouteParams.size>0){const M=s.workUnitAsyncStorage.getStore();M&&(M.type==="prerender"?n.default.use((0,i.makeHangingPromise)(M.renderSignal,k)):M.type==="prerender-ppr"?C(N.route,k,M.dynamicTracking):M.type==="prerender-legacy"&&p(k,N,M))}}const se=/\n\s+at Suspense \(<anonymous>\)/,fe=new RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`),we=new RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),te=new RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function le(k,N,M,z,ne){if(!te.test(N))if(fe.test(N)){M.hasDynamicMetadata=!0;return}else if(we.test(N)){M.hasDynamicViewport=!0;return}else if(se.test(N)){M.hasSuspendedDynamic=!0;return}else if(z.syncDynamicErrorWithStack||ne.syncDynamicErrorWithStack){M.hasSyncDynamicErrors=!0;return}else{const $=`Route "${k}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`,_e=ue($,N);M.dynamicErrors.push(_e);return}}function ue(k,N){const M=Object.defineProperty(new Error(k),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return M.stack="Error: "+k+N,M}function ye(k,N,M,z){let ne,$,_e;if(M.syncDynamicErrorWithStack?(ne=M.syncDynamicErrorWithStack,$=M.syncDynamicExpression,_e=M.syncDynamicLogged===!0):z.syncDynamicErrorWithStack?(ne=z.syncDynamicErrorWithStack,$=z.syncDynamicExpression,_e=z.syncDynamicLogged===!0):(ne=null,$=void 0,_e=!1),N.hasSyncDynamicErrors&&ne)throw _e||console.error(ne),new o.StaticGenBailoutError;const Ce=N.dynamicErrors;if(Ce.length){for(let pe=0;pe<Ce.length;pe++)console.error(Ce[pe]);throw new o.StaticGenBailoutError}if(!N.hasSuspendedDynamic){if(N.hasDynamicMetadata)throw ne?(console.error(ne),Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateMetadata\` that could not finish rendering before ${$} was used. Follow the instructions in the error for this expression to resolve.`),"__NEXT_ERROR_CODE",{value:"E608",enumerable:!1,configurable:!0})):Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateMetadata\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`),"__NEXT_ERROR_CODE",{value:"E534",enumerable:!1,configurable:!0});if(N.hasDynamicViewport)throw ne?(console.error(ne),Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateViewport\` that could not finish rendering before ${$} was used. Follow the instructions in the error for this expression to resolve.`),"__NEXT_ERROR_CODE",{value:"E573",enumerable:!1,configurable:!0})):Object.defineProperty(new o.StaticGenBailoutError(`Route "${k}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateViewport\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`),"__NEXT_ERROR_CODE",{value:"E590",enumerable:!1,configurable:!0})}}}(ta)),ta}var aa={},cf;function ia(){return cf||(cf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return c}});const t=r(W);function n(u){if(typeof WeakMap!="function")return null;var l=new WeakMap,d=new WeakMap;return(n=function(h){return h?d:l})(u)}function r(u,l){if(u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var d=n(l);if(d&&d.has(u))return d.get(u);var h={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in u)if(_!=="default"&&Object.prototype.hasOwnProperty.call(u,_)){var y=m?Object.getOwnPropertyDescriptor(u,_):null;y&&(y.get||y.set)?Object.defineProperty(h,_,y):h[_]=u[_]}return h.default=u,d&&d.set(u,h),h}const o={current:null},s=typeof t.cache=="function"?t.cache:u=>u,a=process.env.__NEXT_DYNAMIC_IO?console.error:console.warn,i=s(u=>{try{a(o.current)}finally{o.current=null}});function c(u){return function(...d){const h=u(...d);if(process.env.NODE_ENV!=="production"){var m;const _=(m=new Error().stack)==null?void 0:m.split(`
186
+ `);if(_===void 0||_.length<4)a(h);else{const y=_[4];o.current=h,i(y)}}else a(h)}}}(aa)),aa}var ca={},ua={},la={},uf;function _0(){return uf||(uf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"afterTaskAsyncStorageInstance",{enumerable:!0,get:function(){return n}});const n=(0,Zs().createAsyncLocalStorage)()}(la)),la}var lf;function S0(){return lf||(lf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"afterTaskAsyncStorage",{enumerable:!0,get:function(){return t.afterTaskAsyncStorageInstance}});const t=_0()}(ua)),ua}var df;function da(){return df||(df=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{isRequestAPICallableInsideAfter:function(){return i},throwForSearchParamsAccessInUseCache:function(){return a},throwWithStaticGenerationBailoutError:function(){return o},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return s}});const n=mn(),r=S0();function o(c,u){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${c} couldn't be rendered statically because it used ${u}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function s(c,u){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${c} with \`dynamic = "error"\` couldn't be rendered statically because it used ${u}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function a(c){const u=Object.defineProperty(new Error(`Route ${c.route} used "searchParams" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "searchParams" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E634",enumerable:!1,configurable:!0});throw c.invalidUsageError??(c.invalidUsageError=u),u}function i(){const c=r.afterTaskAsyncStorage.getStore();return(c==null?void 0:c.rootTaskSpawnPhase)==="action"}}(ca)),ca}var ff;function x0(){return ff||(ff=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cookies",{enumerable:!0,get:function(){return d}});const t=v0(),n=Bn(),r=kt(),o=Kt(),s=Jn(),a=mn(),i=Vn(),c=ia(),u=sa(),l=da();function d(){const v="cookies",x=r.workAsyncStorage.getStore(),C=o.workUnitAsyncStorage.getStore();if(x){if(C&&C.phase==="after"&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${x.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E88",enumerable:!1,configurable:!0});if(x.forceStatic){const P=h();return y(P)}if(C){if(C.type==="cache")throw Object.defineProperty(new Error(`Route ${x.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E398",enumerable:!1,configurable:!0});if(C.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${x.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E157",enumerable:!1,configurable:!0})}if(x.dynamicShouldError)throw Object.defineProperty(new a.StaticGenBailoutError(`Route ${x.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E549",enumerable:!1,configurable:!0});if(C){if(C.type==="prerender")return _(x.route,C);C.type==="prerender-ppr"?(0,s.postponeWithTracking)(x.route,v,C.dynamicTracking):C.type==="prerender-legacy"&&(0,s.throwToInterruptStaticGeneration)(v,x,C)}(0,s.trackDynamicDataInDynamicRender)(x,C)}const D=(0,o.getExpectedRequestStore)(v);let I;return(0,t.areCookiesMutableInCurrentPhase)(D)?I=D.userspaceMutableCookies:I=D.cookies,process.env.NODE_ENV==="development"&&!(x!=null&&x.isPrefetchRequest)?g(I,x==null?void 0:x.route):y(I)}function h(){return t.RequestCookiesAdapter.seal(new n.RequestCookies(new Headers({})))}const m=new WeakMap;function _(v,x){const C=m.get(x);if(C)return C;const D=(0,i.makeHangingPromise)(x.renderSignal,"`cookies()`");return m.set(x,D),Object.defineProperties(D,{[Symbol.iterator]:{value:function(){const I="`cookies()[Symbol.iterator]()`",P=A(v,I);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,I,P,x)}},size:{get(){const I="`cookies().size`",P=A(v,I);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,I,P,x)}},get:{value:function(){let P;arguments.length===0?P="`cookies().get()`":P=`\`cookies().get(${p(arguments[0])})\``;const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},getAll:{value:function(){let P;arguments.length===0?P="`cookies().getAll()`":P=`\`cookies().getAll(${p(arguments[0])})\``;const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},has:{value:function(){let P;arguments.length===0?P="`cookies().has()`":P=`\`cookies().has(${p(arguments[0])})\``;const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},set:{value:function(){let P;if(arguments.length===0)P="`cookies().set()`";else{const G=arguments[0];G?P=`\`cookies().set(${p(G)}, ...)\``:P="`cookies().set(...)`"}const U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},delete:{value:function(){let I;arguments.length===0?I="`cookies().delete()`":arguments.length===1?I=`\`cookies().delete(${p(arguments[0])})\``:I=`\`cookies().delete(${p(arguments[0])}, ...)\``;const P=A(v,I);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,I,P,x)}},clear:{value:function(){const P="`cookies().clear()`",U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}},toString:{value:function(){const P="`cookies().toString()`",U=A(v,P);(0,s.abortAndThrowOnSynchronousRequestDataAccess)(v,P,U,x)}}}),D}function y(v){const x=m.get(v);if(x)return x;const C=Promise.resolve(v);return m.set(v,C),Object.defineProperties(C,{[Symbol.iterator]:{value:v[Symbol.iterator]?v[Symbol.iterator].bind(v):E.bind(v)},size:{get(){return v.size}},get:{value:v.get.bind(v)},getAll:{value:v.getAll.bind(v)},has:{value:v.has.bind(v)},set:{value:v.set.bind(v)},delete:{value:v.delete.bind(v)},clear:{value:typeof v.clear=="function"?v.clear.bind(v):R.bind(v,C)},toString:{value:v.toString.bind(v)}}),C}function g(v,x){const C=m.get(v);if(C)return C;const D=new Promise(I=>(0,u.scheduleImmediate)(()=>I(v)));return m.set(v,D),Object.defineProperties(D,{[Symbol.iterator]:{value:function(){return b(x,"`...cookies()` or similar iteration"),v[Symbol.iterator]?v[Symbol.iterator].apply(v,arguments):E.call(v)},writable:!1},size:{get(){return b(x,"`cookies().size`"),v.size}},get:{value:function(){let P;return arguments.length===0?P="`cookies().get()`":P=`\`cookies().get(${p(arguments[0])})\``,b(x,P),v.get.apply(v,arguments)},writable:!1},getAll:{value:function(){let P;return arguments.length===0?P="`cookies().getAll()`":P=`\`cookies().getAll(${p(arguments[0])})\``,b(x,P),v.getAll.apply(v,arguments)},writable:!1},has:{value:function(){let P;return arguments.length===0?P="`cookies().has()`":P=`\`cookies().has(${p(arguments[0])})\``,b(x,P),v.has.apply(v,arguments)},writable:!1},set:{value:function(){let P;if(arguments.length===0)P="`cookies().set()`";else{const U=arguments[0];U?P=`\`cookies().set(${p(U)}, ...)\``:P="`cookies().set(...)`"}return b(x,P),v.set.apply(v,arguments)},writable:!1},delete:{value:function(){let I;return arguments.length===0?I="`cookies().delete()`":arguments.length===1?I=`\`cookies().delete(${p(arguments[0])})\``:I=`\`cookies().delete(${p(arguments[0])}, ...)\``,b(x,I),v.delete.apply(v,arguments)},writable:!1},clear:{value:function(){return b(x,"`cookies().clear()`"),typeof v.clear=="function"?v.clear.apply(v,arguments):R.call(v,D)},writable:!1},toString:{value:function(){return b(x,"`cookies().toString()` or implicit casting"),v.toString.apply(v,arguments)},writable:!1}}),D}function p(v){return typeof v=="object"&&v!==null&&typeof v.name=="string"?`'${v.name}'`:typeof v=="string"?`'${v}'`:"..."}function b(v,x){const C=o.workUnitAsyncStorage.getStore();if(C&&C.type==="request"&&C.prerenderPhase===!0){const D=C;(0,s.trackSynchronousRequestDataAccessInDev)(D)}f(v,x)}const f=(0,c.createDedupedByCallsiteServerErrorLoggerDev)(A);function A(v,x){const C=v?`Route "${v}" `:"This route ";return Object.defineProperty(new Error(`${C}used ${x}. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E223",enumerable:!1,configurable:!0})}function E(){return this.getAll().map(v=>[v.name,v]).values()}function R(v){for(const x of this.getAll())this.delete(x.name);return v}}(Ks)),Ks}var fa={},ha={},hf;function A0(){return hf||(hf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var i in a)Object.defineProperty(s,i,{enumerable:!0,get:a[i]})}t(e,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return r}});const n=Vs();class r extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new r}}class o extends Headers{constructor(a){super(),this.headers=new Proxy(a,{get(i,c,u){if(typeof c=="symbol")return n.ReflectAdapter.get(i,c,u);const l=c.toLowerCase(),d=Object.keys(a).find(h=>h.toLowerCase()===l);if(!(typeof d>"u"))return n.ReflectAdapter.get(i,d,u)},set(i,c,u,l){if(typeof c=="symbol")return n.ReflectAdapter.set(i,c,u,l);const d=c.toLowerCase(),h=Object.keys(a).find(m=>m.toLowerCase()===d);return n.ReflectAdapter.set(i,h??c,u,l)},has(i,c){if(typeof c=="symbol")return n.ReflectAdapter.has(i,c);const u=c.toLowerCase(),l=Object.keys(a).find(d=>d.toLowerCase()===u);return typeof l>"u"?!1:n.ReflectAdapter.has(i,l)},deleteProperty(i,c){if(typeof c=="symbol")return n.ReflectAdapter.deleteProperty(i,c);const u=c.toLowerCase(),l=Object.keys(a).find(d=>d.toLowerCase()===u);return typeof l>"u"?!0:n.ReflectAdapter.deleteProperty(i,l)}})}static seal(a){return new Proxy(a,{get(i,c,u){switch(c){case"append":case"delete":case"set":return r.callable;default:return n.ReflectAdapter.get(i,c,u)}}})}merge(a){return Array.isArray(a)?a.join(", "):a}static from(a){return a instanceof Headers?a:new o(a)}append(a,i){const c=this.headers[a];typeof c=="string"?this.headers[a]=[c,i]:Array.isArray(c)?c.push(i):this.headers[a]=i}delete(a){delete this.headers[a]}get(a){const i=this.headers[a];return typeof i<"u"?this.merge(i):null}has(a){return typeof this.headers[a]<"u"}set(a,i){this.headers[a]=i}forEach(a,i){for(const[c,u]of this.entries())a.call(i,u,c,this)}*entries(){for(const a of Object.keys(this.headers)){const i=a.toLowerCase(),c=this.get(i);yield[i,c]}}*keys(){for(const a of Object.keys(this.headers))yield a.toLowerCase()}*values(){for(const a of Object.keys(this.headers))yield this.get(a)}[Symbol.iterator](){return this.entries()}}}(ha)),ha}var pf;function R0(){return pf||(pf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"headers",{enumerable:!0,get:function(){return l}});const t=A0(),n=kt(),r=Kt(),o=Jn(),s=mn(),a=Vn(),i=ia(),c=sa(),u=da();function l(){const f=n.workAsyncStorage.getStore(),A=r.workUnitAsyncStorage.getStore();if(f){if(A&&A.phase==="after"&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${f.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E367",enumerable:!1,configurable:!0});if(f.forceStatic){const R=t.HeadersAdapter.seal(new Headers({}));return m(R)}if(A){if(A.type==="cache")throw Object.defineProperty(new Error(`Route ${f.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E304",enumerable:!1,configurable:!0});if(A.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${f.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E127",enumerable:!1,configurable:!0})}if(f.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${f.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E525",enumerable:!1,configurable:!0});if(A){if(A.type==="prerender")return h(f.route,A);A.type==="prerender-ppr"?(0,o.postponeWithTracking)(f.route,"headers",A.dynamicTracking):A.type==="prerender-legacy"&&(0,o.throwToInterruptStaticGeneration)("headers",f,A)}(0,o.trackDynamicDataInDynamicRender)(f,A)}const E=(0,r.getExpectedRequestStore)("headers");return process.env.NODE_ENV==="development"&&!(f!=null&&f.isPrefetchRequest)?_(E.headers,f==null?void 0:f.route):m(E.headers)}const d=new WeakMap;function h(f,A){const E=d.get(A);if(E)return E;const R=(0,a.makeHangingPromise)(A.renderSignal,"`headers()`");return d.set(A,R),Object.defineProperties(R,{append:{value:function(){const x=`\`headers().append(${y(arguments[0])}, ...)\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},delete:{value:function(){const x=`\`headers().delete(${y(arguments[0])})\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},get:{value:function(){const x=`\`headers().get(${y(arguments[0])})\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},has:{value:function(){const x=`\`headers().has(${y(arguments[0])})\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},set:{value:function(){const x=`\`headers().set(${y(arguments[0])}, ...)\``,C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},getSetCookie:{value:function(){const x="`headers().getSetCookie()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},forEach:{value:function(){const x="`headers().forEach(...)`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},keys:{value:function(){const x="`headers().keys()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},values:{value:function(){const x="`headers().values()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},entries:{value:function(){const x="`headers().entries()`",C=b(f,x);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,x,C,A)}},[Symbol.iterator]:{value:function(){const v="`headers()[Symbol.iterator]()`",x=b(f,v);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(f,v,x,A)}}}),R}function m(f){const A=d.get(f);if(A)return A;const E=Promise.resolve(f);return d.set(f,E),Object.defineProperties(E,{append:{value:f.append.bind(f)},delete:{value:f.delete.bind(f)},get:{value:f.get.bind(f)},has:{value:f.has.bind(f)},set:{value:f.set.bind(f)},getSetCookie:{value:f.getSetCookie.bind(f)},forEach:{value:f.forEach.bind(f)},keys:{value:f.keys.bind(f)},values:{value:f.values.bind(f)},entries:{value:f.entries.bind(f)},[Symbol.iterator]:{value:f[Symbol.iterator].bind(f)}}),E}function _(f,A){const E=d.get(f);if(E)return E;const R=new Promise(v=>(0,c.scheduleImmediate)(()=>v(f)));return d.set(f,R),Object.defineProperties(R,{append:{value:function(){const x=`\`headers().append(${y(arguments[0])}, ...)\``;return g(A,x),f.append.apply(f,arguments)}},delete:{value:function(){const x=`\`headers().delete(${y(arguments[0])})\``;return g(A,x),f.delete.apply(f,arguments)}},get:{value:function(){const x=`\`headers().get(${y(arguments[0])})\``;return g(A,x),f.get.apply(f,arguments)}},has:{value:function(){const x=`\`headers().has(${y(arguments[0])})\``;return g(A,x),f.has.apply(f,arguments)}},set:{value:function(){const x=`\`headers().set(${y(arguments[0])}, ...)\``;return g(A,x),f.set.apply(f,arguments)}},getSetCookie:{value:function(){return g(A,"`headers().getSetCookie()`"),f.getSetCookie.apply(f,arguments)}},forEach:{value:function(){return g(A,"`headers().forEach(...)`"),f.forEach.apply(f,arguments)}},keys:{value:function(){return g(A,"`headers().keys()`"),f.keys.apply(f,arguments)}},values:{value:function(){return g(A,"`headers().values()`"),f.values.apply(f,arguments)}},entries:{value:function(){return g(A,"`headers().entries()`"),f.entries.apply(f,arguments)}},[Symbol.iterator]:{value:function(){return g(A,"`...headers()` or similar iteration"),f[Symbol.iterator].apply(f,arguments)}}}),R}function y(f){return typeof f=="string"?`'${f}'`:"..."}function g(f,A){const E=r.workUnitAsyncStorage.getStore();if(E&&E.type==="request"&&E.prerenderPhase===!0){const R=E;(0,o.trackSynchronousRequestDataAccessInDev)(R)}p(f,A)}const p=(0,i.createDedupedByCallsiteServerErrorLoggerDev)(b);function b(f,A){const E=f?`Route "${f}" `:"This route ";return Object.defineProperty(new Error(`${E}used ${A}. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E277",enumerable:!1,configurable:!0})}}(fa)),fa}var pa={},mf;function C0(){return mf||(mf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"draftMode",{enumerable:!0,get:function(){return i}});const t=Kt(),n=kt(),r=Jn(),o=ia(),s=mn(),a=tf();function i(){const p="draftMode",b=n.workAsyncStorage.getStore(),f=t.workUnitAsyncStorage.getStore();switch((!b||!f)&&(0,t.throwForMissingRequestStore)(p),f.type){case"request":return c(f.draftMode,b);case"cache":case"unstable-cache":const A=(0,t.getDraftModeProviderForCacheScope)(b,f);if(A)return c(A,b);case"prerender":case"prerender-ppr":case"prerender-legacy":if(process.env.NODE_ENV==="development"&&!(b!=null&&b.isPrefetchRequest)){const R=b==null?void 0:b.route;return d(null,R)}else return l(null);default:return f}}function c(p,b){const f=u.get(i);if(f)return f;let A;if(process.env.NODE_ENV==="development"&&!(b!=null&&b.isPrefetchRequest)){const E=b==null?void 0:b.route;A=d(p,E)}else A=l(p);return u.set(p,A),A}const u=new WeakMap;function l(p){const b=new h(p),f=Promise.resolve(b);return Object.defineProperty(f,"isEnabled",{get(){return b.isEnabled},set(A){Object.defineProperty(f,"isEnabled",{value:A,writable:!0,enumerable:!0})},enumerable:!0,configurable:!0}),f.enable=b.enable.bind(b),f.disable=b.disable.bind(b),f}function d(p,b){const f=new h(p),A=Promise.resolve(f);return Object.defineProperty(A,"isEnabled",{get(){return m(b,"`draftMode().isEnabled`"),f.isEnabled},set(E){Object.defineProperty(A,"isEnabled",{value:E,writable:!0,enumerable:!0})},enumerable:!0,configurable:!0}),Object.defineProperty(A,"enable",{value:function(){return m(b,"`draftMode().enable()`"),f.enable.apply(f,arguments)}}),Object.defineProperty(A,"disable",{value:function(){return m(b,"`draftMode().disable()`"),f.disable.apply(f,arguments)}}),A}class h{constructor(b){this._provider=b}get isEnabled(){return this._provider!==null?this._provider.isEnabled:!1}enable(){g("draftMode().enable()"),this._provider!==null&&this._provider.enable()}disable(){g("draftMode().disable()"),this._provider!==null&&this._provider.disable()}}function m(p,b){const f=t.workUnitAsyncStorage.getStore();if(f&&f.type==="request"&&f.prerenderPhase===!0){const A=f;(0,r.trackSynchronousRequestDataAccessInDev)(A)}_(p,b)}const _=(0,o.createDedupedByCallsiteServerErrorLoggerDev)(y);function y(p,b){const f=p?`Route "${p}" `:"This route ";return Object.defineProperty(new Error(`${f}used ${b}. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E377",enumerable:!1,configurable:!0})}function g(p){const b=n.workAsyncStorage.getStore(),f=t.workUnitAsyncStorage.getStore();if(b){if(f){if(f.type==="cache")throw Object.defineProperty(new Error(`Route ${b.route} used "${p}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E246",enumerable:!1,configurable:!0});if(f.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${b.route} used "${p}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E259",enumerable:!1,configurable:!0});if(f.phase==="after")throw Object.defineProperty(new Error(`Route ${b.route} used "${p}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E348",enumerable:!1,configurable:!0})}if(b.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${p}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(f)if(f.type==="prerender"){const A=Object.defineProperty(new Error(`Route ${b.route} used ${p} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});(0,r.abortAndThrowOnSynchronousRequestDataAccess)(b.route,p,A,f)}else if(f.type==="prerender-ppr")(0,r.postponeWithTracking)(b.route,p,f.dynamicTracking);else if(f.type==="prerender-legacy"){f.revalidate=0;const A=Object.defineProperty(new a.DynamicServerError(`Route ${b.route} couldn't be rendered statically because it used \`${p}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw b.dynamicUsageDescription=p,b.dynamicUsageStack=A.stack,A}else process.env.NODE_ENV==="development"&&f&&f.type==="request"&&(f.usedDynamic=!0)}}}(pa)),pa}var gf;function T0(){return gf||(gf=1,Gn.cookies=x0().cookies,Gn.headers=R0().headers,Gn.draftMode=C0().draftMode),Gn}var Xn=T0(),Br={exports:{}},ma={},ga={},ba={},bf;function P0(){return bf||(bf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return t}});function t(n,r,o){if(n){o&&(o=o.toLowerCase());for(const i of n){var s,a;const c=(s=i.domain)==null?void 0:s.split(":",1)[0].toLowerCase();if(r===c||o===i.defaultLocale.toLowerCase()||(a=i.locales)!=null&&a.some(u=>u.toLowerCase()===o))return i}}}}(ba)),ba}var ya={},wa={},yf;function O0(){return yf||(yf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeTrailingSlash",{enumerable:!0,get:function(){return t}});function t(n){return n.replace(/\/$/,"")||"/"}}(wa)),wa}var va={},Ea={},wf;function _a(){return wf||(wf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t}});function t(n){const r=n.indexOf("#"),o=n.indexOf("?"),s=o>-1&&(r<0||o<r);return s||r>-1?{pathname:n.substring(0,s?o:r),query:s?n.substring(o,r>-1?r:void 0):"",hash:r>-1?n.slice(r):""}:{pathname:n,query:"",hash:""}}}(Ea)),Ea}var vf;function Ef(){return vf||(vf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathPrefix",{enumerable:!0,get:function(){return n}});const t=_a();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:s,query:a,hash:i}=(0,t.parsePath)(r);return""+o+s+a+i}}(va)),va}var Sa={},_f;function k0(){return _f||(_f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathSuffix",{enumerable:!0,get:function(){return n}});const t=_a();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:s,query:a,hash:i}=(0,t.parsePath)(r);return""+s+o+a+i}}(Sa)),Sa}var xa={},Aa={},Sf;function Ra(){return Sf||(Sf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"pathHasPrefix",{enumerable:!0,get:function(){return n}});const t=_a();function n(r,o){if(typeof r!="string")return!1;const{pathname:s}=(0,t.parsePath)(r);return s===o||s.startsWith(o+"/")}}(Aa)),Aa}var xf;function N0(){return xf||(xf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const t=Ef(),n=Ra();function r(o,s,a,i){if(!s||s===a)return o;const c=o.toLowerCase();return!i&&((0,n.pathHasPrefix)(c,"/api")||(0,n.pathHasPrefix)(c,"/"+s.toLowerCase()))?o:(0,t.addPathPrefix)(o,"/"+s)}}(xa)),xa}var Af;function I0(){return Af||(Af=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});const t=O0(),n=Ef(),r=k0(),o=N0();function s(a){let i=(0,o.addLocale)(a.pathname,a.locale,a.buildId?void 0:a.defaultLocale,a.ignorePrefix);return(a.buildId||!a.trailingSlash)&&(i=(0,t.removeTrailingSlash)(i)),a.buildId&&(i=(0,r.addPathSuffix)((0,n.addPathPrefix)(i,"/_next/data/"+a.buildId),a.pathname==="/"?"index.json":".json")),i=(0,n.addPathPrefix)(i,a.basePath),!a.buildId&&a.trailingSlash?i.endsWith("/")?i:(0,r.addPathSuffix)(i,"/"):(0,t.removeTrailingSlash)(i)}}(ya)),ya}var Ca={},Rf;function D0(){return Rf||(Rf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getHostname",{enumerable:!0,get:function(){return t}});function t(n,r){let o;if(r!=null&&r.host&&!Array.isArray(r.host))o=r.host.toString().split(":",1)[0];else if(n.hostname)o=n.hostname;else return;return o.toLowerCase()}}(Ca)),Ca}var Ta={},Pa={},Cf;function M0(){return Cf||(Cf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});const t=new WeakMap;function n(r,o){if(!o)return{pathname:r};let s=t.get(o);s||(s=o.map(l=>l.toLowerCase()),t.set(o,s));let a;const i=r.split("/",2);if(!i[1])return{pathname:r};const c=i[1].toLowerCase(),u=s.indexOf(c);return u<0?{pathname:r}:(a=o[u],r=r.slice(a.length+1)||"/",{pathname:r,detectedLocale:a})}}(Pa)),Pa}var Oa={},Tf;function L0(){return Tf||(Tf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removePathPrefix",{enumerable:!0,get:function(){return n}});const t=Ra();function n(r,o){if(!(0,t.pathHasPrefix)(r,o))return r;const s=r.slice(o.length);return s.startsWith("/")?s:"/"+s}}(Oa)),Oa}var Pf;function j0(){return Pf||(Pf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});const t=M0(),n=L0(),r=Ra();function o(s,a){var i;const{basePath:c,i18n:u,trailingSlash:l}=(i=a.nextConfig)!=null?i:{},d={pathname:s,trailingSlash:s!=="/"?s.endsWith("/"):l};c&&(0,r.pathHasPrefix)(d.pathname,c)&&(d.pathname=(0,n.removePathPrefix)(d.pathname,c),d.basePath=c);let h=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const _=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),y=_[0];d.buildId=y,h=_[1]!=="index"?"/"+_.slice(1).join("/"):"/",a.parseData===!0&&(d.pathname=h)}if(u){let _=a.i18nProvider?a.i18nProvider.analyze(d.pathname):(0,t.normalizeLocalePath)(d.pathname,u.locales);d.locale=_.detectedLocale;var m;d.pathname=(m=_.pathname)!=null?m:d.pathname,!_.detectedLocale&&d.buildId&&(_=a.i18nProvider?a.i18nProvider.analyze(h):(0,t.normalizeLocalePath)(h,u.locales),_.detectedLocale&&(d.locale=_.detectedLocale))}return d}}(Ta)),Ta}var Of;function kf(){return Of||(Of=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextURL",{enumerable:!0,get:function(){return c}});const t=P0(),n=I0(),r=D0(),o=j0(),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function a(u,l){return new URL(String(u).replace(s,"localhost"),l&&String(l).replace(s,"localhost"))}const i=Symbol("NextURLInternal");class c{constructor(l,d,h){let m,_;typeof d=="object"&&"pathname"in d||typeof d=="string"?(m=d,_=h||{}):_=h||d||{},this[i]={url:a(l,m??_.base),options:_,basePath:""},this.analyze()}analyze(){var l,d,h,m,_;const y=(0,o.getNextPathnameInfo)(this[i].url.pathname,{nextConfig:this[i].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[i].options.i18nProvider}),g=(0,r.getHostname)(this[i].url,this[i].options.headers);this[i].domainLocale=this[i].options.i18nProvider?this[i].options.i18nProvider.detectDomainLocale(g):(0,t.detectDomainLocale)((d=this[i].options.nextConfig)==null||(l=d.i18n)==null?void 0:l.domains,g);const p=((h=this[i].domainLocale)==null?void 0:h.defaultLocale)||((_=this[i].options.nextConfig)==null||(m=_.i18n)==null?void 0:m.defaultLocale);this[i].url.pathname=y.pathname,this[i].defaultLocale=p,this[i].basePath=y.basePath??"",this[i].buildId=y.buildId,this[i].locale=y.locale??p,this[i].trailingSlash=y.trailingSlash}formatPathname(){return(0,n.formatNextPathnameInfo)({basePath:this[i].basePath,buildId:this[i].buildId,defaultLocale:this[i].options.forceLocale?void 0:this[i].defaultLocale,locale:this[i].locale,pathname:this[i].url.pathname,trailingSlash:this[i].trailingSlash})}formatSearch(){return this[i].url.search}get buildId(){return this[i].buildId}set buildId(l){this[i].buildId=l}get locale(){return this[i].locale??""}set locale(l){var d,h;if(!this[i].locale||!(!((h=this[i].options.nextConfig)==null||(d=h.i18n)==null)&&d.locales.includes(l)))throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale "${l}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[i].locale=l}get defaultLocale(){return this[i].defaultLocale}get domainLocale(){return this[i].domainLocale}get searchParams(){return this[i].url.searchParams}get host(){return this[i].url.host}set host(l){this[i].url.host=l}get hostname(){return this[i].url.hostname}set hostname(l){this[i].url.hostname=l}get port(){return this[i].url.port}set port(l){this[i].url.port=l}get protocol(){return this[i].url.protocol}set protocol(l){this[i].url.protocol=l}get href(){const l=this.formatPathname(),d=this.formatSearch();return`${this.protocol}//${this.host}${l}${d}${this.hash}`}set href(l){this[i].url=a(l),this.analyze()}get origin(){return this[i].url.origin}get pathname(){return this[i].url.pathname}set pathname(l){this[i].url.pathname=l}get hash(){return this[i].url.hash}set hash(l){this[i].url.hash=l}get search(){return this[i].url.search}set search(l){this[i].url.search=l}get password(){return this[i].url.password}set password(l){this[i].url.password=l}get username(){return this[i].url.username}set username(l){this[i].url.username=l}get basePath(){return this[i].basePath}set basePath(l){this[i].basePath=l.startsWith("/")?l:`/${l}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new c(String(this),this[i].options)}}}(ga)),ga}var ka={},Na={},Nf;function H0(){return Nf||(Nf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(pe,Ae){for(var De in Ae)Object.defineProperty(pe,De,{enumerable:!0,get:Ae[De]})}t(e,{ACTION_SUFFIX:function(){return d},APP_DIR_ALIAS:function(){return oe},CACHE_ONE_YEAR:function(){return v},DOT_NEXT_ALIAS:function(){return U},ESLINT_DEFAULT_DIRS:function(){return z},GSP_NO_RETURNED_VALUE:function(){return le},GSSP_COMPONENT_MEMBER_ERROR:function(){return k},GSSP_NO_RETURNED_VALUE:function(){return ue},INFINITE_CACHE:function(){return x},INSTRUMENTATION_HOOK_FILENAME:function(){return I},MATCHED_PATH_HEADER:function(){return o},MIDDLEWARE_FILENAME:function(){return C},MIDDLEWARE_LOCATION_REGEXP:function(){return D},NEXT_BODY_SUFFIX:function(){return _},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return R},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return g},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return p},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return E},NEXT_CACHE_TAGS_HEADER:function(){return y},NEXT_CACHE_TAG_MAX_ITEMS:function(){return f},NEXT_CACHE_TAG_MAX_LENGTH:function(){return A},NEXT_DATA_SUFFIX:function(){return h},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return r},NEXT_META_SUFFIX:function(){return m},NEXT_QUERY_PARAM_PREFIX:function(){return n},NEXT_RESUME_HEADER:function(){return b},NON_STANDARD_NODE_ENV:function(){return N},PAGES_DIR_ALIAS:function(){return P},PRERENDER_REVALIDATE_HEADER:function(){return s},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return J},ROOT_DIR_ALIAS:function(){return G},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return H},RSC_ACTION_ENCRYPTION_ALIAS:function(){return T},RSC_ACTION_PROXY_ALIAS:function(){return O},RSC_ACTION_VALIDATE_ALIAS:function(){return Y},RSC_CACHE_WRAPPER_ALIAS:function(){return j},RSC_MOD_REF_PROXY_ALIAS:function(){return V},RSC_PREFETCH_SUFFIX:function(){return i},RSC_SEGMENTS_DIR_SUFFIX:function(){return c},RSC_SEGMENT_SUFFIX:function(){return u},RSC_SUFFIX:function(){return l},SERVER_PROPS_EXPORT_ERROR:function(){return te},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return se},SERVER_PROPS_SSG_CONFLICT:function(){return fe},SERVER_RUNTIME:function(){return ne},SSG_FALLBACK_EXPORT_ERROR:function(){return M},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return X},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return we},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return ye},WEBPACK_LAYERS:function(){return _e},WEBPACK_RESOURCE_QUERIES:function(){return Ce}});const n="nxtP",r="nxtI",o="x-matched-path",s="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",i=".prefetch.rsc",c=".segments",u=".segment.rsc",l=".rsc",d=".action",h=".json",m=".meta",_=".body",y="x-next-cache-tags",g="x-next-revalidated-tags",p="x-next-revalidate-tag-token",b="next-resume",f=128,A=256,E=1024,R="_N_T_",v=31536e3,x=4294967294,C="middleware",D=`(?:src/)?${C}`,I="instrumentation",P="private-next-pages",U="private-dot-next",G="private-next-root-dir",oe="private-next-app-dir",V="private-next-rsc-mod-ref-proxy",Y="private-next-rsc-action-validate",O="private-next-rsc-server-reference",j="private-next-rsc-cache-wrapper",T="private-next-rsc-action-encryption",H="private-next-rsc-action-client-wrapper",J="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",X="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",se="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",fe="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",we="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",te="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",le="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",ue="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",ye="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",k="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",N='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',M="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",z=["app","pages","components","lib","src"],ne={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},$={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"},_e={...$,GROUP:{builtinReact:[$.reactServerComponents,$.actionBrowser],serverOnly:[$.reactServerComponents,$.actionBrowser,$.instrument,$.middleware],neutralTarget:[$.apiNode,$.apiEdge],clientOnly:[$.serverSideRendering,$.appPagesBrowser],bundled:[$.reactServerComponents,$.actionBrowser,$.serverSideRendering,$.appPagesBrowser,$.shared,$.instrument,$.middleware],appPages:[$.reactServerComponents,$.serverSideRendering,$.appPagesBrowser,$.actionBrowser]}},Ce={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}}(Na)),Na}var If;function Df(){return If||(If=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{fromNodeOutgoingHttpHeaders:function(){return r},normalizeNextQueryParam:function(){return i},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return s},validateURL:function(){return a}});const n=H0();function r(c){const u=new Headers;for(let[l,d]of Object.entries(c)){const h=Array.isArray(d)?d:[d];for(let m of h)typeof m>"u"||(typeof m=="number"&&(m=m.toString()),u.append(l,m))}return u}function o(c){var u=[],l=0,d,h,m,_,y;function g(){for(;l<c.length&&/\s/.test(c.charAt(l));)l+=1;return l<c.length}function p(){return h=c.charAt(l),h!=="="&&h!==";"&&h!==","}for(;l<c.length;){for(d=l,y=!1;g();)if(h=c.charAt(l),h===","){for(m=l,l+=1,g(),_=l;l<c.length&&p();)l+=1;l<c.length&&c.charAt(l)==="="?(y=!0,l=_,u.push(c.substring(d,m)),d=l):l=m+1}else l+=1;(!y||l>=c.length)&&u.push(c.substring(d,c.length))}return u}function s(c){const u={},l=[];if(c)for(const[d,h]of c.entries())d.toLowerCase()==="set-cookie"?(l.push(...o(h)),u[d]=l.length===1?l[0]:l):u[d]=h;return u}function a(c){try{return String(new URL(String(c)))}catch(u){throw Object.defineProperty(new Error(`URL is malformed "${String(c)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:u}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function i(c){const u=[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX];for(const l of u)if(c!==l&&c.startsWith(l))return c.substring(l.length);return null}}(ka)),ka}var Ia={},Mf;function U0(){return Mf||(Mf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var i in a)Object.defineProperty(s,i,{enumerable:!0,get:a[i]})}t(e,{PageSignatureError:function(){return n},RemovedPageError:function(){return r},RemovedUAError:function(){return o}});class n extends Error{constructor({page:a}){super(`The middleware "${a}" accepts an async API directly with the form:
187
187
 
188
188
  export function middleware(request, event) {
189
189
  return NextResponse.redirect('/new-location')
190
190
  }
191
191
 
192
192
  Read more: https://nextjs.org/docs/messages/middleware-new-signature
193
- `)}}class r extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class o extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}}(Ia)),Ia}var If;function L0(){return If||(If=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{INTERNALS:function(){return a},NextRequest:function(){return i}});const n=Tf(),r=kf(),o=M0(),s=Bn(),a=Symbol("internal request");class i extends Request{constructor(u,l={}){const d=typeof u!="string"&&"url"in u?u.url:String(u);(0,r.validateURL)(d),process.env.NEXT_RUNTIME!=="edge"&&l.body&&l.duplex!=="half"&&(l.duplex="half"),u instanceof Request?super(u,l):super(d,l);const h=new n.NextURL(d,{headers:(0,r.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:l.nextConfig});this[a]={cookies:new s.RequestCookies(this.headers),nextUrl:h,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?d:h.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[a].cookies}get nextUrl(){return this[a].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[a].url}}}(ma)),ma}var Da={},Df;function j0(){return Df||(Df=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextResponse",{enumerable:!0,get:function(){return u}});const t=Bn(),n=Tf(),r=kf(),o=Vs(),s=Bn(),a=Symbol("internal response"),i=new Set([301,302,303,307,308]);function c(l,d){var h;if(!(l==null||(h=l.request)==null)&&h.headers){if(!(l.request.headers instanceof Headers))throw Object.defineProperty(new Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});const m=[];for(const[_,y]of l.request.headers)d.set("x-middleware-request-"+_,y),m.push(_);d.set("x-middleware-override-headers",m.join(","))}}class u extends Response{constructor(d,h={}){super(d,h);const m=this.headers,_=new s.ResponseCookies(m),y=new Proxy(_,{get(g,p,b){switch(p){case"delete":case"set":return(...f)=>{const A=Reflect.apply(g[p],g,f),E=new Headers(m);return A instanceof s.ResponseCookies&&m.set("x-middleware-set-cookie",A.getAll().map(R=>(0,t.stringifyCookie)(R)).join(",")),c(h,E),A};default:return o.ReflectAdapter.get(g,p,b)}}});this[a]={cookies:y,url:h.url?new n.NextURL(h.url,{headers:(0,r.toNodeOutgoingHttpHeaders)(m),nextConfig:h.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[a].cookies}static json(d,h){const m=Response.json(d,h);return new u(m.body,m)}static redirect(d,h){const m=typeof h=="number"?h:(h==null?void 0:h.status)??307;if(!i.has(m))throw Object.defineProperty(new RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});const _=typeof h=="object"?h:{},y=new Headers(_==null?void 0:_.headers);return y.set("Location",(0,r.validateURL)(d)),new u(null,{..._,headers:y,status:m})}static rewrite(d,h){const m=new Headers(h==null?void 0:h.headers);return m.set("x-middleware-rewrite",(0,r.validateURL)(d)),c(h,m),new u(null,{...h,headers:m})}static next(d){const h=new Headers(d==null?void 0:d.headers);return h.set("x-middleware-next","1"),c(d,h),new u(null,{...d,headers:h})}}}(Da)),Da}var Ma={},Mf;function H0(){return Mf||(Mf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ImageResponse",{enumerable:!0,get:function(){return t}});function t(){throw Object.defineProperty(new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}}(Ma)),Ma}var La={},ja={exports:{}},Lf;function U0(){return Lf||(Lf=1,(()=>{var e={226:function(o,s){(function(a,i){var c="1.0.35",u="",l="?",d="function",h="undefined",m="object",_="string",y="major",g="model",p="name",b="type",f="vendor",A="version",E="architecture",R="console",v="mobile",x="tablet",C="smarttv",D="wearable",I="embedded",P=350,U="Amazon",G="Apple",oe="ASUS",V="BlackBerry",Y="Browser",O="Chrome",j="Edge",T="Firefox",H="Google",J="Huawei",X="LG",se="Microsoft",fe="Motorola",we="Opera",te="Samsung",le="Sharp",ue="Sony",ye="Xiaomi",k="Zebra",N="Facebook",M="Chromium OS",z="Mac OS",ne=function(ie,ge){var re={};for(var ve in ie)ge[ve]&&ge[ve].length%2===0?re[ve]=ge[ve].concat(ie[ve]):re[ve]=ie[ve];return re},$=function(ie){for(var ge={},re=0;re<ie.length;re++)ge[ie[re].toUpperCase()]=ie[re];return ge},_e=function(ie,ge){return typeof ie===_?Ce(ge).indexOf(Ce(ie))!==-1:!1},Ce=function(ie){return ie.toLowerCase()},pe=function(ie){return typeof ie===_?ie.replace(/[^\d\.]/g,u).split(".")[0]:i},Ae=function(ie,ge){if(typeof ie===_)return ie=ie.replace(/^\s\s*/,u),typeof ge===h?ie:ie.substring(0,P)},De=function(ie,ge){for(var re=0,ve,Lt,ft,me,Q,ht;re<ge.length&&!Q;){var Ii=ge[re],op=ge[re+1];for(ve=Lt=0;ve<Ii.length&&!Q&&Ii[ve];)if(Q=Ii[ve++].exec(ie),Q)for(ft=0;ft<op.length;ft++)ht=Q[++Lt],me=op[ft],typeof me===m&&me.length>0?me.length===2?typeof me[1]==d?this[me[0]]=me[1].call(this,ht):this[me[0]]=me[1]:me.length===3?typeof me[1]===d&&!(me[1].exec&&me[1].test)?this[me[0]]=ht?me[1].call(this,ht,me[2]):i:this[me[0]]=ht?ht.replace(me[1],me[2]):i:me.length===4&&(this[me[0]]=ht?me[3].call(this,ht.replace(me[1],me[2])):i):this[me]=ht||i;re+=2}},xn=function(ie,ge){for(var re in ge)if(typeof ge[re]===m&&ge[re].length>0){for(var ve=0;ve<ge[re].length;ve++)if(_e(ge[re][ve],ie))return re===l?i:re}else if(_e(ge[re],ie))return re===l?i:re;return ie},po={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},nr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ke={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[A,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[A,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,A],[/opios[\/ ]+([\w\.]+)/i],[A,[p,we+" Mini"]],[/\bopr\/([\w\.]+)/i],[A,[p,we]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,A],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[A,[p,"UC"+Y]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[A,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[A,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[A,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[A,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[A,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+Y],A],[/\bfocus\/([\w\.]+)/i],[A,[p,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[A,[p,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[A,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[A,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[A,[p,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[A,[p,"MIUI "+Y]],[/fxios\/([-\w\.]+)/i],[A,[p,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+Y]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+Y],A],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],A],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,A],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,N],A],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,A],[/\bgsa\/([\w\.]+) .*safari\//i],[A,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[A,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[A,[p,O+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,O+" WebView"],A],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[A,[p,"Android "+Y]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,A],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[A,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[A,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[A,xn,po]],[/(webkit|khtml)\/([\w\.]+)/i],[p,A],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],A],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[A,[p,T+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,A],[/(cobalt)\/([\w\.]+)/i],[p,[A,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,Ce]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows (ce|mobile); ppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[E,/ower/,u,Ce]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,Ce]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[f,te],[b,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[g,[f,te],[b,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[g,[f,G],[b,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[g,[f,G],[b,x]],[/(macintosh);/i],[g,[f,G]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[f,le],[b,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[g,[f,J],[b,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[g,[f,J],[b,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[g,/_/g," "],[f,ye],[b,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[g,/_/g," "],[f,ye],[b,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[f,"OPPO"],[b,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[f,"Vivo"],[b,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[g,[f,"Realme"],[b,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[g,[f,fe],[b,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[f,fe],[b,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[f,X],[b,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[f,X],[b,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[g,[f,"Lenovo"],[b,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[g,/_/g," "],[f,"Nokia"],[b,v]],[/(pixel c)\b/i],[g,[f,H],[b,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[g,[f,H],[b,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[f,ue],[b,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[f,ue],[b,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[f,"OnePlus"],[b,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[f,U],[b,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[f,U],[b,v]],[/(playbook);[-\w\),; ]+(rim)/i],[g,f,[b,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[g,[f,V],[b,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[f,oe],[b,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[f,oe],[b,v]],[/(nexus 9)/i],[g,[f,"HTC"],[b,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[g,/_/g," "],[b,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[f,"Acer"],[b,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[f,"Meizu"],[b,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,g,[b,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,g,[b,x]],[/(surface duo)/i],[g,[f,se],[b,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[f,"Fairphone"],[b,v]],[/(u304aa)/i],[g,[f,"AT&T"],[b,v]],[/\bsie-(\w*)/i],[g,[f,"Siemens"],[b,v]],[/\b(rct\w+) b/i],[g,[f,"RCA"],[b,x]],[/\b(venue[\d ]{2,7}) b/i],[g,[f,"Dell"],[b,x]],[/\b(q(?:mv|ta)\w+) b/i],[g,[f,"Verizon"],[b,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[g,[f,"Barnes & Noble"],[b,x]],[/\b(tm\d{3}\w+) b/i],[g,[f,"NuVision"],[b,x]],[/\b(k88) b/i],[g,[f,"ZTE"],[b,x]],[/\b(nx\d{3}j) b/i],[g,[f,"ZTE"],[b,v]],[/\b(gen\d{3}) b.+49h/i],[g,[f,"Swiss"],[b,v]],[/\b(zur\d{3}) b/i],[g,[f,"Swiss"],[b,x]],[/\b((zeki)?tb.*\b) b/i],[g,[f,"Zeki"],[b,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],g,[b,x]],[/\b(ns-?\w{0,9}) b/i],[g,[f,"Insignia"],[b,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[g,[f,"NextBook"],[b,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],g,[b,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],g,[b,v]],[/\b(ph-1) /i],[g,[f,"Essential"],[b,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[g,[f,"Envizen"],[b,x]],[/\b(trio[-\w\. ]+) b/i],[g,[f,"MachSpeed"],[b,x]],[/\btu_(1491) b/i],[g,[f,"Rotor"],[b,x]],[/(shield[\w ]+) b/i],[g,[f,"Nvidia"],[b,x]],[/(sprint) (\w+)/i],[f,g,[b,v]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[f,se],[b,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[f,k],[b,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[f,k],[b,v]],[/smart-tv.+(samsung)/i],[f,[b,C]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[f,te],[b,C]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,X],[b,C]],[/(apple) ?tv/i],[f,[g,G+" TV"],[b,C]],[/crkey/i],[[g,O+"cast"],[f,H],[b,C]],[/droid.+aft(\w)( bui|\))/i],[g,[f,U],[b,C]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[f,le],[b,C]],[/(bravia[\w ]+)( bui|\))/i],[g,[f,ue],[b,C]],[/(mitv-\w{5}) bui/i],[g,[f,ye],[b,C]],[/Hbbtv.*(technisat) (.*);/i],[f,g,[b,C]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,Ae],[g,Ae],[b,C]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[b,C]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,g,[b,R]],[/droid.+; (shield) bui/i],[g,[f,"Nvidia"],[b,R]],[/(playstation [345portablevi]+)/i],[g,[f,ue],[b,R]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[f,se],[b,R]],[/((pebble))app/i],[f,g,[b,D]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[g,[f,G],[b,D]],[/droid.+; (glass) \d/i],[g,[f,H],[b,D]],[/droid.+; (wt63?0{2,3})\)/i],[g,[f,k],[b,D]],[/(quest( 2| pro)?)/i],[g,[f,N],[b,D]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[b,I]],[/(aeobc)\b/i],[g,[f,U],[b,I]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[g,[b,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[g,[b,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[b,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[b,v]],[/(android[-\w\. ]{0,9});.+buil/i],[g,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[A,[p,j+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[A,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,A],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[A,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,A],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[A,xn,nr]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[A,xn,nr]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[A,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,z],[A,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[A,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,A],[/\(bb(10);/i],[A,[p,V]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[A,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[A,[p,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[A,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[A,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[A,[p,O+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,M],A],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,A],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],A],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,A]]},Re=function(ie,ge){if(typeof ie===m&&(ge=ie,ie=i),!(this instanceof Re))return new Re(ie,ge).getResult();var re=typeof a!==h&&a.navigator?a.navigator:i,ve=ie||(re&&re.userAgent?re.userAgent:u),Lt=re&&re.userAgentData?re.userAgentData:i,ft=ge?ne(Ke,ge):Ke,me=re&&re.userAgent==ve;return this.getBrowser=function(){var Q={};return Q[p]=i,Q[A]=i,De.call(Q,ve,ft.browser),Q[y]=pe(Q[A]),me&&re&&re.brave&&typeof re.brave.isBrave==d&&(Q[p]="Brave"),Q},this.getCPU=function(){var Q={};return Q[E]=i,De.call(Q,ve,ft.cpu),Q},this.getDevice=function(){var Q={};return Q[f]=i,Q[g]=i,Q[b]=i,De.call(Q,ve,ft.device),me&&!Q[b]&&Lt&&Lt.mobile&&(Q[b]=v),me&&Q[g]=="Macintosh"&&re&&typeof re.standalone!==h&&re.maxTouchPoints&&re.maxTouchPoints>2&&(Q[g]="iPad",Q[b]=x),Q},this.getEngine=function(){var Q={};return Q[p]=i,Q[A]=i,De.call(Q,ve,ft.engine),Q},this.getOS=function(){var Q={};return Q[p]=i,Q[A]=i,De.call(Q,ve,ft.os),me&&!Q[p]&&Lt&&Lt.platform!="Unknown"&&(Q[p]=Lt.platform.replace(/chrome os/i,M).replace(/macos/i,z)),Q},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ve},this.setUA=function(Q){return ve=typeof Q===_&&Q.length>P?Ae(Q,P):Q,this},this.setUA(ve),this};Re.VERSION=c,Re.BROWSER=$([p,A,y]),Re.CPU=$([E]),Re.DEVICE=$([g,f,b,R,v,C,x,D,I]),Re.ENGINE=Re.OS=$([p,A]),typeof s!==h?(o.exports&&(s=o.exports=Re),s.UAParser=Re):typeof a!==h&&(a.UAParser=Re);var dt=typeof a!==h&&(a.jQuery||a.Zepto);if(dt&&!dt.ua){var An=new Re;dt.ua=An.getResult(),dt.ua.get=function(){return An.getUA()},dt.ua.set=function(ie){An.setUA(ie);var ge=An.getResult();for(var re in ge)dt.ua[re]=ge[re]}}})(typeof window=="object"?window:this)}},t={};function n(o){var s=t[o];if(s!==void 0)return s.exports;var a=t[o]={exports:{}},i=!0;try{e[o].call(a.exports,a,a.exports,n),i=!1}finally{i&&delete t[o]}return a.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(226);ja.exports=r})()),ja.exports}var jf;function Hf(){return jf||(jf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,c){for(var u in c)Object.defineProperty(i,u,{enumerable:!0,get:c[u]})}t(e,{isBot:function(){return o},userAgent:function(){return a},userAgentFromString:function(){return s}});const n=r(U0());function r(i){return i&&i.__esModule?i:{default:i}}function o(i){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(i)}function s(i){return{...(0,n.default)(i),isBot:i===void 0?!1:o(i)}}function a({headers:i}){return s(i.get("user-agent")||void 0)}}(La)),La}var Ha={},Uf;function $0(){return Uf||(Uf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"URLPattern",{enumerable:!0,get:function(){return t}});const t=typeof URLPattern>"u"?void 0:URLPattern}(Ha)),Ha}var Ua={},$a={},$f;function W0(){return $f||($f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"after",{enumerable:!0,get:function(){return n}});const t=kt();function n(r){const o=t.workAsyncStorage.getStore();if(!o)throw Object.defineProperty(new Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});const{afterContext:s}=o;return s.after(r)}}($a)),$a}var Wf;function F0(){return Wf||(Wf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),t(W0(),e);function t(n,r){return Object.keys(n).forEach(function(o){o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:function(){return n[o]}})}),n}}(Ua)),Ua}var Wa={},Ff;function K0(){return Ff||(Ff=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"connection",{enumerable:!0,get:function(){return i}});const t=kt(),n=Kt(),r=Jn(),o=mn(),s=Vn(),a=da();function i(){const c=t.workAsyncStorage.getStore(),u=n.workUnitAsyncStorage.getStore();if(c){if(u&&u.phase==="after"&&!(0,a.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${c.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(c.forceStatic)return Promise.resolve(void 0);if(u){if(u.type==="cache")throw Object.defineProperty(new Error(`Route ${c.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E111",enumerable:!1,configurable:!0});if(u.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${c.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0})}if(c.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(u){if(u.type==="prerender")return(0,s.makeHangingPromise)(u.renderSignal,"`connection()`");u.type==="prerender-ppr"?(0,r.postponeWithTracking)(c.route,"connection",u.dynamicTracking):u.type==="prerender-legacy"&&(0,r.throwToInterruptStaticGeneration)("connection",c,u)}(0,r.trackDynamicDataInDynamicRender)(c,u)}return Promise.resolve(void 0)}}(Wa)),Wa}var Fa={},Ka={},Kf;function q0(){return Kf||(Kf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"InvariantError",{enumerable:!0,get:function(){return t}});class t extends Error{constructor(r,o){super("Invariant: "+(r.endsWith(".")?r:r+".")+" This is a bug in Next.js.",o),this.name="InvariantError"}}}(Ka)),Ka}var qa={},qf;function z0(){return qf||(qf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}t(e,{describeHasCheckingStringProperty:function(){return o},describeStringPropertyAccess:function(){return r},wellKnownProperties:function(){return s}});const n=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function r(a,i){return n.test(i)?"`"+a+"."+i+"`":"`"+a+"["+JSON.stringify(i)+"]`"}function o(a,i){const c=JSON.stringify(i);return"`Reflect.has("+a+", "+c+")`, `"+c+" in "+a+"`, or similar"}const s=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","toJSON","$$typeof","__esModule"])}(qa)),qa}var zf;function G0(){return zf||(zf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"unstable_rootParams",{enumerable:!0,get:function(){return c}});const t=q0(),n=Jn(),r=kt(),o=Kt(),s=Vn(),a=z0(),i=new WeakMap;async function c(){const d=r.workAsyncStorage.getStore();if(!d)throw Object.defineProperty(new t.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});const h=o.workUnitAsyncStorage.getStore();if(!h)throw Object.defineProperty(new Error(`Route ${d.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(h.type){case"unstable-cache":case"cache":throw Object.defineProperty(new Error(`Route ${d.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-ppr":case"prerender-legacy":return u(h.rootParams,d,h);default:return Promise.resolve(h.rootParams)}}function u(d,h,m){const _=h.fallbackRouteParams;if(_){let y=!1;for(const g in d)if(_.has(g)){y=!0;break}if(y){if(m.type==="prerender"){const g=i.get(d);if(g)return g;const p=(0,s.makeHangingPromise)(m.renderSignal,"`unstable_rootParams`");return i.set(d,p),p}return l(d,_,h,m)}}return Promise.resolve(d)}function l(d,h,m,_){const y=i.get(d);if(y)return y;const g={...d},p=Promise.resolve(g);return i.set(d,p),Object.keys(d).forEach(b=>{a.wellKnownProperties.has(b)||(h.has(b)?Object.defineProperty(g,b,{get(){const f=(0,a.describeStringPropertyAccess)("unstable_rootParams",b);_.type==="prerender-ppr"?(0,n.postponeWithTracking)(m.route,f,_.dynamicTracking):(0,n.throwToInterruptStaticGeneration)(f,m,_)},enumerable:!0}):p[b]=d[b])}),p}}(Fa)),Fa}var Gf;function B0(){return Gf||(Gf=1,function(e,t){const n={NextRequest:L0().NextRequest,NextResponse:j0().NextResponse,ImageResponse:H0().ImageResponse,userAgentFromString:Hf().userAgentFromString,userAgent:Hf().userAgent,URLPattern:$0().URLPattern,after:F0().after,connection:K0().connection,unstable_rootParams:G0().unstable_rootParams};e.exports=n,t.NextRequest=n.NextRequest,t.NextResponse=n.NextResponse,t.ImageResponse=n.ImageResponse,t.userAgentFromString=n.userAgentFromString,t.userAgent=n.userAgent,t.URLPattern=n.URLPattern,t.after=n.after,t.connection=n.connection,t.unstable_rootParams=n.unstable_rootParams}(Br,Br.exports)),Br.exports}var be=B0();const ce=crypto,Be=e=>e instanceof CryptoKey,V0=async(e,t)=>{const n=`SHA-${e.slice(-3)}`;return new Uint8Array(await ce.subtle.digest(n,t))},$e=new TextEncoder,qt=new TextDecoder,Vr=2**32;function Et(...e){const t=e.reduce((o,{length:s})=>o+s,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function J0(e,t){return Et($e.encode(e),new Uint8Array([0]),t)}function za(e,t,n){if(t<0||t>=Vr)throw new RangeError(`value must be >= 0 and <= ${Vr-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function Bf(e){const t=Math.floor(e/Vr),n=e%Vr,r=new Uint8Array(8);return za(r,t,0),za(r,n,4),r}function Ga(e){const t=new Uint8Array(4);return za(t,e),t}function Ba(e){return Et(Ga(e.length),e)}async function X0(e,t,n){const r=Math.ceil((t>>3)/32),o=new Uint8Array(r*32);for(let s=0;s<r;s++){const a=new Uint8Array(4+e.length+n.length);a.set(Ga(s+1)),a.set(e,4),a.set(n,4+e.length),o.set(await V0("sha256",a),s*32)}return o.slice(0,t>>3)}const Y0=e=>{let t=e;typeof t=="string"&&(t=$e.encode(t));const n=32768,r=[];for(let o=0;o<t.length;o+=n)r.push(String.fromCharCode.apply(null,t.subarray(o,o+n)));return btoa(r.join(""))},Ve=e=>Y0(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Z0=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n},Oe=e=>{let t=e;t instanceof Uint8Array&&(t=qt.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Z0(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class Me extends Error{constructor(t,n){var r;super(t,n),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)==null||r.call(Error,this,this.constructor)}}Me.code="ERR_JOSE_GENERIC";class qe extends Me{constructor(t,n,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=o,this.payload=n}}qe.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class Va extends Me{constructor(t,n,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=o,this.payload=n}}Va.code="ERR_JWT_EXPIRED";class Jr extends Me{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}Jr.code="ERR_JOSE_ALG_NOT_ALLOWED";class Se extends Me{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}Se.code="ERR_JOSE_NOT_SUPPORTED";class Xr extends Me{constructor(t="decryption operation failed",n){super(t,n),this.code="ERR_JWE_DECRYPTION_FAILED"}}Xr.code="ERR_JWE_DECRYPTION_FAILED";class B extends Me{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}B.code="ERR_JWE_INVALID";class ke extends Me{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}ke.code="ERR_JWS_INVALID";class Ja extends Me{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}Ja.code="ERR_JWT_INVALID";class Q0 extends Me{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}Q0.code="ERR_JWK_INVALID";class Xa extends Me{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}Xa.code="ERR_JWKS_INVALID";class Ya extends Me{constructor(t="no applicable key found in the JSON Web Key Set",n){super(t,n),this.code="ERR_JWKS_NO_MATCHING_KEY"}}Ya.code="ERR_JWKS_NO_MATCHING_KEY";class Vf extends Me{constructor(t="multiple matching keys found in the JSON Web Key Set",n){super(t,n),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Vf.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class Jf extends Me{constructor(t="request timed out",n){super(t,n),this.code="ERR_JWKS_TIMEOUT"}}Jf.code="ERR_JWKS_TIMEOUT";class Xf extends Me{constructor(t="signature verification failed",n){super(t,n),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}Xf.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";const Za=ce.getRandomValues.bind(ce);function Yf(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new Se(`Unsupported JWE Algorithm: ${e}`)}}const eE=e=>Za(new Uint8Array(Yf(e)>>3)),Zf=(e,t)=>{if(t.length<<3!==Yf(e))throw new B("Invalid Initialization Vector length")},Yr=(e,t)=>{const n=e.byteLength<<3;if(n!==t)throw new B(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)},tE=(e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const n=e.length;let r=0,o=-1;for(;++o<n;)r|=e[o]^t[o];return r===0};function Ne(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function _t(e,t){return e.name===t}function Zr(e){return parseInt(e.name.slice(4),10)}function nE(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function Qf(e,t){if(t.length&&!t.some(n=>e.usages.includes(n))){let n="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();n+=`one of ${t.join(", ")}, or ${r}.`}else t.length===2?n+=`one of ${t[0]} or ${t[1]}.`:n+=`${t[0]}.`;throw new TypeError(n)}}function rE(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!_t(e.algorithm,"HMAC"))throw Ne("HMAC");const r=parseInt(t.slice(2),10);if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!_t(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Ne("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!_t(e.algorithm,"RSA-PSS"))throw Ne("RSA-PSS");const r=parseInt(t.slice(2),10);if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":{if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw Ne("Ed25519 or Ed448");break}case"Ed25519":{if(!_t(e.algorithm,"Ed25519"))throw Ne("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!_t(e.algorithm,"ECDSA"))throw Ne("ECDSA");const r=nE(t);if(e.algorithm.namedCurve!==r)throw Ne(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Qf(e,n)}function Nt(e,t,...n){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!_t(e.algorithm,"AES-GCM"))throw Ne("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Ne(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!_t(e.algorithm,"AES-KW"))throw Ne("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Ne(r,"algorithm.length");break}case"ECDH":{switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Ne("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!_t(e.algorithm,"PBKDF2"))throw Ne("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!_t(e.algorithm,"RSA-OAEP"))throw Ne("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Qf(e,n)}function eh(e,t,...n){var r;if(n=n.filter(Boolean),n.length>2){const o=n.pop();e+=`one of type ${n.join(", ")}, or ${o}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&(r=t.constructor)!=null&&r.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const We=(e,...t)=>eh("Key must be ",e,...t);function th(e,t,...n){return eh(`Key for the ${e} algorithm must be `,t,...n)}const nh=e=>Be(e)?!0:(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",Fe=["CryptoKey"];async function oE(e,t,n,r,o,s){if(!(t instanceof Uint8Array))throw new TypeError(We(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),i=await ce.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await ce.subtle.importKey("raw",t.subarray(0,a>>3),{hash:`SHA-${a<<1}`,name:"HMAC"},!1,["sign"]),u=Et(s,r,n,Bf(s.length<<3)),l=new Uint8Array((await ce.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d;try{d=tE(o,l)}catch{}if(!d)throw new Xr;let h;try{h=new Uint8Array(await ce.subtle.decrypt({iv:r,name:"AES-CBC"},i,n))}catch{}if(!h)throw new Xr;return h}async function sE(e,t,n,r,o,s){let a;t instanceof Uint8Array?a=await ce.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Nt(t,e,"decrypt"),a=t);try{return new Uint8Array(await ce.subtle.decrypt({additionalData:s,iv:r,name:"AES-GCM",tagLength:128},a,Et(n,o)))}catch{throw new Xr}}const rh=async(e,t,n,r,o,s)=>{if(!Be(t)&&!(t instanceof Uint8Array))throw new TypeError(We(t,...Fe,"Uint8Array"));if(!r)throw new B("JWE Initialization Vector missing");if(!o)throw new B("JWE Authentication Tag missing");switch(Zf(e,r),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&Yr(t,parseInt(e.slice(-3),10)),oE(e,t,n,r,o,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&Yr(t,parseInt(e.slice(1,4),10)),sE(e,t,n,r,o,s);default:throw new Se("Unsupported JWE Content Encryption Algorithm")}},Qa=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const r of t){const o=Object.keys(r);if(!n||n.size===0){n=new Set(o);continue}for(const s of o){if(n.has(s))return!1;n.add(s)}}return!0};function aE(e){return typeof e=="object"&&e!==null}function Je(e){if(!aE(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}const Qr=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function oh(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function sh(e,t,n){if(Be(e))return Nt(e,t,n),e;if(e instanceof Uint8Array)return ce.subtle.importKey("raw",e,"AES-KW",!0,[n]);throw new TypeError(We(e,...Fe,"Uint8Array"))}const ei=async(e,t,n)=>{const r=await sh(t,e,"wrapKey");oh(r,e);const o=await ce.subtle.importKey("raw",n,...Qr);return new Uint8Array(await ce.subtle.wrapKey("raw",o,r,"AES-KW"))},ti=async(e,t,n)=>{const r=await sh(t,e,"unwrapKey");oh(r,e);const o=await ce.subtle.unwrapKey("raw",n,r,"AES-KW",...Qr);return new Uint8Array(await ce.subtle.exportKey("raw",o))};async function ah(e,t,n,r,o=new Uint8Array(0),s=new Uint8Array(0)){if(!Be(e))throw new TypeError(We(e,...Fe));if(Nt(e,"ECDH"),!Be(t))throw new TypeError(We(t,...Fe));Nt(t,"ECDH","deriveBits");const a=Et(Ba($e.encode(n)),Ba(o),Ba(s),Ga(r));let i;e.algorithm.name==="X25519"?i=256:e.algorithm.name==="X448"?i=448:i=Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;const c=new Uint8Array(await ce.subtle.deriveBits({name:e.algorithm.name,public:e},t,i));return X0(c,r,a)}async function iE(e){if(!Be(e))throw new TypeError(We(e,...Fe));return ce.subtle.generateKey(e.algorithm,!0,["deriveBits"])}function ih(e){if(!Be(e))throw new TypeError(We(e,...Fe));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||e.algorithm.name==="X25519"||e.algorithm.name==="X448"}function cE(e){if(!(e instanceof Uint8Array)||e.length<8)throw new B("PBES2 Salt Input must be 8 or more octets")}function uE(e,t){if(e instanceof Uint8Array)return ce.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(Be(e))return Nt(e,t,"deriveBits","deriveKey"),e;throw new TypeError(We(e,...Fe,"Uint8Array"))}async function ch(e,t,n,r){cE(e);const o=J0(t,e),s=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:o},i={length:s,name:"AES-KW"},c=await uE(r,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await ce.subtle.deriveBits(a,c,s));if(c.usages.includes("deriveKey"))return ce.subtle.deriveKey(a,c,i,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const lE=async(e,t,n,r=2048,o=Za(new Uint8Array(16)))=>{const s=await ch(o,e,r,t);return{encryptedKey:await ei(e.slice(-6),s,n),p2c:r,p2s:Ve(o)}},dE=async(e,t,n,r,o)=>{const s=await ch(o,e,r,t);return ti(e.slice(-6),s,n)};function eo(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Se(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const ni=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},fE=async(e,t,n)=>{if(!Be(t))throw new TypeError(We(t,...Fe));if(Nt(t,e,"encrypt","wrapKey"),ni(e,t),t.usages.includes("encrypt"))return new Uint8Array(await ce.subtle.encrypt(eo(e),t,n));if(t.usages.includes("wrapKey")){const r=await ce.subtle.importKey("raw",n,...Qr);return new Uint8Array(await ce.subtle.wrapKey("raw",r,t,eo(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},hE=async(e,t,n)=>{if(!Be(t))throw new TypeError(We(t,...Fe));if(Nt(t,e,"decrypt","unwrapKey"),ni(e,t),t.usages.includes("decrypt"))return new Uint8Array(await ce.subtle.decrypt(eo(e),t,n));if(t.usages.includes("unwrapKey")){const r=await ce.subtle.unwrapKey("raw",n,t,eo(e),...Qr);return new Uint8Array(await ce.subtle.exportKey("raw",r))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function gn(e){return Je(e)&&typeof e.kty=="string"}function pE(e){return e.kty!=="oct"&&typeof e.d=="string"}function mE(e){return e.kty!=="oct"&&typeof e.d>"u"}function gE(e){return gn(e)&&e.kty==="oct"&&typeof e.k=="string"}function bE(e){let t,n;switch(e.kty){case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Se('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Se('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"EdDSA":t={name:e.crv},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Se('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new Se('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}const uh=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:n}=bE(e),r=[t,e.ext??!1,e.key_ops??n],o={...e};return delete o.alg,delete o.use,ce.subtle.importKey("jwk",o,...r)},lh=e=>Oe(e);let bn,yn;const dh=e=>(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",to=async(e,t,n,r,o=!1)=>{let s=e.get(t);if(s!=null&&s[r])return s[r];const a=await uh({...n,alg:r});return o&&Object.freeze(t),s?s[r]=a:e.set(t,{[r]:a}),a},zt={normalizePublicKey:(e,t)=>{if(dh(e)){let n=e.export({format:"jwk"});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?lh(n.k):(yn||(yn=new WeakMap),to(yn,e,n,t))}return gn(e)?e.k?Oe(e.k):(yn||(yn=new WeakMap),to(yn,e,e,t,!0)):e},normalizePrivateKey:(e,t)=>{if(dh(e)){let n=e.export({format:"jwk"});return n.k?lh(n.k):(bn||(bn=new WeakMap),to(bn,e,n,t))}return gn(e)?e.k?Oe(e.k):(bn||(bn=new WeakMap),to(bn,e,e,t,!0)):e}};function ri(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new Se(`Unsupported JWE Algorithm: ${e}`)}}const wn=e=>Za(new Uint8Array(ri(e)>>3)),It=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));const r=e.indexOf(t[0],n);if(r===-1)return!1;const o=e.subarray(r,r+t.length);return o.length!==t.length?!1:o.every((s,a)=>s===t[a])||It(e,t,r+1)},fh=e=>{switch(!0){case It(e,[42,134,72,206,61,3,1,7]):return"P-256";case It(e,[43,129,4,0,34]):return"P-384";case It(e,[43,129,4,0,35]):return"P-521";case It(e,[43,101,110]):return"X25519";case It(e,[43,101,111]):return"X448";case It(e,[43,101,112]):return"Ed25519";case It(e,[43,101,113]):return"Ed448";default:throw new Se("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},yE=async(e,t,n,r,o)=>{let s,a;const i=new Uint8Array(atob(n.replace(e,"")).split("").map(c=>c.charCodeAt(0)));switch(r){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},a=["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},a=["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},a=["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},a=["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},a=["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},a=["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const c=fh(i);s=c.startsWith("P-")?{name:"ECDH",namedCurve:c}:{name:c},a=["deriveBits"];break}case"Ed25519":s={name:"Ed25519"},a=["sign"];break;case"EdDSA":s={name:fh(i)},a=["sign"];break;default:throw new Se('Invalid or unsupported "alg" (Algorithm) value')}return ce.subtle.importKey(t,i,s,!1,a)},wE=(e,t,n)=>yE(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t);async function vE(e,t,n){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return wE(e,t)}async function oi(e,t){if(!Je(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Oe(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new Se('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return uh({...e,alg:t});default:throw new Se('Unsupported "kty" (Key Type) Parameter value')}}const vn=e=>e==null?void 0:e[Symbol.toStringTag],si=(e,t,n)=>{var r,o;if(t.use!==void 0&&t.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(t.key_ops!==void 0&&((o=(r=t.key_ops).includes)==null?void 0:o.call(r,n))!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},EE=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&gn(t)){if(gE(t)&&si(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!nh(t))throw new TypeError(th(e,t,...Fe,"Uint8Array",r?"JSON Web Key":null));if(t.type!=="secret")throw new TypeError(`${vn(t)} instances for symmetric algorithms must be of type "secret"`)}},_E=(e,t,n,r)=>{if(r&&gn(t))switch(n){case"sign":if(pE(t)&&si(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(mE(t)&&si(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!nh(t))throw new TypeError(th(e,t,...Fe,r?"JSON Web Key":null));if(t.type==="secret")throw new TypeError(`${vn(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&t.type==="public")throw new TypeError(`${vn(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&t.type==="public")throw new TypeError(`${vn(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n==="verify"&&t.type==="private")throw new TypeError(`${vn(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n==="encrypt"&&t.type==="private")throw new TypeError(`${vn(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function hh(e,t,n,r){t.startsWith("HS")||t==="dir"||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?EE(t,n,r,e):_E(t,n,r,e)}const ph=hh.bind(void 0,!1),mh=hh.bind(void 0,!0);async function SE(e,t,n,r,o){if(!(n instanceof Uint8Array))throw new TypeError(We(n,"Uint8Array"));const s=parseInt(e.slice(1,4),10),a=await ce.subtle.importKey("raw",n.subarray(s>>3),"AES-CBC",!1,["encrypt"]),i=await ce.subtle.importKey("raw",n.subarray(0,s>>3),{hash:`SHA-${s<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await ce.subtle.encrypt({iv:r,name:"AES-CBC"},a,t)),u=Et(o,r,c,Bf(o.length<<3)),l=new Uint8Array((await ce.subtle.sign("HMAC",i,u)).slice(0,s>>3));return{ciphertext:c,tag:l,iv:r}}async function xE(e,t,n,r,o){let s;n instanceof Uint8Array?s=await ce.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Nt(n,e,"encrypt"),s=n);const a=new Uint8Array(await ce.subtle.encrypt({additionalData:o,iv:r,name:"AES-GCM",tagLength:128},s,t)),i=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:i,iv:r}}const gh=async(e,t,n,r,o)=>{if(!Be(n)&&!(n instanceof Uint8Array))throw new TypeError(We(n,...Fe,"Uint8Array"));switch(r?Zf(e,r):r=eE(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&Yr(n,parseInt(e.slice(-3),10)),SE(e,t,n,r,o);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&Yr(n,parseInt(e.slice(1,4),10)),xE(e,t,n,r,o);default:throw new Se("Unsupported JWE Content Encryption Algorithm")}};async function AE(e,t,n,r){const o=e.slice(0,7),s=await gh(o,n,t,r,new Uint8Array(0));return{encryptedKey:s.ciphertext,iv:Ve(s.iv),tag:Ve(s.tag)}}async function RE(e,t,n,r,o){const s=e.slice(0,7);return rh(s,t,n,r,o,new Uint8Array(0))}async function CE(e,t,n,r,o){var s;switch(ph(e,t,"decrypt"),t=await((s=zt.normalizePrivateKey)==null?void 0:s.call(zt,t,e))||t,e){case"dir":{if(n!==void 0)throw new B("Encountered unexpected JWE Encrypted Key");return t}case"ECDH-ES":if(n!==void 0)throw new B("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Je(r.epk))throw new B('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ih(t))throw new Se("ECDH with the provided key is not allowed or not supported by your javascript runtime");const a=await oi(r.epk,e);let i,c;if(r.apu!==void 0){if(typeof r.apu!="string")throw new B('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=Oe(r.apu)}catch{throw new B("Failed to base64url decode the apu")}}if(r.apv!==void 0){if(typeof r.apv!="string")throw new B('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{c=Oe(r.apv)}catch{throw new B("Failed to base64url decode the apv")}}const u=await ah(a,t,e==="ECDH-ES"?r.enc:e,e==="ECDH-ES"?ri(r.enc):parseInt(e.slice(-5,-2),10),i,c);if(e==="ECDH-ES")return u;if(n===void 0)throw new B("JWE Encrypted Key missing");return ti(e.slice(-6),u,n)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(n===void 0)throw new B("JWE Encrypted Key missing");return hE(e,t,n)}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(n===void 0)throw new B("JWE Encrypted Key missing");if(typeof r.p2c!="number")throw new B('JOSE Header "p2c" (PBES2 Count) missing or invalid');const a=(o==null?void 0:o.maxPBES2Count)||1e4;if(r.p2c>a)throw new B('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if(typeof r.p2s!="string")throw new B('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let i;try{i=Oe(r.p2s)}catch{throw new B("Failed to base64url decode the p2s")}return dE(e,t,n,r.p2c,i)}case"A128KW":case"A192KW":case"A256KW":{if(n===void 0)throw new B("JWE Encrypted Key missing");return ti(e,t,n)}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(n===void 0)throw new B("JWE Encrypted Key missing");if(typeof r.iv!="string")throw new B('JOSE Header "iv" (Initialization Vector) missing or invalid');if(typeof r.tag!="string")throw new B('JOSE Header "tag" (Authentication Tag) missing or invalid');let a;try{a=Oe(r.iv)}catch{throw new B("Failed to base64url decode the iv")}let i;try{i=Oe(r.tag)}catch{throw new B("Failed to base64url decode the tag")}return RE(e,t,n,a,i)}default:throw new Se('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function ai(e,t,n,r,o){if(o.crit!==void 0&&(r==null?void 0:r.crit)===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;n!==void 0?s=new Map([...Object.entries(n),...t.entries()]):s=t;for(const a of r.crit){if(!s.has(a))throw new Se(`Extension Header Parameter "${a}" is not recognized`);if(o[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(s.get(a)&&r[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(r.crit)}const ii=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(n=>typeof n!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function TE(e,t,n){if(!Je(e))throw new B("Flattened JWE must be an object");if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new B("JOSE Header missing");if(e.iv!==void 0&&typeof e.iv!="string")throw new B("JWE Initialization Vector incorrect type");if(typeof e.ciphertext!="string")throw new B("JWE Ciphertext missing or incorrect type");if(e.tag!==void 0&&typeof e.tag!="string")throw new B("JWE Authentication Tag incorrect type");if(e.protected!==void 0&&typeof e.protected!="string")throw new B("JWE Protected Header incorrect type");if(e.encrypted_key!==void 0&&typeof e.encrypted_key!="string")throw new B("JWE Encrypted Key incorrect type");if(e.aad!==void 0&&typeof e.aad!="string")throw new B("JWE AAD incorrect type");if(e.header!==void 0&&!Je(e.header))throw new B("JWE Shared Unprotected Header incorrect type");if(e.unprotected!==void 0&&!Je(e.unprotected))throw new B("JWE Per-Recipient Unprotected Header incorrect type");let r;if(e.protected)try{const f=Oe(e.protected);r=JSON.parse(qt.decode(f))}catch{throw new B("JWE Protected Header is invalid")}if(!Qa(r,e.header,e.unprotected))throw new B("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...r,...e.header,...e.unprotected};if(ai(B,new Map,n==null?void 0:n.crit,r,o),o.zip!==void 0)throw new Se('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:s,enc:a}=o;if(typeof s!="string"||!s)throw new B("missing JWE Algorithm (alg) in JWE Header");if(typeof a!="string"||!a)throw new B("missing JWE Encryption Algorithm (enc) in JWE Header");const i=n&&ii("keyManagementAlgorithms",n.keyManagementAlgorithms),c=n&&ii("contentEncryptionAlgorithms",n.contentEncryptionAlgorithms);if(i&&!i.has(s)||!i&&s.startsWith("PBES2"))throw new Jr('"alg" (Algorithm) Header Parameter value not allowed');if(c&&!c.has(a))throw new Jr('"enc" (Encryption Algorithm) Header Parameter value not allowed');let u;if(e.encrypted_key!==void 0)try{u=Oe(e.encrypted_key)}catch{throw new B("Failed to base64url decode the encrypted_key")}let l=!1;typeof t=="function"&&(t=await t(r,e),l=!0);let d;try{d=await CE(s,t,u,o,n)}catch(f){if(f instanceof TypeError||f instanceof B||f instanceof Se)throw f;d=wn(a)}let h,m;if(e.iv!==void 0)try{h=Oe(e.iv)}catch{throw new B("Failed to base64url decode the iv")}if(e.tag!==void 0)try{m=Oe(e.tag)}catch{throw new B("Failed to base64url decode the tag")}const _=$e.encode(e.protected??"");let y;e.aad!==void 0?y=Et(_,$e.encode("."),$e.encode(e.aad)):y=_;let g;try{g=Oe(e.ciphertext)}catch{throw new B("Failed to base64url decode the ciphertext")}const b={plaintext:await rh(a,d,g,h,m,y)};if(e.protected!==void 0&&(b.protectedHeader=r),e.aad!==void 0)try{b.additionalAuthenticatedData=Oe(e.aad)}catch{throw new B("Failed to base64url decode the aad")}return e.unprotected!==void 0&&(b.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}async function PE(e,t,n){if(e instanceof Uint8Array&&(e=qt.decode(e)),typeof e!="string")throw new B("Compact JWE must be a string or Uint8Array");const{0:r,1:o,2:s,3:a,4:i,length:c}=e.split(".");if(c!==5)throw new B("Invalid Compact JWE");const u=await TE({ciphertext:a,iv:s||void 0,protected:r,tag:i||void 0,encrypted_key:o||void 0},t,n),l={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return typeof t=="function"?{...l,key:u.key}:l}const OE=Symbol(),kE=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:Ve(e)};if(!Be(e))throw new TypeError(We(e,...Fe,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:n,alg:r,use:o,...s}=await ce.subtle.exportKey("jwk",e);return s};async function NE(e){return kE(e)}async function IE(e,t,n,r,o={}){var c;let s,a,i;switch(ph(e,n,"encrypt"),n=await((c=zt.normalizePublicKey)==null?void 0:c.call(zt,n,e))||n,e){case"dir":{i=n;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ih(n))throw new Se("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:u,apv:l}=o;let{epk:d}=o;d||(d=(await iE(n)).privateKey);const{x:h,y:m,crv:_,kty:y}=await NE(d),g=await ah(n,d,e==="ECDH-ES"?t:e,e==="ECDH-ES"?ri(t):parseInt(e.slice(-5,-2),10),u,l);if(a={epk:{x:h,crv:_,kty:y}},y==="EC"&&(a.epk.y=m),u&&(a.apu=Ve(u)),l&&(a.apv=Ve(l)),e==="ECDH-ES"){i=g;break}i=r||wn(t);const p=e.slice(-6);s=await ei(p,g,i);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{i=r||wn(t),s=await fE(e,n,i);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{i=r||wn(t);const{p2c:u,p2s:l}=o;({encryptedKey:s,...a}=await lE(e,n,i,u,l));break}case"A128KW":case"A192KW":case"A256KW":{i=r||wn(t),s=await ei(e,n,i);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{i=r||wn(t);const{iv:u}=o;({encryptedKey:s,...a}=await AE(e,n,i,u));break}default:throw new Se('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:i,encryptedKey:s,parameters:a}}class DE{constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=t}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setSharedUnprotectedHeader(t){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=t,this}setUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}setAdditionalAuthenticatedData(t){return this._aad=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}async encrypt(t,n){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new B("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Qa(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new B("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(ai(B,new Map,n==null?void 0:n.crit,this._protectedHeader,r),r.zip!==void 0)throw new Se('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:o,enc:s}=r;if(typeof o!="string"||!o)throw new B('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof s!="string"||!s)throw new B('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let a;if(this._cek&&(o==="dir"||o==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${o}`);let i;{let y;({cek:i,encryptedKey:a,parameters:y}=await IE(o,s,t,this._cek,this._keyManagementParameters)),y&&(n&&OE in n?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...y}:this.setUnprotectedHeader(y):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...y}:this.setProtectedHeader(y))}let c,u,l;this._protectedHeader?u=$e.encode(Ve(JSON.stringify(this._protectedHeader))):u=$e.encode(""),this._aad?(l=Ve(this._aad),c=Et(u,$e.encode("."),$e.encode(l))):c=u;const{ciphertext:d,tag:h,iv:m}=await gh(s,this._plaintext,i,this._iv,c),_={ciphertext:Ve(d)};return m&&(_.iv=Ve(m)),h&&(_.tag=Ve(h)),a&&(_.encrypted_key=Ve(a)),l&&(_.aad=l),this._protectedHeader&&(_.protected=qt.decode(u)),this._sharedUnprotectedHeader&&(_.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(_.header=this._unprotectedHeader),_}}function ME(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:t.name};default:throw new Se(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function LE(e,t,n){if(t=await zt.normalizePublicKey(t,e),Be(t))return rE(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(We(t,...Fe));return ce.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(We(t,...Fe,"Uint8Array","JSON Web Key"))}const jE=async(e,t,n,r)=>{const o=await LE(e,t,"verify");ni(e,o);const s=ME(e,o.algorithm);try{return await ce.subtle.verify(s,o,n,r)}catch{return!1}};async function bh(e,t,n){if(!Je(e))throw new ke("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new ke('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new ke("JWS Protected Header incorrect type");if(e.payload===void 0)throw new ke("JWS Payload missing");if(typeof e.signature!="string")throw new ke("JWS Signature missing or incorrect type");if(e.header!==void 0&&!Je(e.header))throw new ke("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const y=Oe(e.protected);r=JSON.parse(qt.decode(y))}catch{throw new ke("JWS Protected Header is invalid")}if(!Qa(r,e.header))throw new ke("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...r,...e.header},s=ai(ke,new Map([["b64",!0]]),n==null?void 0:n.crit,r,o);let a=!0;if(s.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new ke('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=o;if(typeof i!="string"||!i)throw new ke('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&ii("algorithms",n.algorithms);if(c&&!c.has(i))throw new Jr('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new ke("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new ke("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof t=="function"?(t=await t(r,e),u=!0,mh(i,t,"verify"),gn(t)&&(t=await oi(t,i))):mh(i,t,"verify");const l=Et($e.encode(e.protected??""),$e.encode("."),typeof e.payload=="string"?$e.encode(e.payload):e.payload);let d;try{d=Oe(e.signature)}catch{throw new ke("Failed to base64url decode the signature")}if(!await jE(i,t,d,l))throw new Xf;let m;if(a)try{m=Oe(e.payload)}catch{throw new ke("Failed to base64url decode the payload")}else typeof e.payload=="string"?m=$e.encode(e.payload):m=e.payload;const _={payload:m};return e.protected!==void 0&&(_.protectedHeader=r),e.header!==void 0&&(_.unprotectedHeader=e.header),u?{..._,key:t}:_}async function HE(e,t,n){if(e instanceof Uint8Array&&(e=qt.decode(e)),typeof e!="string")throw new ke("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:s,length:a}=e.split(".");if(a!==3)throw new ke("Invalid Compact JWS");const i=await bh({payload:o,protected:r,signature:s},t,n),c={payload:i.payload,protectedHeader:i.protectedHeader};return typeof t=="function"?{...c,key:i.key}:c}const Dt=e=>Math.floor(e.getTime()/1e3),yh=60,wh=yh*60,ci=wh*24,UE=ci*7,$E=ci*365.25,WE=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Yn=e=>{const t=WE.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]),r=t[3].toLowerCase();let o;switch(r){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(n*yh);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(n*wh);break;case"day":case"days":case"d":o=Math.round(n*ci);break;case"week":case"weeks":case"w":o=Math.round(n*UE);break;default:o=Math.round(n*$E);break}return t[1]==="-"||t[4]==="ago"?-o:o},vh=e=>e.toLowerCase().replace(/^application\//,""),FE=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,Eh=(e,t,n={})=>{let r;try{r=JSON.parse(qt.decode(t))}catch{}if(!Je(r))throw new Ja("JWT Claims Set must be a top-level JSON object");const{typ:o}=n;if(o&&(typeof e.typ!="string"||vh(e.typ)!==vh(o)))throw new qe('unexpected "typ" JWT header value',r,"typ","check_failed");const{requiredClaims:s=[],issuer:a,subject:i,audience:c,maxTokenAge:u}=n,l=[...s];u!==void 0&&l.push("iat"),c!==void 0&&l.push("aud"),i!==void 0&&l.push("sub"),a!==void 0&&l.push("iss");for(const _ of new Set(l.reverse()))if(!(_ in r))throw new qe(`missing required "${_}" claim`,r,_,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(r.iss))throw new qe('unexpected "iss" claim value',r,"iss","check_failed");if(i&&r.sub!==i)throw new qe('unexpected "sub" claim value',r,"sub","check_failed");if(c&&!FE(r.aud,typeof c=="string"?[c]:c))throw new qe('unexpected "aud" claim value',r,"aud","check_failed");let d;switch(typeof n.clockTolerance){case"string":d=Yn(n.clockTolerance);break;case"number":d=n.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=n,m=Dt(h||new Date);if((r.iat!==void 0||u)&&typeof r.iat!="number")throw new qe('"iat" claim must be a number',r,"iat","invalid");if(r.nbf!==void 0){if(typeof r.nbf!="number")throw new qe('"nbf" claim must be a number',r,"nbf","invalid");if(r.nbf>m+d)throw new qe('"nbf" claim timestamp check failed',r,"nbf","check_failed")}if(r.exp!==void 0){if(typeof r.exp!="number")throw new qe('"exp" claim must be a number',r,"exp","invalid");if(r.exp<=m-d)throw new Va('"exp" claim timestamp check failed',r,"exp","check_failed")}if(u){const _=m-r.iat,y=typeof u=="number"?u:Yn(u);if(_-d>y)throw new Va('"iat" claim timestamp check failed (too far in the past)',r,"iat","check_failed");if(_<0-d)throw new qe('"iat" claim timestamp check failed (it should be in the past)',r,"iat","check_failed")}return r};async function KE(e,t,n){var a;const r=await HE(e,t,n);if((a=r.protectedHeader.crit)!=null&&a.includes("b64")&&r.protectedHeader.b64===!1)throw new Ja("JWTs MUST NOT use unencoded payload");const s={payload:Eh(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t=="function"?{...s,key:r.key}:s}async function qE(e,t,n){const r=await PE(e,t,n),o=Eh(r.protectedHeader,r.plaintext,n),{protectedHeader:s}=r;if(s.iss!==void 0&&s.iss!==o.iss)throw new qe('replicated "iss" claim header parameter mismatch',o,"iss","mismatch");if(s.sub!==void 0&&s.sub!==o.sub)throw new qe('replicated "sub" claim header parameter mismatch',o,"sub","mismatch");if(s.aud!==void 0&&JSON.stringify(s.aud)!==JSON.stringify(o.aud))throw new qe('replicated "aud" claim header parameter mismatch',o,"aud","mismatch");const a={payload:o,protectedHeader:s};return typeof t=="function"?{...a,key:r.key}:a}class zE{constructor(t){this._flattened=new DE(t)}setContentEncryptionKey(t){return this._flattened.setContentEncryptionKey(t),this}setInitializationVector(t){return this._flattened.setInitializationVector(t),this}setProtectedHeader(t){return this._flattened.setProtectedHeader(t),this}setKeyManagementParameters(t){return this._flattened.setKeyManagementParameters(t),this}async encrypt(t,n){const r=await this._flattened.encrypt(t,n);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}function Gt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}class GE{constructor(t={}){if(!Je(t))throw new TypeError("JWT Claims Set MUST be an object");this._payload=t}setIssuer(t){return this._payload={...this._payload,iss:t},this}setSubject(t){return this._payload={...this._payload,sub:t},this}setAudience(t){return this._payload={...this._payload,aud:t},this}setJti(t){return this._payload={...this._payload,jti:t},this}setNotBefore(t){return typeof t=="number"?this._payload={...this._payload,nbf:Gt("setNotBefore",t)}:t instanceof Date?this._payload={...this._payload,nbf:Gt("setNotBefore",Dt(t))}:this._payload={...this._payload,nbf:Dt(new Date)+Yn(t)},this}setExpirationTime(t){return typeof t=="number"?this._payload={...this._payload,exp:Gt("setExpirationTime",t)}:t instanceof Date?this._payload={...this._payload,exp:Gt("setExpirationTime",Dt(t))}:this._payload={...this._payload,exp:Dt(new Date)+Yn(t)},this}setIssuedAt(t){return typeof t>"u"?this._payload={...this._payload,iat:Dt(new Date)}:t instanceof Date?this._payload={...this._payload,iat:Gt("setIssuedAt",Dt(t))}:typeof t=="string"?this._payload={...this._payload,iat:Gt("setIssuedAt",Dt(new Date)+Yn(t))}:this._payload={...this._payload,iat:Gt("setIssuedAt",t)},this}}class BE extends GE{setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(t,n){const r=new zE($e.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(t,n)}}function VE(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Se('Unsupported "alg" value for a JSON Web Key Set')}}function JE(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(XE)}function XE(e){return Je(e)}function _h(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}class YE{constructor(t){if(this._cached=new WeakMap,!JE(t))throw new Xa("JSON Web Key Set malformed");this._jwks=_h(t)}async getKey(t,n){const{alg:r,kid:o}={...t,...n==null?void 0:n.header},s=VE(r),a=this._jwks.keys.filter(u=>{let l=s===u.kty;if(l&&typeof o=="string"&&(l=o===u.kid),l&&typeof u.alg=="string"&&(l=r===u.alg),l&&typeof u.use=="string"&&(l=u.use==="sig"),l&&Array.isArray(u.key_ops)&&(l=u.key_ops.includes("verify")),l)switch(r){case"ES256":l=u.crv==="P-256";break;case"ES256K":l=u.crv==="secp256k1";break;case"ES384":l=u.crv==="P-384";break;case"ES512":l=u.crv==="P-521";break;case"Ed25519":l=u.crv==="Ed25519";break;case"EdDSA":l=u.crv==="Ed25519"||u.crv==="Ed448";break}return l}),{0:i,length:c}=a;if(c===0)throw new Ya;if(c!==1){const u=new Vf,{_cached:l}=this;throw u[Symbol.asyncIterator]=async function*(){for(const d of a)try{yield await Sh(l,d,r)}catch{}},u}return Sh(this._cached,i,r)}}async function Sh(e,t,n){const r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){const o=await oi({...t,ext:!0},n);if(o instanceof Uint8Array||o.type!=="public")throw new Xa("JSON Web Key Set members must be public keys");r[n]=o}return r[n]}function xh(e){const t=new YE(e),n=async(r,o)=>t.getKey(r,o);return Object.defineProperties(n,{jwks:{value:()=>_h(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),n}const ZE=async(e,t,n)=>{let r,o,s=!1;typeof AbortController=="function"&&(r=new AbortController,o=setTimeout(()=>{s=!0,r.abort()},t));const a=await fetch(e.href,{signal:r?r.signal:void 0,redirect:"manual",headers:n.headers}).catch(i=>{throw s?new Jf:i});if(o!==void 0&&clearTimeout(o),a.status!==200)throw new Me("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch{throw new Me("Failed to parse the JSON Web Key Set HTTP response as JSON")}};function QE(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}let ui;(typeof navigator>"u"||!((np=(fo=navigator.userAgent)==null?void 0:fo.startsWith)!=null&&np.call(fo,"Mozilla/5.0 ")))&&(ui="jose/v5.10.0");const no=Symbol();function e_(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!Je(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Je))}class t_{constructor(t,n){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(t.href),this._options={agent:n==null?void 0:n.agent,headers:n==null?void 0:n.headers},this._timeoutDuration=typeof(n==null?void 0:n.timeoutDuration)=="number"?n==null?void 0:n.timeoutDuration:5e3,this._cooldownDuration=typeof(n==null?void 0:n.cooldownDuration)=="number"?n==null?void 0:n.cooldownDuration:3e4,this._cacheMaxAge=typeof(n==null?void 0:n.cacheMaxAge)=="number"?n==null?void 0:n.cacheMaxAge:6e5,(n==null?void 0:n[no])!==void 0&&(this._cache=n==null?void 0:n[no],e_(n==null?void 0:n[no],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=xh(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cooldownDuration:!1}fresh(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cacheMaxAge:!1}async getKey(t,n){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(t,n)}catch(r){if(r instanceof Ya&&this.coolingDown()===!1)return await this.reload(),this._local(t,n);throw r}}async reload(){this._pendingFetch&&QE()&&(this._pendingFetch=void 0);const t=new Headers(this._options.headers);ui&&!t.has("User-Agent")&&(t.set("User-Agent",ui),this._options.headers=Object.fromEntries(t.entries())),this._pendingFetch||(this._pendingFetch=ZE(this._url,this._timeoutDuration,this._options).then(n=>{this._local=xh(n),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=n),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(n=>{throw this._pendingFetch=void 0,n})),await this._pendingFetch}}function n_(e,t){const n=new t_(e,t),r=async(o,s)=>n.getKey(o,s);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!n._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>{var o;return(o=n._local)==null?void 0:o.jwks()},enumerable:!0,configurable:!1,writable:!1}}),r}const r_=Ve;let li;(typeof navigator>"u"||!((rp=(ho=navigator.userAgent)==null?void 0:ho.startsWith)!=null&&rp.call(ho,"Mozilla/5.0 ")))&&(li="oauth4webapi/v3.5.3");function Zn(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}const Ze="ERR_INVALID_ARG_VALUE",Xe="ERR_INVALID_ARG_TYPE";function Ee(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const Mt=Symbol(),o_=Symbol(),s_=Symbol(),Bt=Symbol(),di=Symbol(),a_=new TextEncoder,i_=new TextDecoder;function En(e){return typeof e=="string"?a_.encode(e):i_.decode(e)}let fi;Uint8Array.prototype.toBase64?fi=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):fi=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r<t.byteLength;r+=32768)n.push(String.fromCharCode.apply(null,t.subarray(r,r+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};let hi;Uint8Array.fromBase64?hi=e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(t){throw Ee("The input to be decoded is not correctly encoded.",Ze,t)}}:hi=e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}catch(t){throw Ee("The input to be decoded is not correctly encoded.",Ze,t)}};function Vt(e){return typeof e=="string"?hi(e):fi(e)}class Qe extends Error{constructor(n,r){var o;super(n,r);Le(this,"code");this.name=this.constructor.name,this.code=i2,(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}class c_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"code");this.name=this.constructor.name,r!=null&&r.code&&(this.code=r==null?void 0:r.code),(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}function ee(e,t,n){return new c_(e,{code:t,cause:n})}function u_(e,t){if(!(e instanceof CryptoKey))throw Ee(`${t} must be a CryptoKey`,Xe)}function l_(e,t){if(u_(e,t),e.type!=="private")throw Ee(`${t} must be a private CryptoKey`,Ze)}function ro(e){return!(e===null||typeof e!="object"||Array.isArray(e))}function pi(e){Zn(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e??{});if(li&&!t.has("user-agent")&&t.set("user-agent",li),t.has("authorization"))throw Ee('"options.headers" must not include the "authorization" header name',Ze);return t}function Ah(e){if(typeof e=="function"&&(e=e()),!(e instanceof AbortSignal))throw Ee('"options.signal" must return or be an instance of AbortSignal',Xe);return e}function Rh(e){return e.includes("//")?e.replace("//","/"):e}function d_(e,t){return e.pathname==="/"?e.pathname=t:e.pathname=Rh(`${t}/${e.pathname}`),e}function f_(e,t){return e.pathname=Rh(`${e.pathname}/${t}`),e}async function h_(e,t,n,r){if(!(e instanceof URL))throw Ee(`"${t}" must be an instance of URL`,Xe);Ph(e,(r==null?void 0:r[Mt])!==!0);const o=n(new URL(e.href)),s=pi(r==null?void 0:r.headers);return s.set("accept","application/json"),((r==null?void 0:r[Bt])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:r!=null&&r.signal?Ah(r.signal):void 0})}async function p_(e,t){return h_(e,"issuerIdentifier",n=>{switch(t==null?void 0:t.algorithm){case void 0:case"oidc":f_(n,".well-known/openid-configuration");break;case"oauth2":d_(n,".well-known/oauth-authorization-server");break;default:throw Ee('"options.algorithm" must be "oidc" (default), or "oauth2"',Ze)}return n},t)}function Qn(e,t,n,r,o){try{if(typeof e!="number"||!Number.isFinite(e))throw Ee(`${n} must be a number`,Xe,o);if(e>0)return;throw Ee(`${n} must be a positive number`,Ze,o)}catch(s){throw r?ee(s.message,r,o):s}}function Ie(e,t,n,r){try{if(typeof e!="string")throw Ee(`${t} must be a string`,Xe,r);if(e.length===0)throw Ee(`${t} must not be empty`,Ze,r)}catch(o){throw n?ee(o.message,n,r):o}}async function m_(e,t){const n=e;if(!(n instanceof URL)&&n!==$h)throw Ee('"expectedIssuerIdentifier" must be an instance of URL',Xe);if(!Zn(t,Response))throw Ee('"response" must be an instance of Response',Xe);if(t.status!==200)throw ee('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Hh,t);ao(t);const r=await xi(t);if(Ie(r.issuer,'"response" body "issuer" property',he,{body:r}),n!==$h&&new URL(r.issuer).href!==n.href)throw ee('"response" body "issuer" property does not match the expected value',f2,{expected:n.href,body:r,attribute:"issuer"});return r}function Ch(e){b_(e,"application/json")}function g_(e,...t){let n='"response" content-type must be ';if(t.length>2){const r=t.pop();n+=`${t.join(", ")}, or ${r}`}else t.length===2?n+=`${t[0]} or ${t[1]}`:n+=t[0];return ee(n,u2,e)}function b_(e,t){if(G_(e)!==t)throw g_(e,t)}function oo(){return Vt(crypto.getRandomValues(new Uint8Array(32)))}function y_(){return oo()}function w_(){return oo()}function v_(){return oo()}async function E_(e){return Ie(e,"codeVerifier"),Vt(await crypto.subtle.digest("SHA-256",En(e)))}function __(e){return e instanceof CryptoKey?{key:e}:(e==null?void 0:e.key)instanceof CryptoKey?(e.kid!==void 0&&Ie(e.kid,'"kid"'),{key:e.key,kid:e.kid}):{}}function S_(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new Qe("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}function x_(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new Qe("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}function A_(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new Qe("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}function R_(e){switch(e.algorithm.name){case"RSA-PSS":return S_(e);case"RSASSA-PKCS1-v1_5":return x_(e);case"ECDSA":return A_(e);case"Ed25519":case"EdDSA":return"Ed25519";default:throw new Qe("unsupported CryptoKey algorithm name",{cause:e})}}function mi(e){const t=e==null?void 0:e[o_];return typeof t=="number"&&Number.isFinite(t)?t:0}function Th(e){const t=e==null?void 0:e[s_];return typeof t=="number"&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function gi(){return Math.floor(Date.now()/1e3)}function Jt(e){if(typeof e!="object"||e===null)throw Ee('"as" must be an object',Xe);Ie(e.issuer,'"as.issuer"')}function Xt(e){if(typeof e!="object"||e===null)throw Ee('"client" must be an object',Xe);Ie(e.client_id,'"client.client_id"')}function C_(e){return Ie(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function T_(e,t){const n=gi()+mi(t);return{jti:oo(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}function P_(e,t){const{key:n,kid:r}=__(e);return l_(n,'"clientPrivateKey.key"'),async(o,s,a,i)=>{const c={alg:R_(n),kid:r},u=T_(o,s);a.set("client_id",s.client_id),a.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.set("client_assertion",await O_(c,u,n))}}async function O_(e,t,n){if(!n.usages.includes("sign"))throw Ee('CryptoKey instances used for signing assertions must include "sign" in their "usages"',Ze);const r=`${Vt(En(JSON.stringify(e)))}.${Vt(En(JSON.stringify(t)))}`,o=Vt(await crypto.subtle.sign(y2(n),n,En(r)));return`${r}.${o}`}const k_=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function Ph(e,t){if(t&&e.protocol!=="https:")throw ee("only requests to HTTPS are allowed",l2,e);if(e.protocol!=="https:"&&e.protocol!=="http:")throw ee("only HTTP and HTTPS requests are allowed",d2,e)}function Oh(e,t,n,r){let o;if(typeof e!="string"||!(o=k_(e)))throw ee(`authorization server metadata does not contain a valid ${n?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,e===void 0?h2:p2,{attribute:n?`mtls_endpoint_aliases.${t}`:t});return Ph(o,r),o}function kh(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Oh(e.mtls_endpoint_aliases[t],t,n,r):Oh(e[t],t,n,r)}async function N_(e,t,n,r,o){var u;Jt(e),Xt(t);const s=kh(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,(o==null?void 0:o[Mt])!==!0),a=new URLSearchParams(r);a.set("client_id",t.client_id);const i=pi(o==null?void 0:o.headers);i.set("accept","application/json"),(o==null?void 0:o.DPoP)!==void 0&&(Ih(o.DPoP),await o.DPoP.addProof(s,i,"POST"));const c=await Dh(e,t,n,s,a,i,o);return(u=o==null?void 0:o.DPoP)==null||u.cacheNonce(c),c}class I_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"cause");Le(this,"code");Le(this,"error");Le(this,"status");Le(this,"error_description");Le(this,"response");this.name=this.constructor.name,this.code=a2,this.cause=r.cause,this.error=r.cause.error,this.status=r.response.status,this.error_description=r.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:r.response}),(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}class D_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"cause");Le(this,"code");Le(this,"error");Le(this,"error_description");this.name=this.constructor.name,this.code=c2,this.cause=r.cause,this.error=r.cause.get("error"),this.error_description=r.cause.get("error_description")??void 0,(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}class M_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"cause");Le(this,"code");Le(this,"response");Le(this,"status");this.name=this.constructor.name,this.code=s2,this.cause=r.cause,this.status=r.response.status,this.response=r.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}const so="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",L_="[a-zA-Z0-9\\-\\._\\~\\+\\/]+[=]{0,2}",j_="("+so+")\\s*=\\s*"+'"((?:[^"\\\\]|\\\\.)*)"',H_="("+so+")\\s*=\\s*("+so+")",U_=new RegExp("^[,\\s]*("+so+")\\s(.*)"),$_=new RegExp("^[,\\s]*"+j_+"[,\\s]*(.*)"),W_=new RegExp("^[,\\s]*"+H_+"[,\\s]*(.*)"),F_=new RegExp("^("+L_+")(?:$|[,\\s])(.*)");function K_(e){if(!Zn(e,Response))throw Ee('"response" must be an instance of Response',Xe);const t=e.headers.get("www-authenticate");if(t===null)return;const n=[];let r=t;for(;r;){let o=r.match(U_);const s=o==null?void 0:o[1].toLowerCase();if(r=o==null?void 0:o["2"],!s)return;const a={};let i;for(;r;){let u,l;if(o=r.match($_)){if([,u,l,r]=o,l.includes("\\"))try{l=JSON.parse(`"${l}"`)}catch{}a[u.toLowerCase()]=l;continue}if(o=r.match(W_)){[,u,l,r]=o,a[u.toLowerCase()]=l;continue}if(o=r.match(F_)){if(Object.keys(a).length)break;[,i,r]=o;break}return}const c={scheme:s,parameters:a};i&&(c.token68=i),n.push(c)}if(n.length)return n}async function q_(e,t,n){if(Jt(e),Xt(t),!Zn(n,Response))throw Ee('"response" must be an instance of Response',Xe);jh(n),await Nh(n,201,"Pushed Authorization Request Endpoint"),ao(n);const r=await xi(n);Ie(r.request_uri,'"response" body "request_uri" property',he,{body:r});let o=typeof r.expires_in!="number"?parseFloat(r.expires_in):r.expires_in;return Qn(o,!1,'"response" body "expires_in" property',he,{body:r}),r.expires_in=o,r}async function z_(e){if(e.status>399&&e.status<500){ao(e),Ch(e);try{const t=await e.clone().json();if(ro(t)&&typeof t.error=="string"&&t.error.length)return t}catch{}}}async function Nh(e,t,n){var r;if(e.status!==t){let o;throw(o=await z_(e))?(await((r=e.body)==null?void 0:r.cancel()),new I_("server responded with an error in the response body",{cause:o,response:e})):ee(`"response" is not a conform ${n} response (unexpected HTTP status code)`,Hh,e)}}function Ih(e){if(!wi.has(e))throw Ee('"options.DPoP" is not a valid DPoPHandle',Ze)}function G_(e){var t;return(t=e.headers.get("content-type"))==null?void 0:t.split(";")[0]}async function Dh(e,t,n,r,o,s,a){return await n(e,t,o,s),s.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((a==null?void 0:a[Bt])||fetch)(r.href,{body:o,headers:Object.fromEntries(s.entries()),method:"POST",redirect:"manual",signal:a!=null&&a.signal?Ah(a.signal):void 0})}async function bi(e,t,n,r,o,s){var u;const a=kh(e,"token_endpoint",t.use_mtls_endpoint_aliases,(s==null?void 0:s[Mt])!==!0);o.set("grant_type",r);const i=pi(s==null?void 0:s.headers);i.set("accept","application/json"),(s==null?void 0:s.DPoP)!==void 0&&(Ih(s.DPoP),await s.DPoP.addProof(a,i,"POST"));const c=await Dh(e,t,n,a,o,i,s);return(u=s==null?void 0:s.DPoP)==null||u.cacheNonce(c),c}async function B_(e,t,n,r,o){Jt(e),Xt(t),Ie(r,'"refreshToken"');const s=new URLSearchParams(o==null?void 0:o.additionalParameters);return s.set("refresh_token",r),bi(e,t,n,"refresh_token",s,o)}const Mh=new WeakMap,V_=new WeakMap;function Lh(e){if(!e.id_token)return;const t=Mh.get(e);if(!t)throw Ee('"ref" was already garbage collected or did not resolve from the proper sources',Ze);return t}async function yi(e,t,n,r,o){if(Jt(e),Xt(t),!Zn(n,Response))throw Ee('"response" must be an instance of Response',Xe);jh(n),await Nh(n,200,"Token Endpoint"),ao(n);const s=await xi(n);if(Ie(s.access_token,'"response" body "access_token" property',he,{body:s}),Ie(s.token_type,'"response" body "token_type" property',he,{body:s}),s.token_type=s.token_type.toLowerCase(),s.token_type!=="dpop"&&s.token_type!=="bearer")throw new Qe("unsupported `token_type` value",{cause:{body:s}});if(s.expires_in!==void 0){let a=typeof s.expires_in!="number"?parseFloat(s.expires_in):s.expires_in;Qn(a,!1,'"response" body "expires_in" property',he,{body:s}),s.expires_in=a}if(s.refresh_token!==void 0&&Ie(s.refresh_token,'"response" body "refresh_token" property',he,{body:s}),s.scope!==void 0&&typeof s.scope!="string")throw ee('"response" body "scope" property must be a string',he,{body:s});if(s.id_token!==void 0){Ie(s.id_token,'"response" body "id_token" property',he,{body:s});const a=["aud","exp","iat","iss","sub"];t.require_auth_time===!0&&a.push("auth_time"),t.default_max_age!==void 0&&(Qn(t.default_max_age,!1,'"client.default_max_age"'),a.push("auth_time")),r!=null&&r.length&&a.push(...r);const{claims:i,jwt:c}=await w2(s.id_token,v2.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),mi(t),Th(t),o==null?void 0:o[di]).then(n2.bind(void 0,a)).then(Y_.bind(void 0,e)).then(X_.bind(void 0,t.client_id));if(Array.isArray(i.aud)&&i.aud.length!==1){if(i.azp===void 0)throw ee('ID Token "aud" (audience) claim includes additional untrusted audiences',Yt,{claims:i,claim:"aud"});if(i.azp!==t.client_id)throw ee('unexpected ID Token "azp" (authorized party) claim value',Yt,{expected:t.client_id,claims:i,claim:"azp"})}i.auth_time!==void 0&&Qn(i.auth_time,!1,'ID Token "auth_time" (authentication time)',he,{claims:i}),V_.set(n,c),Mh.set(s,i)}return s}function jh(e){let t;if(t=K_(e))throw new M_("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}async function J_(e,t,n,r){return yi(e,t,n,void 0,r)}function X_(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw ee('unexpected JWT "aud" (audience) claim value',Yt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw ee('unexpected JWT "aud" (audience) claim value',Yt,{expected:e,claims:t.claims,claim:"aud"});return t}function Y_(e,t){var r;const n=((r=e[x2])==null?void 0:r.call(e,t))??e.issuer;if(t.claims.iss!==n)throw ee('unexpected JWT "iss" (issuer) claim value',Yt,{expected:n,claims:t.claims,claim:"iss"});return t}const wi=new WeakSet;function Z_(e){return wi.add(e),e}const Q_=Symbol();async function e2(e,t,n,r,o,s,a){if(Jt(e),Xt(t),!wi.has(r))throw Ee('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',Ze);Ie(o,'"redirectUri"');const i=Zt(r,"code");if(!i)throw ee('no authorization code in "callbackParameters"',he);const c=new URLSearchParams(a==null?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",i),s!==Q_&&(Ie(s,'"codeVerifier"'),c.set("code_verifier",s)),bi(e,t,n,"authorization_code",c,a)}const t2={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function n2(e,t){for(const n of e)if(t.claims[n]===void 0)throw ee(`JWT "${n}" (${t2[n]}) claim missing`,he,{claims:t.claims});return t}const vi=Symbol(),Ei=Symbol();async function r2(e,t,n,r){return o2(e,t,n,r.expectedNonce,r.maxAge,{[di]:r[di]})}async function o2(e,t,n,r,o,s){const a=[];switch(r){case void 0:r=vi;break;case vi:break;default:Ie(r,'"expectedNonce" argument'),a.push("nonce")}switch(o??(o=t.default_max_age),o){case void 0:o=Ei;break;case Ei:break;default:Qn(o,!1,'"maxAge" argument'),a.push("auth_time")}const i=await yi(e,t,n,a,s);Ie(i.id_token,'"response" body "id_token" property',he,{body:i});const c=Lh(i);if(o!==Ei){const u=gi()+mi(t),l=Th(t);if(c.auth_time+o<u-l)throw ee("too much time has elapsed since the last End-User authentication",Si,{claims:c,now:u,tolerance:l,claim:"auth_time"})}if(r===vi){if(c.nonce!==void 0)throw ee('unexpected ID Token "nonce" claim value',Yt,{expected:void 0,claims:c,claim:"nonce"})}else if(c.nonce!==r)throw ee('unexpected ID Token "nonce" claim value',Yt,{expected:r,claims:c,claim:"nonce"});return i}const s2="OAUTH_WWW_AUTHENTICATE_CHALLENGE",a2="OAUTH_RESPONSE_BODY_ERROR",i2="OAUTH_UNSUPPORTED_OPERATION",c2="OAUTH_AUTHORIZATION_RESPONSE_ERROR",_i="OAUTH_PARSE_ERROR",he="OAUTH_INVALID_RESPONSE",u2="OAUTH_RESPONSE_IS_NOT_JSON",Hh="OAUTH_RESPONSE_IS_NOT_CONFORM",l2="OAUTH_HTTP_REQUEST_FORBIDDEN",d2="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Si="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Yt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",f2="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",h2="OAUTH_MISSING_SERVER_METADATA",p2="OAUTH_INVALID_SERVER_METADATA";async function m2(e,t,n,r,o,s){return Jt(e),Xt(t),Ie(r,'"grantType"'),bi(e,t,n,r,new URLSearchParams(o),s)}async function g2(e,t,n,r){return yi(e,t,n,void 0,r)}function ao(e){if(e.bodyUsed)throw Ee('"response" body has been used already',Ze)}function Uh(e){const{algorithm:t}=e;if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Qe(`unsupported ${t.name} modulusLength`,{cause:e})}function b2(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Qe("unsupported ECDSA namedCurve",{cause:e})}}function y2(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:b2(e)};case"RSA-PSS":switch(Uh(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new Qe("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return Uh(e),e.algorithm.name;case"Ed25519":return e.algorithm.name}throw new Qe("unsupported CryptoKey algorithm name",{cause:e})}async function w2(e,t,n,r,o){let{0:s,1:a,length:i}=e.split(".");if(i===5)if(o!==void 0)e=await o(e),{0:s,1:a,length:i}=e.split(".");else throw new Qe("JWE decryption is not configured",{cause:e});if(i!==3)throw ee("Invalid JWT",he,e);let c;try{c=JSON.parse(En(Vt(s)))}catch(d){throw ee("failed to parse JWT Header body as base64url encoded JSON",_i,d)}if(!ro(c))throw ee("JWT Header must be a top level object",he,e);if(t(c),c.crit!==void 0)throw new Qe('no JWT "crit" header parameter extensions are supported',{cause:{header:c}});let u;try{u=JSON.parse(En(Vt(a)))}catch(d){throw ee("failed to parse JWT Payload body as base64url encoded JSON",_i,d)}if(!ro(u))throw ee("JWT Payload must be a top level object",he,e);const l=gi()+n;if(u.exp!==void 0){if(typeof u.exp!="number")throw ee('unexpected JWT "exp" (expiration time) claim type',he,{claims:u});if(u.exp<=l-r)throw ee('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Si,{claims:u,now:l,tolerance:r,claim:"exp"})}if(u.iat!==void 0&&typeof u.iat!="number")throw ee('unexpected JWT "iat" (issued at) claim type',he,{claims:u});if(u.iss!==void 0&&typeof u.iss!="string")throw ee('unexpected JWT "iss" (issuer) claim type',he,{claims:u});if(u.nbf!==void 0){if(typeof u.nbf!="number")throw ee('unexpected JWT "nbf" (not before) claim type',he,{claims:u});if(u.nbf>l+r)throw ee('unexpected JWT "nbf" (not before) claim value',Si,{claims:u,now:l,tolerance:r,claim:"nbf"})}if(u.aud!==void 0&&typeof u.aud!="string"&&!Array.isArray(u.aud))throw ee('unexpected JWT "aud" (audience) claim type',he,{claims:u});return{header:c,claims:u,jwt:e}}function v2(e,t,n,r){if(e!==void 0){if(typeof e=="string"?r.alg!==e:!e.includes(r.alg))throw ee('unexpected JWT "alg" header parameter',he,{header:r,expected:e,reason:"client configuration"});return}if(Array.isArray(t)){if(!t.includes(r.alg))throw ee('unexpected JWT "alg" header parameter',he,{header:r,expected:t,reason:"authorization server metadata"});return}if(n!==void 0){if(typeof n=="string"?r.alg!==n:typeof n=="function"?!n(r.alg):!n.includes(r.alg))throw ee('unexpected JWT "alg" header parameter',he,{header:r,expected:n,reason:"default value"});return}throw ee('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n})}function Zt(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw ee(`"${t}" parameter must be provided only once`,he);return n}const E2=Symbol(),_2=Symbol();function S2(e,t,n,r){if(Jt(e),Xt(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Ee('"parameters" must be an instance of URLSearchParams, or URL',Xe);if(Zt(n,"response"))throw ee('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',he,{parameters:n});const o=Zt(n,"iss"),s=Zt(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw ee('response parameter "iss" (issuer) missing',he,{parameters:n});if(o&&o!==e.issuer)throw ee('unexpected "iss" (issuer) response parameter value',he,{expected:e.issuer,parameters:n});switch(r){case void 0:case _2:if(s!==void 0)throw ee('unexpected "state" response parameter encountered',he,{expected:void 0,parameters:n});break;case E2:break;default:if(Ie(r,'"expectedState" argument'),s!==r)throw ee(s===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',he,{expected:r,parameters:n})}if(Zt(n,"error"))throw new D_("authorization response from the server is an error",{cause:n});const i=Zt(n,"id_token"),c=Zt(n,"token");if(i!==void 0||c!==void 0)throw new Qe("implicit and hybrid flows are not supported");return Z_(new URLSearchParams(n))}async function xi(e,t=Ch){let n;try{n=await e.json()}catch(r){throw t(e),ee('failed to parse "response" body as JSON',_i,r)}if(!ro(n))throw ee('"response" body must be a top level object',he,{body:n});return n}const $h=Symbol(),x2=Symbol(),A2={version:"4.7.0"};function R2(e,t){let n;try{n=new URL(e,t)}catch{return}if(n.origin===t.origin)return n}function io(e){var t;const n=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||e.expires===0)&&`Expires=${(typeof e.expires=="number"?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&typeof e.maxAge=="number"&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),r=`${e.name}=${encodeURIComponent((t=e.value)!=null?t:"")}`;return n.length===0?r:`${r}; ${n.join("; ")}`}function Wh(e){const t=new Map;for(const n of e.split(/; */)){if(!n)continue;const r=n.indexOf("=");if(r===-1){t.set(n,"true");continue}const[o,s]=[n.slice(0,r),n.slice(r+1)];try{t.set(o,decodeURIComponent(s??"true"))}catch{}}return t}function C2(e){if(!e)return;const[[t,n],...r]=Wh(e),{domain:o,expires:s,httponly:a,maxage:i,path:c,samesite:u,secure:l,partitioned:d,priority:h}=Object.fromEntries(r.map(([_,y])=>[_.toLowerCase().replace(/-/g,""),y])),m={name:t,value:decodeURIComponent(n),domain:o,...s&&{expires:new Date(s)},...a&&{httpOnly:!0},...typeof i=="string"&&{maxAge:Number(i)},path:c,...u&&{sameSite:O2(u)},...l&&{secure:!0},...h&&{priority:N2(h)},...d&&{partitioned:!0}};return T2(m)}function T2(e){const t={};for(const n in e)e[n]&&(t[n]=e[n]);return t}var P2=["strict","lax","none"];function O2(e){return e=e.toLowerCase(),P2.includes(e)?e:void 0}var k2=["low","medium","high"];function N2(e){return e=e.toLowerCase(),k2.includes(e)?e:void 0}function I2(e){if(!e)return[];var t=[],n=0,r,o,s,a,i;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function u(){return o=e.charAt(n),o!=="="&&o!==";"&&o!==","}for(;n<e.length;){for(r=n,i=!1;c();)if(o=e.charAt(n),o===","){for(s=n,n+=1,c(),a=n;n<e.length&&u();)n+=1;n<e.length&&e.charAt(n)==="="?(i=!0,n=a,t.push(e.substring(r,s)),r=n):n=s+1}else n+=1;(!i||n>=e.length)&&t.push(e.substring(r,e.length))}return t}var D2=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t){const n=Wh(t);for(const[r,o]of n)this._parsed.set(r,{name:r,value:o})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const n=Array.from(this._parsed);if(!e.length)return n.map(([o,s])=>s);const r=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return n.filter(([o])=>o===r).map(([o,s])=>s)}has(e){return this._parsed.has(e)}set(...e){const[t,n]=e.length===1?[e[0].name,e[0].value]:e,r=this._parsed;return r.set(t,{name:t,value:n}),this._headers.set("cookie",Array.from(r).map(([o,s])=>io(s)).join("; ")),this}delete(e){const t=this._parsed,n=Array.isArray(e)?e.map(r=>t.delete(r)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([r,o])=>io(o)).join("; ")),n}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},Ai=class{constructor(e){this._parsed=new Map;var t,n,r;this._headers=e;const o=(r=(n=(t=e.getSetCookie)==null?void 0:t.call(e))!=null?n:e.get("set-cookie"))!=null?r:[],s=Array.isArray(o)?o:I2(o);for(const a of s){const i=C2(a);i&&this._parsed.set(i.name,i)}}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const n=Array.from(this._parsed.values());if(!e.length)return n;const r=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return n.filter(o=>o.name===r)}has(e){return this._parsed.has(e)}set(...e){const[t,n,r]=e.length===1?[e[0].name,e[0].value,e[0]]:e,o=this._parsed;return o.set(t,L2({name:t,value:n,...r})),M2(o,this._headers),this}delete(...e){const[t,n]=typeof e[0]=="string"?[e[0]]:[e[0].name,e[0]];return this.set({...n,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(io).join("; ")}};function M2(e,t){t.delete("set-cookie");for(const[,n]of e){const r=io(n);t.append("set-cookie",r)}}function L2(e={name:"",value:""}){return typeof e.expires=="number"&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+e.maxAge*1e3)),(e.path===null||e.path===void 0)&&(e.path="/"),e}const j2=()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;throw new Error("unable to locate global object")},H2=async(e,t,n,r,o)=>{const{crypto:{subtle:s}}=j2();return new Uint8Array(await s.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:n,info:r},await s.importKey("raw",t,"HKDF",!1,["deriveBits"]),o<<3))};function U2(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw new TypeError('unsupported "digest" value')}}function Ri(e,t){if(typeof e=="string")return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw new TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}function $2(e){const t=Ri(e,"ikm");if(!t.byteLength)throw new TypeError('"ikm" must be at least one byte in length');return t}function W2(e){const t=Ri(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}function F2(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError('"keylen" must be a positive integer');const n=parseInt(t.substr(3),10)>>3||20;if(e>255*n)throw new TypeError('"keylen" too large');return e}async function Ci(e,t,n,r,o){return H2(U2(e),$2(t),Ri(n,"salt"),W2(r),F2(o,e))}const K2="A256GCM",q2="dir",Fh="sha256",Ti=32,Kh="JWE CEK";async function co(e,t,n,r){const o=await Ci(Fh,t,"",Kh,Ti);return(await new BE(e).setProtectedHeader({enc:K2,alg:q2,...r}).setExpirationTime(n).encrypt(o)).toString()}async function _n(e,t,n){const r=await Ci(Fh,t,"",Kh,Ti);return await qE(e,r,{...n,clockTolerance:15})}const z2=e=>Ci("sha256",e,"","JWS Cookie Signing",Ti);async function G2(e,t,n){if(!t)return;const[r,o]=t.split("."),s={protected:r_(JSON.stringify({alg:"HS256",b64:!1,crit:["b64"]})),payload:`${e}=${r}`,signature:o},a=await z2(n);try{return await bh(s,a,{algorithms:["HS256"]}),r}catch{return}}const Pi=3500,uo="__",B2=new RegExp(`${uo}(\\d+)$`),qh=/\.(\d+)$/,Oi=(e,t)=>{const n=t?qh.exec(e):B2.exec(e);if(n)return parseInt(n[1],10)},lo=(e,t,n)=>{const r=new RegExp(n?`^${t}${qh.source}$`:`^${t}${uo}\\d+$`);return e.getAll().filter(o=>r.test(o.name))};function V2(e,t,n,r,o){const{transient:s,...a}=n,i={...a};if(s&&delete i.maxAge,new TextEncoder().encode(t).length<=Pi){o.set(e,t,i),r.set(e,t),lo(r,e).forEach(m=>{o.delete(m.name),r.delete(m.name)});return}let u=0,l=0;for(;u<t.length;){const m=t.slice(u,u+Pi),_=`${e}${uo}${l}`;o.set(_,m,i),r.set(_,m),u+=Pi,l++}const h=lo(r,e).length-l;if(h>0)for(let m=0;m<h;m++){const _=l+m,y=`${e}${uo}${_}`;o.delete(y),r.delete(y)}o.delete(e),r.delete(e)}function zh(e,t,n){const r=t.get(e);if(r!=null&&r.value)return r.value;const o=lo(t,e,n).sort((a,i)=>Oi(a.name,n)-Oi(i.name,n));if(o.length===0)return;const s=Oi(o[o.length-1].name,n);if(o.length!==s+1){console.warn(`Incomplete chunked cookie '${e}': Found ${o.length} chunks, expected ${s+1}`);return}return o.map(a=>a.value).join("")}function Gh(e,t,n,r){n.delete(e),lo(t,e,r).forEach(o=>{n.delete(o.name)})}function er(e){e.headers.set("Cache-Control","private, no-cache, no-store, must-revalidate, max-age=0"),e.headers.set("Pragma","no-cache"),e.headers.set("Expires","0")}const J2=["sub","name","nickname","given_name","family_name","picture","email","email_verified","org_id"];function X2(e){return Object.keys(e).reduce((t,n)=>(J2.includes(n)&&(t[n]=e[n]),t),{})}const Y2=["client_id","redirect_uri","response_type","code_challenge","code_challenge_method","state","nonce"],Bh=["openid","profile","email","offline_access"].join(" "),Z2="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",Q2="urn:ietf:params:oauth:token-type:refresh_token",eS="http://auth0.com/oauth/token-type/federated-connection-access-token";function ki(e,t){return new URL(Ol(kl(e)),Pl(t))}class tS{constructor(t){if(this.fetch=t.fetch||fetch,this.jwksCache=t.jwksCache||{},this.allowInsecureRequests=t.allowInsecureRequests??!1,this.httpOptions=()=>{const r=new Headers,o=t.enableTelemetry??!0,s=t.httpTimeout??5e3;if(o){const a="nextjs-auth0",i=A2.version;r.set("User-Agent",`${a}/${i}`),r.set("Auth0-Client",nS(JSON.stringify({name:a,version:i})))}return{signal:AbortSignal.timeout(s),headers:r}},this.allowInsecureRequests&&process.env.NODE_ENV==="production"&&console.warn("allowInsecureRequests is enabled in a production environment. This is not recommended."),this.transactionStore=t.transactionStore,this.sessionStore=t.sessionStore,this.domain=t.domain,this.clientMetadata={client_id:t.clientId},this.clientSecret=t.clientSecret,this.authorizationParameters=t.authorizationParameters||{scope:Bh},this.pushedAuthorizationRequests=t.pushedAuthorizationRequests??!1,this.clientAssertionSigningKey=t.clientAssertionSigningKey,this.clientAssertionSigningAlg=t.clientAssertionSigningAlg||"RS256",this.authorizationParameters.scope||(this.authorizationParameters.scope=Bh),!this.authorizationParameters.scope.split(" ").map(r=>r.trim()).includes("openid"))throw new Error("The 'openid' scope must be included in the set of scopes. See https://auth0.com/docs");this.appBaseUrl=t.appBaseUrl,this.signInReturnToPath=t.signInReturnToPath||"/",this.beforeSessionSaved=t.beforeSessionSaved,this.onCallback=t.onCallback||this.defaultOnCallback,this.routes={login:"/auth/login",logout:"/auth/logout",callback:"/auth/callback",backChannelLogout:"/auth/backchannel-logout",profile:process.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile",accessToken:process.env.NEXT_PUBLIC_ACCESS_TOKEN_ROUTE||"/auth/access-token",...t.routes},this.enableAccessTokenEndpoint=t.enableAccessTokenEndpoint??!0,this.noContentProfileResponseWhenUnauthenticated=t.noContentProfileResponseWhenUnauthenticated??!1}async handler(t){const{pathname:n}=t.nextUrl,r=lw(n),o=t.method;if(o==="GET"&&r===this.routes.login)return this.handleLogin(t);if(o==="GET"&&r===this.routes.logout)return this.handleLogout(t);if(o==="GET"&&r===this.routes.callback)return this.handleCallback(t);if(o==="GET"&&r===this.routes.profile)return this.handleProfile(t);if(o==="GET"&&r===this.routes.accessToken&&this.enableAccessTokenEndpoint)return this.handleAccessToken(t);if(o==="POST"&&r===this.routes.backChannelLogout)return this.handleBackChannelLogout(t);{const s=be.NextResponse.next(),a=await this.sessionStore.get(t.cookies);return a&&(await this.sessionStore.set(t.cookies,s.cookies,{...a}),er(s)),s}}async startInteractiveLogin(t={}){const n=ki(this.routes.callback,this.appBaseUrl);let r=this.signInReturnToPath;if(t.returnTo){const y=new URL(this.authorizationParameters.redirect_uri||this.appBaseUrl),g=R2(t.returnTo,y);g&&(r=g.pathname+g.search+g.hash)}const o="S256",s=y_(),a=await E_(s),i=w_(),c=v_(),u=new URLSearchParams;u.set("client_id",this.clientMetadata.client_id),u.set("redirect_uri",n.toString()),u.set("response_type","code"),u.set("code_challenge",a),u.set("code_challenge_method",o),u.set("state",i),u.set("nonce",c);const l={...this.authorizationParameters,...t.authorizationParameters};Object.entries(l).forEach(([y,g])=>{!Y2.includes(y)&&g!=null&&u.set(y,String(g))});const d={nonce:c,maxAge:this.authorizationParameters.max_age,codeVerifier:s,responseType:"code",state:i,returnTo:r},[h,m]=await this.authorizationUrl(u);if(h)return new be.NextResponse("An error occured while trying to initiate the login request.",{status:500});const _=be.NextResponse.redirect(m.toString());return await this.transactionStore.save(_.cookies,d),_}async handleLogin(t){const n=Object.fromEntries(t.nextUrl.searchParams.entries()),r={authorizationParameters:this.pushedAuthorizationRequests?{}:n,returnTo:n.returnTo};return this.startInteractiveLogin(r)}async handleLogout(t){const n=await this.sessionStore.get(t.cookies),[r,o]=await this.discoverAuthorizationServerMetadata();if(r)return new be.NextResponse("An error occured while trying to initiate the logout request.",{status:500});const s=t.nextUrl.searchParams.get("returnTo")||this.appBaseUrl;if(!o.end_session_endpoint){console.warn("The Auth0 client does not have RP-initiated logout enabled, the user will be redirected to the `/v2/logout` endpoint instead. Learn how to enable it here: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0#enable-endpoint-discovery");const c=new URL("/v2/logout",this.issuer);c.searchParams.set("returnTo",s),c.searchParams.set("client_id",this.clientMetadata.client_id);const u=be.NextResponse.redirect(c);return await this.sessionStore.delete(t.cookies,u.cookies),await this.transactionStore.deleteAll(t.cookies,u.cookies),u}const a=new URL(o.end_session_endpoint);a.searchParams.set("client_id",this.clientMetadata.client_id),a.searchParams.set("post_logout_redirect_uri",s),n!=null&&n.internal.sid&&a.searchParams.set("logout_hint",n.internal.sid),n!=null&&n.tokenSet.idToken&&a.searchParams.set("id_token_hint",n==null?void 0:n.tokenSet.idToken);const i=be.NextResponse.redirect(a);return await this.sessionStore.delete(t.cookies,i.cookies),er(i),await this.transactionStore.deleteAll(t.cookies,i.cookies),i}async handleCallback(t){const n=t.nextUrl.searchParams.get("state");if(!n)return this.onCallback(new hw,{},null);const r=await this.transactionStore.get(t.cookies,n);if(!r)return this.onCallback(new pw,{},null);const o=r.payload,s={returnTo:o.returnTo},[a,i]=await this.discoverAuthorizationServerMetadata();if(a)return this.onCallback(a,s,null);let c;try{c=S2(i,this.clientMetadata,t.nextUrl.searchParams,o.state)}catch(_){return this.onCallback(new Nl({cause:new jn({code:_.error,message:_.error_description})}),s,null)}let u;try{const _=ki(this.routes.callback,this.appBaseUrl);u=await e2(i,this.clientMetadata,await this.getClientAuth(),c,_.toString(),o.codeVerifier,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests})}catch(_){return this.onCallback(new mw(_.message),s,null)}let l;try{l=await r2(i,this.clientMetadata,u,{expectedNonce:o.nonce,maxAge:o.maxAge,requireIdToken:!0})}catch(_){return this.onCallback(new gw({cause:new jn({code:_.error,message:_.error_description})}),s,null)}const d=Lh(l);let h={user:d,tokenSet:{accessToken:l.access_token,idToken:l.id_token,scope:l.scope,refreshToken:l.refresh_token,expiresAt:Math.floor(Date.now()/1e3)+Number(l.expires_in)},internal:{sid:d.sid,createdAt:Math.floor(Date.now()/1e3)}};const m=await this.onCallback(null,s,h);return this.beforeSessionSaved?h={...await this.beforeSessionSaved(h,l.id_token??null),internal:h.internal}:h.user=X2(d),await this.sessionStore.set(t.cookies,m.cookies,h,!0),er(m),await this.transactionStore.delete(m.cookies,n),m}async handleProfile(t){const n=await this.sessionStore.get(t.cookies);if(!n)return this.noContentProfileResponseWhenUnauthenticated?new be.NextResponse(null,{status:204}):new be.NextResponse(null,{status:401});const r=be.NextResponse.json(n==null?void 0:n.user);return er(r),r}async handleAccessToken(t){const n=await this.sessionStore.get(t.cookies);if(!n)return be.NextResponse.json({error:{message:"The user does not have an active session.",code:pn.MISSING_SESSION}},{status:401});const[r,o]=await this.getTokenSet(n.tokenSet);if(r)return be.NextResponse.json({error:{message:r.message,code:r.code}},{status:401});const s=be.NextResponse.json({token:o.accessToken,scope:o.scope,expires_at:o.expiresAt});return(o.accessToken!==n.tokenSet.accessToken||o.refreshToken!==n.tokenSet.refreshToken||o.expiresAt!==n.tokenSet.expiresAt)&&(await this.sessionStore.set(t.cookies,s.cookies,{...n,tokenSet:o}),er(s)),s}async handleBackChannelLogout(t){if(!this.sessionStore.store)return new be.NextResponse("A session data store is not configured.",{status:500});if(!this.sessionStore.store.deleteByLogoutToken)return new be.NextResponse("Back-channel logout is not supported by the session data store.",{status:500});const r=new URLSearchParams(await t.text()).get("logout_token");if(!r)return new be.NextResponse("Missing `logout_token` in the request body.",{status:400});const[o,s]=await this.verifyLogoutToken(r);return o?new be.NextResponse(o.message,{status:400}):(await this.sessionStore.store.deleteByLogoutToken(s),new be.NextResponse(null,{status:204}))}async getTokenSet(t,n){if(!t.refreshToken&&t.expiresAt<=Date.now()/1e3)return[new Ps(pn.MISSING_REFRESH_TOKEN,"The access token has expired and a refresh token was not provided. The user needs to re-authenticate."),null];if(t.refreshToken&&(n||t.expiresAt<=Date.now()/1e3)){const[r,o]=await this.discoverAuthorizationServerMetadata();if(r)return[r,null];const s=await B_(o,this.clientMetadata,await this.getClientAuth(),t.refreshToken,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests});let a;try{a=await J_(o,this.clientMetadata,s)}catch(u){return[new Ps(pn.FAILED_TO_REFRESH_TOKEN,"The access token has expired and there was an error while trying to refresh it.",new jn({code:u.error,message:u.error_description})),null]}const i=Math.floor(Date.now()/1e3)+Number(a.expires_in),c={...t,accessToken:a.access_token,idToken:a.id_token,expiresAt:i};return a.refresh_token?c.refreshToken=a.refresh_token:c.refreshToken=t.refreshToken,[null,c]}return[null,t]}async discoverAuthorizationServerMetadata(){if(this.authorizationServerMetadata)return[null,this.authorizationServerMetadata];const t=new URL(this.issuer);try{const n=await p_(t,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests}).then(r=>m_(t,r));return this.authorizationServerMetadata=n,[null,n]}catch(n){return console.error(`An error occured while performing the discovery request. issuer=${t.toString()}, error:`,n),[new fw("Discovery failed for the OpenID Connect configuration."),null]}}async defaultOnCallback(t,n){return t?new be.NextResponse(t.message,{status:500}):be.NextResponse.redirect(ki(n.returnTo||"/",this.appBaseUrl))}async verifyLogoutToken(t){const[n,r]=await this.discoverAuthorizationServerMetadata();if(n)return[n,null];const o="RS256",s=n_(new URL(r.jwks_uri),{[no]:this.jwksCache}),{payload:a}=await KE(t,s,{issuer:r.issuer,audience:this.clientMetadata.client_id,algorithms:[o],requiredClaims:["iat"]});return!("sid"in a)&&!("sub"in a)?[new Pt('either "sid" or "sub" (or both) claims must be present'),null]:"sid"in a&&typeof a.sid!="string"?[new Pt('"sid" claim must be a string'),null]:"sub"in a&&typeof a.sub!="string"?[new Pt('"sub" claim must be a string'),null]:"nonce"in a?[new Pt('"nonce" claim is prohibited'),null]:"events"in a?typeof a.events!="object"||a.events===null?[new Pt('"events" claim must be an object'),null]:"http://schemas.openid.net/event/backchannel-logout"in a.events?typeof a.events["http://schemas.openid.net/event/backchannel-logout"]!="object"?[new Pt('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object'),null]:[null,{sid:a.sid,sub:a.sub}]:[new Pt('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim'),null]:[new Pt('"events" claim is missing'),null]}async authorizationUrl(t){const[n,r]=await this.discoverAuthorizationServerMetadata();if(n)return[n,null];if(this.pushedAuthorizationRequests&&!r.pushed_authorization_request_endpoint)return console.error("The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par"),[new Error("The authorization server does not support pushed authorization requests."),null];const o=new URL(r.authorization_endpoint);if(this.pushedAuthorizationRequests){const s=await N_(r,this.clientMetadata,await this.getClientAuth(),t,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests});let a;try{a=await q_(r,this.clientMetadata,s)}catch(i){return[new Nl({cause:new jn({code:i.error,message:i.error_description}),message:"An error occured while pushing the authorization request."}),null]}return o.searchParams.set("request_uri",a.request_uri),o.searchParams.set("client_id",this.clientMetadata.client_id),[null,o]}return o.search=t.toString(),[null,o]}async getClientAuth(){if(!this.clientSecret&&!this.clientAssertionSigningKey)throw new Error("The client secret or client assertion signing key must be provided.");let t=this.clientAssertionSigningKey;return t&&!(t instanceof CryptoKey)&&(t=await vE(t,this.clientAssertionSigningAlg)),t?P_(t):C_(this.clientSecret)}get issuer(){return this.domain.startsWith("http://")||this.domain.startsWith("https://")?this.domain:`https://${this.domain}`}async getConnectionTokenSet(t,n,r){if(!t.refreshToken&&(!n||n.expiresAt<=Date.now()/1e3))return[new Os(Hn.MISSING_REFRESH_TOKEN,"A refresh token was not present, Connection Access Token requires a refresh token. The user needs to re-authenticate."),null];if(t.refreshToken&&(!n||n.expiresAt<=Date.now()/1e3)){const o=new URLSearchParams;o.append("connection",r.connection),o.append("subject_token_type",Q2),o.append("subject_token",t.refreshToken),o.append("requested_token_type",eS),r.login_hint&&o.append("login_hint",r.login_hint);const[s,a]=await this.discoverAuthorizationServerMetadata();if(s)return[s,null];const i=await m2(a,this.clientMetadata,await this.getClientAuth(),Z2,o,{[Bt]:this.fetch,[Mt]:this.allowInsecureRequests});let c;try{c=await g2(a,this.clientMetadata,i)}catch(u){return[new Os(Hn.FAILED_TO_EXCHANGE,"There was an error trying to exchange the refresh token for a connection access token.",new jn({code:u.error,message:u.error_description})),null]}return[null,{accessToken:c.access_token,expiresAt:Math.floor(Date.now()/1e3)+Number(c.expires_in),scope:c.scope,connection:r.connection}]}return[null,n]}}const nS=e=>{const t=new TextEncoder().encode(e),n=32768,r=[];for(let o=0;o<t.length;o+=n)r.push(String.fromCharCode.apply(null,t.subarray(o,o+n)));return btoa(r.join(""))},rS="__session";class Vh{constructor({secret:t,rolling:n=!0,absoluteDuration:r=60*60*24*3,inactivityDuration:o=60*60*24*1,store:s,cookieOptions:a}){this.secret=t,this.rolling=n,this.absoluteDuration=r,this.inactivityDuration=o,this.store=s,this.sessionCookieName=(a==null?void 0:a.name)??rS,this.cookieConfig={httpOnly:!0,sameSite:(a==null?void 0:a.sameSite)??"lax",secure:(a==null?void 0:a.secure)??!1,path:(a==null?void 0:a.path)??"/",domain:a==null?void 0:a.domain,transient:a==null?void 0:a.transient}}epoch(){return Date.now()/1e3|0}calculateMaxAge(t){if(!this.rolling)return this.absoluteDuration;const n=this.epoch(),o=Math.min(n+this.inactivityDuration,t+this.absoluteDuration)-this.epoch();return o>0?o:0}}const Sn="appSession";function oS(e){if(e.protectedHeader.iat){const t=e;return Jh(t.protectedHeader,t.payload)}return e.payload}function sS(e){var t;if((t=e.header)!=null&&t.iat){const n=e;return Jh(n.header,n.data)}return e}function Jh(e,t){const n=t.user;return{user:n,tokenSet:{idToken:t.idToken??void 0,accessToken:t.accessToken??void 0,scope:t.accessTokenScope,refreshToken:t.refreshToken,expiresAt:t.accessTokenExpiresAt},internal:{sid:n.sid,createdAt:e.iat}}}const Xh=()=>{const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")};class aS extends Vh{constructor({secret:t,store:n,rolling:r,absoluteDuration:o,inactivityDuration:s,cookieOptions:a}){super({secret:t,rolling:r,absoluteDuration:o,inactivityDuration:s,cookieOptions:a}),this.store=n}async get(t){const n=t.get(this.sessionCookieName)||t.get(Sn);if(!n||!n.value)return null;let r=null;try{const{payload:s}=await _n(n.value,this.secret);r=s.id}catch(s){if(s.code==="ERR_JWE_INVALID"){const a=await G2(n.name,n.value,this.secret);if(!a)return null;r=a}}if(!r)return null;const o=await this.store.get(r);return o?sS(o):null}async set(t,n,r,o=!1){var l;let s=null;const a=(l=t.get(this.sessionCookieName))==null?void 0:l.value;if(a){const{payload:d}=await _n(a,this.secret);s=d.id}s&&o&&(await this.store.delete(s),s=Xh()),s||(s=Xh());const i=this.calculateMaxAge(r.internal.createdAt),c=Date.now()/1e3+i,u=await co({id:s},this.secret,c);n.set(this.sessionCookieName,u.toString(),{...this.cookieConfig,maxAge:i}),await this.store.set(s,r),t.set(this.sessionCookieName,u.toString()),this.sessionCookieName!==Sn&&t.has(Sn)&&n.delete(Sn)}async delete(t,n){var s;const r=(s=t.get(this.sessionCookieName))==null?void 0:s.value;if(await n.delete(this.sessionCookieName),!r)return;const{payload:o}=await _n(r,this.secret);await this.store.delete(o.id)}}class iS extends Vh{constructor({secret:t,rolling:n,absoluteDuration:r,inactivityDuration:o,cookieOptions:s}){super({secret:t,rolling:n,absoluteDuration:r,inactivityDuration:o,cookieOptions:s}),this.connectionTokenSetsCookieName="__FC"}async get(t){const n=zh(this.sessionCookieName,t)??zh(Sn,t,!0);if(!n)return null;const r=await _n(n,this.secret),o=oS(r),s=await Promise.all(this.getConnectionTokenSetsCookies(t).map(a=>_n(a.value,this.secret)));return{...o,...s.length?{connectionTokenSets:s.map(a=>a.payload)}:{}}}async set(t,n,r){const{connectionTokenSets:o,...s}=r,a=this.calculateMaxAge(r.internal.createdAt),i=Math.floor(Date.now()/1e3)+a,u=(await co(s,this.secret,i)).toString(),l={...this.cookieConfig,maxAge:a};V2(this.sessionCookieName,u,l,t,n),o!=null&&o.length&&await Promise.all(o.map((d,h)=>this.storeInCookie(t,n,d,`${this.connectionTokenSetsCookieName}_${h}`,a))),Gh(Sn,t,n,!0)}async delete(t,n){Gh(this.sessionCookieName,t,n),this.getConnectionTokenSetsCookies(t).forEach(r=>n.delete(r.name))}async storeInCookie(t,n,r,o,s){const a=Math.floor(Date.now()/1e3+s),i=await co(r,this.secret,a),c=i.toString();n.set(o,i.toString(),{...this.cookieConfig,maxAge:s}),t.set(o,c);const u=new Ai(new Headers);u.set(o,c,{...this.cookieConfig,maxAge:s}),new TextEncoder().encode(u.toString()).length>=4096&&(o===this.sessionCookieName?console.warn(`The ${o} cookie size exceeds 4096 bytes, which may cause issues in some browsers. Consider removing any unnecessary custom claims from the access token or the user profile. Alternatively, you can use a stateful session implementation to store the session data in a data store.`):console.warn(`The ${o} cookie size exceeds 4096 bytes, which may cause issues in some browsers. You can use a stateful session implementation to store the session data in a data store.`))}getConnectionTokenSetsCookies(t){return t.getAll().filter(n=>n.name.startsWith(this.connectionTokenSetsCookieName))}}const cS="__txn_";class uS{constructor({secret:t,cookieOptions:n}){this.secret=t,this.transactionCookiePrefix=(n==null?void 0:n.prefix)??cS,this.cookieConfig={httpOnly:!0,sameSite:(n==null?void 0:n.sameSite)??"lax",secure:(n==null?void 0:n.secure)??!1,path:(n==null?void 0:n.path)??"/",maxAge:60*60}}getTransactionCookieName(t){return`${this.transactionCookiePrefix}${t}`}getCookiePrefix(){return this.transactionCookiePrefix}async save(t,n){const r=Math.floor(Date.now()/1e3+this.cookieConfig.maxAge),o=await co(n,this.secret,r);if(!n.state)throw new Error("Transaction state is required");t.set(this.getTransactionCookieName(n.state),o.toString(),this.cookieConfig)}async get(t,n){var s;const r=this.getTransactionCookieName(n),o=(s=t.get(r))==null?void 0:s.value;return o?_n(o,this.secret):null}async delete(t,n){await t.delete(this.getTransactionCookieName(n))}async deleteAll(t,n){const r=this.getCookiePrefix();t.getAll().forEach(o=>{o.name.startsWith(r)&&n.delete(o.name)})}}class lS{constructor(t={}){var d,h,m,_,y,g,p,b,f,A,E,R,v,x,C,D;const{domain:n,clientId:r,clientSecret:o,appBaseUrl:s,secret:a,clientAssertionSigningKey:i}=this.validateAndExtractRequiredOptions(t),c=t.clientAssertionSigningAlg||process.env.AUTH0_CLIENT_ASSERTION_SIGNING_ALG,u={name:((h=(d=t.session)==null?void 0:d.cookie)==null?void 0:h.name)??"__session",secure:((_=(m=t.session)==null?void 0:m.cookie)==null?void 0:_.secure)??process.env.AUTH0_COOKIE_SECURE==="true",sameSite:((g=(y=t.session)==null?void 0:y.cookie)==null?void 0:g.sameSite)??process.env.AUTH0_COOKIE_SAME_SITE??"lax",path:((b=(p=t.session)==null?void 0:p.cookie)==null?void 0:b.path)??process.env.AUTH0_COOKIE_PATH??"/",transient:((A=(f=t.session)==null?void 0:f.cookie)==null?void 0:A.transient)??process.env.AUTH0_COOKIE_TRANSIENT==="true",domain:((R=(E=t.session)==null?void 0:E.cookie)==null?void 0:R.domain)??process.env.AUTH0_COOKIE_DOMAIN},l={prefix:((v=t.transactionCookie)==null?void 0:v.prefix)??"__txn_",secure:((x=t.transactionCookie)==null?void 0:x.secure)??!1,sameSite:((C=t.transactionCookie)==null?void 0:C.sameSite)??"lax",path:((D=t.transactionCookie)==null?void 0:D.path)??"/"};if(s){const{protocol:I}=new URL(s);I==="https:"&&(u.secure=!0,l.secure=!0)}this.transactionStore=new uS({...t.session,secret:a,cookieOptions:l}),this.sessionStore=t.sessionStore?new aS({...t.session,secret:a,store:t.sessionStore,cookieOptions:u}):new iS({...t.session,secret:a,cookieOptions:u}),this.authClient=new tS({transactionStore:this.transactionStore,sessionStore:this.sessionStore,domain:n,clientId:r,clientSecret:o,clientAssertionSigningKey:i,clientAssertionSigningAlg:c,authorizationParameters:t.authorizationParameters,pushedAuthorizationRequests:t.pushedAuthorizationRequests,appBaseUrl:s,secret:a,signInReturnToPath:t.signInReturnToPath,beforeSessionSaved:t.beforeSessionSaved,onCallback:t.onCallback,routes:t.routes,allowInsecureRequests:t.allowInsecureRequests,httpTimeout:t.httpTimeout,enableTelemetry:t.enableTelemetry,enableAccessTokenEndpoint:t.enableAccessTokenEndpoint,noContentProfileResponseWhenUnauthenticated:t.noContentProfileResponseWhenUnauthenticated})}middleware(t){return this.authClient.handler.bind(this.authClient)(t)}async getSession(t){return t?t instanceof be.NextRequest?this.sessionStore.get(t.cookies):this.sessionStore.get(this.createRequestCookies(t)):this.sessionStore.get(await Xn.cookies())}async getAccessToken(t,n,r){const o={refresh:!1};let s,a,i={};if(t&&(t instanceof Request||typeof t.headers=="object")){if(s=t,a=n,i={...o,...r??{}},!a)throw new TypeError("getAccessToken(req, res): The 'res' argument is missing. Both 'req' and 'res' must be provided together for Pages Router or middleware usage.")}else{if(n!==void 0||r!==void 0)throw new TypeError("getAccessToken: Invalid arguments. Valid signatures are getAccessToken(), getAccessToken(options), or getAccessToken(req, res, options).");i={...o,...t??{}}}const c=s?await this.getSession(s):await this.getSession();if(!c)throw new Ps(pn.MISSING_SESSION,"The user does not have an active session.");const[u,l]=await this.authClient.getTokenSet(c.tokenSet,i.refresh);if(u)throw u;return(l.accessToken!==c.tokenSet.accessToken||l.expiresAt!==c.tokenSet.expiresAt||l.refreshToken!==c.tokenSet.refreshToken)&&await this.saveToSession({...c,tokenSet:l},s,a),{token:l.accessToken,scope:l.scope,expiresAt:l.expiresAt}}async getAccessTokenForConnection(t,n,r){var c,u;const o=n?await this.getSession(n):await this.getSession();if(!o)throw new Os(Hn.MISSING_SESSION,"The user does not have an active session.");const s=(c=o.connectionTokenSets)==null?void 0:c.find(l=>l.connection===t.connection),[a,i]=await this.authClient.getConnectionTokenSet(o.tokenSet,s,t);if(a!==null)throw a;if(i&&(!s||i.accessToken!==s.accessToken||i.expiresAt!==s.expiresAt||i.scope!==s.scope)){let l;s?l=(u=o.connectionTokenSets)==null?void 0:u.map(d=>d.connection===t.connection?i:d):l=[...o.connectionTokenSets||[],i],await this.saveToSession({...o,connectionTokenSets:l},n,r)}return{token:i.accessToken,scope:i.scope,expiresAt:i.expiresAt}}async updateSession(t,n,r){if(n){const o=t;if(!r)throw new Error("The session data is missing.");if(o instanceof be.NextRequest&&n instanceof be.NextResponse){const s=await this.getSession(o);if(!s)throw new Error("The user is not authenticated.");await this.sessionStore.set(o.cookies,n.cookies,{...r,internal:{...s.internal}})}else{const s=await this.getSession(o);if(!s)throw new Error("The user is not authenticated.");const a=new Headers,i=new Ai(a),c=r,u=this.createRequestCookies(o),l=n;await this.sessionStore.set(u,i,{...c,internal:{...s.internal}});for(const[d,h]of a.entries())l.setHeader(d,h)}}else{const o=await this.getSession();if(!o)throw new Error("The user is not authenticated.");const s=t;if(!s)throw new Error("The session data is missing.");await this.sessionStore.set(await Xn.cookies(),await Xn.cookies(),{...s,internal:{...o.internal}})}}createRequestCookies(t){const n=new Headers;for(const r in t.headers)if(Array.isArray(t.headers[r]))for(const o of t.headers[r])n.append(r,o);else n.append(r,t.headers[r]??"");return new D2(n)}async startInteractiveLogin(t){return this.authClient.startInteractiveLogin(t)}async saveToSession(t,n,r){if(n&&r)if(n instanceof be.NextRequest&&r instanceof be.NextResponse)await this.sessionStore.set(n.cookies,r.cookies,t);else{const o=new Headers,s=new Ai(o),a=r;await this.sessionStore.set(this.createRequestCookies(n),s,t);for(const[i,c]of o.entries())a.setHeader(i,c)}else try{await this.sessionStore.set(await Xn.cookies(),await Xn.cookies(),t)}catch{process.env.NODE_ENV==="development"&&console.warn("Failed to persist the updated token set. `getAccessToken()` was likely called from a Server Component which cannot set cookies.")}}validateAndExtractRequiredOptions(t){const n={domain:t.domain??process.env.AUTH0_DOMAIN,clientId:t.clientId??process.env.AUTH0_CLIENT_ID,appBaseUrl:t.appBaseUrl??process.env.APP_BASE_URL,secret:t.secret??process.env.AUTH0_SECRET},r=t.clientSecret??process.env.AUTH0_CLIENT_SECRET,o=t.clientAssertionSigningKey??process.env.AUTH0_CLIENT_ASSERTION_SIGNING_KEY,s=!!(r||o),a=Object.entries(n).filter(([,c])=>!c).map(([c])=>c);if(s||a.push("clientAuthentication"),a.length){const c={domain:"AUTH0_DOMAIN",clientId:"AUTH0_CLIENT_ID",appBaseUrl:"APP_BASE_URL",secret:"AUTH0_SECRET"};let u=`WARNING: Not all required options were provided when creating an instance of Auth0Client. Ensure to provide all missing options, either by passing it to the Auth0Client constructor, or by setting the corresponding environment variable.
193
+ `)}}class r extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class o extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}}(Ia)),Ia}var Lf;function $0(){return Lf||(Lf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(c,u){for(var l in u)Object.defineProperty(c,l,{enumerable:!0,get:u[l]})}t(e,{INTERNALS:function(){return a},NextRequest:function(){return i}});const n=kf(),r=Df(),o=U0(),s=Bn(),a=Symbol("internal request");class i extends Request{constructor(u,l={}){const d=typeof u!="string"&&"url"in u?u.url:String(u);(0,r.validateURL)(d),process.env.NEXT_RUNTIME!=="edge"&&l.body&&l.duplex!=="half"&&(l.duplex="half"),u instanceof Request?super(u,l):super(d,l);const h=new n.NextURL(d,{headers:(0,r.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:l.nextConfig});this[a]={cookies:new s.RequestCookies(this.headers),nextUrl:h,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?d:h.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[a].cookies}get nextUrl(){return this[a].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[a].url}}}(ma)),ma}var Da={},jf;function W0(){return jf||(jf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NextResponse",{enumerable:!0,get:function(){return u}});const t=Bn(),n=kf(),r=Df(),o=Vs(),s=Bn(),a=Symbol("internal response"),i=new Set([301,302,303,307,308]);function c(l,d){var h;if(!(l==null||(h=l.request)==null)&&h.headers){if(!(l.request.headers instanceof Headers))throw Object.defineProperty(new Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});const m=[];for(const[_,y]of l.request.headers)d.set("x-middleware-request-"+_,y),m.push(_);d.set("x-middleware-override-headers",m.join(","))}}class u extends Response{constructor(d,h={}){super(d,h);const m=this.headers,_=new s.ResponseCookies(m),y=new Proxy(_,{get(g,p,b){switch(p){case"delete":case"set":return(...f)=>{const A=Reflect.apply(g[p],g,f),E=new Headers(m);return A instanceof s.ResponseCookies&&m.set("x-middleware-set-cookie",A.getAll().map(R=>(0,t.stringifyCookie)(R)).join(",")),c(h,E),A};default:return o.ReflectAdapter.get(g,p,b)}}});this[a]={cookies:y,url:h.url?new n.NextURL(h.url,{headers:(0,r.toNodeOutgoingHttpHeaders)(m),nextConfig:h.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[a].cookies}static json(d,h){const m=Response.json(d,h);return new u(m.body,m)}static redirect(d,h){const m=typeof h=="number"?h:(h==null?void 0:h.status)??307;if(!i.has(m))throw Object.defineProperty(new RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});const _=typeof h=="object"?h:{},y=new Headers(_==null?void 0:_.headers);return y.set("Location",(0,r.validateURL)(d)),new u(null,{..._,headers:y,status:m})}static rewrite(d,h){const m=new Headers(h==null?void 0:h.headers);return m.set("x-middleware-rewrite",(0,r.validateURL)(d)),c(h,m),new u(null,{...h,headers:m})}static next(d){const h=new Headers(d==null?void 0:d.headers);return h.set("x-middleware-next","1"),c(d,h),new u(null,{...d,headers:h})}}}(Da)),Da}var Ma={},Hf;function F0(){return Hf||(Hf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ImageResponse",{enumerable:!0,get:function(){return t}});function t(){throw Object.defineProperty(new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}}(Ma)),Ma}var La={},ja={exports:{}},Uf;function K0(){return Uf||(Uf=1,(()=>{var e={226:function(o,s){(function(a,i){var c="1.0.35",u="",l="?",d="function",h="undefined",m="object",_="string",y="major",g="model",p="name",b="type",f="vendor",A="version",E="architecture",R="console",v="mobile",x="tablet",C="smarttv",D="wearable",I="embedded",P=350,U="Amazon",G="Apple",oe="ASUS",V="BlackBerry",Y="Browser",O="Chrome",j="Edge",T="Firefox",H="Google",J="Huawei",X="LG",se="Microsoft",fe="Motorola",we="Opera",te="Samsung",le="Sharp",ue="Sony",ye="Xiaomi",k="Zebra",N="Facebook",M="Chromium OS",z="Mac OS",ne=function(ie,ge){var re={};for(var ve in ie)ge[ve]&&ge[ve].length%2===0?re[ve]=ge[ve].concat(ie[ve]):re[ve]=ie[ve];return re},$=function(ie){for(var ge={},re=0;re<ie.length;re++)ge[ie[re].toUpperCase()]=ie[re];return ge},_e=function(ie,ge){return typeof ie===_?Ce(ge).indexOf(Ce(ie))!==-1:!1},Ce=function(ie){return ie.toLowerCase()},pe=function(ie){return typeof ie===_?ie.replace(/[^\d\.]/g,u).split(".")[0]:i},Ae=function(ie,ge){if(typeof ie===_)return ie=ie.replace(/^\s\s*/,u),typeof ge===h?ie:ie.substring(0,P)},De=function(ie,ge){for(var re=0,ve,Lt,ft,me,Q,ht;re<ge.length&&!Q;){var Ii=ge[re],ap=ge[re+1];for(ve=Lt=0;ve<Ii.length&&!Q&&Ii[ve];)if(Q=Ii[ve++].exec(ie),Q)for(ft=0;ft<ap.length;ft++)ht=Q[++Lt],me=ap[ft],typeof me===m&&me.length>0?me.length===2?typeof me[1]==d?this[me[0]]=me[1].call(this,ht):this[me[0]]=me[1]:me.length===3?typeof me[1]===d&&!(me[1].exec&&me[1].test)?this[me[0]]=ht?me[1].call(this,ht,me[2]):i:this[me[0]]=ht?ht.replace(me[1],me[2]):i:me.length===4&&(this[me[0]]=ht?me[3].call(this,ht.replace(me[1],me[2])):i):this[me]=ht||i;re+=2}},xn=function(ie,ge){for(var re in ge)if(typeof ge[re]===m&&ge[re].length>0){for(var ve=0;ve<ge[re].length;ve++)if(_e(ge[re][ve],ie))return re===l?i:re}else if(_e(ge[re],ie))return re===l?i:re;return ie},po={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},nr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ke={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[A,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[A,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,A],[/opios[\/ ]+([\w\.]+)/i],[A,[p,we+" Mini"]],[/\bopr\/([\w\.]+)/i],[A,[p,we]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,A],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[A,[p,"UC"+Y]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[A,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[A,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[A,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[A,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[A,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+Y],A],[/\bfocus\/([\w\.]+)/i],[A,[p,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[A,[p,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[A,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[A,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[A,[p,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[A,[p,"MIUI "+Y]],[/fxios\/([-\w\.]+)/i],[A,[p,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+Y]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+Y],A],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],A],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,A],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,N],A],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,A],[/\bgsa\/([\w\.]+) .*safari\//i],[A,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[A,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[A,[p,O+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,O+" WebView"],A],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[A,[p,"Android "+Y]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,A],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[A,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[A,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[A,xn,po]],[/(webkit|khtml)\/([\w\.]+)/i],[p,A],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],A],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[A,[p,T+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,A],[/(cobalt)\/([\w\.]+)/i],[p,[A,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,Ce]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[E,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[E,"armhf"]],[/windows (ce|mobile); ppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[E,/ower/,u,Ce]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[E,Ce]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[f,te],[b,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[g,[f,te],[b,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[g,[f,G],[b,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[g,[f,G],[b,x]],[/(macintosh);/i],[g,[f,G]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[f,le],[b,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[g,[f,J],[b,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[g,[f,J],[b,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[g,/_/g," "],[f,ye],[b,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[g,/_/g," "],[f,ye],[b,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[f,"OPPO"],[b,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[f,"Vivo"],[b,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[g,[f,"Realme"],[b,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[g,[f,fe],[b,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[f,fe],[b,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[f,X],[b,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[f,X],[b,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[g,[f,"Lenovo"],[b,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[g,/_/g," "],[f,"Nokia"],[b,v]],[/(pixel c)\b/i],[g,[f,H],[b,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[g,[f,H],[b,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[f,ue],[b,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[f,ue],[b,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[f,"OnePlus"],[b,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[f,U],[b,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[f,U],[b,v]],[/(playbook);[-\w\),; ]+(rim)/i],[g,f,[b,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[g,[f,V],[b,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[f,oe],[b,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[f,oe],[b,v]],[/(nexus 9)/i],[g,[f,"HTC"],[b,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[g,/_/g," "],[b,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[f,"Acer"],[b,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[f,"Meizu"],[b,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,g,[b,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,g,[b,x]],[/(surface duo)/i],[g,[f,se],[b,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[f,"Fairphone"],[b,v]],[/(u304aa)/i],[g,[f,"AT&T"],[b,v]],[/\bsie-(\w*)/i],[g,[f,"Siemens"],[b,v]],[/\b(rct\w+) b/i],[g,[f,"RCA"],[b,x]],[/\b(venue[\d ]{2,7}) b/i],[g,[f,"Dell"],[b,x]],[/\b(q(?:mv|ta)\w+) b/i],[g,[f,"Verizon"],[b,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[g,[f,"Barnes & Noble"],[b,x]],[/\b(tm\d{3}\w+) b/i],[g,[f,"NuVision"],[b,x]],[/\b(k88) b/i],[g,[f,"ZTE"],[b,x]],[/\b(nx\d{3}j) b/i],[g,[f,"ZTE"],[b,v]],[/\b(gen\d{3}) b.+49h/i],[g,[f,"Swiss"],[b,v]],[/\b(zur\d{3}) b/i],[g,[f,"Swiss"],[b,x]],[/\b((zeki)?tb.*\b) b/i],[g,[f,"Zeki"],[b,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],g,[b,x]],[/\b(ns-?\w{0,9}) b/i],[g,[f,"Insignia"],[b,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[g,[f,"NextBook"],[b,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],g,[b,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],g,[b,v]],[/\b(ph-1) /i],[g,[f,"Essential"],[b,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[g,[f,"Envizen"],[b,x]],[/\b(trio[-\w\. ]+) b/i],[g,[f,"MachSpeed"],[b,x]],[/\btu_(1491) b/i],[g,[f,"Rotor"],[b,x]],[/(shield[\w ]+) b/i],[g,[f,"Nvidia"],[b,x]],[/(sprint) (\w+)/i],[f,g,[b,v]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[f,se],[b,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[f,k],[b,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[f,k],[b,v]],[/smart-tv.+(samsung)/i],[f,[b,C]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[f,te],[b,C]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,X],[b,C]],[/(apple) ?tv/i],[f,[g,G+" TV"],[b,C]],[/crkey/i],[[g,O+"cast"],[f,H],[b,C]],[/droid.+aft(\w)( bui|\))/i],[g,[f,U],[b,C]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[f,le],[b,C]],[/(bravia[\w ]+)( bui|\))/i],[g,[f,ue],[b,C]],[/(mitv-\w{5}) bui/i],[g,[f,ye],[b,C]],[/Hbbtv.*(technisat) (.*);/i],[f,g,[b,C]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,Ae],[g,Ae],[b,C]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[b,C]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,g,[b,R]],[/droid.+; (shield) bui/i],[g,[f,"Nvidia"],[b,R]],[/(playstation [345portablevi]+)/i],[g,[f,ue],[b,R]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[f,se],[b,R]],[/((pebble))app/i],[f,g,[b,D]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[g,[f,G],[b,D]],[/droid.+; (glass) \d/i],[g,[f,H],[b,D]],[/droid.+; (wt63?0{2,3})\)/i],[g,[f,k],[b,D]],[/(quest( 2| pro)?)/i],[g,[f,N],[b,D]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[b,I]],[/(aeobc)\b/i],[g,[f,U],[b,I]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[g,[b,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[g,[b,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[b,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[b,v]],[/(android[-\w\. ]{0,9});.+buil/i],[g,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[A,[p,j+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[A,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,A],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[A,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,A],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[A,xn,nr]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[A,xn,nr]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[A,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,z],[A,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[A,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,A],[/\(bb(10);/i],[A,[p,V]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[A,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[A,[p,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[A,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[A,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[A,[p,O+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,M],A],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,A],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],A],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,A]]},Re=function(ie,ge){if(typeof ie===m&&(ge=ie,ie=i),!(this instanceof Re))return new Re(ie,ge).getResult();var re=typeof a!==h&&a.navigator?a.navigator:i,ve=ie||(re&&re.userAgent?re.userAgent:u),Lt=re&&re.userAgentData?re.userAgentData:i,ft=ge?ne(Ke,ge):Ke,me=re&&re.userAgent==ve;return this.getBrowser=function(){var Q={};return Q[p]=i,Q[A]=i,De.call(Q,ve,ft.browser),Q[y]=pe(Q[A]),me&&re&&re.brave&&typeof re.brave.isBrave==d&&(Q[p]="Brave"),Q},this.getCPU=function(){var Q={};return Q[E]=i,De.call(Q,ve,ft.cpu),Q},this.getDevice=function(){var Q={};return Q[f]=i,Q[g]=i,Q[b]=i,De.call(Q,ve,ft.device),me&&!Q[b]&&Lt&&Lt.mobile&&(Q[b]=v),me&&Q[g]=="Macintosh"&&re&&typeof re.standalone!==h&&re.maxTouchPoints&&re.maxTouchPoints>2&&(Q[g]="iPad",Q[b]=x),Q},this.getEngine=function(){var Q={};return Q[p]=i,Q[A]=i,De.call(Q,ve,ft.engine),Q},this.getOS=function(){var Q={};return Q[p]=i,Q[A]=i,De.call(Q,ve,ft.os),me&&!Q[p]&&Lt&&Lt.platform!="Unknown"&&(Q[p]=Lt.platform.replace(/chrome os/i,M).replace(/macos/i,z)),Q},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ve},this.setUA=function(Q){return ve=typeof Q===_&&Q.length>P?Ae(Q,P):Q,this},this.setUA(ve),this};Re.VERSION=c,Re.BROWSER=$([p,A,y]),Re.CPU=$([E]),Re.DEVICE=$([g,f,b,R,v,C,x,D,I]),Re.ENGINE=Re.OS=$([p,A]),typeof s!==h?(o.exports&&(s=o.exports=Re),s.UAParser=Re):typeof a!==h&&(a.UAParser=Re);var dt=typeof a!==h&&(a.jQuery||a.Zepto);if(dt&&!dt.ua){var An=new Re;dt.ua=An.getResult(),dt.ua.get=function(){return An.getUA()},dt.ua.set=function(ie){An.setUA(ie);var ge=An.getResult();for(var re in ge)dt.ua[re]=ge[re]}}})(typeof window=="object"?window:this)}},t={};function n(o){var s=t[o];if(s!==void 0)return s.exports;var a=t[o]={exports:{}},i=!0;try{e[o].call(a.exports,a,a.exports,n),i=!1}finally{i&&delete t[o]}return a.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(226);ja.exports=r})()),ja.exports}var $f;function Wf(){return $f||($f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,c){for(var u in c)Object.defineProperty(i,u,{enumerable:!0,get:c[u]})}t(e,{isBot:function(){return o},userAgent:function(){return a},userAgentFromString:function(){return s}});const n=r(K0());function r(i){return i&&i.__esModule?i:{default:i}}function o(i){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(i)}function s(i){return{...(0,n.default)(i),isBot:i===void 0?!1:o(i)}}function a({headers:i}){return s(i.get("user-agent")||void 0)}}(La)),La}var Ha={},Ff;function q0(){return Ff||(Ff=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"URLPattern",{enumerable:!0,get:function(){return t}});const t=typeof URLPattern>"u"?void 0:URLPattern}(Ha)),Ha}var Ua={},$a={},Kf;function z0(){return Kf||(Kf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"after",{enumerable:!0,get:function(){return n}});const t=kt();function n(r){const o=t.workAsyncStorage.getStore();if(!o)throw Object.defineProperty(new Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});const{afterContext:s}=o;return s.after(r)}}($a)),$a}var qf;function G0(){return qf||(qf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),t(z0(),e);function t(n,r){return Object.keys(n).forEach(function(o){o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:function(){return n[o]}})}),n}}(Ua)),Ua}var Wa={},zf;function B0(){return zf||(zf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"connection",{enumerable:!0,get:function(){return i}});const t=kt(),n=Kt(),r=Jn(),o=mn(),s=Vn(),a=da();function i(){const c=t.workAsyncStorage.getStore(),u=n.workUnitAsyncStorage.getStore();if(c){if(u&&u.phase==="after"&&!(0,a.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${c.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(c.forceStatic)return Promise.resolve(void 0);if(u){if(u.type==="cache")throw Object.defineProperty(new Error(`Route ${c.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E111",enumerable:!1,configurable:!0});if(u.type==="unstable-cache")throw Object.defineProperty(new Error(`Route ${c.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0})}if(c.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${c.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(u){if(u.type==="prerender")return(0,s.makeHangingPromise)(u.renderSignal,"`connection()`");u.type==="prerender-ppr"?(0,r.postponeWithTracking)(c.route,"connection",u.dynamicTracking):u.type==="prerender-legacy"&&(0,r.throwToInterruptStaticGeneration)("connection",c,u)}(0,r.trackDynamicDataInDynamicRender)(c,u)}return Promise.resolve(void 0)}}(Wa)),Wa}var Fa={},Ka={},Gf;function V0(){return Gf||(Gf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"InvariantError",{enumerable:!0,get:function(){return t}});class t extends Error{constructor(r,o){super("Invariant: "+(r.endsWith(".")?r:r+".")+" This is a bug in Next.js.",o),this.name="InvariantError"}}}(Ka)),Ka}var qa={},Bf;function J0(){return Bf||(Bf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(a,i){for(var c in i)Object.defineProperty(a,c,{enumerable:!0,get:i[c]})}t(e,{describeHasCheckingStringProperty:function(){return o},describeStringPropertyAccess:function(){return r},wellKnownProperties:function(){return s}});const n=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function r(a,i){return n.test(i)?"`"+a+"."+i+"`":"`"+a+"["+JSON.stringify(i)+"]`"}function o(a,i){const c=JSON.stringify(i);return"`Reflect.has("+a+", "+c+")`, `"+c+" in "+a+"`, or similar"}const s=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","toJSON","$$typeof","__esModule"])}(qa)),qa}var Vf;function X0(){return Vf||(Vf=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"unstable_rootParams",{enumerable:!0,get:function(){return c}});const t=V0(),n=Jn(),r=kt(),o=Kt(),s=Vn(),a=J0(),i=new WeakMap;async function c(){const d=r.workAsyncStorage.getStore();if(!d)throw Object.defineProperty(new t.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});const h=o.workUnitAsyncStorage.getStore();if(!h)throw Object.defineProperty(new Error(`Route ${d.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(h.type){case"unstable-cache":case"cache":throw Object.defineProperty(new Error(`Route ${d.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-ppr":case"prerender-legacy":return u(h.rootParams,d,h);default:return Promise.resolve(h.rootParams)}}function u(d,h,m){const _=h.fallbackRouteParams;if(_){let y=!1;for(const g in d)if(_.has(g)){y=!0;break}if(y){if(m.type==="prerender"){const g=i.get(d);if(g)return g;const p=(0,s.makeHangingPromise)(m.renderSignal,"`unstable_rootParams`");return i.set(d,p),p}return l(d,_,h,m)}}return Promise.resolve(d)}function l(d,h,m,_){const y=i.get(d);if(y)return y;const g={...d},p=Promise.resolve(g);return i.set(d,p),Object.keys(d).forEach(b=>{a.wellKnownProperties.has(b)||(h.has(b)?Object.defineProperty(g,b,{get(){const f=(0,a.describeStringPropertyAccess)("unstable_rootParams",b);_.type==="prerender-ppr"?(0,n.postponeWithTracking)(m.route,f,_.dynamicTracking):(0,n.throwToInterruptStaticGeneration)(f,m,_)},enumerable:!0}):p[b]=d[b])}),p}}(Fa)),Fa}var Jf;function Y0(){return Jf||(Jf=1,function(e,t){const n={NextRequest:$0().NextRequest,NextResponse:W0().NextResponse,ImageResponse:F0().ImageResponse,userAgentFromString:Wf().userAgentFromString,userAgent:Wf().userAgent,URLPattern:q0().URLPattern,after:G0().after,connection:B0().connection,unstable_rootParams:X0().unstable_rootParams};e.exports=n,t.NextRequest=n.NextRequest,t.NextResponse=n.NextResponse,t.ImageResponse=n.ImageResponse,t.userAgentFromString=n.userAgentFromString,t.userAgent=n.userAgent,t.URLPattern=n.URLPattern,t.after=n.after,t.connection=n.connection,t.unstable_rootParams=n.unstable_rootParams}(Br,Br.exports)),Br.exports}var be=Y0();const ce=crypto,Be=e=>e instanceof CryptoKey,Z0=async(e,t)=>{const n=`SHA-${e.slice(-3)}`;return new Uint8Array(await ce.subtle.digest(n,t))},$e=new TextEncoder,qt=new TextDecoder,Vr=2**32;function Et(...e){const t=e.reduce((o,{length:s})=>o+s,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function Q0(e,t){return Et($e.encode(e),new Uint8Array([0]),t)}function za(e,t,n){if(t<0||t>=Vr)throw new RangeError(`value must be >= 0 and <= ${Vr-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function Xf(e){const t=Math.floor(e/Vr),n=e%Vr,r=new Uint8Array(8);return za(r,t,0),za(r,n,4),r}function Ga(e){const t=new Uint8Array(4);return za(t,e),t}function Ba(e){return Et(Ga(e.length),e)}async function eE(e,t,n){const r=Math.ceil((t>>3)/32),o=new Uint8Array(r*32);for(let s=0;s<r;s++){const a=new Uint8Array(4+e.length+n.length);a.set(Ga(s+1)),a.set(e,4),a.set(n,4+e.length),o.set(await Z0("sha256",a),s*32)}return o.slice(0,t>>3)}const tE=e=>{let t=e;typeof t=="string"&&(t=$e.encode(t));const n=32768,r=[];for(let o=0;o<t.length;o+=n)r.push(String.fromCharCode.apply(null,t.subarray(o,o+n)));return btoa(r.join(""))},Ve=e=>tE(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),nE=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n},Oe=e=>{let t=e;t instanceof Uint8Array&&(t=qt.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return nE(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class Me extends Error{constructor(t,n){var r;super(t,n),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)==null||r.call(Error,this,this.constructor)}}Me.code="ERR_JOSE_GENERIC";class qe extends Me{constructor(t,n,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=o,this.payload=n}}qe.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class Va extends Me{constructor(t,n,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:n}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=o,this.payload=n}}Va.code="ERR_JWT_EXPIRED";class Jr extends Me{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}Jr.code="ERR_JOSE_ALG_NOT_ALLOWED";class Se extends Me{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}Se.code="ERR_JOSE_NOT_SUPPORTED";class Xr extends Me{constructor(t="decryption operation failed",n){super(t,n),this.code="ERR_JWE_DECRYPTION_FAILED"}}Xr.code="ERR_JWE_DECRYPTION_FAILED";class B extends Me{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}B.code="ERR_JWE_INVALID";class ke extends Me{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}ke.code="ERR_JWS_INVALID";class Ja extends Me{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}Ja.code="ERR_JWT_INVALID";class rE extends Me{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}rE.code="ERR_JWK_INVALID";class Xa extends Me{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}Xa.code="ERR_JWKS_INVALID";class Ya extends Me{constructor(t="no applicable key found in the JSON Web Key Set",n){super(t,n),this.code="ERR_JWKS_NO_MATCHING_KEY"}}Ya.code="ERR_JWKS_NO_MATCHING_KEY";class Yf extends Me{constructor(t="multiple matching keys found in the JSON Web Key Set",n){super(t,n),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Yf.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class Zf extends Me{constructor(t="request timed out",n){super(t,n),this.code="ERR_JWKS_TIMEOUT"}}Zf.code="ERR_JWKS_TIMEOUT";class Qf extends Me{constructor(t="signature verification failed",n){super(t,n),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}Qf.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";const Za=ce.getRandomValues.bind(ce);function eh(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new Se(`Unsupported JWE Algorithm: ${e}`)}}const oE=e=>Za(new Uint8Array(eh(e)>>3)),th=(e,t)=>{if(t.length<<3!==eh(e))throw new B("Invalid Initialization Vector length")},Yr=(e,t)=>{const n=e.byteLength<<3;if(n!==t)throw new B(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)},sE=(e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const n=e.length;let r=0,o=-1;for(;++o<n;)r|=e[o]^t[o];return r===0};function Ne(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function _t(e,t){return e.name===t}function Zr(e){return parseInt(e.name.slice(4),10)}function aE(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function nh(e,t){if(t.length&&!t.some(n=>e.usages.includes(n))){let n="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();n+=`one of ${t.join(", ")}, or ${r}.`}else t.length===2?n+=`one of ${t[0]} or ${t[1]}.`:n+=`${t[0]}.`;throw new TypeError(n)}}function iE(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!_t(e.algorithm,"HMAC"))throw Ne("HMAC");const r=parseInt(t.slice(2),10);if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!_t(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Ne("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!_t(e.algorithm,"RSA-PSS"))throw Ne("RSA-PSS");const r=parseInt(t.slice(2),10);if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":{if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw Ne("Ed25519 or Ed448");break}case"Ed25519":{if(!_t(e.algorithm,"Ed25519"))throw Ne("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!_t(e.algorithm,"ECDSA"))throw Ne("ECDSA");const r=aE(t);if(e.algorithm.namedCurve!==r)throw Ne(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}nh(e,n)}function Nt(e,t,...n){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!_t(e.algorithm,"AES-GCM"))throw Ne("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Ne(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!_t(e.algorithm,"AES-KW"))throw Ne("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Ne(r,"algorithm.length");break}case"ECDH":{switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Ne("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!_t(e.algorithm,"PBKDF2"))throw Ne("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!_t(e.algorithm,"RSA-OAEP"))throw Ne("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Zr(e.algorithm.hash)!==r)throw Ne(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}nh(e,n)}function rh(e,t,...n){var r;if(n=n.filter(Boolean),n.length>2){const o=n.pop();e+=`one of type ${n.join(", ")}, or ${o}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&(r=t.constructor)!=null&&r.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const We=(e,...t)=>rh("Key must be ",e,...t);function oh(e,t,...n){return rh(`Key for the ${e} algorithm must be `,t,...n)}const sh=e=>Be(e)?!0:(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",Fe=["CryptoKey"];async function cE(e,t,n,r,o,s){if(!(t instanceof Uint8Array))throw new TypeError(We(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),i=await ce.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await ce.subtle.importKey("raw",t.subarray(0,a>>3),{hash:`SHA-${a<<1}`,name:"HMAC"},!1,["sign"]),u=Et(s,r,n,Xf(s.length<<3)),l=new Uint8Array((await ce.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d;try{d=sE(o,l)}catch{}if(!d)throw new Xr;let h;try{h=new Uint8Array(await ce.subtle.decrypt({iv:r,name:"AES-CBC"},i,n))}catch{}if(!h)throw new Xr;return h}async function uE(e,t,n,r,o,s){let a;t instanceof Uint8Array?a=await ce.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Nt(t,e,"decrypt"),a=t);try{return new Uint8Array(await ce.subtle.decrypt({additionalData:s,iv:r,name:"AES-GCM",tagLength:128},a,Et(n,o)))}catch{throw new Xr}}const ah=async(e,t,n,r,o,s)=>{if(!Be(t)&&!(t instanceof Uint8Array))throw new TypeError(We(t,...Fe,"Uint8Array"));if(!r)throw new B("JWE Initialization Vector missing");if(!o)throw new B("JWE Authentication Tag missing");switch(th(e,r),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&Yr(t,parseInt(e.slice(-3),10)),cE(e,t,n,r,o,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&Yr(t,parseInt(e.slice(1,4),10)),uE(e,t,n,r,o,s);default:throw new Se("Unsupported JWE Content Encryption Algorithm")}},Qa=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const r of t){const o=Object.keys(r);if(!n||n.size===0){n=new Set(o);continue}for(const s of o){if(n.has(s))return!1;n.add(s)}}return!0};function lE(e){return typeof e=="object"&&e!==null}function Je(e){if(!lE(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}const Qr=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ih(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ch(e,t,n){if(Be(e))return Nt(e,t,n),e;if(e instanceof Uint8Array)return ce.subtle.importKey("raw",e,"AES-KW",!0,[n]);throw new TypeError(We(e,...Fe,"Uint8Array"))}const ei=async(e,t,n)=>{const r=await ch(t,e,"wrapKey");ih(r,e);const o=await ce.subtle.importKey("raw",n,...Qr);return new Uint8Array(await ce.subtle.wrapKey("raw",o,r,"AES-KW"))},ti=async(e,t,n)=>{const r=await ch(t,e,"unwrapKey");ih(r,e);const o=await ce.subtle.unwrapKey("raw",n,r,"AES-KW",...Qr);return new Uint8Array(await ce.subtle.exportKey("raw",o))};async function uh(e,t,n,r,o=new Uint8Array(0),s=new Uint8Array(0)){if(!Be(e))throw new TypeError(We(e,...Fe));if(Nt(e,"ECDH"),!Be(t))throw new TypeError(We(t,...Fe));Nt(t,"ECDH","deriveBits");const a=Et(Ba($e.encode(n)),Ba(o),Ba(s),Ga(r));let i;e.algorithm.name==="X25519"?i=256:e.algorithm.name==="X448"?i=448:i=Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;const c=new Uint8Array(await ce.subtle.deriveBits({name:e.algorithm.name,public:e},t,i));return eE(c,r,a)}async function dE(e){if(!Be(e))throw new TypeError(We(e,...Fe));return ce.subtle.generateKey(e.algorithm,!0,["deriveBits"])}function lh(e){if(!Be(e))throw new TypeError(We(e,...Fe));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||e.algorithm.name==="X25519"||e.algorithm.name==="X448"}function fE(e){if(!(e instanceof Uint8Array)||e.length<8)throw new B("PBES2 Salt Input must be 8 or more octets")}function hE(e,t){if(e instanceof Uint8Array)return ce.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(Be(e))return Nt(e,t,"deriveBits","deriveKey"),e;throw new TypeError(We(e,...Fe,"Uint8Array"))}async function dh(e,t,n,r){fE(e);const o=Q0(t,e),s=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:o},i={length:s,name:"AES-KW"},c=await hE(r,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await ce.subtle.deriveBits(a,c,s));if(c.usages.includes("deriveKey"))return ce.subtle.deriveKey(a,c,i,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const pE=async(e,t,n,r=2048,o=Za(new Uint8Array(16)))=>{const s=await dh(o,e,r,t);return{encryptedKey:await ei(e.slice(-6),s,n),p2c:r,p2s:Ve(o)}},mE=async(e,t,n,r,o)=>{const s=await dh(o,e,r,t);return ti(e.slice(-6),s,n)};function eo(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Se(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const ni=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},gE=async(e,t,n)=>{if(!Be(t))throw new TypeError(We(t,...Fe));if(Nt(t,e,"encrypt","wrapKey"),ni(e,t),t.usages.includes("encrypt"))return new Uint8Array(await ce.subtle.encrypt(eo(e),t,n));if(t.usages.includes("wrapKey")){const r=await ce.subtle.importKey("raw",n,...Qr);return new Uint8Array(await ce.subtle.wrapKey("raw",r,t,eo(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},bE=async(e,t,n)=>{if(!Be(t))throw new TypeError(We(t,...Fe));if(Nt(t,e,"decrypt","unwrapKey"),ni(e,t),t.usages.includes("decrypt"))return new Uint8Array(await ce.subtle.decrypt(eo(e),t,n));if(t.usages.includes("unwrapKey")){const r=await ce.subtle.unwrapKey("raw",n,t,eo(e),...Qr);return new Uint8Array(await ce.subtle.exportKey("raw",r))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function gn(e){return Je(e)&&typeof e.kty=="string"}function yE(e){return e.kty!=="oct"&&typeof e.d=="string"}function wE(e){return e.kty!=="oct"&&typeof e.d>"u"}function vE(e){return gn(e)&&e.kty==="oct"&&typeof e.k=="string"}function EE(e){let t,n;switch(e.kty){case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Se('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Se('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"EdDSA":t={name:e.crv},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Se('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new Se('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}const fh=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:n}=EE(e),r=[t,e.ext??!1,e.key_ops??n],o={...e};return delete o.alg,delete o.use,ce.subtle.importKey("jwk",o,...r)},hh=e=>Oe(e);let bn,yn;const ph=e=>(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",to=async(e,t,n,r,o=!1)=>{let s=e.get(t);if(s!=null&&s[r])return s[r];const a=await fh({...n,alg:r});return o&&Object.freeze(t),s?s[r]=a:e.set(t,{[r]:a}),a},zt={normalizePublicKey:(e,t)=>{if(ph(e)){let n=e.export({format:"jwk"});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?hh(n.k):(yn||(yn=new WeakMap),to(yn,e,n,t))}return gn(e)?e.k?Oe(e.k):(yn||(yn=new WeakMap),to(yn,e,e,t,!0)):e},normalizePrivateKey:(e,t)=>{if(ph(e)){let n=e.export({format:"jwk"});return n.k?hh(n.k):(bn||(bn=new WeakMap),to(bn,e,n,t))}return gn(e)?e.k?Oe(e.k):(bn||(bn=new WeakMap),to(bn,e,e,t,!0)):e}};function ri(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new Se(`Unsupported JWE Algorithm: ${e}`)}}const wn=e=>Za(new Uint8Array(ri(e)>>3)),It=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));const r=e.indexOf(t[0],n);if(r===-1)return!1;const o=e.subarray(r,r+t.length);return o.length!==t.length?!1:o.every((s,a)=>s===t[a])||It(e,t,r+1)},mh=e=>{switch(!0){case It(e,[42,134,72,206,61,3,1,7]):return"P-256";case It(e,[43,129,4,0,34]):return"P-384";case It(e,[43,129,4,0,35]):return"P-521";case It(e,[43,101,110]):return"X25519";case It(e,[43,101,111]):return"X448";case It(e,[43,101,112]):return"Ed25519";case It(e,[43,101,113]):return"Ed448";default:throw new Se("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},_E=async(e,t,n,r,o)=>{let s,a;const i=new Uint8Array(atob(n.replace(e,"")).split("").map(c=>c.charCodeAt(0)));switch(r){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},a=["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},a=["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},a=["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},a=["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},a=["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},a=["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const c=mh(i);s=c.startsWith("P-")?{name:"ECDH",namedCurve:c}:{name:c},a=["deriveBits"];break}case"Ed25519":s={name:"Ed25519"},a=["sign"];break;case"EdDSA":s={name:mh(i)},a=["sign"];break;default:throw new Se('Invalid or unsupported "alg" (Algorithm) value')}return ce.subtle.importKey(t,i,s,!1,a)},SE=(e,t,n)=>_E(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t);async function xE(e,t,n){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return SE(e,t)}async function oi(e,t){if(!Je(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Oe(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new Se('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return fh({...e,alg:t});default:throw new Se('Unsupported "kty" (Key Type) Parameter value')}}const vn=e=>e==null?void 0:e[Symbol.toStringTag],si=(e,t,n)=>{var r,o;if(t.use!==void 0&&t.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(t.key_ops!==void 0&&((o=(r=t.key_ops).includes)==null?void 0:o.call(r,n))!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},AE=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&gn(t)){if(vE(t)&&si(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!sh(t))throw new TypeError(oh(e,t,...Fe,"Uint8Array",r?"JSON Web Key":null));if(t.type!=="secret")throw new TypeError(`${vn(t)} instances for symmetric algorithms must be of type "secret"`)}},RE=(e,t,n,r)=>{if(r&&gn(t))switch(n){case"sign":if(yE(t)&&si(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(wE(t)&&si(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!sh(t))throw new TypeError(oh(e,t,...Fe,r?"JSON Web Key":null));if(t.type==="secret")throw new TypeError(`${vn(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&t.type==="public")throw new TypeError(`${vn(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&t.type==="public")throw new TypeError(`${vn(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n==="verify"&&t.type==="private")throw new TypeError(`${vn(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n==="encrypt"&&t.type==="private")throw new TypeError(`${vn(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function gh(e,t,n,r){t.startsWith("HS")||t==="dir"||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?AE(t,n,r,e):RE(t,n,r,e)}const bh=gh.bind(void 0,!1),yh=gh.bind(void 0,!0);async function CE(e,t,n,r,o){if(!(n instanceof Uint8Array))throw new TypeError(We(n,"Uint8Array"));const s=parseInt(e.slice(1,4),10),a=await ce.subtle.importKey("raw",n.subarray(s>>3),"AES-CBC",!1,["encrypt"]),i=await ce.subtle.importKey("raw",n.subarray(0,s>>3),{hash:`SHA-${s<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await ce.subtle.encrypt({iv:r,name:"AES-CBC"},a,t)),u=Et(o,r,c,Xf(o.length<<3)),l=new Uint8Array((await ce.subtle.sign("HMAC",i,u)).slice(0,s>>3));return{ciphertext:c,tag:l,iv:r}}async function TE(e,t,n,r,o){let s;n instanceof Uint8Array?s=await ce.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Nt(n,e,"encrypt"),s=n);const a=new Uint8Array(await ce.subtle.encrypt({additionalData:o,iv:r,name:"AES-GCM",tagLength:128},s,t)),i=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:i,iv:r}}const wh=async(e,t,n,r,o)=>{if(!Be(n)&&!(n instanceof Uint8Array))throw new TypeError(We(n,...Fe,"Uint8Array"));switch(r?th(e,r):r=oE(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&Yr(n,parseInt(e.slice(-3),10)),CE(e,t,n,r,o);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&Yr(n,parseInt(e.slice(1,4),10)),TE(e,t,n,r,o);default:throw new Se("Unsupported JWE Content Encryption Algorithm")}};async function PE(e,t,n,r){const o=e.slice(0,7),s=await wh(o,n,t,r,new Uint8Array(0));return{encryptedKey:s.ciphertext,iv:Ve(s.iv),tag:Ve(s.tag)}}async function OE(e,t,n,r,o){const s=e.slice(0,7);return ah(s,t,n,r,o,new Uint8Array(0))}async function kE(e,t,n,r,o){var s;switch(bh(e,t,"decrypt"),t=await((s=zt.normalizePrivateKey)==null?void 0:s.call(zt,t,e))||t,e){case"dir":{if(n!==void 0)throw new B("Encountered unexpected JWE Encrypted Key");return t}case"ECDH-ES":if(n!==void 0)throw new B("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Je(r.epk))throw new B('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!lh(t))throw new Se("ECDH with the provided key is not allowed or not supported by your javascript runtime");const a=await oi(r.epk,e);let i,c;if(r.apu!==void 0){if(typeof r.apu!="string")throw new B('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=Oe(r.apu)}catch{throw new B("Failed to base64url decode the apu")}}if(r.apv!==void 0){if(typeof r.apv!="string")throw new B('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{c=Oe(r.apv)}catch{throw new B("Failed to base64url decode the apv")}}const u=await uh(a,t,e==="ECDH-ES"?r.enc:e,e==="ECDH-ES"?ri(r.enc):parseInt(e.slice(-5,-2),10),i,c);if(e==="ECDH-ES")return u;if(n===void 0)throw new B("JWE Encrypted Key missing");return ti(e.slice(-6),u,n)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(n===void 0)throw new B("JWE Encrypted Key missing");return bE(e,t,n)}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(n===void 0)throw new B("JWE Encrypted Key missing");if(typeof r.p2c!="number")throw new B('JOSE Header "p2c" (PBES2 Count) missing or invalid');const a=(o==null?void 0:o.maxPBES2Count)||1e4;if(r.p2c>a)throw new B('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if(typeof r.p2s!="string")throw new B('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let i;try{i=Oe(r.p2s)}catch{throw new B("Failed to base64url decode the p2s")}return mE(e,t,n,r.p2c,i)}case"A128KW":case"A192KW":case"A256KW":{if(n===void 0)throw new B("JWE Encrypted Key missing");return ti(e,t,n)}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(n===void 0)throw new B("JWE Encrypted Key missing");if(typeof r.iv!="string")throw new B('JOSE Header "iv" (Initialization Vector) missing or invalid');if(typeof r.tag!="string")throw new B('JOSE Header "tag" (Authentication Tag) missing or invalid');let a;try{a=Oe(r.iv)}catch{throw new B("Failed to base64url decode the iv")}let i;try{i=Oe(r.tag)}catch{throw new B("Failed to base64url decode the tag")}return OE(e,t,n,a,i)}default:throw new Se('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function ai(e,t,n,r,o){if(o.crit!==void 0&&(r==null?void 0:r.crit)===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;n!==void 0?s=new Map([...Object.entries(n),...t.entries()]):s=t;for(const a of r.crit){if(!s.has(a))throw new Se(`Extension Header Parameter "${a}" is not recognized`);if(o[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(s.get(a)&&r[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(r.crit)}const ii=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(n=>typeof n!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function NE(e,t,n){if(!Je(e))throw new B("Flattened JWE must be an object");if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new B("JOSE Header missing");if(e.iv!==void 0&&typeof e.iv!="string")throw new B("JWE Initialization Vector incorrect type");if(typeof e.ciphertext!="string")throw new B("JWE Ciphertext missing or incorrect type");if(e.tag!==void 0&&typeof e.tag!="string")throw new B("JWE Authentication Tag incorrect type");if(e.protected!==void 0&&typeof e.protected!="string")throw new B("JWE Protected Header incorrect type");if(e.encrypted_key!==void 0&&typeof e.encrypted_key!="string")throw new B("JWE Encrypted Key incorrect type");if(e.aad!==void 0&&typeof e.aad!="string")throw new B("JWE AAD incorrect type");if(e.header!==void 0&&!Je(e.header))throw new B("JWE Shared Unprotected Header incorrect type");if(e.unprotected!==void 0&&!Je(e.unprotected))throw new B("JWE Per-Recipient Unprotected Header incorrect type");let r;if(e.protected)try{const f=Oe(e.protected);r=JSON.parse(qt.decode(f))}catch{throw new B("JWE Protected Header is invalid")}if(!Qa(r,e.header,e.unprotected))throw new B("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...r,...e.header,...e.unprotected};if(ai(B,new Map,n==null?void 0:n.crit,r,o),o.zip!==void 0)throw new Se('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:s,enc:a}=o;if(typeof s!="string"||!s)throw new B("missing JWE Algorithm (alg) in JWE Header");if(typeof a!="string"||!a)throw new B("missing JWE Encryption Algorithm (enc) in JWE Header");const i=n&&ii("keyManagementAlgorithms",n.keyManagementAlgorithms),c=n&&ii("contentEncryptionAlgorithms",n.contentEncryptionAlgorithms);if(i&&!i.has(s)||!i&&s.startsWith("PBES2"))throw new Jr('"alg" (Algorithm) Header Parameter value not allowed');if(c&&!c.has(a))throw new Jr('"enc" (Encryption Algorithm) Header Parameter value not allowed');let u;if(e.encrypted_key!==void 0)try{u=Oe(e.encrypted_key)}catch{throw new B("Failed to base64url decode the encrypted_key")}let l=!1;typeof t=="function"&&(t=await t(r,e),l=!0);let d;try{d=await kE(s,t,u,o,n)}catch(f){if(f instanceof TypeError||f instanceof B||f instanceof Se)throw f;d=wn(a)}let h,m;if(e.iv!==void 0)try{h=Oe(e.iv)}catch{throw new B("Failed to base64url decode the iv")}if(e.tag!==void 0)try{m=Oe(e.tag)}catch{throw new B("Failed to base64url decode the tag")}const _=$e.encode(e.protected??"");let y;e.aad!==void 0?y=Et(_,$e.encode("."),$e.encode(e.aad)):y=_;let g;try{g=Oe(e.ciphertext)}catch{throw new B("Failed to base64url decode the ciphertext")}const b={plaintext:await ah(a,d,g,h,m,y)};if(e.protected!==void 0&&(b.protectedHeader=r),e.aad!==void 0)try{b.additionalAuthenticatedData=Oe(e.aad)}catch{throw new B("Failed to base64url decode the aad")}return e.unprotected!==void 0&&(b.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}async function IE(e,t,n){if(e instanceof Uint8Array&&(e=qt.decode(e)),typeof e!="string")throw new B("Compact JWE must be a string or Uint8Array");const{0:r,1:o,2:s,3:a,4:i,length:c}=e.split(".");if(c!==5)throw new B("Invalid Compact JWE");const u=await NE({ciphertext:a,iv:s||void 0,protected:r,tag:i||void 0,encrypted_key:o||void 0},t,n),l={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return typeof t=="function"?{...l,key:u.key}:l}const DE=Symbol(),ME=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:Ve(e)};if(!Be(e))throw new TypeError(We(e,...Fe,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:n,alg:r,use:o,...s}=await ce.subtle.exportKey("jwk",e);return s};async function LE(e){return ME(e)}async function jE(e,t,n,r,o={}){var c;let s,a,i;switch(bh(e,n,"encrypt"),n=await((c=zt.normalizePublicKey)==null?void 0:c.call(zt,n,e))||n,e){case"dir":{i=n;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!lh(n))throw new Se("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:u,apv:l}=o;let{epk:d}=o;d||(d=(await dE(n)).privateKey);const{x:h,y:m,crv:_,kty:y}=await LE(d),g=await uh(n,d,e==="ECDH-ES"?t:e,e==="ECDH-ES"?ri(t):parseInt(e.slice(-5,-2),10),u,l);if(a={epk:{x:h,crv:_,kty:y}},y==="EC"&&(a.epk.y=m),u&&(a.apu=Ve(u)),l&&(a.apv=Ve(l)),e==="ECDH-ES"){i=g;break}i=r||wn(t);const p=e.slice(-6);s=await ei(p,g,i);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{i=r||wn(t),s=await gE(e,n,i);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{i=r||wn(t);const{p2c:u,p2s:l}=o;({encryptedKey:s,...a}=await pE(e,n,i,u,l));break}case"A128KW":case"A192KW":case"A256KW":{i=r||wn(t),s=await ei(e,n,i);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{i=r||wn(t);const{iv:u}=o;({encryptedKey:s,...a}=await PE(e,n,i,u));break}default:throw new Se('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:i,encryptedKey:s,parameters:a}}class HE{constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=t}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setSharedUnprotectedHeader(t){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=t,this}setUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}setAdditionalAuthenticatedData(t){return this._aad=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}async encrypt(t,n){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new B("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Qa(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new B("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(ai(B,new Map,n==null?void 0:n.crit,this._protectedHeader,r),r.zip!==void 0)throw new Se('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:o,enc:s}=r;if(typeof o!="string"||!o)throw new B('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof s!="string"||!s)throw new B('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let a;if(this._cek&&(o==="dir"||o==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${o}`);let i;{let y;({cek:i,encryptedKey:a,parameters:y}=await jE(o,s,t,this._cek,this._keyManagementParameters)),y&&(n&&DE in n?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...y}:this.setUnprotectedHeader(y):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...y}:this.setProtectedHeader(y))}let c,u,l;this._protectedHeader?u=$e.encode(Ve(JSON.stringify(this._protectedHeader))):u=$e.encode(""),this._aad?(l=Ve(this._aad),c=Et(u,$e.encode("."),$e.encode(l))):c=u;const{ciphertext:d,tag:h,iv:m}=await wh(s,this._plaintext,i,this._iv,c),_={ciphertext:Ve(d)};return m&&(_.iv=Ve(m)),h&&(_.tag=Ve(h)),a&&(_.encrypted_key=Ve(a)),l&&(_.aad=l),this._protectedHeader&&(_.protected=qt.decode(u)),this._sharedUnprotectedHeader&&(_.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(_.header=this._unprotectedHeader),_}}function UE(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:t.name};default:throw new Se(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function $E(e,t,n){if(t=await zt.normalizePublicKey(t,e),Be(t))return iE(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(We(t,...Fe));return ce.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(We(t,...Fe,"Uint8Array","JSON Web Key"))}const WE=async(e,t,n,r)=>{const o=await $E(e,t,"verify");ni(e,o);const s=UE(e,o.algorithm);try{return await ce.subtle.verify(s,o,n,r)}catch{return!1}};async function vh(e,t,n){if(!Je(e))throw new ke("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new ke('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new ke("JWS Protected Header incorrect type");if(e.payload===void 0)throw new ke("JWS Payload missing");if(typeof e.signature!="string")throw new ke("JWS Signature missing or incorrect type");if(e.header!==void 0&&!Je(e.header))throw new ke("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const y=Oe(e.protected);r=JSON.parse(qt.decode(y))}catch{throw new ke("JWS Protected Header is invalid")}if(!Qa(r,e.header))throw new ke("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...r,...e.header},s=ai(ke,new Map([["b64",!0]]),n==null?void 0:n.crit,r,o);let a=!0;if(s.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new ke('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=o;if(typeof i!="string"||!i)throw new ke('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&ii("algorithms",n.algorithms);if(c&&!c.has(i))throw new Jr('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new ke("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new ke("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof t=="function"?(t=await t(r,e),u=!0,yh(i,t,"verify"),gn(t)&&(t=await oi(t,i))):yh(i,t,"verify");const l=Et($e.encode(e.protected??""),$e.encode("."),typeof e.payload=="string"?$e.encode(e.payload):e.payload);let d;try{d=Oe(e.signature)}catch{throw new ke("Failed to base64url decode the signature")}if(!await WE(i,t,d,l))throw new Qf;let m;if(a)try{m=Oe(e.payload)}catch{throw new ke("Failed to base64url decode the payload")}else typeof e.payload=="string"?m=$e.encode(e.payload):m=e.payload;const _={payload:m};return e.protected!==void 0&&(_.protectedHeader=r),e.header!==void 0&&(_.unprotectedHeader=e.header),u?{..._,key:t}:_}async function FE(e,t,n){if(e instanceof Uint8Array&&(e=qt.decode(e)),typeof e!="string")throw new ke("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:s,length:a}=e.split(".");if(a!==3)throw new ke("Invalid Compact JWS");const i=await vh({payload:o,protected:r,signature:s},t,n),c={payload:i.payload,protectedHeader:i.protectedHeader};return typeof t=="function"?{...c,key:i.key}:c}const Dt=e=>Math.floor(e.getTime()/1e3),Eh=60,_h=Eh*60,ci=_h*24,KE=ci*7,qE=ci*365.25,zE=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Yn=e=>{const t=zE.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]),r=t[3].toLowerCase();let o;switch(r){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(n*Eh);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(n*_h);break;case"day":case"days":case"d":o=Math.round(n*ci);break;case"week":case"weeks":case"w":o=Math.round(n*KE);break;default:o=Math.round(n*qE);break}return t[1]==="-"||t[4]==="ago"?-o:o},Sh=e=>e.toLowerCase().replace(/^application\//,""),GE=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,xh=(e,t,n={})=>{let r;try{r=JSON.parse(qt.decode(t))}catch{}if(!Je(r))throw new Ja("JWT Claims Set must be a top-level JSON object");const{typ:o}=n;if(o&&(typeof e.typ!="string"||Sh(e.typ)!==Sh(o)))throw new qe('unexpected "typ" JWT header value',r,"typ","check_failed");const{requiredClaims:s=[],issuer:a,subject:i,audience:c,maxTokenAge:u}=n,l=[...s];u!==void 0&&l.push("iat"),c!==void 0&&l.push("aud"),i!==void 0&&l.push("sub"),a!==void 0&&l.push("iss");for(const _ of new Set(l.reverse()))if(!(_ in r))throw new qe(`missing required "${_}" claim`,r,_,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(r.iss))throw new qe('unexpected "iss" claim value',r,"iss","check_failed");if(i&&r.sub!==i)throw new qe('unexpected "sub" claim value',r,"sub","check_failed");if(c&&!GE(r.aud,typeof c=="string"?[c]:c))throw new qe('unexpected "aud" claim value',r,"aud","check_failed");let d;switch(typeof n.clockTolerance){case"string":d=Yn(n.clockTolerance);break;case"number":d=n.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=n,m=Dt(h||new Date);if((r.iat!==void 0||u)&&typeof r.iat!="number")throw new qe('"iat" claim must be a number',r,"iat","invalid");if(r.nbf!==void 0){if(typeof r.nbf!="number")throw new qe('"nbf" claim must be a number',r,"nbf","invalid");if(r.nbf>m+d)throw new qe('"nbf" claim timestamp check failed',r,"nbf","check_failed")}if(r.exp!==void 0){if(typeof r.exp!="number")throw new qe('"exp" claim must be a number',r,"exp","invalid");if(r.exp<=m-d)throw new Va('"exp" claim timestamp check failed',r,"exp","check_failed")}if(u){const _=m-r.iat,y=typeof u=="number"?u:Yn(u);if(_-d>y)throw new Va('"iat" claim timestamp check failed (too far in the past)',r,"iat","check_failed");if(_<0-d)throw new qe('"iat" claim timestamp check failed (it should be in the past)',r,"iat","check_failed")}return r};async function BE(e,t,n){var a;const r=await FE(e,t,n);if((a=r.protectedHeader.crit)!=null&&a.includes("b64")&&r.protectedHeader.b64===!1)throw new Ja("JWTs MUST NOT use unencoded payload");const s={payload:xh(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t=="function"?{...s,key:r.key}:s}async function VE(e,t,n){const r=await IE(e,t,n),o=xh(r.protectedHeader,r.plaintext,n),{protectedHeader:s}=r;if(s.iss!==void 0&&s.iss!==o.iss)throw new qe('replicated "iss" claim header parameter mismatch',o,"iss","mismatch");if(s.sub!==void 0&&s.sub!==o.sub)throw new qe('replicated "sub" claim header parameter mismatch',o,"sub","mismatch");if(s.aud!==void 0&&JSON.stringify(s.aud)!==JSON.stringify(o.aud))throw new qe('replicated "aud" claim header parameter mismatch',o,"aud","mismatch");const a={payload:o,protectedHeader:s};return typeof t=="function"?{...a,key:r.key}:a}class JE{constructor(t){this._flattened=new HE(t)}setContentEncryptionKey(t){return this._flattened.setContentEncryptionKey(t),this}setInitializationVector(t){return this._flattened.setInitializationVector(t),this}setProtectedHeader(t){return this._flattened.setProtectedHeader(t),this}setKeyManagementParameters(t){return this._flattened.setKeyManagementParameters(t),this}async encrypt(t,n){const r=await this._flattened.encrypt(t,n);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}function Gt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}class XE{constructor(t={}){if(!Je(t))throw new TypeError("JWT Claims Set MUST be an object");this._payload=t}setIssuer(t){return this._payload={...this._payload,iss:t},this}setSubject(t){return this._payload={...this._payload,sub:t},this}setAudience(t){return this._payload={...this._payload,aud:t},this}setJti(t){return this._payload={...this._payload,jti:t},this}setNotBefore(t){return typeof t=="number"?this._payload={...this._payload,nbf:Gt("setNotBefore",t)}:t instanceof Date?this._payload={...this._payload,nbf:Gt("setNotBefore",Dt(t))}:this._payload={...this._payload,nbf:Dt(new Date)+Yn(t)},this}setExpirationTime(t){return typeof t=="number"?this._payload={...this._payload,exp:Gt("setExpirationTime",t)}:t instanceof Date?this._payload={...this._payload,exp:Gt("setExpirationTime",Dt(t))}:this._payload={...this._payload,exp:Dt(new Date)+Yn(t)},this}setIssuedAt(t){return typeof t>"u"?this._payload={...this._payload,iat:Dt(new Date)}:t instanceof Date?this._payload={...this._payload,iat:Gt("setIssuedAt",Dt(t))}:typeof t=="string"?this._payload={...this._payload,iat:Gt("setIssuedAt",Dt(new Date)+Yn(t))}:this._payload={...this._payload,iat:Gt("setIssuedAt",t)},this}}class YE extends XE{setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(t,n){const r=new JE($e.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(t,n)}}function ZE(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Se('Unsupported "alg" value for a JSON Web Key Set')}}function QE(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(e_)}function e_(e){return Je(e)}function Ah(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}class t_{constructor(t){if(this._cached=new WeakMap,!QE(t))throw new Xa("JSON Web Key Set malformed");this._jwks=Ah(t)}async getKey(t,n){const{alg:r,kid:o}={...t,...n==null?void 0:n.header},s=ZE(r),a=this._jwks.keys.filter(u=>{let l=s===u.kty;if(l&&typeof o=="string"&&(l=o===u.kid),l&&typeof u.alg=="string"&&(l=r===u.alg),l&&typeof u.use=="string"&&(l=u.use==="sig"),l&&Array.isArray(u.key_ops)&&(l=u.key_ops.includes("verify")),l)switch(r){case"ES256":l=u.crv==="P-256";break;case"ES256K":l=u.crv==="secp256k1";break;case"ES384":l=u.crv==="P-384";break;case"ES512":l=u.crv==="P-521";break;case"Ed25519":l=u.crv==="Ed25519";break;case"EdDSA":l=u.crv==="Ed25519"||u.crv==="Ed448";break}return l}),{0:i,length:c}=a;if(c===0)throw new Ya;if(c!==1){const u=new Yf,{_cached:l}=this;throw u[Symbol.asyncIterator]=async function*(){for(const d of a)try{yield await Rh(l,d,r)}catch{}},u}return Rh(this._cached,i,r)}}async function Rh(e,t,n){const r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){const o=await oi({...t,ext:!0},n);if(o instanceof Uint8Array||o.type!=="public")throw new Xa("JSON Web Key Set members must be public keys");r[n]=o}return r[n]}function Ch(e){const t=new t_(e),n=async(r,o)=>t.getKey(r,o);return Object.defineProperties(n,{jwks:{value:()=>Ah(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),n}const n_=async(e,t,n)=>{let r,o,s=!1;typeof AbortController=="function"&&(r=new AbortController,o=setTimeout(()=>{s=!0,r.abort()},t));const a=await fetch(e.href,{signal:r?r.signal:void 0,redirect:"manual",headers:n.headers}).catch(i=>{throw s?new Zf:i});if(o!==void 0&&clearTimeout(o),a.status!==200)throw new Me("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch{throw new Me("Failed to parse the JSON Web Key Set HTTP response as JSON")}};function r_(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}let ui;(typeof navigator>"u"||!((op=(fo=navigator.userAgent)==null?void 0:fo.startsWith)!=null&&op.call(fo,"Mozilla/5.0 ")))&&(ui="jose/v5.10.0");const no=Symbol();function o_(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!Je(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Je))}class s_{constructor(t,n){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(t.href),this._options={agent:n==null?void 0:n.agent,headers:n==null?void 0:n.headers},this._timeoutDuration=typeof(n==null?void 0:n.timeoutDuration)=="number"?n==null?void 0:n.timeoutDuration:5e3,this._cooldownDuration=typeof(n==null?void 0:n.cooldownDuration)=="number"?n==null?void 0:n.cooldownDuration:3e4,this._cacheMaxAge=typeof(n==null?void 0:n.cacheMaxAge)=="number"?n==null?void 0:n.cacheMaxAge:6e5,(n==null?void 0:n[no])!==void 0&&(this._cache=n==null?void 0:n[no],o_(n==null?void 0:n[no],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=Ch(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cooldownDuration:!1}fresh(){return typeof this._jwksTimestamp=="number"?Date.now()<this._jwksTimestamp+this._cacheMaxAge:!1}async getKey(t,n){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(t,n)}catch(r){if(r instanceof Ya&&this.coolingDown()===!1)return await this.reload(),this._local(t,n);throw r}}async reload(){this._pendingFetch&&r_()&&(this._pendingFetch=void 0);const t=new Headers(this._options.headers);ui&&!t.has("User-Agent")&&(t.set("User-Agent",ui),this._options.headers=Object.fromEntries(t.entries())),this._pendingFetch||(this._pendingFetch=n_(this._url,this._timeoutDuration,this._options).then(n=>{this._local=Ch(n),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=n),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(n=>{throw this._pendingFetch=void 0,n})),await this._pendingFetch}}function a_(e,t){const n=new s_(e,t),r=async(o,s)=>n.getKey(o,s);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!n._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>{var o;return(o=n._local)==null?void 0:o.jwks()},enumerable:!0,configurable:!1,writable:!1}}),r}const i_=Ve;let li;(typeof navigator>"u"||!((sp=(ho=navigator.userAgent)==null?void 0:ho.startsWith)!=null&&sp.call(ho,"Mozilla/5.0 ")))&&(li="oauth4webapi/v3.5.3");function Zn(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}const Ze="ERR_INVALID_ARG_VALUE",Xe="ERR_INVALID_ARG_TYPE";function Ee(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const Mt=Symbol(),c_=Symbol(),u_=Symbol(),Bt=Symbol(),di=Symbol(),l_=new TextEncoder,d_=new TextDecoder;function En(e){return typeof e=="string"?l_.encode(e):d_.decode(e)}let fi;Uint8Array.prototype.toBase64?fi=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):fi=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r<t.byteLength;r+=32768)n.push(String.fromCharCode.apply(null,t.subarray(r,r+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};let hi;Uint8Array.fromBase64?hi=e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(t){throw Ee("The input to be decoded is not correctly encoded.",Ze,t)}}:hi=e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}catch(t){throw Ee("The input to be decoded is not correctly encoded.",Ze,t)}};function Vt(e){return typeof e=="string"?hi(e):fi(e)}class Qe extends Error{constructor(n,r){var o;super(n,r);Le(this,"code");this.name=this.constructor.name,this.code=dS,(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}class f_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"code");this.name=this.constructor.name,r!=null&&r.code&&(this.code=r==null?void 0:r.code),(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}function ee(e,t,n){return new f_(e,{code:t,cause:n})}function h_(e,t){if(!(e instanceof CryptoKey))throw Ee(`${t} must be a CryptoKey`,Xe)}function p_(e,t){if(h_(e,t),e.type!=="private")throw Ee(`${t} must be a private CryptoKey`,Ze)}function ro(e){return!(e===null||typeof e!="object"||Array.isArray(e))}function pi(e){Zn(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e??{});if(li&&!t.has("user-agent")&&t.set("user-agent",li),t.has("authorization"))throw Ee('"options.headers" must not include the "authorization" header name',Ze);return t}function Th(e){if(typeof e=="function"&&(e=e()),!(e instanceof AbortSignal))throw Ee('"options.signal" must return or be an instance of AbortSignal',Xe);return e}function Ph(e){return e.includes("//")?e.replace("//","/"):e}function m_(e,t){return e.pathname==="/"?e.pathname=t:e.pathname=Ph(`${t}/${e.pathname}`),e}function g_(e,t){return e.pathname=Ph(`${e.pathname}/${t}`),e}async function b_(e,t,n,r){if(!(e instanceof URL))throw Ee(`"${t}" must be an instance of URL`,Xe);Nh(e,(r==null?void 0:r[Mt])!==!0);const o=n(new URL(e.href)),s=pi(r==null?void 0:r.headers);return s.set("accept","application/json"),((r==null?void 0:r[Bt])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:r!=null&&r.signal?Th(r.signal):void 0})}async function y_(e,t){return b_(e,"issuerIdentifier",n=>{switch(t==null?void 0:t.algorithm){case void 0:case"oidc":g_(n,".well-known/openid-configuration");break;case"oauth2":m_(n,".well-known/oauth-authorization-server");break;default:throw Ee('"options.algorithm" must be "oidc" (default), or "oauth2"',Ze)}return n},t)}function Qn(e,t,n,r,o){try{if(typeof e!="number"||!Number.isFinite(e))throw Ee(`${n} must be a number`,Xe,o);if(e>0)return;throw Ee(`${n} must be a positive number`,Ze,o)}catch(s){throw r?ee(s.message,r,o):s}}function Ie(e,t,n,r){try{if(typeof e!="string")throw Ee(`${t} must be a string`,Xe,r);if(e.length===0)throw Ee(`${t} must not be empty`,Ze,r)}catch(o){throw n?ee(o.message,n,r):o}}async function w_(e,t){const n=e;if(!(n instanceof URL)&&n!==Kh)throw Ee('"expectedIssuerIdentifier" must be an instance of URL',Xe);if(!Zn(t,Response))throw Ee('"response" must be an instance of Response',Xe);if(t.status!==200)throw ee('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Wh,t);ao(t);const r=await xi(t);if(Ie(r.issuer,'"response" body "issuer" property',he,{body:r}),n!==Kh&&new URL(r.issuer).href!==n.href)throw ee('"response" body "issuer" property does not match the expected value',gS,{expected:n.href,body:r,attribute:"issuer"});return r}function Oh(e){E_(e,"application/json")}function v_(e,...t){let n='"response" content-type must be ';if(t.length>2){const r=t.pop();n+=`${t.join(", ")}, or ${r}`}else t.length===2?n+=`${t[0]} or ${t[1]}`:n+=t[0];return ee(n,hS,e)}function E_(e,t){if(X_(e)!==t)throw v_(e,t)}function oo(){return Vt(crypto.getRandomValues(new Uint8Array(32)))}function __(){return oo()}function S_(){return oo()}function x_(){return oo()}async function A_(e){return Ie(e,"codeVerifier"),Vt(await crypto.subtle.digest("SHA-256",En(e)))}function R_(e){return e instanceof CryptoKey?{key:e}:(e==null?void 0:e.key)instanceof CryptoKey?(e.kid!==void 0&&Ie(e.kid,'"kid"'),{key:e.key,kid:e.kid}):{}}function C_(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new Qe("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}function T_(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new Qe("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}function P_(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new Qe("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}function O_(e){switch(e.algorithm.name){case"RSA-PSS":return C_(e);case"RSASSA-PKCS1-v1_5":return T_(e);case"ECDSA":return P_(e);case"Ed25519":case"EdDSA":return"Ed25519";default:throw new Qe("unsupported CryptoKey algorithm name",{cause:e})}}function mi(e){const t=e==null?void 0:e[c_];return typeof t=="number"&&Number.isFinite(t)?t:0}function kh(e){const t=e==null?void 0:e[u_];return typeof t=="number"&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function gi(){return Math.floor(Date.now()/1e3)}function Jt(e){if(typeof e!="object"||e===null)throw Ee('"as" must be an object',Xe);Ie(e.issuer,'"as.issuer"')}function Xt(e){if(typeof e!="object"||e===null)throw Ee('"client" must be an object',Xe);Ie(e.client_id,'"client.client_id"')}function k_(e){return Ie(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function N_(e,t){const n=gi()+mi(t);return{jti:oo(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}function I_(e,t){const{key:n,kid:r}=R_(e);return p_(n,'"clientPrivateKey.key"'),async(o,s,a,i)=>{const c={alg:O_(n),kid:r},u=N_(o,s);a.set("client_id",s.client_id),a.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.set("client_assertion",await D_(c,u,n))}}async function D_(e,t,n){if(!n.usages.includes("sign"))throw Ee('CryptoKey instances used for signing assertions must include "sign" in their "usages"',Ze);const r=`${Vt(En(JSON.stringify(e)))}.${Vt(En(JSON.stringify(t)))}`,o=Vt(await crypto.subtle.sign(_S(n),n,En(r)));return`${r}.${o}`}const M_=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function Nh(e,t){if(t&&e.protocol!=="https:")throw ee("only requests to HTTPS are allowed",pS,e);if(e.protocol!=="https:"&&e.protocol!=="http:")throw ee("only HTTP and HTTPS requests are allowed",mS,e)}function Ih(e,t,n,r){let o;if(typeof e!="string"||!(o=M_(e)))throw ee(`authorization server metadata does not contain a valid ${n?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,e===void 0?bS:yS,{attribute:n?`mtls_endpoint_aliases.${t}`:t});return Nh(o,r),o}function Dh(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Ih(e.mtls_endpoint_aliases[t],t,n,r):Ih(e[t],t,n,r)}async function L_(e,t,n,r,o){var u;Jt(e),Xt(t);const s=Dh(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,(o==null?void 0:o[Mt])!==!0),a=new URLSearchParams(r);a.set("client_id",t.client_id);const i=pi(o==null?void 0:o.headers);i.set("accept","application/json"),(o==null?void 0:o.DPoP)!==void 0&&(Lh(o.DPoP),await o.DPoP.addProof(s,i,"POST"));const c=await jh(e,t,n,s,a,i,o);return(u=o==null?void 0:o.DPoP)==null||u.cacheNonce(c),c}class j_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"cause");Le(this,"code");Le(this,"error");Le(this,"status");Le(this,"error_description");Le(this,"response");this.name=this.constructor.name,this.code=lS,this.cause=r.cause,this.error=r.cause.error,this.status=r.response.status,this.error_description=r.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:r.response}),(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}class H_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"cause");Le(this,"code");Le(this,"error");Le(this,"error_description");this.name=this.constructor.name,this.code=fS,this.cause=r.cause,this.error=r.cause.get("error"),this.error_description=r.cause.get("error_description")??void 0,(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}class U_ extends Error{constructor(n,r){var o;super(n,r);Le(this,"cause");Le(this,"code");Le(this,"response");Le(this,"status");this.name=this.constructor.name,this.code=uS,this.cause=r.cause,this.status=r.response.status,this.response=r.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)==null||o.call(Error,this,this.constructor)}}const so="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",$_="[a-zA-Z0-9\\-\\._\\~\\+\\/]+[=]{0,2}",W_="("+so+")\\s*=\\s*"+'"((?:[^"\\\\]|\\\\.)*)"',F_="("+so+")\\s*=\\s*("+so+")",K_=new RegExp("^[,\\s]*("+so+")\\s(.*)"),q_=new RegExp("^[,\\s]*"+W_+"[,\\s]*(.*)"),z_=new RegExp("^[,\\s]*"+F_+"[,\\s]*(.*)"),G_=new RegExp("^("+$_+")(?:$|[,\\s])(.*)");function B_(e){if(!Zn(e,Response))throw Ee('"response" must be an instance of Response',Xe);const t=e.headers.get("www-authenticate");if(t===null)return;const n=[];let r=t;for(;r;){let o=r.match(K_);const s=o==null?void 0:o[1].toLowerCase();if(r=o==null?void 0:o["2"],!s)return;const a={};let i;for(;r;){let u,l;if(o=r.match(q_)){if([,u,l,r]=o,l.includes("\\"))try{l=JSON.parse(`"${l}"`)}catch{}a[u.toLowerCase()]=l;continue}if(o=r.match(z_)){[,u,l,r]=o,a[u.toLowerCase()]=l;continue}if(o=r.match(G_)){if(Object.keys(a).length)break;[,i,r]=o;break}return}const c={scheme:s,parameters:a};i&&(c.token68=i),n.push(c)}if(n.length)return n}async function V_(e,t,n){if(Jt(e),Xt(t),!Zn(n,Response))throw Ee('"response" must be an instance of Response',Xe);$h(n),await Mh(n,201,"Pushed Authorization Request Endpoint"),ao(n);const r=await xi(n);Ie(r.request_uri,'"response" body "request_uri" property',he,{body:r});let o=typeof r.expires_in!="number"?parseFloat(r.expires_in):r.expires_in;return Qn(o,!1,'"response" body "expires_in" property',he,{body:r}),r.expires_in=o,r}async function J_(e){if(e.status>399&&e.status<500){ao(e),Oh(e);try{const t=await e.clone().json();if(ro(t)&&typeof t.error=="string"&&t.error.length)return t}catch{}}}async function Mh(e,t,n){var r;if(e.status!==t){let o;throw(o=await J_(e))?(await((r=e.body)==null?void 0:r.cancel()),new j_("server responded with an error in the response body",{cause:o,response:e})):ee(`"response" is not a conform ${n} response (unexpected HTTP status code)`,Wh,e)}}function Lh(e){if(!wi.has(e))throw Ee('"options.DPoP" is not a valid DPoPHandle',Ze)}function X_(e){var t;return(t=e.headers.get("content-type"))==null?void 0:t.split(";")[0]}async function jh(e,t,n,r,o,s,a){return await n(e,t,o,s),s.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((a==null?void 0:a[Bt])||fetch)(r.href,{body:o,headers:Object.fromEntries(s.entries()),method:"POST",redirect:"manual",signal:a!=null&&a.signal?Th(a.signal):void 0})}async function bi(e,t,n,r,o,s){var u;const a=Dh(e,"token_endpoint",t.use_mtls_endpoint_aliases,(s==null?void 0:s[Mt])!==!0);o.set("grant_type",r);const i=pi(s==null?void 0:s.headers);i.set("accept","application/json"),(s==null?void 0:s.DPoP)!==void 0&&(Lh(s.DPoP),await s.DPoP.addProof(a,i,"POST"));const c=await jh(e,t,n,a,o,i,s);return(u=s==null?void 0:s.DPoP)==null||u.cacheNonce(c),c}async function Y_(e,t,n,r,o){Jt(e),Xt(t),Ie(r,'"refreshToken"');const s=new URLSearchParams(o==null?void 0:o.additionalParameters);return s.set("refresh_token",r),bi(e,t,n,"refresh_token",s,o)}const Hh=new WeakMap,Z_=new WeakMap;function Uh(e){if(!e.id_token)return;const t=Hh.get(e);if(!t)throw Ee('"ref" was already garbage collected or did not resolve from the proper sources',Ze);return t}async function yi(e,t,n,r,o){if(Jt(e),Xt(t),!Zn(n,Response))throw Ee('"response" must be an instance of Response',Xe);$h(n),await Mh(n,200,"Token Endpoint"),ao(n);const s=await xi(n);if(Ie(s.access_token,'"response" body "access_token" property',he,{body:s}),Ie(s.token_type,'"response" body "token_type" property',he,{body:s}),s.token_type=s.token_type.toLowerCase(),s.token_type!=="dpop"&&s.token_type!=="bearer")throw new Qe("unsupported `token_type` value",{cause:{body:s}});if(s.expires_in!==void 0){let a=typeof s.expires_in!="number"?parseFloat(s.expires_in):s.expires_in;Qn(a,!1,'"response" body "expires_in" property',he,{body:s}),s.expires_in=a}if(s.refresh_token!==void 0&&Ie(s.refresh_token,'"response" body "refresh_token" property',he,{body:s}),s.scope!==void 0&&typeof s.scope!="string")throw ee('"response" body "scope" property must be a string',he,{body:s});if(s.id_token!==void 0){Ie(s.id_token,'"response" body "id_token" property',he,{body:s});const a=["aud","exp","iat","iss","sub"];t.require_auth_time===!0&&a.push("auth_time"),t.default_max_age!==void 0&&(Qn(t.default_max_age,!1,'"client.default_max_age"'),a.push("auth_time")),r!=null&&r.length&&a.push(...r);const{claims:i,jwt:c}=await SS(s.id_token,xS.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),mi(t),kh(t),o==null?void 0:o[di]).then(aS.bind(void 0,a)).then(tS.bind(void 0,e)).then(eS.bind(void 0,t.client_id));if(Array.isArray(i.aud)&&i.aud.length!==1){if(i.azp===void 0)throw ee('ID Token "aud" (audience) claim includes additional untrusted audiences',Yt,{claims:i,claim:"aud"});if(i.azp!==t.client_id)throw ee('unexpected ID Token "azp" (authorized party) claim value',Yt,{expected:t.client_id,claims:i,claim:"azp"})}i.auth_time!==void 0&&Qn(i.auth_time,!1,'ID Token "auth_time" (authentication time)',he,{claims:i}),Z_.set(n,c),Hh.set(s,i)}return s}function $h(e){let t;if(t=B_(e))throw new U_("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}async function Q_(e,t,n,r){return yi(e,t,n,void 0,r)}function eS(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw ee('unexpected JWT "aud" (audience) claim value',Yt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw ee('unexpected JWT "aud" (audience) claim value',Yt,{expected:e,claims:t.claims,claim:"aud"});return t}function tS(e,t){var r;const n=((r=e[TS])==null?void 0:r.call(e,t))??e.issuer;if(t.claims.iss!==n)throw ee('unexpected JWT "iss" (issuer) claim value',Yt,{expected:n,claims:t.claims,claim:"iss"});return t}const wi=new WeakSet;function nS(e){return wi.add(e),e}const rS=Symbol();async function oS(e,t,n,r,o,s,a){if(Jt(e),Xt(t),!wi.has(r))throw Ee('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',Ze);Ie(o,'"redirectUri"');const i=Zt(r,"code");if(!i)throw ee('no authorization code in "callbackParameters"',he);const c=new URLSearchParams(a==null?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",i),s!==rS&&(Ie(s,'"codeVerifier"'),c.set("code_verifier",s)),bi(e,t,n,"authorization_code",c,a)}const sS={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function aS(e,t){for(const n of e)if(t.claims[n]===void 0)throw ee(`JWT "${n}" (${sS[n]}) claim missing`,he,{claims:t.claims});return t}const vi=Symbol(),Ei=Symbol();async function iS(e,t,n,r){return cS(e,t,n,r.expectedNonce,r.maxAge,{[di]:r[di]})}async function cS(e,t,n,r,o,s){const a=[];switch(r){case void 0:r=vi;break;case vi:break;default:Ie(r,'"expectedNonce" argument'),a.push("nonce")}switch(o??(o=t.default_max_age),o){case void 0:o=Ei;break;case Ei:break;default:Qn(o,!1,'"maxAge" argument'),a.push("auth_time")}const i=await yi(e,t,n,a,s);Ie(i.id_token,'"response" body "id_token" property',he,{body:i});const c=Uh(i);if(o!==Ei){const u=gi()+mi(t),l=kh(t);if(c.auth_time+o<u-l)throw ee("too much time has elapsed since the last End-User authentication",Si,{claims:c,now:u,tolerance:l,claim:"auth_time"})}if(r===vi){if(c.nonce!==void 0)throw ee('unexpected ID Token "nonce" claim value',Yt,{expected:void 0,claims:c,claim:"nonce"})}else if(c.nonce!==r)throw ee('unexpected ID Token "nonce" claim value',Yt,{expected:r,claims:c,claim:"nonce"});return i}const uS="OAUTH_WWW_AUTHENTICATE_CHALLENGE",lS="OAUTH_RESPONSE_BODY_ERROR",dS="OAUTH_UNSUPPORTED_OPERATION",fS="OAUTH_AUTHORIZATION_RESPONSE_ERROR",_i="OAUTH_PARSE_ERROR",he="OAUTH_INVALID_RESPONSE",hS="OAUTH_RESPONSE_IS_NOT_JSON",Wh="OAUTH_RESPONSE_IS_NOT_CONFORM",pS="OAUTH_HTTP_REQUEST_FORBIDDEN",mS="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Si="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Yt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",gS="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",bS="OAUTH_MISSING_SERVER_METADATA",yS="OAUTH_INVALID_SERVER_METADATA";async function wS(e,t,n,r,o,s){return Jt(e),Xt(t),Ie(r,'"grantType"'),bi(e,t,n,r,new URLSearchParams(o),s)}async function vS(e,t,n,r){return yi(e,t,n,void 0,r)}function ao(e){if(e.bodyUsed)throw Ee('"response" body has been used already',Ze)}function Fh(e){const{algorithm:t}=e;if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Qe(`unsupported ${t.name} modulusLength`,{cause:e})}function ES(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Qe("unsupported ECDSA namedCurve",{cause:e})}}function _S(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:ES(e)};case"RSA-PSS":switch(Fh(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new Qe("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return Fh(e),e.algorithm.name;case"Ed25519":return e.algorithm.name}throw new Qe("unsupported CryptoKey algorithm name",{cause:e})}async function SS(e,t,n,r,o){let{0:s,1:a,length:i}=e.split(".");if(i===5)if(o!==void 0)e=await o(e),{0:s,1:a,length:i}=e.split(".");else throw new Qe("JWE decryption is not configured",{cause:e});if(i!==3)throw ee("Invalid JWT",he,e);let c;try{c=JSON.parse(En(Vt(s)))}catch(d){throw ee("failed to parse JWT Header body as base64url encoded JSON",_i,d)}if(!ro(c))throw ee("JWT Header must be a top level object",he,e);if(t(c),c.crit!==void 0)throw new Qe('no JWT "crit" header parameter extensions are supported',{cause:{header:c}});let u;try{u=JSON.parse(En(Vt(a)))}catch(d){throw ee("failed to parse JWT Payload body as base64url encoded JSON",_i,d)}if(!ro(u))throw ee("JWT Payload must be a top level object",he,e);const l=gi()+n;if(u.exp!==void 0){if(typeof u.exp!="number")throw ee('unexpected JWT "exp" (expiration time) claim type',he,{claims:u});if(u.exp<=l-r)throw ee('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Si,{claims:u,now:l,tolerance:r,claim:"exp"})}if(u.iat!==void 0&&typeof u.iat!="number")throw ee('unexpected JWT "iat" (issued at) claim type',he,{claims:u});if(u.iss!==void 0&&typeof u.iss!="string")throw ee('unexpected JWT "iss" (issuer) claim type',he,{claims:u});if(u.nbf!==void 0){if(typeof u.nbf!="number")throw ee('unexpected JWT "nbf" (not before) claim type',he,{claims:u});if(u.nbf>l+r)throw ee('unexpected JWT "nbf" (not before) claim value',Si,{claims:u,now:l,tolerance:r,claim:"nbf"})}if(u.aud!==void 0&&typeof u.aud!="string"&&!Array.isArray(u.aud))throw ee('unexpected JWT "aud" (audience) claim type',he,{claims:u});return{header:c,claims:u,jwt:e}}function xS(e,t,n,r){if(e!==void 0){if(typeof e=="string"?r.alg!==e:!e.includes(r.alg))throw ee('unexpected JWT "alg" header parameter',he,{header:r,expected:e,reason:"client configuration"});return}if(Array.isArray(t)){if(!t.includes(r.alg))throw ee('unexpected JWT "alg" header parameter',he,{header:r,expected:t,reason:"authorization server metadata"});return}if(n!==void 0){if(typeof n=="string"?r.alg!==n:typeof n=="function"?!n(r.alg):!n.includes(r.alg))throw ee('unexpected JWT "alg" header parameter',he,{header:r,expected:n,reason:"default value"});return}throw ee('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n})}function Zt(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw ee(`"${t}" parameter must be provided only once`,he);return n}const AS=Symbol(),RS=Symbol();function CS(e,t,n,r){if(Jt(e),Xt(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Ee('"parameters" must be an instance of URLSearchParams, or URL',Xe);if(Zt(n,"response"))throw ee('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',he,{parameters:n});const o=Zt(n,"iss"),s=Zt(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw ee('response parameter "iss" (issuer) missing',he,{parameters:n});if(o&&o!==e.issuer)throw ee('unexpected "iss" (issuer) response parameter value',he,{expected:e.issuer,parameters:n});switch(r){case void 0:case RS:if(s!==void 0)throw ee('unexpected "state" response parameter encountered',he,{expected:void 0,parameters:n});break;case AS:break;default:if(Ie(r,'"expectedState" argument'),s!==r)throw ee(s===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',he,{expected:r,parameters:n})}if(Zt(n,"error"))throw new H_("authorization response from the server is an error",{cause:n});const i=Zt(n,"id_token"),c=Zt(n,"token");if(i!==void 0||c!==void 0)throw new Qe("implicit and hybrid flows are not supported");return nS(new URLSearchParams(n))}async function xi(e,t=Oh){let n;try{n=await e.json()}catch(r){throw t(e),ee('failed to parse "response" body as JSON',_i,r)}if(!ro(n))throw ee('"response" body must be a top level object',he,{body:n});return n}const Kh=Symbol(),TS=Symbol(),PS={version:"4.7.0"};function OS(e,t){let n;try{n=new URL(e,t)}catch{return}if(n.origin===t.origin)return n}function io(e){var t;const n=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||e.expires===0)&&`Expires=${(typeof e.expires=="number"?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&typeof e.maxAge=="number"&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),r=`${e.name}=${encodeURIComponent((t=e.value)!=null?t:"")}`;return n.length===0?r:`${r}; ${n.join("; ")}`}function qh(e){const t=new Map;for(const n of e.split(/; */)){if(!n)continue;const r=n.indexOf("=");if(r===-1){t.set(n,"true");continue}const[o,s]=[n.slice(0,r),n.slice(r+1)];try{t.set(o,decodeURIComponent(s??"true"))}catch{}}return t}function kS(e){if(!e)return;const[[t,n],...r]=qh(e),{domain:o,expires:s,httponly:a,maxage:i,path:c,samesite:u,secure:l,partitioned:d,priority:h}=Object.fromEntries(r.map(([_,y])=>[_.toLowerCase().replace(/-/g,""),y])),m={name:t,value:decodeURIComponent(n),domain:o,...s&&{expires:new Date(s)},...a&&{httpOnly:!0},...typeof i=="string"&&{maxAge:Number(i)},path:c,...u&&{sameSite:DS(u)},...l&&{secure:!0},...h&&{priority:LS(h)},...d&&{partitioned:!0}};return NS(m)}function NS(e){const t={};for(const n in e)e[n]&&(t[n]=e[n]);return t}var IS=["strict","lax","none"];function DS(e){return e=e.toLowerCase(),IS.includes(e)?e:void 0}var MS=["low","medium","high"];function LS(e){return e=e.toLowerCase(),MS.includes(e)?e:void 0}function jS(e){if(!e)return[];var t=[],n=0,r,o,s,a,i;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function u(){return o=e.charAt(n),o!=="="&&o!==";"&&o!==","}for(;n<e.length;){for(r=n,i=!1;c();)if(o=e.charAt(n),o===","){for(s=n,n+=1,c(),a=n;n<e.length&&u();)n+=1;n<e.length&&e.charAt(n)==="="?(i=!0,n=a,t.push(e.substring(r,s)),r=n):n=s+1}else n+=1;(!i||n>=e.length)&&t.push(e.substring(r,e.length))}return t}var HS=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t){const n=qh(t);for(const[r,o]of n)this._parsed.set(r,{name:r,value:o})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const n=Array.from(this._parsed);if(!e.length)return n.map(([o,s])=>s);const r=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return n.filter(([o])=>o===r).map(([o,s])=>s)}has(e){return this._parsed.has(e)}set(...e){const[t,n]=e.length===1?[e[0].name,e[0].value]:e,r=this._parsed;return r.set(t,{name:t,value:n}),this._headers.set("cookie",Array.from(r).map(([o,s])=>io(s)).join("; ")),this}delete(e){const t=this._parsed,n=Array.isArray(e)?e.map(r=>t.delete(r)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([r,o])=>io(o)).join("; ")),n}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},Ai=class{constructor(e){this._parsed=new Map;var t,n,r;this._headers=e;const o=(r=(n=(t=e.getSetCookie)==null?void 0:t.call(e))!=null?n:e.get("set-cookie"))!=null?r:[],s=Array.isArray(o)?o:jS(o);for(const a of s){const i=kS(a);i&&this._parsed.set(i.name,i)}}get(...e){const t=typeof e[0]=="string"?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;const n=Array.from(this._parsed.values());if(!e.length)return n;const r=typeof e[0]=="string"?e[0]:(t=e[0])==null?void 0:t.name;return n.filter(o=>o.name===r)}has(e){return this._parsed.has(e)}set(...e){const[t,n,r]=e.length===1?[e[0].name,e[0].value,e[0]]:e,o=this._parsed;return o.set(t,$S({name:t,value:n,...r})),US(o,this._headers),this}delete(...e){const[t,n]=typeof e[0]=="string"?[e[0]]:[e[0].name,e[0]];return this.set({...n,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(io).join("; ")}};function US(e,t){t.delete("set-cookie");for(const[,n]of e){const r=io(n);t.append("set-cookie",r)}}function $S(e={name:"",value:""}){return typeof e.expires=="number"&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+e.maxAge*1e3)),(e.path===null||e.path===void 0)&&(e.path="/"),e}const WS=()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;throw new Error("unable to locate global object")},FS=async(e,t,n,r,o)=>{const{crypto:{subtle:s}}=WS();return new Uint8Array(await s.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:n,info:r},await s.importKey("raw",t,"HKDF",!1,["deriveBits"]),o<<3))};function KS(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw new TypeError('unsupported "digest" value')}}function Ri(e,t){if(typeof e=="string")return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw new TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}function qS(e){const t=Ri(e,"ikm");if(!t.byteLength)throw new TypeError('"ikm" must be at least one byte in length');return t}function zS(e){const t=Ri(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}function GS(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError('"keylen" must be a positive integer');const n=parseInt(t.substr(3),10)>>3||20;if(e>255*n)throw new TypeError('"keylen" too large');return e}async function Ci(e,t,n,r,o){return FS(KS(e),qS(t),Ri(n,"salt"),zS(r),GS(o,e))}const BS="A256GCM",VS="dir",zh="sha256",Ti=32,Gh="JWE CEK";async function co(e,t,n,r){const o=await Ci(zh,t,"",Gh,Ti);return(await new YE(e).setProtectedHeader({enc:BS,alg:VS,...r}).setExpirationTime(n).encrypt(o)).toString()}async function _n(e,t,n){const r=await Ci(zh,t,"",Gh,Ti);return await VE(e,r,{...n,clockTolerance:15})}const JS=e=>Ci("sha256",e,"","JWS Cookie Signing",Ti);async function XS(e,t,n){if(!t)return;const[r,o]=t.split("."),s={protected:i_(JSON.stringify({alg:"HS256",b64:!1,crit:["b64"]})),payload:`${e}=${r}`,signature:o},a=await JS(n);try{return await vh(s,a,{algorithms:["HS256"]}),r}catch{return}}const Pi=3500,uo="__",YS=new RegExp(`${uo}(\\d+)$`),Bh=/\.(\d+)$/,Oi=(e,t)=>{const n=t?Bh.exec(e):YS.exec(e);if(n)return parseInt(n[1],10)},lo=(e,t,n)=>{const r=new RegExp(n?`^${t}${Bh.source}$`:`^${t}${uo}\\d+$`);return e.getAll().filter(o=>r.test(o.name))};function ZS(e,t,n,r,o){const{transient:s,...a}=n,i={...a};if(s&&delete i.maxAge,new TextEncoder().encode(t).length<=Pi){o.set(e,t,i),r.set(e,t),lo(r,e).forEach(m=>{o.delete(m.name),r.delete(m.name)});return}let u=0,l=0;for(;u<t.length;){const m=t.slice(u,u+Pi),_=`${e}${uo}${l}`;o.set(_,m,i),r.set(_,m),u+=Pi,l++}const h=lo(r,e).length-l;if(h>0)for(let m=0;m<h;m++){const _=l+m,y=`${e}${uo}${_}`;o.delete(y),r.delete(y)}o.delete(e),r.delete(e)}function Vh(e,t,n){const r=t.get(e);if(r!=null&&r.value)return r.value;const o=lo(t,e,n).sort((a,i)=>Oi(a.name,n)-Oi(i.name,n));if(o.length===0)return;const s=Oi(o[o.length-1].name,n);if(o.length!==s+1){console.warn(`Incomplete chunked cookie '${e}': Found ${o.length} chunks, expected ${s+1}`);return}return o.map(a=>a.value).join("")}function Jh(e,t,n,r){n.delete(e),lo(t,e,r).forEach(o=>{n.delete(o.name)})}function er(e){e.headers.set("Cache-Control","private, no-cache, no-store, must-revalidate, max-age=0"),e.headers.set("Pragma","no-cache"),e.headers.set("Expires","0")}const QS=["sub","name","nickname","given_name","family_name","picture","email","email_verified","org_id"];function e2(e){return Object.keys(e).reduce((t,n)=>(QS.includes(n)&&(t[n]=e[n]),t),{})}const t2=["client_id","redirect_uri","response_type","code_challenge","code_challenge_method","state","nonce"],Xh=["openid","profile","email","offline_access"].join(" "),n2="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r2="urn:ietf:params:oauth:token-type:refresh_token",o2="http://auth0.com/oauth/token-type/federated-connection-access-token";function ki(e,t){return new URL(Ol(kl(e)),Pl(t))}class s2{constructor(t){if(this.fetch=t.fetch||fetch,this.jwksCache=t.jwksCache||{},this.allowInsecureRequests=t.allowInsecureRequests??!1,this.httpOptions=()=>{const r=new Headers,o=t.enableTelemetry??!0,s=t.httpTimeout??5e3;if(o){const a="nextjs-auth0",i=PS.version;r.set("User-Agent",`${a}/${i}`),r.set("Auth0-Client",a2(JSON.stringify({name:a,version:i})))}return{signal:AbortSignal.timeout(s),headers:r}},this.allowInsecureRequests&&process.env.NODE_ENV==="production"&&console.warn("allowInsecureRequests is enabled in a production environment. This is not recommended."),this.transactionStore=t.transactionStore,this.sessionStore=t.sessionStore,this.domain=t.domain,this.clientMetadata={client_id:t.clientId},this.clientSecret=t.clientSecret,this.authorizationParameters=t.authorizationParameters||{scope:Xh},this.pushedAuthorizationRequests=t.pushedAuthorizationRequests??!1,this.clientAssertionSigningKey=t.clientAssertionSigningKey,this.clientAssertionSigningAlg=t.clientAssertionSigningAlg||"RS256",this.authorizationParameters.scope||(this.authorizationParameters.scope=Xh),!this.authorizationParameters.scope.split(" ").map(r=>r.trim()).includes("openid"))throw new Error("The 'openid' scope must be included in the set of scopes. See https://auth0.com/docs");this.appBaseUrl=t.appBaseUrl,this.signInReturnToPath=t.signInReturnToPath||"/",this.beforeSessionSaved=t.beforeSessionSaved,this.onCallback=t.onCallback||this.defaultOnCallback,this.routes={login:"/auth/login",logout:"/auth/logout",callback:"/auth/callback",backChannelLogout:"/auth/backchannel-logout",profile:process.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile",accessToken:process.env.NEXT_PUBLIC_ACCESS_TOKEN_ROUTE||"/auth/access-token",...t.routes},this.enableAccessTokenEndpoint=t.enableAccessTokenEndpoint??!0,this.noContentProfileResponseWhenUnauthenticated=t.noContentProfileResponseWhenUnauthenticated??!1}async handler(t){const{pathname:n}=t.nextUrl,r=fw(n),o=t.method;if(o==="GET"&&r===this.routes.login)return this.handleLogin(t);if(o==="GET"&&r===this.routes.logout)return this.handleLogout(t);if(o==="GET"&&r===this.routes.callback)return this.handleCallback(t);if(o==="GET"&&r===this.routes.profile)return this.handleProfile(t);if(o==="GET"&&r===this.routes.accessToken&&this.enableAccessTokenEndpoint)return this.handleAccessToken(t);if(o==="POST"&&r===this.routes.backChannelLogout)return this.handleBackChannelLogout(t);{const s=be.NextResponse.next(),a=await this.sessionStore.get(t.cookies);return a&&(await this.sessionStore.set(t.cookies,s.cookies,{...a}),er(s)),s}}async startInteractiveLogin(t={}){const n=ki(this.routes.callback,this.appBaseUrl);let r=this.signInReturnToPath;if(t.returnTo){const y=new URL(this.authorizationParameters.redirect_uri||this.appBaseUrl),g=OS(t.returnTo,y);g&&(r=g.pathname+g.search+g.hash)}const o="S256",s=__(),a=await A_(s),i=S_(),c=x_(),u=new URLSearchParams;u.set("client_id",this.clientMetadata.client_id),u.set("redirect_uri",n.toString()),u.set("response_type","code"),u.set("code_challenge",a),u.set("code_challenge_method",o),u.set("state",i),u.set("nonce",c);const l={...this.authorizationParameters,...t.authorizationParameters};Object.entries(l).forEach(([y,g])=>{!t2.includes(y)&&g!=null&&u.set(y,String(g))});const d={nonce:c,maxAge:this.authorizationParameters.max_age,codeVerifier:s,responseType:"code",state:i,returnTo:r},[h,m]=await this.authorizationUrl(u);if(h)return new be.NextResponse("An error occured while trying to initiate the login request.",{status:500});const _=be.NextResponse.redirect(m.toString());return await this.transactionStore.save(_.cookies,d),_}async handleLogin(t){const n=Object.fromEntries(t.nextUrl.searchParams.entries()),r={authorizationParameters:this.pushedAuthorizationRequests?{}:n,returnTo:n.returnTo};return this.startInteractiveLogin(r)}async handleLogout(t){const n=await this.sessionStore.get(t.cookies),[r,o]=await this.discoverAuthorizationServerMetadata();if(r)return new be.NextResponse("An error occured while trying to initiate the logout request.",{status:500});const s=t.nextUrl.searchParams.get("returnTo")||this.appBaseUrl;if(!o.end_session_endpoint){console.warn("The Auth0 client does not have RP-initiated logout enabled, the user will be redirected to the `/v2/logout` endpoint instead. Learn how to enable it here: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0#enable-endpoint-discovery");const c=new URL("/v2/logout",this.issuer);c.searchParams.set("returnTo",s),c.searchParams.set("client_id",this.clientMetadata.client_id);const u=be.NextResponse.redirect(c);return await this.sessionStore.delete(t.cookies,u.cookies),await this.transactionStore.deleteAll(t.cookies,u.cookies),u}const a=new URL(o.end_session_endpoint);a.searchParams.set("client_id",this.clientMetadata.client_id),a.searchParams.set("post_logout_redirect_uri",s),n!=null&&n.internal.sid&&a.searchParams.set("logout_hint",n.internal.sid),n!=null&&n.tokenSet.idToken&&a.searchParams.set("id_token_hint",n==null?void 0:n.tokenSet.idToken);const i=be.NextResponse.redirect(a);return await this.sessionStore.delete(t.cookies,i.cookies),er(i),await this.transactionStore.deleteAll(t.cookies,i.cookies),i}async handleCallback(t){const n=t.nextUrl.searchParams.get("state");if(!n)return this.onCallback(new mw,{},null);const r=await this.transactionStore.get(t.cookies,n);if(!r)return this.onCallback(new gw,{},null);const o=r.payload,s={returnTo:o.returnTo},[a,i]=await this.discoverAuthorizationServerMetadata();if(a)return this.onCallback(a,s,null);let c;try{c=CS(i,this.clientMetadata,t.nextUrl.searchParams,o.state)}catch(_){return this.onCallback(new Nl({cause:new jn({code:_.error,message:_.error_description})}),s,null)}let u;try{const _=ki(this.routes.callback,this.appBaseUrl);u=await oS(i,this.clientMetadata,await this.getClientAuth(),c,_.toString(),o.codeVerifier,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests})}catch(_){return this.onCallback(new bw(_.message),s,null)}let l;try{l=await iS(i,this.clientMetadata,u,{expectedNonce:o.nonce,maxAge:o.maxAge,requireIdToken:!0})}catch(_){return this.onCallback(new yw({cause:new jn({code:_.error,message:_.error_description})}),s,null)}const d=Uh(l);let h={user:d,tokenSet:{accessToken:l.access_token,idToken:l.id_token,scope:l.scope,refreshToken:l.refresh_token,expiresAt:Math.floor(Date.now()/1e3)+Number(l.expires_in)},internal:{sid:d.sid,createdAt:Math.floor(Date.now()/1e3)}};const m=await this.onCallback(null,s,h);return this.beforeSessionSaved?h={...await this.beforeSessionSaved(h,l.id_token??null),internal:h.internal}:h.user=e2(d),await this.sessionStore.set(t.cookies,m.cookies,h,!0),er(m),await this.transactionStore.delete(m.cookies,n),m}async handleProfile(t){const n=await this.sessionStore.get(t.cookies);if(!n)return this.noContentProfileResponseWhenUnauthenticated?new be.NextResponse(null,{status:204}):new be.NextResponse(null,{status:401});const r=be.NextResponse.json(n==null?void 0:n.user);return er(r),r}async handleAccessToken(t){const n=await this.sessionStore.get(t.cookies);if(!n)return be.NextResponse.json({error:{message:"The user does not have an active session.",code:pn.MISSING_SESSION}},{status:401});const[r,o]=await this.getTokenSet(n.tokenSet);if(r)return be.NextResponse.json({error:{message:r.message,code:r.code}},{status:401});const s=be.NextResponse.json({token:o.accessToken,scope:o.scope,expires_at:o.expiresAt});return(o.accessToken!==n.tokenSet.accessToken||o.refreshToken!==n.tokenSet.refreshToken||o.expiresAt!==n.tokenSet.expiresAt)&&(await this.sessionStore.set(t.cookies,s.cookies,{...n,tokenSet:o}),er(s)),s}async handleBackChannelLogout(t){if(!this.sessionStore.store)return new be.NextResponse("A session data store is not configured.",{status:500});if(!this.sessionStore.store.deleteByLogoutToken)return new be.NextResponse("Back-channel logout is not supported by the session data store.",{status:500});const r=new URLSearchParams(await t.text()).get("logout_token");if(!r)return new be.NextResponse("Missing `logout_token` in the request body.",{status:400});const[o,s]=await this.verifyLogoutToken(r);return o?new be.NextResponse(o.message,{status:400}):(await this.sessionStore.store.deleteByLogoutToken(s),new be.NextResponse(null,{status:204}))}async getTokenSet(t,n){if(!t.refreshToken&&t.expiresAt<=Date.now()/1e3)return[new Ps(pn.MISSING_REFRESH_TOKEN,"The access token has expired and a refresh token was not provided. The user needs to re-authenticate."),null];if(t.refreshToken&&(n||t.expiresAt<=Date.now()/1e3)){const[r,o]=await this.discoverAuthorizationServerMetadata();if(r)return[r,null];const s=await Y_(o,this.clientMetadata,await this.getClientAuth(),t.refreshToken,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests});let a;try{a=await Q_(o,this.clientMetadata,s)}catch(u){return[new Ps(pn.FAILED_TO_REFRESH_TOKEN,"The access token has expired and there was an error while trying to refresh it.",new jn({code:u.error,message:u.error_description})),null]}const i=Math.floor(Date.now()/1e3)+Number(a.expires_in),c={...t,accessToken:a.access_token,idToken:a.id_token,expiresAt:i};return a.refresh_token?c.refreshToken=a.refresh_token:c.refreshToken=t.refreshToken,[null,c]}return[null,t]}async discoverAuthorizationServerMetadata(){if(this.authorizationServerMetadata)return[null,this.authorizationServerMetadata];const t=new URL(this.issuer);try{const n=await y_(t,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests}).then(r=>w_(t,r));return this.authorizationServerMetadata=n,[null,n]}catch(n){return console.error(`An error occured while performing the discovery request. issuer=${t.toString()}, error:`,n),[new pw("Discovery failed for the OpenID Connect configuration."),null]}}async defaultOnCallback(t,n){return t?new be.NextResponse(t.message,{status:500}):be.NextResponse.redirect(ki(n.returnTo||"/",this.appBaseUrl))}async verifyLogoutToken(t){const[n,r]=await this.discoverAuthorizationServerMetadata();if(n)return[n,null];const o="RS256",s=a_(new URL(r.jwks_uri),{[no]:this.jwksCache}),{payload:a}=await BE(t,s,{issuer:r.issuer,audience:this.clientMetadata.client_id,algorithms:[o],requiredClaims:["iat"]});return!("sid"in a)&&!("sub"in a)?[new Pt('either "sid" or "sub" (or both) claims must be present'),null]:"sid"in a&&typeof a.sid!="string"?[new Pt('"sid" claim must be a string'),null]:"sub"in a&&typeof a.sub!="string"?[new Pt('"sub" claim must be a string'),null]:"nonce"in a?[new Pt('"nonce" claim is prohibited'),null]:"events"in a?typeof a.events!="object"||a.events===null?[new Pt('"events" claim must be an object'),null]:"http://schemas.openid.net/event/backchannel-logout"in a.events?typeof a.events["http://schemas.openid.net/event/backchannel-logout"]!="object"?[new Pt('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object'),null]:[null,{sid:a.sid,sub:a.sub}]:[new Pt('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim'),null]:[new Pt('"events" claim is missing'),null]}async authorizationUrl(t){const[n,r]=await this.discoverAuthorizationServerMetadata();if(n)return[n,null];if(this.pushedAuthorizationRequests&&!r.pushed_authorization_request_endpoint)return console.error("The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par"),[new Error("The authorization server does not support pushed authorization requests."),null];const o=new URL(r.authorization_endpoint);if(this.pushedAuthorizationRequests){const s=await L_(r,this.clientMetadata,await this.getClientAuth(),t,{...this.httpOptions(),[Bt]:this.fetch,[Mt]:this.allowInsecureRequests});let a;try{a=await V_(r,this.clientMetadata,s)}catch(i){return[new Nl({cause:new jn({code:i.error,message:i.error_description}),message:"An error occured while pushing the authorization request."}),null]}return o.searchParams.set("request_uri",a.request_uri),o.searchParams.set("client_id",this.clientMetadata.client_id),[null,o]}return o.search=t.toString(),[null,o]}async getClientAuth(){if(!this.clientSecret&&!this.clientAssertionSigningKey)throw new Error("The client secret or client assertion signing key must be provided.");let t=this.clientAssertionSigningKey;return t&&!(t instanceof CryptoKey)&&(t=await xE(t,this.clientAssertionSigningAlg)),t?I_(t):k_(this.clientSecret)}get issuer(){return this.domain.startsWith("http://")||this.domain.startsWith("https://")?this.domain:`https://${this.domain}`}async getConnectionTokenSet(t,n,r){if(!t.refreshToken&&(!n||n.expiresAt<=Date.now()/1e3))return[new Os(Hn.MISSING_REFRESH_TOKEN,"A refresh token was not present, Connection Access Token requires a refresh token. The user needs to re-authenticate."),null];if(t.refreshToken&&(!n||n.expiresAt<=Date.now()/1e3)){const o=new URLSearchParams;o.append("connection",r.connection),o.append("subject_token_type",r2),o.append("subject_token",t.refreshToken),o.append("requested_token_type",o2),r.login_hint&&o.append("login_hint",r.login_hint);const[s,a]=await this.discoverAuthorizationServerMetadata();if(s)return[s,null];const i=await wS(a,this.clientMetadata,await this.getClientAuth(),n2,o,{[Bt]:this.fetch,[Mt]:this.allowInsecureRequests});let c;try{c=await vS(a,this.clientMetadata,i)}catch(u){return[new Os(Hn.FAILED_TO_EXCHANGE,"There was an error trying to exchange the refresh token for a connection access token.",new jn({code:u.error,message:u.error_description})),null]}return[null,{accessToken:c.access_token,expiresAt:Math.floor(Date.now()/1e3)+Number(c.expires_in),scope:c.scope,connection:r.connection}]}return[null,n]}}const a2=e=>{const t=new TextEncoder().encode(e),n=32768,r=[];for(let o=0;o<t.length;o+=n)r.push(String.fromCharCode.apply(null,t.subarray(o,o+n)));return btoa(r.join(""))},i2="__session";class Yh{constructor({secret:t,rolling:n=!0,absoluteDuration:r=60*60*24*3,inactivityDuration:o=60*60*24*1,store:s,cookieOptions:a}){this.secret=t,this.rolling=n,this.absoluteDuration=r,this.inactivityDuration=o,this.store=s,this.sessionCookieName=(a==null?void 0:a.name)??i2,this.cookieConfig={httpOnly:!0,sameSite:(a==null?void 0:a.sameSite)??"lax",secure:(a==null?void 0:a.secure)??!1,path:(a==null?void 0:a.path)??"/",domain:a==null?void 0:a.domain,transient:a==null?void 0:a.transient}}epoch(){return Date.now()/1e3|0}calculateMaxAge(t){if(!this.rolling)return this.absoluteDuration;const n=this.epoch(),o=Math.min(n+this.inactivityDuration,t+this.absoluteDuration)-this.epoch();return o>0?o:0}}const Sn="appSession";function c2(e){if(e.protectedHeader.iat){const t=e;return Zh(t.protectedHeader,t.payload)}return e.payload}function u2(e){var t;if((t=e.header)!=null&&t.iat){const n=e;return Zh(n.header,n.data)}return e}function Zh(e,t){const n=t.user;return{user:n,tokenSet:{idToken:t.idToken??void 0,accessToken:t.accessToken??void 0,scope:t.accessTokenScope,refreshToken:t.refreshToken,expiresAt:t.accessTokenExpiresAt},internal:{sid:n.sid,createdAt:e.iat}}}const Qh=()=>{const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")};class l2 extends Yh{constructor({secret:t,store:n,rolling:r,absoluteDuration:o,inactivityDuration:s,cookieOptions:a}){super({secret:t,rolling:r,absoluteDuration:o,inactivityDuration:s,cookieOptions:a}),this.store=n}async get(t){const n=t.get(this.sessionCookieName)||t.get(Sn);if(!n||!n.value)return null;let r=null;try{const{payload:s}=await _n(n.value,this.secret);r=s.id}catch(s){if(s.code==="ERR_JWE_INVALID"){const a=await XS(n.name,n.value,this.secret);if(!a)return null;r=a}}if(!r)return null;const o=await this.store.get(r);return o?u2(o):null}async set(t,n,r,o=!1){var l;let s=null;const a=(l=t.get(this.sessionCookieName))==null?void 0:l.value;if(a){const{payload:d}=await _n(a,this.secret);s=d.id}s&&o&&(await this.store.delete(s),s=Qh()),s||(s=Qh());const i=this.calculateMaxAge(r.internal.createdAt),c=Date.now()/1e3+i,u=await co({id:s},this.secret,c);n.set(this.sessionCookieName,u.toString(),{...this.cookieConfig,maxAge:i}),await this.store.set(s,r),t.set(this.sessionCookieName,u.toString()),this.sessionCookieName!==Sn&&t.has(Sn)&&n.delete(Sn)}async delete(t,n){var s;const r=(s=t.get(this.sessionCookieName))==null?void 0:s.value;if(await n.delete(this.sessionCookieName),!r)return;const{payload:o}=await _n(r,this.secret);await this.store.delete(o.id)}}class d2 extends Yh{constructor({secret:t,rolling:n,absoluteDuration:r,inactivityDuration:o,cookieOptions:s}){super({secret:t,rolling:n,absoluteDuration:r,inactivityDuration:o,cookieOptions:s}),this.connectionTokenSetsCookieName="__FC"}async get(t){const n=Vh(this.sessionCookieName,t)??Vh(Sn,t,!0);if(!n)return null;const r=await _n(n,this.secret),o=c2(r),s=await Promise.all(this.getConnectionTokenSetsCookies(t).map(a=>_n(a.value,this.secret)));return{...o,...s.length?{connectionTokenSets:s.map(a=>a.payload)}:{}}}async set(t,n,r){const{connectionTokenSets:o,...s}=r,a=this.calculateMaxAge(r.internal.createdAt),i=Math.floor(Date.now()/1e3)+a,u=(await co(s,this.secret,i)).toString(),l={...this.cookieConfig,maxAge:a};ZS(this.sessionCookieName,u,l,t,n),o!=null&&o.length&&await Promise.all(o.map((d,h)=>this.storeInCookie(t,n,d,`${this.connectionTokenSetsCookieName}_${h}`,a))),Jh(Sn,t,n,!0)}async delete(t,n){Jh(this.sessionCookieName,t,n),this.getConnectionTokenSetsCookies(t).forEach(r=>n.delete(r.name))}async storeInCookie(t,n,r,o,s){const a=Math.floor(Date.now()/1e3+s),i=await co(r,this.secret,a),c=i.toString();n.set(o,i.toString(),{...this.cookieConfig,maxAge:s}),t.set(o,c);const u=new Ai(new Headers);u.set(o,c,{...this.cookieConfig,maxAge:s}),new TextEncoder().encode(u.toString()).length>=4096&&(o===this.sessionCookieName?console.warn(`The ${o} cookie size exceeds 4096 bytes, which may cause issues in some browsers. Consider removing any unnecessary custom claims from the access token or the user profile. Alternatively, you can use a stateful session implementation to store the session data in a data store.`):console.warn(`The ${o} cookie size exceeds 4096 bytes, which may cause issues in some browsers. You can use a stateful session implementation to store the session data in a data store.`))}getConnectionTokenSetsCookies(t){return t.getAll().filter(n=>n.name.startsWith(this.connectionTokenSetsCookieName))}}const f2="__txn_";class h2{constructor({secret:t,cookieOptions:n}){this.secret=t,this.transactionCookiePrefix=(n==null?void 0:n.prefix)??f2,this.cookieConfig={httpOnly:!0,sameSite:(n==null?void 0:n.sameSite)??"lax",secure:(n==null?void 0:n.secure)??!1,path:(n==null?void 0:n.path)??"/",maxAge:60*60}}getTransactionCookieName(t){return`${this.transactionCookiePrefix}${t}`}getCookiePrefix(){return this.transactionCookiePrefix}async save(t,n){const r=Math.floor(Date.now()/1e3+this.cookieConfig.maxAge),o=await co(n,this.secret,r);if(!n.state)throw new Error("Transaction state is required");t.set(this.getTransactionCookieName(n.state),o.toString(),this.cookieConfig)}async get(t,n){var s;const r=this.getTransactionCookieName(n),o=(s=t.get(r))==null?void 0:s.value;return o?_n(o,this.secret):null}async delete(t,n){await t.delete(this.getTransactionCookieName(n))}async deleteAll(t,n){const r=this.getCookiePrefix();t.getAll().forEach(o=>{o.name.startsWith(r)&&n.delete(o.name)})}}class ep{constructor(t={}){var d,h,m,_,y,g,p,b,f,A,E,R,v,x,C,D;const{domain:n,clientId:r,clientSecret:o,appBaseUrl:s,secret:a,clientAssertionSigningKey:i}=this.validateAndExtractRequiredOptions(t),c=t.clientAssertionSigningAlg||process.env.AUTH0_CLIENT_ASSERTION_SIGNING_ALG,u={name:((h=(d=t.session)==null?void 0:d.cookie)==null?void 0:h.name)??"__session",secure:((_=(m=t.session)==null?void 0:m.cookie)==null?void 0:_.secure)??process.env.AUTH0_COOKIE_SECURE==="true",sameSite:((g=(y=t.session)==null?void 0:y.cookie)==null?void 0:g.sameSite)??process.env.AUTH0_COOKIE_SAME_SITE??"lax",path:((b=(p=t.session)==null?void 0:p.cookie)==null?void 0:b.path)??process.env.AUTH0_COOKIE_PATH??"/",transient:((A=(f=t.session)==null?void 0:f.cookie)==null?void 0:A.transient)??process.env.AUTH0_COOKIE_TRANSIENT==="true",domain:((R=(E=t.session)==null?void 0:E.cookie)==null?void 0:R.domain)??process.env.AUTH0_COOKIE_DOMAIN},l={prefix:((v=t.transactionCookie)==null?void 0:v.prefix)??"__txn_",secure:((x=t.transactionCookie)==null?void 0:x.secure)??!1,sameSite:((C=t.transactionCookie)==null?void 0:C.sameSite)??"lax",path:((D=t.transactionCookie)==null?void 0:D.path)??"/"};if(s){const{protocol:I}=new URL(s);I==="https:"&&(u.secure=!0,l.secure=!0)}this.transactionStore=new h2({...t.session,secret:a,cookieOptions:l}),this.sessionStore=t.sessionStore?new l2({...t.session,secret:a,store:t.sessionStore,cookieOptions:u}):new d2({...t.session,secret:a,cookieOptions:u}),this.authClient=new s2({transactionStore:this.transactionStore,sessionStore:this.sessionStore,domain:n,clientId:r,clientSecret:o,clientAssertionSigningKey:i,clientAssertionSigningAlg:c,authorizationParameters:t.authorizationParameters,pushedAuthorizationRequests:t.pushedAuthorizationRequests,appBaseUrl:s,secret:a,signInReturnToPath:t.signInReturnToPath,beforeSessionSaved:t.beforeSessionSaved,onCallback:t.onCallback,routes:t.routes,allowInsecureRequests:t.allowInsecureRequests,httpTimeout:t.httpTimeout,enableTelemetry:t.enableTelemetry,enableAccessTokenEndpoint:t.enableAccessTokenEndpoint,noContentProfileResponseWhenUnauthenticated:t.noContentProfileResponseWhenUnauthenticated})}middleware(t){return this.authClient.handler.bind(this.authClient)(t)}async getSession(t){return t?t instanceof be.NextRequest?this.sessionStore.get(t.cookies):this.sessionStore.get(this.createRequestCookies(t)):this.sessionStore.get(await Xn.cookies())}async getAccessToken(t,n,r){const o={refresh:!1};let s,a,i={};if(t&&(t instanceof Request||typeof t.headers=="object")){if(s=t,a=n,i={...o,...r??{}},!a)throw new TypeError("getAccessToken(req, res): The 'res' argument is missing. Both 'req' and 'res' must be provided together for Pages Router or middleware usage.")}else{if(n!==void 0||r!==void 0)throw new TypeError("getAccessToken: Invalid arguments. Valid signatures are getAccessToken(), getAccessToken(options), or getAccessToken(req, res, options).");i={...o,...t??{}}}const c=s?await this.getSession(s):await this.getSession();if(!c)throw new Ps(pn.MISSING_SESSION,"The user does not have an active session.");const[u,l]=await this.authClient.getTokenSet(c.tokenSet,i.refresh);if(u)throw u;return(l.accessToken!==c.tokenSet.accessToken||l.expiresAt!==c.tokenSet.expiresAt||l.refreshToken!==c.tokenSet.refreshToken)&&await this.saveToSession({...c,tokenSet:l},s,a),{token:l.accessToken,scope:l.scope,expiresAt:l.expiresAt}}async getAccessTokenForConnection(t,n,r){var c,u;const o=n?await this.getSession(n):await this.getSession();if(!o)throw new Os(Hn.MISSING_SESSION,"The user does not have an active session.");const s=(c=o.connectionTokenSets)==null?void 0:c.find(l=>l.connection===t.connection),[a,i]=await this.authClient.getConnectionTokenSet(o.tokenSet,s,t);if(a!==null)throw a;if(i&&(!s||i.accessToken!==s.accessToken||i.expiresAt!==s.expiresAt||i.scope!==s.scope)){let l;s?l=(u=o.connectionTokenSets)==null?void 0:u.map(d=>d.connection===t.connection?i:d):l=[...o.connectionTokenSets||[],i],await this.saveToSession({...o,connectionTokenSets:l},n,r)}return{token:i.accessToken,scope:i.scope,expiresAt:i.expiresAt}}async updateSession(t,n,r){if(n){const o=t;if(!r)throw new Error("The session data is missing.");if(o instanceof be.NextRequest&&n instanceof be.NextResponse){const s=await this.getSession(o);if(!s)throw new Error("The user is not authenticated.");await this.sessionStore.set(o.cookies,n.cookies,{...r,internal:{...s.internal}})}else{const s=await this.getSession(o);if(!s)throw new Error("The user is not authenticated.");const a=new Headers,i=new Ai(a),c=r,u=this.createRequestCookies(o),l=n;await this.sessionStore.set(u,i,{...c,internal:{...s.internal}});for(const[d,h]of a.entries())l.setHeader(d,h)}}else{const o=await this.getSession();if(!o)throw new Error("The user is not authenticated.");const s=t;if(!s)throw new Error("The session data is missing.");await this.sessionStore.set(await Xn.cookies(),await Xn.cookies(),{...s,internal:{...o.internal}})}}createRequestCookies(t){const n=new Headers;for(const r in t.headers)if(Array.isArray(t.headers[r]))for(const o of t.headers[r])n.append(r,o);else n.append(r,t.headers[r]??"");return new HS(n)}async startInteractiveLogin(t){return this.authClient.startInteractiveLogin(t)}async saveToSession(t,n,r){if(n&&r)if(n instanceof be.NextRequest&&r instanceof be.NextResponse)await this.sessionStore.set(n.cookies,r.cookies,t);else{const o=new Headers,s=new Ai(o),a=r;await this.sessionStore.set(this.createRequestCookies(n),s,t);for(const[i,c]of o.entries())a.setHeader(i,c)}else try{await this.sessionStore.set(await Xn.cookies(),await Xn.cookies(),t)}catch{process.env.NODE_ENV==="development"&&console.warn("Failed to persist the updated token set. `getAccessToken()` was likely called from a Server Component which cannot set cookies.")}}validateAndExtractRequiredOptions(t){const n={domain:t.domain??process.env.AUTH0_DOMAIN,clientId:t.clientId??process.env.AUTH0_CLIENT_ID,appBaseUrl:t.appBaseUrl??process.env.APP_BASE_URL,secret:t.secret??process.env.AUTH0_SECRET},r=t.clientSecret??process.env.AUTH0_CLIENT_SECRET,o=t.clientAssertionSigningKey??process.env.AUTH0_CLIENT_ASSERTION_SIGNING_KEY,s=!!(r||o),a=Object.entries(n).filter(([,c])=>!c).map(([c])=>c);if(s||a.push("clientAuthentication"),a.length){const c={domain:"AUTH0_DOMAIN",clientId:"AUTH0_CLIENT_ID",appBaseUrl:"APP_BASE_URL",secret:"AUTH0_SECRET"};let u=`WARNING: Not all required options were provided when creating an instance of Auth0Client. Ensure to provide all missing options, either by passing it to the Auth0Client constructor, or by setting the corresponding environment variable.
194
194
  `;a.forEach(l=>{l==="clientAuthentication"?u+=`Missing: clientAuthentication: Set either AUTH0_CLIENT_SECRET env var or AUTH0_CLIENT_ASSERTION_SIGNING_KEY env var, or pass clientSecret or clientAssertionSigningKey in options
195
195
  `:c[l]?u+=`Missing: ${l}: Set ${c[l]} env var or pass ${l} in options
196
196
  `:u+=`Missing: ${l}
197
- `}),console.error(u.trim())}return{...n,clientSecret:r,clientAssertionSigningKey:o}}}const Ni=new lS({authorizationParameters:{scope:"openid profile email permissions",audience:`${process.env.AUTH0_AUDIENCE}`}});async function Yh(){const e=await Ni.getAccessToken();return(e==null?void 0:e.token)||"No token available"}async function dS(e){try{const t=await Ni.middleware(e);if(t instanceof be.NextResponse){const n=t.status;if(n===401||n===403||n===500){const r=new URL("/auth/login",e.url);return be.NextResponse.redirect(r)}}return t}catch(t){if(t instanceof Error&&t.message==="Missing session"){const r=new URL("/auth/login",e.url);return be.NextResponse.redirect(r)}const n=new URL("/auth/login",e.url);return be.NextResponse.redirect(n)}}const fS=["/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|api/auth).*)"];class tr extends Error{}tr.prototype.name="InvalidTokenError";function hS(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function pS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return hS(t)}catch{return atob(t)}}function mS(e,t){if(typeof e!="string")throw new tr("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new tr(`Invalid token specified: missing part #${n+1}`);let o;try{o=pS(r)}catch(s){throw new tr(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(o)}catch(s){throw new tr(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}async function Zh(){var e,t,n,r;try{const o=await Yh();if(!o||o==="No token available")return{essentialInsights:!1,web:!1,priceMonster:!1};const a=(e=mS(o)["https://cloud.golocal.com/org_metadata"])==null?void 0:e.metadata;return{essentialInsights:((t=a==null?void 0:a["essential-insights"])==null?void 0:t.enabled)===!0,web:((n=a==null?void 0:a.web)==null?void 0:n.enabled)===!0,priceMonster:((r=a==null?void 0:a["price-monster"])==null?void 0:r.enabled)===!0}}catch(o){return console.error("Error getting user permissions:",o),{essentialInsights:!1,web:!1,priceMonster:!1}}}const Qh=F.createContext(void 0),ep=()=>{const e=F.useContext(Qh);if(e===void 0)throw new Error("usePermissions must be used within PermissionsProvider");return e};function gS({children:e}){const[t,n]=F.useState({essentialInsights:!1,priceMonster:!1,web:!1});return F.useEffect(()=>{Zh().then(r=>{n(r)}).catch(r=>console.error("Error fetching product access:",r))},[]),w.jsx(Qh.Provider,{value:t,children:e})}const bS={navMain:[{title:"Essential Insights",key:"essentialInsights",url:"/essential-insights/overall-performance",icon:w.jsx(om,{className:"h-5 w-5"}),items:[{title:"Overall Performance",url:"/essential-insights/overall-performance",icon:w.jsx(hc,{className:"h-4 w-4"})},{title:"Organic Performance",url:"/essential-insights/organic-performance",icon:w.jsx(dc,{className:"h-4 w-4"})},{title:"Paid Performance",url:"/essential-insights/paid-performance",icon:w.jsx(rm,{className:"h-4 w-4"})},{title:"Keyword Performance",url:"/essential-insights/keyword-performance",icon:w.jsx(dc,{className:"h-4 w-4"})},{title:"More Components",url:"/essential-insights/more-components",icon:w.jsx(cr,{className:"h-4 w-4"})}]},{title:"Price Monster",key:"priceMonster",url:"/price-monster",icon:w.jsx(im,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/price-monster/dashboard",icon:w.jsx(cr,{className:"h-4 w-4"})},{title:"Documentation",url:"/price-monster/documentation",icon:w.jsx(tm,{className:"h-4 w-4"})},{title:"Subscriptions",url:"/price-monster/subscriptions",icon:w.jsx(nm,{className:"h-4 w-4"})}]},{title:"CMS",key:"web",url:"/cms",icon:w.jsx(cr,{className:"h-4 w-4"}),items:[{title:"Dashboard",url:"/cms/dashboard",icon:w.jsx(cr,{className:"h-4 w-4"})}]}]};function tp({...e}){const{isActiveRoute:t}=$d(),n=ep();return w.jsxs(el,{...e,children:[w.jsx(ol,{children:w.jsx("div",{className:"relative h-12 w-32 overflow-hidden",children:w.jsx("img",{src:d0,alt:"GLI Logo",className:"h-full w-full object-contain"})})}),w.jsxs(sl,{children:[w.jsx("div",{className:"relative flex w-full min-w-0 flex-col px-2 py-1",children:w.jsxs("a",{href:"/",className:W("flex cursor-pointer items-center gap-2 rounded-lg px-2 py-2 transition-colors hover:bg-gray-100",t("/")&&"bg-blue-50 text-gli-bluedark font-medium"),children:[w.jsx(hc,{className:W("h-5 w-5",t("/")?"text-gli-bluedark":"text-gray-500")}),w.jsx("span",{children:"Home"})]})}),w.jsx(cs,{delayDuration:150,children:bS.navMain.map(r=>{const o=!r.key||n[r.key],s=o&&(t(r.url)||r.items.some(i=>t(i.url))),a=w.jsx(Ud,{url:o?r.url:void 0,title:r.title,icon:r.icon,isActive:s,disabled:!o,className:W(!o&&"opacity-50"),children:o&&w.jsx(il,{children:w.jsx(cl,{children:r.items.map(i=>{const c=t(i.url);return w.jsx(ul,{children:w.jsx(ll,{asChild:!0,children:w.jsxs("a",{href:i.url,className:W("flex items-center gap-2 pl-4 transition-colors text-muted-foreground hover:bg-muted hover:text-foreground",c&&"bg-blue-50 text-gli-bluedark font-medium"),children:[w.jsx("span",{className:W(c?"text-gli-bluedark":"text-muted-foreground"),children:i.icon}),w.jsx("span",{className:W(c?"text-gli-bluedark":"text-muted-foreground"),children:i.title})]})})},i.title)})})})},r.title);return r.key==="priceMonster"&&!o?w.jsxs(us,{children:[w.jsx(ls,{asChild:!0,children:w.jsx("div",{children:a})}),w.jsx(Dr,{side:"top",align:"center",children:"Coming soon"})]},r.title):a})})]}),w.jsx(nl,{})]})}const yS=({children:e,onLogout:t})=>w.jsx(bw,{children:w.jsx(Qu,{children:w.jsxs("div",{className:"flex h-screen w-full",children:[w.jsx(tp,{}),w.jsxs(rl,{className:"flex-1 flex flex-col min-w-0",children:[w.jsx(Hd,{onLogout:t}),w.jsx("main",{className:"flex-1 bg-white overflow-auto",id:"page-content",children:e})]})]})})});L.AppHeader=Hd,L.AppSidebar=tp,L.Button=ur,L.Card=o0,L.CardAction=c0,L.CardContent=u0,L.CardDescription=i0,L.CardFooter=l0,L.CardHeader=s0,L.CardTitle=a0,L.CollapsibleSection=Ud,L.DropdownMenu=Nd,L.DropdownMenuCheckboxItem=Yv,L.DropdownMenuContent=Dd,L.DropdownMenuGroup=Xv,L.DropdownMenuItem=Fs,L.DropdownMenuLabel=Md,L.DropdownMenuPortal=Jv,L.DropdownMenuRadioGroup=Zv,L.DropdownMenuRadioItem=Qv,L.DropdownMenuSeparator=Ld,L.DropdownMenuShortcut=e0,L.DropdownMenuSub=t0,L.DropdownMenuSubContent=r0,L.DropdownMenuSubTrigger=n0,L.DropdownMenuTrigger=Id,L.GLICloudProvider=yS,L.Input=_o,L.PermissionsProvider=gS,L.ProfileDropdown=jd,L.Separator=ir,L.Sheet=uu,L.SheetClose=Lg,L.SheetContent=Uo,L.SheetDescription=Fo,L.SheetFooter=du,L.SheetHeader=$o,L.SheetOverlay=Ho,L.SheetPortal=lu,L.SheetTitle=Wo,L.SheetTrigger=Mg,L.Sidebar=el,L.SidebarContent=sl,L.SidebarFooter=Ey,L.SidebarGroup=al,L.SidebarGroupAction=xy,L.SidebarGroupContent=il,L.SidebarGroupLabel=Sy,L.SidebarHeader=ol,L.SidebarInput=vy,L.SidebarInset=rl,L.SidebarMenu=Ay,L.SidebarMenuAction=Py,L.SidebarMenuBadge=Oy,L.SidebarMenuButton=Ty,L.SidebarMenuItem=Ry,L.SidebarMenuSkeleton=ky,L.SidebarMenuSub=cl,L.SidebarMenuSubButton=ll,L.SidebarMenuSubItem=ul,L.SidebarProvider=Qu,L.SidebarRail=nl,L.SidebarSeparator=_y,L.SidebarTrigger=tl,L.Skeleton=Ko,L.Tooltip=us,L.TooltipContent=Dr,L.TooltipProvider=cs,L.TooltipTrigger=ls,L.accessToken=Yh,L.auth0=Ni,L.authMiddlewareMatcher=fS,L.buttonVariants=gc,L.getUserPermissions=Zh,L.handleAuthMiddleware=dS,L.useActiveRoute=$d,L.useIsMobile=mc,L.usePermissions=ep,L.useSidebar=Dn,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
197
+ `}),console.error(u.trim())}return{...n,clientSecret:r,clientAssertionSigningKey:o}}}const Ni=new ep({authorizationParameters:{scope:"openid profile email permissions",audience:`${process.env.AUTH0_AUDIENCE}`}});async function tp(){const e=await Ni.getAccessToken();return(e==null?void 0:e.token)||"No token available"}async function p2(e){try{const t=await Ni.middleware(e);if(t instanceof be.NextResponse){const n=t.status;if(n===401||n===403||n===500){const r=new URL("/auth/login",e.url);return be.NextResponse.redirect(r)}}return t}catch(t){if(t instanceof Error&&t.message==="Missing session"){const r=new URL("/auth/login",e.url);return be.NextResponse.redirect(r)}const n=new URL("/auth/login",e.url);return be.NextResponse.redirect(n)}}const m2=["/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|api/auth).*)"];class tr extends Error{}tr.prototype.name="InvalidTokenError";function g2(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function b2(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return g2(t)}catch{return atob(t)}}function np(e,t){if(typeof e!="string")throw new tr("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new tr(`Invalid token specified: missing part #${n+1}`);let o;try{o=b2(r)}catch(s){throw new tr(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(o)}catch(s){throw new tr(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}async function y2(){var e,t,n,r;try{const o=await tp();if(!o||o==="No token available")return{essentialInsights:!1,web:!1,priceMonster:!1};const a=(e=np(o)["https://cloud.golocal.com/org_metadata"])==null?void 0:e.metadata;return{essentialInsights:((t=a==null?void 0:a["essential-insights"])==null?void 0:t.enabled)===!0,web:((n=a==null?void 0:a.web)==null?void 0:n.enabled)===!0,priceMonster:((r=a==null?void 0:a["price-monster"])==null?void 0:r.enabled)===!0}}catch(o){return console.error("Error getting user permissions:",o),{essentialInsights:!1,web:!1,priceMonster:!1}}}const rp=new ep({authorizationParameters:{scope:"openid profile email permissions",audience:`${process.env.AUTH0_AUDIENCE}`}});async function w2(){var e,t,n,r;try{const o=await rp.getAccessToken(),s=o==null?void 0:o.token;if(!s)return{essentialInsights:!1,web:!1,priceMonster:!1};const i=(e=np(s)["https://cloud.golocal.com/org_metadata"])==null?void 0:e.metadata;return{essentialInsights:((t=i==null?void 0:i["essential-insights"])==null?void 0:t.enabled)===!0,web:((n=i==null?void 0:i.web)==null?void 0:n.enabled)===!0,priceMonster:((r=i==null?void 0:i["price-monster"])==null?void 0:r.enabled)===!0}}catch(o){return console.error("Error getting user permissions:",o),{essentialInsights:!1,web:!1,priceMonster:!1}}}const v2=({children:e,onLogout:t})=>w.jsx(ww,{children:w.jsx(Qu,{children:w.jsxs("div",{className:"flex h-screen w-full",children:[w.jsx(Kd,{}),w.jsxs(rl,{className:"flex-1 flex flex-col min-w-0",children:[w.jsx(Hd,{onLogout:t}),w.jsx("main",{className:"flex-1 bg-white overflow-auto",id:"page-content",children:e})]})]})})});L.AppHeader=Hd,L.AppSidebar=Kd,L.Button=ur,L.Card=a0,L.CardAction=l0,L.CardContent=d0,L.CardDescription=u0,L.CardFooter=f0,L.CardHeader=i0,L.CardTitle=c0,L.CollapsibleSection=Ud,L.DropdownMenu=Nd,L.DropdownMenuCheckboxItem=Qv,L.DropdownMenuContent=Dd,L.DropdownMenuGroup=Zv,L.DropdownMenuItem=Fs,L.DropdownMenuLabel=Md,L.DropdownMenuPortal=Yv,L.DropdownMenuRadioGroup=e0,L.DropdownMenuRadioItem=t0,L.DropdownMenuSeparator=Ld,L.DropdownMenuShortcut=n0,L.DropdownMenuSub=r0,L.DropdownMenuSubContent=s0,L.DropdownMenuSubTrigger=o0,L.DropdownMenuTrigger=Id,L.GLICloudProvider=v2,L.Input=_o,L.PermissionsProvider=p0,L.ProfileDropdown=jd,L.Separator=ir,L.Sheet=uu,L.SheetClose=Hg,L.SheetContent=Uo,L.SheetDescription=Fo,L.SheetFooter=du,L.SheetHeader=$o,L.SheetOverlay=Ho,L.SheetPortal=lu,L.SheetTitle=Wo,L.SheetTrigger=jg,L.Sidebar=el,L.SidebarContent=sl,L.SidebarFooter=Sy,L.SidebarGroup=al,L.SidebarGroupAction=Ry,L.SidebarGroupContent=il,L.SidebarGroupLabel=Ay,L.SidebarHeader=ol,L.SidebarInput=_y,L.SidebarInset=rl,L.SidebarMenu=Cy,L.SidebarMenuAction=ky,L.SidebarMenuBadge=Ny,L.SidebarMenuButton=Oy,L.SidebarMenuItem=Ty,L.SidebarMenuSkeleton=Iy,L.SidebarMenuSub=cl,L.SidebarMenuSubButton=ll,L.SidebarMenuSubItem=ul,L.SidebarProvider=Qu,L.SidebarRail=nl,L.SidebarSeparator=xy,L.SidebarTrigger=tl,L.Skeleton=Ko,L.Tooltip=us,L.TooltipContent=Dr,L.TooltipProvider=cs,L.TooltipTrigger=ls,L.accessToken=tp,L.auth0=Ni,L.authMiddlewareMatcher=m2,L.buttonVariants=gc,L.getServerSidePermissions=w2,L.getUserPermissions=y2,L.handleAuthMiddleware=p2,L.serverAuth0=rp,L.useActiveRoute=$d,L.useIsMobile=mc,L.usePermissions=Fd,L.useSidebar=Dn,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});