@ouim/logto-authkit 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +823 -0
- package/dist/bundler-config.cjs +1 -0
- package/dist/bundler-config.d.ts +81 -0
- package/dist/bundler-config.js +31 -0
- package/dist/callback.d.ts +3 -0
- package/dist/components/signin-button.d.ts +53 -0
- package/dist/components/ui/alert.d.ts +8 -0
- package/dist/components/ui/avatar.d.ts +6 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts +17 -0
- package/dist/components/ui/loading-spinner.d.ts +2 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/utils/utils.d.ts +2 -0
- package/dist/context.d.ts +57 -0
- package/dist/index.cjs +129 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +9583 -0
- package/dist/navigation.d.ts +10 -0
- package/dist/server/authorization.d.ts +53 -0
- package/dist/server/csrf.d.ts +247 -0
- package/dist/server/index.cjs +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +431 -0
- package/dist/server/types.d.ts +62 -0
- package/dist/server/verify-auth.d.ts +296 -0
- package/dist/signin.d.ts +42 -0
- package/dist/types.d.ts +81 -0
- package/dist/useAuth.d.ts +55 -0
- package/dist/usePermission.d.ts +9 -0
- package/dist/user-center.d.ts +49 -0
- package/dist/utils.d.ts +169 -0
- package/package.json +111 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),E=require("react"),ln=require("@logto/react"),Eo=require("react-dom"),dn=require("./bundler-config.cjs");function Ro(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 p=Ro(E),nr=Ro(Eo);function Po(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=Po(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rr(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Po(e))&&(r&&(r+=" "),r+=t);return r}const or="-",Ba=e=>{const t=za(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(or);return s[0]===""&&s.length!==1&&s.shift(),Ao(s,t)||Ua(a)},getConflictingClassGroupIds:(a,s)=>{const c=n[a]||[];return s&&r[a]?[...c,...r[a]]:c}}},Ao=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ao(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(or);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},Mr=/^\[(.+)\]$/,Ua=e=>{if(Mr.test(e)){const t=Mr.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},za=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ya(Object.entries(e.classGroups),n).forEach(([i,a])=>{Wn(a,r,i,t)}),r},Wn=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:kr(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Ha(o)){Wn(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,a])=>{Wn(a,kr(t,i),n,r)})})},kr=(e,t)=>{let n=e;return t.split(or).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ha=e=>e.isThemeGetter,Ya=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,o]}):e,Za=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return o(i,a),a},set(i,a){n.has(i)?n.set(i,a):o(i,a)}}},Mo="!",Xa=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,a=s=>{const c=[];let u=0,d=0,l;for(let g=0;g<s.length;g++){let w=s[g];if(u===0){if(w===o&&(r||s.slice(g,g+i)===t)){c.push(s.slice(d,g)),d=g+i;continue}if(w==="/"){l=g;continue}}w==="["?u++:w==="]"&&u--}const f=c.length===0?s:s.substring(d),m=f.startsWith(Mo),h=m?f.substring(1):f,v=l&&l>d?l-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:a}):a},Ka=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Ja=e=>({cache:Za(e.cacheSize),parseClassName:Xa(e),...Ba(e)}),qa=/\s+/,Qa=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(qa);let s="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:l,baseClassName:f,maybePostfixModifierPosition:m}=n(u);let h=!!m,v=r(h?f.substring(0,m):f);if(!v){if(!h){s=u+(s.length>0?" "+s:s);continue}if(v=r(f),!v){s=u+(s.length>0?" "+s:s);continue}h=!1}const g=Ka(d).join(":"),w=l?g+Mo:g,b=w+v;if(i.includes(b))continue;i.push(b);const x=o(v,h);for(let S=0;S<x.length;++S){const C=x[S];i.push(w+C)}s=u+(s.length>0?" "+s:s)}return s};function es(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ko(t))&&(r&&(r+=" "),r+=n);return r}const ko=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ko(e[r]))&&(n&&(n+=" "),n+=t);return n};function ts(e,...t){let n,r,o,i=a;function a(c){const u=t.reduce((d,l)=>l(d),e());return n=Ja(u),r=n.cache.get,o=n.cache.set,i=s,s(c)}function s(c){const u=r(c);if(u)return u;const d=Qa(c,n);return o(c,d),d}return function(){return i(es.apply(null,arguments))}}const Y=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Io=/^\[(?:([a-z-]+):)?(.+)\]$/i,ns=/^\d+\/\d+$/,rs=new Set(["px","full","screen"]),os=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,is=/\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$/,as=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ss=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_e=e=>st(e)||rs.has(e)||ns.test(e),Fe=e=>dt(e,"length",hs),st=e=>!!e&&!Number.isNaN(Number(e)),Sn=e=>dt(e,"number",st),ht=e=>!!e&&Number.isInteger(Number(e)),us=e=>e.endsWith("%")&&st(e.slice(0,-1)),_=e=>Io.test(e),We=e=>os.test(e),ls=new Set(["length","size","percentage"]),ds=e=>dt(e,ls,To),fs=e=>dt(e,"position",To),ps=new Set(["image","url"]),ms=e=>dt(e,ps,ws),vs=e=>dt(e,"",gs),gt=()=>!0,dt=(e,t,n)=>{const r=Io.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},hs=e=>is.test(e)&&!as.test(e),To=()=>!1,gs=e=>ss.test(e),ws=e=>cs.test(e),ys=()=>{const e=Y("colors"),t=Y("spacing"),n=Y("blur"),r=Y("brightness"),o=Y("borderColor"),i=Y("borderRadius"),a=Y("borderSpacing"),s=Y("borderWidth"),c=Y("contrast"),u=Y("grayscale"),d=Y("hueRotate"),l=Y("invert"),f=Y("gap"),m=Y("gradientColorStops"),h=Y("gradientColorStopPositions"),v=Y("inset"),g=Y("margin"),w=Y("opacity"),b=Y("padding"),x=Y("saturate"),S=Y("scale"),C=Y("sepia"),A=Y("skew"),P=Y("space"),R=Y("translate"),L=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",_,t],k=()=>[_,t],F=()=>["",_e,Fe],O=()=>["auto",st,_],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",_],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[st,_];return{cacheSize:500,separator:":",theme:{colors:[gt],spacing:[_e,Fe],blur:["none","",We,_],brightness:z(),borderColor:[e],borderRadius:["none","","full",We,_],borderSpacing:k(),borderWidth:F(),contrast:z(),grayscale:M(),hueRotate:z(),invert:M(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[us,Fe],inset:N(),margin:N(),opacity:z(),padding:k(),saturate:z(),scale:z(),sepia:M(),skew:z(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",_]}],container:["container"],columns:[{columns:[We]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],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:[...Z(),_]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ht,_]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",ht,_]}],"grid-cols":[{"grid-cols":[gt]}],"col-start-end":[{col:["auto",{span:["full",ht,_]},_]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[gt]}],"row-start-end":[{row:["auto",{span:[ht,_]},_]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",_,t]}],"min-w":[{"min-w":[_,t,"min","max","fit"]}],"max-w":[{"max-w":[_,t,"none","full","min","max","fit","prose",{screen:[We]},We]}],h:[{h:[_,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_,t,"auto","min","max","fit"]}],"font-size":[{text:["base",We,Fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sn]}],"font-family":[{font:[gt]}],"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:["tighter","tight","normal","wide","wider","widest",_]}],"line-clamp":[{"line-clamp":["none",st,Sn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",_e,_]}],"list-image":[{"list-image":["none",_]}],"list-style-type":[{list:["none","disc","decimal",_]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",_e,Fe]}],"underline-offset":[{"underline-offset":["auto",_e,_]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),fs]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ds]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ms]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:D()}],"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:["",...D()]}],"outline-offset":[{"outline-offset":[_e,_]}],"outline-w":[{outline:[_e,Fe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[_e,Fe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",We,vs]}],"shadow-color":[{shadow:[gt]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",We,_]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[l]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",_]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",_]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ht,_]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",_]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",_]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[_e,Fe,Sn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},Lo=ts(ys);var ve=function(){return ve=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ve.apply(this,arguments)};function _o(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 Me(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{u(r.next(d))}catch(l){a(l)}}function c(d){try{u(r.throw(d))}catch(l){a(l)}}function u(d){d.done?i(d.value):o(d.value).then(s,c)}u((r=r.apply(e,t||[])).next())})}function ke(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ir(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var No="4.6.2";function tn(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function bs(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function xs(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:t})}):tn(Math.min(e,t))}function Oo(e){return!!e&&typeof e.then=="function"}function Ir(e,t){try{var n=e();Oo(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function Tr(e,t,n){return n===void 0&&(n=16),Me(this,void 0,void 0,function(){var r,o,i,a;return ke(this,function(s){switch(s.label){case 0:r=Array(e.length),o=Date.now(),i=0,s.label=1;case 1:return i<e.length?(r[i]=t(e[i],i),a=Date.now(),a>=o+n?(o=a,[4,bs()]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++i,[3,1];case 4:return[2,r]}})})}function bt(e){return e.then(void 0,function(){}),e}function Ss(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function Cs(e,t){return!Ss(e,t)}function ar(e){return parseInt(e)}function me(e){return parseFloat(e)}function Ne(e,t){return typeof e=="number"&&isNaN(e)?t:e}function ne(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function Do(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function Es(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),i=o[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(f,m){a[f]=a[f]||[],a[f].push(m)};;){var u=s.exec(o[2]);if(!u)break;var d=u[0];switch(d[0]){case".":c("class",d.slice(1));break;case"#":c("id",d.slice(1));break;case"[":{var l=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(d);if(l)c(l[1],(n=(t=l[4])!==null&&t!==void 0?t:l[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[i,a]}function Rs(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function Ve(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,i=e[1]&65535,a=t[0]>>>16,s=t[0]&65535,c=t[1]>>>16,u=t[1]&65535,d=0,l=0,f=0,m=0;m+=i+u,f+=m>>>16,m&=65535,f+=o+c,l+=f>>>16,f&=65535,l+=r+s,d+=l>>>16,l&=65535,d+=n+a,d&=65535,e[0]=d<<16|l,e[1]=f<<16|m}function ue(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,i=e[1]&65535,a=t[0]>>>16,s=t[0]&65535,c=t[1]>>>16,u=t[1]&65535,d=0,l=0,f=0,m=0;m+=i*u,f+=m>>>16,m&=65535,f+=o*u,l+=f>>>16,f&=65535,f+=i*c,l+=f>>>16,f&=65535,l+=r*u,d+=l>>>16,l&=65535,l+=o*c,d+=l>>>16,l&=65535,l+=i*s,d+=l>>>16,l&=65535,d+=n*u+r*c+o*s+i*a,d&=65535,e[0]=d<<16|l,e[1]=f<<16|m}function tt(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function ae(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function X(e,t){e[0]^=t[0],e[1]^=t[1]}var Ps=[4283543511,3981806797],As=[3301882366,444984403];function Lr(e){var t=[0,e[0]>>>1];X(e,t),ue(e,Ps),t[1]=e[0]>>>1,X(e,t),ue(e,As),t[1]=e[0]>>>1,X(e,t)}var Wt=[2277735313,289559509],Vt=[1291169091,658871167],_r=[0,5],Ms=[0,1390208809],ks=[0,944331445];function Is(e,t){var n=Rs(e);t=t||0;var r=[0,n.length],o=r[1]%16,i=r[1]-o,a=[0,t],s=[0,t],c=[0,0],u=[0,0],d;for(d=0;d<i;d=d+16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,u[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,u[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,ue(c,Wt),tt(c,31),ue(c,Vt),X(a,c),tt(a,27),Ve(a,s),ue(a,_r),Ve(a,Ms),ue(u,Vt),tt(u,33),ue(u,Wt),X(s,u),tt(s,31),Ve(s,a),ue(s,_r),Ve(s,ks);c[0]=0,c[1]=0,u[0]=0,u[1]=0;var l=[0,0];switch(o){case 15:l[1]=n[d+14],ae(l,48),X(u,l);case 14:l[1]=n[d+13],ae(l,40),X(u,l);case 13:l[1]=n[d+12],ae(l,32),X(u,l);case 12:l[1]=n[d+11],ae(l,24),X(u,l);case 11:l[1]=n[d+10],ae(l,16),X(u,l);case 10:l[1]=n[d+9],ae(l,8),X(u,l);case 9:l[1]=n[d+8],X(u,l),ue(u,Vt),tt(u,33),ue(u,Wt),X(s,u);case 8:l[1]=n[d+7],ae(l,56),X(c,l);case 7:l[1]=n[d+6],ae(l,48),X(c,l);case 6:l[1]=n[d+5],ae(l,40),X(c,l);case 5:l[1]=n[d+4],ae(l,32),X(c,l);case 4:l[1]=n[d+3],ae(l,24),X(c,l);case 3:l[1]=n[d+2],ae(l,16),X(c,l);case 2:l[1]=n[d+1],ae(l,8),X(c,l);case 1:l[1]=n[d],X(c,l),ue(c,Wt),tt(c,31),ue(c,Vt),X(a,c)}return X(a,r),X(s,r),Ve(a,s),Ve(s,a),Lr(a),Lr(s),Ve(a,s),Ve(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function Ts(e){var t;return ve({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
|
|
3
|
+
`)},e)}function Ls(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function _s(e){return typeof e!="function"}function Ns(e,t){var n=bt(new Promise(function(r){var o=Date.now();Ir(e.bind(null,t),function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=Date.now()-o;if(!i[0])return r(function(){return{error:i[1],duration:s}});var c=i[1];if(_s(c))return r(function(){return{value:c,duration:s}});r(function(){return new Promise(function(u){var d=Date.now();Ir(c,function(){for(var l=[],f=0;f<arguments.length;f++)l[f]=arguments[f];var m=s+Date.now()-d;if(!l[0])return u({error:l[1],duration:m});u({value:l[1],duration:m})})})})})}));return function(){return n.then(function(o){return o()})}}function Os(e,t,n,r){var o=Object.keys(e).filter(function(a){return Cs(n,a)}),i=bt(Tr(o,function(a){return Ns(e[a],t)},r));return function(){return Me(this,void 0,void 0,function(){var s,c,u,d,l;return ke(this,function(f){switch(f.label){case 0:return[4,i];case 1:return s=f.sent(),[4,Tr(s,function(m){return bt(m())},r)];case 2:return c=f.sent(),[4,Promise.all(c)];case 3:for(u=f.sent(),d={},l=0;l<o.length;++l)d[o[l]]=u[l];return[2,d]}})})}}function jo(){var e=window,t=navigator;return ne(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Ds(){var e=window,t=navigator;return ne(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!jo()}function Et(){var e=window,t=navigator;return ne(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function ye(){var e=window,t=navigator;return ne(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function sr(){var e=window,t=e.HTMLElement,n=e.Document;return ne(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Rt(){var e=window;return Ls(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Fo(){var e,t,n=window;return ne(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function js(){var e=window;return ne([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Fs(){var e=window,t=e.URLPattern;return ne(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Ws(){var e=window;return ne(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Pt(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return ne([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Vs(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return ne(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function $s(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Gs(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function cr(){var e=Et(),t=Fo(),n=window,r=navigator,o="connection";return e?ne([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?ne(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Bs(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return ne(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function Us(){return Ys()?-4:zs()}function zs(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Hs())return-1;var n=4500,r=5e3,o=new t(1,r,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;var a=o.createDynamicsCompressor();a.threshold.value=-50,a.knee.value=40,a.ratio.value=12,a.attack.value=0,a.release.value=.25,i.connect(a),a.connect(o.destination),i.start(0);var s=Zs(o),c=s[0],u=s[1],d=bt(c.then(function(l){return Xs(l.getChannelData(0).subarray(n))},function(l){if(l.name==="timeout"||l.name==="suspended")return-3;throw l}));return function(){return u(),d}}function Hs(){return ye()&&!sr()&&!Ws()}function Ys(){return ye()&&Pt()&&Rt()||Et()&&Bs()&&Fs()}function Zs(e){var t=3,n=500,r=500,o=5e3,i=function(){},a=new Promise(function(s,c){var u=!1,d=0,l=0;e.oncomplete=function(h){return s(h.renderedBuffer)};var f=function(){setTimeout(function(){return c(Nr("timeout"))},Math.min(r,l+o-Date.now()))},m=function(){try{var h=e.startRendering();switch(Oo(h)&&bt(h),e.state){case"running":l=Date.now(),u&&f();break;case"suspended":document.hidden||d++,u&&d>=t?c(Nr("suspended")):setTimeout(m,n);break}}catch(v){c(v)}};m(),i=function(){u||(u=!0,l>0&&f())}});return[a,i]}function Xs(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Nr(e){var t=new Error(e);return t.name=e,t}function Wo(e,t,n){var r,o,i;return n===void 0&&(n=50),Me(this,void 0,void 0,function(){var a,s;return ke(this,function(c){switch(c.label){case 0:a=document,c.label=1;case 1:return a.body?[3,3]:[4,tn(n)];case 2:return c.sent(),[3,1];case 3:s=a.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(u,d){var l=!1,f=function(){l=!0,u()},m=function(g){l=!0,d(g)};s.onload=f,s.onerror=m;var h=s.style;h.setProperty("display","block","important"),h.position="absolute",h.top="0",h.left="0",h.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);var v=function(){var g,w;l||(((w=(g=s.contentWindow)===null||g===void 0?void 0:g.document)===null||w===void 0?void 0:w.readyState)==="complete"?f():setTimeout(v,10))};v()})];case 5:c.sent(),c.label=6;case 6:return!((o=(r=s.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body?[3,8]:[4,tn(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,c.sent()];case 10:return(i=s.parentNode)===null||i===void 0||i.removeChild(s),[7];case 11:return[2]}})})}function Ks(e){for(var t=Es(e),n=t[0],r=t[1],o=document.createElement(n??"div"),i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s].join(" ");s==="style"?Js(o.style,c):o.setAttribute(s,c)}return o}function Js(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var o=r[n],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(i){var a=i[1],s=i[2],c=i[4];e.setProperty(a,s,c||"")}}}function qs(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var Qs="mmMwWLliI0O&1",ec="48px",nt=["monospace","sans-serif","serif"],Or=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function tc(){var e=this;return Wo(function(t,n){var r=n.document;return Me(e,void 0,void 0,function(){var o,i,a,s,c,u,d,l,f,m,h,v;return ke(this,function(g){for(o=r.body,o.style.fontSize=ec,i=r.createElement("div"),i.style.setProperty("visibility","hidden","important"),a={},s={},c=function(w){var b=r.createElement("span"),x=b.style;return x.position="absolute",x.top="0",x.left="0",x.fontFamily=w,b.textContent=Qs,i.appendChild(b),b},u=function(w,b){return c("'".concat(w,"',").concat(b))},d=function(){return nt.map(c)},l=function(){for(var w={},b=function(A){w[A]=nt.map(function(P){return u(A,P)})},x=0,S=Or;x<S.length;x++){var C=S[x];b(C)}return w},f=function(w){return nt.some(function(b,x){return w[x].offsetWidth!==a[b]||w[x].offsetHeight!==s[b]})},m=d(),h=l(),o.appendChild(i),v=0;v<nt.length;v++)a[nt[v]]=m[v].offsetWidth,s[nt[v]]=m[v].offsetHeight;return[2,Or.filter(function(w){return f(h[w])})]})})})}function nc(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var o=[],i=0;i<r.length;++i){var a=r[i];o.push({type:a.type,suffixes:a.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}}return t}}function rc(){return oc(dc())}function oc(e){var t,n=!1,r,o,i=ic(),a=i[0],s=i[1];return ac(a,s)?(n=sc(s),e?r=o="skipped":(t=cc(a,s),r=t[0],o=t[1])):r=o="unsupported",{winding:n,geometry:r,text:o}}function ic(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function ac(e,t){return!!(t&&e.toDataURL)}function sc(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function cc(e,t){uc(e,t);var n=Cn(e),r=Cn(e);if(n!==r)return["unstable","unstable"];lc(e,t);var o=Cn(e);return[o,n]}function uc(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function lc(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var o=r[n],i=o[0],a=o[1],s=o[2];t.fillStyle=i,t.beginPath(),t.arc(a,s,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Cn(e){return e.toDataURL()}function dc(){return ye()&&Pt()&&Rt()}function fc(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=ar(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function pc(){return navigator.oscpu}function mc(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Et()&&js()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function vc(){return window.screen.colorDepth}function hc(){return Ne(me(navigator.deviceMemory),void 0)}function gc(){if(!(ye()&&Pt()&&Rt()))return wc()}function wc(){var e=screen,t=function(r){return Ne(ar(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var yc=2500,bc=10,Xt,En;function xc(){if(En===void 0){var e=function(){var t=Vn();$n(t)?En=setTimeout(e,yc):(Xt=t,En=void 0)};e()}}function Sc(){var e=this;return xc(),function(){return Me(e,void 0,void 0,function(){var t;return ke(this,function(n){switch(n.label){case 0:return t=Vn(),$n(t)?Xt?[2,ir([],Xt,!0)]:$s()?[4,Gs()]:[3,2]:[3,2];case 1:n.sent(),t=Vn(),n.label=2;case 2:return $n(t)||(Xt=t),[2,t]}})})}}function Cc(){var e=this;if(ye()&&Pt()&&Rt())return function(){return Promise.resolve(void 0)};var t=Sc();return function(){return Me(e,void 0,void 0,function(){var n,r;return ke(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return n=o.sent(),r=function(i){return i===null?null:Do(i,bc)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function Vn(){var e=screen;return[Ne(me(e.availTop),null),Ne(me(e.width)-me(e.availWidth)-Ne(me(e.availLeft),0),null),Ne(me(e.height)-me(e.availHeight)-Ne(me(e.availTop),0),null),Ne(me(e.availLeft),null)]}function $n(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Ec(){return Ne(ar(navigator.hardwareConcurrency),void 0)}function Rc(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var r=-Pc();return"UTC".concat(r>=0?"+":"").concat(r)}function Pc(){var e=new Date().getFullYear();return Math.max(me(new Date(e,0,1).getTimezoneOffset()),me(new Date(e,6,1).getTimezoneOffset()))}function Ac(){try{return!!window.sessionStorage}catch{return!0}}function Mc(){try{return!!window.localStorage}catch{return!0}}function kc(){if(!(jo()||Ds()))try{return!!window.indexedDB}catch{return!0}}function Ic(){return!!window.openDatabase}function Tc(){return navigator.cpuClass}function Lc(){var e=navigator.platform;return e==="MacIntel"&&ye()&&!sr()?Vs()?"iPad":"iPhone":e}function _c(){return navigator.vendor||""}function Nc(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],o=window[r];o&&typeof o=="object"&&e.push(r)}return e.sort()}function Oc(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Dc(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function jc(e){var t=e===void 0?{}:e,n=t.debug;return Me(this,void 0,void 0,function(){var r,o,i,a,s,c;return ke(this,function(u){switch(u.label){case 0:return Fc()?(r=Dc(),o=Object.keys(r),i=(c=[]).concat.apply(c,o.map(function(d){return r[d]})),[4,Wc(i)]):[2,void 0];case 1:return a=u.sent(),n&&Vc(r,a),s=o.filter(function(d){var l=r[d],f=ne(l.map(function(m){return a[m]}));return f>l.length*.6}),s.sort(),[2,s]}})})}function Fc(){return ye()||cr()}function Wc(e){var t;return Me(this,void 0,void 0,function(){var n,r,o,i,c,a,s,c;return ke(this,function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),o=new Array(e.length),i={},Dr(r),c=0;c<e.length;++c)a=Ks(e[c]),a.tagName==="DIALOG"&&a.show(),s=n.createElement("div"),Dr(s),s.appendChild(a),r.appendChild(s),o[c]=a;u.label=1;case 1:return n.body?[3,3]:[4,tn(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(r);try{for(c=0;c<e.length;++c)o[c].offsetParent||(i[e[c]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return[2,i]}})})}function Dr(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Vc(e,t){for(var n="DOM blockers debug:\n```",r=0,o=Object.keys(e);r<o.length;r++){var i=o[r];n+=`
|
|
4
|
+
`.concat(i,":");for(var a=0,s=e[i];a<s.length;a++){var c=s[a];n+=`
|
|
5
|
+
`.concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}function $c(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Gc(){if(jr("inverted"))return!0;if(jr("none"))return!1}function jr(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Bc(){if(Fr("active"))return!0;if(Fr("none"))return!1}function Fr(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var Uc=100;function zc(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=Uc;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function Hc(){if(rt("no-preference"))return 0;if(rt("high")||rt("more"))return 1;if(rt("low")||rt("less"))return-1;if(rt("forced"))return 10}function rt(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function Yc(){if(Wr("reduce"))return!0;if(Wr("no-preference"))return!1}function Wr(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Zc(){if(Vr("reduce"))return!0;if(Vr("no-preference"))return!1}function Vr(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function Xc(){if($r("high"))return!0;if($r("standard"))return!1}function $r(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var $=Math,te=function(){return 0};function Kc(){var e=$.acos||te,t=$.acosh||te,n=$.asin||te,r=$.asinh||te,o=$.atanh||te,i=$.atan||te,a=$.sin||te,s=$.sinh||te,c=$.cos||te,u=$.cosh||te,d=$.tan||te,l=$.tanh||te,f=$.exp||te,m=$.expm1||te,h=$.log1p||te,v=function(R){return $.pow($.PI,R)},g=function(R){return $.log(R+$.sqrt(R*R-1))},w=function(R){return $.log(R+$.sqrt(R*R+1))},b=function(R){return $.log((1+R)/(1-R))/2},x=function(R){return $.exp(R)-1/$.exp(R)/2},S=function(R){return($.exp(R)+1/$.exp(R))/2},C=function(R){return $.exp(R)-1},A=function(R){return($.exp(2*R)-1)/($.exp(2*R)+1)},P=function(R){return $.log(1+R)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:g(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:w(1),atanh:o(.5),atanhPf:b(.5),atan:i(.5),sin:a(-1e300),sinh:s(1),sinhPf:x(1),cos:c(10.000000000123),cosh:u(1),coshPf:S(1),tan:d(-1e300),tanh:l(1),tanhPf:A(1),exp:f(1),expm1:m(1),expm1Pf:C(1),log1p:h(10),log1pPf:P(10),powPI:v(-100)}}var Jc="mmMwWLliI0fiflO&1",Rn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function qc(){return Qc(function(e,t){for(var n={},r={},o=0,i=Object.keys(Rn);o<i.length;o++){var a=i[o],s=Rn[a],c=s[0],u=c===void 0?{}:c,d=s[1],l=d===void 0?Jc:d,f=e.createElement("span");f.textContent=l,f.style.whiteSpace="nowrap";for(var m=0,h=Object.keys(u);m<h.length;m++){var v=h[m],g=u[v];g!==void 0&&(f.style[v]=g)}n[a]=f,t.append(e.createElement("br"),f)}for(var w=0,b=Object.keys(Rn);w<b.length;w++){var a=b[w];r[a]=n[a].getBoundingClientRect().width}return r})}function Qc(e,t){return t===void 0&&(t=4e3),Wo(function(n,r){var o=r.document,i=o.body,a=i.style;a.width="".concat(t,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",Et()?i.style.zoom="".concat(1/r.devicePixelRatio):ye()&&(i.style.zoom="reset");var s=o.createElement("div");return s.textContent=ir([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(s),e(o,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function eu(){return navigator.pdfViewerEnabled}function tu(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function nu(){var e=window.ApplePaySession;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(ru())return-3;try{return e.canMakePayments()?1:0}catch(t){return ou(t)}}var ru=qs;function ou(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function iu(){var e,t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}var Vo=-1,$o=-2,au=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),su=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),cu=["FRAGMENT_SHADER","VERTEX_SHADER"],uu=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Go="WEBGL_debug_renderer_info",lu="WEBGL_polygon_mode";function du(e){var t,n,r,o,i,a,s=e.cache,c=Bo(s);if(!c)return Vo;if(!zo(c))return $o;var u=Uo()?null:c.getExtension(Go);return{version:((t=c.getParameter(c.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=c.getParameter(c.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:u?(r=c.getParameter(u.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((o=c.getParameter(c.RENDERER))===null||o===void 0?void 0:o.toString())||"",rendererUnmasked:u?(i=c.getParameter(u.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((a=c.getParameter(c.SHADING_LANGUAGE_VERSION))===null||a===void 0?void 0:a.toString())||""}}function fu(e){var t=e.cache,n=Bo(t);if(!n)return Vo;if(!zo(n))return $o;var r=n.getSupportedExtensions(),o=n.getContextAttributes(),i=[],a=[],s=[],c=[],u=[];if(o)for(var d=0,l=Object.keys(o);d<l.length;d++){var f=l[d];a.push("".concat(f,"=").concat(o[f]))}for(var m=Gr(n),h=0,v=m;h<v.length;h++){var g=v[h],w=n[g];s.push("".concat(g,"=").concat(w).concat(au.has(w)?"=".concat(n.getParameter(w)):""))}if(r)for(var b=0,x=r;b<x.length;b++){var S=x[b];if(!(S===Go&&Uo()||S===lu&&vu())){var C=n.getExtension(S);if(!C){i.push(S);continue}for(var A=0,P=Gr(C);A<P.length;A++){var g=P[A],w=C[g];c.push("".concat(g,"=").concat(w).concat(su.has(w)?"=".concat(n.getParameter(w)):""))}}}for(var R=0,L=cu;R<L.length;R++)for(var T=L[R],N=0,k=uu;N<k.length;N++){var F=k[N],O=pu(n,T,F);u.push("".concat(T,".").concat(F,"=").concat(O.join(",")))}return c.sort(),s.sort(),{contextAttributes:a,parameters:s,shaderPrecisions:u,extensions:r,extensionParameters:c,unsupportedExtensions:i}}function Bo(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,o=["webgl","experimental-webgl"];r<o.length;r++){var i=o[r];try{n=t.getContext(i)}catch{}if(n)break}return e.webgl={context:n},n}function pu(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Gr(e){var t=Object.keys(e.__proto__);return t.filter(mu)}function mu(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Uo(){return Fo()}function vu(){return Et()||ye()}function zo(e){return typeof e.getParameter=="function"}function hu(){var e=cr()||ye();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function gu(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var wu={fonts:tc,domBlockers:jc,fontPreferences:qc,audio:Us,screenFrame:Cc,canvas:rc,osCpu:pc,languages:mc,colorDepth:vc,deviceMemory:hc,screenResolution:gc,hardwareConcurrency:Ec,timezone:Rc,sessionStorage:Ac,localStorage:Mc,indexedDB:kc,openDatabase:Ic,cpuClass:Tc,platform:Lc,plugins:nc,touchSupport:fc,vendor:_c,vendorFlavors:Nc,cookiesEnabled:Oc,colorGamut:$c,invertedColors:Gc,forcedColors:Bc,monochrome:zc,contrast:Hc,reducedMotion:Yc,reducedTransparency:Zc,hdr:Xc,math:Kc,pdfViewerEnabled:eu,architecture:tu,applePay:nu,privateClickMeasurement:iu,audioBaseLatency:hu,dateTimeLocale:gu,webGlBasics:du,webGlExtensions:fu};function yu(e){return Os(wu,e,[])}var bu="$ if upgrade to Pro: https://fpjs.dev/pro";function xu(e){var t=Su(e),n=Cu(t);return{score:t,comment:bu.replace(/\$/g,"".concat(n))}}function Su(e){if(cr())return .4;if(ye())return sr()&&!(Pt()&&Rt())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Cu(e){return Do(.99+.01*e,1e-4)}function Eu(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var o=r[n],i=e[o],a="error"in i?"error":JSON.stringify(i.value);t+="".concat(t?"|":"").concat(o.replace(/([:|\\])/g,"\\$1"),":").concat(a)}return t}function Ho(e){return JSON.stringify(e,function(t,n){return n instanceof Error?Ts(n):n},2)}function Yo(e){return Is(Eu(e))}function Ru(e){var t,n=xu(e);return{get visitorId(){return t===void 0&&(t=Yo(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:No}}function Pu(e){return e===void 0&&(e=50),xs(e,e*2)}function Au(e,t){var n=Date.now();return{get:function(r){return Me(this,void 0,void 0,function(){var o,i,a;return ke(this,function(s){switch(s.label){case 0:return o=Date.now(),[4,e()];case 1:return i=s.sent(),a=Ru(i),(t||r!=null&&r.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(a.version,`
|
|
6
|
+
userAgent: `).concat(navigator.userAgent,`
|
|
7
|
+
timeBetweenLoadAndGet: `).concat(o-n,`
|
|
8
|
+
visitorId: `).concat(a.visitorId,`
|
|
9
|
+
components: `).concat(Ho(i),"\n```")),[2,a]}})})}}}function Mu(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(No,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function ku(e){var t;return e===void 0&&(e={}),Me(this,void 0,void 0,function(){var n,r,o;return ke(this,function(i){switch(i.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Mu(),n=e.delayFallback,r=e.debug,[4,Pu(n)];case 1:return i.sent(),o=yu({cache:{},debug:r}),[2,Au(o,r)]}})})}var Iu={load:ku,hashComponents:Yo,componentsToDebugString:Ho};const Zo=(e,t={})=>{const{warnOnMissingResources:n=!0}=t;if(!e)throw new Error("Logto configuration is required. Please provide a valid LogtoConfig object to AuthProvider.");const r=[];if(!e.endpoint)r.push("`endpoint` (Logto URL) is required in configuration");else if(typeof e.endpoint!="string"||e.endpoint.trim()==="")r.push("`endpoint` must be a non-empty string");else try{new URL(e.endpoint)}catch{r.push('`endpoint` must be a valid URL (e.g., "https://your-tenant.logto.app")')}if(e.appId?(typeof e.appId!="string"||e.appId.trim()==="")&&r.push("`appId` must be a non-empty string"):r.push("`appId` is required in configuration"),n&&(!e.resources||e.resources.length===0)&&console.warn("Warning: No `resources` configured in Logto config. If you need to access protected backend APIs with JWTs, ensure at least one resource is configured. See: https://docs.logto.io/docs/recipes/configure-jwt-token"),r.length>0){const o=`Invalid Logto configuration:
|
|
10
|
+
`+r.map((i,a)=>` ${a+1}. ${i}`).join(`
|
|
11
|
+
`)+`
|
|
12
|
+
|
|
13
|
+
Please check your AuthProvider config. Example: <AuthProvider config={{ endpoint: "https://your-tenant.logto.app", appId: "your-app-id", resources: {...} }}>`;throw new Error(o)}},Tu=e=>e?{id:e.sub||"",name:e.name||e.username||"",email:e.email||"",avatar:e.picture||"",...e}:null,Xo=(e,t={})=>{try{if(typeof window>"u")return;const{replace:n=!1,force:r=!1}=t;if(!r&&(window.location.pathname===e||window.location.href===e))return;if(e.startsWith("/")&&window.history&&(window.history.pushState||window.history.replaceState)){n&&window.history.replaceState?window.history.replaceState(null,"",e):window.history.pushState&&window.history.pushState(null,"",e);const o=new PopStateEvent("popstate",{state:null});window.dispatchEvent(o);const i=new CustomEvent("navigate",{detail:{url:e,replace:n}});window.dispatchEvent(i);return}n?window.location.replace(e):window.location.href=e}catch(n){console.warn("Navigation failed, using fallback method:",n),window.location.href=e}},Lu=e=>{if(!e)return"U";const t=e.split(" ");return t.length===1?e.substring(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()},Ze={setCookie:(e,t,n={})=>{if(typeof document>"u")return;const{expires:r,maxAge:o,domain:i,path:a="/",secure:s=window.location.protocol==="https:",sameSite:c="lax"}=n;let u=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(r){const d=typeof r=="number"?new Date(Date.now()+r*24*60*60*1e3):r;u+=`; expires=${d.toUTCString()}`}o!==void 0&&(u+=`; max-age=${o}`),i&&(u+=`; domain=${i}`),a&&(u+=`; path=${a}`),s&&(u+="; secure"),c&&(u+=`; samesite=${c}`),document.cookie=u},getCookie:e=>{if(typeof document>"u")return null;const t=encodeURIComponent(e)+"=",n=document.cookie.split(";");for(let r of n)if(r=r.trim(),r.indexOf(t)===0)return decodeURIComponent(r.substring(t.length));return null},removeCookie:(e,t={})=>{if(typeof document>"u")return;const{domain:n,path:r="/"}=t;let o=`${encodeURIComponent(e)}=; expires=Thu, 01 Jan 1970 00:00:01 GMT`;n&&(o+=`; domain=${n}`),r&&(o+=`; path=${r}`),document.cookie=o}},$e={saveToken:e=>{Ze.setCookie("logto_authtoken",e,{expires:7,secure:!0,sameSite:"strict",path:"/"})},getToken:()=>Ze.getCookie("logto_authtoken"),removeToken:()=>{Ze.removeCookie("logto_authtoken",{path:"/"})}},_u={async generateGuestId(){try{return(await(await Iu.load()).get()).visitorId}catch(e){if(console.warn("Failed to generate fingerprint, falling back to UUID:",e),typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const t=new Uint8Array(16);return crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,Array.from(t).map((n,r)=>([4,6,8,10].includes(r)?"-":"")+n.toString(16).padStart(2,"0")).join("")}throw new Error("No cryptographically secure random source available for guest ID generation")}},getGuestId(){return Ze.getCookie("guest_logto_authtoken")},async setGuestId(e){if(typeof document>"u")return e||"";const t=e||await this.generateGuestId();return Ze.setCookie("guest_logto_authtoken",t,{expires:7,secure:!0,sameSite:"strict",path:"/"}),t},async ensureGuestId(){const e=this.getGuestId();return e||await this.setGuestId()},clearGuestId(){Ze.removeCookie("guest_logto_authtoken",{path:"/"})}};function Nu(...e){return Lo(rr(e))}const Ko=E.createContext(null),Ou=({children:e,customNavigate:t})=>{const n=E.useRef(t);E.useEffect(()=>{n.current=t},[t]);const r=E.useCallback((o,i)=>{const a=n.current;if(a){a(o,i);return}Xo(o,i)},[]);return y.jsx(Ko.Provider,{value:r,children:e})},Jo=()=>E.useContext(Ko)??Xo,$t=500,Du=250,ju=20,Gn="simple_logto_local_signout",Fu=6e4,Pn=1e3,Wu=15e3,Vu=e=>{try{const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");if(typeof atob=="function")return atob(n);if(typeof Buffer<"u")return Buffer.from(n,"base64").toString("utf8")}catch{return null}return null},$u=e=>{const t=e.split(".")[1];if(!t)return;const n=Vu(t);if(n)try{const r=JSON.parse(n);return typeof r.exp=="number"?r.exp:void 0}catch{return}},Gu=e=>e instanceof Error?e:new Error(String(e)),Bu=()=>typeof window>"u"?!1:window.sessionStorage.getItem(Gn)==="true",Uu=e=>{typeof window>"u"||(e?window.sessionStorage.setItem(Gn,"true"):window.sessionStorage.removeItem(Gn))},qo=E.createContext(void 0),zu=({children:e})=>{const[t,n]=E.useState(!1);return E.useEffect(()=>{n(!0)},[]),t?y.jsx(y.Fragment,{children:e}):null},Hu=({children:e,callbackUrl:t,enablePopupSignIn:n,logtoConfig:r,onTokenRefresh:o,onAuthError:i,onSignOut:a})=>{var Ar;const{isAuthenticated:s,isLoading:c,getIdTokenClaims:u,getAccessToken:d,signIn:l,signOut:f}=ln.useLogto(),[m,h]=E.useState(null),[v,g]=E.useState(!0),w=((Ar=r==null?void 0:r.resources)==null?void 0:Ar[0])||"urn:logto:resource:default",b=E.useRef(0),x=E.useRef(0),S=E.useRef(0),C=E.useRef(),A=E.useRef(),P=E.useRef(!1),R=E.useRef(),L=E.useRef(!1),T=E.useRef(),N=E.useRef(),k=E.useRef(),F=E.useRef(!1),O=E.useRef(0),Z=E.useRef(Bu()),D=E.useRef(),U=E.useRef(),I=E.useRef(o),M=E.useRef(i),V=E.useRef(a),z=3,oe=5,He=1e3;E.useEffect(()=>{I.current=o},[o]),E.useEffect(()=>{M.current=i},[i]),E.useEffect(()=>{V.current=a},[a]);const be=E.useCallback(G=>{var H;try{(H=M.current)==null||H.call(M,G)}catch(B){console.error("Error in AuthProvider onAuthError callback:",B)}},[]),Te=E.useCallback(G=>{var H;try{(H=V.current)==null||H.call(V,G)}catch(B){console.error("Error in AuthProvider onSignOut callback:",B)}},[]),xe=E.useCallback(G=>{var H;try{(H=I.current)==null||H.call(I,G)}catch(B){console.error("Error in AuthProvider onTokenRefresh callback:",B)}},[]),J=E.useCallback(()=>{D.current=void 0,U.current=void 0},[]),Se=E.useCallback(async(G,H,B)=>{Te({reason:G,global:!0,callbackUrl:B,error:H}),await f(B)},[Te,f]),Q=E.useCallback(()=>{clearTimeout(A.current),A.current=void 0},[]),ee=E.useCallback(()=>{Q(),R.current=void 0},[Q]),je=E.useCallback(()=>{clearTimeout(k.current),k.current=void 0,F.current=!1,O.current=0},[]),Ce=E.useCallback(G=>{Z.current=G,Uu(G)},[]),fe=E.useCallback((G=$t)=>{F.current=!0,O.current=0,clearTimeout(k.current),k.current=setTimeout(()=>{L.current||pe.current(!0)},G)},[]),mt=E.useCallback(G=>{if(Q(),!s||G===void 0)return;const H=R.current,K=G*1e3-Date.now(),j=H!==void 0&&G<=H;let q=K-Fu;j&&q<=Pn?q=Math.min(Math.max(K,Pn),Wu):q=Math.max(q,Pn),R.current=G,A.current=setTimeout(()=>{L.current||P.current||(P.current=!0,pe.current(!0).finally(()=>{P.current=!1}))},q)},[Q,s]),qe=E.useCallback(async G=>{if(c&&!G)return;const H=Date.now();if(!(!G&&H-b.current<He)){if(b.current=H,g(!0),s){if(Z.current){h(null),$e.removeToken(),J(),x.current=0,S.current=0,clearTimeout(C.current),ee(),g(!1);return}try{const B=await u(),K=await d(w);if(K){je();const j=Tu(B),q=$u(K),Ye=D.current,Dt=U.current;$e.saveToken(K),h(j),x.current=0,S.current=0,clearTimeout(C.current),D.current=K,U.current=q,Ye!==void 0&&Ye!==K&&j&&xe({user:j,accessToken:K,expiresAt:q,previousExpiresAt:Dt}),mt(q)}else{const j=new Error("Access token unavailable — session likely expired. Forcing logout.");console.warn(j.message),be({error:j,isTransient:!1,willSignOut:!0}),h(null),$e.removeToken(),ee(),J(),await Se("missing_access_token",j)}}catch(B){console.error("Error fetching user claims:",B);const K=Gu(B),j=K.message.toLowerCase(),q=typeof B=="object"&&B!==null&&"code"in B?B.code:void 0,Ye=j.includes("invalid")||j.includes("expired")||j.includes("grant request is invalid")||q==="invalid_grant";if(!Ye&&(B instanceof TypeError&&(j.includes("fetch")||j.includes("network"))||j.includes("networkerror")||j.includes("network error")||j.includes("timeout")||j.includes("econnrefused")||j.includes("enotfound")||j.includes("500")||j.includes("502")||j.includes("503")||j.includes("504"))){S.current+=1;const et=S.current>oe;be({error:K,isTransient:!0,willSignOut:et});const Le=Math.min(1e3*Math.pow(2,S.current-1),32e3);if(console.warn(`Transient auth error (attempt ${S.current}/${oe}). Retrying in ${Le}ms:`,B instanceof Error?B.message:B),S.current<=oe)clearTimeout(C.current),C.current=setTimeout(()=>{L.current||pe.current(!0)},Le);else{console.warn("Max transient error retries exceeded. Signing out to reset to a clean state."),h(null),$e.removeToken(),S.current=0,ee(),J();try{await Se("transient_error_limit",K)}catch(vt){console.error("Error during forced logout after transient retry exhaustion:",vt),typeof window<"u"&&window.dispatchEvent(new CustomEvent("auth-state-changed"))}}}else{clearTimeout(C.current),h(null),$e.removeToken(),ee(),x.current+=1,S.current=0;const et=Ye||x.current>=z;if(be({error:K,isTransient:!1,willSignOut:et}),et){console.warn("Authentication error detected, forcing logout:",K.message),J();try{await Se("auth_error",K)}catch(Le){console.error("Error during forced logout:",Le),typeof window<"u"&&window.dispatchEvent(new CustomEvent("auth-state-changed"))}x.current=0}}}}else{if(Z.current&&Ce(!1),G&&F.current){if(O.current<ju){O.current+=1,k.current=setTimeout(()=>{L.current||pe.current(!0)},Du),g(!1);return}je()}h(null),$e.removeToken(),J(),x.current=0,S.current=0,clearTimeout(C.current),ee()}g(!1)}},[je,J,w,be,xe,d,u,s,c,Se,ee,mt,Ce]);E.useEffect(()=>{qe()},[qe]),E.useEffect(()=>()=>{L.current=!0,clearTimeout(C.current),ee(),clearInterval(T.current),clearTimeout(N.current),clearTimeout(k.current)},[ee]);const pe=E.useRef(qe);pe.current=qe,E.useEffect(()=>{if(typeof window>"u")return;_u.ensureGuestId();let G=0;const H=j=>{j.key&&(j.key.includes("logto")||j.key.includes("auth"))&&setTimeout(()=>{pe.current()},100),j.key==="simple_logto_signin_complete"&&(localStorage.removeItem("simple_logto_signin_complete"),setTimeout(()=>{fe(),window.dispatchEvent(new CustomEvent("auth-state-changed"))},$t))},B=()=>{const j=Date.now();j-G>1e3&&(G=j,pe.current())},K=()=>{pe.current(F.current)};return window.addEventListener("storage",H),window.addEventListener("focus",B),window.addEventListener("auth-state-changed",K),()=>{window.removeEventListener("storage",H),window.removeEventListener("focus",B),window.removeEventListener("auth-state-changed",K)}},[fe]);const Nt=E.useCallback(async(G,H)=>{if(typeof window>"u")return;if(Ce(!1),window.opener&&window.opener!==window){const j=G||t||window.location.href;try{await l(j)}catch(q){throw console.error("Sign-in failed:",q),q}return}if(H??n){const Ye=window.innerWidth/2-250,Dt=window.innerHeight/2-770/2,et=`width=500,height=770,left=${Ye},top=${Dt},resizable=yes,scrollbars=yes,status=yes`,Le=window.open("/signin?popup=true","SignInPopup",et);if(!Le){console.warn("Sign-in popup was blocked by the browser. Users may need to allow popups for this site.");return}let vt;const jt=setInterval(()=>{Le.closed&&(clearInterval(jt),T.current=void 0,setTimeout(()=>{L.current||(fe(0),window.dispatchEvent(new CustomEvent("auth-state-changed")))},$t))},1e3);T.current=jt;const xn=Ft=>{Ft.origin===window.location.origin&&Ft.source===Le&&(Ft.data.type==="SIGNIN_SUCCESS"||Ft.data.type==="SIGNIN_COMPLETE")&&(clearTimeout(vt),N.current=void 0,window.removeEventListener("message",xn),clearInterval(jt),T.current=void 0,Le.close(),setTimeout(()=>{L.current||(fe(0),window.dispatchEvent(new CustomEvent("auth-state-changed")))},$t))};window.addEventListener("message",xn),vt=setTimeout(()=>{window.removeEventListener("message",xn),clearInterval(jt)},3e5),N.current=vt}else{const j=G||t||window.location.href;try{await l(j)}catch(q){throw console.error("Sign-in failed:",q),q}}},[n,t,l,fe,Ce]),Ot=E.useCallback(async G=>{if(typeof window>"u")return;const{callbackUrl:H,global:B=!0}=G||{};$e.removeToken(),ee(),J(),je(),Te({reason:"user",global:B,callbackUrl:H}),B?(Ce(!1),await f(H)):(Ce(!0),clearTimeout(C.current),h(null),g(!1),H&&(window.location.href=H)),window.dispatchEvent(new CustomEvent("auth-state-changed"))},[je,J,Te,f,ee,Ce]),Qe=E.useMemo(()=>({user:m,isLoadingUser:v,signIn:Nt,signOut:Ot,refreshAuth:()=>pe.current(),enablePopupSignIn:n}),[m,v,Nt,Ot,n]);return y.jsx(qo.Provider,{value:Qe,children:e})},Yu=({children:e,config:t,callbackUrl:n,customNavigate:r,enablePopupSignIn:o=!1,onTokenRefresh:i,onAuthError:a,onSignOut:s})=>(E.useEffect(()=>{var u,d;(typeof process<"u"?(u=process.env)==null?void 0:u.NODE_ENV:void 0)!=="production"&&(t!=null&&t.appId||console.warn("[logto-authkit] AuthProvider: `appId` is missing or empty.\nEvery Logto application needs an App ID from the Logto Console.\nDocs: https://docs.logto.io/quick-starts"),t!=null&&t.endpoint||console.warn('[logto-authkit] AuthProvider: `endpoint` (your Logto tenant URL) is missing or empty.\nExample: "https://your-tenant.logto.app"\nDocs: https://docs.logto.io/quick-starts'),(d=t==null?void 0:t.resources)!=null&&d.length||console.warn("[logto-authkit] AuthProvider: No `resources` (API identifiers) are configured.\nBackend JWT verification requires at least one API resource.\nDocs: https://docs.logto.io/docs/recipes/configure-jwt-token")),Zo(t,{warnOnMissingResources:!1})},[t]),y.jsx(zu,{children:y.jsx(ln.LogtoProvider,{config:t,children:y.jsx(Ou,{customNavigate:r,children:y.jsx(Hu,{logtoConfig:t,callbackUrl:n,enablePopupSignIn:o,onTokenRefresh:i,onAuthError:a,onSignOut:s,children:e})})})})),Qo=()=>{const e=E.useContext(qo);if(e===void 0)throw new Error("useAuthContext must be used within an AuthProvider");return e},fn=e=>{const t=Qo(),{user:n,isLoadingUser:r}=t,o=Jo(),i=E.useMemo(()=>({middleware:e==null?void 0:e.middleware,redirectTo:e==null?void 0:e.redirectTo,redirectIfAuthenticated:e==null?void 0:e.redirectIfAuthenticated,navigationOptions:e==null?void 0:e.navigationOptions}),[e==null?void 0:e.middleware,e==null?void 0:e.redirectTo,e==null?void 0:e.redirectIfAuthenticated,e==null?void 0:e.navigationOptions]);return E.useEffect(()=>{if(r)return;const{middleware:a,redirectTo:s,redirectIfAuthenticated:c,navigationOptions:u}=i;a==="auth"&&!n?o(s||"/signin",u):a==="guest"&&n&&c&&o(c,u)},[n,r,i,o]),t},Zu=["permissions","scope","scp"];function Bn(e){return(Array.isArray(e)?e:[e]).flatMap(t=>t.split(/[,\s]+/)).map(t=>t.trim()).filter(Boolean)}function Xu(e,t){if(!e)return[];for(const n of t){const r=e[n];if(Array.isArray(r)&&r.every(o=>typeof o=="string")||typeof r=="string")return Bn(r)}return[]}function Ku(e,t={}){const{user:n,isLoadingUser:r}=Qo();return E.useMemo(()=>{var c;if(r)return!1;const o=Bn(e);if(o.length===0)return!0;const i=(c=t.claimKeys)!=null&&c.length?t.claimKeys:Zu,a=Xu(n,i);return(t.mode??"all")==="any"?o.some(u=>a.includes(u)):o.every(u=>a.includes(u))},[r,t.claimKeys,t.mode,e,n])}/**
|
|
14
|
+
* @license lucide-react v0.575.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/const ei=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
19
|
+
* @license lucide-react v0.575.0 - ISC
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the ISC license.
|
|
22
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/const Ju=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
24
|
+
* @license lucide-react v0.575.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/const qu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
29
|
+
* @license lucide-react v0.575.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/const Br=e=>{const t=qu(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
34
|
+
* @license lucide-react v0.575.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var Qu={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"};/**
|
|
39
|
+
* @license lucide-react v0.575.0 - ISC
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the ISC license.
|
|
42
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/const el=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
44
|
+
* @license lucide-react v0.575.0 - ISC
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the ISC license.
|
|
47
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/const tl=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},c)=>E.createElement("svg",{ref:c,...Qu,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ei("lucide",o),...!i&&!el(s)&&{"aria-hidden":"true"},...s},[...a.map(([u,d])=>E.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
|
|
49
|
+
* @license lucide-react v0.575.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const ur=(e,t)=>{const n=E.forwardRef(({className:r,...o},i)=>E.createElement(tl,{ref:i,iconNode:t,className:ei(`lucide-${Ju(Br(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Br(e),n};/**
|
|
54
|
+
* @license lucide-react v0.575.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/const nl=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],rl=ur("circle-user",nl);/**
|
|
59
|
+
* @license lucide-react v0.575.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const ol=[["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"}]],il=ur("log-out",ol);/**
|
|
64
|
+
* @license lucide-react v0.575.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const al=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],sl=ur("user",al);function cl(e,t=[]){let n=[];function r(i,a){const s=p.createContext(a);s.displayName=i+"Context";const c=n.length;n=[...n,a];const u=l=>{var w;const{scope:f,children:m,...h}=l,v=((w=f==null?void 0:f[e])==null?void 0:w[c])||s,g=p.useMemo(()=>h,Object.values(h));return y.jsx(v.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(l,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[c])||s,h=p.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>p.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,ul(o,...t)]}function ul(...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(i){const a=r.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Pe(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var he=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function Ur(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function At(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Ur(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Ur(e[o],null)}}}}function ie(...e){return p.useCallback(At(...e),e)}var ll=Symbol.for("react.lazy"),nn=p[" use ".trim().toString()];function dl(e){return typeof e=="object"&&e!==null&&"then"in e}function ti(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ll&&"_payload"in e&&dl(e._payload)}function fl(e){const t=pl(e),n=p.forwardRef((r,o)=>{let{children:i,...a}=r;ti(i)&&typeof nn=="function"&&(i=nn(i._payload));const s=p.Children.toArray(i),c=s.find(vl);if(c){const u=c.props.children,d=s.map(l=>l===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:l);return y.jsx(t,{...a,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return y.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function pl(e){const t=p.forwardRef((n,r)=>{let{children:o,...i}=n;if(ti(o)&&typeof nn=="function"&&(o=nn(o._payload)),p.isValidElement(o)){const a=gl(o),s=hl(i,o.props);return o.type!==p.Fragment&&(s.ref=r?At(r,a):a),p.cloneElement(o,s)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ml=Symbol("radix.slottable");function vl(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ml}function hl(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const c=i(...s);return o(...s),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function gl(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 wl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lr=wl.reduce((e,t)=>{const n=fl(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Gt={exports:{}},An={};/**
|
|
69
|
+
* @license React
|
|
70
|
+
* use-sync-external-store-shim.production.js
|
|
71
|
+
*
|
|
72
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the MIT license found in the
|
|
75
|
+
* LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/var zr;function yl(){if(zr)return An;zr=1;var e=E;function t(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(l,f){var m=f(),h=r({inst:{value:m,getSnapshot:f}}),v=h[0].inst,g=h[1];return i(function(){v.value=m,v.getSnapshot=f,c(v)&&g({inst:v})},[l,m,f]),o(function(){return c(v)&&g({inst:v}),l(function(){c(v)&&g({inst:v})})},[l]),a(m),m}function c(l){var f=l.getSnapshot;l=l.value;try{var m=f();return!n(l,m)}catch{return!0}}function u(l,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return An.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,An}var Mn={};/**
|
|
77
|
+
* @license React
|
|
78
|
+
* use-sync-external-store-shim.development.js
|
|
79
|
+
*
|
|
80
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the MIT license found in the
|
|
83
|
+
* LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/var Hr;function bl(){return Hr||(Hr=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,h){return m===h&&(m!==0||1/m===1/h)||m!==m&&h!==h}function t(m,h){d||o.startTransition===void 0||(d=!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 v=h();if(!l){var g=h();i(v,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}g=a({inst:{value:v,getSnapshot:h}});var w=g[0].inst,b=g[1];return c(function(){w.value=v,w.getSnapshot=h,n(w)&&b({inst:w})},[m,v,h]),s(function(){return n(w)&&b({inst:w}),m(function(){n(w)&&b({inst:w})})},[m]),u(v),v}function n(m){var h=m.getSnapshot;m=m.value;try{var v=h();return!i(m,v)}catch{return!0}}function r(m,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=E,i=typeof Object.is=="function"?Object.is:e,a=o.useState,s=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,d=!1,l=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Mn.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Mn}var Yr;function xl(){return Yr||(Yr=1,process.env.NODE_ENV==="production"?Gt.exports=yl():Gt.exports=bl()),Gt.exports}var Sl=xl();function Cl(){return Sl.useSyncExternalStore(El,()=>!0,()=>!1)}function El(){return()=>{}}var dr="Avatar",[Rl]=cl(dr),[Pl,ni]=Rl(dr),ri=p.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=p.useState("idle");return y.jsx(Pl,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:y.jsx(lr.span,{...r,ref:t})})});ri.displayName=dr;var oi="AvatarImage",ii=p.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=ni(oi,n),s=Al(r,i),c=Pe(u=>{o(u),a.onImageLoadingStatusChange(u)});return he(()=>{s!=="idle"&&c(s)},[s,c]),s==="loaded"?y.jsx(lr.img,{...i,ref:t,src:r}):null});ii.displayName=oi;var ai="AvatarFallback",si=p.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=ni(ai,n),[a,s]=p.useState(r===void 0);return p.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?y.jsx(lr.span,{...o,ref:t}):null});si.displayName=ai;function Zr(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Al(e,{referrerPolicy:t,crossOrigin:n}){const r=Cl(),o=p.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,s]=p.useState(()=>Zr(i,e));return he(()=>{s(Zr(i,e))},[i,e]),he(()=>{const c=l=>()=>{s(l)};if(!i)return;const u=c("loaded"),d=c("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,t]),a}var ci=ri,ui=ii,li=si;function ze(...e){return Lo(rr(e))}const Un=p.forwardRef(({className:e,...t},n)=>y.jsx(ci,{ref:n,className:ze("relative flex shrink-0 overflow-hidden rounded-full",e),...t}));Un.displayName=ci.displayName;const di=p.forwardRef(({className:e,...t},n)=>y.jsx(ui,{ref:n,className:ze("aspect-square h-full w-full",e),...t}));di.displayName=ui.displayName;const zn=p.forwardRef(({className:e,...t},n)=>y.jsx(li,{ref:n,className:ze("flex h-full w-full items-center justify-center",e),...t}));zn.displayName=li.displayName;function W(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 Ml(e,t=[]){let n=[];function r(i,a){const s=p.createContext(a),c=n.length;n=[...n,a];const u=l=>{var w;const{scope:f,children:m,...h}=l,v=((w=f==null?void 0:f[e])==null?void 0:w[c])||s,g=p.useMemo(()=>h,Object.values(h));return y.jsx(v.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(l,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[c])||s,h=p.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>p.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,kl(o,...t)]}function kl(...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(i){const a=r.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Il=p[" useInsertionEffect ".trim().toString()]||he;function fi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=Tl({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:o;{const d=p.useRef(e!==void 0);p.useEffect(()=>{const l=d.current;l!==s&&console.warn(`${r} is changing from ${l?"controlled":"uncontrolled"} to ${s?"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.`),d.current=s},[s,r])}const u=p.useCallback(d=>{var l;if(s){const f=Ll(d)?d(e):d;f!==e&&((l=a.current)==null||l.call(a,f))}else i(d)},[s,e,i,a]);return[c,u]}function Tl({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),i=p.useRef(t);return Il(()=>{i.current=t},[t]),p.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Ll(e){return typeof e=="function"}function de(e){const t=Nl(e),n=p.forwardRef((r,o)=>{const{children:i,...a}=r,s=p.Children.toArray(i),c=s.find(Dl);if(c){const u=c.props.children,d=s.map(l=>l===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:l);return y.jsx(t,{...a,ref:o,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return y.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var _l=de("Slot");function Nl(e){const t=p.forwardRef((n,r)=>{const{children:o,...i}=n;if(p.isValidElement(o)){const a=Fl(o),s=jl(i,o.props);return o.type!==p.Fragment&&(s.ref=r?At(r,a):a),p.cloneElement(o,s)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ol=Symbol("radix.slottable");function Dl(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ol}function jl(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const c=i(...s);return o(...s),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Fl(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 Wl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vl=Wl.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $l(e,t=[]){let n=[];function r(i,a){const s=p.createContext(a),c=n.length;n=[...n,a];const u=l=>{var w;const{scope:f,children:m,...h}=l,v=((w=f==null?void 0:f[e])==null?void 0:w[c])||s,g=p.useMemo(()=>h,Object.values(h));return y.jsx(v.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(l,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[c])||s,h=p.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>p.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,Gl(o,...t)]}function Gl(...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(i){const a=r.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function pi(e){const t=e+"CollectionProvider",[n,r]=$l(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:w}=v,b=E.useRef(null),x=E.useRef(new Map).current;return y.jsx(o,{scope:g,itemMap:x,collectionRef:b,children:w})};a.displayName=t;const s=e+"CollectionSlot",c=de(s),u=E.forwardRef((v,g)=>{const{scope:w,children:b}=v,x=i(s,w),S=ie(g,x.collectionRef);return y.jsx(c,{ref:S,children:b})});u.displayName=s;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=de(d),m=E.forwardRef((v,g)=>{const{scope:w,children:b,...x}=v,S=E.useRef(null),C=ie(g,S),A=i(d,w);return E.useEffect(()=>(A.itemMap.set(S,{ref:S,...x}),()=>void A.itemMap.delete(S))),y.jsx(f,{[l]:"",ref:C,children:b})});m.displayName=d;function h(v){const g=i(e+"CollectionConsumer",v);return E.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${l}]`));return Array.from(g.itemMap.values()).sort((A,P)=>x.indexOf(A.ref.current)-x.indexOf(P.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},h,r]}function Bl(e,t=[]){let n=[];function r(i,a){const s=p.createContext(a),c=n.length;n=[...n,a];const u=l=>{var w;const{scope:f,children:m,...h}=l,v=((w=f==null?void 0:f[e])==null?void 0:w[c])||s,g=p.useMemo(()=>h,Object.values(h));return y.jsx(v.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(l,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[c])||s,h=p.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>p.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,Ul(o,...t)]}function Ul(...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(i){const a=r.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var zl=p.createContext(void 0);function mi(e){const t=p.useContext(zl);return e||t||"ltr"}var Hl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vi=Hl.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yl(e,t){e&&nr.flushSync(()=>e.dispatchEvent(t))}function Zl(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e);p.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 Xl="DismissableLayer",Hn="dismissableLayer.update",Kl="dismissableLayer.pointerDownOutside",Jl="dismissableLayer.focusOutside",Xr,hi=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gi=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...c}=e,u=p.useContext(hi),[d,l]=p.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=p.useState({}),h=ie(t,P=>l(P)),v=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(g),b=d?v.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=w,C=ed(P=>{const R=P.target,L=[...u.branches].some(T=>T.contains(R));!S||L||(o==null||o(P),a==null||a(P),P.defaultPrevented||s==null||s())},f),A=td(P=>{const R=P.target;[...u.branches].some(T=>T.contains(R))||(i==null||i(P),a==null||a(P),P.defaultPrevented||s==null||s())},f);return Zl(P=>{b===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},f),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Xr=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Kr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Xr)}},[d,f,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Kr())},[d,u]),p.useEffect(()=>{const P=()=>m({});return document.addEventListener(Hn,P),()=>document.removeEventListener(Hn,P)},[]),y.jsx(vi.div,{...c,ref:h,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,A.onFocusCapture),onBlurCapture:W(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,C.onPointerDownCapture)})});gi.displayName=Xl;var ql="DismissableLayerBranch",Ql=p.forwardRef((e,t)=>{const n=p.useContext(hi),r=p.useRef(null),o=ie(t,r);return p.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),y.jsx(vi.div,{...e,ref:o})});Ql.displayName=ql;function ed(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){wi(Kl,n,u,{discrete:!0})};const u={originalEvent:s};s.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",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function td(e,t=globalThis==null?void 0:globalThis.document){const n=Pe(e),r=p.useRef(!1);return p.useEffect(()=>{const o=i=>{i.target&&!r.current&&wi(Jl,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kr(){const e=new CustomEvent(Hn);document.dispatchEvent(e)}function wi(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Yl(o,i):o.dispatchEvent(i)}var kn=0;function nd(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jr()),document.body.insertAdjacentElement("beforeend",e[1]??Jr()),kn++,()=>{kn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kn--}},[])}function Jr(){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 rd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],od=rd.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),In="focusScope.autoFocusOnMount",Tn="focusScope.autoFocusOnUnmount",qr={bubbles:!1,cancelable:!0},id="FocusScope",yi=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,c]=p.useState(null),u=Pe(o),d=Pe(i),l=p.useRef(null),f=ie(t,v=>c(v)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(x){if(m.paused||!s)return;const S=x.target;s.contains(S)?l.current=S:Ge(l.current,{select:!0})},g=function(x){if(m.paused||!s)return;const S=x.relatedTarget;S!==null&&(s.contains(S)||Ge(l.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&Ge(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const b=new MutationObserver(w);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),b.disconnect()}}},[r,s,m.paused]),p.useEffect(()=>{if(s){eo.add(m);const v=document.activeElement;if(!s.contains(v)){const w=new CustomEvent(In,qr);s.addEventListener(In,u),s.dispatchEvent(w),w.defaultPrevented||(ad(dd(bi(s)),{select:!0}),document.activeElement===v&&Ge(s))}return()=>{s.removeEventListener(In,u),setTimeout(()=>{const w=new CustomEvent(Tn,qr);s.addEventListener(Tn,d),s.dispatchEvent(w),w.defaultPrevented||Ge(v??document.body,{select:!0}),s.removeEventListener(Tn,d),eo.remove(m)},0)}}},[s,u,d,m]);const h=p.useCallback(v=>{if(!n&&!r||m.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(g&&w){const b=v.currentTarget,[x,S]=sd(b);x&&S?!v.shiftKey&&w===S?(v.preventDefault(),n&&Ge(x,{select:!0})):v.shiftKey&&w===x&&(v.preventDefault(),n&&Ge(S,{select:!0})):w===b&&v.preventDefault()}},[n,r,m.paused]);return y.jsx(od.div,{tabIndex:-1,...a,ref:f,onKeyDown:h})});yi.displayName=id;function ad(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ge(r,{select:t}),document.activeElement!==n)return}function sd(e){const t=bi(e),n=Qr(t,e),r=Qr(t.reverse(),e);return[n,r]}function bi(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 Qr(e,t){for(const n of e)if(!cd(n,{upTo:t}))return n}function cd(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 ud(e){return e instanceof HTMLInputElement&&"select"in e}function Ge(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ud(e)&&t&&e.select()}}var eo=ld();function ld(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=to(e,t),e.unshift(t)},remove(t){var n;e=to(e,t),(n=e[0])==null||n.resume()}}}function to(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dd(e){return e.filter(t=>t.tagName!=="A")}var fd=p[" useId ".trim().toString()]||(()=>{}),pd=0;function Yn(e){const[t,n]=p.useState(fd());return he(()=>{n(r=>r??String(pd++))},[e]),e||(t?`radix-${t}`:"")}const md=["top","right","bottom","left"],Be=Math.min,se=Math.max,rn=Math.round,Bt=Math.floor,Re=e=>({x:e,y:e}),vd={left:"right",right:"left",bottom:"top",top:"bottom"},hd={start:"end",end:"start"};function Zn(e,t,n){return se(e,Be(t,n))}function Oe(e,t){return typeof e=="function"?e(t):e}function De(e){return e.split("-")[0]}function ft(e){return e.split("-")[1]}function fr(e){return e==="x"?"y":"x"}function pr(e){return e==="y"?"height":"width"}const gd=new Set(["top","bottom"]);function Ee(e){return gd.has(De(e))?"y":"x"}function mr(e){return fr(Ee(e))}function wd(e,t,n){n===void 0&&(n=!1);const r=ft(e),o=mr(e),i=pr(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=on(a)),[a,on(a)]}function yd(e){const t=on(e);return[Xn(e),t,Xn(t)]}function Xn(e){return e.replace(/start|end/g,t=>hd[t])}const no=["left","right"],ro=["right","left"],bd=["top","bottom"],xd=["bottom","top"];function Sd(e,t,n){switch(e){case"top":case"bottom":return n?t?ro:no:t?no:ro;case"left":case"right":return t?bd:xd;default:return[]}}function Cd(e,t,n,r){const o=ft(e);let i=Sd(De(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Xn)))),i}function on(e){return e.replace(/left|right|bottom|top/g,t=>vd[t])}function Ed(e){return{top:0,right:0,bottom:0,left:0,...e}}function xi(e){return typeof e!="number"?Ed(e):{top:e,right:e,bottom:e,left:e}}function an(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 oo(e,t,n){let{reference:r,floating:o}=e;const i=Ee(t),a=mr(t),s=pr(a),c=De(t),u=i==="y",d=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-o.width,y:l};break;default:m={x:r.x,y:r.y}}switch(ft(t)){case"start":m[a]-=f*(n&&u?-1:1);break;case"end":m[a]+=f*(n&&u?-1:1);break}return m}async function Rd(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:l="floating",altBoundary:f=!1,padding:m=0}=Oe(t,e),h=xi(m),g=s[f?l==="floating"?"reference":"floating":l],w=an(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:c})),b=l==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=an(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:c}):b);return{top:(w.top-C.top+h.top)/S.y,bottom:(C.bottom-w.bottom+h.bottom)/S.y,left:(w.left-C.left+h.left)/S.x,right:(C.right-w.right+h.right)/S.x}}const Pd=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:l}=oo(u,r,c),f=r,m={},h=0;for(let g=0;g<s.length;g++){var v;const{name:w,fn:b}=s[g],{x,y:S,data:C,reset:A}=await b({x:d,y:l,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:u,platform:{...a,detectOverflow:(v=a.detectOverflow)!=null?v:Rd},elements:{reference:e,floating:t}});d=x??d,l=S??l,m={...m,[w]:{...m[w],...C}},A&&h<=50&&(h++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:d,y:l}=oo(u,f,c)),g=-1)}return{x:d,y:l,placement:f,strategy:o,middlewareData:m}},Ad=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:u,padding:d=0}=Oe(e,t)||{};if(u==null)return{};const l=xi(d),f={x:n,y:r},m=mr(o),h=pr(m),v=await a.getDimensions(u),g=m==="y",w=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",S=i.reference[h]+i.reference[m]-f[m]-i.floating[h],C=f[m]-i.reference[m],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let P=A?A[x]:0;(!P||!await(a.isElement==null?void 0:a.isElement(A)))&&(P=s.floating[x]||i.floating[h]);const R=S/2-C/2,L=P/2-v[h]/2-1,T=Be(l[w],L),N=Be(l[b],L),k=T,F=P-v[h]-N,O=P/2-v[h]/2+R,Z=Zn(k,O,F),D=!c.arrow&&ft(o)!=null&&O!==Z&&i.reference[h]/2-(O<k?T:N)-v[h]/2<0,U=D?O<k?O-k:O-F:0;return{[m]:f[m]+U,data:{[m]:Z,centerOffset:O-Z-U,...D&&{alignmentOffset:U}},reset:D}}}),Md=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...g}=Oe(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=De(o),b=Ee(s),x=De(s)===s,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=f||(x||!v?[on(s)]:yd(s)),A=h!=="none";!f&&A&&C.push(...Cd(s,v,h,S));const P=[s,...C],R=await c.detectOverflow(t,g),L=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&L.push(R[w]),l){const O=wd(o,a,S);L.push(R[O[0]],R[O[1]])}if(T=[...T,{placement:o,overflows:L}],!L.every(O=>O<=0)){var N,k;const O=(((N=i.flip)==null?void 0:N.index)||0)+1,Z=P[O];if(Z&&(!(l==="alignment"?b!==Ee(Z):!1)||T.every(I=>Ee(I.placement)===b?I.overflows[0]>0:!0)))return{data:{index:O,overflows:T},reset:{placement:Z}};let D=(k=T.filter(U=>U.overflows[0]<=0).sort((U,I)=>U.overflows[1]-I.overflows[1])[0])==null?void 0:k.placement;if(!D)switch(m){case"bestFit":{var F;const U=(F=T.filter(I=>{if(A){const M=Ee(I.placement);return M===b||M==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(M=>M>0).reduce((M,V)=>M+V,0)]).sort((I,M)=>I[1]-M[1])[0])==null?void 0:F[0];U&&(D=U);break}case"initialPlacement":D=s;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function io(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ao(e){return md.some(t=>e[t]>=0)}const kd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Oe(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=io(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:ao(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=io(a,n.floating);return{data:{escapedOffsets:s,escaped:ao(s)}}}default:return{}}}}},Si=new Set(["left","top"]);async function Id(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=De(n),s=ft(n),c=Ee(n)==="y",u=Si.has(a)?-1:1,d=i&&c?-1:1,l=Oe(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return s&&typeof h=="number"&&(m=s==="end"?h*-1:h),c?{x:m*d,y:f*u}:{x:f*u,y:m*d}}const Td=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await Id(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},Ld=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:b,y:x}=w;return{x:b,y:x}}},...u}=Oe(e,t),d={x:n,y:r},l=await i.detectOverflow(t,u),f=Ee(De(o)),m=fr(f);let h=d[m],v=d[f];if(a){const w=m==="y"?"top":"left",b=m==="y"?"bottom":"right",x=h+l[w],S=h-l[b];h=Zn(x,h,S)}if(s){const w=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=v+l[w],S=v-l[b];v=Zn(x,v,S)}const g=c.fn({...t,[m]:h,[f]:v});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[m]:a,[f]:s}}}}}},_d=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:u=!0}=Oe(e,t),d={x:n,y:r},l=Ee(o),f=fr(l);let m=d[f],h=d[l];const v=Oe(s,t),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=f==="y"?"height":"width",S=i.reference[f]-i.floating[x]+g.mainAxis,C=i.reference[f]+i.reference[x]-g.mainAxis;m<S?m=S:m>C&&(m=C)}if(u){var w,b;const x=f==="y"?"width":"height",S=Si.has(De(o)),C=i.reference[l]-i.floating[x]+(S&&((w=a.offset)==null?void 0:w[l])||0)+(S?0:g.crossAxis),A=i.reference[l]+i.reference[x]+(S?0:((b=a.offset)==null?void 0:b[l])||0)-(S?g.crossAxis:0);h<C?h=C:h>A&&(h=A)}return{[f]:m,[l]:h}}}},Nd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...u}=Oe(e,t),d=await a.detectOverflow(t,u),l=De(o),f=ft(o),m=Ee(o)==="y",{width:h,height:v}=i.floating;let g,w;l==="top"||l==="bottom"?(g=l,w=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=l,g=f==="end"?"top":"bottom");const b=v-d.top-d.bottom,x=h-d.left-d.right,S=Be(v-d[g],b),C=Be(h-d[w],x),A=!t.middlewareData.shift;let P=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=b),A&&!f){const T=se(d.left,0),N=se(d.right,0),k=se(d.top,0),F=se(d.bottom,0);m?R=h-2*(T!==0||N!==0?T+N:se(d.left,d.right)):P=v-2*(k!==0||F!==0?k+F:se(d.top,d.bottom))}await c({...t,availableWidth:R,availableHeight:P});const L=await a.getDimensions(s.floating);return h!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function pn(){return typeof window<"u"}function pt(e){return Ci(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Ci(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ci(e){return pn()?e instanceof Node||e instanceof ce(e).Node:!1}function ge(e){return pn()?e instanceof Element||e instanceof ce(e).Element:!1}function Ae(e){return pn()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function so(e){return!pn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}const Od=new Set(["inline","contents"]);function Mt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=we(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Od.has(o)}const Dd=new Set(["table","td","th"]);function jd(e){return Dd.has(pt(e))}const Fd=[":popover-open",":modal"];function mn(e){return Fd.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wd=["transform","translate","scale","rotate","perspective"],Vd=["transform","translate","scale","rotate","perspective","filter"],$d=["paint","layout","strict","content"];function vr(e){const t=hr(),n=ge(e)?we(e):e;return Wd.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)||Vd.some(r=>(n.willChange||"").includes(r))||$d.some(r=>(n.contain||"").includes(r))}function Gd(e){let t=Ue(e);for(;Ae(t)&&!lt(t);){if(vr(t))return t;if(mn(t))return null;t=Ue(t)}return null}function hr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Bd=new Set(["html","body","#document"]);function lt(e){return Bd.has(pt(e))}function we(e){return ce(e).getComputedStyle(e)}function vn(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ue(e){if(pt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||so(e)&&e.host||Ie(e);return so(t)?t.host:t}function Ei(e){const t=Ue(e);return lt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ae(t)&&Mt(t)?t:Ei(t)}function xt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ei(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=ce(o);if(i){const s=Kn(a);return t.concat(a,a.visualViewport||[],Mt(o)?o:[],s&&n?xt(s):[])}return t.concat(o,xt(o,[],n))}function Kn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ri(e){const t=we(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ae(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=rn(n)!==i||rn(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function gr(e){return ge(e)?e:e.contextElement}function ct(e){const t=gr(e);if(!Ae(t))return Re(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ri(t);let a=(i?rn(n.width):n.width)/r,s=(i?rn(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Ud=Re(0);function Pi(e){const t=ce(e);return!hr()||!t.visualViewport?Ud:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ce(e)?!1:t}function Xe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=gr(e);let a=Re(1);t&&(r?ge(r)&&(a=ct(r)):a=ct(e));const s=zd(i,n,r)?Pi(i):Re(0);let c=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,d=o.width/a.x,l=o.height/a.y;if(i){const f=ce(i),m=r&&ge(r)?ce(r):r;let h=f,v=Kn(h);for(;v&&r&&m!==h;){const g=ct(v),w=v.getBoundingClientRect(),b=we(v),x=w.left+(v.clientLeft+parseFloat(b.paddingLeft))*g.x,S=w.top+(v.clientTop+parseFloat(b.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,l*=g.y,c+=x,u+=S,h=ce(v),v=Kn(h)}}return an({width:d,height:l,x:c,y:u})}function hn(e,t){const n=vn(e).scrollLeft;return t?t.left+n:Xe(Ie(e)).left+n}function Ai(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-hn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Hd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Ie(r),s=t?mn(t.floating):!1;if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Re(1);const d=Re(0),l=Ae(r);if((l||!l&&!i)&&((pt(r)!=="body"||Mt(a))&&(c=vn(r)),Ae(r))){const m=Xe(r);u=ct(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const f=a&&!l&&!i?Ai(a,c):Re(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:n.y*u.y-c.scrollTop*u.y+d.y+f.y}}function Yd(e){return Array.from(e.getClientRects())}function Zd(e){const t=Ie(e),n=vn(e),r=e.ownerDocument.body,o=se(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=se(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+hn(e);const s=-n.scrollTop;return we(r).direction==="rtl"&&(a+=se(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const co=25;function Xd(e,t){const n=ce(e),r=Ie(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const d=hr();(!d||d&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}const u=hn(r);if(u<=0){const d=r.ownerDocument,l=d.body,f=getComputedStyle(l),m=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(r.clientWidth-l.clientWidth-m);h<=co&&(i-=h)}else u<=co&&(i+=u);return{width:i,height:a,x:s,y:c}}const Kd=new Set(["absolute","fixed"]);function Jd(e,t){const n=Xe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ae(e)?ct(e):Re(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:a,height:s,x:c,y:u}}function uo(e,t,n){let r;if(t==="viewport")r=Xd(e,n);else if(t==="document")r=Zd(Ie(e));else if(ge(t))r=Jd(t,n);else{const o=Pi(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return an(r)}function Mi(e,t){const n=Ue(e);return n===t||!ge(n)||lt(n)?!1:we(n).position==="fixed"||Mi(n,t)}function qd(e,t){const n=t.get(e);if(n)return n;let r=xt(e,[],!1).filter(s=>ge(s)&&pt(s)!=="body"),o=null;const i=we(e).position==="fixed";let a=i?Ue(e):e;for(;ge(a)&&!lt(a);){const s=we(a),c=vr(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&Kd.has(o.position)||Mt(a)&&!c&&Mi(e,a))?r=r.filter(d=>d!==a):o=s,a=Ue(a)}return t.set(e,r),r}function Qd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?mn(t)?[]:qd(t,this._c):[].concat(n),r],s=a[0],c=a.reduce((u,d)=>{const l=uo(t,d,o);return u.top=se(l.top,u.top),u.right=Be(l.right,u.right),u.bottom=Be(l.bottom,u.bottom),u.left=se(l.left,u.left),u},uo(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ef(e){const{width:t,height:n}=Ri(e);return{width:t,height:n}}function tf(e,t,n){const r=Ae(t),o=Ie(t),i=n==="fixed",a=Xe(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Re(0);function u(){c.x=hn(o)}if(r||!r&&!i)if((pt(t)!=="body"||Mt(o))&&(s=vn(t)),r){const m=Xe(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?Ai(o,s):Re(0),l=a.left+s.scrollLeft-c.x-d.x,f=a.top+s.scrollTop-c.y-d.y;return{x:l,y:f,width:a.width,height:a.height}}function Ln(e){return we(e).position==="static"}function lo(e,t){if(!Ae(e)||we(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function ki(e,t){const n=ce(e);if(mn(e))return n;if(!Ae(e)){let o=Ue(e);for(;o&&!lt(o);){if(ge(o)&&!Ln(o))return o;o=Ue(o)}return n}let r=lo(e,t);for(;r&&jd(r)&&Ln(r);)r=lo(r,t);return r&<(r)&&Ln(r)&&!vr(r)?n:r||Gd(e)||n}const nf=async function(e){const t=this.getOffsetParent||ki,n=this.getDimensions,r=await n(e.floating);return{reference:tf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rf(e){return we(e).direction==="rtl"}const of={convertOffsetParentRelativeRectToViewportRelativeRect:Hd,getDocumentElement:Ie,getClippingRect:Qd,getOffsetParent:ki,getElementRects:nf,getClientRects:Yd,getDimensions:ef,getScale:ct,isElement:ge,isRTL:rf};function Ii(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function af(e,t){let n=null,r;const o=Ie(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:d,top:l,width:f,height:m}=u;if(s||t(),!f||!m)return;const h=Bt(l),v=Bt(o.clientWidth-(d+f)),g=Bt(o.clientHeight-(l+m)),w=Bt(d),x={rootMargin:-h+"px "+-v+"px "+-g+"px "+-w+"px",threshold:se(0,Be(1,c))||1};let S=!0;function C(A){const P=A[0].intersectionRatio;if(P!==c){if(!S)return a();P?a(!1,P):r=setTimeout(()=>{a(!1,1e-7)},1e3)}P===1&&!Ii(u,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),i}function sf(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=gr(e),d=o||i?[...u?xt(u):[],...xt(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const l=u&&s?af(u,n):null;let f=-1,m=null;a&&(m=new ResizeObserver(w=>{let[b]=w;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let h,v=c?Xe(e):null;c&&g();function g(){const w=Xe(e);v&&!Ii(v,w)&&n(),v=w,h=requestAnimationFrame(g)}return n(),()=>{var w;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),l==null||l(),(w=m)==null||w.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const cf=Td,uf=Ld,lf=Md,df=Nd,ff=kd,fo=Ad,pf=_d,mf=(e,t,n)=>{const r=new Map,o={platform:of,...n},i={...o.platform,_c:r};return Pd(e,t,{...o,platform:i})};var vf=typeof document<"u",hf=function(){},Kt=vf?E.useLayoutEffect:hf;function sn(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(!sn(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!sn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ti(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function po(e,t){const n=Ti(e);return Math.round(t*n)/n}function _n(e){const t=p.useRef(e);return Kt(()=>{t.current=e}),t}function gf(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[d,l]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);sn(f,r)||m(r);const[h,v]=p.useState(null),[g,w]=p.useState(null),b=p.useCallback(I=>{I!==A.current&&(A.current=I,v(I))},[]),x=p.useCallback(I=>{I!==P.current&&(P.current=I,w(I))},[]),S=i||h,C=a||g,A=p.useRef(null),P=p.useRef(null),R=p.useRef(d),L=c!=null,T=_n(c),N=_n(o),k=_n(u),F=p.useCallback(()=>{if(!A.current||!P.current)return;const I={placement:t,strategy:n,middleware:f};N.current&&(I.platform=N.current),mf(A.current,P.current,I).then(M=>{const V={...M,isPositioned:k.current!==!1};O.current&&!sn(R.current,V)&&(R.current=V,nr.flushSync(()=>{l(V)}))})},[f,t,n,N,k]);Kt(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,l(I=>({...I,isPositioned:!1})))},[u]);const O=p.useRef(!1);Kt(()=>(O.current=!0,()=>{O.current=!1}),[]),Kt(()=>{if(S&&(A.current=S),C&&(P.current=C),S&&C){if(T.current)return T.current(S,C,F);F()}},[S,C,F,T,L]);const Z=p.useMemo(()=>({reference:A,floating:P,setReference:b,setFloating:x}),[b,x]),D=p.useMemo(()=>({reference:S,floating:C}),[S,C]),U=p.useMemo(()=>{const I={position:n,left:0,top:0};if(!D.floating)return I;const M=po(D.floating,d.x),V=po(D.floating,d.y);return s?{...I,transform:"translate("+M+"px, "+V+"px)",...Ti(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:V}},[n,s,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:F,refs:Z,elements:D,floatingStyles:U}),[d,F,Z,D,U])}const wf=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?fo({element:r.current,padding:o}).fn(n):{}:r?fo({element:r,padding:o}).fn(n):{}}}},yf=(e,t)=>({...cf(e),options:[e,t]}),bf=(e,t)=>({...uf(e),options:[e,t]}),xf=(e,t)=>({...pf(e),options:[e,t]}),Sf=(e,t)=>({...lf(e),options:[e,t]}),Cf=(e,t)=>({...df(e),options:[e,t]}),Ef=(e,t)=>({...ff(e),options:[e,t]}),Rf=(e,t)=>({...wf(e),options:[e,t]});var Pf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Af=Pf.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Mf="Arrow",Li=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return y.jsx(Af.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Li.displayName=Mf;var kf=Li;function If(e,t=[]){let n=[];function r(i,a){const s=p.createContext(a),c=n.length;n=[...n,a];const u=l=>{var w;const{scope:f,children:m,...h}=l,v=((w=f==null?void 0:f[e])==null?void 0:w[c])||s,g=p.useMemo(()=>h,Object.values(h));return y.jsx(v.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(l,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[c])||s,h=p.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>p.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,Tf(o,...t)]}function Tf(...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(i){const a=r.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Lf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_i=Lf.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _f(e){const[t,n]=p.useState(void 0);return he(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wr="Popper",[Ni,Oi]=If(wr),[Nf,Di]=Ni(wr),ji=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return y.jsx(Nf,{scope:t,anchor:r,onAnchorChange:o,children:n})};ji.displayName=wr;var Fi="PopperAnchor",Wi=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Di(Fi,n),a=p.useRef(null),s=ie(t,a),c=p.useRef(null);return p.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||a.current,u!==c.current&&i.onAnchorChange(c.current)}),r?null:y.jsx(_i.div,{...o,ref:s})});Wi.displayName=Fi;var yr="PopperContent",[Of,Df]=Ni(yr),Vi=p.forwardRef((e,t)=>{var J,Se,Q,ee,je,Ce;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:l="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:h,...v}=e,g=Di(yr,n),[w,b]=p.useState(null),x=ie(t,fe=>b(fe)),[S,C]=p.useState(null),A=_f(S),P=(A==null?void 0:A.width)??0,R=(A==null?void 0:A.height)??0,L=r+(i!=="center"?"-"+i:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(u)?u:[u],k=N.length>0,F={padding:T,boundary:N.filter(Ff),altBoundary:k},{refs:O,floatingStyles:Z,placement:D,isPositioned:U,middlewareData:I}=gf({strategy:"fixed",placement:L,whileElementsMounted:(...fe)=>sf(...fe,{animationFrame:m==="always"}),elements:{reference:g.anchor},middleware:[yf({mainAxis:o+R,alignmentAxis:a}),c&&bf({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?xf():void 0,...F}),c&&Sf({...F}),Cf({...F,apply:({elements:fe,rects:mt,availableWidth:qe,availableHeight:pe})=>{const{width:Nt,height:Ot}=mt.reference,Qe=fe.floating.style;Qe.setProperty("--radix-popper-available-width",`${qe}px`),Qe.setProperty("--radix-popper-available-height",`${pe}px`),Qe.setProperty("--radix-popper-anchor-width",`${Nt}px`),Qe.setProperty("--radix-popper-anchor-height",`${Ot}px`)}}),S&&Rf({element:S,padding:s}),Wf({arrowWidth:P,arrowHeight:R}),f&&Ef({strategy:"referenceHidden",...F})]}),[M,V]=Bi(D),z=Pe(h);he(()=>{U&&(z==null||z())},[U,z]);const oe=(J=I.arrow)==null?void 0:J.x,He=(Se=I.arrow)==null?void 0:Se.y,be=((Q=I.arrow)==null?void 0:Q.centerOffset)!==0,[Te,xe]=p.useState();return he(()=>{w&&xe(window.getComputedStyle(w).zIndex)},[w]),y.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:U?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(ee=I.transformOrigin)==null?void 0:ee.x,(je=I.transformOrigin)==null?void 0:je.y].join(" "),...((Ce=I.hide)==null?void 0:Ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(Of,{scope:n,placedSide:M,onArrowChange:C,arrowX:oe,arrowY:He,shouldHideArrow:be,children:y.jsx(_i.div,{"data-side":M,"data-align":V,...v,ref:x,style:{...v.style,animation:U?void 0:"none"}})})})});Vi.displayName=yr;var $i="PopperArrow",jf={top:"bottom",right:"left",bottom:"top",left:"right"},Gi=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Df($i,r),a=jf[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:y.jsx(kf,{...o,ref:n,style:{...o.style,display:"block"}})})});Gi.displayName=$i;function Ff(e){return e!==null}var Wf=e=>({name:"transformOrigin",options:e,fn(t){var g,w,b;const{placement:n,rects:r,middlewareData:o}=t,a=((g=o.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=Bi(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let h="",v="";return u==="bottom"?(h=a?l:`${f}px`,v=`${-c}px`):u==="top"?(h=a?l:`${f}px`,v=`${r.floating.height+c}px`):u==="right"?(h=`${-c}px`,v=a?l:`${m}px`):u==="left"&&(h=`${r.floating.width+c}px`,v=a?l:`${m}px`),{data:{x:h,y:v}}}});function Bi(e){const[t,n="center"]=e.split("-");return[t,n]}var Vf=ji,$f=Wi,Gf=Vi,Bf=Gi,Uf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zf=Uf.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Hf="Portal",Ui=p.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=p.useState(!1);he(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Eo.createPortal(y.jsx(zf.div,{...r,ref:t}),a):null});Ui.displayName=Hf;function Yf(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var kt=e=>{const{present:t,children:n}=e,r=Zf(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),i=ie(r.ref,Xf(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:i}):null};kt.displayName="Presence";function Zf(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),i=p.useRef("none"),a=e?"mounted":"unmounted",[s,c]=Yf(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Ut(r.current);i.current=s==="mounted"?u:"none"},[s]),he(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,m=Ut(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),he(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,l=m=>{const v=Ut(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(c("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=m=>{m.target===t&&(i.current=Ut(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ut(e){return(e==null?void 0:e.animationName)||"none"}function Xf(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 Kf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],It=Kf.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Jf(e,t){e&&nr.flushSync(()=>e.dispatchEvent(t))}function qf(e,t=[]){let n=[];function r(i,a){const s=p.createContext(a),c=n.length;n=[...n,a];const u=l=>{var w;const{scope:f,children:m,...h}=l,v=((w=f==null?void 0:f[e])==null?void 0:w[c])||s,g=p.useMemo(()=>h,Object.values(h));return y.jsx(v.Provider,{value:g,children:m})};u.displayName=i+"Provider";function d(l,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[c])||s,h=p.useContext(m);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(a=>p.createContext(a));return function(s){const c=(s==null?void 0:s[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return o.scopeName=e,[r,Qf(o,...t)]}function Qf(...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(i){const a=r.reduce((s,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...s,...l}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var ep=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zi=ep.reduce((e,t)=>{const n=de(`Primitive.${t}`),r=p.forwardRef((o,i)=>{const{asChild:a,...s}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(c,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Nn="rovingFocusGroup.onEntryFocus",tp={bubbles:!1,cancelable:!0},Tt="RovingFocusGroup",[Jn,Hi,np]=pi(Tt),[rp,Yi]=qf(Tt,[np]),[op,ip]=rp(Tt),Zi=p.forwardRef((e,t)=>y.jsx(Jn.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx(Jn.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(ap,{...e,ref:t})})}));Zi.displayName=Tt;var ap=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...l}=e,f=p.useRef(null),m=ie(t,f),h=mi(i),[v,g]=fi({prop:a,defaultProp:s??null,onChange:c,caller:Tt}),[w,b]=p.useState(!1),x=Pe(u),S=Hi(n),C=p.useRef(!1),[A,P]=p.useState(0);return p.useEffect(()=>{const R=f.current;if(R)return R.addEventListener(Nn,x),()=>R.removeEventListener(Nn,x)},[x]),y.jsx(op,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:v,onItemFocus:p.useCallback(R=>g(R),[g]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:p.useCallback(()=>P(R=>R-1),[]),children:y.jsx(zi.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...e.style},onMouseDown:W(e.onMouseDown,()=>{C.current=!0}),onFocus:W(e.onFocus,R=>{const L=!C.current;if(R.target===R.currentTarget&&L&&!w){const T=new CustomEvent(Nn,tp);if(R.currentTarget.dispatchEvent(T),!T.defaultPrevented){const N=S().filter(D=>D.focusable),k=N.find(D=>D.active),F=N.find(D=>D.id===v),Z=[k,F,...N].filter(Boolean).map(D=>D.ref.current);Ji(Z,d)}}C.current=!1}),onBlur:W(e.onBlur,()=>b(!1))})})}),Xi="RovingFocusGroupItem",Ki=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...s}=e,c=Yn(),u=i||c,d=ip(Xi,n),l=d.currentTabStopId===u,f=Hi(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:v}=d;return p.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),y.jsx(Jn.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:y.jsx(zi.span,{tabIndex:l?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:W(e.onMouseDown,g=>{r?d.onItemFocus(u):g.preventDefault()}),onFocus:W(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:W(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=up(g,d.orientation,d.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=f().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")x.reverse();else if(w==="prev"||w==="next"){w==="prev"&&x.reverse();const S=x.indexOf(g.currentTarget);x=d.loop?lp(x,S+1):x.slice(S+1)}setTimeout(()=>Ji(x))}}),children:typeof a=="function"?a({isCurrentTabStop:l,hasTabStop:v!=null}):a})})});Ki.displayName=Xi;var sp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function up(e,t,n){const r=cp(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sp[r]}function Ji(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function lp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dp=Zi,fp=Ki,pp=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ot=new WeakMap,zt=new WeakMap,Ht={},On=0,qi=function(e){return e&&(e.host||qi(e.parentNode))},mp=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qi(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})},vp=function(e,t,n,r){var o=mp(t,Array.isArray(e)?e:[e]);Ht[n]||(Ht[n]=new WeakMap);var i=Ht[n],a=[],s=new Set,c=new Set(o),u=function(l){!l||s.has(l)||(s.add(l),u(l.parentNode))};o.forEach(u);var d=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(f){if(s.has(f))d(f);else try{var m=f.getAttribute(r),h=m!==null&&m!=="false",v=(ot.get(f)||0)+1,g=(i.get(f)||0)+1;ot.set(f,v),i.set(f,g),a.push(f),v===1&&h&&zt.set(f,!0),g===1&&f.setAttribute(n,"true"),h||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return d(t),s.clear(),On++,function(){a.forEach(function(l){var f=ot.get(l)-1,m=i.get(l)-1;ot.set(l,f),i.set(l,m),f||(zt.has(l)||l.removeAttribute(r),zt.delete(l)),m||l.removeAttribute(n)}),On--,On||(ot=new WeakMap,ot=new WeakMap,zt=new WeakMap,Ht={})}},hp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=pp(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),vp(r,o,n,"aria-hidden")):function(){return null}},Jt="right-scroll-bar-position",qt="width-before-scroll-bar",gp="with-scroll-bars-hidden",wp="--removed-body-scroll-bar-size";function Dn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yp(e,t){var n=E.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 bp=typeof window<"u"?p.useLayoutEffect:p.useEffect,mo=new WeakMap;function xp(e,t){var n=yp(null,function(r){return e.forEach(function(o){return Dn(o,r)})});return bp(function(){var r=mo.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Dn(s,null)}),i.forEach(function(s){o.has(s)||Dn(s,a)})}mo.set(n,e)},[e]),n}function Sp(e){return e}function Cp(e,t){t===void 0&&(t=Sp);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function Ep(e){e===void 0&&(e={});var t=Cp(null);return t.options=ve({async:!0,ssr:!1},e),t}var Qi=function(e){var t=e.sideCar,n=_o(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 p.createElement(r,ve({},n))};Qi.isSideCarExport=!0;function Rp(e,t){return e.useMedium(t),Qi}var ea=Ep(),jn=function(){},gn=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:jn,onWheelCapture:jn,onTouchMoveCapture:jn}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,l=e.shards,f=e.sideCar,m=e.noRelative,h=e.noIsolation,v=e.inert,g=e.allowPinchZoom,w=e.as,b=w===void 0?"div":w,x=e.gapMode,S=_o(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,A=xp([n,t]),P=ve(ve({},S),o);return p.createElement(p.Fragment,null,d&&p.createElement(C,{sideCar:ea,removeScrollBar:u,shards:l,noRelative:m,noIsolation:h,inert:v,setCallbacks:i,allowPinchZoom:!!g,lockRef:n,gapMode:x}),a?p.cloneElement(p.Children.only(s),ve(ve({},P),{ref:A})):p.createElement(b,ve({},P,{className:c,ref:A}),s))});gn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gn.classNames={fullWidth:qt,zeroRight:Jt};var Pp=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ap(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Pp();return t&&e.setAttribute("nonce",t),e}function Mp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kp(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ip=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ap())&&(Mp(t,n),kp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tp=function(){var e=Ip();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ta=function(){var e=Tp(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Lp={left:0,top:0,right:0,gap:0},Fn=function(e){return parseInt(e||"",10)||0},_p=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[Fn(n),Fn(r),Fn(o)]},Np=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lp;var t=_p(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])}},Op=ta(),ut="data-scroll-locked",Dp=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
85
|
+
.`.concat(gp,` {
|
|
86
|
+
overflow: hidden `).concat(r,`;
|
|
87
|
+
padding-right: `).concat(s,"px ").concat(r,`;
|
|
88
|
+
}
|
|
89
|
+
body[`).concat(ut,`] {
|
|
90
|
+
overflow: hidden `).concat(r,`;
|
|
91
|
+
overscroll-behavior: contain;
|
|
92
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
93
|
+
padding-left: `.concat(o,`px;
|
|
94
|
+
padding-top: `).concat(i,`px;
|
|
95
|
+
padding-right: `).concat(a,`px;
|
|
96
|
+
margin-left:0;
|
|
97
|
+
margin-top:0;
|
|
98
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
99
|
+
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.`).concat(Jt,` {
|
|
103
|
+
right: `).concat(s,"px ").concat(r,`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.`).concat(qt,` {
|
|
107
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.`).concat(Jt," .").concat(Jt,` {
|
|
111
|
+
right: 0 `).concat(r,`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.`).concat(qt," .").concat(qt,` {
|
|
115
|
+
margin-right: 0 `).concat(r,`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
body[`).concat(ut,`] {
|
|
119
|
+
`).concat(wp,": ").concat(s,`px;
|
|
120
|
+
}
|
|
121
|
+
`)},vo=function(){var e=parseInt(document.body.getAttribute(ut)||"0",10);return isFinite(e)?e:0},jp=function(){p.useEffect(function(){return document.body.setAttribute(ut,(vo()+1).toString()),function(){var e=vo()-1;e<=0?document.body.removeAttribute(ut):document.body.setAttribute(ut,e.toString())}},[])},Fp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;jp();var i=p.useMemo(function(){return Np(o)},[o]);return p.createElement(Op,{styles:Dp(i,!t,o,n?"":"!important")})},qn=!1;if(typeof window<"u")try{var Yt=Object.defineProperty({},"passive",{get:function(){return qn=!0,!0}});window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{qn=!1}var it=qn?{passive:!1}:!1,Wp=function(e){return e.tagName==="TEXTAREA"},na=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wp(e)&&n[t]==="visible")},Vp=function(e){return na(e,"overflowY")},$p=function(e){return na(e,"overflowX")},ho=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ra(e,r);if(o){var i=oa(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gp=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Bp=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ra=function(e,t){return e==="v"?Vp(t):$p(t)},oa=function(e,t){return e==="v"?Gp(t):Bp(t)},Up=function(e,t){return e==="h"&&t==="rtl"?-1:1},zp=function(e,t,n,r,o){var i=Up(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,c=t.contains(s),u=!1,d=a>0,l=0,f=0;do{if(!s)break;var m=oa(e,s),h=m[0],v=m[1],g=m[2],w=v-g-i*h;(h||w)&&ra(e,s)&&(l+=w,f+=h);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(d&&Math.abs(l)<1||!d&&Math.abs(f)<1)&&(u=!0),u},Zt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},go=function(e){return[e.deltaX,e.deltaY]},wo=function(e){return e&&"current"in e?e.current:e},Hp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yp=function(e){return`
|
|
122
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
123
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
124
|
+
`)},Zp=0,at=[];function Xp(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(Zp++)[0],i=p.useState(ta)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=ir([e.lockRef.current],(e.shards||[]).map(wo),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=p.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var w=Zt(v),b=n.current,x="deltaX"in v?v.deltaX:b[0]-w[0],S="deltaY"in v?v.deltaY:b[1]-w[1],C,A=v.target,P=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in v&&P==="h"&&A.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,T=L?L===A||L.contains(A):!1;if(T)return!1;var N=ho(P,A);if(!N)return!0;if(N?C=P:(C=P==="v"?"h":"v",N=ho(P,A)),!N)return!1;if(!r.current&&"changedTouches"in v&&(x||S)&&(r.current=C),!C)return!0;var k=r.current||C;return zp(k,g,v,k==="h"?x:S)},[]),c=p.useCallback(function(v){var g=v;if(!(!at.length||at[at.length-1]!==i)){var w="deltaY"in g?go(g):Zt(g),b=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&Hp(C.delta,w)})[0];if(b&&b.should){g.cancelable&&g.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(wo).filter(Boolean).filter(function(C){return C.contains(g.target)}),S=x.length>0?s(g,x[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),u=p.useCallback(function(v,g,w,b){var x={name:v,delta:g,target:w,should:b,shadowParent:Kp(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=p.useCallback(function(v){n.current=Zt(v),r.current=void 0},[]),l=p.useCallback(function(v){u(v.type,go(v),v.target,s(v,e.lockRef.current))},[]),f=p.useCallback(function(v){u(v.type,Zt(v),v.target,s(v,e.lockRef.current))},[]);p.useEffect(function(){return at.push(i),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",c,it),document.addEventListener("touchmove",c,it),document.addEventListener("touchstart",d,it),function(){at=at.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,it),document.removeEventListener("touchmove",c,it),document.removeEventListener("touchstart",d,it)}},[]);var m=e.removeScrollBar,h=e.inert;return p.createElement(p.Fragment,null,h?p.createElement(i,{styles:Yp(o)}):null,m?p.createElement(Fp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Kp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Jp=Rp(ea,Xp);var ia=p.forwardRef(function(e,t){return p.createElement(gn,ve({},e,{ref:t,sideCar:Jp}))});ia.classNames=gn.classNames;var Qn=["Enter"," "],qp=["ArrowDown","PageUp","Home"],aa=["ArrowUp","PageDown","End"],Qp=[...qp,...aa],em={ltr:[...Qn,"ArrowRight"],rtl:[...Qn,"ArrowLeft"]},tm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lt="Menu",[St,nm,rm]=pi(Lt),[Ke,sa]=Bl(Lt,[rm,Oi,Yi]),wn=Oi(),ca=Yi(),[om,Je]=Ke(Lt),[im,_t]=Ke(Lt),ua=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=wn(t),[c,u]=p.useState(null),d=p.useRef(!1),l=Pe(i),f=mi(o);return p.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),y.jsx(Vf,{...s,children:y.jsx(om,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:y.jsx(im,{scope:t,onClose:p.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};ua.displayName=Lt;var am="MenuAnchor",br=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=wn(n);return y.jsx($f,{...o,...r,ref:t})});br.displayName=am;var xr="MenuPortal",[sm,la]=Ke(xr,{forceMount:void 0}),da=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Je(xr,t);return y.jsx(sm,{scope:t,forceMount:n,children:y.jsx(kt,{present:n||i.open,children:y.jsx(Ui,{asChild:!0,container:o,children:r})})})};da.displayName=xr;var le="MenuContent",[cm,Sr]=Ke(le),fa=p.forwardRef((e,t)=>{const n=la(le,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Je(le,e.__scopeMenu),a=_t(le,e.__scopeMenu);return y.jsx(St.Provider,{scope:e.__scopeMenu,children:y.jsx(kt,{present:r||i.open,children:y.jsx(St.Slot,{scope:e.__scopeMenu,children:a.modal?y.jsx(um,{...o,ref:t}):y.jsx(lm,{...o,ref:t})})})})}),um=p.forwardRef((e,t)=>{const n=Je(le,e.__scopeMenu),r=p.useRef(null),o=ie(t,r);return p.useEffect(()=>{const i=r.current;if(i)return hp(i)},[]),y.jsx(Cr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lm=p.forwardRef((e,t)=>{const n=Je(le,e.__scopeMenu);return y.jsx(Cr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),dm=de("MenuContent.ScrollLock"),Cr=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:f,onDismiss:m,disableOutsideScroll:h,...v}=e,g=Je(le,n),w=_t(le,n),b=wn(n),x=ca(n),S=nm(n),[C,A]=p.useState(null),P=p.useRef(null),R=ie(t,P,g.onContentChange),L=p.useRef(0),T=p.useRef(""),N=p.useRef(0),k=p.useRef(null),F=p.useRef("right"),O=p.useRef(0),Z=h?ia:p.Fragment,D=h?{as:dm,allowPinchZoom:!0}:void 0,U=M=>{var J,Se;const V=T.current+M,z=S().filter(Q=>!Q.disabled),oe=document.activeElement,He=(J=z.find(Q=>Q.ref.current===oe))==null?void 0:J.textValue,be=z.map(Q=>Q.textValue),Te=Cm(be,V,He),xe=(Se=z.find(Q=>Q.textValue===Te))==null?void 0:Se.ref.current;(function Q(ee){T.current=ee,window.clearTimeout(L.current),ee!==""&&(L.current=window.setTimeout(()=>Q(""),1e3))})(V),xe&&setTimeout(()=>xe.focus())};p.useEffect(()=>()=>window.clearTimeout(L.current),[]),nd();const I=p.useCallback(M=>{var z,oe;return F.current===((z=k.current)==null?void 0:z.side)&&Rm(M,(oe=k.current)==null?void 0:oe.area)},[]);return y.jsx(cm,{scope:n,searchRef:T,onItemEnter:p.useCallback(M=>{I(M)&&M.preventDefault()},[I]),onItemLeave:p.useCallback(M=>{var V;I(M)||((V=P.current)==null||V.focus(),A(null))},[I]),onTriggerLeave:p.useCallback(M=>{I(M)&&M.preventDefault()},[I]),pointerGraceTimerRef:N,onPointerGraceIntentChange:p.useCallback(M=>{k.current=M},[]),children:y.jsx(Z,{...D,children:y.jsx(yi,{asChild:!0,trapped:o,onMountAutoFocus:W(i,M=>{var V;M.preventDefault(),(V=P.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:y.jsx(gi,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:f,onDismiss:m,children:y.jsx(dp,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:A,onEntryFocus:W(c,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(Gf,{role:"menu","aria-orientation":"vertical","data-state":Ma(g.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:R,style:{outline:"none",...v.style},onKeyDown:W(v.onKeyDown,M=>{const z=M.target.closest("[data-radix-menu-content]")===M.currentTarget,oe=M.ctrlKey||M.altKey||M.metaKey,He=M.key.length===1;z&&(M.key==="Tab"&&M.preventDefault(),!oe&&He&&U(M.key));const be=P.current;if(M.target!==be||!Qp.includes(M.key))return;M.preventDefault();const xe=S().filter(J=>!J.disabled).map(J=>J.ref.current);aa.includes(M.key)&&xe.reverse(),xm(xe)}),onBlur:W(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(L.current),T.current="")}),onPointerMove:W(e.onPointerMove,Ct(M=>{const V=M.target,z=O.current!==M.clientX;if(M.currentTarget.contains(V)&&z){const oe=M.clientX>O.current?"right":"left";F.current=oe,O.current=M.clientX}}))})})})})})})});fa.displayName=le;var fm="MenuGroup",Er=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(It.div,{role:"group",...r,ref:t})});Er.displayName=fm;var pm="MenuLabel",pa=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(It.div,{...r,ref:t})});pa.displayName=pm;var cn="MenuItem",yo="menu.itemSelect",yn=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=p.useRef(null),a=_t(cn,e.__scopeMenu),s=Sr(cn,e.__scopeMenu),c=ie(t,i),u=p.useRef(!1),d=()=>{const l=i.current;if(!n&&l){const f=new CustomEvent(yo,{bubbles:!0,cancelable:!0});l.addEventListener(yo,m=>r==null?void 0:r(m),{once:!0}),Jf(l,f),f.defaultPrevented?u.current=!1:a.onClose()}};return y.jsx(ma,{...o,ref:c,disabled:n,onClick:W(e.onClick,d),onPointerDown:l=>{var f;(f=e.onPointerDown)==null||f.call(e,l),u.current=!0},onPointerUp:W(e.onPointerUp,l=>{var f;u.current||(f=l.currentTarget)==null||f.click()}),onKeyDown:W(e.onKeyDown,l=>{const f=s.searchRef.current!=="";n||f&&l.key===" "||Qn.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});yn.displayName=cn;var ma=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=Sr(cn,n),s=ca(n),c=p.useRef(null),u=ie(t,c),[d,l]=p.useState(!1),[f,m]=p.useState("");return p.useEffect(()=>{const h=c.current;h&&m((h.textContent??"").trim())},[i.children]),y.jsx(St.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:y.jsx(fp,{asChild:!0,...s,focusable:!r,children:y.jsx(It.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:W(e.onPointerMove,Ct(h=>{r?a.onItemLeave(h):(a.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,Ct(h=>a.onItemLeave(h))),onFocus:W(e.onFocus,()=>l(!0)),onBlur:W(e.onBlur,()=>l(!1))})})})}),mm="MenuCheckboxItem",va=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return y.jsx(ba,{scope:e.__scopeMenu,checked:n,children:y.jsx(yn,{role:"menuitemcheckbox","aria-checked":un(n)?"mixed":n,...o,ref:t,"data-state":Pr(n),onSelect:W(o.onSelect,()=>r==null?void 0:r(un(n)?!0:!n),{checkForDefaultPrevented:!1})})})});va.displayName=mm;var ha="MenuRadioGroup",[vm,hm]=Ke(ha,{value:void 0,onValueChange:()=>{}}),ga=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Pe(r);return y.jsx(vm,{scope:e.__scopeMenu,value:n,onValueChange:i,children:y.jsx(Er,{...o,ref:t})})});ga.displayName=ha;var wa="MenuRadioItem",ya=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=hm(wa,e.__scopeMenu),i=n===o.value;return y.jsx(ba,{scope:e.__scopeMenu,checked:i,children:y.jsx(yn,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Pr(i),onSelect:W(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});ya.displayName=wa;var Rr="MenuItemIndicator",[ba,gm]=Ke(Rr,{checked:!1}),xa=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=gm(Rr,n);return y.jsx(kt,{present:r||un(i.checked)||i.checked===!0,children:y.jsx(It.span,{...o,ref:t,"data-state":Pr(i.checked)})})});xa.displayName=Rr;var wm="MenuSeparator",Sa=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(It.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Sa.displayName=wm;var ym="MenuArrow",Ca=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=wn(n);return y.jsx(Bf,{...o,...r,ref:t})});Ca.displayName=ym;var bm="MenuSub",[Sv,Ea]=Ke(bm),wt="MenuSubTrigger",Ra=p.forwardRef((e,t)=>{const n=Je(wt,e.__scopeMenu),r=_t(wt,e.__scopeMenu),o=Ea(wt,e.__scopeMenu),i=Sr(wt,e.__scopeMenu),a=p.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},d=p.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const l=s.current;return()=>{window.clearTimeout(l),c(null)}},[s,c]),y.jsx(br,{asChild:!0,...u,children:y.jsx(ma,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ma(n.open),...e,ref:At(t,o.onTriggerChange),onClick:l=>{var f;(f=e.onClick)==null||f.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,Ct(l=>{i.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:W(e.onPointerLeave,Ct(l=>{var m,h;d();const f=(m=n.content)==null?void 0:m.getBoundingClientRect();if(f){const v=(h=n.content)==null?void 0:h.dataset.side,g=v==="right",w=g?-5:5,b=f[g?"left":"right"],x=f[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+w,y:l.clientY},{x:b,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:b,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,l=>{var m;const f=i.searchRef.current!=="";e.disabled||f&&l.key===" "||em[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});Ra.displayName=wt;var Pa="MenuSubContent",Aa=p.forwardRef((e,t)=>{const n=la(le,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Je(le,e.__scopeMenu),a=_t(le,e.__scopeMenu),s=Ea(Pa,e.__scopeMenu),c=p.useRef(null),u=ie(t,c);return y.jsx(St.Provider,{scope:e.__scopeMenu,children:y.jsx(kt,{present:r||i.open,children:y.jsx(St.Slot,{scope:e.__scopeMenu,children:y.jsx(Cr,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;a.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:W(e.onFocusOutside,d=>{d.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:W(e.onKeyDown,d=>{var m;const l=d.currentTarget.contains(d.target),f=tm[a.dir].includes(d.key);l&&f&&(i.onOpenChange(!1),(m=s.trigger)==null||m.focus(),d.preventDefault())})})})})})});Aa.displayName=Pa;function Ma(e){return e?"open":"closed"}function un(e){return e==="indeterminate"}function Pr(e){return un(e)?"indeterminate":e?"checked":"unchecked"}function xm(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Sm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Cm(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=Sm(e,Math.max(i,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 Em(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],c=t[a],u=s.x,d=s.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}function Rm(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Em(n,t)}function Ct(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Pm=ua,Am=br,Mm=da,km=fa,Im=Er,Tm=pa,Lm=yn,_m=va,Nm=ga,Om=ya,Dm=xa,jm=Sa,Fm=Ca,Wm=Ra,Vm=Aa,bn="DropdownMenu",[$m]=Ml(bn,[sa]),re=sa(),[Gm,ka]=$m(bn),Ia=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=re(t),u=p.useRef(null),[d,l]=fi({prop:o,defaultProp:i??!1,onChange:a,caller:bn});return y.jsx(Gm,{scope:t,triggerId:Yn(),triggerRef:u,contentId:Yn(),open:d,onOpenChange:l,onOpenToggle:p.useCallback(()=>l(f=>!f),[l]),modal:s,children:y.jsx(Pm,{...c,open:d,onOpenChange:l,dir:r,modal:s,children:n})})};Ia.displayName=bn;var Ta="DropdownMenuTrigger",La=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=ka(Ta,n),a=re(n);return y.jsx(Am,{asChild:!0,...a,children:y.jsx(Vl.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:At(t,i.triggerRef),onPointerDown:W(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:W(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});La.displayName=Ta;var Bm="DropdownMenuPortal",_a=e=>{const{__scopeDropdownMenu:t,...n}=e,r=re(t);return y.jsx(Mm,{...r,...n})};_a.displayName=Bm;var Na="DropdownMenuContent",Oa=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ka(Na,n),i=re(n),a=p.useRef(!1);return y.jsx(km,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,s=>{var c;a.current||(c=o.triggerRef.current)==null||c.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:W(e.onInteractOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!o.modal||d)&&(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)"}})});Oa.displayName=Na;var Um="DropdownMenuGroup",zm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Im,{...o,...r,ref:t})});zm.displayName=Um;var Hm="DropdownMenuLabel",Da=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Tm,{...o,...r,ref:t})});Da.displayName=Hm;var Ym="DropdownMenuItem",ja=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Lm,{...o,...r,ref:t})});ja.displayName=Ym;var Zm="DropdownMenuCheckboxItem",Xm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(_m,{...o,...r,ref:t})});Xm.displayName=Zm;var Km="DropdownMenuRadioGroup",Jm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Nm,{...o,...r,ref:t})});Jm.displayName=Km;var qm="DropdownMenuRadioItem",Qm=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Om,{...o,...r,ref:t})});Qm.displayName=qm;var ev="DropdownMenuItemIndicator",tv=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Dm,{...o,...r,ref:t})});tv.displayName=ev;var nv="DropdownMenuSeparator",Fa=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(jm,{...o,...r,ref:t})});Fa.displayName=nv;var rv="DropdownMenuArrow",ov=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Fm,{...o,...r,ref:t})});ov.displayName=rv;var iv="DropdownMenuSubTrigger",av=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Wm,{...o,...r,ref:t})});av.displayName=iv;var sv="DropdownMenuSubContent",cv=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=re(n);return y.jsx(Vm,{...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)"}})});cv.displayName=sv;var uv=Ia,lv=La,dv=_a,Wa=Oa,Va=Da,$a=ja,Ga=Fa;const bo=uv,xo=lv,er=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(dv,{children:y.jsx(Wa,{ref:r,sideOffset:t,className:ze("z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));er.displayName=Wa.displayName;const Qt=p.forwardRef(({className:e,inset:t,...n},r)=>y.jsx($a,{ref:r,className:ze("relative flex select-none items-center rounded-sm outline-none transition-colors focus:bg-slate-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Qt.displayName=$a.displayName;const tr=p.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(Va,{ref:r,className:ze("text-sm",t&&"pl-8",e),...n}));tr.displayName=Va.displayName;const en=p.forwardRef(({className:e,...t},n)=>y.jsx(Ga,{ref:n,className:ze("-mx-1 my-1 h-px",e),...t}));en.displayName=Ga.displayName;const So=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Co=rr,fv=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Co(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],l=i==null?void 0:i[u];if(d===null)return null;const f=So(d)||So(l);return o[u][f]}),s=n&&Object.entries(n).reduce((u,d)=>{let[l,f]=d;return f===void 0||(u[l]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:l,className:f,...m}=d;return Object.entries(m).every(h=>{let[v,g]=h;return Array.isArray(g)?g.includes({...i,...s}[v]):{...i,...s}[v]===g})?[...u,l,f]:u},[]);return Co(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},pv=fv("inline-flex items-center justify-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{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"}}),yt=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const a=r?_l:"button";return y.jsx(a,{className:ze(pv({variant:t,size:n,className:e})),ref:i,...o})});yt.displayName="Button";const mv=({className:e="",globalSignOut:t=!1,signoutCallbackUrl:n,additionalPages:r=[],themeClassnames:o="light:bg-stone-800 light:border-stone-700 light:text-stone-200"})=>{const{user:i,isLoadingUser:a,signOut:s,signIn:c}=fn(),u=Jo(),[d,l]=E.useState(!1);E.useEffect(()=>{l(!0)},[]);const f=d&&typeof window<"u"?window.location.href:"/",m=n||f;return!d||a?y.jsx("div",{className:`relative ${e}`,children:y.jsx("div",{className:"h-8 w-8 rounded-full bg-slate-100 animate-pulse"})}):i?y.jsxs(bo,{children:[y.jsx(xo,{className:"outline-none",children:y.jsx(Un,{className:`h-8 w-8 transition-all hover:ring-2 hover:ring-red-2 ${e}`,children:i.avatar?y.jsx(di,{src:i.avatar,alt:i.name||"User",className:"object-cover"}):y.jsx(zn,{className:"bg-slate-50 text-slate-600 text-sm",children:Lu(i.name)})})}),y.jsxs(er,{align:"end",className:`w-64 ${o}`,children:[y.jsx(tr,{className:"px-2 py-2",children:y.jsxs("div",{className:"flex flex-col space-y-1",children:[y.jsx("p",{className:"text-sm font-semibold ",children:i.name||"User"}),i.email&&y.jsx("p",{className:"text-xs text-slate-500 truncate ",children:i.email})]})}),y.jsx(en,{className:"bg-slate-100"}),r.map(({link:h,text:v,icon:g},w)=>y.jsx(Qt,{onSelect:()=>u(h),children:y.jsxs(yt,{variant:"ghost",className:"w-full flex text-left",children:[g&&(E.isValidElement(g)?E.cloneElement(g,{className:Nu("mr-2.5 h-4 w-4",g.props.className)}):g),v]})},w)),r.length>0&&y.jsx(en,{className:"bg-slate-100"}),y.jsx(Qt,{onClick:()=>s({callbackUrl:m,global:t}),children:y.jsxs(yt,{variant:"destructive",className:"w-full flex text-left",children:[y.jsx(il,{className:"mr-2.5 h-4 w-4"}),"Sign out"]})})]})]}):y.jsxs(bo,{children:[y.jsx(xo,{className:"outline-none",children:y.jsx(Un,{className:`h-9 w-9 transition-all hover:ring-2 hover:ring-slate-200 ${e}`,children:y.jsx(zn,{className:"bg-slate-50",children:y.jsx(rl,{className:"h-5 w-5 text-slate-400"})})})}),y.jsxs(er,{align:"end",className:`w-64 ${o}`,children:[y.jsx(tr,{className:"px-3 py-2",children:y.jsx("p",{className:`text-sm font-medium ${o}`,children:"Sign in to your account"})}),y.jsx(en,{className:"bg-slate-100"}),y.jsx(Qt,{onClick:()=>c(),children:y.jsxs(yt,{variant:"default",className:" w-full flex gap-1.5 text-left",children:[y.jsx(sl,{className:"h-4 w-4"}),"Sign in"]})})]})]})},vv=`
|
|
125
|
+
@keyframes spin {
|
|
126
|
+
from { transform: rotate(0deg); }
|
|
127
|
+
to { transform: rotate(360deg); }
|
|
128
|
+
}
|
|
129
|
+
`,hv=({className:e="",loadingComponent:t,successComponent:n,onSuccess:r,onError:o,redirectTo:i="/"})=>{const a=E.useRef(!1);E.useEffect(()=>{if(!document.querySelector("#spin-keyframes")){const f=document.createElement("style");f.id="spin-keyframes",f.textContent=vv,document.head.appendChild(f)}},[]);const{isLoading:s}=ln.useHandleSignInCallback(()=>{if(!a.current){a.current=!0;try{const f=window.opener&&window.opener!==window||sessionStorage.getItem("simple_logto_popup_flow")==="true";if(r&&r(),!f)window.location.href=i;else{if(sessionStorage.removeItem("simple_logto_popup_flow"),window.opener&&window.opener!==window)try{window.opener.postMessage({type:"SIGNIN_SUCCESS"},window.location.origin)}catch(m){console.error("Failed to post message to opener:",m),localStorage.setItem("simple_logto_signin_complete",Date.now().toString())}else localStorage.setItem("simple_logto_signin_complete",Date.now().toString());setTimeout(()=>{window.close()},100)}}catch(f){console.error("Authentication callback error:",f),o&&o(f)}}}),c={display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"500",minHeight:"100vh"},u={display:"flex",alignItems:"center",gap:"0.5rem"},d={width:"1.25rem",height:"1.25rem",color:"black",animation:"spin 1s linear infinite"},l={fontSize:"1.125rem",color:"#64748b"};return s?y.jsx("div",{style:c,className:e,children:t||y.jsxs("div",{style:u,children:[y.jsxs("svg",{style:d,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[y.jsx("circle",{style:{opacity:.25},cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),y.jsx("path",{style:{opacity:.75},fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),y.jsx("div",{style:l,children:"Signing you in..."})]})}):y.jsx("div",{style:c,className:e,children:n||y.jsxs("div",{style:{...u,textAlign:"center"},children:[y.jsxs("svg",{style:d,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[y.jsx("circle",{style:{opacity:.25},cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),y.jsx("path",{style:{opacity:.75},fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),y.jsx("div",{style:l,children:"Authentication complete! Redirecting..."})]})})},gv={width:"1.25rem",height:"1.25rem",color:"black",animation:"spin 1s linear infinite"},wv=()=>y.jsxs("svg",{style:gv,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[y.jsx("circle",{style:{opacity:.25},cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),y.jsx("path",{style:{opacity:.75},fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});function yv({className:e="",loadingComponent:t,errorComponent:n}){const{user:r,signIn:o,isLoadingUser:i}=fn(),a=E.useRef(!1),[s,c]=E.useState(null);return E.useEffect(()=>{if(i)return;new URLSearchParams(window.location.search).get("popup")==="true"&&sessionStorage.setItem("simple_logto_popup_flow","true");const d=window.opener&&window.opener!==window||sessionStorage.getItem("simple_logto_popup_flow")==="true";if(r){if(d){if(window.opener&&window.opener!==window)try{window.opener.postMessage({type:"SIGNIN_COMPLETE"},window.location.origin)}catch(l){console.error("Failed to post message to opener:",l),localStorage.setItem("simple_logto_signin_complete",Date.now().toString())}else localStorage.setItem("simple_logto_signin_complete",Date.now().toString());sessionStorage.removeItem("simple_logto_popup_flow"),console.log("[SignInPage] Closing popup"),setTimeout(()=>window.close(),100)}else window.location.pathname!=="/"&&(window.location.href="/");return}a.current||(a.current=!0,c(null),o(void 0,!1).catch(l=>{a.current=!1,c(l instanceof Error?l:new Error("Failed to start sign-in"))}))},[r,i,o]),s?y.jsx("div",{className:`flex min-h-screen items-center justify-center ${e}`.trim(),children:typeof n=="function"?n(s):n??y.jsx("div",{role:"alert",children:"Failed to start sign-in. Please try again."})}):i?y.jsx("div",{className:`flex min-h-screen items-center justify-center ${e}`.trim(),children:t??y.jsx(wv,{})}):null}function bv({label:e="Sign In",redirectUri:t,usePopup:n,onBeforeSignIn:r,onAfterSignIn:o,onSignInError:i,disabled:a,...s}){const{signIn:c,isLoadingUser:u}=fn(),[d,l]=E.useState(!1),f=a||u||d,m=async h=>{h.preventDefault();try{l(!0),r&&await r(),await c(t,n),o&&await o()}catch(v){const g=v instanceof Error?v:new Error("Failed to sign in");i?i(g):console.error("Sign-in error:",g)}finally{l(!1)}};return y.jsx(yt,{disabled:f,...s,onClick:m,children:e})}Object.defineProperty(exports,"UserScope",{enumerable:!0,get:()=>ln.UserScope});exports.getBundlerConfig=dn.getBundlerConfig;exports.nextjsConfig=dn.nextjsConfig;exports.viteConfig=dn.viteConfig;exports.webpackConfig=dn.webpackConfig;exports.AuthProvider=Yu;exports.CallbackPage=hv;exports.SignInButton=bv;exports.SignInPage=yv;exports.UserCenter=mv;exports.cookieUtils=Ze;exports.jwtCookieUtils=$e;exports.useAuth=fn;exports.usePermission=Ku;exports.validateLogtoConfig=Zo;
|