rivet-design 0.18.0 → 0.18.2

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.
Files changed (51) hide show
  1. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  2. package/dist/agent-variants/SessionStore.js +2 -2
  3. package/dist/agent-variants/SessionStore.js.map +1 -1
  4. package/dist/agent-variants/contracts.d.ts +669 -234
  5. package/dist/agent-variants/contracts.d.ts.map +1 -1
  6. package/dist/cli/commands/serve.js +1 -1
  7. package/dist/routes/library/index.d.ts.map +1 -1
  8. package/dist/routes/library/index.js +2 -0
  9. package/dist/routes/library/index.js.map +1 -1
  10. package/dist/routes/library/profiles.d.ts.map +1 -1
  11. package/dist/routes/library/profiles.js +3 -4
  12. package/dist/routes/library/profiles.js.map +1 -1
  13. package/dist/services/VariantHistoryService.js +1 -1
  14. package/dist/services/VariantHistoryService.js.map +1 -1
  15. package/dist/services/VariantRunService.d.ts.map +1 -1
  16. package/dist/services/VariantRunService.js +38 -29
  17. package/dist/services/VariantRunService.js.map +1 -1
  18. package/dist/services/profiles/DesignProfiles.d.ts +13 -1
  19. package/dist/services/profiles/DesignProfiles.d.ts.map +1 -1
  20. package/dist/services/profiles/DesignProfiles.js +117 -6
  21. package/dist/services/profiles/DesignProfiles.js.map +1 -1
  22. package/dist/services/profiles/ProfilePreparation.d.ts +6 -1
  23. package/dist/services/profiles/ProfilePreparation.d.ts.map +1 -1
  24. package/dist/services/profiles/ProfilePreparation.js +12 -10
  25. package/dist/services/profiles/ProfilePreparation.js.map +1 -1
  26. package/dist/services/profiles/profileAccount.d.ts.map +1 -1
  27. package/dist/services/profiles/profileAccount.js +3 -1
  28. package/dist/services/profiles/profileAccount.js.map +1 -1
  29. package/dist/services/profiles/profileContext.d.ts +1 -1
  30. package/dist/services/profiles/profileContext.d.ts.map +1 -1
  31. package/dist/services/profiles/profileContext.js +28 -5
  32. package/dist/services/profiles/profileContext.js.map +1 -1
  33. package/dist/services/profiles/selectionContext.d.ts +7 -0
  34. package/dist/services/profiles/selectionContext.d.ts.map +1 -0
  35. package/dist/services/profiles/selectionContext.js +76 -0
  36. package/dist/services/profiles/selectionContext.js.map +1 -0
  37. package/dist/types/design-profile.d.ts +108 -0
  38. package/dist/types/design-profile.d.ts.map +1 -1
  39. package/dist/types/design-profile.js +44 -1
  40. package/dist/types/design-profile.js.map +1 -1
  41. package/dist/types/variant-reference.d.ts +19 -4
  42. package/dist/types/variant-reference.d.ts.map +1 -1
  43. package/dist/types/variant-reference.js +20 -8
  44. package/dist/types/variant-reference.js.map +1 -1
  45. package/package.json +2 -1
  46. package/src/ui/dist/assets/{LibraryApp-Bu7hVbt_.js → LibraryApp-NAzSe5xc.js} +5 -5
  47. package/src/ui/dist/assets/main-D7LJLJwW.js +438 -0
  48. package/src/ui/dist/assets/main-f2uWt6ZY.css +1 -0
  49. package/src/ui/dist/index.html +2 -2
  50. package/src/ui/dist/assets/main-CHyx_rEa.css +0 -1
  51. package/src/ui/dist/assets/main-CuiPb_rl.js +0 -438
@@ -0,0 +1,438 @@
1
+ var ND=Object.defineProperty;var SS=t=>{throw TypeError(t)};var DD=(t,e,n)=>e in t?ND(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var la=(t,e,n)=>DD(t,typeof e!="symbol"?e+"":e,n),T1=(t,e,n)=>e.has(t)||SS("Cannot "+n);var q=(t,e,n)=>(T1(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>e.has(t)?SS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(T1(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),xt=(t,e,n)=>(T1(t,e,"access private method"),n);var r0=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return q(t,e,r)}});function $D(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const jD="modulepreload",FD=function(t){return"/"+t},kS={},aP=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=FD(d),d in kS)return;kS[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":jD,f||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),f)return new Promise((v,w)=>{g.addEventListener("load",v),g.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function _g(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var I1={exports:{}},ef={},M1={exports:{}},mt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ES;function VD(){if(ES)return mt;ES=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function g(N){return N===null||typeof N!="object"?null:(N=p&&N[p]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(N,X,ie){this.props=N,this.context=X,this.refs=_,this.updater=ie||v}x.prototype.isReactComponent={},x.prototype.setState=function(N,X){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,X,"setState")},x.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function b(){}b.prototype=x.prototype;function E(N,X,ie){this.props=N,this.context=X,this.refs=_,this.updater=ie||v}var C=E.prototype=new b;C.constructor=E,w(C,x.prototype),C.isPureReactComponent=!0;var R=Array.isArray,A=Object.prototype.hasOwnProperty,M={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function T(N,X,ie){var ne,oe={},fe=null,xe=null;if(X!=null)for(ne in X.ref!==void 0&&(xe=X.ref),X.key!==void 0&&(fe=""+X.key),X)A.call(X,ne)&&!I.hasOwnProperty(ne)&&(oe[ne]=X[ne]);var de=arguments.length-2;if(de===1)oe.children=ie;else if(1<de){for(var ae=Array(de),Oe=0;Oe<de;Oe++)ae[Oe]=arguments[Oe+2];oe.children=ae}if(N&&N.defaultProps)for(ne in de=N.defaultProps,de)oe[ne]===void 0&&(oe[ne]=de[ne]);return{$$typeof:t,type:N,key:fe,ref:xe,props:oe,_owner:M.current}}function L(N,X){return{$$typeof:t,type:N.type,key:X,ref:N.ref,props:N.props,_owner:N._owner}}function D(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function B(N){var X={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ie){return X[ie]})}var j=/\/+/g;function K(N,X){return typeof N=="object"&&N!==null&&N.key!=null?B(""+N.key):X.toString(36)}function U(N,X,ie,ne,oe){var fe=typeof N;(fe==="undefined"||fe==="boolean")&&(N=null);var xe=!1;if(N===null)xe=!0;else switch(fe){case"string":case"number":xe=!0;break;case"object":switch(N.$$typeof){case t:case e:xe=!0}}if(xe)return xe=N,oe=oe(xe),N=ne===""?"."+K(xe,0):ne,R(oe)?(ie="",N!=null&&(ie=N.replace(j,"$&/")+"/"),U(oe,X,ie,"",function(Oe){return Oe})):oe!=null&&(D(oe)&&(oe=L(oe,ie+(!oe.key||xe&&xe.key===oe.key?"":(""+oe.key).replace(j,"$&/")+"/")+N)),X.push(oe)),1;if(xe=0,ne=ne===""?".":ne+":",R(N))for(var de=0;de<N.length;de++){fe=N[de];var ae=ne+K(fe,de);xe+=U(fe,X,ie,ae,oe)}else if(ae=g(N),typeof ae=="function")for(N=ae.call(N),de=0;!(fe=N.next()).done;)fe=fe.value,ae=ne+K(fe,de++),xe+=U(fe,X,ie,ae,oe);else if(fe==="object")throw X=String(N),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return xe}function H(N,X,ie){if(N==null)return N;var ne=[],oe=0;return U(N,ne,"","",function(fe){return X.call(ie,fe,oe++)}),ne}function Z(N){if(N._status===-1){var X=N._result;X=X(),X.then(function(ie){(N._status===0||N._status===-1)&&(N._status=1,N._result=ie)},function(ie){(N._status===0||N._status===-1)&&(N._status=2,N._result=ie)}),N._status===-1&&(N._status=0,N._result=X)}if(N._status===1)return N._result.default;throw N._result}var Q={current:null},z={transition:null},ee={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:z,ReactCurrentOwner:M};function W(){throw Error("act(...) is not supported in production builds of React.")}return mt.Children={map:H,forEach:function(N,X,ie){H(N,function(){X.apply(this,arguments)},ie)},count:function(N){var X=0;return H(N,function(){X++}),X},toArray:function(N){return H(N,function(X){return X})||[]},only:function(N){if(!D(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},mt.Component=x,mt.Fragment=n,mt.Profiler=s,mt.PureComponent=E,mt.StrictMode=r,mt.Suspense=u,mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,mt.act=W,mt.cloneElement=function(N,X,ie){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var ne=w({},N.props),oe=N.key,fe=N.ref,xe=N._owner;if(X!=null){if(X.ref!==void 0&&(fe=X.ref,xe=M.current),X.key!==void 0&&(oe=""+X.key),N.type&&N.type.defaultProps)var de=N.type.defaultProps;for(ae in X)A.call(X,ae)&&!I.hasOwnProperty(ae)&&(ne[ae]=X[ae]===void 0&&de!==void 0?de[ae]:X[ae])}var ae=arguments.length-2;if(ae===1)ne.children=ie;else if(1<ae){de=Array(ae);for(var Oe=0;Oe<ae;Oe++)de[Oe]=arguments[Oe+2];ne.children=de}return{$$typeof:t,type:N.type,key:oe,ref:fe,props:ne,_owner:xe}},mt.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:i,_context:N},N.Consumer=N},mt.createElement=T,mt.createFactory=function(N){var X=T.bind(null,N);return X.type=N,X},mt.createRef=function(){return{current:null}},mt.forwardRef=function(N){return{$$typeof:l,render:N}},mt.isValidElement=D,mt.lazy=function(N){return{$$typeof:f,_payload:{_status:-1,_result:N},_init:Z}},mt.memo=function(N,X){return{$$typeof:d,type:N,compare:X===void 0?null:X}},mt.startTransition=function(N){var X=z.transition;z.transition={};try{N()}finally{z.transition=X}},mt.unstable_act=W,mt.useCallback=function(N,X){return Q.current.useCallback(N,X)},mt.useContext=function(N){return Q.current.useContext(N)},mt.useDebugValue=function(){},mt.useDeferredValue=function(N){return Q.current.useDeferredValue(N)},mt.useEffect=function(N,X){return Q.current.useEffect(N,X)},mt.useId=function(){return Q.current.useId()},mt.useImperativeHandle=function(N,X,ie){return Q.current.useImperativeHandle(N,X,ie)},mt.useInsertionEffect=function(N,X){return Q.current.useInsertionEffect(N,X)},mt.useLayoutEffect=function(N,X){return Q.current.useLayoutEffect(N,X)},mt.useMemo=function(N,X){return Q.current.useMemo(N,X)},mt.useReducer=function(N,X,ie){return Q.current.useReducer(N,X,ie)},mt.useRef=function(N){return Q.current.useRef(N)},mt.useState=function(N){return Q.current.useState(N)},mt.useSyncExternalStore=function(N,X,ie){return Q.current.useSyncExternalStore(N,X,ie)},mt.useTransition=function(){return Q.current.useTransition()},mt.version="18.3.1",mt}var CS;function Hx(){return CS||(CS=1,M1.exports=VD()),M1.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var PS;function HD(){if(PS)return ef;PS=1;var t=Hx(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var f,p={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(p[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:l,key:g,ref:v,props:p,_owner:s.current}}return ef.Fragment=n,ef.jsx=o,ef.jsxs=o,ef}var RS;function zD(){return RS||(RS=1,I1.exports=HD()),I1.exports}var S=zD(),m=Hx();const _e=_g(m),Dh=$D({__proto__:null,default:_e},[m]),lP=m.createContext(void 0),cP=t=>{const e=m.useContext(lP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},BD=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(lP.Provider,{value:t,children:e})),UD={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var ga,Vx,X3,ZD=(X3=class{constructor(){Je(this,ga,UD);Je(this,Vx,!1)}setTimeoutProvider(t){Ae(this,ga,t)}setTimeout(t,e){return q(this,ga).setTimeout(t,e)}clearTimeout(t){q(this,ga).clearTimeout(t)}setInterval(t,e){return q(this,ga).setInterval(t,e)}clearInterval(t){q(this,ga).clearInterval(t)}},ga=new WeakMap,Vx=new WeakMap,X3);const Fl=new ZD;function WD(t){setTimeout(t,0)}const qD=typeof window>"u"||"Deno"in globalThis;function qr(){}function GD(t,e){return typeof t=="function"?t(e):t}function uP(t){return typeof t=="number"&&t>=0&&t!==1/0}function dP(t,e){return Math.max(t+(e||0)-Date.now(),0)}function hn(t,e){return typeof t=="function"?t(e):t}function AS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==zx(o,e.options))return!1}else if(!zu(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function TS(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Kf(e.options.mutationKey)!==Kf(i))return!1}else if(!zu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function zx(t,e){return((e==null?void 0:e.queryKeyHashFn)||Kf)(t)}function Kf(t){return JSON.stringify(t,(e,n)=>w_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function zu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!zu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!zu(t[r],e[r]))return!1;return!0}return!1}const KD=Object.prototype.hasOwnProperty;function fP(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=IS(t)&&IS(e);if(!r&&!(w_(t)&&w_(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=t[f],g=e[f];if(p===g){l[f]=p,(r?d<s:KD.call(t,f))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){l[f]=g;continue}const v=fP(p,g,n+1);l[f]=v,v===p&&u++}return s===o&&u===s?t:l}function O1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function IS(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function w_(t){if(!MS(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!MS(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function MS(t){return Object.prototype.toString.call(t)==="[object Object]"}function YD(t){return new Promise(e=>{Fl.setTimeout(e,t)})}function b_(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?fP(t,e):e}function XD(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function QD(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const Bx=Symbol();function hP(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Bx?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function pP(t,e){return typeof t=="function"?t(...e):!!t}function JD(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let e7=()=>qD;const Ux=()=>e7();var $h=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Bl,va,Au,Q3,t7=(Q3=class extends $h{constructor(){super();Je(this,Bl);Je(this,va);Je(this,Au);Ae(this,Au,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,va)||this.setEventListener(q(this,Au))}onUnsubscribe(){var e;this.hasListeners()||((e=q(this,va))==null||e.call(this),Ae(this,va,void 0))}setEventListener(e){var n;Ae(this,Au,e),(n=q(this,va))==null||n.call(this),Ae(this,va,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){q(this,Bl)!==e&&(Ae(this,Bl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof q(this,Bl)=="boolean"?q(this,Bl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Bl=new WeakMap,va=new WeakMap,Au=new WeakMap,Q3);const Zx=new t7,n7=WD;function r7(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=n7;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const pr=r7();var Tu,ya,Iu,J3,s7=(J3=class extends $h{constructor(){super();Je(this,Tu,!0);Je(this,ya);Je(this,Iu);Ae(this,Iu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){q(this,ya)||this.setEventListener(q(this,Iu))}onUnsubscribe(){var e;this.hasListeners()||((e=q(this,ya))==null||e.call(this),Ae(this,ya,void 0))}setEventListener(e){var n;Ae(this,Iu,e),(n=q(this,ya))==null||n.call(this),Ae(this,ya,e(this.setOnline.bind(this)))}setOnline(e){q(this,Tu)!==e&&(Ae(this,Tu,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return q(this,Tu)}},Tu=new WeakMap,ya=new WeakMap,Iu=new WeakMap,J3);const gm=new s7;function i7(t){return Math.min(1e3*2**t,3e4)}function mP(t){return(t??"online")==="online"?gm.isOnline():!0}var S_=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function gP(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((E,C)=>{i=E,o=C});l.catch(qr);const u=()=>s!=="pending",d=E=>{var C;if(!u()){const R=new S_(E);_(R),(C=t.onCancel)==null||C.call(t,R)}},f=()=>{e=!0},p=()=>{e=!1},g=()=>Zx.isFocused()&&(t.networkMode==="always"||gm.isOnline())&&t.canRun(),v=()=>mP(t.networkMode)&&t.canRun(),w=E=>{u()||(r==null||r(),s="resolved",i(E))},_=E=>{u()||(r==null||r(),s="rejected",o(E))},x=()=>new Promise(E=>{var C;r=R=>{(u()||g())&&E(R)},(C=t.onPause)==null||C.call(t)}).then(()=>{var E;r=void 0,u()||(E=t.onContinue)==null||E.call(t)}),b=()=>{if(u())return;let E;const C=n===0?t.initialPromise:void 0;try{E=C??t.fn()}catch(R){E=Promise.reject(R)}Promise.resolve(E).then(w).catch(R=>{var L;if(u())return;const A=t.retry??(Ux()?0:3),M=t.retryDelay??i7,I=typeof M=="function"?M(n,R):M,T=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,R);if(e||!T){_(R);return}n++,(L=t.onFail)==null||L.call(t,n,R),YD(I).then(()=>g()?void 0:x()).then(()=>{e?_(R):b()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?b():x().then(b),l)}}var Ul,eP,vP=(eP=class{constructor(){Je(this,Ul)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uP(this.gcTime)&&Ae(this,Ul,Fl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ux()?1/0:3e5))}clearGcTimeout(){q(this,Ul)!==void 0&&(Fl.clearTimeout(q(this,Ul)),Ae(this,Ul,void 0))}},Ul=new WeakMap,eP);function o7(t){return{onFetch:(e,n)=>{var f,p,g,v,w;const r=e.options,s=(g=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const x=C=>{JD(C,()=>e.signal,()=>_=!0)},b=hP(e.options,e.fetchOptions),E=async(C,R,A)=>{if(_)return Promise.reject(e.signal.reason);if(R==null&&C.pages.length)return Promise.resolve(C);const I=(()=>{const B={client:e.client,queryKey:e.queryKey,pageParam:R,direction:A?"backward":"forward",meta:e.options.meta};return x(B),B})(),T=await b(I),{maxPages:L}=e.options,D=A?QD:XD;return{pages:D(C.pages,T,L),pageParams:D(C.pageParams,R,L)}};if(s&&i.length){const C=s==="backward",R=C?a7:OS,A={pages:i,pageParams:o};l=await E(A,R(r,A),C)}else{const C=t??i.length;do{const R=u===0?o[0]??r.initialPageParam:OS(r,l);if(u>0&&R==null)break;l=await E(l,R),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function OS(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function a7(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Mu,Zl,Ou,Hs,Wl,Kn,Ih,ql,fi,go,tP,l7=(tP=class extends vP{constructor(e){super();Je(this,fi);Je(this,Mu);Je(this,Zl);Je(this,Ou);Je(this,Hs);Je(this,Wl);Je(this,Kn);Je(this,Ih);Je(this,ql);Ae(this,ql,!1),Ae(this,Ih,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,Wl,e.client),Ae(this,Hs,q(this,Wl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,Zl,NS(this.options)),this.state=e.state??q(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return q(this,Mu)}get promise(){var e;return(e=q(this,Kn))==null?void 0:e.promise}setOptions(e){if(this.options={...q(this,Ih),...e},e!=null&&e._type&&Ae(this,Mu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=NS(this.options);n.data!==void 0&&(this.setState(LS(n.data,n.dataUpdatedAt)),Ae(this,Zl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,Hs).remove(this)}setData(e,n){const r=b_(this.state.data,e,this.options);return xt(this,fi,go).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){xt(this,fi,go).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=q(this,Kn))==null?void 0:r.promise;return(s=q(this,Kn))==null||s.cancel(e),n?n.then(qr).catch(qr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return q(this,Zl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bx||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!dP(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=q(this,Kn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=q(this,Kn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),q(this,Hs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(q(this,Kn)&&(q(this,ql)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?q(this,Kn).cancel({revert:!0}):q(this,Kn).cancelRetry()),this.scheduleGc()),q(this,Hs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||xt(this,fi,go).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,g,v,w,_,x,b,E,C,R;if(this.state.fetchStatus!=="idle"&&((d=q(this,Kn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,Kn))return q(this,Kn).continueRetry(),q(this,Kn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const A=this.observers.find(M=>M.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,s=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Ae(this,ql,!0),r.signal)})},i=()=>{const A=hP(this.options,n),I=(()=>{const T={client:q(this,Wl),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return Ae(this,ql,!1),this.options.persister?this.options.persister(A,I,this):A(I)},l=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,Wl),state:this.state,fetchFn:i};return s(A),A})();(f=q(this,Mu)==="infinite"?o7(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Ae(this,Ou,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&xt(this,fi,go).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=Ae(this,Kn,gP({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:A=>{A instanceof S_&&A.revert&&this.setState({...q(this,Ou),fetchStatus:"idle"}),r.abort()},onFail:(A,M)=>{xt(this,fi,go).call(this,{type:"failed",failureCount:A,error:M})},onPause:()=>{xt(this,fi,go).call(this,{type:"pause"})},onContinue:()=>{xt(this,fi,go).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const A=await u.start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(w=(v=q(this,Hs).config).onSuccess)==null||w.call(v,A,this),(x=(_=q(this,Hs).config).onSettled)==null||x.call(_,A,this.state.error,this),A}catch(A){if(A instanceof S_){if(A.silent)return q(this,Kn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw xt(this,fi,go).call(this,{type:"error",error:A}),(E=(b=q(this,Hs).config).onError)==null||E.call(b,A,this),(R=(C=q(this,Hs).config).onSettled)==null||R.call(C,this.state.data,A,this),A}finally{q(this,Kn)===u&&Ae(this,Kn,void 0),this.scheduleGc()}}},Mu=new WeakMap,Zl=new WeakMap,Ou=new WeakMap,Hs=new WeakMap,Wl=new WeakMap,Kn=new WeakMap,Ih=new WeakMap,ql=new WeakMap,fi=new WeakSet,go=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...yP(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...LS(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,Ou,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),pr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),q(this,Hs).notify({query:this,type:"updated",action:e})})},tP);function yP(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mP(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function LS(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function NS(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ir,wt,Mh,Mr,Gl,Lu,So,Oh,Nu,Du,Kl,Yl,_a,$u,Nt,vf,k_,E_,C_,P_,R_,A_,T_,I_,nP,c7=(nP=class extends $h{constructor(e,n){super();Je(this,Nt);Je(this,Ir);Je(this,wt);Je(this,Mh);Je(this,Mr);Je(this,Gl);Je(this,Lu);Je(this,So);Je(this,Oh);Je(this,Nu);Je(this,Du);Je(this,Kl);Je(this,Yl);Je(this,_a);Je(this,$u,new Set);this.options=n,Ae(this,Ir,e),Ae(this,So,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,wt).addObserver(this),DS(q(this,wt),this.options)?xt(this,Nt,vf).call(this):this.updateResult(),xt(this,Nt,R_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return M_(q(this,wt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return M_(q(this,wt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,Nt,A_).call(this),xt(this,Nt,T_).call(this),q(this,wt).removeObserver(this)}setOptions(e){const n=this.options,r=q(this,wt);if(this.options=q(this,Ir).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hn(this.options.enabled,q(this,wt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");xt(this,Nt,I_).call(this),q(this,wt).setOptions(this.options),n._defaulted&&!O1(this.options,n)&&q(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,wt),observer:this});const s=this.hasListeners();s&&$S(q(this,wt),r,this.options,n)&&xt(this,Nt,vf).call(this),this.updateResult(),s&&(q(this,wt)!==r||hn(this.options.enabled,q(this,wt))!==hn(n.enabled,q(this,wt))||hn(this.options.staleTime,q(this,wt))!==hn(n.staleTime,q(this,wt)))&&xt(this,Nt,E_).call(this);const i=xt(this,Nt,C_).call(this);s&&(q(this,wt)!==r||hn(this.options.enabled,q(this,wt))!==hn(n.enabled,q(this,wt))||i!==q(this,_a))&&xt(this,Nt,P_).call(this,i)}getOptimisticResult(e){const n=q(this,Ir).getQueryCache().build(q(this,Ir),e),r=this.createResult(n,e);return O1(this.getCurrentResult(),r)||(Ae(this,Mr,r),Ae(this,Lu,this.options),Ae(this,Gl,q(this,wt).state)),r}getCurrentResult(){return q(this,Mr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){q(this,$u).add(e)}getCurrentQuery(){return q(this,wt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=q(this,Ir).defaultQueryOptions(e),r=q(this,Ir).getQueryCache().build(q(this,Ir),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=q(this,Ir).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return xt(this,Nt,vf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,Mr)))}createResult(e,n){var M;const r=q(this,wt),s=this.options,i=q(this,Mr),o=q(this,Gl),l=q(this,Lu),u=e!==r?e.state:q(this,Mh),{state:d}=e;let f={...d},p=!1,g;if(n._optimisticResults){const I=this.hasListeners(),T=!I&&DS(e,n),L=I&&$S(e,r,n,s);(T||L)&&(f={...f,...yP(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:_}=f;g=f.data;let x=!1;if(n.placeholderData!==void 0&&g===void 0&&_==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,x=!0):I=typeof n.placeholderData=="function"?n.placeholderData((M=q(this,Du))==null?void 0:M.state.data,q(this,Du)):n.placeholderData,I!==void 0&&(_="success",g=b_(i==null?void 0:i.data,I,n),p=!0)}if(n.select&&g!==void 0&&!x)if(i&&g===(o==null?void 0:o.data)&&n.select===q(this,Oh))g=q(this,Nu);else try{Ae(this,Oh,n.select),g=n.select(g),g=b_(i==null?void 0:i.data,g,n),Ae(this,Nu,g),Ae(this,So,null)}catch(I){Ae(this,So,I)}else g===void 0&&Ae(this,So,null);q(this,So)&&(v=q(this,So),g=q(this,Nu),w=Date.now(),_="error",p=!1);const b=f.fetchStatus==="fetching",E=_==="pending",C=_==="error",R=E&&b,A=g!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:E,isSuccess:_==="success",isError:C,isInitialLoading:R,isLoading:R,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!E,isLoadingError:C&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&A,isStale:Wx(e,n),refetch:this.refetch,isEnabled:hn(n.enabled,e)!==!1}}updateResult(){const e=q(this,Mr),n=this.createResult(q(this,wt),this.options);if(Ae(this,Gl,q(this,wt).state),Ae(this,Lu,this.options),q(this,Gl).data!==void 0&&Ae(this,Du,q(this,wt)),O1(n,e))return;Ae(this,Mr,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!q(this,$u).size)return!0;const l=new Set(o??q(this,$u));return this.options.throwOnError&&l.add("error"),Object.keys(q(this,Mr)).some(u=>{const d=u;return q(this,Mr)[d]!==e[d]&&l.has(d)})})();pr.batch(()=>{s&&this.listeners.forEach(i=>{i(q(this,Mr))}),q(this,Ir).getQueryCache().notify({query:q(this,wt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,Nt,R_).call(this)}},Ir=new WeakMap,wt=new WeakMap,Mh=new WeakMap,Mr=new WeakMap,Gl=new WeakMap,Lu=new WeakMap,So=new WeakMap,Oh=new WeakMap,Nu=new WeakMap,Du=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,_a=new WeakMap,$u=new WeakMap,Nt=new WeakSet,vf=function(e){xt(this,Nt,I_).call(this);let n=q(this,wt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(qr)),n},k_=function(e){return!Ux()&&hn(this.options.enabled,q(this,wt))!==!1&&uP(e)},E_=function(){xt(this,Nt,A_).call(this);const e=hn(this.options.staleTime,q(this,wt));if(q(this,Mr).isStale||!xt(this,Nt,k_).call(this,e))return;const n=dP(q(this,Mr).dataUpdatedAt,e)+1;Ae(this,Kl,Fl.setTimeout(()=>{q(this,Mr).isStale||this.updateResult()},n))},C_=function(){return hn(this.options.refetchInterval,q(this,wt))??!1},P_=function(e){xt(this,Nt,T_).call(this),Ae(this,_a,e),!(q(this,_a)===0||!xt(this,Nt,k_).call(this,q(this,_a)))&&Ae(this,Yl,Fl.setInterval(()=>{(this.options.refetchIntervalInBackground||Zx.isFocused())&&xt(this,Nt,vf).call(this)},q(this,_a)))},R_=function(){xt(this,Nt,E_).call(this),xt(this,Nt,P_).call(this,xt(this,Nt,C_).call(this))},A_=function(){q(this,Kl)!==void 0&&(Fl.clearTimeout(q(this,Kl)),Ae(this,Kl,void 0))},T_=function(){q(this,Yl)!==void 0&&(Fl.clearInterval(q(this,Yl)),Ae(this,Yl,void 0))},I_=function(){const e=q(this,Ir).getQueryCache().build(q(this,Ir),this.options);if(e===q(this,wt))return;const n=q(this,wt);Ae(this,wt,e),Ae(this,Mh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},nP);function u7(t,e){return hn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&hn(e.retryOnMount,t)===!1)}function DS(t,e){return u7(t,e)||t.state.data!==void 0&&M_(t,e,e.refetchOnMount)}function M_(t,e,n){if(hn(e.enabled,t)!==!1&&hn(e.staleTime,t)!=="static"){const r=hn(n,t);return r==="always"||r!==!1&&Wx(t,e)}return!1}function $S(t,e,n,r){return(t!==e||hn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Wx(t,n)}function Wx(t,e){return hn(e.enabled,t)!==!1&&t.isStaleByTime(hn(e.staleTime,t))}var Lh,Oi,Sr,Xl,Li,fa,rP,d7=(rP=class extends vP{constructor(e){super();Je(this,Li);Je(this,Lh);Je(this,Oi);Je(this,Sr);Je(this,Xl);Ae(this,Lh,e.client),this.mutationId=e.mutationId,Ae(this,Sr,e.mutationCache),Ae(this,Oi,[]),this.state=e.state||f7(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){q(this,Oi).includes(e)||(q(this,Oi).push(e),this.clearGcTimeout(),q(this,Sr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,Oi,q(this,Oi).filter(n=>n!==e)),this.scheduleGc(),q(this,Sr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){q(this,Oi).length||(this.state.status==="pending"?this.scheduleGc():q(this,Sr).remove(this))}continue(){var e;return((e=q(this,Xl))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,p,g,v,w,_,x,b,E,C,R,A,M,I,T;const n=()=>{xt(this,Li,fa).call(this,{type:"continue"})},r={client:q(this,Lh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ae(this,Xl,gP({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{xt(this,Li,fa).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{xt(this,Li,fa).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,Sr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{xt(this,Li,fa).call(this,{type:"pending",variables:e,isPaused:o}),q(this,Sr).config.onMutate&&await q(this,Sr).config.onMutate(e,this,r);const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));D!==this.state.context&&xt(this,Li,fa).call(this,{type:"pending",context:D,variables:e,isPaused:o})}const L=await s.start();return await((f=(d=q(this,Sr).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,r)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,L,e,this.state.context,r)),await((w=(v=q(this,Sr).config).onSettled)==null?void 0:w.call(v,L,null,this.state.variables,this.state.context,this,r)),await((x=(_=this.options).onSettled)==null?void 0:x.call(_,L,null,e,this.state.context,r)),xt(this,Li,fa).call(this,{type:"success",data:L}),L}catch(L){try{await((E=(b=q(this,Sr).config).onError)==null?void 0:E.call(b,L,e,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((R=(C=this.options).onError)==null?void 0:R.call(C,L,e,this.state.context,r))}catch(D){Promise.reject(D)}try{await((M=(A=q(this,Sr).config).onSettled)==null?void 0:M.call(A,void 0,L,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((T=(I=this.options).onSettled)==null?void 0:T.call(I,void 0,L,e,this.state.context,r))}catch(D){Promise.reject(D)}throw xt(this,Li,fa).call(this,{type:"error",error:L}),L}finally{q(this,Xl)===s&&Ae(this,Xl,void 0),q(this,Sr).runNext(this)}}},Lh=new WeakMap,Oi=new WeakMap,Sr=new WeakMap,Xl=new WeakMap,Li=new WeakSet,fa=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pr.batch(()=>{q(this,Oi).forEach(r=>{r.onMutationUpdate(e)}),q(this,Sr).notify({mutation:this,type:"updated",action:e})})},rP);function f7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ko,hi,Nh,sP,h7=(sP=class extends $h{constructor(e={}){super();Je(this,ko);Je(this,hi);Je(this,Nh);this.config=e,Ae(this,ko,new Set),Ae(this,hi,new Map),Ae(this,Nh,0)}build(e,n,r){const s=new d7({client:e,mutationCache:this,mutationId:++r0(this,Nh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){q(this,ko).add(e);const n=s0(e);if(typeof n=="string"){const r=q(this,hi).get(n);r?r.push(e):q(this,hi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(q(this,ko).delete(e)){const n=s0(e);if(typeof n=="string"){const r=q(this,hi).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&q(this,hi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=s0(e);if(typeof n=="string"){const s=(r=q(this,hi).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=s0(e);return typeof n=="string"?((s=(r=q(this,hi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){pr.batch(()=>{q(this,ko).forEach(e=>{this.notify({type:"removed",mutation:e})}),q(this,ko).clear(),q(this,hi).clear()})}getAll(){return Array.from(q(this,ko))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>TS(n,r))}findAll(e={}){return this.getAll().filter(n=>TS(e,n))}notify(e){pr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return pr.batch(()=>Promise.all(e.map(n=>n.continue().catch(qr))))}},ko=new WeakMap,hi=new WeakMap,Nh=new WeakMap,sP);function s0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Ni,iP,p7=(iP=class extends $h{constructor(e={}){super();Je(this,Ni);this.config=e,Ae(this,Ni,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??zx(s,n);let o=this.get(i);return o||(o=new l7({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){q(this,Ni).has(e.queryHash)||(q(this,Ni).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){q(this,Ni).get(e.queryHash)===e&&(e.destroy(),q(this,Ni).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return q(this,Ni).get(e)}getAll(){return[...q(this,Ni).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>AS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>AS(e,r)):n}notify(e){pr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){pr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ni=new WeakMap,iP),wn,xa,wa,ju,Fu,ba,Vu,Hu,oP,m7=(oP=class{constructor(t={}){Je(this,wn);Je(this,xa);Je(this,wa);Je(this,ju);Je(this,Fu);Je(this,ba);Je(this,Vu);Je(this,Hu);Ae(this,wn,t.queryCache||new p7),Ae(this,xa,t.mutationCache||new h7),Ae(this,wa,t.defaultOptions||{}),Ae(this,ju,new Map),Ae(this,Fu,new Map),Ae(this,ba,0)}mount(){r0(this,ba)._++,q(this,ba)===1&&(Ae(this,Vu,Zx.subscribe(async t=>{t&&(await this.resumePausedMutations(),q(this,wn).onFocus())})),Ae(this,Hu,gm.subscribe(async t=>{t&&(await this.resumePausedMutations(),q(this,wn).onOnline())})))}unmount(){var t,e;r0(this,ba)._--,q(this,ba)===0&&((t=q(this,Vu))==null||t.call(this),Ae(this,Vu,void 0),(e=q(this,Hu))==null||e.call(this),Ae(this,Hu,void 0))}isFetching(t){return q(this,wn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return q(this,xa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=q(this,wn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=q(this,wn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(hn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return q(this,wn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=q(this,wn).get(r.queryHash))==null?void 0:o.state.data,i=GD(e,s);if(i!==void 0)return q(this,wn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return pr.batch(()=>q(this,wn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=q(this,wn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=q(this,wn);pr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=q(this,wn);return pr.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=pr.batch(()=>q(this,wn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(qr).catch(qr)}invalidateQueries(t,e={}){return pr.batch(()=>(q(this,wn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=pr.batch(()=>q(this,wn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(qr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(qr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=q(this,wn).build(this,e),r=n.isStaleByTime(hn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=q(this,wn).build(this,e);return n.isStaleByTime(hn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(qr).catch(qr)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(qr).catch(qr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return gm.isOnline()?q(this,xa).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,wn)}getMutationCache(){return q(this,xa)}getDefaultOptions(){return q(this,wa)}setDefaultOptions(t){Ae(this,wa,t)}setQueryDefaults(t,e){q(this,ju).set(Kf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...q(this,ju).values()],n={};return e.forEach(r=>{zu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){q(this,Fu).set(Kf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...q(this,Fu).values()],n={};return e.forEach(r=>{zu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...q(this,wa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=zx(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Bx&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...q(this,wa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){q(this,wn).clear(),q(this,xa).clear()}},wn=new WeakMap,xa=new WeakMap,wa=new WeakMap,ju=new WeakMap,Fu=new WeakMap,ba=new WeakMap,Vu=new WeakMap,Hu=new WeakMap,oP);const _P=m.createContext(!1),g7=()=>m.useContext(_P);_P.Provider;function v7(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const y7=m.createContext(v7()),_7=()=>m.useContext(y7),x7=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?pP(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},w7=t=>{m.useEffect(()=>{t.clearReset()},[t])},b7=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||pP(n,[t.error,r])),S7=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},k7=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,E7=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function C7(t,e,n){const r=g7(),s=_7(),i=cP(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,S7(o),x7(o,s,l),w7(s);const[d]=m.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),p=!r&&u;if(m.useSyncExternalStore(m.useCallback(g=>{const v=p?d.subscribe(pr.batchCalls(g)):qr;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),k7(o,f))throw E7(o,d,s);if(b7({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function vm(t,e){return C7(t,c7)}const J="u">typeof window?window:void 0,Er="u">typeof globalThis?globalThis:J,Qn=Er==null?void 0:Er.navigator,ue=Er==null?void 0:Er.document,on=Er==null?void 0:Er.location,Yf=Er==null?void 0:Er.fetch,qx=Er!=null&&Er.XMLHttpRequest&&"withCredentials"in new Er.XMLHttpRequest?Er.XMLHttpRequest:void 0,jS=Er==null?void 0:Er.AbortController,P7=Er==null?void 0:Er.CompressionStream,Or=Qn==null?void 0:Qn.userAgent;function xP(){return!(!J||J.navigator.onLine===!1)}const tf=typeof globalThis<"u"?globalThis:J;tf&&typeof self>"u"&&(tf.self=tf),tf&&typeof File>"u"&&(tf.File=function(){});const je=J??{},R7="0.9.0",Ao={DEBUG:!1,LIB_VERSION:R7,LIB_NAME:"browser-common"};var Ti=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),O_=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const A7=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],T7=["token"];function qe(t,e){return t.indexOf(e)!==-1}const xg=function(t){return t.trim()},L_=function(t){return t.replace(/^\$/,"")};function wP(t){var e;const n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}const bP=Object.prototype,Gx=bP.hasOwnProperty,wg=bP.toString,We=Array.isArray||function(t){return wg.call(t)==="[object Array]"},Xn=t=>typeof t=="function",ct=t=>t===Object(t)&&!We(t),Gr=t=>{if(ct(t)){for(const e in t)if(Gx.call(t,e))return!1;return!0}return!1},ce=t=>t===void 0,st=t=>wg.call(t)=="[object String]",Cf=t=>st(t)&&t.trim().length===0,an=t=>t===null,et=t=>ce(t)||an(t),mn=t=>wg.call(t)=="[object Number]"&&t==t,vo=t=>mn(t)&&t>0,Nr=t=>wg.call(t)==="[object Boolean]",I7=t=>qe(A7,t),M7=t=>qe(T7,t);function SP(t){return t===null||typeof t!="object"}function ym(t,e){return{}.toString.call(t)===`[object ${e}]`}function ld(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return kP(t,Error)}}function Kx(t){return"u">typeof Event&&kP(t,Event)}function kP(t,e){try{return t instanceof e}catch{return!1}}const O7=[!0,"true",1,"1","yes"],L1=t=>qe(O7,t),L7=[!1,"false",0,"0","no"];function FS(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function Wt(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){FS(i,r,s,o,l,"next",u)}function l(u){FS(i,r,s,o,l,"throw",u)}o(void 0)})}}const N7=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],VS=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return N7.concat(e).some(r=>{const s=r.toLowerCase();return n.indexOf(s)!==-1})};function Fi(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),mn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Fi(s??n,e,n,r))}var D7=class{constructor(t){this.C={},this.I=t.I,this.R=Fi(t.bucketSize,0,100,t.$),this.A=Fi(t.refillRate,0,this.R,t.$),this.O=Fi(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.R,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const Bu="Mobile",Xf="Android",_m="Tablet",EP="Android Tablet",CP="iPad",PP="Apple Watch",F0="Safari",bg="BlackBerry",RP="Samsung Internet",V0="Chrome",AP="Chrome iOS",TP="Internet Explorer",IP="Internet Explorer Mobile",MP="Opera",OP="Microsoft Edge",H0="Firefox",LP="Firefox iOS",xm="Nintendo",wm="PlayStation",Sg="Xbox",NP="Android Mobile",DP="Mobile Safari",N1="Windows",$P="Windows Phone",HS="Nokia",N_="Ouya",$7="Generic "+Bu.toLowerCase(),jP="Generic "+_m.toLowerCase(),D_="Konqueror",FP="Oculus Browser",VP="Vivaldi",HP="Yandex",zP="Whale",BP="DuckDuckGo",UP="Pale Moon",ZP="Waterfox",$_="Brave",WP="Claude",qP="Codex",GP="ChatGPT",KP="Google Search App",D1=new RegExp("Version/(\\d+(\\.\\d+)?)"),$1=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),j7=new RegExp(Sg,"i"),F7=new RegExp("PlayStation \\w+","i"),V7=new RegExp("Nintendo \\w+","i"),Yx=new RegExp("BlackBerry|PlayBook|BB10","i"),H7={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},YP=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?$_:null})(n)||(r!=null&&r.detectGoogleSearchApp&&qe(t,"GSA/")?KP:qe(t," OPR/")&&qe(t,"Mini")?"Opera Mini":qe(t," OPR/")?MP:Yx.test(t)?bg:qe(t,"IEMobile")||qe(t,"WPDesktop")?IP:qe(t,"OculusBrowser")?FP:qe(t,"SamsungBrowser")?RP:qe(t,"Edge")||qe(t,"Edg/")?OP:qe(t,"Vivaldi/")?VP:qe(t,"YaBrowser/")?HP:qe(t,"Whale/")?zP:qe(t,"DuckDuckGo/")||qe(t,"Ddg/")?BP:qe(t,"Claude/")?WP:qe(t,"Codex/")?qP:qe(t,"ChatGPT/")?GP:qe(t,"FBIOS")?"Facebook Mobile":qe(t,"UCWEB")||qe(t,"UCBrowser")?"UC Browser":qe(t,"CriOS")?AP:qe(t,"CrMo")||qe(t,V0)?V0:qe(t,Xf)&&qe(t,F0)?NP:qe(t,"FxiOS")?LP:qe(t.toLowerCase(),D_.toLowerCase())?D_:qe(t,"Brave/")?$_:((i,o)=>o&&qe(o,"Apple")||(function(l){return qe(l,F0)&&!qe(l,V0)&&!qe(l,Xf)})(i))(t,e)?qe(t,Bu)?DP:F0:qe(t,"PaleMoon/")?UP:qe(t,"Waterfox/")?ZP:qe(t,H0)?H0:qe(t,"MSIE")||qe(t,"Trident/")?TP:qe(t,"Gecko")?H0:"")},z7={[IP]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[OP]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[V0]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[AP]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[F0]:[D1],[DP]:[D1],[MP]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[H0]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[LP]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[D_]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[bg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),D1],[NP]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[RP]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[FP]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[VP]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[HP]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[zP]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[$_]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[WP]:[$1],[qP]:[$1],[GP]:[$1],[BP]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[UP]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[ZP]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[KP]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[TP]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},B7=function(t,e,n,r){const s=YP(t,e,n,r),i=z7[s];if(ce(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},zS=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Sg,t&&t[1]||""]],[new RegExp(xm,"i"),[xm,""]],[new RegExp(wm,"i"),[wm,""]],[Yx,[bg,""]],[new RegExp(N1,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[$P,""];if(new RegExp(Bu).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=H7[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[N1,r]}return[N1,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=ce(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Xf,[t[2],t[3],t[4]||"0"].join(".")]:[Xf,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],XP=function(t){for(let e=0;zS.length>e;e++){const[n,r]=zS[e],s=n.exec(t),i=s&&(Xn(r)?r(s,t):r);if(i)return i}return["",""]},QP=function(t){return V7.test(t)?xm:F7.test(t)?wm:j7.test(t)?Sg:new RegExp(N_,"i").test(t)?N_:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?$P:/iPad/.test(t)?CP:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?PP:Yx.test(t)?bg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(HS,"i").test(t)?HS:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Bu).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Xf:EP:new RegExp("(pda|Mobile)","i").test(t)?$7:new RegExp(_m,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?jP:""},U7=function(t,e){var n;const r=QP(t);return r===CP||r===EP||r==="Kobo"||r==="Kindle Fire"||r===jP?_m:r===xm||r===Sg||r===wm||r===N_?"Console":r===PP?"Wearable":r?Bu:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?Bu:_m:"Desktop";var s,i,o},j1=/\bFBAV\/(\d+(?:\.\d+)*)/i,BS=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",j1],[/\bFBAN\/EMA\b/i,"Facebook Lite",j1],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",j1],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],j_="[Truncated]",jh="[Unserializable]";function xu(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function JP(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=jh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const z0=3e5;var e5=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,z0);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+z0))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(z0,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const Z7=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function US(t,e){return typeof(n=t)=="string"&&Z7.test(n)?t:e();var n}function t5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function ja(t){return t&&t.split("#")[0]}function ZS(t){try{return t()}catch{return}}function n5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function WS(t,e,n){return r5.apply(this,arguments)}function r5(){return(r5=Wt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=n5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}let i0,qS,F1;function W7(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return F1&&n.length===qS||(qS=n.length,F1=n.reduce((r,s)=>{i0||(i0={});const i=i0[s];if(i)r[i[0]]=i[1];else{const o=t(s);for(let l=o.length-1;l>=0;l--){const u=o[l],d=u==null?void 0:u.filename,f=e[s];if(d&&f){r[d]=f,i0[s]=[d,f];break}}}return r},{})),F1}function Pf(t){return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pf(t)}function q7(t,e,n){return(e=(function(r){var s=(function(i){if(Pf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Pf(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Pf(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function V(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?GS(Object(n),!0).forEach(function(r){q7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):GS(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var G7=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return Wt(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&We(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return V(V({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return Wt(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const u=n.length,d=i===void 0?V(V({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const p of(l=s.errors)!==null&&l!==void 0?l:[])r(p,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:W7(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(ld(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return We(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],u={},d=(g,v,w=0)=>{const _=f(v,w),x=_.apply;if(_.apply=M=>{l.push(g);try{return x(M)}finally{l.pop()}},w>4||w>0&&l.indexOf(g)!==-1)return this.coerceFallback(_);const b=typeof g=="object"&&g!==null||typeof g=="function";if(w===0&&r>=50||b&&o.has(g))return;b&&o.add(g),w===0&&r++;const E=this.getAggregateErrors(g);let C,R;i||(i=!!E);try{if(C=this.applyCoercers(g,_),!C)throw u}catch(M){if(M===u)return void(w===0&&r--);if(!i)throw M;C=this.coerceFallback(_)}if(!E||r>=50)return C;try{R=E.length}catch{return C}if(!Number.isInteger(R)||0>R||R>4294967295)return C;const A=[];for(let M=0;50>r&&1e3>s&&R>M;M++){let I;s++;try{I=_.next(E[M])}catch{r++,I=this.coerceFallback(f(v+1))}I&&A.push(I)}return V(V({},C),{},{errors:A})},f=(g,v=0)=>V(V({},e),{},{syntheticException:g==0?e.syntheticException:void 0,mechanism:g==0?t:{},apply(w){const _=d(w,g,v+1);if(!_)throw u;return _},next:w=>d(w,g+1)}),p=f(n);return V(V({},p),{},{apply:g=>{var v;return(v=d(g,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const K7=/^([a-z][a-z0-9.+-]+):/i,Y7=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function X7(t){if(!t||t==="<anonymous>")return!1;const e=K7.exec(t);return!e||Y7.includes(e[1].toLowerCase())}function F_(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:X7(e)};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}const s5=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Q7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,J7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,e$=/\((\S*)(?::(\d+))(?::(\d+))\)/,t$=(t,e)=>{const n=Q7.exec(t);if(n){const[,s,i,o]=n;return F_(e,s,"?",+i,+o)}const r=J7.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=e$.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=s5(r[1]||"?",r[2]);return F_(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},n$=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,r$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s$=(t,e)=>{const n=n$.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=r$.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=s5(s,r),F_(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},KS=/\(error: (.*)\)/;function Xx(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function i$(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!Xx(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function o$(t,e){const n=e.start+e.length,r=o5(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function i5(t,e){let n=e.start;for(;n>0&&Xx(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function o5(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&Xx(t[r],t[r-e.length]);)r++;return r-n}function a$(t,e){const n=e[0];let r=t.length-(n?i5(t,n):0);for(const s of e)r-=o5(t,s);return r}function l$(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var c$=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=st(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return ym(t,"DOMException")}isDOMError(t){return ym(t,"DOMError")}},u$=class{match(t){return ld(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},d$=class{match(t){return!!ym(t,"ErrorEvent")&&(t.error!=null||this.ur(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return V(V({},r),{},{stack:(n=this.cr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ur(t){return st(t.message)&&t.message.length>0}cr(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(st(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
+ at ${r.filename}:${s}:${i}`}};const f$=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var h$=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(f$);return r&&(e=r[1],n=r[2]),[e,n]}};const p$=["fatal","error","warning","log","info","debug"];function a5(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var m$=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(Kx(t))return t.constructor.name;const e="name"in t?t.name:void 0;return st(e)&&!Cf(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${a5(t)}`}isSeverityLevel(t){return st(t)&&!Cf(t)&&p$.indexOf(t)>=0}getStack(t){try{return st(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:st(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(ld(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},g$=class{match(t){return Kx(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${a5(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},v$=class{match(t){return SP(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},y$=class{match(t){return ym(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Kx(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return SP(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const bm="$message",Sm="$timestamp",_$=new Set([bm,Sm]),V1={enabled:!0,max_bytes:32768};function km(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:V1.enabled,max_bytes:w$(t.max_bytes,V1.max_bytes)}:V({},V1)}var x$=class{constructor(t){this.ns=[],this.ss=0,this.Rr=km(t)}setConfig(t){this.Rr=km(t),this.rs()}add(t){const e=(function(r){let s;try{s=wP(r)}catch{return}try{const i=JSON.parse(s);if(!ct(i))return;const o=i,l=o[bm],u=o[Sm];return!st(l)||l.trim().length===0||!st(u)&&!mn(u)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Rr.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Rr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function w$(t,e){if(!mn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const YS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function XS(t){return typeof t=="string"||t}function QS(t){return typeof t=="string"?t:void 0}const b$=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],l5="NativeGzipValidationError",V_=t=>t.length>=2&&t[0]===31&&t[1]===139,JS=(t,e)=>t===O_.GZipJS||e===O_.GZipJS||e==="gzip",e8=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let nf;const o0=t=>{throw t5(l5,`Native gzip produced invalid output: ${t}`)},S$=(t8=Wt(function*(t,e){18>t.size&&o0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());V_(n)&&n[2]===8||o0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(nf)return nf;nf=[];for(let u=0;256>u;u++){let d=u;for(let f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;nf[u]=d>>>0}return nf})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&o0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&o0("invalid-size")}),function(t,e){return t8.apply(this,arguments)});var t8;function H_(){return H_=Wt(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=Wt(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,l]);return yield S$(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),H_.apply(this,arguments)}function c5(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;u[d]=o[d]}return u})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const k$={}.propertyIsEnumerable;function Em(t,e){try{return u5(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Qx(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:j_};if(n.remainingNodes--,Nr(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:xu(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:j_};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?xu(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return Qx(s.call(t),e,n,r+1)}catch{}return We(t)?{arrayValue:{values:E$(t,e,n,r+1)}}:{kvlistValue:{values:u5(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:xu(String(t))}}function E$(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(et(l))continue;s.push(Qx(l,e,n,r))}catch{s.push({stringValue:jh})}return t.length>o&&s.push({stringValue:j_}),s}function u5(t,e,n,r){const s=[];for(const i in t)if(k$.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(an(o)||ce(o))continue;s.push({key:xu(i),value:Qx(o,e,n,r)})}catch{s.push({key:xu(i),value:{stringValue:jh}})}}return s}function d5(t,e,n){return V(V(V(V({},JP({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const C$=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function f5(t,e){const n=JP({},t),r={};for(const s of C$)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Em(n,e),...Em(r,e)]}const n8={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},h5={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},P$=h5.info;function R$(t){try{return xu(String(t))}catch{return jh}}function A$(t,e,n,r){const s=t.level||"info",{text:i,number:o}=h5[s]||P$,l=(function(g=Date.now()){return String(g)+"000000"})(mn(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);const d=V({},u),f=t.attributes;if(f){let g=[];try{g=Object.keys(f)}catch{g=[]}for(const v of g){let w;try{w=f[v]}catch{w=jh}Object.defineProperty(d,v,{value:w,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:R$(t.body)},attributes:Em(d,n)};return t.trace_id&&(p.traceId=t.trace_id),t.span_id&&(p.spanId=t.span_id),ce(t.trace_flags)||(p.flags=t.trace_flags),p}function p5(t,e,n){return d5(t,e,n)}function m5(t,e,n,r){return{resourceLogs:[{resource:{attributes:f5(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var g5=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.hs}arm(t){this.clear(),this.us=Date.now()+t,this.hs=n5(()=>{this.hs=void 0,this.ls()},t)}armNoEarlierThan(t){this.hs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function v5(){return .75+.5*Math.random()}function y5(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var T$=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Rr=e,this.$=n,this.cs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new g5(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new e5,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.Ps=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ti.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Rr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Os(t);if(r===null)return;if(!r.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:A$(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.cs(),this.$,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Os(t){const e=this.Rr.beforeSend;if(!e)return t;const n=We(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.Ps>e&&e>=0||(this.xs=t,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var t=this;return Wt(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return Wt(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Ti.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const u=Math.min(n.length,t.Es),d=n.slice(0,u),f=m5(d.map(g=>g.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.js(f);if(t._s!==l)return;if(p.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.$.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(p),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?t.$.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.Rr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Rr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Ti.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}})()}Bs(t){var e=this;return Wt(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Ti.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ti.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return p5(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Ti.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ti.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(y5(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(Ti.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Wt(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield WS(n,t):yield n})()}flushWithTimeout(t){var e=this;return Wt(function*(){const n=e.flush();yield WS(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=v5(),this.$.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const H1=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function r8(t){return String(t)+"000000"}function s8(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var I$=class{constructor(t,e,n){this._instance=t,this.Rr=e,this.$=n,this.zs=new Map,this.ps=new g5(()=>this.flush().catch(r=>{this.$.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new e5,this.ks=0,this.Ss=1,this.Gs=0}count(t,e=1,n){this.Zs({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Zs({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Zs({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this;const e=this.ys,n=(function(){var r=Wt(function*(){e&&(yield e.catch(()=>{})),yield t.Qs()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.zs.size===0)return null;const t=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Os(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.$.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.$.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.$.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?V({},e.attributes):void 0,r=s8(e.type,e.name,e.unit,n)}catch(o){return void this.$.warn(`Dropping metric '${e.name}': attributes could not be serialized`,o)}let s=this.zs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.zs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.$.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,e.value),this.Fs()}Ks(){return this.Rr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Rr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(H1.length+1).fill(0)});const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,H1)]+=1;break}}}Os(t){const e=this.Rr.beforeSend;if(!e)return t;const n=We(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for metric:",i),null}return r}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(y5(this.Rr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var t=this;return Wt(function*(){if(t.ps.clear(),t.zs.size===0)return;const e=t.zs;t.zs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance.Ys(t.Js(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=v5()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.Hs()),r.kind){case"ok":return;case"retry-later":return t.ho(e),void t.ps.armNoEarlierThan(t.Hs());case"too-large":return void t.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.$.error("Failed to send metrics batch:",r.error)}})()}Js(t){return e=this.vo(t),n=(function(i,o,l){return d5(i,o,l)})(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:f5(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}vo(t){const e=r8(Date.now()),n=new Map;for(const o of t.values()){var r;const l=s8(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=V({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=Em((r=o.attributes)!==null&&r!==void 0?r:{},this.$),f=r8(o.windowStartMs);if(o.type==="count"){var s;const p={attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0};u.sum.dataPoints.push(p)}else if(o.type==="gauge"){var i;const p={attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0};u.gauge.dataPoints.push(p)}else o.hist&&u.histogram.dataPoints.push({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:H1})}return Array.from(n.values())}ho(t){for(const[r,s]of t){const i=this.zs.get(r);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,s.windowStartMs),i.type){case"count":var e,n;i.total=((e=i.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(i.hist){i.hist.count+=s.hist.count,i.hist.sum+=s.hist.sum,i.hist.min=Math.min(i.hist.min,s.hist.min),i.hist.max=Math.max(i.hist.max,s.hist.max);for(let o=0;i.hist.bucketCounts.length>o;o++)i.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else i.hist=s.hist}else this.Ks()&&this.zs.set(r,s)}}};const _5=(t,{debugEnabled:e}={})=>{const n={N(r,...s){J&&(Ao.DEBUG||J.POSTHOG_DEBUG||e)&&!ce(J.console)&&J.console&&("__rrweb_original__"in J.console[r]?J.console[r].__rrweb_original__:J.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>_5(`${t} ${r}`,s)};return n},ve=_5("[PostHog.js]"),dn=ve.createLogger,M$=dn("[ExternalScriptsLoader]"),Cm=t=>{const e=ue==null?void 0:ue.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},Ll=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return M$.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=Cm(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!ue)return n("document not found");if(Cm(e))return Ll(t,e,n);let i=ue.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")ue.head.appendChild(i);else{const l=ue.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):ue.body.appendChild(i)}};ue!=null&&ue.body?s():ue==null||ue.addEventListener("DOMContentLoaded",s)},z1={},i8=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};je.__PosthogExtensions__=je.__PosthogExtensions__||{},je.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void Ll(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=z1[s];if(r==="fallback"&&i){if(Cm(i))return void Ll(t,i,n);delete z1[s]}return void Ll(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=i8(t,e);z1[s]=d;const f=Cm(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),Ll(t,d,n)}else n(void 0,l)}:n)}Ll(t,i8(t,e),n)},je.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);Ll(t,r,n)},Ao.DEBUG=!1,Ao.LIB_VERSION="1.434.14",Ao.LIB_NAME="web";var Bn=Ao;const O$="$people_distinct_id",li="distinct_id",Jx="$device_id",B1="$device_model",Pm="__alias",L$="__cmpns",o8="$fbc",wu="$fbc_persistence",a8="$fbp",Rf="$fbp_persistence",z_="__timers",x5="$autocapture_disabled_server_side",B_="$heatmaps_enabled_server_side",U_="$exception_capture_enabled_server_side",w5="$error_tracking_suppression_rules",Z_="$error_tracking_capture_extension_exceptions",W_="$web_vitals_enabled_server_side",ew="$dead_clicks_enabled_server_side",tw="$product_tours_enabled_server_side",b5="$logs_capture_enabled_server_side",S5="$web_vitals_allowed_metrics",Af="$session_recording_remote_config",N$="$session_recording_enabled_server_side",D$="$replay_sample_rate",$$="$replay_override_sampling",j$="$replay_override_linked_flag",F$="$replay_override_url_trigger",V$="$replay_override_event_trigger",du="$sesid",k5="$session_is_sampled",H$="$session_past_minimum_duration",z$="$session_recording_url_trigger_activated_session",B$="$session_recording_event_trigger_activated_session",U$="$debug_first_full_snapshot_timestamp",Z$="$sess_rec_flush_size",pi="$enabled_feature_flags",Eo="$active_feature_flags",q_="$early_access_features",Ql="$feature_flag_details",Sa="$feature_flag_payloads",Jl="$feature_flag_request_id",Tf="$minimal_flag_called_events",Ai="$override_feature_flags",Nl="$override_feature_flag_payloads",ka="$stored_person_properties",Ea="$stored_group_properties",E5="$groups",G_="$surveys",Rm="$surveys_loaded_at",C5="$surveys_activated",P5="$surveys_activated_session",R5="$surveys_activated_timestamps",K_="ph_product_tours",W$="$product_tours_activated",q$="$product_tours_activated_session",G$="$conversations_widget_session_id",K$="$conversations_ticket_id",Y$="$conversations_widget_state",X$="$conversations_user_traits",Ca="$flag_call_reported",yf="$flag_call_reported_session_id",Qf="$feature_flag_errors",Ma="$feature_flag_evaluated_at",Lr="$user_state",Y_="$client_session_props",Q$="$capture_rate_limit",A5="$initial_campaign_params",T5="$initial_referrer_info",fu="$initial_person_info",nw="$epp",U1="$posthog_cookieless",I5="$cookieless_mode",M5="$sdk_debug_extensions_init_method",O5="$sdk_debug_extensions_init_time_ms",L5="$sdk_debug_recording_script_not_loaded",N5="$sdk_debug_replay_stale_config",J$="$sdk_debug_replay_event_trigger_status",ej="$sdk_debug_replay_linked_flag_trigger_status",tj="$sdk_debug_replay_matched_recording_trigger_groups",nj="$sdk_debug_replay_pending_trigger_conditions",rj="$sdk_debug_replay_remote_trigger_matching_config",sj="$sdk_debug_replay_trigger_groups_count",ij="$sdk_debug_replay_url_trigger_status",oj="$session_recording_start_reason",rw="PostHog loadExternalDependency extension not found.",Co="anonymous",B0="identified",D5="identified_only",Jf="visibilitychange",Am="beforeunload",sw="$pageview",l8="$pageleave",$5="$identify",c8="$groupidentify";function hu(t,e){We(t)&&t.forEach(e)}function Rt(t,e){if(!et(t))if(We(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)Gx.call(t,n)&&e(t[n],n)}const Bt=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function U0(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const aj=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ve.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ve.critical(n)}}},iw=function(t){const e={};return Rt(t,function(n,r){(st(n)&&n.length>0||mn(n))&&(e[r]=n)}),e};function j5(t){const e=V({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const lj=["herokuapp.com","vercel.app","netlify.app"];function cj(t){const e=t==null?void 0:t.hostname;if(!st(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of lj)if(n===r)return!1;return!0}function St(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function X_(t){return t.name==="ph_toolbar_internal"}const If=t=>{if(ue){try{const e=t+"=",n=ue.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return mn(t)&&isFinite(t)&&Math.floor(t)===t});var uj=class Q_{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new Q_(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Q_(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},dj=class{generate(){const t=this.generateOrAbort();if(!ce(t))return t;{this.Ct=0;const e=this.generateOrAbort();if(ce(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return mn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return uj.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new fj}};let F5=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};J&&!ce(J.crypto)&&crypto.getRandomValues&&(F5=t=>crypto.getRandomValues(t));var fj=class{nextUint32(){return this.Rt.length>this.$t||(F5(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let u8;const mi=()=>hj().toString(),hj=()=>(u8||(u8=new dj)).generate();let rf="";const pj=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let Kc=null;const sn={Et(){if(!an(Kc))return Kc;if(Kc=!1,ue)try{const t=`__ph_cookie_support_${mi()}`;sn.At(t,"xyz"),Kc=If(t)==='"xyz"',sn.Lt(t)}catch{Kc=!1}return Kc},Pt(t){ve.error("cookieStore error: "+t)},Ot:If,Dt(t){let e;try{e=JSON.parse(sn.Ot(t))||{}}catch{}return e},At(t,e,n,r,s){if(!ue)return!1;try{let i="",o="";const l=(function(d,f){if(f){let p=(function(g,v=ue){if(rf)return rf;if(!v||["localhost","127.0.0.1"].includes(g))return"";const w=g.split(".");let _=Math.min(w.length,8);const x="dmn_chk_"+mi();for(;!rf&&_--;){const b=w.slice(_).join("."),E=x+"=1;domain=."+b+";path=/";v.cookie=E+";max-age=3",v.cookie.includes(x)&&(v.cookie=E+";max-age=0",rf=b)}return rf})(d);if(!p){const g=(v=>{const w=v.match(pj);return w?w[0]:""})(d);g!==p&&ve.info("Warning: cookie subdomain discovery mismatch",g,p),p=g}return p?"; domain=."+p:""}return""})(ue.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+u.length),ue.cookie=u,!0}catch{return!1}},Lt(t,e){if(ue!=null&&ue.cookie&&(!e||!an(If(t))))try{sn.At(t,"",-1,e)}catch{return}}};let Z1=null;const gt={Et(){if(!an(Z1))return Z1;let t=!0;if(ce(J))t=!1;else try{const e="__mplssupport__";gt.At(e,"xyz"),gt.Ot(e)!=='"xyz"'&&(t=!1),gt.Lt(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),Z1=t,t},Pt(t){ve.error("localStorage error: "+t)},Ot(t){try{return J==null?void 0:J.localStorage.getItem(t)}catch(e){gt.Pt(e)}return null},Dt(t){try{return JSON.parse(gt.Ot(t))||{}}catch{}return null},At(t,e){try{return J==null||J.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){gt.Pt(n)}return!1},Lt(t){try{J==null||J.localStorage.removeItem(t)}catch(e){gt.Pt(e)}}},W1=[ka,Eo,pi,Ql,Sa,Jl,Ma,Qf,Ca],Dl=[Jx,li,du,k5,nw,fu,wu,Lr],Tm=t=>t+"_cpm",mj=["__proto__","constructor","prototype"],q1=t=>{if(!ct(t))return{};const e={};return Object.keys(t).forEach(n=>{mj.indexOf(n)===-1&&(e[n]=t[n])}),e},G1=(t,e=[])=>{const n={};return[...Dl,...e].forEach(r=>{const s=t[r];ce(s)||an(s)||s===""||(n[r]=s)}),n},V5=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},d8=(t,e)=>({p:e,f:V5(JSON.stringify(t))}),f8=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=sn.Dt(Tm(t)),r=(n==null?void 0:n.f)===V5(e)&&We(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},K1=(t,e)=>e+"|"+(sn.Ot(Tm(t))||""),Yc={},J_={Et:()=>!0,Pt(t){ve.error("memoryStorage error: "+t)},Ot:t=>t in Yc?Yc[t]:null,Dt:t=>t in Yc?Yc[t]:null,At:(t,e)=>(Yc[t]=e,!0),Lt(t){delete Yc[t]}};let wl=null;const Vt={Et(){if(!an(wl))return wl;if(wl=!0,ce(J))wl=!1;else try{const t="__support__";Vt.At(t,"xyz"),Vt.Ot(t)!=='"xyz"'&&(wl=!1),Vt.Lt(t)}catch{wl=!1}return wl},Pt(t){ve.error("sessionStorage error: ",t)},Ot(t){try{return J==null?void 0:J.sessionStorage.getItem(t)}catch(e){Vt.Pt(e)}return null},Dt(t){try{return JSON.parse(Vt.Ot(t))||null}catch{}return null},At(t,e){try{return J==null||J.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Vt.Pt(n)}return!1},Lt(t){try{J==null||J.sessionStorage.removeItem(t)}catch(e){Vt.Pt(e)}}};var gj=class{constructor(t){this._instance=t}get Rr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return this.Rr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Rr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Rr.opt_out_capturing_by_default}optInOut(t){this.qo.At(this.jo,t?1:0,this.Rr.cookie_expiration,this.Rr.cross_subdomain_cookie,this.Rr.secure_cookie)}reset(){this.qo.Lt(this.jo,this.Rr.cross_subdomain_cookie)}get jo(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get No(){const t=this.qo.Ot(this.jo);return L1(t)?1:qe(L7,t)?0:-1}get qo(){const t=this.Rr.opt_out_capturing_persistence_type,e=t==="localStorage"?gt:sn,n=e.Et()?e:J_;if(!this.Bo||this.Bo!==n){this.Bo=n;const r=t==="localStorage"?sn:gt;r.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(L1(r.Ot(this.jo))),r.Lt(this.jo,this.Rr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Rr.respect_dnt&&[Qn==null?void 0:Qn.doNotTrack,Qn==null?void 0:Qn.msDoNotTrack,je.doNotTrack,Qn==null?void 0:Qn.globalPrivacyControl].some(t=>L1(t))}};function H5(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Xn(r))return e;try{const s=r(e);return st(s)&&s?s:e}catch(s){return ve.error("Error in get_current_url, falling back to window.location.href",s),e}}function h8(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Ui(t){return!!t&&t.nodeType===1}function mr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function z5(t){return!!t&&t.nodeType===3}function ow(t){return!!t&&t.nodeType===11&&Ui(t.host)}function aw(t){return t?xg(t).split(/\s+/):[]}function p8(t,e){const n=(function(r){var s;const i=J==null||(s=J.location)===null||s===void 0?void 0:s.href;return ce(i)?void 0:H5(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function Uu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return aw(e)}function B5(t){return et(t)?null:xg(t).split(/(\s+)/).filter(e=>Of(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function eh(t){let e="";return bu(t)&&!th(t)&&t.childNodes&&t.childNodes.length&&Rt(t.childNodes,function(n){var r;z5(n)&&n.textContent&&(e+=(r=B5(n.textContent))!==null&&r!==void 0?r:"")}),xg(e)}function Mf(t){var e;return ce(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const lw=["a","button","form","input","select","textarea","label"];function e2(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function t2(t,e){if(ce(e))return!0;for(const n of t)if(e.some(r=>e2(n,r)))return!0;return!1}function U5(t){const e=t.parentNode;return!(!e||!Ui(e))&&e}const Y1=[".ph-no-autocapture","[data-ph-no-autocapture]"],Z5=["next","previous","prev",">","<"],vj=[...Z5,"+","-","−","–"],m8=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,g8=[".ph-no-rageclick",".ph-no-capture"],yj=["","text","search","email","password","url","tel","number"];function W5(t,e){if(!J||cw(t))return!1;let n,r,s;var i,o;if(Nr(e)?(n=!!e&&g8,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:g8,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!Ui(u))&&(!!mr(u,"textarea")||(mr(u,"input")?qe(yj,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const p=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return p==="true"||p===""})(u)))})(t))return!1;const{targetElementList:l}=q5(t,!1);return!(function(u,d){if(u===!1||ce(u))return!1;let f;if(u===!0)f=Z5;else{if(!We(u))return!1;if(u.length>10)return ve.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;f=u.map(p=>p.toLowerCase())}return d.some(({safeText:p,ariaLabel:g})=>f.some(v=>m8(p,v)||m8(g,v)))})(r,l.map(u=>{var d;return{safeText:eh(u).toLowerCase(),ariaLabel:((d=u.getAttribute("aria-label"))===null||d===void 0?void 0:d.toLowerCase().trim())||""}}))&&!t2(l,n)}const cw=t=>!t||mr(t,"html")||!Ui(t),q5=(t,e)=>{if(!J||cw(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!mr(s,"body");){if(ow(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=U5(s);if(!i)break;if(e||lw.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{const o=J.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function bu(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!mr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=Uu(i);if(qe(o,"ph-sensitive")||qe(o,"ph-no-capture"))return!1}if(qe(Uu(t),"ph-include"))return!0;const r=t.type||"";if(st(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!st(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function th(t){return!!(mr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||mr(t,"select")||mr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const v8=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),y8=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,_j=[16,15,14,13],xj=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),_8=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),x8=/[0-9A-Za-z_]/;function wj(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Of(t,e=!0){return!(et(t)||st(t)&&(t=xg(t),(e?v8.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(y8.lastIndex=0;r=y8.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of _j){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(v8.test(d)&&wj(d))return!0}}}return!1})(t))||(e?xj.test(t):(function(n){let r;for(_8.lastIndex=0;r=_8.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&x8.test(s)&&x8.test(i)))return!0}return!1})(t))))}function w8(t){let e=eh(t);return e=`${e} ${G5(t)}`.trim(),Of(e)?e:""}function G5(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Rt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=eh(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${G5(n)}`.trim())}catch(s){ve.error("[AutoCapture]",s)}}),e}function b8(t){return t.replace(/"|\\"/g,'\\"')}function bj(t){const e=t.attr__class;if(e)return We(e)?e:aw(e)}const a0=dn("[Dead Clicks]"),Sj=()=>!0,kj=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(ew)),r=t.instance.config.capture_dead_clicks;return Nr(r)?r:!!ct(r)||n};var S8=class{get lazyLoadedDeadClicksAutocapture(){return this.Ho}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[ew]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Uo()}):this.stop()}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?a0.error("failed to load script",s):t()})}Uo(){var t;if(ue){if(!this.Ho&&(!((t=je.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=ct(this.instance.config.capture_dead_clicks)?V({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Ho=je.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ho.start(ue),a0.info("starting...")}}else a0.error("`document` not found. Cannot start.")}stop(){this.Ho&&(this.Ho.stop(),this.Ho=void 0,a0.info("stopping..."))}};const sf=dn("[SegmentIntegration]");function k8(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Xn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const p=v=>{const w=()=>v.anonymousId()||mi();l.config.get_device_id=w,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:w()}),l.persistence.set_property(Lr,B0)),d(f?void 0:v.anonymousId()||void 0)},g=u.user();"then"in g&&Xn(g.then)?g.then(p):p(g)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||sf.warn("This browser does not have Promise support, and can not use the segment integration");const p=(g,v)=>{if(!v)return g;const w=!!d&&g.event.anonymousId===d&&!g.event.userId;w||g.event.userId||g.event.anonymousId===u.get_distinct_id()||(sf.info("No userId set, resetting PostHog"),u.reset()),w||(d=void 0),g.event.userId&&g.event.userId!==u.get_distinct_id()&&(sf.info("UserId set, identifying with PostHog"),u.identify(g.event.userId));let _=u.calculateEventProperties(v,g.event.properties);if(!et(f)){const x=g.event.properties||{},b={};for(const C of Object.keys(_))Gx.call(x,C)||(b[C]=_[C]);const E=((C,R)=>{const A=We(C)?C:[C];let M=V({},R);for(const I of A)try{if(M=I(M),et(M))return null}catch(T){return sf.error("Error in Segment filterProperties:",T),null}return M})(f,b);if(et(E))return g;_=E}return g.event.properties=Object.assign({},_,g.event.properties),g};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(g){return p(g,g.event.event)},page(g){return p(g,sw)},identify(g){return p(g,$5)},screen(g){return p(g,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{sf.error("Failed to register the Segment integration",u),e()})},n)}const K5="posthog-js";function Y5(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,f,p;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const g=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],w=v.map(b=>V(V({},b),{},{stacktrace:b.stacktrace?V(V({},b.stacktrace),{},{type:"raw",frames:(b.stacktrace.frames||[]).map(E=>V(V({},E),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:w,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(p=v[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var x;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((x=t.exceptions)===null||x===void 0||x.sendExceptionEvent(_)),o}}var Ej=class{constructor(t,e,n,r,s,i){this.name=K5,this.setupOnce=function(o){o(Y5(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},E8=class{constructor(t){this.Wo=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Go()}Go(){var t;this.Zo=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Wo)}destroy(){var t;(t=this.Zo)===null||t===void 0||t.call(this),this.Zo=void 0}doPageView(t,e){var n;const r=this.Qo(t,e);return this.Vo={pathname:(n=J==null?void 0:J.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Qo(t,(e=this.Vo)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Vo)===null||t===void 0?void 0:t.pageViewId}}Qo(t,e){const n=this.Vo;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(ce(i)||ce(o)||ce(l)||ce(u)||ce(d)||ce(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const p=i>1?Fi(o/i,0,1,ve):1,g=i>1?Fi(l/i,0,1,ve):1,v=u>1?Fi(d/u,0,1,ve):1,w=u>1?Fi(f/u,0,1,ve):1;r=Bt(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:w})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const of=["flags","surveys"],Cj={[O$]:{exposure:"hidden"},[Pm]:{exposure:"hidden"},[L$]:{exposure:"hidden"},[z_]:{exposure:"hidden"},[wu]:{exposure:"hidden"},[Rf]:{exposure:"hidden"},[x5]:{exposure:"event"},[B_]:{exposure:"hidden"},[b5]:{exposure:"hidden"},[U_]:{exposure:"event"},[w5]:{exposure:"hidden"},[Z_]:{exposure:"event"},[W_]:{exposure:"event"},[ew]:{exposure:"event"},[tw]:{exposure:"hidden"},[S5]:{exposure:"event"},[Af]:{exposure:"hidden"},[N$]:{exposure:"hidden"},[du]:{exposure:"hidden"},[k5]:{exposure:"event"},[D$]:{exposure:"event",shouldSkipFromEventProperties:t=>an(t)},[H$]:{exposure:"event"},[z$]:{exposure:"event"},[B$]:{exposure:"event"},[U$]:{exposure:"event"},[Z$]:{exposure:"hidden"},[pi]:{exposure:"hidden",storageGroup:"flags"},[Eo]:{exposure:"hidden",storageGroup:"flags"},[q_]:{exposure:"hidden"},[Ql]:{exposure:"hidden",storageGroup:"flags"},[Sa]:{exposure:"hidden",storageGroup:"flags"},[Jl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Tf]:{exposure:"hidden",storageGroup:"flags"},[Ai]:{exposure:"hidden"},[Nl]:{exposure:"hidden"},[ka]:{exposure:"hidden"},[Ea]:{exposure:"hidden"},[G_]:{exposure:"hidden",storageGroup:"surveys"},[Rm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[C5]:{exposure:"event"},[P5]:{exposure:"hidden"},[R5]:{exposure:"hidden"},[K_]:{exposure:"hidden"},[W$]:{exposure:"hidden"},[q$]:{exposure:"hidden"},[G$]:{exposure:"event"},[K$]:{exposure:"event"},[Y$]:{exposure:"event"},[X$]:{exposure:"event"},[Ca]:{exposure:"hidden"},[yf]:{exposure:"hidden"},[E5]:{exposure:"event"},[Qf]:{exposure:"hidden"},[Ma]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Lr]:{exposure:"hidden"},[Y_]:{exposure:"hidden"},[Q$]:{exposure:"hidden"},[A5]:{exposure:"hidden"},[T5]:{exposure:"hidden"},[fu]:{exposure:"hidden"},[nw]:{exposure:"hidden"},[$$]:{exposure:"event"},[j$]:{exposure:"event"},[F$]:{exposure:"event"},[V$]:{exposure:"event"},[M5]:{exposure:"event"},[O5]:{exposure:"event"},[L5]:{exposure:"event"},[N5]:{exposure:"event"},[J$]:{exposure:"event"},[ej]:{exposure:"event"},[tj]:{exposure:"event"},[nj]:{exposure:"event"},[rj]:{exposure:"event"},[sj]:{exposure:"event"},[ij]:{exposure:"event"},[oj]:{exposure:"event"}},Pj=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],sr=t=>{const e=Cj[t];if(e)return e;for(const[n,r]of Pj)if(t.indexOf(n)===0)return r},pu=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return ld(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,j5(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return wP(t)}},Fa=t=>{const e=ue==null?void 0:ue.createElement("a");return ce(e)?null:(e.href=t,e)},Zu=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split("=");if(i[0]===e){r=i;break}}if(!We(r)||2>r.length)return"";{let s=r[1];try{s=decodeURIComponent(s)}catch{ve.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")}},nh=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[];for(let p=0;u.length>p;p++){const g=u[p].split("=");We(g)&&(e.includes(g[0])?d.push(g[0]+"="+n):d.push(u[p]))}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Im=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},X5=(t,e)=>t>=e&&xP(),Q5=(t,e,n,r)=>{if(t===0){if(xP()){const s=e+1;return s===n&&r(),s}return e}return 0},Wu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Rj=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Wu],rh="<masked>",Aj=["li_fat_id"];function J5(t,e,n){if(!ue)return{};const r=e?[...Wu,...n||[]]:[],s=eR(nh(ue.URL,r,rh),t),i=(function(){const o={};return Rt(Aj,function(l){const u=If(l);o[l]=u||null}),o})();return Bt(i,s)}function eR(t,e){const n=Rj.concat(e||[]),r={};return Rt(n,function(s){const i=Zu(t,s);r[s]=i||null}),r}function tR(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!an(e)){r.$search_engine=e;const s=ue?Zu(ue.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function nR(){return navigator.language||navigator.userLanguage}function Tj(){const t=nR();return typeof t=="string"?t.split("-")[0]:void 0}const Mm="$direct";function rR(){return(ue==null?void 0:ue.referrer)||Mm}function sR(t,e,n=!1){const r=t?[...Wu,...e||[]]:[],s=n?ja(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:rR().substring(0,1e3),u:i?nh(i,r,rh):void 0}}function iR(t,e=!1){var n;const{r,u:s}=t,i=e?ja(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Mm?Mm:(n=Fa(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Fa(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=eR(i);Bt(o,u)}if(r){const l=tR(r);Bt(o,l)}return o}function oR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Ij(){try{return new Date().getTimezoneOffset()}catch{return}}const Mj={flags:Ma,surveys:Rm},Oj=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],l0=t=>`${t}_cookie_identity_change_pending`,c0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},Fn="main",yo=[pi,Eo,Ql,Sa,Jl,Ma,Tf,ka],X1=t=>yo.indexOf(t)!==-1,aR=[wu,Rf],C8=t=>aR.indexOf(t)!==-1,ca=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},Xc=t=>{if(!t)return{};const e=JSON.parse(t);return ct(e)?e:{}},P8=(t,e)=>{Rt(t,(n,r)=>{const s=sr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var Q1=class{constructor(t,e,n=!0){if(this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Rr=t,this.la=n,this.props={},this.ua=void 0,this.ha=(r=>{let s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.qo=this.ca(t),this.Yo=this.da(t),this.load(),this.va(),t.debug&&ve.info("Persistence loaded",t.persistence,V({},this.props)),this.update_config(t,t,e),this.save(),J){const r=()=>this.flush();St(J,"beforeunload",r,{capture:!1}),St(J,"pagehide",r,{capture:!1}),this.fa=s=>{if(this.Ko&&(!s.storageArea||s.storageArea===(J==null?void 0:J.localStorage))&&s.key)if(s.key!==this.ha){if(this.Yo){const i=of.find(o=>s.key===this.pa(o));i&&this.ga(s.key,i)}}else this.ga(s.key,Fn)},St(J,"storage",this.fa)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.ia.get(e);if(!X1(e)||r===!0)return;if(n===!0)return void this.ma(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.ma(e,s)})}onCrossTabFeatureFlagChange(t){return this.aa.add(t),()=>this.aa.delete(t)}destroy(){this.fa&&J&&(J.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(t,e,n=!0){if(this.mi)return!1;let r,s;try{if(s=gt.Ot(t),an(s)){const l=this.ya(e);return l.storageValue=null,e!==Fn&&(l.persisted=!1),!1}r=Xc(s)}catch{return!1}const i=e===Fn?r:gt.Dt(this.ha);if(i&&this.ba(i))return!1;const o=this._a(r,e,n);return e===Fn&&this.Yo&&!ca(this.wa().main,r)||this.ka(r,e,!0,s),o}ba(t){const e=this.props[li],n=t[li];return!ce(e)&&!ce(n)&&e!==n}ka(t,e,n,r){const s=this.ya(e);s.storageValue=r,e!==Fn&&(s.persisted=n);try{s.fingerprint=this.Sa(t,e)}catch{s.fingerprint=void 0}}_a(t,e,n){let r=!1;return yo.forEach(s=>{var i;const o=(i=sr(s))===null||i===void 0?void 0:i.storageGroup;if(e===Fn&&this.Yo&&o||e!==Fn&&o!==e)return;const l=s in t,u=this.xa(s,l?t[s]:void 0),d=this.ia.has(s)?s in this.props:l;d===s in this.props&&ca(u,this.props[s])||(d?this.Ca(s,u,!1):this.$a(s,!1),r=!0)}),r&&n&&this.aa.forEach(s=>s()),r}Ta(){if(!this.Ko)return!1;try{this.ra=!1;const t=gt.Ot(this.ha),e=this.ya(Fn);let n,r=!1,s=!1;if(t!==e.storageValue)if(an(t))e.storageValue=null;else{if(n=Xc(t),this.ra=!this.sa&&this.ba(n),this.ra)return!1;s=this._a(n,Fn,!1),!this.Yo||ca(this.wa().main,n)?this.ka(n,Fn,!0,t):e.storageValue=t,r=!0}return this.Yo&&of.forEach(i=>{const o=gt.Ot(this.pa(i)),l=this.ya(i),u=n||{},d=r&&yo.some(p=>{var g;return((g=sr(p))===null||g===void 0?void 0:g.storageGroup)===i&&p in u});if(o===l.storageValue&&!d)return;if(an(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this._a(u,i,!1)||s));const f=Xc(o);s=this._a(f,i,!1)||s,this.ka(f,i,!0,o)}),s}catch{return!1}}ma(t,e){this.ia.set(t,e);const n=sr(t);n!=null&&n.volatile||(this.ya((this.Yo?n==null?void 0:n.storageGroup:void 0)||Fn).fingerprint=void 0,this.Ia(t))}Ma(){yo.forEach(t=>this.ia.set(t,!0))}va(){if(this.Ko)try{const t=gt.Ot(this.ha),e=Xc(t);this.ya(Fn).storageValue=t,yo.forEach(n=>{var r;const s=this.Yo?(r=sr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?gt.Ot(this.pa(s)):null;if(s){const l=this.ya(s);l.storageValue=i,l.persisted=!an(i)}const o=s&&!an(i)?Xc(i):e;n in this.props?this.Ea(n,o[n],this.props[n]):n in o&&this.ma(n,!0)})}catch{}}xa(t,e){const n=this.ia.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(We(e)?e:[]),o=new Set(We(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=ct(e)?V({},e):{},s=ct(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Ea(t,e,n){if(!X1(t))return;const r=this.ia.get(t);if(r===!0)return;let s=e;if(this.Ko)try{var i;const l=this.Yo?(i=sr(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.pa(l):this.ha;s=Xc(gt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!ce(e)&&!We(e)||!ce(s)&&!We(s)||!We(n))return void this.ma(t,!0);const l=new Set(e||[]),u=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!ct(n))return void(ca(s,n)?this.ia.delete(t):this.ma(t,!0));{if(!ce(e)&&!ct(e)||ce(e)&&Gr(n)&&ce(s))return void this.ma(t,!0);const l=ct(e)?e:{},u=ct(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&ca(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&ca(u[d],n[d])&&o.delete(d)})}}o.size?this.ma(t,o):this.ia.delete(t)}Pa(){var t;const e=(t=this.Rr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return mn(e)&&e>0?e:0}Ra(t){if(this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=G1(t,this.Rr.cookie_persisted_properties||[]),n=d8(e,this.Rr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=sn.Ot(this.ha)||void 0;s&&K1(this.ha,s)===r&&(this.Aa=r,this.Fa=s)}catch{}else try{const e=sn.Ot(this.ha)||void 0;this.Aa=e?K1(this.ha,e):void 0,this.Fa=e}catch{}}syncCookieProperties(){return this.Oa(this.Rr)}Oa(t,e=!1){if(this.mi&&!e||this.ea||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=sn.Ot(this.ha)||void 0}catch{}if(!n||n===this.Fa)return!1;const r=K1(this.ha,n);let s;try{s=q1(JSON.parse(n))}catch{return!1}if((sn.Ot(this.ha)||void 0)!==n)return!1;this.Aa=r,this.Fa=n;const i=f8(this.ha,n),o=[...Dl,...i.properties],l={};if(Object.keys(s).forEach(_=>{const x=s[_];(ce(x)||an(x)||x===""||_==="$user_state"&&x!=="anonymous"&&x!=="identified")&&(l[_]=!0,delete s[_])}),Gr(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[li],p=d[Lr],g=Bt({},d);[...Dl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const x=g[_];(i.isValid||Dl.indexOf(_)===-1||x!==!1&&x!==0)&&delete g[_]}}),this.props=Bt(g,s),yo.forEach(_=>{const x=_ in this.props;_ in d===x&&ca(d[_],this.props[_])||(x?this.Ea(_,d[_],this.props[_]):this.ma(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.Ca(Lr,Co);const v=this.props[li],w=this.props[Lr];return!u||v===f&&w===p||(this.sa=!0,this.ta=!0,Vt.At(l0(this.ha),!0),this.$a(ka),this.$a(Eo),this.$a(pi),this.$a(Ql),this.$a(Sa),this.$a(Jl),this.$a(Ma),this.$a(Qf),this.$a(Ca),w!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(ce(f)||v===f)||(P8(this.props,s),this.$a(Ea)),w==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.$a(Pm)),!0}consumeCookieIdentityChange(){const t=l0(this.ha),e=this.ta||!!Vt.Ot(t);return this.ta=!1,e&&Vt.Lt(t),e}Da(t=!1){return!(this.ea||this.mi&&!t||!this.Rr.cookieWinsOnConflict||this.Rr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ea=!0,0))}La(){this.ea&&(ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[Fn],this.qa(!0))}ja(t=!0){if(this.ea)try{t?this.La():ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.mi}ca(t){Oj.indexOf(t.persistence.toLowerCase())===-1&&(ve.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1)=>{const u=[...Dl,...o];return V(V({},gt),{},{Dt(d){try{let p,g={};try{p=sn.Ot(d)||void 0,g=p?q1(JSON.parse(p)):{}}catch{}const v=JSON.parse(gt.Ot(d)||"{}");let w;if(l){const _=f8(d,p),x=[...Dl,..._.properties],b={};Object.keys(g).forEach(C=>{const R=g[C];an(R)||R===""||C==="$user_state"&&R!=="anonymous"&&R!=="identified"||(b[C]=R)});const E="distinct_id"in b||b.$user_state==="anonymous"||b.$user_state==="identified";if(Object.keys(b).length>0){var f;const C=v[li],R=(f=v.$user_state)!==null&&f!==void 0?f:Co;u.forEach(A=>{if(x.indexOf(A)!==-1&&!(A in g)&&(E||A!=="distinct_id"&&A!=="$user_state")){const M=v[A];(_.isValid||Dl.indexOf(A)===-1||M!==!1&&M!==0)&&delete v[A]}}),!E||"$user_state"in g||"$user_state"in v||(v[Lr]=Co),!E||("distinct_id"in b?b[li]:v[li])===C&&("$user_state"in b?b[Lr]:v[Lr])===R||(W1.forEach(A=>delete v[A]),b.$user_state==="identified"&&"distinct_id"in b?v.$user_id=b[li]:delete v.$user_id,b.$user_state!=="identified"&&(delete v[E5],delete v[Ea]),delete v.__alias)}w=Bt(v,b)}else w=Bt(g,v);return gt.At(d,w),w}catch{}return null},At(d,f,p,g,v,w){const _=gt.At(d,f,void 0,void 0,w);try{const x=G1(f,o);if(Object.keys(x).length){if(l){const b=Tm(d),E=d8(x,o);if(sn.At(b,E,p,g,v,w),sn.Ot(b)!==JSON.stringify(E)){sn.Lt(b,g);const C=G1(f);return sn.At(d,C,p,g,v,w),_}}sn.At(d,x,p,g,v,w)}}catch(x){gt.Pt(x)}return _},Lt(d,f){try{J==null||J.localStorage.removeItem(d),sn.Lt(d,f),sn.Lt(Tm(d),f)}catch(p){gt.Pt(p)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&gt.Et()?(n=gt,s=!0):i==="localstorage+cookie"&&e.Et()?(n=e,s=!0,r=!0):i==="sessionstorage"&&Vt.Et()?n=Vt:i==="memory"?n=J_:i==="cookie"&&sn.Et()?(n=sn,r=!0):e.Et()?(n=e,s=!0,r=!0):sn.Et()?(n=sn,r=!0):n=J_,this.Ko=s,this.Xo=r,n}pa(t){return`${this.ha}__${t}`}da(t){return this.Ko&&!!t.split_storage}properties(){const t={};return Rt(this.props,(e,n)=>{const r=sr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.mi&&!t)return;const e=this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie",n=e?gt.Dt(this.ha):null;let r={};if(e)try{r=q1(sn.Dt(this.ha)),Rt(r,(l,u)=>{(ce(l)||an(l)||l==="")&&delete r[u]})}catch{}const s=this.qo.Dt(this.ha);if(s&&(this.props=Bt({},s)),this.Yo&&this.Ba(),e&&s){var i,o;const l=n==null?void 0:n[li],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Co,d=s[li],f=(o=s.$user_state)!==null&&o!==void 0?o:Co;if(d!==l||f!==u){this.ta=!0,Vt.At(l0(this.ha),!0);const p=Bt({},this.props);W1.forEach(v=>delete p[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(ce(l)||d===l)||(P8(p,r),delete p[Ea]),this.props=p;const g=new Set;W1.forEach(v=>{var w;const _=(w=sr(v))===null||w===void 0?void 0:w.storageGroup;_&&g.add(_)}),g.forEach(v=>{const w={};Rt(this.props,(_,x)=>{var b;((b=sr(x))===null||b===void 0?void 0:b.storageGroup)===v&&(w[x]=_)}),Gr(w)?(gt.Lt(this.pa(v)),this.Jo[v]={}):gt.At(this.pa(v),w)&&(this.Jo[v]={persisted:!0,fingerprint:this.Sa(w,v)})})}}Vt.Ot(l0(this.ha))&&(this.ta=!0)}Ba(){for(const t of of){const e=gt.Dt(this.pa(t));if(e&&!Gr(e)){const n=this.ya(t);n.persisted=!0,this.Ha(t)||(n.fingerprint=this.Sa(e,t)),this.za(t,e)||Bt(this.props,e)}}}Ha(t){return Object.keys(this.props).some(e=>{var n;return((n=sr(e))===null||n===void 0?void 0:n.storageGroup)===t})}za(t,e){const n=Mj[t];if(!n)return!1;const r=e[n],s=this.props[n];return mn(r)&&mn(s)&&s>r}refreshKey(t){var e;if(this.mi||this.oa.has(t))return;const n=this.Yo?(e=sr(t))===null||e===void 0?void 0:e.storageGroup:void 0,r=n?gt.Dt(this.pa(n)):this.qo.Dt(this.ha);if(r&&t in r)this.Ca(t,r[t],!1);else{if(n){const s=this.qo.Dt(this.ha);if(s&&t in s)return void this.Ca(t,s[t],!1)}this.$a(t,!1)}}save(){if(this.mi)return;const t=this.Pa();t>0?ce(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},t)):this.qa()}flush(){ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(t=!1){if(this.mi||this.ea&&!t)return;t||(this.syncCookieProperties(),this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie"||aR.forEach(s=>this.refreshKey(s)));const e=!t&&!this.na;e||(this.ra=!1);const n=!!e&&this.Ta();if(this.ra)return void(this.Rr.debug&&ve.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Yo)return this.Ua(),void(n&&this.aa.forEach(s=>s()));const r=this.Wa(this.qo,this.ha,this.props,Fn);r==="written"&&this.Ra(this.props),r!=="failed"&&(this.ia.clear(),this.sa=!1,this.oa.clear()),n&&this.aa.forEach(s=>s())}Ua(){const{main:t,groups:e}=this.wa(),n=this.Wa(this.qo,this.ha,t,Fn);n==="written"&&this.Ra(t),n!=="failed"&&(this.sa=!1,this.oa.clear(),yo.forEach(s=>{var i;!((i=sr(s))===null||i===void 0)&&i.storageGroup||this.ia.delete(s)}));for(const s of of){var r;const i=e[s];if(Gr(i)&&!(!((r=this.Jo[s])===null||r===void 0)&&r.persisted)){yo.forEach(l=>{var u;((u=sr(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.ia.delete(l)});continue}const o=this.Wa(gt,this.pa(s),i,s);o!=="failed"&&yo.forEach(l=>{const u=sr(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ia.delete(l)})}}wa(){const t={},e={flags:{},surveys:{}};return Rt(this.props,(n,r)=>{var s;const i=(s=sr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}Sa(t,e){if(e===Fn)return JSON.stringify(t)+"|"+this.Va+"|"+this.Ga+"|"+this.Za;const n={};return Rt(t,(r,s)=>{var i;n[s]=!((i=sr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Wa(t,e,n,r){const s=this.ya(r);if(r!==Fn&&!s.dirty&&!ce(s.fingerprint))return"skipped";let i;try{if(i=this.Sa(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.At(e,n,this.Va,this.Ga,this.Za,this.Rr.debug)?(s.dirty=!1,r!==Fn&&(s.persisted=!0),ce(i)||(s.fingerprint=i),this.Ko&&(s.storageValue=gt.Ot(e)),"written"):(this.Rr.debug&&ve.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Ma(),ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Lt(this.ha,!1),this.qo.Lt(this.ha,!0),!t&&this.la)for(const e of of)gt.Lt(this.pa(e));t?delete this.Jo[Fn]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(ct(t)){this.syncCookieProperties(),ce(e)&&(e="None"),this.Va=ce(n)?this.Qa:n;let r=!1;if(Rt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Ca(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(ct(t)){this.syncCookieProperties(),this.Va=ce(e)?this.Qa:e;let n=!1;if(Rt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||ct(r)||We(r))&&(this.Ca(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.$a(r),n=!0);n&&this.save()}update_campaign_params(){const t=ue==null?void 0:ue.URL;if(t===this.ua)return;const e=J5(this.Rr.custom_campaign_params,this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties),n=!Gr(iw(e));return n&&this.register(e),this.ua=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=ue==null?void 0:ue.referrer;return t?tR(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:rR(),$referring_domain:(ue==null?void 0:ue.referrer)&&((t=Fa(ue.referrer))===null||t===void 0?void 0:t.host)||Mm},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=sR(this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties,this.Rr.disable_capture_url_hashes);this.register_once({[fu]:this.Xo?{r:c0(t.r),u:t.u?c0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Rt([T5,A5],n=>{const r=this.props[n];r&&Rt(r,function(s,i){t["$initial_"+L_(i)]=s})});const e=this.props[fu];if(e){const n=(function(r,s=!1){const i=iR(r,s),o={};return Rt(i,function(l,u){o[`$initial_${L_(u)}`]=l}),o})(e,this.Rr.disable_capture_url_hashes);Bt(t,n)}return t}safe_merge(t){return Rt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,w)=>{if(v.length!==w.length)return!1;const _=[...v].sort(),x=[...w].sort();return _.every((b,E)=>b===x[E])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.mi&&!l;l||this.Oa(e,u),this.Rr=t,!l&&(r||s||o)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(V(V({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.ca(t):this.qo;this.Ja();const f=this.da(t),p=i||f!==this.Yo,g=!l&&(p||t.cross_subdomain_cookie!==this.Ga||t.secure_cookie!==this.Za)&&this.Da(u);this.na=p;try{if(this.Qa=this.Va=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),p){const v=this.props;this.clear(),this.qo=d,this.Yo=f,this.props=v,this.save()}else o&&(this.qo=d,l||(delete this.Jo[Fn],this.qa()))}finally{this.na=!1,g&&this.ja()}}Ja(){const t=this.props[fu];if(!this.Xo||!ct(t)||typeof t.r!="string")return;const e=c0(t.r),n=typeof t.u=="string"?c0(t.u):t.u;e===t.r&&n===t.u||this.Ca(fu,V(V({},t),{},{r:e,u:n}))}set_disabled(t){this.mi=t,this.mi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ga&&(this.Ga=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Za&&(this.Za=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.Ca(z_,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return ce(n)||(delete e[t],this.Ca(z_,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.Ca(t,e),this.save()}Ca(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.sa=!0),C8(t)&&!ca(s,e)&&this.oa.add(t),this.Ea(t,s,e),!((r=sr(t))===null||r===void 0)&&r.volatile||this.Ia(t))}$a(t,e=!0){delete this.props[t],e&&(X1(t)&&this.ma(t,!0),C8(t)&&this.oa.add(t),this.Ia(t))}Ia(t){var e;const n=(e=sr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.ya(n).dirty=!0)}ya(t){return this.Jo[t]||(this.Jo[t]={})}};const gs={GZipJS:"gzip-js",Base64:"base64"},af={Activation:"events",Cancellation:"cancelEvents"},J1={Popover:"popover",API:"api",Widget:"widget"},Po={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},ey={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},n2={Popover:"popover",Inline:"inline"};function u0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Xn(n.then)&&n.then(void 0,()=>{})}}}}const Lj={SHOWN:"product tour shown"},R8={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},A8=dn("[RateLimiter]");var Nj=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{A8.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void A8.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t=!1){var e,n,r;const{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),l=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:s,last:o};l.tokens+=(o-l.last)/1e3*i,l.last=o,l.tokens>s&&(l.tokens=s);const u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){const d=(mn(l.dropped)?l.dropped:0)+1;l.dropped=d,!this.lastEventRateLimited&&this.Ka(d)&&(l.dropped=0)}return this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property("$capture_rate_limit",l),{isRateLimited:u,remainingTokens:l.tokens}}Xa(t){const e=this.instance.config.property_denylist;return!We(e)||!e.includes(t)}Ya(){var t;if(this.Xa("$current_url")&&this.Xa("$pathname")&&(on!=null&&on.pathname))return`${(t=on.origin)!==null&&t!==void 0?t:""}${on.pathname}`}Ka(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Ya(),o=this.Xa("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const ua=dn("[RemoteConfig]");var lR=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=je._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}tl(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}el(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return ua.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void ua.warn("Remote config is disabled. Falling back to local config.");this.tl(t=>{if(!t)return ua.info("No config found after loading remote JS config. Falling back to JSON."),void this.el(e=>{this.il(e.json,e)});this.il(t)})}catch(t){ua.error("Error loading remote config",t),this.il()}}il(t,e){!t&&e&&(e.statusCode===0?e.error||ua.warn("Failed to fetch remote config from PostHog."):ua.error("Failed to fetch remote config from PostHog."));try{this._instance.il(t?{ok:!0,config:t}:{ok:!1})}catch(r){ua.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){ua.error("Error loading feature flags",r)}}},Ws=Uint8Array,Yr=Uint16Array,qu=Uint32Array,uw=new Ws([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),dw=new Ws([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),T8=new Ws([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cR=function(t,e){for(var n=new Yr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new qu(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},uR=cR(uw,2),r2=uR[1];uR[0][28]=258,r2[258]=28;for(var I8=cR(dw,0)[1],dR=new Yr(32768),cn=0;32768>cn;++cn){var Qc=(43690&cn)>>>1|(21845&cn)<<1;dR[cn]=((65280&(Qc=(61680&(Qc=(52428&Qc)>>>2|(13107&Qc)<<2))>>>4|(3855&Qc)<<4))>>>8|(255&Qc)<<8)>>>1}var Lf=function(t,e,n){for(var r=t.length,s=0,i=new Yr(e);r>s;++s)++i[t[s]-1];var o,l=new Yr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Yr(r),s=0;r>s;++s)o[s]=dR[l[t[s]-1]++]>>>15-t[s];return o},ac=new Ws(288);for(cn=0;144>cn;++cn)ac[cn]=8;for(cn=144;256>cn;++cn)ac[cn]=9;for(cn=256;280>cn;++cn)ac[cn]=7;for(cn=280;288>cn;++cn)ac[cn]=8;var Om=new Ws(32);for(cn=0;32>cn;++cn)Om[cn]=5;var Dj=Lf(ac,9),$j=Lf(Om,5),fR=function(t){return(t/8|0)+(7&t&&1)},hR=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Yr?Yr:t instanceof qu?qu:Ws)(n-e);return r.set(t.subarray(e,n)),r},uo=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},lf=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},ty=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new Ws(0),0];if(s==1){var o=new Ws(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(A,M){return A.f-M.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[p].f>n[d].f?d++:p++],u=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var g=i[0].s;for(r=1;s>r;++r)i[r].s>g&&(g=i[r].s);var v=new Yr(g+1),w=s2(n[f-1],v,0);if(w>e){r=0;var _=0,x=w-e,b=1<<x;for(i.sort(function(A,M){return v[M.s]-v[A.s]||A.f-M.f});s>r;++r){var E=i[r].s;if(e>=v[E])break;_+=b-(1<<w-v[E]),v[E]=e}for(_>>>=x;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var R=i[r].s;v[R]==e&&(--v[R],++_)}w=e}return[new Ws(v),w]},s2=function(t,e,n){return t.s==-1?Math.max(s2(t.l,e,n+1),s2(t.r,e,n+1)):e[t.s]=n},M8=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Yr(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},cf=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},i2=function(t,e,n){var r=n.length,s=fR(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},O8=function(t,e,n,r,s,i,o,l,u,d,f){uo(e,f++,n),++s[256];for(var p=ty(s,15),g=p[0],v=p[1],w=ty(i,15),_=w[0],x=w[1],b=M8(g),E=b[0],C=b[1],R=M8(_),A=R[0],M=R[1],I=new Yr(19),T=0;E.length>T;++T)I[31&E[T]]++;for(T=0;A.length>T;++T)I[31&A[T]]++;for(var L=ty(I,7),D=L[0],B=L[1],j=19;j>4&&!D[T8[j-1]];--j);var K,U,H,Z,Q=d+5<<3,z=cf(s,ac)+cf(i,Om)+o,ee=cf(s,g)+cf(i,_)+o+14+3*j+cf(I,D)+(2*I[16]+3*I[17]+7*I[18]);if(z>=Q&&ee>=Q)return i2(e,f,t.subarray(u,u+d));if(uo(e,f,1+(z>ee)),f+=2,z>ee){K=Lf(g,v),U=g,H=Lf(_,x),Z=_;var W=Lf(D,B);for(uo(e,f,C-257),uo(e,f+5,M-1),uo(e,f+10,j-4),f+=14,T=0;j>T;++T)uo(e,f+3*T,D[T8[T]]);f+=3*j;for(var N=[E,A],X=0;2>X;++X){var ie=N[X];for(T=0;ie.length>T;++T)uo(e,f,W[ne=31&ie[T]]),f+=D[ne],ne>15&&(uo(e,f,ie[T]>>>5&127),f+=ie[T]>>>12)}}else K=Dj,U=ac,H=$j,Z=Om;for(T=0;l>T;++T)if(r[T]>255){var ne;lf(e,f,K[257+(ne=r[T]>>>18&31)]),f+=U[ne+257],ne>7&&(uo(e,f,r[T]>>>23&31),f+=uw[ne]);var oe=31&r[T];lf(e,f,H[oe]),f+=Z[oe],oe>3&&(lf(e,f,r[T]>>>5&8191),f+=dw[oe])}else lf(e,f,K[r[T]]),f+=U[r[T]];return lf(e,f,K[256]),f+U[256]},jj=new qu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fj=(function(){for(var t=new qu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),ny=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Vj(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(g){for(var v=p,w=0;g.length>w;++w)v=Fj[255&v^g[w]]^v>>>8;p=v},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,g,v,w,_,x){var b=p.length,E=new Ws(w+b+5*(1+Math.floor(b/7e3))+_),C=E.subarray(w,E.length-_),R=0;if(!g||8>b)for(var A=0;b>=A;A+=65535){var M=A+65535;b>M?R=i2(C,R,p.subarray(A,M)):(C[A]=x,R=i2(C,R,p.subarray(A,b)))}else{for(var I=jj[g-1],T=I>>>13,L=8191&I,D=(1<<v)-1,B=new Yr(32768),j=new Yr(D+1),K=Math.ceil(v/3),U=2*K,H=function(Be){return(p[Be]^p[Be+1]<<K^p[Be+2]<<U)&D},Z=new qu(25e3),Q=new Yr(288),z=new Yr(32),ee=0,W=0,N=(A=0,0),X=0,ie=0;b>A;++A){var ne=H(A),oe=32767&A,fe=j[ne];if(B[oe]=fe,j[ne]=oe,A>=X){var xe=b-A;if((ee>7e3||N>24576)&&xe>423){R=O8(p,C,0,Z,Q,z,W,N,ie,A-ie,R),N=ee=W=0,ie=A;for(var de=0;286>de;++de)Q[de]=0;for(de=0;30>de;++de)z[de]=0}var ae=2,Oe=0,Ce=L,Ge=oe-fe&32767;if(xe>2&&ne==H(A-Ge))for(var dt=Math.min(T,xe)-1,Lt=Math.min(32767,A),Kt=Math.min(258,xe);Lt>=Ge&&--Ce&&oe!=fe;){if(p[A+ae]==p[A+ae-Ge]){for(var _t=0;Kt>_t&&p[A+_t]==p[A+_t-Ge];++_t);if(_t>ae){if(ae=_t,Oe=Ge,_t>dt)break;var ht=Math.min(Ge,_t-2),En=0;for(de=0;ht>de;++de){var kt=A-Ge+de+32768&32767,Yt=kt-B[kt]+32768&32767;Yt>En&&(En=Yt,fe=kt)}}}Ge+=(oe=fe)-(fe=B[oe])+32768&32767}if(Oe){Z[N++]=268435456|r2[ae]<<18|I8[Oe];var Le=31&r2[ae],rt=31&I8[Oe];W+=uw[Le]+dw[rt],++Q[257+Le],++z[rt],X=A+ae,++ee}else Z[N++]=p[A],++Q[p[A]]}}R=O8(p,C,x,Z,Q,z,W,N,ie,A-ie,R)}return hR(E,0,w+fR(R)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),f=d.length;return(function(p,g){var v=g.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>g.level?4:g.level==9?2:0,p[9]=3,g.mtime!=0&&ny(p,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){p[3]=8;for(var w=0;v.length>=w;++w)p[w+10]=v.charCodeAt(w)}})(d,e),ny(d,f-8,n.d()),ny(d,f-4,r),d}const Hj=!!qx||!!Yf,pR=new WeakMap,mR="text/plain";let ry=0,Z0=!1;const gR=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},Fh=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=V({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[p,g]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:g;return delete o[p],`${p}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let p,g;const v=[];return Rt(d,function(w,_){ce(w)||ce(_)||_==="undefined"||(p=encodeURIComponent((x=>x instanceof File)(w)?w.name:w.toString()),g=encodeURIComponent(_),v[v.length]=g+"="+p)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},sy=t=>{if(t.sl)return t.sl;const{data:e,compression:n}=t;if(!e)return;if(n===gs.GZipJS){const s=Vj((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Ws(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},f=0;o>f;++f){if(u+5>l.length){var p=new Ws(u+8+(o-f<<1));p.set(l),l=p}var g=i.charCodeAt(f);128>g?d(g):2048>g?(d(192|g>>>6),d(128|63&g)):g>55295&&57344>g?(d(240|(g=65536+(1047552&g)|1023&i.charCodeAt(++f))>>>18),d(128|g>>>12&63),d(128|g>>>6&63),d(128|63&g)):(d(224|g>>>12),d(128|g>>>6&63),d(128|63&g))}return hR(l,0,u)})(pu(e)),{mtime:0});return{contentType:mR,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===gs.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(pu(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:pu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=pu(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},vR=t=>{const e=()=>t.transport==="sendBeacon"?{url:Fh(t.url,{compression:gs.Base64}),encodedBody:sy(V(V({},t),{},{compression:gs.Base64,sl:void 0}))}:{url:gR(t.url,"compression"),encodedBody:sy(V(V({},t),{},{compression:void 0,sl:void 0}))};let n;try{n=sy(t)}catch(s){if(JS(t.compression,Zu(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&JS(t.compression,Zu(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?V_(new Uint8Array(r)):ArrayBuffer.isView(r)&&V_(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Z0=!0,e()):{url:t.url,encodedBody:n};var r},yR=t=>{try{return vR(t)}catch(n){var e;return ve.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},zj=(function(){var t=Wt(function*(e){const n=yield(function(s){return H_.apply(this,arguments)})(pu(e.data),Bn.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return V(V({},e),{},{sl:{contentType:mR,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),Bj=/Failed to fetch|NetworkError|Load failed/i,_R=t=>(t==null?void 0:t.name)==="TypeError"&&Bj.test((t==null?void 0:t.message)||""),xR=t=>{try{const e=(function(n,r=Date.now()){if(typeof n!="string"||!n)return;const s=n.trim(),i=/^\d+\s*,/.test(s)?s.slice(0,s.indexOf(",")).trim():s;if(/^\d+$/.test(i)){const u=1e3*Math.min(Number(i),300);return u>0?u:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i))return;const o=/^\w{3} \w{3} /.test(i)?i+" GMT":i,l=Date.parse(o)-r;return Number.isFinite(l)&&l>0?Math.min(l,z0):void 0})(t());return ce(e)?void 0:Math.min(e,3e4)}catch{return}},wR=t=>{const e=yR(t);if(!e)return;const n=new qx;pR.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Rt(t.headers,function(l,u){n.setRequestHeader(u,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,u,xR(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},bR=t=>{const e=yR(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Rt(t.headers,function(w,_){l.append(_,w)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(jS){const w=new jS;u={signal:w.signal,timeout:setTimeout(()=>{d=!0;try{w.abort(t5("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(x){p(x)}var _},t.timeout)}}let f=!1;const p=w=>{var _;f||(f=!0,d&&(w==null?void 0:w.name)==="AbortError"||_R(w)?ve.warn(w):ve.error(w),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:w}))};let g=0;const v=()=>{ry-=g,g=0,u&&clearTimeout(u.timeout)};try{const w=V({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),_=o??(ce(i)?0:void 0);w.keepalive=w.method==="POST"&&!t.rl&&w.keepalive!==!1&&w.body===i&&!ce(_)&&_>=0&&52428.8>ry+_,w.keepalive&&(g=_,ry+=g),Yf(n,w).then(x=>x.text().then(b=>{var E;if(f)return;const C={statusCode:x.status,text:b};if(x.status===200)try{C.json=JSON.parse(b)}catch(R){ve.error(R)}f=!0,v(),(E=t.callback)===null||E===void 0||E.call(t,C,xR(()=>x.headers.get("Retry-After")))})).catch(x=>{v(),p(x)}).finally(v)}catch(w){v(),p(w)}},o2=t=>{try{var e;const{url:n,encodedBody:r}=vR(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Qn.sendBeacon(n,l))return;const u=We(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(We(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=p=>We(t.data)?p:V(V({},t.data),{},{batch:p});return o2(V(V({},t),{},{data:f(u.slice(0,d))})),void o2(V(V({},t),{},{data:f(u.slice(d))}))}ve.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${Yf?"fetch":"XHR"}`),Yf?bR(V(V({},t),{},{rl:!0})):wR(t)}catch(n){ve.warn("Beacon send failed",n)}},L8=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Fh(n===gs.GZipJS?gR(t,"compression"):t,V(V({},s?{[s]:Date.now().toString()}:{}),n===gs.GZipJS?{}:{compression:n}))},Uj=(()=>{const t=[];return Yf&&t.push({transport:"fetch",method:bR}),qx&&t.push({transport:"XHR",method:wR}),Qn!=null&&Qn.sendBeacon&&t.push({transport:"sendBeacon",method:o2}),t})();let SR=!Hj&&(Or==null?void 0:Or.indexOf("MSIE"))===-1&&(Or==null?void 0:Or.indexOf("Mozilla"))===-1;function kR(t,e,n){var r,s,i;n&&(e=V(V({},e),{},{callback:o=>n(o)})),t.__loaded?SR?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((s=e.callback)===null||s===void 0||s.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=V(V({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(ce(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((o,l)=>{var u,d,f;const p=V(V({},o),{},{callback:l??(x=>{var b;return(b=o.callback)===null||b===void 0?void 0:b.call(o,x)})});p.timeout=p.timeout||6e4;const g=(u=p.transport)!==null&&u!==void 0?u:"fetch";g==="sendBeacon"&&ce(p.compression)&&p.data&&(p.compression=gs.Base64),p.method==="POST"&&p.data&&(p.timestampMode==="capture-body"?p.data=(x=>{var b,E;const C=(We(x)?x:[x]).map(A=>V(V({},A),A.timestamp instanceof Date&&!isNaN(A.timestamp.getTime())?{timestamp:A.timestamp.toISOString()}:{})),R=C[0];return{api_key:(b=R==null||(E=R.properties)===null||E===void 0?void 0:E.token)!==null&&b!==void 0?b:R==null?void 0:R.token,batch:C,sent_at:new Date().toISOString()}})(p.data):p.timestampMode==="body"&&(p.data=((x,b=new Date().toISOString())=>We(x)?x.map(E=>V(V({},E),{},{sent_at:b})):V(V({},x),{},{sent_at:b}))(p.data))),p.url=L8(p.url,p.method,p.compression,p.timestampMode);const v=Uj.filter(x=>!p.disableTransport||!x.transport||!p.disableTransport.includes(x.transport)),w=(d=(f=(function(x,b){for(let E=0;x.length>E;E++)if(b(x[E]))return x[E]})(v,x=>x.transport===g))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!w)throw new Error("No available transport method");const _=x=>{try{w(x)}catch(E){var b;_R(E)?ve.warn(E):ve.error(E),(b=p.callback)===null||b===void 0||b.call(p,{statusCode:0,error:E})}};g!=="sendBeacon"&&!p.preferSyncCompression&&p.data&&p.compression===gs.GZipJS&&P7&&typeof Promise<"u"&&!Z0?zj(p).then(x=>{_(x)}).catch(x=>{if(e8(x))return Z0=!0,void _(V(V({},p),{},{compression:void 0,url:L8(o.url,o.method,void 0,o.timestampMode)}));(b=>{if(!b||typeof b!="object")return!1;const E="name"in b?String(b.name):"";return e8(b)||E===l5})(x)&&(Z0=!0),_(p)}):_(p)})(e,(o,l)=>{var u,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.call(d,o),n?n(o,l):(f=e.callback)===null||f===void 0||f.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var Zj=class{constructor(t,e){this.ol=!0,this.al=[],this.ll=Fi((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ve.createLogger("flush interval"),3e3),this.ul=t}enqueue(t){this.al.push(t),this.hl||this.cl()}unload(){this.dl();const t=this.al.length>0?this.vl():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.fl(n,"sendBeacon")})}enable(){this.ol=!1,this.cl()}cl(){this.ol||(this.hl=setTimeout(()=>{if(this.dl(),this.al.length>0){const t=this.vl();for(const e in t)this.fl(t[e])}},this.ll))}fl(t,e){try{this.ul(t,e)}catch(n){ve.error(n)}}dl(){clearTimeout(this.hl),this.hl=void 0}vl(){const t={};return Rt(this.al,e=>{var n;const r=e,s=((r?r.batchKey:null)||r.url)+(r.batchGroup?`:${r.batchGroup}`:"");ce(t[s])&&(t[s]=V(V({},r),{},{data:[]})),(n=t[s].data)===null||n===void 0||n.push(r.data)}),this.al=[],t}};const Wj=["retriesPerformedSoFar"];var qj=class{constructor(t){this._instance=t,this.pl=!1,this.gl=3e3,this.al=[],this.al=[],this.ml=!0,this.resume()}resume(){if(!ce(J)&&"onLine"in J.navigator){if(this.ml=J.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.bl()},this._l=()=>{this.ml=!1},St(J,"online",this.yl),St(J,"offline",this._l)}}get length(){return this.al.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=c5(t,Wj);vo(n)&&(r.url=Fh(r.url,{retry_count:n})),kR(this._instance,e?V(V({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls(V({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ve.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.al.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ve.warn(i),this.pl||(this.pl=!0,this.wl())}wl(){if(this.kl&&clearTimeout(this.kl),this.al.length===0)return this.pl=!1,void(this.kl=void 0);this.kl=setTimeout(()=>{this.ml&&this.al.length>0&&this.bl(),this.wl()},this.gl)}bl(){const t=Date.now(),e=[],n=this.al.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.al=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.pl=!1,ce(J)||(this.yl&&(J.removeEventListener("online",this.yl),this.yl=void 0),this._l&&(J.removeEventListener("offline",this._l),this._l=void 0));for(const{requestOptions:t}of this.al)try{this._instance._send_request(V(V({},t),{},{transport:"sendBeacon"}))}catch(e){ve.error(e)}this.al=[]}},Gj=class{constructor(t){this._instance=t,this.Sl=()=>{var e,n,r,s;this.xl||(this.xl={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.xl.lastScrollY=Math.ceil(o),this.xl.maxScrollY=Math.max(o,(e=this.xl.maxScrollY)!==null&&e!==void 0?e:0),this.xl.maxScrollHeight=Math.max(l,(n=this.xl.maxScrollHeight)!==null&&n!==void 0?n:0),this.xl.lastContentY=u,this.xl.maxContentY=Math.max(u,(r=this.xl.maxContentY)!==null&&r!==void 0?r:0),this.xl.maxContentHeight=Math.max(d,(s=this.xl.maxContentHeight)!==null&&s!==void 0?s:0)}}get Cl(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){const t=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),t}startMeasuringScrollPosition(){St(J,"scroll",this.Sl,{capture:!0}),St(J,"scrollend",this.Sl,{capture:!0}),St(J,"resize",this.Sl)}scrollElement(){if(this.Cl){const n=We(this.Cl)?this.Cl:[this.Cl];for(const r of n){var t;const s=J==null||(t=J.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return J==null||(e=J.document)===null||e===void 0?void 0:e.documentElement}$l(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.Cl){const s=this.scrollElement();return s&&s[r]||0}return J?t==="y"?J.scrollY||J.pageYOffset||((e=J.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:J.scrollX||J.pageXOffset||((n=J.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}};const Kj=t=>sR(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var N8=class{constructor(t,e,n,r){this.Be=s=>{const i=this.Tl();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Il(this._instance)};this.Ml.register({[Y_]:o})},this._instance=t,this.El=e,this.Ml=n,this.Il=r||Kj,this.El.onSessionId(this.Be)}Tl(){return this.Ml.props[Y_]}getSetOnceProps(){var t;const e=(t=this.Tl())===null||t===void 0?void 0:t.props;return e?"r"in e?iR(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return Rt(iw(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${L_(n)}`]=e}),t}},Lm=class{on(t,e){return this.Pl[t]||(this.Pl[t]=[]),this.Pl[t].push(e),()=>{this.Pl[t]=this.Pl[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Pl[t]||[])n(e);for(const n of this.Pl["*"]||[])n(t,e)}constructor(){this.Pl={}}};const Jc=dn("[SessionId]"),D8=864e5;var $8=class{on(t,e){return this.Rl.on(t,e)}constructor(t,e,n){var r;if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new Lm,this.Nl=(i,o)=>!(!vo(i)||!vo(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rr=t.config,this.Ml=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=e||mi,this.Bl=n||mi;const s=this.Rr.persistence_name||this.Rr.token;if(this._sessionTimeoutMs=1e3*Fi(this.Rr.session_idle_timeout_seconds||1800,60,36e3,Jc.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hl(),this.zl="ph_"+s+"_window_id",this.Ul="ph_"+s+"_primary_window_exists",this.Wl()){const i=Vt.Dt(this.zl),o=Vt.Dt(this.Ul);i&&!o?this.He=i:Vt.Lt(this.zl),Vt.At(this.Ul,!0)}!((r=this.Rr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Rr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ce(this.Ol)&&(this.Ol=[]),this.Ol.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.Ol=this.Ol.filter(e=>e!==t)}}Wl(){return this.Rr.persistence!=="memory"&&!this.Ml.mi&&Vt.Et()}Gl(t){t!==this.He&&(this.He=t,this.Wl()&&Vt.At(this.zl,t))}Zl(){return this.He?this.He:this.Wl()?Vt.Dt(this.zl):null}Ql(t){const e=this.Al;return!an(e)&&!an(t)&&5e3>Math.abs(t-e)}Jl(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Ql(e)||(this.Al=e,this.Ml.register({[du]:[e,t,n]}))}Kl(){var t;const e=(t=this.Rr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return vo(e)&&e>0}Xl(){this.Kl()?this.Ml.refreshKey(du):(this.Ml.flush(),this.Ml.load())}Yl(){var t;if(an(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Al)return;this.Xl();const[,e,n]=this.tu();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[du]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){const[t]=this.tu(),e=vo(t)?t:0,n=vo(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}iu(t){return this.Xl(),this.Nl(t,this.eu())}tu(){const t=this.Ml.props[du];return We(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void Jc.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void Jc.error("Invalid sessionID in bootstrap",i)}})(t);return!ce(n)&&(e?this.ql={sessionId:t,sessionStartTimestamp:n}:this.Jl(t,new Date().getTime(),n),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&J&&(J.removeEventListener(Am,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&Vt.Lt(this.Ul)},St(J,Am,this.Dl,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Rr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Fl=r;else if(an(this.Fl)||this.Fl>r||r-this.Fl>=1e3){var i,o;(i=(o=this.Ml).syncCookieProperties)===null||i===void 0||i.call(o),this.Fl=r}let[,l,u]=this.tu();const d=!ce(s)&&l!==s,f=this.eu();let p=this.Zl();const g=this.ql,v=!!g&&(g.sessionStartTimestamp>r+6e4||r-g.sessionStartTimestamp>D8),w=g?v:vo(u)&&Math.abs(r-u)>D8;let _=!1,x=d,b=!l||!!g;const E=l;let C=!b&&!t&&this.Nl(r,f);if(C&&(C=this.iu(r),C||Jc.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.tu(),C||(b=!l||!!g)),b||C||w){x=!1;const I=g&&!v;l=I?g.sessionId:this.jl(),p=this.Bl(),Jc.info("new session ID assigned",{sessionId:l,windowId:p,bootstrapped:!!I,changeReason:{noSessionId:b,activityTimeout:C,sessionPastMaximumLength:w}}),u=I?g.sessionStartTimestamp:r,this.ql=void 0,_=!0}else p||(p=this.Bl(),_=!0),x=x||l!==E,x&&(Jc.info("adopted cross-tab session id",{sessionId:l,windowId:p}),_=!0);const R=vo(f)&&t&&!w?f:r,A=vo(u)?u:new Date().getTime();this.Gl(p),this.Jl(l,R,A),t||this.Hl();const M={noSessionId:b,activityTimeout:C,sessionPastMaximumLength:w,crossTabAdoption:x};return _&&this.Ol.forEach(I=>I(l,p,M)),{sessionId:l,windowId:p,sessionStartTimestamp:A,changeReason:_?M:void 0,lastActivityTimestamp:f}}Hl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:t})}else this.Hl()},1.1*this.sessionTimeoutMs))}};const ER=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&VS(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>VS(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function CR(){return(CR=Wt(function*(){const t=Qn==null?void 0:Qn.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return st(n)&&n.length>0?n:void 0}catch(e){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function Yj(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function PR(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Nm=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},d0=t=>t.toLowerCase(),RR={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>Nm(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Nm(n,r))),icontains:(t,e)=>e.map(d0).some(n=>t.map(d0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(d0).every(n=>t.map(d0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function AR(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=RR[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function iy(t,e,n){return pu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const a2="custom",j8="i.posthog.com",Xj=/^\/static\//,Qj=["/s/","/e/","/i/"];var Jj=class{constructor(t){this.su={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${j8}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.su[this.apiHost]||(this.su[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":a2),this.su[this.apiHost]}ru(t){if(!Xj.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}ou(t){const e=Fa(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}au(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Fa(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&Qj.some(o=>e.indexOf(o)===0)){const o=this.ou(r);if(o){const l=this.apiHost;let u=this.lu;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.lu=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.lu,n=this.ou(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.au(t,e,this.uiHost+e);if(t==="flags")return this.au(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.ru(e);if(r)return this.au(t,e,`${r}${e}`)}if(this.region===a2)return this.au(t,e,this.apiHost+e);const n=j8+e;switch(t){case"assets":return this.au(t,e,`https://${this.region}-assets.${n}`);case"api":return this.au(t,e,`https://${this.region}.${n}`)}}};const Ct=dn("[Surveys]"),TR=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Ct.error("Failed to persist survey seen state",e)}},eF=[J1.Popover,J1.Widget,J1.API],tF={ignoreConditions:!1,ignoreDelay:!1,displayType:n2.Popover},nF=dn("[PostHog ExternalIntegrations]"),rF={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var sF=class{constructor(t){this._instance=t}zo(t,e){var n,r;(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return nF.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=je.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.zo(rF[s],()=>{var o;(o=je.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=je.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=je.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},iF=class{constructor(t,e){this.$=t,this.wo=e,this.uu=new Map,this.Io=!1}add(t){var e=this;return Wt(function*(){if(e.Io)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.uu.has(t.name))throw new Error(`Browser extension "${t.name}" is already registered`);e.uu.set(t.name,t);try{const n=t.setup(e.wo);n&&(yield n)}catch(n){const r=e.uu.get(t.name)===t;r&&e.uu.delete(t.name),e.$.error(`Failed to set up browser extension "${t.name}"`,n),r&&e.hu(t)}})()}getExtension(t){return this.uu.get(t)}dispose(){if(this.Io)return;this.Io=!0;const t=Array.from(this.uu.values()).reverse();this.uu.clear();for(const e of t)this.hu(e)}hu(t){try{var e;const n=(e=t.dispose)===null||e===void 0?void 0:e.call(t);n&&Xn(n.then)&&n.then(void 0,r=>{this.$.error(`Failed to dispose browser extension "${t.name}"`,r)})}catch(n){this.$.error(`Failed to dispose browser extension "${t.name}"`,n)}}},oF=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);ce(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}};const F8="extensionsRemoteConfig";var aF=class{constructor(t){this.instance=t,this.Io=!1,this.$=ve,this.cu=t.du,this.kv=new oF(t),this.onEvent=e=>u0(this.instance.on("eventCaptured",n=>{try{e({event:n.event,properties:n.properties})}catch(r){this.$.error("Browser extension event listener failed",r)}})),this.onRemoteConfig=e=>{if(this.Io)return u0(()=>{});const n=s=>{try{e(s)}catch(i){this.$.error("Browser extension remote config listener failed",i)}},r=this.instance.vu.on(F8,n);return this.cu&&n(this.cu),u0(r)},this.fu=new iF(ve.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(Jx);return typeof t=="string"?t:void 0}get library(){return{name:Bn.LIB_NAME,version:Bn.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r;const s=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=s==null?void 0:s.sessionId)!==null&&e!==void 0?e:"",windowId:(n=s==null?void 0:s.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=s==null?void 0:s.sessionStartTimestamp)!==null&&r!==void 0?r:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.fu.add(t)}getExtension(t){return this.fu.getExtension(t)}capture(t,e,n){n?this.instance.capture(t,e,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):this.instance.capture(t,e)}registerDynamicEventProperties(t){return u0(this.instance.pu(t))}handleRemoteConfig(t){this.Io||(this.cu=t,this.instance.vu.emit(F8,t))}sendRequest(t){var e=this;return Wt(function*(n,r={}){var s;const i=e.instance.requestRouter.endpointFor((s=r.target)!==null&&s!==void 0?s:"api",n),o={method:r.method,url:r.query?Fh(i,r.query):i,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?O_.Base64:void 0,timestampMode:r.sentAt};return r.transport==="sendBeacon"?(e.instance._send_request(o),{statusCode:202}):new Promise(l=>{o.callback=l,e.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.Io||(this.Io=!0,this.fu.dispose())}};const Nf={};let oy=0;const Df=()=>{},V8='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',uf="Surveys module not available",H8="sanitize_properties is deprecated. Use before_send instead",IR="Invalid value for property_denylist config: ",lF=/^[A-Za-z0-9_-]{1,400}$/,z8=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,B8=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,cF=["token","distinct_id",I5],_f="posthog",uF=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},ay=t=>{var e;return V({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:cj(ue==null?void 0:ue.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Df,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:on&&st(on==null?void 0:on.search)&&on.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(J==null||(e=J.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){ve.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:D5,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Df},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:vj,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:uF(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},dF=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],U8=t=>{const e={};for(const[s,i]of dF)ce(t[s])||(e[i]=t[s]);const n=Bt({},e,t),r=t.__preview_external_dependency_versioned_paths;return ce(r)||(ce(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),st(r)&&ce(t.asset_host)&&(n.asset_host=r)),We(t.property_blacklist)&&(ce(t.property_denylist)?n.property_denylist=t.property_blacklist:We(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(IR+t.property_denylist)),n};var fF=class{constructor(){this.__forceAllowLocalhost=!1}get gu(){return this.__forceAllowLocalhost}set gu(t){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},$f=class ha{mu(e){if(!e)return;const n=this.uu.indexOf(e);n!==-1&&this.uu.splice(n,1)}yu(e,n){var r;return this.mu(e),this.uu.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}bu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}_u(){if(this.wu||this.config.reuseAnonymousId||this.config.segment||this.bu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.ku)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.wu=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}Su(){if(this.bu()||this.get_distinct_id()!=="$posthog_cookieless")return;const e=this.persistence;if(!e)return;this.xu()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(mi());this.register({distinct_id:r,$device_id:r}),e.set_property(Lr,Co)}this.Cu()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.$u=!1,this.Tu=!1,this.webPerformance=new fF,this.Iu=!1,this.version=Bn.LIB_VERSION,this.Mu=new Set,this.Eu="",this.vu=new Lm,this.uu=[],this.Pu=[],this.ku=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ay(),this.SentryIntegration=Ej,this.sentryIntegration=r=>(function(s,i){const o=Y5(s,i);return{name:K5,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new Gj(this),this.pageViewManager=new E8(this),this.rateLimiter=new Nj(this),this.requestRouter=new Jj(this),this.consent=new gj(this),this.externalIntegrations=new sF(this);const n=(e=ha.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=st(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=st(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ve.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==_f){var s;const i=(s=Nf[r])!==null&&s!==void 0?s:new ha;return i._init(e,n,r),Nf[r]=i,Nf[_f][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=st(e)?e.trim():"";if(!l)return ve.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return l!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ay(n.defaults),n.debug=this.Du(n.debug),this.Lu=n,this.Nu=[],n.person_profiles?this.Fu=n.person_profiles:n.process_person&&(this.Fu=n.process_person);const d=ay(n.defaults),f=U8(n),p=Bt({},d,f,{name:r,token:l});ct(d.rageclick)&&ct(f.rageclick)&&(p.rageclick=Bt({},d.rageclick,f.rageclick)),ct(d.session_recording)&&ct(f.session_recording)&&(p.session_recording=Bt({},d.session_recording,f.session_recording)),this.set_config(p),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:gs.GZipJS;const g=this.xu();if(this.persistence=new Q1(this.config,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Q1(V(V({},this.config),{},{persistence:"sessionStorage"}),g,!1),this.Eu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!g&&Vt.Et()){const b=Vt.Dt(this.Eu);We(b)&&b.forEach(E=>{st(E)&&this.Mu.add(E)})}else Vt.Lt(this.Eu);const v=V({},this.persistence.props),w=V({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new Zj((b,E)=>this.ju(b,E),this.config.request_queue_config),this.Bu=new qj(this),this.__request_queue=[];const _=this.bu();_||(this.sessionManager=new $8(this),this.sessionPropsManager=new N8(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((b,E,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Hu()})),this.zu(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Uu(_)},0)):(ve.info("Initializing extensions synchronously"),this.Uu(_)),Bn.DEBUG=Bn.DEBUG||this.config.debug,Bn.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:V({},this.config),p:v,s:w}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=V(V({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.ku=!!x&&!Cf(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const b=n.bootstrap.distinctID,E=this.get_distinct_id(),C=this.persistence.get_property(Lr);if(n.bootstrap.isIdentifiedID&&E!=null&&E!==b&&C==="anonymous")this.identify(b);else if(n.bootstrap.isIdentifiedID&&E!=null&&E!==b&&C==="identified")ve.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const R=this.config.get_device_id(mi()),A=n.bootstrap.isIdentifiedID?R:b;this.persistence.set_property(Lr,n.bootstrap.isIdentifiedID?B0:Co),this.register({distinct_id:b,$device_id:A})}}if(_)this.register_once({distinct_id:U1,$device_id:null},"");else if(!this.get_distinct_id()){const b=this.config.get_device_id(mi());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Lr,Co)}return St(J,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),St(J,"pageshow",()=>{var b;this.$u=!1,this.Tu||(b=this.Bu)===null||b===void 0||b.resume()}),n.segment?k8(this,()=>this.Wu()):this.Wu(),Xn(this.config._onCapture)&&this.config._onCapture!==Df&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this.config.ip&&ve.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return CR.apply(this,arguments)})().then(b=>{b&&this.register({[B1]:b})}).catch(Df),this}Vu(e){const n=e;return st(n.name)&&Xn(n.setup)}Gu(e,n){this.Vu(e)?n.push(()=>{this.Zu().add(e).catch(()=>{var r;return(r=e.dispose)===null||r===void 0?void 0:r.call(e)}).catch(r=>{ve.error(`Failed to dispose browser extension "${e.name}"`,r)})}):this.uu.push(e)}zu(){var e,n,r;const s=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=ha.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var i,o,l;s&&(this.featureFlags&&this.featureFlags instanceof s||((i=this.Qu)===null||i===void 0||i.call(this),this.Qu=void 0,this.featureFlags=new s(this)),Xn(this.featureFlags.onReloading)&&Xn(this.featureFlags.setup)?this.Qu||(this.Qu=this.featureFlags.onReloading(()=>{this.vu.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):(o=(l=this.featureFlags).initialize)===null||o===void 0||o.call(l))}Uu(e){const n=performance.now(),r=V(V({},ha.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,p;r.exceptions&&this.uu.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.uu.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.uu.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.uu.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.uu.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.Gu(this.autocapture=new r.autocapture(this),s),r.surveys&&this.Gu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.Gu(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.uu.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.uu.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.uu.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.uu.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.uu.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.uu.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.uu.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,kj)),r.toolbar&&this.uu.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.uu.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new r.experiments(this)),this.uu.forEach(g=>{g.initialize&&s.push(()=>{var v;(v=g.initialize)===null||v===void 0||v.call(g)})}),s.push(()=>{if(this.Ju){const g=this.Ju;this.Ju=void 0,this.uu.forEach(v=>{var w;return(w=v.onRemoteConfig)===null||w===void 0?void 0:w.call(v,g)})}}),this.Ku(s,n)}Ku(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Ku(e,n)},0);const s=e.shift();if(s)try{s()}catch(i){ve.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[M5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[O5]:r}),this.config.__preview_deferred_init_extensions&&ve.info(`PostHog extensions initialized (${r}ms)`)}il(e){var n;if(!ue||!ue.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ju=e),this.du=e,this.compression=void 0,e.ok){var r;const s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=qe(s.supportedCompression,gs.GZipJS)?gs.GZipJS:qe(s.supportedCompression,gs.Base64)?gs.Base64:void 0),!((r=s.analytics)===null||r===void 0)&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:D5}),(n=this.Xu)===null||n===void 0||n.handleRemoteConfig(e),this.uu.forEach(s=>{var i;return(i=s.onRemoteConfig)===null||i===void 0?void 0:i.call(s,e)})}Wu(){try{this.config.loaded(this)}catch(e){ve.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&(on==null?void 0:on.hostname)){const e=on.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.bu())&&this.th()},1),this.eh=new lR(this),this.eh.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.qu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&hu(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,n,r,s,i,o;this.$u=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.ih()&&this.capture(l8),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.qu)===null||i===void 0||i.unload(),(o=this.Bu)===null||o===void 0||o.unload()):this.ih()&&this.capture(l8,null,{transport:"sendBeacon"})}_send_request(e){kR(this,e)}ju(e,n){this.Bu?this.Bu.retriableRequest(e,n):this._send_request(n?V(V({},e),{},{transport:n}):e)}_execute_array(e){oy++;try{let n;const r=[],s=[],i=[];hu(e,l=>{if(l)if(n=l[0],We(n))i.push(l);else if(Xn(l))try{l.call(this)}catch(u){ve.error("Error executing queued PostHog call",l,u)}else We(l)&&n==="alias"?r.push(l):We(l)&&n.indexOf("capture")!==-1&&Xn(this[n])?i.push(l):s.push(l)});const o=function(l,u){hu(l,function(d){try{if(We(d[0])){let f=u;Rt(d,function(p){f=f[p[0]].apply(f,p.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){ve.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{oy--}}push(e){if(oy>0&&We(e)&&st(e[0])){const n=ha.prototype[e[0]];return void(Xn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get nh(){return{property:o8,persistenceKey:wu,cookieName:"_fbc",pattern:z8,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[wu]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(wu)}}}get sh(){return{property:a8,persistenceKey:Rf,cookieName:"_fbp",pattern:B8,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Rf]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Rf)}}}rh(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return st(r)&&e.pattern.test(r)?{value:r,delivered:!1}:ct(r)&&st(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}oh(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}ah(e){if(!this.config.save_campaign_params||this.bu())return;const n=If(e.cookieName);return st(n)&&e.pattern.test(n)?n:void 0}uh(e,n,r,s){if(!this.persistence)return;const i=this.nh;this.persistence.refreshKey(i.persistenceKey);const o=this.rh(i);if(s)return void i.unregister();if(r)return st(n)&&z8.test(n)?this.oh(i,n,o):void i.unregister();const l=st(e)&&lF.test(e)?e:void 0,u=this.ah(i);return u&&((d,f,p)=>{const g=d.split(".");if(f)return g[3]===f;if(!p)return!0;const v=p.value.split(".");return g[3]===v[3]||Number(g[2])>Number(v[2])})(u,l,o)?this.oh(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.oh(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}hh(e,n,r){if(!this.persistence)return;const s=this.sh;this.persistence.refreshKey(s.persistenceKey);const i=this.rh(s);if(r)return void s.unregister();if(n)return st(e)&&B8.test(e)?this.oh(s,e,i):void s.unregister();const o=this.ah(s);return o?this.oh(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}dh(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const r=this.rh(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void ve.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(ce(e)||!st(e))return void ve.error("No event name provided to posthog.capture");this.Su();const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;const l=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l!=null&&l.isRateLimited)return void ve.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!st(n==null?void 0:n.$current_url)&&(ve.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.fh||ve.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const d=new Date,f=(r==null?void 0:r.timestamp)||d,p=US(r==null?void 0:r.uuid,mi);let g={uuid:p,event:e,properties:this.calculateEventProperties(e,n||{},f,p)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),l&&(g.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&g.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(g.$set=r==null?void 0:r.$set);const w=ct(n==null?void 0:n.$set)?n.$set:void 0,_=We(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],b=U=>{var H;const Z=!!(r!=null&&r.$set)&&U in r.$set;return{hasProvided:Z||!!w&&U in w,provided:Z?r==null||(H=r.$set)===null||H===void 0?void 0:H[U]:w==null?void 0:w[U],unset:_.indexOf(U)!==-1||x.indexOf(U)!==-1}},E=b(o8),C=b(a8),R=[{channel:this.nh,hasProvided:E.hasProvided,update:this.uh(u==null?void 0:u.fbclid,E.provided,E.hasProvided,E.unset)},{channel:this.sh,hasProvided:C.hasProvided,update:this.hh(C.provided,C.hasProvided,C.unset)}];for(const{channel:U,hasProvided:H,update:Z}of R)Z&&g.properties.$process_person_profile===!0&&Z.pending&&!H&&!v&&(g.$set=V({[U.property]:Z.value},g.$set));const A=r==null?void 0:r.$unset;A&&(g.$unset=A);const M=v?void 0:this.ph(r==null?void 0:r.$set_once,e!==c8,e===$5);if(M&&(g.$set_once=M),r!=null&&r._noTruncate||(I=this.config.properties_string_max_length,g=(function(U,H){const Z=new Set;return(function Q(z,ee){if(z!==Object(z))return H?H(z):z;if(Z.has(z))return;let W;if(Z.add(z),We(z))W=[],hu(z,N=>{W.push(Q(N))});else{const N={};Rt(ld(z)?j5(z):z,(X,ie)=>{Z.has(X)||(N[ie]=Q(X))}),W=N}return W})(U)})(g,U=>st(U)?U.slice(0,I):U)),g.timestamp=f,ce(r==null?void 0:r.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),v&&(g.properties=((U,H=[])=>{const Z={},Q=z=>{U[z]!==void 0&&(Z[z]=U[z])};return b$.forEach(Q),H.forEach(Q),Z})(g.properties,cF)),e===Po.DISMISSED||e===Po.SENT){const U=n==null?void 0:n[ey.SURVEY_ID],H=n==null?void 0:n[ey.SURVEY_ITERATION];TR({id:U,current_iteration:H}),g.$set=V(V({},g.$set),{},{[Yj({id:U,current_iteration:H},e===Po.SENT?"responded":"dismissed")]:!0})}else e===Po.SHOWN&&(g.$set=V(V({},g.$set),{},{[ey.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var I;if(e===Lj.SHOWN){const U=n==null?void 0:n[R8.TOUR_TYPE];U&&(g.$set=V(V({},g.$set),{},{[`${R8.TOUR_LAST_SEEN_DATE}/${U}`]:new Date().toISOString()}))}const T=V(V({},g.properties.$set),g.$set);if(Gr(T)||this.setPersonPropertiesForFlags(T),!et(this.config.before_send)){const U=this.Os(g);if(!U)return;g=U,g.uuid=US(g.uuid,mi)}const L=R.filter(({channel:U,update:H})=>{var Z,Q,z;const ee=(Z=(Q=g.$set)===null||Q===void 0?void 0:Q[U.property])!==null&&Z!==void 0?Z:ct((z=g.properties)===null||z===void 0?void 0:z.$set)?g.properties.$set[U.property]:void 0;return(H==null?void 0:H.pending)&&ee===H.value});this.vu.emit("eventCaptured",g);const D=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),B=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D),j=V(V(V({method:"POST",url:D,data:g,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:B?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},B&&(!((i=g.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:g.properties.$session_id+(g.properties.$window_id?`-${g.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),L.length?{fireCallbackOnDrop:!0,callback:U=>{if(U.statusCode>=200&&300>U.statusCode)for(const{channel:H,update:Z}of L)this.dh(H,Z.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly||L.length){var K;let U;!j.transport&&!j.callback&&Gr((K=this.config.request_headers)!==null&&K!==void 0?K:{})&&this.$u&&(U="sendBeacon"),this.ju(j,U)}else this.qu.enqueue(j);return g}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.Xu)===null||n===void 0?void 0:n.getExtension(e)}Zu(){var e;return(e=this.Xu)!==null&&e!==void 0?e:this.Xu=new aF(this)}pu(e){this.Pu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Pu.indexOf(e);r!==-1&&this.Pu.splice(r,1)}}gh(e=!0){var n,r,s;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Ou=null,this.persistence.get_property("$user_state")==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Mu.clear(),this.mh()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=V({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.bu()&&(l[I5]=!0),e==="$snapshot"){const E=V(V({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=E.distinct_id,(!st(l.distinct_id)&&!mn(l.distinct_id)||Cf(l.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(E,C,R,A=!1){var M,I,T,L;if(!Or)return{};const D=E?[...Wu,...C||[]]:[],[B,j]=XP(Or),[K,U]=(function(ne){for(let oe=0;BS.length>oe;oe++){const[fe,xe,de]=BS[oe],ae=ne.match(fe);if(ae){const Oe=de&&ne.match(de)||ae;return[xe,(Oe==null?void 0:Oe[1])||""]}}return["",""]})(Or),H=(function(){const ne="u">typeof navigator?navigator:void 0;return ne!=null&&ne.brave?{brave:!0}:{}})(),Z={};ce(R)||(Z.detectGoogleSearchApp=R);const Q={},z=(M=navigator)===null||M===void 0||(M=M.userAgentData)===null||M===void 0?void 0:M.platform,ee=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,W=J==null||(T=J.screen)===null||T===void 0?void 0:T.width,N=J==null||(L=J.screen)===null||L===void 0?void 0:L.height,X=J==null?void 0:J.devicePixelRatio;ce(z)||(Q.userAgentDataPlatform=z),ce(ee)||(Q.maxTouchPoints=ee),ce(W)||(Q.screenWidth=W),ce(N)||(Q.screenHeight=N),ce(X)||(Q.devicePixelRatio=X);const ie=Bt(iw({$os:B,$os_version:j,$browser:YP(Or,navigator.vendor,H,Z),$webview_app:K,$webview_app_version:U,$device:QP(Or),$device_type:U7(Or,Q),$timezone:oR(),$timezone_offset:Ij()}),{$current_url:nh(A?ja(on==null?void 0:on.href):on==null?void 0:on.href,D,rh),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:Or.length>1e3?Or.substring(0,997)+"...":Or,$browser_version:B7(Or,navigator.vendor,H,Z),$browser_language:nR(),$browser_language_prefix:Tj(),$screen_height:J==null?void 0:J.screen.height,$screen_width:J==null?void 0:J.screen.width,$viewport_height:J==null?void 0:J.innerHeight,$viewport_width:J==null?void 0:J.innerWidth,$lib:Ao.LIB_NAME,$lib_version:Ao.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ao.SDK_DIST_CHANNEL&&(ie.$sdk_dist_channel=Ao.SDK_DIST_CHANNEL),ie})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:E,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=E,l.$window_id=C}this.sessionPropsManager&&Bt(l,this.sessionPropsManager.getSessionProps());try{var d;this.sessionRecording&&Bt(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(d=this.Bu)===null||d===void 0?void 0:d.length}catch(E){l.$sdk_debug_error_capturing_properties=String(E)}let f;if(this.requestRouter.region===a2&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=Bt(l,f),e==="$pageview"&&ue&&(l.title=ue.title),!ce(o)){const E=r.getTime()-o;l.$duration=parseFloat((E/1e3).toFixed(3))}Or&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),g=this.sessionPersistence.properties(),v=l.$groups,w=p.$groups;ct(v)&&!Gr(v)&&(l.$groups=V(V({},ct(w)?w:{}),v)),Rt(["$referrer","$referring_domain"],E=>{E in p&&delete g[E]});const _={};if(this.Pu.length>0)for(const E of this.Pu.slice())try{Bt(_,E())}catch(C){ve.error("Failed to produce browser extension event properties",C)}l=Bt({},u,p,g,V(V({},_),l)),l.$is_identified=this._isIdentified(),We(this.config.property_denylist)?Rt(this.config.property_denylist,function(E){delete l[E]}):ve.error(IR+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const x=this.config.sanitize_properties;x&&(ve.error(H8),l=x(l,e));const b=this.yh();return l.$process_person_profile=b,b&&!i&&this.bh("_calculate_event_properties"),l}ph(e,n=!0,r=!1){var s;if(!this.persistence||!this.yh()||this.Iu&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=Bt({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ve.error(H8),l=u(l,"$set_once")),n&&(this.Iu=!0),Gr(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.gh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Mu.add(s)),this.mh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Mu.delete(e),this.mh()}_h(e,n){this.register({[e]:n})}Hu(){this.Mu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Mu.clear(),this.mh()}mh(){var e;if(!this.Eu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.mi||!Vt.Et())return void Vt.Lt(this.Eu);const n=[];this.Mu.forEach(r=>n.push(r)),n.length>0?Vt.At(this.Eu,n):Vt.Lt(this.Eu)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.vu.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:uf}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:uf})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:uf})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=tF){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:uf}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:uf})}wh(e){return!e||Cf(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ve.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ve.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ve.uninitializedWarning("posthog.identify");if(mn(e)&&(e=e.toString(),ve.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wh(e)||!this.bh("posthog.identify"))return;this.Su();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.gh(!1),l=this.persistence.Da();let u=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(Pm),this.register({distinct_id:e}));const p=(this.persistence.get_property("$user_state")||"anonymous")===Co,g=e!==f,v=!g&&p;if(g&&p){var d;const w=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Lr,B0),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",w,{$set:n||{},$set_once:r||{}})&&(this.Ou=iy(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(Lr,B0);const w=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:w,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:w,$set_once:_})&&(this.Ou=iy(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);g||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Ca)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.ja(u)}}setPersonProperties(e,n){if(!e&&!n||!this.bh("posthog.setPersonProperties"))return;const r=iy(this.get_distinct_id(),e,n);this.Ou!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Ou=r)):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(We(e)?e:[e]).filter(s=>st(s)&&s.length>0);r.length!==0&&this.bh("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ou=null)}group(e,n,r){var s;if(!e||!n)return void ve.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.gh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:V(V({},i),{},{[e]:n})}),(o||r)&&this.yh()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(c8,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.bh("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Nr(e)?e:e==null?void 0:e.resetDeviceID,r=Nr(e)||e==null?void 0:e.bootstrap;this.kh(n,!1,r)}kh(e,n=!1,r){var s,i,o,l,u,d;if(ve.info("reset"),!this.__loaded)return ve.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Lu)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.nl());const p=this.get_property(Jx),g=this.get_property(B1),v=this.get_property(Af);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const w=this.is_capturing();this.consent.reset(),n||!w||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const _=(u=this.persistence)===null||u===void 0||(d=u.Da)===null||d===void 0?void 0:d.call(u);let x=!1;try{var b,E,C,R,A,M,I,T,L,D,B,j,K;if((b=this.persistence)===null||b===void 0||b.clear(),(E=this.sessionPersistence)===null||E===void 0||E.clear(),this.Mu.clear(),this.mh(),ce(v)||(D=this.persistence)===null||D===void 0||D.register({$session_recording_remote_config:v}),(C=this.surveys)===null||C===void 0||C.reset(),(R=this.featureFlags)===null||R===void 0||R.reset(),(A=this.conversations)===null||A===void 0||A.reset(),(M=this.logs)===null||M===void 0||M.reset(),(I=this.metrics)===null||I===void 0||I.reset(),(T=this.persistence)===null||T===void 0||T.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:U1,$device_id:null},"");else{const Z=this.config.get_device_id(mi());this.register_once({distinct_id:Z,$device_id:e?Z:p},""),e||ce(g)||this.register({[B1]:g})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.bu()&&((K=this.persistence)===null||K===void 0||K.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(B=this.featureFlags)===null||B===void 0||B.initialize(),!et(f)&&!(!((j=this.sessionManager)===null||j===void 0)&&j.setBootstrapSessionId(f,!0)))){const Z=V({},r);delete Z.sessionID,this.config.bootstrap=Z}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var U,H;_&&((U=this.persistence)===null||U===void 0||(H=U.ja)===null||H===void 0||H.call(U,x))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Wt(function*(){var r,s,i,o,l,u,d,f;if(n.__loaded){n.Tu=!0,n.Zu().dispose(),(r=n.sessionRecording)===null||r===void 0||r.dispose(),(s=n.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=n.metrics)===null||i===void 0||i.flush("sendBeacon"),(o=n.metrics)===null||o===void 0||o.dispose(),(l=n.qu)===null||l===void 0||l.unload(),(u=n.Bu)===null||u===void 0||u.unload();try{var p;(p=n.featureFlags)===null||p===void 0||p.destroy()}catch(g){ve.error("Error while destroying feature flags",g)}(d=n.persistence)===null||d===void 0||d.destroy(),(f=n.sessionPersistence)===null||f===void 0||f.destroy()}else ve.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.Sh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.xh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.bh("posthog.alias")?(ce(n)&&(n=this.get_distinct_id()),e!==n?(this._h(Pm,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ve.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=V({},this.config);if(ct(e)){var r,s,i,o,l,u,d,f,p,g,v,w,_,x;Bt(this.config,U8(e));const E=this.xu();(r=this.persistence)===null||r===void 0||r.update_config(this.config,n,E),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Q1(V(V({},this.config),{},{persistence:"sessionStorage"}),E,!1);const C=this.Du(this.config.debug);var b;Nr(C)&&(this.config.debug=C),Nr(this.config.debug)&&(this.config.debug?(Bn.DEBUG=!0,gt.Et()&&gt.At("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:V({},this.config)})):(Bn.DEBUG=!1,gt.Et()&&gt.Lt("ph_debug"))),(s=this.featureFlags)===null||s===void 0||(i=s.updateConfig)===null||i===void 0||i.call(s,this.config,this.nl()),(o=this.exceptionObserver)===null||o===void 0||o.onConfigChange(),(l=this.exceptions)===null||l===void 0||l.onConfigChange(),(u=this.metrics)===null||u===void 0||u.onConfigChange(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(p=this.autocapture)===null||p===void 0||p.startIfEnabled(),(g=this.heatmaps)===null||g===void 0||g.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((b=this.historyAutocapture)===null||b===void 0||b.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(w=this.deadClicksAutocapture)===null||w===void 0||w.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.Cu(),(x=this.externalIntegrations)===null||x===void 0||x.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&k8(this,Df,!1)}}_overrideSDKInfo(e,n){Bn.LIB_NAME=e,Bn.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(V(V({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:ha.Ch}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:_f;return n!==_f&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}yh(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Gr(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}ih(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yh()||this.bh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bh(e){return this.config.person_profiles==="never"?(ve.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._u(),this._h(nw,!0),!0)}xu(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Cu(){var e,n;const r=this.xu();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.$h(),((e=this.persistence)===null||e===void 0?void 0:e.mi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.mi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),r&&(this.Mu.clear(),this.mh()),r}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.bu()){var r,s,i,o,l,u;(r=this.sessionRecording)===null||r===void 0||r.dispose({discardBufferedEvents:!0}),this.kh(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new $8(this),this.pageViewManager=new E8(this),this.persistence&&(this.sessionPropsManager=new N8(this,this.sessionManager,this.persistence));const v=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=ha.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,f;v&&(this.sessionRecording=this.yu(this.sessionRecording,new v(this)),this.du&&((d=this.sessionRecording)===null||d===void 0||(f=d.onRemoteConfig)===null||f===void 0||f.call(d,this.du)))}var p,g;this.consent.optInOut(!0),this.Cu(),this.Yu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((p=this.surveys)===null||p===void 0||p.loadIfEnabled()),(ce(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((g=e==null?void 0:e.captureEventName)!==null&&g!==void 0?g:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.th()}else ve.warn(V8)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void ve.warn(V8);const e=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var n,r;e==null||e.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.kh(!0,!0),this.consent.optInOut(!1),this.Cu(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:U1,$device_id:null}),this.mu(e),this.sessionRecording=void 0,(n=this.sessionManager)===null||n===void 0||n.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.th(),this.Yu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Cu()}_is_bot(){return Qn?ER(Qn,this.config.custom_blocked_useragents):void 0}th(){ue&&(ue.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture(sw,{title:ue.title},{send_instantly:!0}),this.Au&&(ue.removeEventListener(Jf,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),St(ue,Jf,this.Au)))}debug(e){e===!1?(J==null||J.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(J==null||J.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}nl(){const e=this.Lu||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ve.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!et(n[r]),u=s in n&&!et(n[s]);return l?n[r]:!!u&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ve)}Os(e){var n;if(et(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(M7),s=We(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),et(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return I7(e.event)?ve.warn(`${l}. This can cause unexpected behavior.`):ve.info(l),null}i.properties&&!Gr(i.properties)||ve.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ve.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&et(i.properties[o]))return ve.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Vo)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Du(e){const n=Nr(e)&&!e,r=gt.Et()&&gt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};$f.__defaultExtensionClasses={},$f.Ch=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=aj(t.prototype[e[n]])})($f,["identify"]);var MR=class{constructor(t){this.disabled=t===!1;const e=ct(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const ly="$copy_autocapture",cy=dn("[AutoCapture]");function uy(t,e){return e.length>t?e.slice(0,t)+"...":e}function hF(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Ui(e));return e}function pF(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Ui(t))return{props:{}};const d=[t],f=new Set([t]);let p=t;for(;p.parentNode&&!mr(p,"body")&&1e3>d.length;){if(ow(p.parentNode)){const M=p.parentNode.host;if(f.has(M))break;f.add(M),d.push(M),p=M;continue}if(!Ui(p.parentNode)||f.has(p.parentNode))break;f.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}const g=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(M=>mr(M,"button")||mr(M,"a")):-1;g>0&&(r=r||d.slice(0,g+1).some(M=>!bu(M)||th(M)));const v=[],w={};let _,x=!1,b=!1;if(Rt(d,M=>{const I=bu(M);if(mr(M,"a")&&!n&&!(s!=null&&s.includes("href"))){const T=M.getAttribute("href");x=!!(I&&T&&Of(T))&&(o?ja(T):T)}qe(Uu(M),"ph-no-capture")&&(b=!0),v.push((function(T,L,D,B,j=!1){const K=T.tagName.toLowerCase(),U={tag_name:K};lw.indexOf(K)>-1&&!D&&(U.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?uy(1024,w8(T)):uy(1024,eh(T)));const H=Uu(T);L||B!=null&&B.includes("class")||0>=H.length||(U.classes=H.filter(function(ee){return ee!==""})),Rt(T.attributes,function(ee){var W;if((!th(T)||["name","id","class","aria-label"].indexOf(ee.name)!==-1)&&!(B!=null&&B.includes(ee.name))&&!L&&Of(ee.value)&&(!st(W=ee.name)||W.substring(0,10)!=="_ngcontent"&&W.substring(0,7)!=="_nghost")){let N=ee.value;ee.name==="class"&&(N=aw(N).join(" ")),U["attr__"+ee.name]=uy(1024,ee.name==="href"&&j?ja(N):N)}});let Z=1,Q=1,z=T;for(;z=hF(z);)Z++,z.tagName===T.tagName&&Q++;return U.nth_child=Z,U.nth_of_type=Q,U})(M,n,r,s,o)),Rt((function(T){if(!bu(T))return{};const L={};return Rt(T.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){const B=D.name.replace("data-ph-capture-attribute-",""),j=D.value;B&&j&&Of(j)&&(L[B]=j)}}),L})(M),(T,L)=>{({}).hasOwnProperty.call(w,L)||(w[L]=T)})}),b)return{props:{},explicitNoCapture:b};if(g>0&&(t=d[g],v.splice(0,g)),r||(v[0].$el_text=mr(t,"a")||mr(t,"button")?w8(t):eh(t)),x){var E,C;v[0].attr__href=x;const M=(E=Fa(x))===null||E===void 0?void 0:E.host,I=J==null||(C=J.location)===null||C===void 0?void 0:C.host;M&&I&&M!==I&&(_=x)}return{props:Bt((A=e.type,{$event_type:A,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(R=v,We(R)?(function(M){return M.map(I=>{var T,L;let D="";if(I.tag_name&&(D+=I.tag_name),I.attr_class){I.attr_class.sort();for(const K of I.attr_class)D+=`.${K.replace(/"/g,"")}`}const B=V(V(V(V({},I.text?{text:I.text}:{}),{},{"nth-child":(T=I.nth_child)!==null&&T!==void 0?T:0,"nth-of-type":(L=I.nth_of_type)!==null&&L!==void 0?L:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),j={};return U0(B).sort(([K],[U])=>(function(H,Z){return Z>H?-1:H>Z?1:0})(K,U)).forEach(([K,U])=>j[b8(K.toString())]=b8(U.toString())),D+=":",D+=U0(j).map(([K,U])=>`${K}="${U}"`).join(""),D}).join(";")})((function(M){return M.map(I=>{var T,L;const D={text:(T=I.$el_text)===null||T===void 0?void 0:T.slice(0,400),tag_name:I.tag_name,href:(L=I.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:bj(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return U0(I).filter(([B])=>B.indexOf("attr__")===0).forEach(([B,j])=>D.attributes[B]=j),D})})(R)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},w),target:t};var R,A}var mF=class{fo(){this.po=void 0,clearTimeout(this.mo),this.mo=void 0}yo(t){var e;if(!bu(t))return!0;const n=(e=this.bo().css_selector_ignorelist)!==null&&e!==void 0?e:Y1,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=Uu(i);if(qe(o,"ph-no-capture")||qe(o,"ph-sensitive")||th(i)||n.some(u=>e2(i,u)))return!0;const l=s.parentNode;s=ow(l)?l.host:l&&Ui(l)?l:null}return!1}_o(t){if(!this.isEnabled||t.type==="pointercancel")return void this.fo();if(t.type==="pointerdown"){this.fo();const r=Mf(t);var e;return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Ui(r)&&(this.po={target:r,excluded:this.yo(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.wo)===null||e===void 0?void 0:e.distinctId}))}const n=this.po;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.fo():t.type==="pointerup"&&(n.released=!0,this.mo=setTimeout(()=>this.fo(),0)))}ko(t){var e;const n=this.po;this.fo();const r=Mf(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.wo)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(mr(r,"html")||mr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.bo().css_selector_ignorelist)!==null&&s!==void 0?s:Y1;return[r,ue==null?void 0:ue.documentElement,ue==null?void 0:ue.body].some(o=>{if(!o)return!1;const l=Uu(o);return qe(l,"ph-no-capture")||qe(l,"ph-sensitive")||!bu(o)||th(o)||i.some(u=>e2(o,u))})?null:n.target}}constructor(t){this.So=t,this.name="autocapture",this.xo=!1,this.Co=null,this.$o=!1,this.To=!1,this.Rr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Io=!1,this.So.refresh(this.Rr),this.rageclicks=new MR(this.Rr.rageclick),this.Mo=null}setup(t){this.Eo(),this.wo=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Io?e.dispose():(this.Po=e,this.startIfEnabled())}dispose(){var t;this.Io||(this.Io=!0,this.wo=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this.Ro())}bo(){return this.So.refresh(this.Rr),this.Rr}Eo(){var t,e;return this.bo(),this.Rr.url_allowlist=(t=this.Rr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Rr.url_ignorelist=(e=this.Rr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Rr}Ao(){if(!this.isBrowserSupported())return void cy.info("Disabling Automatic Event Collection because this browser is not supported");if(!J||!ue)return;const t=this.Fo=e=>{e=e||(J==null?void 0:J.event);try{if(e.type==="blur")return void this.fo();if(e.type.indexOf("pointer")===0)return void this._o(e);const n=e.type==="click"?this.ko(e):void 0;if(an(n))return;this.Oo(e,"$autocapture",n)}catch(n){cy.error("Failed to capture event",n)}};if(St(J,"blur",t),St(ue,"submit",t,{capture:!0}),St(ue,"change",t,{capture:!0}),St(ue,"click",t,{capture:!0}),Rt(["pointerdown","pointermove","pointerup","pointercancel"],e=>{St(ue,e,t,{capture:!0})}),this.bo().capture_copied_text){const e=this.Do=n=>{n=n||(J==null?void 0:J.event);try{this.Oo(n,ly)}catch(r){cy.error("Failed to capture clipboard event",r)}};St(ue,"copy",e,{capture:!0}),St(ue,"cut",e,{capture:!0}),St(ue,"paste",e,{capture:!0})}}Ro(){this.fo(),this.Fo&&(J==null||J.removeEventListener("blur",this.Fo),Rt(["pointerdown","pointermove","pointerup","pointercancel"],t=>{ue==null||ue.removeEventListener(t,this.Fo,!0)}),ue==null||ue.removeEventListener("submit",this.Fo,!0),ue==null||ue.removeEventListener("change",this.Fo,!0),ue==null||ue.removeEventListener("click",this.Fo,!0),this.Fo=void 0),this.Do&&(ue==null||ue.removeEventListener("copy",this.Do,!0),ue==null||ue.removeEventListener("cut",this.Do,!0),ue==null||ue.removeEventListener("paste",this.Do,!0),this.Do=void 0),this.xo=!1}startIfEnabled(){this.isEnabled||this.fo(),!this.Io&&this.wo&&this.isEnabled&&!this.xo&&(this.Ao(),this.xo=!0)}onRemoteConfig(t){if(this.Io)return;if(this.$o=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.To=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Nr(n)&&((r=this.wo)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.Co=n),this.startIfEnabled()}setElementSelectors(t){this.Mo=t}getElementSelectors(t,e){var n;const r=[];return(n=this.Mo)===null||n===void 0||n.forEach(s=>{const i=ue==null?void 0:ue.querySelectorAll(s);i==null||i.forEach(o=>{t!==o&&e!==o||qe(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Io)return!1;const n=(t=this.wo)===null||t===void 0?void 0:t.kv.get(x5),r=this.Co,s=this.bo();if(!s.remoteRequestsDisabled&&!this.$o)return!1;const i=s.remoteRequestsDisabled&&!this.$o;if(an(r)&&!Nr(n)&&!i)return!1;const o=(e=this.Co)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Oo(t,e="$autocapture",n){if(!this.isEnabled)return void this.fo();let r=n||Mf(t);z5(r)&&(r=r.parentNode||null);const s=this.Eo();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&W5(r,s.rageclick)&&this.Oo(t,"$rageclick",n);const o=e===ly,l=o?V(V({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(p,g,v,w,_,x){var b;if(!J||cw(p)||v!=null&&v.url_allowlist&&!p8(v.url_allowlist,x)||v!=null&&v.url_ignorelist&&p8(v.url_ignorelist,x))return!1;if(v!=null&&v.dom_event_allowlist){const A=v.dom_event_allowlist;if(A&&!A.some(M=>g.type===M))return!1}const{parentIsUsefulElement:E,targetElementList:C}=q5(p,w);if(!(function(A,M){const I=M==null?void 0:M.element_allowlist;if(ce(I))return!0;for(const T of A)if(I.some(L=>T.tagName.toLowerCase()===L))return!0;return!1})(C,v)||!t2(C,v==null?void 0:v.css_selector_allowlist)||t2(C,(b=v==null?void 0:v.css_selector_ignorelist)!==null&&b!==void 0?b:Y1))return!1;try{const A=J.getComputedStyle(p);if(A&&A.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0}catch{}const R=p.tagName.toLowerCase();switch(R){case"html":return!1;case"form":return(_||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(g.type)>=0;default:return E?(_||["click"]).indexOf(g.type)>=0:(_||["click"]).indexOf(g.type)>=0&&(lw.indexOf(R)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:p,explicitNoCapture:g,target:v}=pF(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(g)return!1;const w=this.getElementSelectors(r,v);if(w&&w.length>0&&(p.$element_selectors=w),e===ly){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const x=J==null||(d=J.getSelection())===null||d===void 0?void 0:d.toString(),b=B5(x);if(!b)return!1;p.$selected_content=b,p.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}p.$copy_type=_}return(u=this.wo)===null||u===void 0||u.capture(e,p),!0}}isBrowserSupported(){return Xn(ue==null?void 0:ue.querySelectorAll)}},gF=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=ct(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.nl(),t.url_allowlist=n==null?void 0:n.url_allowlist,t.url_ignorelist=n==null?void 0:n.url_ignorelist,t.dom_event_allowlist=n==null?void 0:n.dom_event_allowlist,t.element_allowlist=n==null?void 0:n.element_allowlist,t.css_selector_allowlist=n==null?void 0:n.css_selector_allowlist,t.css_selector_ignorelist=n==null?void 0:n.css_selector_ignorelist,t.element_attribute_ignorelist=n==null?void 0:n.element_attribute_ignorelist,t.capture_copied_text=n==null?void 0:n.capture_copied_text}};const df=dn("[ExceptionAutocapture]"),Z8=()=>{},W8=t=>{var e;if(Xn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function sh(t,e,n){try{if(!(e in t))return Z8;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Xn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=W8(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=W8(i)}}}catch{return Z8}}const vF=dn("[TracingHeaders]"),bl=dn("[Web Vitals]"),q8=9e5,G8=["CLS","FCP","INP","LCP"],yF=["INP","LCP"],_F=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],dy="disabled",K8="lazy_loading",fo=dn("[SessionRecording]"),xF=dn("[Heatmaps]");function fy(t){return ct(t)&&"clientX"in t&&"clientY"in t&&mn(t.clientX)&&mn(t.clientY)}const f0=dn("[Product Tours]"),hy=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(tw))},wF=["$set_once","$set"],ki=dn("[SiteApps]"),Y8="Error while initializing PostHog app with config id ",OR=(t,e)=>t!=null&&t.then?t.then(e):e(t),eu="SDK is not enabled or survey functionality is not yet loaded",X8="Disabled. Not loading surveys.";var bF=class{constructor(t,e){this.So=t,this.Th=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ih=!1,this.Mh=[],this.Eh=null,this.Ph=null,this.Io=!1,this.Rh=new Set,this.onRemoteConfig=n=>{if(this.Io||this.Rr.disableSurveys)return;if(!n.ok)return Ct.warn("Remote config unavailable. Not loading surveys.");const r=n.config.surveys;if(et(r))return Ct.warn("Flags not loaded yet. Not loading surveys.");this.Ah=Nr(r)?r:r.length>0,Ct.info(`flags response received, isSurveysEnabled: ${this.Ah}`),this.loadIfEnabled()}}setup(t){if(!this.Io)return this.Fh=t,OR(t.kv.initialize(),()=>{if(this.Fh!==t||this.Io)return;this.Fh=void 0,this.wo=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Io?e.dispose():(this.Po=e,this.loadIfEnabled())})}dispose(){var t,e,n,r;this.Io||(this.Io=!0,this.Fh=void 0,this.wo=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Mh=[],this.Eh=null,this.Rh.forEach(s=>clearTimeout(s)),this.Rh.clear())}get Rr(){return this.So.get()}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}}loadIfEnabled(){if(this.Io||!this.wo)return;const t=this.Rr;if(this._surveyManager)return;if(this.Ih)return void Ct.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Ct.info(X8);if(t.cookielessMode&&this.So.isOptedOut())return void Ct.info("Not loading surveys in cookieless mode without consent.");const e=this.So.getExtensions();if(!e)return void Ct.error("PostHog Extensions not found.");if(ce(this.Ah)&&!t.advancedEnableSurveys)return;const n=this.Ah||t.advancedEnableSurveys;this.Ih=!0;try{const r=e.generateSurveys;if(r)return this.Oh(r,n),void(this.Ih=!1);const s=e.loadExternalDependency;if(!s)return this.Dh(rw),void(this.Ih=!1);s(i=>{try{if(this.Io)return;const o=this.So.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Dh("Could not load surveys script",i):this.Oh(o.generateSurveys,n)}finally{this.Ih=!1}})}catch(r){throw this.Ih=!1,this.Dh("Error initializing surveys",r),r}}Oh(t,e){this.Io||(this._surveyManager=t(e),this._surveyEventReceiver=this.So.createEventReceiver(),Ct.info("Surveys loaded successfully"),this.Lh({isLoaded:!0}))}Dh(t,e){Ct.error(t,e),this.Lh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Mh.push(t),this._surveyManager&&this.Lh({isLoaded:!0}),()=>{this.Mh=this.Mh.filter(e=>e!==t)}}getSurveys(t,e=!1){var n;const r=(n=this.wo)!==null&&n!==void 0?n:this.Th;if(!r||this.Io)return;if(this.Rr.disableSurveys)return Ct.info(X8),t([]);const s=r.kv.get(G_);if(s&&!e)return t(s,{isLoaded:!0}),void(this.Nh()&&this.getSurveys(()=>{},!0));if(this.Eh)return void this.Eh.then(({surveys:l,context:u})=>{this.Io||t(l,u)}).catch(l=>Ct.error("Error in survey callback",l));const i=this.qh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rr.requestTimeoutMs}).then(l=>{try{return this.jh(r,l)}catch(u){return Ct.error("Error processing surveys response",u),this.jh(r,{statusCode:0,error:u})}},l=>this.jh(r,{statusCode:0,error:l}));this.Eh=i;const o=()=>{this.Eh===i&&(this.Eh=null)};i.then(l=>{o(),this.Io||t(l.surveys,l.context)},o).catch(l=>Ct.error("Error in survey callback",l))}qh(t,e){const n=this.wo;return n?n.sendRequest(t,e):new Promise(r=>r({statusCode:0,error:new Error(eu)}))}jh(t,e){if(this.Io)return{surveys:[],context:{isLoaded:!1,error:eu}};const n=e.statusCode;if(n!==200||!e.json){const o=`Surveys API could not be loaded, status: ${n}`;return n!==0?Ct.error(o):e.error||Ct.warn(o),this.Ph=Date.now(),{surveys:[],context:{isLoaded:!1,error:o}}}this.Ph=null;const r=e.json.surveys||[],s=r.filter(o=>(function(l){return!(!l.start_date||l.end_date)})(o)&&(PR(o)||(function(l){var u;return!!(!((u=l.conditions)===null||u===void 0||(u=u.actions)===null||u===void 0||(u=u.values)===null||u===void 0)&&u.length)})(o)));var i;return s.length>0&&((i=this._surveyEventReceiver)===null||i===void 0||i.register(s)),t.kv.set({[G_]:r,[Rm]:Date.now()}),{surveys:r,context:{isLoaded:!0}}}Nh(){return this.Bh()&&!this.Eh&&!this.Hh()}Bh(){var t,e;const n=(t=(e=this.wo)!==null&&e!==void 0?e:this.Th)===null||t===void 0?void 0:t.kv.get(Rm);return mn(n)&&Date.now()-n>3e5}Hh(){return mn(this.Ph)&&3e5>Date.now()-this.Ph}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};TR(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Lh(t){for(const e of this.Mh)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Ct.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ct.warn("init was not called")}zh(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}Uh(t){if(et(this._surveyManager))return{eligible:!1,reason:eu};const e=typeof t=="string"?this.zh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wh(t){if(!this.So.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(et(this._surveyManager))return{eligible:!1,reason:eu};const e=typeof t=="string"?this.zh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(et(this._surveyManager))return Ct.warn("init was not called"),{visible:!1,disabledReason:eu};const e=this.Wh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return et(this._surveyManager)?(Ct.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:eu})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.Wh(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r;if(!this.So.isCapturing())return;if(et(this._surveyManager))return void Ct.warn("init was not called");const s=typeof t=="string"?this.zh(t):t;if(!(s!=null&&s.id))return void Ct.warn("Survey not found");if(!eF.includes(s.type))return void Ct.warn(`Surveys of type ${s.type} cannot be rendered in the app`);const i=ue==null?void 0:ue.querySelector(e);if(i){if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds){Ct.info(`Rendering survey ${s.id} with delay of ${s.appearance.surveyPopupDelaySeconds} seconds`);const o=setTimeout(()=>{var l,u;this.Rh.delete(o),!this.Io&&this.So.isCapturing()&&(Ct.info(`Rendering survey ${s.id} with delay of ${(l=s.appearance)===null||l===void 0?void 0:l.surveyPopupDelaySeconds} seconds`),(u=this._surveyManager)===null||u===void 0||u.renderSurvey(s,i,n),Ct.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Rh.add(o)}this._surveyManager.renderSurvey(s,i,n)}else Ct.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.So.isCapturing())return;if(et(this._surveyManager))return void Ct.warn("init was not called");const r=this.zh(t);if(!r)return void Ct.warn("Survey not found");let s=r;if(!((n=r.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=V(V({},r),{},{appearance:V(V({},r.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==n2.Popover&&e.initialResponses&&Ct.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const i=this.Uh(r);if(!i.eligible)return void Ct.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==n2.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}cancelPendingSurvey(t){et(this._surveyManager)?Ct.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}};function tu(t,e,n){if(et(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var SF=class{constructor(t){this._instance=t,this.Vh=new Set,this.Gh=new Set,this.Zh=new Lm,this.Qh=(e,n)=>this.Jh(e,n)&&this.Kh(e,n)&&this.Xh(e,n)&&this.Yh(e,n),this.Jh=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;ce((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.tc=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,r)=>{this.on(n,r)}))}dispose(){var t;(t=this.tc)===null||t===void 0||t.call(this),this.tc=void 0,this.Zh=new Lm}register(t){var e,n;if(!ce((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(r=>{var s;this.Vh.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.Gh.add((i==null?void 0:i.event)||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const r=new Set;this.Vh.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Vh.clear(),this.Gh.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.Gh.has(t)||this.Gh.has(e.event))&&this.Vh.forEach(n=>{this.ec(e,n)&&this.Zh.emit("actionCaptured",n.name)})}nc(t){this.onAction("actionCaptured",e=>t(e))}ec(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.Qh(t,n))return!0;return!1}onAction(t,e){return this.Zh.on(t,e)}Kh(t,e){if(e!=null&&e.url){var n;const r=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!r||typeof r!="string"||!tu(r,e.url,e.url_matching||"contains"))return!1}return!0}Xh(t,e){return!!this.sc(t,e)&&!!this.rc(t,e)&&!!this.oc(t,e)}sc(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.ac(t);if(r.length>0)return r.some(i=>tu(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&tu((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}rc(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.ac(t);if(r.length>0)return r.some(u=>tu(u.text,e.text,e.text_matching||"exact")||tu(u.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let p;for(;!et(p=f.exec(u));)d.includes(p[1])||d.push(p[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>tu(u,o,l)));var i,o,l}oc(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{return!1}return!1}ac(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}Yh(t,e){return!(e!=null&&e.properties)||e.properties.length===0||AR(e.properties.reduce((n,r)=>{const s=We(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},kF=class{constructor(t){var e,n;this.lc=[],this._instance=t,this.uc=new Map,this.hc=new Map,this.cc=new Map,this.dc=(e=this._instance)===null||e===void 0||(n=e.onSessionId)===null||n===void 0?void 0:n.call(e,r=>this.vc(r))}fc(t){return!1}gc(){return null}mc(t){}yc(){}bc(t,e){return!!t&&AR(t.propertyFilters,e==null?void 0:e.properties)}_c(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}wc(t,e,n){const r=(n===af.Activation?this.uc:this.hc).get(t);let s=[];return this.kc(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(u=>u.name===t);return this.bc(l,e)})}register(t){this.Sc(t,!1)}replace(t){this.Sc(t,!0)}Sc(t,e){var n;ce((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.xc(t,e),this.Cc(t,e))}Cc(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.cc.clear(),n.length===0)return void(e&&((r=this.$c)===null||r===void 0||r.replace([])));this.$c||(this.$c=new SF(this._instance),this.$c.init(),this.$c.nc(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(l=>{if(s.push(l),l.name){var u;const d=(u=this.cc.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.cc.set(l.name,d)}})}),e?this.$c.replace(s):this.$c.register(s)}Tc(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}xc(t,e){var n,r;const s=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((f=u.conditions)===null||f===void 0||(f=f.events)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),i=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.cancelEvents)&&((f=u.conditions)===null||f===void 0||(f=f.cancelEvents)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),o=this._c(t,af.Activation),l=this._c(t,af.Cancellation);e?(this.uc=o,this.hc=l):(this.Tc(this.uc,o),this.Tc(this.hc,l)),(s.length!==0||i.length!==0)&&((n=this.tc)!==null&&n!==void 0||(this.tc=(r=this._instance)===null||r===void 0?void 0:r._addCaptureHook((u,d)=>{this.onEvent(u,d)})))}onEvent(t,e){var n,r;const s=this.Ic(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.Mc(t,i);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.Ec([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.Pc(i),void this.Rc([i])}if(this.hc.has(t)){const l=this.wc(t,e,af.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.Ec(l.map(u=>u.id)),l.forEach(u=>this.Ac(u.id)))}if(!this.uc.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.uc.get(t)});const o=this.wc(t,e,af.Activation);this.Fc(o.map(l=>l.id))}onAction(t){this.cc.has(t)&&this.Fc(this.cc.get(t)||[])}Fc(t){var e,n;if(t.length===0)return;const r=!!(!((e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0)&&n.call(e)),s=[];for(const i of t)r&&this.fc(i)?this.Pc(i)&&this.Oc(i):s.push(i);s.length>0&&(this.lc=[...new Set([...this.lc,...s])]),this.Ic().info("updating activated items",{activatedItems:this.getActivatedIds()})}Pc(t){this.lc=this.lc.filter(n=>n!==t);const e=this.Dc();return!e.includes(t)&&(this.Lc([...e,t]),this.Nc(),!0)}Ec(t){const e=new Set(t);this.lc=this.lc.filter(s=>!e.has(s));const n=this.qc(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Lc(r),r.length===0&&this.jc()),this.Rc(t)}Bc(){var t;const e=this.gc();if(!e)return{};const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e];return n&&typeof n=="object"?n:{}}Oc(t){if(!this.gc())return;const e=this.Bc();this.mc(V(V({},e),{},{[t]:Date.now()}))}Rc(t){if(!this.gc())return;const e=this.Bc(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Gr(n)?this.yc():this.mc(n))}Hc(){this.gc()&&this.yc()}getActivationTimestamp(t){if(!this.Dc().includes(t))return;const e=this.Bc()[t];return mn(e)?e:void 0}qc(){var t;const e=this.zc();return((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e])||[]}Dc(){var t,e,n;const r=this.qc();if(r.length===0)return[];const s=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.Uc()],i=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);return i&&s===i?r:[]}Nc(){var t,e;const n=(t=this._instance)===null||t===void 0||(e=t.get_session_id)===null||e===void 0?void 0:e.call(t);n&&this.Wc(n)}jc(){this.Vc()}vc(t){var e;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.Uc()];if(n&&n!==t){const r=this.qc(),s=this.Bc();r.length>0&&(this.Lc([]),r.filter(i=>mn(s[i])).forEach(i=>this.Ac(i))),this.jc(),this.Hc()}}getActivatedIds(){return[...new Set([...this.Dc(),...this.lc])].filter(t=>!this.Gc(t))}dispose(){var t,e,n;(t=this.dc)===null||t===void 0||t.call(this),this.dc=void 0,(e=this.tc)===null||e===void 0||e.call(this),this.tc=void 0,(n=this.$c)===null||n===void 0||n.dispose(),this.$c=void 0}reset(){this.lc=[],this.qc().length>0&&this.Lc([]),this.jc(),this.Hc()}getEventToItemsMap(){return this.uc}Zc(){return this.$c}},EF=class extends kF{constructor(t){super(t)}zc(){return C5}Uc(){return P5}gc(){return R5}mc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}yc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}fc(t){var e;let n;this.kc(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return mn(r)&&r>0}Qc(){return Po.SHOWN}kc(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}Ac(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}Ic(){return Ct}Lc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated:t})}Wc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_session:t})}Vc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_session")}Gc(){return!1}Mc(t,e){let n;return this.kc(r=>{n=r.find(s=>s.id===e)}),!n||(function(r){var s;return PR(r)&&!!(!((s=r.conditions)===null||s===void 0||(s=s.events)===null||s===void 0)&&s.repeatedActivation)||r.schedule==="always"})(n)?t===Po.SHOWN?"consume":"ignore":t===Po.SHOWN?"persist":t===Po.DISMISSED||t===Po.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},CF=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);const n={};for(const r of e){const s=this._instance.get_property(r);ce(s)||(n[r]=s)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach(n=>this._instance.unregister(n)):this._instance.unregister(e)}},PF=class{constructor(t){this._instance=t}get(){const t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const t=je==null?void 0:je.__PosthogExtensions__;if(!t)return;const{generateSurveys:e,loadExternalDependency:n}=t;return{generateSurveys:e?r=>e(this._instance,r):void 0,loadExternalDependency:n?r=>n(this._instance,"surveys",r):void 0}}createEventReceiver(){return new EF(this._instance)}};const RF=J!=null&&J.location?Im(J.location.hash,"__posthog")||Im(location.hash,"state"):null,Q8="_postHogToolbarParams",J8=dn("[Toolbar]"),ek=dn("[FeatureFlags]");var AF=class{constructor(t,e=!1){this.Jc=!1,this.update(t,e)}update(t,e){this.Kc=((n,r)=>{var s,i,o,l,u,d,f,p;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:ce(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(p=n.evaluation_contexts)!==null&&p!==void 0?p:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:We(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Jc||(ek.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Jc=!0),ce(t.flag_keys)||We(t.flag_keys)||ek.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Kc}};const tk=dn("[FeatureFlags]"),Sl=dn("[FeatureFlags]",{debugEnabled:!0}),py=`" failed. Feature flags didn't load in time.`,TF=[502,504],nk=["click","keydown","wheel","touchstart","pointerdown"],rk="connection_error",sk=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},ik=t=>{const e={};for(const[n,r]of U0(t||{}))r&&(e[n]=r);return e},ok=t=>ld(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),oi=dn("[Error tracking]"),l2="webkit-masked-url:",IF=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],MF=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",l2],OF=["__firefox__","__gCrWeb"],ak="Refusing to render web experiment since the viewer is a likely bot",LF={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Nm(e,t),not_regex:(t,e)=>!Nm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Fs=dn("[Conversations]"),kl="Conversations not available yet.";function lk(t,e){var n,r,s,i,o,l,u;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,p=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,g=ce(p)?Math.max(f,2048):Math.max(f,p),v=V(V({},(function(){let w="",_="";try{const x=Qn==null?void 0:Qn.userAgent;x&&([w,_]=XP(x))}catch{}return(function(x,b){const E=(function(C){if(C)return{}.hasOwnProperty.call(n8,C)?n8[C]:C})(x);return V(V({},E?{"os.name":E}:{}),b?{"os.version":b}:{})})(w,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const NF=["debug","log","warn","error","info"],DF=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},ck="console",LR="__posthogHandledLogsRequestError",my=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[LR]=!0,n},uk=t=>!!t&&typeof t=="object"&&t[LR]===!0,Dm=dn("[NetworkMetrics]"),fw=()=>{var t;return!(J==null||(t=J.performance)===null||t===void 0)&&t.now?J.performance.now():Date.now()},$F={"http:":80,"https:":443},jF=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),NR=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Fa(r))===null||n===void 0?void 0:n.href)||r}},c2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,p=fw()-r,g=Fa(e.url);if(g&&g.protocol!=="http:"&&g.protocol!=="https:")return;const v={url:(g==null?void 0:g.href)||e.url,method:e.method},w=Xn(d.name)?d.name(v):st(d.name)?d.name:"http.client.request.duration";if(!w)return;const _=o&&!f?void 0:((b,E)=>b?400>b?void 0:String(b):(E==null?void 0:E.name)||"_OTHER")(f,i),x=V(V(V(V(V({},(b=>{const E=jF.has(b)?b:"_OTHER";return V({"http.request.method":E},E==="_OTHER"&&b!==E?{"http.request.method_original":b}:{})})(v.method)),g?(b=>{return{"server.address":b.hostname.startsWith("[")&&b.hostname.endsWith("]")?b.hostname.slice(1,-1):b.hostname,"server.port":Number(b.port)||$F[b.protocol],"url.scheme":b.protocol.slice(0,-1),"url.template":(E=b.pathname,E.split("/").map(C=>(R=>/^\d+$/.test(R)||R.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(R))(C)?":id":C).join("/"))};var E})(g):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:p}));(u=t.metrics)===null||u===void 0||u.histogram(w,p,{unit:"ms",attributes:x})}catch(d){Dm.error("Failed to record network metric",d)}},DR=()=>{},FF=(t,e)=>Xn(J==null?void 0:J.fetch)?sh(J,"fetch",n=>function(...r){const s=fw(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,p=NR((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(g=>(c2(t,p,g==null?void 0:g.status,s,e,void 0,!0),g),g=>{throw c2(t,p,void 0,s,e,g),g})}catch(d){return Dm.error("Failed to observe fetch",d),i}}):DR,VF=(t,e)=>{var n;const r=J==null||(n=J.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return DR;const s=new WeakMap,i=sh(r,"open",l=>function(...u){try{pR.has(this)||s.set(this,NR(u[0],u[1]))}catch(d){Dm.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=sh(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const p=fw();d=()=>{this.removeEventListener("loadend",d),c2(t,f,this.status,p,e)},St(this,"loadend",d)}}catch(f){Dm.error("Failed to observe XHR send",f)}try{return l.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},kg={featureFlags:class{constructor(t){this.name="featureFlags",this.Xc=!1,this.featureFlagEventHandlers=[],this.$=tk,this.Yc={},this.td={},this.ed=[],this.nd=!1,this.sd=!1,this.rd=0,this.od=!1,this.ad=!1,this.ld=!1,this.ud=!1,this.hd=0,this.dd=!1,this.an=()=>{const e=this.vd();this.hd=0,e&&this.reloadFeatureFlags()},this.fd=()=>{var e,n;const r=this.pd,s=(e=this.gd)!==null&&e!==void 0?e:r;ce(r)||ce(s)||this.Rr.remoteRequestsDisabled||!ue||ue.visibilityState==="hidden"||Date.now()-((n=this.md)!==null&&n!==void 0?n:0)<s||(this.gd=this.dd||!this.Rr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.dd=!1,this.reloadFeatureFlags(),this.yd())},this.bd=()=>{this.dd&&this.gd===this.pd||this._d()},this.ln=()=>{(ue==null?void 0:ue.visibilityState)==="visible"&&this._d()},"get"in t?this.So=t:(this._instance=t,this.wd=new AF(t.config,t.nl()),this.So=this.wd)}updateConfig(t,e){var n;(n=this.wd)===null||n===void 0||n.update(t,e),this.wo&&this.kd()}setup(t){return this.Fh=t,this.$=t.logger.createLogger("[FeatureFlags]"),OR(t.kv.initialize(),()=>{this.Fh===t&&(this.Fh=void 0,this.wo=t,this.Sd(t))})}Sd(t){var e;if(this.wo===t)return J&&St(J,"online",this.an),this.kd(),this.xd=t.registerDynamicEventProperties(()=>this.Cd()?this.Yc:this.td),this.$d=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Td(),this.Id(),this.Md()}),this.Id(),this.initialize()}_d(){this.dd=!0,this.gd=this.pd,this.fd()}kd(){const t=this.Rr.refreshIntervalMs,e=!this.Rr.remoteRequestsDisabled&&ue&&!ce(t)&&t>0?t:void 0;this.Rr.idleRefreshBackoff||(this.gd=e),e!==this.pd&&(this.Ed(),ce(e)||(this.pd=e,this.gd=e,this.yd(),ue!=null&&ue.addEventListener&&(St(ue,Jf,this.ln),hu(nk,n=>{St(ue,n,this.bd,{capture:!0})}))))}yd(){ce(this.pd)||(ce(this.Pd)||clearInterval(this.Pd),this.md=Date.now(),this.Pd=setInterval(this.fd,this.pd))}Ed(){var t;ce(this.Pd)||(clearInterval(this.Pd),this.Pd=void 0,ue==null||(t=ue.removeEventListener)===null||t===void 0||t.call(ue,"visibilitychange",this.ln),hu(nk,e=>{var n;ue==null||(n=ue.removeEventListener)===null||n===void 0||n.call(ue,e,this.bd,{capture:!0})})),this.pd=void 0,this.gd=void 0,this.dd=!1,this.md=void 0}destroy(){this.Rd()}dispose(){this.Rd()}Rd(){var t,e;this.Ed(),this.rd++,this.ad=!1,this.Fh=void 0,this.wo&&(this.Ad(),(t=this.xd)===null||t===void 0||t.dispose(),this.xd=void 0,(e=this.$d)===null||e===void 0||e.call(this),this.$d=void 0,this.ed=[],J==null||J.removeEventListener("online",this.an),this.wo=void 0)}get Rr(){return this.So.get()}Fd(t){var e;return this.Od&&t in this.Od?this.Od[t]:(e=this.wo)===null||e===void 0?void 0:e.kv.get(t)}Td(){return!!this.Od&&(this.Od=void 0,!0)}Dd(){var t;return!ce((t=this.wo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Td()}At(t){this.Ld(()=>{var e;return(e=this.wo)===null||e===void 0?void 0:e.kv.set(t)})}Nd(t,e,n){var r;if(!(!((r=this._instance)===null||r===void 0)&&r.persistence)||!t.$enabled_feature_flags)return;const s=this.Fd("$enabled_feature_flags")||{},i=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,l=e.flags?Object.entries(e.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],u=!!e.errorsWhileComputingFlags&&!!e.flags,d=u?l:n&&!We(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(s),...Object.keys(i)])),f=this.Fd("$feature_flag_payloads")||{},p=t.$feature_flag_payloads||{},g=u||n?d:Array.from(new Set([...Object.keys(f),...Object.keys(p)])),v=!u&&!n,w=!!v||d,_=!!v||g,x={[Eo]:w,[pi]:w,[Sa]:_};t.$feature_flag_details&&(x[Ql]=w);for(const b of[Jl,Ma,Tf])ce(t[b])||(x[b]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(x)}Lt(t){this.Ld(()=>{var e;return(e=this.wo)===null||e===void 0?void 0:e.kv.remove(t)})}Ld(t){try{t()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}Id(){const t={};for(const r of[Eo,Sa,Jl,Ai]){const s=this.Fd(r);ce(s)||(t[r]=s)}this.Yc=t;const e=V({},t),n=this.Fd(pi);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.td=e}Cd(){const t=this.Rr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Fd(Ma);return typeof e!="number"||Date.now()-e>t}qd(){return!!this.Cd()&&(this.ud||this.sd||(this.ud=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}jd(){const t=this.Rr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Bd(){const t=this.Rr.flagKeys;if(!ce(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Rr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!ce(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Hd({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.Fd("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Fd("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=V(V({},i),t),u=V(V({},o),e),d={};for(const[f,p]of Object.entries(l))d[f]={key:f,enabled:XS(p),variant:QS(p),reason:void 0,metadata:ce(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.Hd({flags:d})}get hasLoadedFlags(){return this.nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Fd(Ql),e=this.Fd(Ai),n=this.Fd(Nl);if(!n&&!e)return t||{};const r=Bt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i;const u=r[l],d=e==null?void 0:e[l],f=ce(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,p=ce(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,g=n==null?void 0:n[l],v=V(V({},u),{},{enabled:f,variant:f?p??(u==null?void 0:u.variant):void 0});var o;f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),g&&(v.metadata=V(V({},u==null?void 0:u.metadata),{},{payload:g,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.Xc||(this.$.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Xc=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:XS(r),variant:QS(r),payload:YS(e[n])}})}getFlagVariants(){const t=this.Fd(pi),e=this.Fd(Ai);if(!e)return t||{};const n=Bt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Xc||(this.$.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Xc=!0),n}getFlagPayloads(){const t=this.Fd(Sa),e=this.Fd(Nl);if(!e)return t||{};const n=Bt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Xc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Xc=!0),n}reloadFeatureFlags(){this.od||this.Rr.featureFlagsDisabled||this.vd()||(this.sd&&(this.ad=!0),this.zd||(this.ed.slice().forEach(t=>{try{t()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.zd=setTimeout(()=>{this.Ud()},5)))}Ad(){clearTimeout(this.zd),this.zd=void 0}onReloading(t){return this.ed.push(t),()=>{this.ed=this.ed.filter(e=>e!==t)}}ensureFlagsLoaded(){this.nd||this.sd||this.zd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.od=t}resetFlagCallReported(){this.Lt(Ca)}Ud(t){this.Ad();const e=this.wo;if(!e||this.Rr.remoteRequestsDisabled||this.vd())return;if(this.sd)return void(this.ad=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:V(V(V({},e.initialPersonProperties),this.Fd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Fd(Ea),timezone:oR()};ce(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.Rr.featureFlagsDisabled)&&(n.disable_flags=!0);const r=this.jd();r.length&&(n.evaluation_contexts=r);const s=this.Bd();ce(s)||(n.flag_keys=s);const i=this.Rr.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),l=this.rd;this.sd=!0;const u=()=>{this.ad&&(this.ad=!1,this.Ud())},d=w=>{var _,x;const b=(_=w.json)!==null&&_!==void 0?_:{},E=w.statusCode!==200;if(this.sd=!1,l!==this.rd)return void u();if(this.Wd(w.statusCode),E||this.ad||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.ad)return;this.ld=!E;const C=[];w.error?C.push(w.error instanceof Error&&w.error.name==="AbortError"?"timeout":w.error instanceof Error?rk:"unknown_error"):w.statusCode!==200&&C.push(`api_error_${w.statusCode}`),b.errorsWhileComputingFlags&&C.push("errors_while_computing_flags");const R=!!(!((x=b.quotaLimited)===null||x===void 0)&&x.includes("feature_flags"));R&&C.push("quota_limited"),this.At({[Qf]:C}),R?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Hd(b,E,{partialResponse:i}),u()},f=w=>{this.sd=!1,l===this.rd&&(this.At({[Qf]:[rk]}),this.$.error("Feature flag request failed",w),this.Dd()&&this.Md(!0)),u()};let p=this.Rr.requestMaxRetries;const g=()=>p>0&&l===this.rd,v=()=>{if(l!==this.rd||!this.wo||this.Rr.remoteRequestsDisabled)return this.sd=!1,void u();try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.Rr.compression,sentAt:"body",timeoutMs:this.Rr.requestTimeoutMs}).then(w=>{if((_=>TF.includes(_.statusCode)||(x=>x.statusCode===0&&x.error instanceof Error&&x.error.name==="AbortError")(_))(w)&&g())return p--,void setTimeout(v,500);d(w)}).catch(f)}catch(w){f(w)}};v()}vd(){return X5(this.hd,3)}Wd(t){this.hd=Q5(t,this.hd,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+t+py);if(this.qd())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+t+py);if(this.qd())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.Fd("$feature_flag_request_id")||void 0,u=this.Fd("$feature_flag_evaluated_at")||void 0;let d,f=this.Fd("$flag_call_reported")||{};if(this.Rr.deduplicateCallsPerSession){var p;const L=(p=this.wo)===null||p===void 0?void 0:p.session.sessionId,D=this.Fd(yf);L&&L!==D&&(f={},d=L)}if(e.send_event||!("send_event"in e))if(t in f&&f[t].includes(o))d&&this.At({[Ca]:f,[yf]:d});else{var g,v,w,_,x,b,E,C,R,A,M,I;We(f[t])?f[t].push(o):f[t]=[o],this.At(V({[Ca]:f},d?{[yf]:d}:{}));const L=this.getFeatureFlagDetails(t),D=[...(g=this.Fd("$feature_flag_errors"))!==null&&g!==void 0?g:[]];ce(s)&&D.push("flag_missing");const B={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(v=(w=this.Rr.bootstrap)===null||w===void 0||(w=w.featureFlags)===null||w===void 0?void 0:w[t])!==null&&v!==void 0?v:null,$feature_flag_bootstrapped_payload:(_=(x=this.Rr.bootstrap)===null||x===void 0||(x=x.featureFlagPayloads)===null||x===void 0?void 0:x[t])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this.ld};ce(L==null||(b=L.metadata)===null||b===void 0?void 0:b.has_experiment)||(B.$feature_flag_has_experiment=L.metadata.has_experiment),ce(L==null||(E=L.metadata)===null||E===void 0?void 0:E.version)||(B.$feature_flag_version=L.metadata.version);const j=(C=L==null||(R=L.reason)===null||R===void 0?void 0:R.description)!==null&&C!==void 0?C:L==null||(A=L.reason)===null||A===void 0?void 0:A.code;var T;j&&(B.$feature_flag_reason=j),!(L==null||(M=L.metadata)===null||M===void 0)&&M.id&&(B.$feature_flag_id=L.metadata.id),ce(L==null?void 0:L.original_variant)&&ce(L==null?void 0:L.original_enabled)||(B.$feature_flag_original_response=ce(L.original_variant)?L.original_enabled:L.original_variant),!(L==null||(I=L.metadata)===null||I===void 0)&&I.original_payload&&(B.$feature_flag_original_payload=L==null||(T=L.metadata)===null||T===void 0?void 0:T.original_payload),D.length&&(B.$feature_flag_error=D.join(",")),this.Vd(B)}else d&&this.At({[Ca]:f,[yf]:d});return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:YS(i)}:void 0}Vd(t){try{var e;(e=this.wo)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.$.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Gd(t,e)}Gd(t,e){var n=this;return Wt(function*(){const r=n.wo;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.jd();i.length&&(s.evaluation_contexts=i);const o=n.Bd();let l;ce(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Rr.compression,sentAt:"body",timeoutMs:n.Rr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.$.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.$.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.ld)return e.defaultValue;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+t+py),e.defaultValue;const n=this.getFeatureFlag(t,e);return ce(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Hd(t,e,n)}Hd(t,e,n){if(!this.wo)return;this.nd=!0;const r=((s,i={},o={},l={},u,d=tk)=>{const f=((C,R)=>{const A=C.flags;if(A){const M=Object.fromEntries(Object.keys(A).map(T=>{var L;return[T,(L=A[T].variant)!==null&&L!==void 0?L:A[T].enabled]})),I=Object.fromEntries(Object.keys(A).filter(T=>A[T].enabled).filter(T=>{var L;return!ce((L=A[T].metadata)===null||L===void 0?void 0:L.payload)}).map(T=>{var L;return[T,(L=A[T].metadata)===null||L===void 0?void 0:L.payload]}));return V(V({},C),{},{featureFlags:M,featureFlagPayloads:I})}return C.featureFlags&&R.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),p=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(!g)return;const w=s.requestId,_=s.evaluatedAt;if(We(g)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(g)for(let R=0;g.length>R;R++)C[g[R]]=!0;return{[Eo]:g,[pi]:C,[Tf]:!1}}let x=g,b=v,E=p;if(u!=null&&u.partialResponse){const C=Object.keys(x),R=b||{};x=V(V({},i),x),b=V(V({},o),R),C.forEach(A=>{A in R||b==null||delete b[A]}),E=V(V({},l),E)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(A=>{var M;return!(!((M=p[A])===null||M===void 0)&&M.failed)}));x=V(V({},i),Object.fromEntries(Object.entries(x).filter(([A])=>C.has(A))));const R=Object.fromEntries(Object.entries(b||{}).filter(([A])=>C.has(A)));b=V(V({},o),R),C.forEach(A=>{A in R||b==null||delete b[A]}),E=V(V({},l),Object.fromEntries(Object.entries(E||{}).filter(([A])=>C.has(A))))}else x=V(V({},i),x),b=V(V({},o),b),E=V(V({},l),E);return V(V({[Eo]:Object.keys(ik(x)),[pi]:x||{},[Sa]:b||{},[Ql]:E||{},[Tf]:s.minimalFlagCalledEvents===!0},w?{[Jl]:w}:{}),_?{[Ma]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.$);if(r)if((n==null?void 0:n.persist)===!1){const s=!ce(this.wo.kv.get(pi));this.Od=r,s||this.At(r)}else this.Td(),this.Nd(r,t,!!(n!=null&&n.partialResponse)),this.At(r);else e&&this.Dd();e||(this.ud=!1),this.Md(e)}override(t,e=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Zd(t)}Zd(t){if(this.wo){if(t===!1)return this.Lt([Ai,Nl]),this.Md(),void Sl.info("All overrides cleared");if(We(t))return this.At({[Ai]:sk(t)}),this.Md(),void Sl.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Xc=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Ai]=We(s)?sk(s):s),i&&(r[Nl]=i),Object.keys(r).length&&this.At(r),s===!1&&i===!1?this.Lt([Ai,Nl]):s===!1?this.Lt(Ai):i===!1&&this.Lt(Nl),this.Md(),s===!1?Sl.info("Flag overrides cleared"):s&&Sl.info("Flag overrides set",{flags:s}),void(i===!1?Sl.info("Payload overrides cleared"):i&&Sl.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.At({[Ai]:t}),this.Md(),void Sl.info("Flag overrides set",{flags:t});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.nd){const{flags:e,flagVariants:n}=this.Qd();try{t(e,n)}catch(r){this.$.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.Fd("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=V(V({},this.getFlagVariants()),{},{[t]:e});(r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.At({[Eo]:Object.keys(ik(l)),[pi]:l,[ka]:V(V({},this.Fd("$stored_person_properties")||{}),i)}),this.Md();try{var u;(u=this.wo)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.$.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.Fd(q_);!r||e?this.Jd(t,n):t(r)}Jd(t,e){var n=this;return Wt(function*(){const r=n.wo;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.At({[q_]:i})}catch(o){return void n.$.error("Early access feature request failed",o)}try{t(i)}catch(o){n.$.error("Early access feature callback failed",o)}})()}Qd(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}Md(t){this.Id();const{flags:e,flagVariants:n}=this.Qd();this.featureFlagEventHandlers.forEach(r=>{try{r(e,n,{errorsLoading:t})}catch(s){this.$.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(t,e=!0){this.Kd(t,e)}Kd(t,e=!0){const n=this.Fd("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.At({[ka]:V(V(V({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=V({},this.Fd("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.At({[ka]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(ka),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Fd("$stored_group_properties")||{},r=V({},n);for(const s of Object.keys(t))r[s]=V(V({},n[s]),t[s]);this.At({[Ea]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Fd("$stored_group_properties")||{};this.At({[Ea]:V(V({},e),{},{[t]:{}})})}else this.Lt(Ea)}reset(){this.rd++,this.ad=!1,this.Yc={},this.td={},this.Od=void 0,this.nd=!1,this.od=!1,this.ld=!1,this.$anon_distinct_id=void 0,this.Ad(),this.Xc=!1,this.hd=0}}},HF={sessionRecording:class{get Rr(){return this._instance.config}get Ml(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Xd)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Yd==="awaiting_config"||this.Yd==="missing_config"?this.Yd:(t=(e=this.Xd)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Yd}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Yd=dy,this.tv=void 0,this.ev=!1,this.Xe=(()=>{var e,n;if(!(ue!=null&&ue.visibilityState)||ue.visibilityState==="visible")return!0;const r=J==null||(e=J.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.ln=()=>{var e,n;(ue==null?void 0:ue.visibilityState)==="visible"&&(this.Xe=!0,(e=this.Xd)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw fo.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Rr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');ue!=null&&ue.addEventListener&&St(ue,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.ev=!0,ue==null||(e=ue.removeEventListener)===null||e===void 0||e.call(ue,"visibilitychange",this.ln),t?this.iv(!0):this.stopRecording()}get nv(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Rr.disable_session_recording,r=this.Rr.disable_session_recording||this._instance.consent.isOptedOut();return J&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.ev||this.nv&&(!((e=this.Xd)===null||e===void 0)&&e.isStarted))return;const n=!ce(Object.assign)&&!ce(Array.from);this.nv&&n?(this.sv(t),fo.info("starting")):(this.Yd=dy,this.stopRecording())}sv(t){var e,n;if(this.nv)if(this.Yd!=="awaiting_config"&&this.Yd!=="missing_config"&&(this.Yd=K8),(je==null||(e=je.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=je.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.rv(t);else{var r,s;const i=this._instance.sessionManager;(r=je.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.ov,o=>{if(!this.ev&&this.nv&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),fo.error("could not load recorder",o)):void this.rv(t);this.Yd="disabled"})}}stopRecording(){var t,e;(t=this.tv)===null||t===void 0||t.call(this),this.tv=void 0,(e=this.Xd)===null||e===void 0||e.stop()}iv(t=!1){var e,n;(e=this.tv)===null||e===void 0||e.call(this),this.tv=void 0,(n=this.Xd)===null||n===void 0||n.discard({discardProducerEvents:t})}av(){var t,e;(t=this.Ml)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Ml)===null||e===void 0||e.unregister("$replay_sample_rate")}lv(t,e){if(et(t))return null;const n=mn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(fo.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}uv(t){if(this.Ml){var e,n;const r=this.Ml,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.lv((i=this.Rr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.lv(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;et(d)&&this.av();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Af]:V(V({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:V({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:ce(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.tv)===null||e===void 0||e.call(this),this.tv=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.uv(e),void this.iv()):(this.uv(e),void this.startIfEnabledOrStop()):(this.Yd==="awaiting_config"&&(this.Yd="missing_config",this._instance.register_for_session({[N5]:!0}),fo.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Xd)===null||n===void 0)&&n.log?this.Xd.log(t,e):fo.warn("log called before recorder was ready")}get ov(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Af);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}hv(){const t=this._instance.get_property(Af);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return fo.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!et(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}rv(t){var e,n,r;if(!this.ev&&this.nv&&this._instance.sessionManager){if(!(!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return fo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[L5]:!0});var s;if(this.Xd||(this.Xd=(s=je.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Xe),this.Xd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hv())return this.Yd==="missing_config"||this.Yd==="awaiting_config"?void 0:(this.Yd="awaiting_config",fo.info("persisted remote config is stale, requesting fresh config before starting"),void new lR(this._instance).load());this.Yd=K8,(n=(r=this.Xd).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Xe),this.Xd.start(t)}else this.Yd=dy}onRRwebEmit(t){var e,n;(e=this.Xd)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Xd||(e=this.Ml)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Xd)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Xd||(e=this.Ml)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Xd)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Xd||(n=this.Ml)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Xd)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Xd)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Xd)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Xd)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},zF={autocapture:class extends mF{constructor(t){super(new gF(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.dv=this.vv()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.fv();return!!(t.path||t.search||this.pv(t))}startIfEnabled(){this.isEnabled&&(ve.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.dv=this.vv(),this.startIfEnabled()}stop(){this.gv&&this.gv(),this.gv=void 0,this.mv&&this.mv(),this.mv=void 0,ve.info("History API monitoring stopped")}monitorHistoryChanges(){J&&J.history&&(this.yv("pushState"),this.yv("replaceState"),this.bv(),this.pv()&&this._v())}yv(t){var e;if(!J||!((e=J.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;sh(J.history,t,r=>function(s,i,o){r.call(this,s,i,o),n.wv(t)})}vv(){const t=J==null?void 0:J.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}fv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ct(t)?t:{}}pv(t=this.fv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}Sv(t){const e=this.fv(),n=this.dv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.pv(e)&&t.hash!==n.hash))}wv(t){try{const e=this.vv();if(!e)return;this.Sv(e)&&this._instance.capture(sw,{navigation_type:t}),this.dv=e}catch(e){ve.error(`Error capturing ${t} pageview`,e)}}bv(){if(this.gv)return;const t=()=>{this.wv("popstate")};St(J,"popstate",t),this.gv=()=>{J&&J.removeEventListener("popstate",t)}}_v(){if(this.mv)return;const t=()=>{this.wv("hashchange")};St(J,"hashchange",t),this.mv=()=>{J&&J.removeEventListener("hashchange",t)}}},heatmaps:class{get Rr(){return this.instance.config}constructor(t){var e;this.xv=!1,this.xo=!1,this.Cv=null,this.instance=t,this.xv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[B_]),this.rageclicks=new MR(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return ct(this.Rr.capture_heatmaps)&&this.Rr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.Rr.capture_heatmaps)?et(this.Rr.enable_heatmaps)?this.xv:this.Rr.enable_heatmaps:this.Rr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.xo)return;xF.info("starting..."),this.$v(),this.ln()}else{var t;clearInterval((t=this.Cv)!==null&&t!==void 0?t:void 0),this.Tv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[B_]:n}),this.xv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Iv(t){fy(t.originalEvent)&&this.Tr(t.originalEvent,"deadclick")}ln(){this.Cv&&clearInterval(this.Cv),this.Cv=(ue==null?void 0:ue.visibilityState)==="visible"?setInterval(this.bl.bind(this),this.flushIntervalMilliseconds):null}$v(){J&&ue&&(this.Mv=this.bl.bind(this),St(J,Am,this.Mv),this.Ev=t=>this.Tr(t||(J==null?void 0:J.event)),St(ue,"click",this.Ev,{capture:!0}),this.Pv=t=>this.Rv(t||(J==null?void 0:J.event)),St(ue,"mousemove",this.Pv,{capture:!0}),this.Av=new S8(this.instance,Sj,this.Iv.bind(this)),this.Av.startIfEnabledOrStop(),this.Fv=this.ln.bind(this),St(ue,Jf,this.Fv),this.xo=!0)}Tv(){var t;J&&ue&&(this.Mv&&J.removeEventListener(Am,this.Mv),this.Ev&&ue.removeEventListener("click",this.Ev,{capture:!0}),this.Pv&&ue.removeEventListener("mousemove",this.Pv,{capture:!0}),this.Fv&&ue.removeEventListener(Jf,this.Fv),clearTimeout(this.Ov),(t=this.Av)===null||t===void 0||t.stop(),this.xo=!1)}Dv(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){let d=o;for(;d&&Ui(d)&&!mr(d,"body");){if(d===u)return!1;let v;try{var f,p,g;v=(f=(p=(g=d.ownerDocument)===null||g===void 0?void 0:g.defaultView)!==null&&p!==void 0?p:J)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(qe(l,v))return!0;d=U5(d)}return!1})(Mf(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Tr(t,e="click"){var n;if(h8(t.target)||!fy(t))return;const r=this.Dv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&W5(Mf(t),this.instance.config.rageclick)&&this.Zs(V(V({},r),{},{type:"rageclick"})),this.Zs(r)}Rv(t){!h8(t.target)&&fy(t)&&(clearTimeout(this.Ov),this.Ov=setTimeout(()=>{this.Zs(this.Dv(t,"mousemove"))},500))}Zs(t){if(!J)return;const e=this.Rr.disable_capture_url_hashes?ja(J.location.href):J.location.href,n=this.Rr.custom_personal_data_properties,r=this.Rr.mask_personal_data_properties?[...Wu,...n||[]]:[],s=nh(e,r,rh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}bl(){this.Rt&&!Gr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:S8,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.xv=!1,this.xo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Lv=()=>{clearTimeout(this.Nv),this.Nv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",V({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>V(V({},n),{},{[`$web_vitals_${r.name}_event`]:V({},r),[`$web_vitals_${r.name}_value`]:r.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.qv=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(n==null?void 0:n.name)||et(n==null?void 0:n.value))return void bl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.jv(s);if(ce(i))return;const o=mn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.Bv&&n.value>=this.Bv)return void bl.error("Ignoring metric with value >= "+this.Bv,n);this.Rt.navigationKey!==o&&(this.Lv(),this.Nv=setTimeout(this.Lv,this.flushToCaptureTimeoutMs)),ce(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=ce(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=V(V(V({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,ct(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of _F){const p=f==="url"&&typeof n.attribution[f]=="string"?this.jv(n.attribution[f]):n.attribution[f];ce(p)||(d[f]=p)}u.attribution=d}else delete u.attribution;ce(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.Lv()},this.Hv=()=>{if(this.xo)return;let n,r,s,i,o=!1;const l=je.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.zv])||(this.zv==="web-vitals"&&ce(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!ce(d)){const g=d.withoutAttribution,v=this.attributionMetrics;o=!ce(g),n=v.indexOf("LCP")>-1?d.onLCP:(g==null?void 0:g.onLCP)||d.onLCP,r=v.indexOf("CLS")>-1?d.onCLS:(g==null?void 0:g.onCLS)||d.onCLS,s=v.indexOf("FCP")>-1?d.onFCP:(g==null?void 0:g.onFCP)||d.onFCP,i=v.indexOf("INP")>-1?d.onINP:(g==null?void 0:g.onINP)||d.onINP}if(!(n&&r&&s&&i))return void bl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?V(V({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.qv.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.qv.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.qv.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.qv.bind(this),p),this.xo=!0},this.xv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[W_]),this.startIfEnabled()}get Uv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=ct(this.Uv)?(t=this.Uv)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return et(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||G8:n}get flushToCaptureTimeoutMs(){return(ct(this.Uv)?this.Uv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=ct(this.Uv)?this.Uv.web_vitals_attribution:void 0;return Nr(t)?t?G8:[]:We(t)?t:yF}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=ct(this.Uv)?this.Uv.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Bv(){const t=ct(this.Uv)&&mn(this.Uv.__web_vitals_max_value)?this.Uv.__web_vitals_max_value:q8;return t>0&&6e4>=t?q8:t}get isEnabled(){const t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return bl.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=ct(this.Uv)?this.Uv.web_vitals:Nr(this.Uv)?this.Uv:void 0;return Nr(e)?e:this.xv}startIfEnabled(){this.isEnabled&&!this.xo&&(bl.info("enabled, starting..."),this.zo(this.Hv))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=ct(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ct(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[W_]:n}),this._instance.persistence.register({[S5]:r})),this.xv=n,this.startIfEnabled()}get zv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(t){var e;const n=je.__PosthogExtensions__,r=this.zv,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&ce(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?bl.error("failed to load script",i):t()})}jv(t){const e=t||(J==null?void 0:J.location.href);if(!e)return void bl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?ja(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Wu,...r||[]]:[];return nh(n,s,rh)}}},BF={exceptionObserver:class{constructor(t){var e;this.Hv=()=>{var n;if(!J||!this.isEnabled||!(!((n=je.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=je.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=je.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=je.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Wv&&this.Rr.capture_unhandled_errors&&(this.Wv=r(this.captureException.bind(this))),!this.Vv&&this.Rr.capture_unhandled_rejections&&(this.Vv=s(this.captureException.bind(this))),!this.Gv&&this.Rr.capture_console_errors&&(this.Gv=i(this.captureException.bind(this)))}catch(o){df.error("failed to start",o),this.Zv()}},this._instance=t,this.Qv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[U_]),this.wt=new D7(V(V({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:df})),this.Rr=this.Jv(),this.startIfEnabledOrStop()}Jv(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ct(t)?e=V(V({},e),t):(ce(t)?this.Qv:t)&&(e=V(V({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rr.capture_console_errors||this.Rr.capture_unhandled_errors||this.Rr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(df.info("enabled"),this.Zv(),this.zo(this.Hv)):this.Zv()}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return df.error("failed to load script",s);t()})}Zv(){var t,e,n;(t=this.Wv)===null||t===void 0||t.call(this),this.Wv=void 0,(e=this.Vv)===null||e===void 0||e.call(this),this.Vv=void 0,(n=this.Gv)===null||n===void 0||n.call(this),this.Gv=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Qv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[U_]:this.Qv}),this.Rr=this.Jv(),this.startIfEnabledOrStop())}onConfigChange(){this.Rr=this.Jv()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void df.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.Kv=[],this.Xv=new G7([new c$,new y$,new d$,new u$,new g$,new m$,new h$,new v$],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
19
+ `),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const w=u[v];if(w.length>1024)continue;const _=KS.test(w)?w.replace(KS,"$1"):w;if(!_.match(/\S*Error: /)){for(const x of s){const b=x(_,r);if(b){l.push(b);const E=i$(l);if(E){for(let C=f.length-1;C>=0;C--){const R=f[C];if(E.start>=R.start+R.length)break;f.pop()}f.push(E)}break}}if(a$(l,f)>=50)break}}const p=[...f].sort((v,w)=>w.start-v.start),g=p[p.length-1];if(g){const v=i5(l,g);l.splice(g.start-v,v);for(const w of p)w.start-=v}for(const v of p)o$(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const w=v.map(x=>`${x.function}|${x.filename}|${x.lineno}|${x.colno}|${x.module}`);let _=0;for(let x=1;w.length>x;x++)l$(w,x,_)&&(_=x);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const w=Array.from(v);return w.reverse(),w.slice(0,50).map(_=>{return V(V({},_),{},{filename:_.filename||(x=w,x[x.length-1]||{}).filename,function:_.function||"?"});var x})})(l)}})("web:javascript",t$,s$)),this._instance=t,this.Kv=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.Yv=km(this.tf()),this.ef=new x$(this.Yv)}onConfigChange(){this.Yv=km(this.tf()),this.ef.setConfig(this.Yv)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Kv=i,this._instance.persistence&&this._instance.persistence.register({[w5]:this.Kv,[Z_]:o})}get if(){var t;const e=!!this._instance.get_property(Z_),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Xv.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Yv.enabled)try{if(!st(t)||t.trim().length===0)return void oi.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>_$.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.nf(e));r.length>0&&oi.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.ef.add(V({[bm]:t,[Sm]:new Date().toISOString()},n))}catch(n){oi.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.sf(e)){if(this.rf(e))return this.af("Exception dropped: matched a suppression rule"),void oi.info("Skipping exception capture because a suppression rule matched");if(!this.if&&this.lf(e))return this.af("Exception dropped: thrown by a browser extension"),void oi.info("Skipping exception capture because it was thrown by an extension");if(!this.if&&this.uf(e))return this.af("Exception dropped: thrown by an injected browser script"),void oi.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.hf(e))return this.af("Exception dropped: thrown by the PostHog SDK"),void oi.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Yv.enabled&&et(t.$exception_steps)?this.cf(t):t,r=(function(){const s=globalThis._posthogReleaseId;return typeof s=="string"&&s.length>0?s:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return s&&this.ef.clear(),s}catch(s){return ok(s)||oi.error("Failed to capture exception event. Dropping this exception.",s),void this.ef.clear()}}catch(e){return void(ok(e)||oi.error("Failed to process exception event. Ignoring this exception.",e))}}cf(t){try{const e=this.ef.getAttachable();return e.length===0?t:V(V({},t),{},{$exception_steps:e})}catch(e){return oi.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}af(t){this.Yv.enabled&&this.ef.add({[bm]:t,[Sm]:new Date().toISOString()})}nf(t){return ct(t)?V({},t):{}}tf(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}rf(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(st(r)&&r.length>0&&n.$exception_types.push(r),st(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Kv.some(n=>{const r=n.values.map(s=>{const i=RR[s.operator],o=e[s.key];if(!i||!o)return!1;const l=We(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return oi.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}lf(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&MF.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(l2))||t.some(({type:r,value:s})=>r==="NoResponse"||st(s)&&IF.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(l2))))}uf(t){return t.some(({value:e})=>st(e)&&OF.some(n=>e.includes(n)))}hf(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}sf(t){return!et(t)&&We(t)}}},UF=V({productTours:class{get Ml(){return this._instance.persistence}constructor(t){this.df=null,this.vf=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Ml&&this.Ml.register({[tw]:!!e.productTours}),!hy(this._instance))return!this.df&&et((n=this.Ml)===null||n===void 0?void 0:n.props.ph_product_tours)||f0.info("product tours disabled; stopping and clearing cached tours"),(r=this.df)===null||r===void 0||r.stop(),this.df=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.df&&hy(this._instance)&&this.zo(()=>this.ff())}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?f0.error("Could not load product tours script",s):t()})}ff(){var t;!this.df&&(!((t=je.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.df=je.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(We(this.vf)&&!e)return void t(this.vf,{isLoaded:!0});const n=this.Ml;if(n){const r=n.props[K_];if(We(r)&&!e)return this.vf=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!hy(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||f0.warn(o):f0.error(o),void t([],{isLoaded:!1,error:o})}const i=We(r.json.product_tours)?r.json.product_tours:[];this.vf=i,n&&n.register({[K_]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){et(this.df)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.df.getActiveProductTours(t)}showProductTour(t){var e;(e=this.df)===null||e===void 0||e.showTourById(t)}previewTour(t){this.df?this.df.previewTour(t):this.zo(()=>{var e;this.ff(),(e=this.df)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.df)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.df)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.df)===null||t===void 0||t.previousStep()}clearCache(){var t;this.vf=null,(t=this.Ml)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.df)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.df)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.df)===null||e===void 0||e.cancelPendingTour(t)}}},kg),ZF={siteApps:class{constructor(t){this._instance=t,this.pf=0,this.gf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}mf(t,e){if(!e)return;const n=this.globalsForEvent(e);this.gf.push(n),this.gf.length>1e3&&(this.gf=this.gf.slice(10))}get siteAppLoaders(){var t;return(t=je._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.mf.bind(this));this.yf=()=>{t(),this.gf=[],this.yf=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,w]of Object.entries(f))u[v]={id:d[v],type:v,properties:w};const{$set_once:p,$set:g}=t;return{event:V(V({},c5(t,wF)),{},{properties:V(V(V({},t.properties),g?{$set:V(V({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),g)}:{}),p?{$set_once:V(V({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),p)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}bf(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(ki.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(ki.error("prepare_external_dependency_script returned null"),null):t}_f(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=ue==null?void 0:ue.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.pf++,this.wf)return this.kf();const f=[],p=this,g=new WeakSet,v=(x,b,E)=>{if(!(x!=null&&x[b]))return;const C=x[b];x[b]=E(C),f.push(()=>{x[b]=C})},w=x=>{if(g.has(x))return x;const b=p.bf(x);return b&&g.add(b),b},_=x=>x.map(b=>typeof b=="string"?b:w(b)).filter(b=>!an(b));return v(d,"appendChild",x=>function(b){const E=w(b);return E?x.call(this,E):b}),v(d,"insertBefore",x=>function(b,E){const C=w(b);return C?x.call(this,C,E):b}),v(d,"replaceChild",x=>function(b,E){const C=w(b);return C?x.call(this,C,E):E}),[(e=u.Element)===null||e===void 0?void 0:e.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(x=>{v(x,"append",b=>function(...E){return b.apply(this,_(E))}),v(x,"prepend",b=>function(...E){return b.apply(this,_(E))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(x=>{v(x,"before",b=>function(...E){return b.apply(this,_(E))}),v(x,"after",b=>function(...E){return b.apply(this,_(E))}),v(x,"replaceWith",b=>function(...E){const C=_(E);return E.length&&!C.length?void 0:b.apply(this,C)})}),v((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",x=>function(b,E){const C=w(E);return C?x.call(this,b,C):null}),this.wf=()=>{f.forEach(x=>x()),this.wf=void 0},this.kf()}kf(){let t=!1;return()=>{var e;t||(t=!0,this.pf--,this.pf===0&&((e=this.wf)===null||e===void 0||e.call(this)))}}Sf(t,e=!0){const n=this._f();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.gf.length&&(ki.info(`Processing ${this.gf.length} events for site app with id ${t.id}`),this.gf.forEach(o=>this.Sf(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.yf)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,ki.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.Sf(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){ki.error(Y8+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){ki.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}xf(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}Cf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Sf(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){ki.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.xf(),void this._instance.on("eventCaptured",l=>this.Cf(l))):void ki.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.yf)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:u}of s.siteApps){var i,o;je[`__$$ph_site_app_${l}`]=this._instance,(i=je.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return ki.error(Y8+l,d)})}else ki.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},WF={tracingHeaders:class{constructor(t){this._instance=t,this.$f=void 0,this.Tf=void 0,this.If=void 0,this.Hv=()=>{const e=this.Mf();var n,r;e?(ce(this.$f)&&(this.$f=(n=je.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ce(this.Tf)&&(this.Tf=(r=je.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Zv()}}initialize(){this.startIfEnabledOrStop()}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return vF.error("failed to load script",s);t()})}Ef(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Mf(){const t=this.Ef();return We(t)?(We(this.If)?this.If.splice(0,this.If.length,...t):this.If=[...t],t.length>0?this.If:void 0):(We(this.If)&&this.If.splice(0),this.If=t||void 0,this.If)}Zv(){var t,e;(t=this.$f)===null||t===void 0||t.call(this),(e=this.Tf)===null||e===void 0||e.call(this),this.$f=void 0,this.Tf=void 0}startIfEnabledOrStop(){this.Mf()?this.zo(this.Hv):this.Zv()}}},qF=V({surveys:class extends bF{constructor(t){var e;super(new PF(t),(e=t,{get projectToken(){return e.config.token},kv:new CF(e)})),this._instance=t}qh(t,e){const n=e.query?Fh(t,e.query):t;return new Promise(r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},kg),GF={toolbar:class{constructor(t){this.instance=t}Pf(t){je.ph_toolbar_state=t}Rf(){var t;return(t=je.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(X_(this.instance.config)||!J||!ue)return!1;t=(r=t)!==null&&r!==void 0?r:J.location,n=(s=n)!==null&&s!==void 0?s:J.history;try{if(!e){try{J.localStorage.setItem("test","test"),J.localStorage.removeItem("test")}catch{return!1}e=J==null?void 0:J.localStorage}const i=RF||Im(t.hash,"__posthog")||Im(t.hash,"state");let o;const l=i?ZS(()=>JSON.parse(atob(decodeURIComponent(i))))||ZS(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(Q8)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Af(t){const e=je.ph_load_toolbar||je.ph_load_editor;!et(e)&&Xn(e)?e(t,this.instance):J8.warn("No toolbar load function found")}loadToolbar(t){const e=!!(ue!=null&&ue.getElementById("__POSTHOG_TOOLBAR__"));if(!J||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=V(V({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(J.localStorage.setItem(Q8,JSON.stringify(V(V({},r),{},{source:void 0}))),this.Rf()===2)this.Af(r);else if(this.Rf()===0){var s,i;this.Pf(1),(s=je.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return J8.error("[Toolbar] Failed to load",o),void this.Pf(0);this.Pf(2),this.Af(r)}),St(J,"turbolinks:load",()=>{this.Pf(0),this.loadToolbar(r)})}return!0}Ff(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},KF=V({experiments:class Tr{get Rr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{Tr.Of("retrieved web experiments from the server"),this.Df=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.Df&&(Tr.Of("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.Df)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);st(o)&&s.variants[o]&&this.Lf(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];Tr.Nf(l,this._instance)&&this.Lf(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())Tr.Of(ak);else if(!this.Rr.disable_web_experiments){if(et(this.Df))return this.Df=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Tr.Of("applying feature flags",e),e.forEach(n=>{var r;if(this.Df&&(!((r=this.Df)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.Df)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.Lf(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=Tr.getWindowLocation();if(e!=null&&e.search){const n=Zu(e==null?void 0:e.search,"__experiment_id"),r=Zu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Tr.Of(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.qf(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Rr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Rr.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Rr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}qf(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(Tr.Of(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.Lf(s[0].name,n,s[0].variants[n].transforms))}static Nf(e,n){return!et(e.conditions)&&Tr.jf(e,n)&&Tr.Bf(e)}static jf(e,n){var r;if(et(e.conditions)||et((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=Tr.getWindowLocation();if(s){var i,o,l;const u=H5(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||LF[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return J==null?void 0:J.location}static Bf(e){var n;if(et(e.conditions)||et((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=J5();if(r.utm_source){var s,i,o,l,u,d,f,p;const g=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,w=!(!((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((p=e.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==r.utm_term;return g&&w&&_&&v}return!1}static Of(e,...n){ve.info(`[WebExperiments] ${e}`,n)}Lf(e,n,r){this._is_bot()?Tr.Of(ak):n!=="control"?r.forEach(s=>{if(s.selector){var i;Tr.Of(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(l=>{const u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)})}}):Tr.Of("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?ER(Qn,this.Rr.custom_blocked_useragents):void 0}}},kg),YF={conversations:class{constructor(t){this._instance=t,this.Hf=void 0,this._conversationsManager=null,this.zf=!1,this.ne=null,this.Uf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.Wf=t.ok,!t.ok))return;const e=t.config.conversations;et(e)||(Nr(e)?this.Hf=e:(this.Hf=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Hf=void 0,this.ne=null,this.Wf=void 0,this.Uf=!1}loadIfEnabled(){if(this._conversationsManager||this.zf||this._instance.config.disable_conversations||X_(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=je==null?void 0:je.__PosthogExtensions__;if(t&&!ce(this.Hf)&&this.Hf)if(this.ne&&this.ne.token){this.zf=!0;try{const e=t.initConversations;if(e)return this.Vf(e),void(this.zf=!1);const n=t.loadExternalDependency;if(!n)return void this.Gf(rw);n(this._instance,"conversations",r=>{r||!t.initConversations?this.Gf("Could not load conversations script",r):this.Vf(t.initConversations),this.zf=!1})}catch(e){this.Gf("Error initializing conversations",e),this.zf=!1}}else Fs.error("Conversations enabled but missing token in remote config.")}Vf(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.Uf=!1,Fs.info("Conversations loaded successfully")}catch(e){this.Gf("Error completing conversations initialization",e)}else Fs.error("Cannot complete initialization: remote config is null")}Gf(t,e){Fs.error(t,e),this._conversationsManager=null,this.zf=!1,this.Uf=!0}show(){this._conversationsManager?this._conversationsManager.show():Fs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Hf===!0&&!an(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":X_(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Wf===!1?"remote_config_failed":ce(this.Hf)?this.Wf?"disabled_in_project":"remote_config_pending":this.Hf?et(this.ne)||!this.ne.token?"missing_token":je!=null&&je.__PosthogExtensions__?this.zf?"initializing":this.Uf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Wt(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Fs.warn(kl),null)})()}getMessages(t,e){var n=this;return Wt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Fs.warn(kl),null)})()}markAsRead(t){var e=this;return Wt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Fs.warn(kl),null)})()}getTickets(t){var e=this;return Wt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Fs.warn(kl),null)})()}requestRestoreLink(t){var e=this;return Wt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Fs.warn(kl),null)})()}restoreFromToken(t){var e=this;return Wt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Fs.warn(kl),null)})()}restoreFromUrlToken(){var t=this;return Wt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Fs.warn(kl),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Sh(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}xh(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},XF={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.Zf=!1,this.Qf=!1,this.Jf=!1,this.$=dn("[logs]"),this.Kf=V(V({},this.$),{},{error:(...n)=>{n.some(uk)||this.$.error(...n)}}),this.al=[],this.Xf=[],this.hd=0,this.Io=!1,this.Yf=[],this.tp=[],this.ep=!1,this.np=!1,this.sp=()=>{var n,r;this.Io||(this.hd=0,(n=this.rp)===null||n===void 0||n.onReconnect(),(r=this.op)===null||r===void 0||r.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.Zf=!0),J&&St(J,"online",this.sp)}ap(t,e,n,r){var s;const i=lk((s=this._instance)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.logs,n);return[new T$(this.lp(t,e),i,this.Kf,()=>this.up(),o=>o(),void 0,r),i]}hp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.rp&&this.cp===e||((n=this.rp)===null||n===void 0||n.reset(),this.cp=e,[this.rp,this.dp]=this.ap(()=>this.al,r=>{this.al=r})),this.rp}vp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.op&&this.fp===e||((n=this.op)===null||n===void 0||n.reset(),this.fp=e,[this.op,this.pp]=this.ap(()=>this.Xf,r=>{this.Xf=r},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ck)),this.op}setup(t){var e;if(this.Io)return;this.wo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.Zf=!0),(this.Zf||this.gp()&&this.mp())&&this.yp();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Io?r.dispose():(this.Po=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r;this.Io||(this.Io=!0,this.bp(),(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this.wo=void 0,this.Jf=!1,J==null||J.removeEventListener("online",this.sp),(e=this._p)===null||e===void 0||e.call(this),this._p=void 0,(n=this.rp)===null||n===void 0||n.reset(),(r=this.op)===null||r===void 0||r.reset())}onRemoteConfig(t){var e,n;if(this.Io)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;et(r)?this.wp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!r}),r?(this.Zf=!0,this.Qf||this.yp(),this.loadIfEnabled()):this.wp())}reset(){var t,e,n,r;this.bp(),(t=this.rp)===null||t===void 0||t.clearQueue(),this.al=[],(e=this.rp)===null||e===void 0||e.reset(),(n=this.op)===null||n===void 0||n.clearQueue(),this.Xf=[],(r=this.op)===null||r===void 0||r.reset(),this.hd=0}captureLog(t){this.Io||this.hp().captureLog(t)}captureConsoleLog(t){this.Io||this.vp().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.Io||this.vp().captureLog(t,{context:e,occurredAtMs:n})}mp(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[b5])}gp(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.nl)===null||e===void 0)&&e.call(t))||!!(!((n=je._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}$h(){var t;this.bp(),(t=this.op)===null||t===void 0||t.clearQueue(),this.Xf=[]}wp(){this.Zf||this.bp()}yp(){var t;if(this.ep||!(je!=null&&je.console))return;const e=lk((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.tp.push(()=>{n=!1});for(const r of NF){let s;try{s=DF(je.console[r])}catch{continue}s&&this.tp.push(sh(je.console,r,i=>{const o=(...l)=>{try{n&&this.kp(r,l,e)}catch{}return i.apply(je.console,l)};return o.__rrweb_original__=s,o}))}this.ep=!0,this.Sp=setTimeout(()=>{this.bp()},3e4)}kp(t,e,n){var r;if(this.ep&&!this.np&&e.length!==0)if(!((r=this._instance)===null||r===void 0)&&r.is_capturing()){if(n>this.Yf.length){this.np=!0;try{this.Yf.push({level:t,args:e,occurredAtMs:Date.now(),context:this.up()})}finally{this.np=!1}}}else this.bp()}bp(){if(this.Yf=[],this.ep){this.ep=!1,this.Sp&&(clearTimeout(this.Sp),this.Sp=void 0);for(const t of this.tp)t();this.tp=[]}}xp(){const t=this.Yf;return this.bp(),t}get logger(){return this.Cp||(this.Cp={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Cp}flushLogs(t){t?this.$p(t):(this.rp&&this.rp.flush().catch(e=>this.Tp(e)),this.op&&this.op.flush().catch(e=>this.Tp(e)))}Tp(t){uk(t)||this.$.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Io||!this.Zf||this.Qf||this.Jf)return;const t=je==null?void 0:je.__PosthogExtensions__;if(!t)return this.$.error("PostHog Extensions not found."),void this.bp();const e=t.loadExternalDependency;if(!e)return this.$.error(rw),void this.bp();this.Jf=!0;try{e(this._instance,"logs",n=>{if(this.Jf=!1,this.Io||!this.Zf)return;const r=t.logs;if(n||!(r!=null&&r.initializeLogs))this.$.error("Could not load logs script",n),this.bp();else{var s;const l=this.xp();var i,o;this._p=r.initializeLogs((s=this.wo)!==null&&s!==void 0?s:this._instance),this.Qf=!0,l.length>0&&((i=r.replayConsoleBuffer)===null||i===void 0||i.call(r,(o=this.wo)!==null&&o!==void 0?o:this._instance,l))}})}catch(n){throw this.Jf=!1,n}}lp(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Ti.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Ti.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},js:r=>this.js(r),getLibraryId:()=>Bn.LIB_NAME,getLibraryVersion:()=>Bn.LIB_VERSION}}js(t){return new Promise(e=>{if(X5(this.hd,3))return void e({kind:"fatal",error:my(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:my(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Ip(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{const o=i.statusCode;if(this.Mp(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var l;o===0?(i.error||this.$.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:my(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=i.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${o}`)})}}})})}Mp(t){(t!==0||this._instance.__loaded)&&(this.hd=Q5(t,this.hd,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}$p(t){this.al.length>0&&this.Ep(t,this.al,this.dp,Bn.LIB_NAME,e=>{this.al=e}),this.Xf.length>0&&this.Ep(t,this.Xf,this.pp,ck,e=>{this.Xf=e})}Ep(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=m5(i,p5(n,Bn.LIB_NAME,Bn.LIB_VERSION),r,Bn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ip(),data:o,compression:"best-available",batchKey:"logs",transport:t})}Ip(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}up(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:r,sessionStartTimestamp:s,lastActivityTimestamp:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=r,et(s)||(e.sessionStartTimestamp=s),et(i)||(e.lastActivityTimestamp=i)}if(!(je==null||(t=je.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ja(je.location.href):je.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},QF={metrics:class{constructor(t){this._instance=t,this.$=dn("[metrics]"),this.Io=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Io)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Pp?this.Pp=(n=>{let r=!0;const s=()=>r?(l=>{var u;const d=(u=l.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=FF(n,s),o=VF(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Pp&&(this.Pp(),this.Pp=void 0)}hp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.rp&&this.cp===e||((n=this.rp)===null||n===void 0||n.reset(),this.cp=e,this.rp=new I$(this.lp(),(function(r){var s,i,o,l,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(e),this.$)),this.rp}count(t,e=1,n){this.hp().count(t,e,n)}gauge(t,e,n){this.hp().gauge(t,e,n)}histogram(t,e,n){this.hp().histogram(t,e,n)}flush(t){if(!this.rp)return Promise.resolve();if(t){const e=this.rp.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.rp.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.rp)===null||t===void 0||t.reset()}dispose(){var t,e;this.Io=!0,(t=this.Pp)===null||t===void 0||t.call(this),this.Pp=void 0,(e=this.rp)===null||e===void 0||e.reset()}lp(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>Bn.LIB_NAME,getLibraryVersion:()=>Bn.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(V(V({method:"POST",url:this.Rp(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${l}`)})}}}))})}Rp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};$f.__defaultExtensionClasses=V({},V(V(V(V(V(V(V(V(V(V(V(V(V({},kg),HF),zF),BF),UF),ZF),qF),WF),GF),KF),YF),XF),QF));const JF=(function(){Bn.SDK_DIST_CHANNEL="npm";const t=Nf[_f]=new $f;return(function(){function e(){e.done||(e.done=!0,SR=!1,Rt(Nf,function(n){n._dom_loaded()}))}ue!=null&&ue.addEventListener?ue.readyState==="complete"?e():St(ue,"DOMContentLoaded",e,{capture:!1}):J&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ee=JF,eV=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var tV=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},h0,dk="__POSTHOG_REACT_SHARED_STATE__",fk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},ih;try{ih=fk[dk]=fk[dk]||new WeakMap}catch{ih=new WeakMap}ih.has(m.createContext)||ih.set(m.createContext,{});var ec=ih.get(m.createContext),u2;function nV(t){(!ec.defaultPostHogInstance||ec.defaultPostHogInstance===u2)&&(ec.defaultPostHogInstance=t),u2=t}function d2(){return u2}ec.context||(ec.context=m.createContext({get client(){return d2()||ec.defaultPostHogInstance},bootstrap:void 0}));var hw=ec.context;function $R(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!$R(t[l],e[l],n))return!1}return!0}function rV(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=m.useRef(null),u=m.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=d2();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(o)]);return m.useEffect(function(){if(!(s||!i)){var d=d2(),f=l.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!$R(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),_e.createElement(hw.Provider,{value:{client:u,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var gy=function(t){return typeof t=="function"},sV=function(t){return t===void 0},Vo=function(){var t=m.useContext(hw).client;return t},W0=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},iV=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},oV=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!W0(r.cause)){sV(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},aV=function(t,e){if(!e)return t;var n=new Error(W0(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return iV(n,"React ErrorBoundary ".concat(W0(t)?t.name:"Error")),n.stack=e,W0(t)?(oV(t,n),t):n},hk={componentStack:null,exceptionEvent:null,error:null},lV={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},cV=(h0=(function(t){eV(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(hk)},r.state=hk,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;gy(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(aV(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return gy(r)?r():r;var o=gy(s)?_e.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return _e.isValidElement(o)?o:(console.warn(lV.INVALID_FALLBACK),_e.createElement(_e.Fragment,null))},e})(_e.Component),tV(h0,"PostHogErrorBoundary"),(function(){h0.contextType=hw})(),h0);nV(Ee);const pk="rivet_library_token";let jf="";const uV=()=>`Bearer ${jf}`,dV=()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)).get("token");if(t){jf=t;try{window.sessionStorage.setItem(pk,t)}catch{}window.history.replaceState(null,"",window.location.pathname+window.location.search)}else try{jf=window.sessionStorage.getItem(pk)??""}catch{jf=""}},Eie=async(t,e={})=>{const n=await fetch(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{Authorization:`Bearer ${jf}`,"Content-Type":"application/json"},...e.body!==void 0?{body:JSON.stringify(e.body)}:{}}),r=await n.text();let s;try{s=JSON.parse(r)}catch{s={error:r}}if(!n.ok){if(n.status===401)throw new Error("Run rivet open to reconnect to this library.");const i=s&&typeof s=="object"&&"error"in s?String(s.error):`Request failed (${n.status})`;throw new Error(i)}return s};var p0={},vy={exports:{}},Zr={},yy={exports:{}},_y={};/**
20
+ * @license React
21
+ * scheduler.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var mk;function fV(){return mk||(mk=1,(function(t){function e(z,ee){var W=z.length;z.push(ee);e:for(;0<W;){var N=W-1>>>1,X=z[N];if(0<s(X,ee))z[N]=ee,z[W]=X,W=N;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var ee=z[0],W=z.pop();if(W!==ee){z[0]=W;e:for(var N=0,X=z.length,ie=X>>>1;N<ie;){var ne=2*(N+1)-1,oe=z[ne],fe=ne+1,xe=z[fe];if(0>s(oe,W))fe<X&&0>s(xe,oe)?(z[N]=xe,z[fe]=W,N=fe):(z[N]=oe,z[ne]=W,N=ne);else if(fe<X&&0>s(xe,W))z[N]=xe,z[fe]=W,N=fe;else break e}}return ee}function s(z,ee){var W=z.sortIndex-ee.sortIndex;return W!==0?W:z.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],f=1,p=null,g=3,v=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(z){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=z)r(d),ee.sortIndex=ee.expirationTime,e(u,ee);else break;ee=n(d)}}function R(z){if(_=!1,C(z),!w)if(n(u)!==null)w=!0,Z(A);else{var ee=n(d);ee!==null&&Q(R,ee.startTime-z)}}function A(z,ee){w=!1,_&&(_=!1,b(T),T=-1),v=!0;var W=g;try{for(C(ee),p=n(u);p!==null&&(!(p.expirationTime>ee)||z&&!B());){var N=p.callback;if(typeof N=="function"){p.callback=null,g=p.priorityLevel;var X=N(p.expirationTime<=ee);ee=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(u)&&r(u),C(ee)}else r(u);p=n(u)}if(p!==null)var ie=!0;else{var ne=n(d);ne!==null&&Q(R,ne.startTime-ee),ie=!1}return ie}finally{p=null,g=W,v=!1}}var M=!1,I=null,T=-1,L=5,D=-1;function B(){return!(t.unstable_now()-D<L)}function j(){if(I!==null){var z=t.unstable_now();D=z;var ee=!0;try{ee=I(!0,z)}finally{ee?K():(M=!1,I=null)}}else M=!1}var K;if(typeof E=="function")K=function(){E(j)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=j,K=function(){H.postMessage(null)}}else K=function(){x(j,0)};function Z(z){I=z,M||(M=!0,K())}function Q(z,ee){T=x(function(){z(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){w||v||(w=!0,Z(A))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(z){switch(g){case 1:case 2:case 3:var ee=3;break;default:ee=g}var W=g;g=ee;try{return z()}finally{g=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,ee){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var W=g;g=z;try{return ee()}finally{g=W}},t.unstable_scheduleCallback=function(z,ee,W){var N=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?N+W:N):W=N,z){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=W+X,z={id:f++,callback:ee,priorityLevel:z,startTime:W,expirationTime:X,sortIndex:-1},W>N?(z.sortIndex=W,e(d,z),n(u)===null&&z===n(d)&&(_?(b(T),T=-1):_=!0,Q(R,W-N))):(z.sortIndex=X,e(u,z),w||v||(w=!0,Z(A))),z},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(z){var ee=g;return function(){var W=g;g=ee;try{return z.apply(this,arguments)}finally{g=W}}}})(_y)),_y}var gk;function hV(){return gk||(gk=1,yy.exports=fV()),yy.exports}/**
28
+ * @license React
29
+ * react-dom.production.min.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var vk;function pV(){if(vk)return Zr;vk=1;var t=Hx(),e=hV();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function g(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function v(a,c,h,y){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function w(a,c,h,y){if(c===null||typeof c>"u"||v(a,c,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,h,y,k,P,O){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=k,this.mustUseProperty=h,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=O}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){x[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];x[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){x[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){x[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){x[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){x[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){x[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){x[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){x[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function E(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(b,E);x[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(b,E);x[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(b,E);x[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,h,y){var k=x.hasOwnProperty(c)?x[c]:null;(k!==null?k.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(w(c,h,k,y)&&(h=null),y||k===null?g(c)&&(h===null?a.removeAttribute(c):a.setAttribute(c,""+h)):k.mustUseProperty?a[k.propertyName]=h===null?k.type===3?!1:"":h:(c=k.attributeName,y=k.attributeNamespace,h===null?a.removeAttribute(c):(k=k.type,h=k===3||k===4&&h===!0?"":""+h,y?a.setAttributeNS(y,c,h):a.setAttribute(c,h))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),M=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),B=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),z=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=z&&a[z]||a["@@iterator"],typeof a=="function"?a:null)}var W=Object.assign,N;function X(a){if(N===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);N=c&&c[1]||""}return`
36
+ `+N+a}var ie=!1;function ne(a,c){if(!a||ie)return"";ie=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(se){var y=se}Reflect.construct(a,[],c)}else{try{c.call()}catch(se){y=se}a.call(c.prototype)}else{try{throw Error()}catch(se){y=se}a()}}catch(se){if(se&&y&&typeof se.stack=="string"){for(var k=se.stack.split(`
37
+ `),P=y.stack.split(`
38
+ `),O=k.length-1,F=P.length-1;1<=O&&0<=F&&k[O]!==P[F];)F--;for(;1<=O&&0<=F;O--,F--)if(k[O]!==P[F]){if(O!==1||F!==1)do if(O--,F--,0>F||k[O]!==P[F]){var G=`
39
+ `+k[O].replace(" at new "," at ");return a.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",a.displayName)),G}while(1<=O&&0<=F);break}}}finally{ie=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?X(a):""}function oe(a){switch(a.tag){case 5:return X(a.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return a=ne(a.type,!1),a;case 11:return a=ne(a.type.render,!1),a;case 1:return a=ne(a.type,!0),a;default:return""}}function fe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case M:return"Portal";case L:return"Profiler";case T:return"StrictMode";case K:return"Suspense";case U:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case B:return(a.displayName||"Context")+".Consumer";case D:return(a._context.displayName||"Context")+".Provider";case j:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case H:return c=a.displayName||null,c!==null?c:fe(a.type)||"Memo";case Z:c=a._payload,a=a._init;try{return fe(a(c))}catch{}}return null}function xe(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(c);case 8:return c===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function de(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ae(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Oe(a){var c=ae(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var k=h.get,P=h.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return k.call(this)},set:function(O){y=""+O,P.call(this,O)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(O){y=""+O},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Ce(a){a._valueTracker||(a._valueTracker=Oe(a))}function Ge(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return a&&(y=ae(a)?a.checked?"true":"false":a.value),a=y,a!==h?(c.setValue(a),!0):!1}function dt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Lt(a,c){var h=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function Kt(a,c){var h=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;h=de(c.value!=null?c.value:h),a._wrapperState={initialChecked:y,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function _t(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function ht(a,c){_t(a,c);var h=de(c.value),y=c.type;if(h!=null)y==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?kt(a,c.type,h):c.hasOwnProperty("defaultValue")&&kt(a,c.type,de(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function En(a,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,h||c===a.value||(a.value=c),a.defaultValue=c}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function kt(a,c,h){(c!=="number"||dt(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var Yt=Array.isArray;function Le(a,c,h,y){if(a=a.options,c){c={};for(var k=0;k<h.length;k++)c["$"+h[k]]=!0;for(h=0;h<a.length;h++)k=c.hasOwnProperty("$"+a[h].value),a[h].selected!==k&&(a[h].selected=k),k&&y&&(a[h].defaultSelected=!0)}else{for(h=""+de(h),c=null,k=0;k<a.length;k++){if(a[k].value===h){a[k].selected=!0,y&&(a[k].defaultSelected=!0);return}c!==null||a[k].disabled||(c=a[k])}c!==null&&(c.selected=!0)}}function rt(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Be(a,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(n(92));if(Yt(h)){if(1<h.length)throw Error(n(93));h=h[0]}c=h}c==null&&(c=""),h=c}a._wrapperState={initialValue:de(h)}}function Me(a,c){var h=de(c.value),y=de(c.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),c.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),y!=null&&(a.defaultValue=""+y)}function pt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function An(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $t(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?An(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Pe,Jn=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,y,k){MSApp.execUnsafeLocalFunction(function(){return a(c,h,y,k)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Pe=Pe||document.createElement("div"),Pe.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Pe.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Xt(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var Tn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rl=["Webkit","ms","Moz","O"];Object.keys(Tn).forEach(function(a){rl.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Tn[c]=Tn[a]})});function gn(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||Tn.hasOwnProperty(a)&&Tn[a]?(""+c).trim():c+"px"}function vn(a,c){a=a.style;for(var h in c)if(c.hasOwnProperty(h)){var y=h.indexOf("--")===0,k=gn(h,c[h],y);h==="float"&&(h="cssFloat"),y?a.setProperty(h,k):a[h]=k}}var gd=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rs(a,c){if(c){if(gd[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function yr(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var er=null;function Xi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ks=null,Dn=null,As=null;function sl(a){if(a=Fd(a)){if(typeof Ks!="function")throw Error(n(280));var c=a.stateNode;c&&(c=yp(c),Ks(a.stateNode,a.type,c))}}function Qi(a){Dn?As?As.push(a):As=[a]:Dn=a}function ss(){if(Dn){var a=Dn,c=As;if(As=Dn=null,sl(a),c)for(a=0;a<c.length;a++)sl(c[a])}}function Ke(a,c){return a(c)}function Tt(){}var jt=!1;function Zn(a,c,h){if(jt)return a(c,h);jt=!0;try{return Ke(a,c,h)}finally{jt=!1,(Dn!==null||As!==null)&&(Tt(),ss())}}function is(a,c){var h=a.stateNode;if(h===null)return null;var y=yp(h);if(y===null)return null;h=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(n(231,c,typeof h));return h}var zt=!1;if(l)try{var $n={};Object.defineProperty($n,"passive",{get:function(){zt=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{zt=!1}function Fr(a,c,h,y,k,P,O,F,G){var se=Array.prototype.slice.call(arguments,3);try{c.apply(h,se)}catch(ge){this.onError(ge)}}var Ys=!1,cr=null,In=!1,il=null,gc={onError:function(a){Ys=!0,cr=a}};function vc(a,c,h,y,k,P,O,F,G){Ys=!1,cr=null,Fr.apply(gc,arguments)}function yc(a,c,h,y,k,P,O,F,G){if(vc.apply(this,arguments),Ys){if(Ys){var se=cr;Ys=!1,cr=null}else throw Error(n(198));In||(In=!0,il=se)}}function Ts(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function Ji(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function vd(a){if(Ts(a)!==a)throw Error(n(188))}function _c(a){var c=a.alternate;if(!c){if(c=Ts(a),c===null)throw Error(n(188));return c!==a?null:a}for(var h=a,y=c;;){var k=h.return;if(k===null)break;var P=k.alternate;if(P===null){if(y=k.return,y!==null){h=y;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===h)return vd(k),a;if(P===y)return vd(k),c;P=P.sibling}throw Error(n(188))}if(h.return!==y.return)h=k,y=P;else{for(var O=!1,F=k.child;F;){if(F===h){O=!0,h=k,y=P;break}if(F===y){O=!0,y=k,h=P;break}F=F.sibling}if(!O){for(F=P.child;F;){if(F===h){O=!0,h=P,y=k;break}if(F===y){O=!0,y=P,h=k;break}F=F.sibling}if(!O)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:c}function yd(a){return a=_c(a),a!==null?xc(a):null}function xc(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=xc(a);if(c!==null)return c;a=a.sibling}return null}var wc=e.unstable_scheduleCallback,Bo=e.unstable_cancelCallback,_d=e.unstable_shouldYield,Jg=e.unstable_requestPaint,Qt=e.unstable_now,ev=e.unstable_getCurrentPriorityLevel,xd=e.unstable_ImmediatePriority,Jh=e.unstable_UserBlockingPriority,Uo=e.unstable_NormalPriority,wd=e.unstable_LowPriority,bd=e.unstable_IdlePriority,bc=null,Is=null;function ep(a){if(Is&&typeof Is.onCommitFiberRoot=="function")try{Is.onCommitFiberRoot(bc,a,void 0,(a.current.flags&128)===128)}catch{}}var os=Math.clz32?Math.clz32:nv,tv=Math.log,Sd=Math.LN2;function nv(a){return a>>>=0,a===0?32:31-(tv(a)/Sd|0)|0}var Sc=64,kc=4194304;function ol(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ec(a,c){var h=a.pendingLanes;if(h===0)return 0;var y=0,k=a.suspendedLanes,P=a.pingedLanes,O=h&268435455;if(O!==0){var F=O&~k;F!==0?y=ol(F):(P&=O,P!==0&&(y=ol(P)))}else O=h&~k,O!==0?y=ol(O):P!==0&&(y=ol(P));if(y===0)return 0;if(c!==0&&c!==y&&(c&k)===0&&(k=y&-y,P=c&-c,k>=P||k===16&&(P&4194240)!==0))return c;if((y&4)!==0&&(y|=h&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)h=31-os(c),k=1<<h,y|=a[h],c&=~k;return y}function kd(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rv(a,c){for(var h=a.suspendedLanes,y=a.pingedLanes,k=a.expirationTimes,P=a.pendingLanes;0<P;){var O=31-os(P),F=1<<O,G=k[O];G===-1?((F&h)===0||(F&y)!==0)&&(k[O]=kd(F,c)):G<=c&&(a.expiredLanes|=F),P&=~F}}function Ed(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function tp(){var a=Sc;return Sc<<=1,(Sc&4194240)===0&&(Sc=64),a}function al(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function eo(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-os(c),a[c]=h}function np(a,c){var h=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<h;){var k=31-os(h),P=1<<k;c[k]=0,y[k]=-1,a[k]=-1,h&=~P}}function Cd(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var y=31-os(h),k=1<<y;k&c|a[y]&c&&(a[y]|=c),h&=~k}}var Dt=0;function to(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Pd,ll,rp,sp,ip,Cc=!1,Pc=[],Xs=null,as=null,Ms=null,Zo=new Map,Wo=new Map,Qs=[],op="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function $(a,c){switch(a){case"focusin":case"focusout":Xs=null;break;case"dragenter":case"dragleave":as=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Zo.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wo.delete(c.pointerId)}}function le(a,c,h,y,k,P){return a===null||a.nativeEvent!==P?(a={blockedOn:c,domEventName:h,eventSystemFlags:y,nativeEvent:P,targetContainers:[k]},c!==null&&(c=Fd(c),c!==null&&ll(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,k!==null&&c.indexOf(k)===-1&&c.push(k),a)}function ke(a,c,h,y,k){switch(c){case"focusin":return Xs=le(Xs,a,c,h,y,k),!0;case"dragenter":return as=le(as,a,c,h,y,k),!0;case"mouseover":return Ms=le(Ms,a,c,h,y,k),!0;case"pointerover":var P=k.pointerId;return Zo.set(P,le(Zo.get(P)||null,a,c,h,y,k)),!0;case"gotpointercapture":return P=k.pointerId,Wo.set(P,le(Wo.get(P)||null,a,c,h,y,k)),!0}return!1}function he(a){var c=cl(a.target);if(c!==null){var h=Ts(c);if(h!==null){if(c=h.tag,c===13){if(c=Ji(h),c!==null){a.blockedOn=c,ip(a.priority,function(){rp(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function pe(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=Js(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);er=y,h.target.dispatchEvent(y),er=null}else return c=Fd(h),c!==null&&ll(c),a.blockedOn=h,!1;c.shift()}return!0}function be(a,c,h){pe(a)&&h.delete(c)}function Ye(){Cc=!1,Xs!==null&&pe(Xs)&&(Xs=null),as!==null&&pe(as)&&(as=null),Ms!==null&&pe(Ms)&&(Ms=null),Zo.forEach(be),Wo.forEach(be)}function Re(a,c){a.blockedOn===c&&(a.blockedOn=null,Cc||(Cc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ye)))}function tn(a){function c(k){return Re(k,a)}if(0<Pc.length){Re(Pc[0],a);for(var h=1;h<Pc.length;h++){var y=Pc[h];y.blockedOn===a&&(y.blockedOn=null)}}for(Xs!==null&&Re(Xs,a),as!==null&&Re(as,a),Ms!==null&&Re(Ms,a),Zo.forEach(c),Wo.forEach(c),h=0;h<Qs.length;h++)y=Qs[h],y.blockedOn===a&&(y.blockedOn=null);for(;0<Qs.length&&(h=Qs[0],h.blockedOn===null);)he(h),h.blockedOn===null&&Qs.shift()}var yn=R.ReactCurrentBatchConfig,Pr=!0;function ls(a,c,h,y){var k=Dt,P=yn.transition;yn.transition=null;try{Dt=1,at(a,c,h,y)}finally{Dt=k,yn.transition=P}}function cs(a,c,h,y){var k=Dt,P=yn.transition;yn.transition=null;try{Dt=4,at(a,c,h,y)}finally{Dt=k,yn.transition=P}}function at(a,c,h,y){if(Pr){var k=Js(a,c,h,y);if(k===null)xv(a,c,y,Ft,h),$(a,y);else if(ke(k,a,c,h,y))y.stopPropagation();else if($(a,y),c&4&&-1<op.indexOf(a)){for(;k!==null;){var P=Fd(k);if(P!==null&&Pd(P),P=Js(a,c,h,y),P===null&&xv(a,c,y,Ft,h),P===k)break;k=P}k!==null&&y.stopPropagation()}else xv(a,c,y,null,h)}}var Ft=null;function Js(a,c,h,y){if(Ft=null,a=Xi(y),a=cl(a),a!==null)if(c=Ts(a),c===null)a=null;else if(h=c.tag,h===13){if(a=Ji(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Ft=a,null}function c4(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ev()){case xd:return 1;case Jh:return 4;case Uo:case wd:return 16;case bd:return 536870912;default:return 16}default:return 16}}var qo=null,sv=null,ap=null;function u4(){if(ap)return ap;var a,c=sv,h=c.length,y,k="value"in qo?qo.value:qo.textContent,P=k.length;for(a=0;a<h&&c[a]===k[a];a++);var O=h-a;for(y=1;y<=O&&c[h-y]===k[P-y];y++);return ap=k.slice(a,1<y?1-y:void 0)}function lp(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function cp(){return!0}function d4(){return!1}function us(a){function c(h,y,k,P,O){this._reactName=h,this._targetInst=k,this.type=y,this.nativeEvent=P,this.target=O,this.currentTarget=null;for(var F in a)a.hasOwnProperty(F)&&(h=a[F],this[F]=h?h(P):P[F]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?cp:d4,this.isPropagationStopped=d4,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=cp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=cp)},persist:function(){},isPersistent:cp}),c}var Rc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},iv=us(Rc),Rd=W({},Rc,{view:0,detail:0}),lN=us(Rd),ov,av,Ad,up=W({},Rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Ad&&(Ad&&a.type==="mousemove"?(ov=a.screenX-Ad.screenX,av=a.screenY-Ad.screenY):av=ov=0,Ad=a),ov)},movementY:function(a){return"movementY"in a?a.movementY:av}}),f4=us(up),cN=W({},up,{dataTransfer:0}),uN=us(cN),dN=W({},Rd,{relatedTarget:0}),lv=us(dN),fN=W({},Rc,{animationName:0,elapsedTime:0,pseudoElement:0}),hN=us(fN),pN=W({},Rc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),mN=us(pN),gN=W({},Rc,{data:0}),h4=us(gN),vN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_N={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xN(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=_N[a])?!!c[a]:!1}function cv(){return xN}var wN=W({},Rd,{key:function(a){if(a.key){var c=vN[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=lp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?yN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cv,charCode:function(a){return a.type==="keypress"?lp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?lp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),bN=us(wN),SN=W({},up,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),p4=us(SN),kN=W({},Rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cv}),EN=us(kN),CN=W({},Rc,{propertyName:0,elapsedTime:0,pseudoElement:0}),PN=us(CN),RN=W({},up,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),AN=us(RN),TN=[9,13,27,32],uv=l&&"CompositionEvent"in window,Td=null;l&&"documentMode"in document&&(Td=document.documentMode);var IN=l&&"TextEvent"in window&&!Td,m4=l&&(!uv||Td&&8<Td&&11>=Td),g4=" ",v4=!1;function y4(a,c){switch(a){case"keyup":return TN.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _4(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ac=!1;function MN(a,c){switch(a){case"compositionend":return _4(c);case"keypress":return c.which!==32?null:(v4=!0,g4);case"textInput":return a=c.data,a===g4&&v4?null:a;default:return null}}function ON(a,c){if(Ac)return a==="compositionend"||!uv&&y4(a,c)?(a=u4(),ap=sv=qo=null,Ac=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return m4&&c.locale!=="ko"?null:c.data;default:return null}}var LN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function x4(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!LN[a.type]:c==="textarea"}function w4(a,c,h,y){Qi(y),c=mp(c,"onChange"),0<c.length&&(h=new iv("onChange","change",null,h,y),a.push({event:h,listeners:c}))}var Id=null,Md=null;function NN(a){F4(a,0)}function dp(a){var c=Lc(a);if(Ge(c))return a}function DN(a,c){if(a==="change")return c}var b4=!1;if(l){var dv;if(l){var fv="oninput"in document;if(!fv){var S4=document.createElement("div");S4.setAttribute("oninput","return;"),fv=typeof S4.oninput=="function"}dv=fv}else dv=!1;b4=dv&&(!document.documentMode||9<document.documentMode)}function k4(){Id&&(Id.detachEvent("onpropertychange",E4),Md=Id=null)}function E4(a){if(a.propertyName==="value"&&dp(Md)){var c=[];w4(c,Md,a,Xi(a)),Zn(NN,c)}}function $N(a,c,h){a==="focusin"?(k4(),Id=c,Md=h,Id.attachEvent("onpropertychange",E4)):a==="focusout"&&k4()}function jN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return dp(Md)}function FN(a,c){if(a==="click")return dp(c)}function VN(a,c){if(a==="input"||a==="change")return dp(c)}function HN(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ei=typeof Object.is=="function"?Object.is:HN;function Od(a,c){if(ei(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),y=Object.keys(c);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var k=h[y];if(!u.call(c,k)||!ei(a[k],c[k]))return!1}return!0}function C4(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function P4(a,c){var h=C4(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=c&&y>=c)return{node:h,offset:c-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=C4(h)}}function R4(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?R4(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function A4(){for(var a=window,c=dt();c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=dt(a.document)}return c}function hv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function zN(a){var c=A4(),h=a.focusedElem,y=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&R4(h.ownerDocument.documentElement,h)){if(y!==null&&hv(h)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(a,h.value.length);else if(a=(c=h.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var k=h.textContent.length,P=Math.min(y.start,k);y=y.end===void 0?P:Math.min(y.end,k),!a.extend&&P>y&&(k=y,y=P,P=k),k=P4(h,P);var O=P4(h,y);k&&O&&(a.rangeCount!==1||a.anchorNode!==k.node||a.anchorOffset!==k.offset||a.focusNode!==O.node||a.focusOffset!==O.offset)&&(c=c.createRange(),c.setStart(k.node,k.offset),a.removeAllRanges(),P>y?(a.addRange(c),a.extend(O.node,O.offset)):(c.setEnd(O.node,O.offset),a.addRange(c)))}}for(c=[],a=h;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)a=c[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var BN=l&&"documentMode"in document&&11>=document.documentMode,Tc=null,pv=null,Ld=null,mv=!1;function T4(a,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;mv||Tc==null||Tc!==dt(y)||(y=Tc,"selectionStart"in y&&hv(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Ld&&Od(Ld,y)||(Ld=y,y=mp(pv,"onSelect"),0<y.length&&(c=new iv("onSelect","select",null,c,h),a.push({event:c,listeners:y}),c.target=Tc)))}function fp(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var Ic={animationend:fp("Animation","AnimationEnd"),animationiteration:fp("Animation","AnimationIteration"),animationstart:fp("Animation","AnimationStart"),transitionend:fp("Transition","TransitionEnd")},gv={},I4={};l&&(I4=document.createElement("div").style,"AnimationEvent"in window||(delete Ic.animationend.animation,delete Ic.animationiteration.animation,delete Ic.animationstart.animation),"TransitionEvent"in window||delete Ic.transitionend.transition);function hp(a){if(gv[a])return gv[a];if(!Ic[a])return a;var c=Ic[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in I4)return gv[a]=c[h];return a}var M4=hp("animationend"),O4=hp("animationiteration"),L4=hp("animationstart"),N4=hp("transitionend"),D4=new Map,$4="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Go(a,c){D4.set(a,c),i(c,[a])}for(var vv=0;vv<$4.length;vv++){var yv=$4[vv],UN=yv.toLowerCase(),ZN=yv[0].toUpperCase()+yv.slice(1);Go(UN,"on"+ZN)}Go(M4,"onAnimationEnd"),Go(O4,"onAnimationIteration"),Go(L4,"onAnimationStart"),Go("dblclick","onDoubleClick"),Go("focusin","onFocus"),Go("focusout","onBlur"),Go(N4,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),WN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nd));function j4(a,c,h){var y=a.type||"unknown-event";a.currentTarget=h,yc(y,c,void 0,a),a.currentTarget=null}function F4(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],k=y.event;y=y.listeners;e:{var P=void 0;if(c)for(var O=y.length-1;0<=O;O--){var F=y[O],G=F.instance,se=F.currentTarget;if(F=F.listener,G!==P&&k.isPropagationStopped())break e;j4(k,F,se),P=G}else for(O=0;O<y.length;O++){if(F=y[O],G=F.instance,se=F.currentTarget,F=F.listener,G!==P&&k.isPropagationStopped())break e;j4(k,F,se),P=G}}}if(In)throw a=il,In=!1,il=null,a}function nn(a,c){var h=c[Cv];h===void 0&&(h=c[Cv]=new Set);var y=a+"__bubble";h.has(y)||(V4(c,a,2,!1),h.add(y))}function _v(a,c,h){var y=0;c&&(y|=4),V4(h,a,y,c)}var pp="_reactListening"+Math.random().toString(36).slice(2);function Dd(a){if(!a[pp]){a[pp]=!0,r.forEach(function(h){h!=="selectionchange"&&(WN.has(h)||_v(h,!1,a),_v(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[pp]||(c[pp]=!0,_v("selectionchange",!1,c))}}function V4(a,c,h,y){switch(c4(c)){case 1:var k=ls;break;case 4:k=cs;break;default:k=at}h=k.bind(null,c,h,a),k=void 0,!zt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(k=!0),y?k!==void 0?a.addEventListener(c,h,{capture:!0,passive:k}):a.addEventListener(c,h,!0):k!==void 0?a.addEventListener(c,h,{passive:k}):a.addEventListener(c,h,!1)}function xv(a,c,h,y,k){var P=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var O=y.tag;if(O===3||O===4){var F=y.stateNode.containerInfo;if(F===k||F.nodeType===8&&F.parentNode===k)break;if(O===4)for(O=y.return;O!==null;){var G=O.tag;if((G===3||G===4)&&(G=O.stateNode.containerInfo,G===k||G.nodeType===8&&G.parentNode===k))return;O=O.return}for(;F!==null;){if(O=cl(F),O===null)return;if(G=O.tag,G===5||G===6){y=P=O;continue e}F=F.parentNode}}y=y.return}Zn(function(){var se=P,ge=Xi(h),ye=[];e:{var me=D4.get(a);if(me!==void 0){var Te=iv,Fe=a;switch(a){case"keypress":if(lp(h)===0)break e;case"keydown":case"keyup":Te=bN;break;case"focusin":Fe="focus",Te=lv;break;case"focusout":Fe="blur",Te=lv;break;case"beforeblur":case"afterblur":Te=lv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=f4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=uN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=EN;break;case M4:case O4:case L4:Te=hN;break;case N4:Te=PN;break;case"scroll":Te=lN;break;case"wheel":Te=AN;break;case"copy":case"cut":case"paste":Te=mN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=p4}var He=(c&4)!==0,Mn=!He&&a==="scroll",te=He?me!==null?me+"Capture":null:me;He=[];for(var Y=se,re;Y!==null;){re=Y;var we=re.stateNode;if(re.tag===5&&we!==null&&(re=we,te!==null&&(we=is(Y,te),we!=null&&He.push($d(Y,we,re)))),Mn)break;Y=Y.return}0<He.length&&(me=new Te(me,Fe,null,h,ge),ye.push({event:me,listeners:He}))}}if((c&7)===0){e:{if(me=a==="mouseover"||a==="pointerover",Te=a==="mouseout"||a==="pointerout",me&&h!==er&&(Fe=h.relatedTarget||h.fromElement)&&(cl(Fe)||Fe[no]))break e;if((Te||me)&&(me=ge.window===ge?ge:(me=ge.ownerDocument)?me.defaultView||me.parentWindow:window,Te?(Fe=h.relatedTarget||h.toElement,Te=se,Fe=Fe?cl(Fe):null,Fe!==null&&(Mn=Ts(Fe),Fe!==Mn||Fe.tag!==5&&Fe.tag!==6)&&(Fe=null)):(Te=null,Fe=se),Te!==Fe)){if(He=f4,we="onMouseLeave",te="onMouseEnter",Y="mouse",(a==="pointerout"||a==="pointerover")&&(He=p4,we="onPointerLeave",te="onPointerEnter",Y="pointer"),Mn=Te==null?me:Lc(Te),re=Fe==null?me:Lc(Fe),me=new He(we,Y+"leave",Te,h,ge),me.target=Mn,me.relatedTarget=re,we=null,cl(ge)===se&&(He=new He(te,Y+"enter",Fe,h,ge),He.target=re,He.relatedTarget=Mn,we=He),Mn=we,Te&&Fe)t:{for(He=Te,te=Fe,Y=0,re=He;re;re=Mc(re))Y++;for(re=0,we=te;we;we=Mc(we))re++;for(;0<Y-re;)He=Mc(He),Y--;for(;0<re-Y;)te=Mc(te),re--;for(;Y--;){if(He===te||te!==null&&He===te.alternate)break t;He=Mc(He),te=Mc(te)}He=null}else He=null;Te!==null&&H4(ye,me,Te,He,!1),Fe!==null&&Mn!==null&&H4(ye,Mn,Fe,He,!0)}}e:{if(me=se?Lc(se):window,Te=me.nodeName&&me.nodeName.toLowerCase(),Te==="select"||Te==="input"&&me.type==="file")var Ue=DN;else if(x4(me))if(b4)Ue=VN;else{Ue=jN;var Xe=$N}else(Te=me.nodeName)&&Te.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(Ue=FN);if(Ue&&(Ue=Ue(a,se))){w4(ye,Ue,h,ge);break e}Xe&&Xe(a,me,se),a==="focusout"&&(Xe=me._wrapperState)&&Xe.controlled&&me.type==="number"&&kt(me,"number",me.value)}switch(Xe=se?Lc(se):window,a){case"focusin":(x4(Xe)||Xe.contentEditable==="true")&&(Tc=Xe,pv=se,Ld=null);break;case"focusout":Ld=pv=Tc=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,T4(ye,h,ge);break;case"selectionchange":if(BN)break;case"keydown":case"keyup":T4(ye,h,ge)}var Qe;if(uv)e:{switch(a){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Ac?y4(a,h)&&(tt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(tt="onCompositionStart");tt&&(m4&&h.locale!=="ko"&&(Ac||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ac&&(Qe=u4()):(qo=ge,sv="value"in qo?qo.value:qo.textContent,Ac=!0)),Xe=mp(se,tt),0<Xe.length&&(tt=new h4(tt,a,null,h,ge),ye.push({event:tt,listeners:Xe}),Qe?tt.data=Qe:(Qe=_4(h),Qe!==null&&(tt.data=Qe)))),(Qe=IN?MN(a,h):ON(a,h))&&(se=mp(se,"onBeforeInput"),0<se.length&&(ge=new h4("onBeforeInput","beforeinput",null,h,ge),ye.push({event:ge,listeners:se}),ge.data=Qe))}F4(ye,c)})}function $d(a,c,h){return{instance:a,listener:c,currentTarget:h}}function mp(a,c){for(var h=c+"Capture",y=[];a!==null;){var k=a,P=k.stateNode;k.tag===5&&P!==null&&(k=P,P=is(a,h),P!=null&&y.unshift($d(a,P,k)),P=is(a,c),P!=null&&y.push($d(a,P,k))),a=a.return}return y}function Mc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function H4(a,c,h,y,k){for(var P=c._reactName,O=[];h!==null&&h!==y;){var F=h,G=F.alternate,se=F.stateNode;if(G!==null&&G===y)break;F.tag===5&&se!==null&&(F=se,k?(G=is(h,P),G!=null&&O.unshift($d(h,G,F))):k||(G=is(h,P),G!=null&&O.push($d(h,G,F)))),h=h.return}O.length!==0&&a.push({event:c,listeners:O})}var qN=/\r\n?/g,GN=/\u0000|\uFFFD/g;function z4(a){return(typeof a=="string"?a:""+a).replace(qN,`
40
+ `).replace(GN,"")}function gp(a,c,h){if(c=z4(c),z4(a)!==c&&h)throw Error(n(425))}function vp(){}var wv=null,bv=null;function Sv(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var kv=typeof setTimeout=="function"?setTimeout:void 0,KN=typeof clearTimeout=="function"?clearTimeout:void 0,B4=typeof Promise=="function"?Promise:void 0,YN=typeof queueMicrotask=="function"?queueMicrotask:typeof B4<"u"?function(a){return B4.resolve(null).then(a).catch(XN)}:kv;function XN(a){setTimeout(function(){throw a})}function Ev(a,c){var h=c,y=0;do{var k=h.nextSibling;if(a.removeChild(h),k&&k.nodeType===8)if(h=k.data,h==="/$"){if(y===0){a.removeChild(k),tn(c);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=k}while(h);tn(c)}function Ko(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function U4(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return a;c--}else h==="/$"&&c++}a=a.previousSibling}return null}var Oc=Math.random().toString(36).slice(2),xi="__reactFiber$"+Oc,jd="__reactProps$"+Oc,no="__reactContainer$"+Oc,Cv="__reactEvents$"+Oc,QN="__reactListeners$"+Oc,JN="__reactHandles$"+Oc;function cl(a){var c=a[xi];if(c)return c;for(var h=a.parentNode;h;){if(c=h[no]||h[xi]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=U4(a);a!==null;){if(h=a[xi])return h;a=U4(a)}return c}a=h,h=a.parentNode}return null}function Fd(a){return a=a[xi]||a[no],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Lc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function yp(a){return a[jd]||null}var Pv=[],Nc=-1;function Yo(a){return{current:a}}function rn(a){0>Nc||(a.current=Pv[Nc],Pv[Nc]=null,Nc--)}function Jt(a,c){Nc++,Pv[Nc]=a.current,a.current=c}var Xo={},_r=Yo(Xo),Vr=Yo(!1),ul=Xo;function Dc(a,c){var h=a.type.contextTypes;if(!h)return Xo;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in h)k[P]=c[P];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=k),k}function Hr(a){return a=a.childContextTypes,a!=null}function _p(){rn(Vr),rn(_r)}function Z4(a,c,h){if(_r.current!==Xo)throw Error(n(168));Jt(_r,c),Jt(Vr,h)}function W4(a,c,h){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var k in y)if(!(k in c))throw Error(n(108,xe(a)||"Unknown",k));return W({},h,y)}function xp(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Xo,ul=_r.current,Jt(_r,a),Jt(Vr,Vr.current),!0}function q4(a,c,h){var y=a.stateNode;if(!y)throw Error(n(169));h?(a=W4(a,c,ul),y.__reactInternalMemoizedMergedChildContext=a,rn(Vr),rn(_r),Jt(_r,a)):rn(Vr),Jt(Vr,h)}var ro=null,wp=!1,Rv=!1;function G4(a){ro===null?ro=[a]:ro.push(a)}function eD(a){wp=!0,G4(a)}function Qo(){if(!Rv&&ro!==null){Rv=!0;var a=0,c=Dt;try{var h=ro;for(Dt=1;a<h.length;a++){var y=h[a];do y=y(!0);while(y!==null)}ro=null,wp=!1}catch(k){throw ro!==null&&(ro=ro.slice(a+1)),wc(xd,Qo),k}finally{Dt=c,Rv=!1}}return null}var $c=[],jc=0,bp=null,Sp=0,Os=[],Ls=0,dl=null,so=1,io="";function fl(a,c){$c[jc++]=Sp,$c[jc++]=bp,bp=a,Sp=c}function K4(a,c,h){Os[Ls++]=so,Os[Ls++]=io,Os[Ls++]=dl,dl=a;var y=so;a=io;var k=32-os(y)-1;y&=~(1<<k),h+=1;var P=32-os(c)+k;if(30<P){var O=k-k%5;P=(y&(1<<O)-1).toString(32),y>>=O,k-=O,so=1<<32-os(c)+k|h<<k|y,io=P+a}else so=1<<P|h<<k|y,io=a}function Av(a){a.return!==null&&(fl(a,1),K4(a,1,0))}function Tv(a){for(;a===bp;)bp=$c[--jc],$c[jc]=null,Sp=$c[--jc],$c[jc]=null;for(;a===dl;)dl=Os[--Ls],Os[Ls]=null,io=Os[--Ls],Os[Ls]=null,so=Os[--Ls],Os[Ls]=null}var ds=null,fs=null,fn=!1,ti=null;function Y4(a,c){var h=js(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=a,c=a.deletions,c===null?(a.deletions=[h],a.flags|=16):c.push(h)}function X4(a,c){switch(a.tag){case 5:var h=a.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,ds=a,fs=Ko(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ds=a,fs=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=dl!==null?{id:so,overflow:io}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=js(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,ds=a,fs=null,!0):!1;default:return!1}}function Iv(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Mv(a){if(fn){var c=fs;if(c){var h=c;if(!X4(a,c)){if(Iv(a))throw Error(n(418));c=Ko(h.nextSibling);var y=ds;c&&X4(a,c)?Y4(y,h):(a.flags=a.flags&-4097|2,fn=!1,ds=a)}}else{if(Iv(a))throw Error(n(418));a.flags=a.flags&-4097|2,fn=!1,ds=a}}}function Q4(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ds=a}function kp(a){if(a!==ds)return!1;if(!fn)return Q4(a),fn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Sv(a.type,a.memoizedProps)),c&&(c=fs)){if(Iv(a))throw J4(),Error(n(418));for(;c;)Y4(a,c),c=Ko(c.nextSibling)}if(Q4(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(c===0){fs=Ko(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}fs=null}}else fs=ds?Ko(a.stateNode.nextSibling):null;return!0}function J4(){for(var a=fs;a;)a=Ko(a.nextSibling)}function Fc(){fs=ds=null,fn=!1}function Ov(a){ti===null?ti=[a]:ti.push(a)}var tD=R.ReactCurrentBatchConfig;function Vd(a,c,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,a));var k=y,P=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===P?c.ref:(c=function(O){var F=k.refs;O===null?delete F[P]:F[P]=O},c._stringRef=P,c)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function Ep(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function e6(a){var c=a._init;return c(a._payload)}function t6(a){function c(te,Y){if(a){var re=te.deletions;re===null?(te.deletions=[Y],te.flags|=16):re.push(Y)}}function h(te,Y){if(!a)return null;for(;Y!==null;)c(te,Y),Y=Y.sibling;return null}function y(te,Y){for(te=new Map;Y!==null;)Y.key!==null?te.set(Y.key,Y):te.set(Y.index,Y),Y=Y.sibling;return te}function k(te,Y){return te=oa(te,Y),te.index=0,te.sibling=null,te}function P(te,Y,re){return te.index=re,a?(re=te.alternate,re!==null?(re=re.index,re<Y?(te.flags|=2,Y):re):(te.flags|=2,Y)):(te.flags|=1048576,Y)}function O(te){return a&&te.alternate===null&&(te.flags|=2),te}function F(te,Y,re,we){return Y===null||Y.tag!==6?(Y=k1(re,te.mode,we),Y.return=te,Y):(Y=k(Y,re),Y.return=te,Y)}function G(te,Y,re,we){var Ue=re.type;return Ue===I?ge(te,Y,re.props.children,we,re.key):Y!==null&&(Y.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Z&&e6(Ue)===Y.type)?(we=k(Y,re.props),we.ref=Vd(te,Y,re),we.return=te,we):(we=Kp(re.type,re.key,re.props,null,te.mode,we),we.ref=Vd(te,Y,re),we.return=te,we)}function se(te,Y,re,we){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==re.containerInfo||Y.stateNode.implementation!==re.implementation?(Y=E1(re,te.mode,we),Y.return=te,Y):(Y=k(Y,re.children||[]),Y.return=te,Y)}function ge(te,Y,re,we,Ue){return Y===null||Y.tag!==7?(Y=xl(re,te.mode,we,Ue),Y.return=te,Y):(Y=k(Y,re),Y.return=te,Y)}function ye(te,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=k1(""+Y,te.mode,re),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case A:return re=Kp(Y.type,Y.key,Y.props,null,te.mode,re),re.ref=Vd(te,null,Y),re.return=te,re;case M:return Y=E1(Y,te.mode,re),Y.return=te,Y;case Z:var we=Y._init;return ye(te,we(Y._payload),re)}if(Yt(Y)||ee(Y))return Y=xl(Y,te.mode,re,null),Y.return=te,Y;Ep(te,Y)}return null}function me(te,Y,re,we){var Ue=Y!==null?Y.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ue!==null?null:F(te,Y,""+re,we);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case A:return re.key===Ue?G(te,Y,re,we):null;case M:return re.key===Ue?se(te,Y,re,we):null;case Z:return Ue=re._init,me(te,Y,Ue(re._payload),we)}if(Yt(re)||ee(re))return Ue!==null?null:ge(te,Y,re,we,null);Ep(te,re)}return null}function Te(te,Y,re,we,Ue){if(typeof we=="string"&&we!==""||typeof we=="number")return te=te.get(re)||null,F(Y,te,""+we,Ue);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case A:return te=te.get(we.key===null?re:we.key)||null,G(Y,te,we,Ue);case M:return te=te.get(we.key===null?re:we.key)||null,se(Y,te,we,Ue);case Z:var Xe=we._init;return Te(te,Y,re,Xe(we._payload),Ue)}if(Yt(we)||ee(we))return te=te.get(re)||null,ge(Y,te,we,Ue,null);Ep(Y,we)}return null}function Fe(te,Y,re,we){for(var Ue=null,Xe=null,Qe=Y,tt=Y=0,rr=null;Qe!==null&&tt<re.length;tt++){Qe.index>tt?(rr=Qe,Qe=null):rr=Qe.sibling;var It=me(te,Qe,re[tt],we);if(It===null){Qe===null&&(Qe=rr);break}a&&Qe&&It.alternate===null&&c(te,Qe),Y=P(It,Y,tt),Xe===null?Ue=It:Xe.sibling=It,Xe=It,Qe=rr}if(tt===re.length)return h(te,Qe),fn&&fl(te,tt),Ue;if(Qe===null){for(;tt<re.length;tt++)Qe=ye(te,re[tt],we),Qe!==null&&(Y=P(Qe,Y,tt),Xe===null?Ue=Qe:Xe.sibling=Qe,Xe=Qe);return fn&&fl(te,tt),Ue}for(Qe=y(te,Qe);tt<re.length;tt++)rr=Te(Qe,te,tt,re[tt],we),rr!==null&&(a&&rr.alternate!==null&&Qe.delete(rr.key===null?tt:rr.key),Y=P(rr,Y,tt),Xe===null?Ue=rr:Xe.sibling=rr,Xe=rr);return a&&Qe.forEach(function(aa){return c(te,aa)}),fn&&fl(te,tt),Ue}function He(te,Y,re,we){var Ue=ee(re);if(typeof Ue!="function")throw Error(n(150));if(re=Ue.call(re),re==null)throw Error(n(151));for(var Xe=Ue=null,Qe=Y,tt=Y=0,rr=null,It=re.next();Qe!==null&&!It.done;tt++,It=re.next()){Qe.index>tt?(rr=Qe,Qe=null):rr=Qe.sibling;var aa=me(te,Qe,It.value,we);if(aa===null){Qe===null&&(Qe=rr);break}a&&Qe&&aa.alternate===null&&c(te,Qe),Y=P(aa,Y,tt),Xe===null?Ue=aa:Xe.sibling=aa,Xe=aa,Qe=rr}if(It.done)return h(te,Qe),fn&&fl(te,tt),Ue;if(Qe===null){for(;!It.done;tt++,It=re.next())It=ye(te,It.value,we),It!==null&&(Y=P(It,Y,tt),Xe===null?Ue=It:Xe.sibling=It,Xe=It);return fn&&fl(te,tt),Ue}for(Qe=y(te,Qe);!It.done;tt++,It=re.next())It=Te(Qe,te,tt,It.value,we),It!==null&&(a&&It.alternate!==null&&Qe.delete(It.key===null?tt:It.key),Y=P(It,Y,tt),Xe===null?Ue=It:Xe.sibling=It,Xe=It);return a&&Qe.forEach(function(LD){return c(te,LD)}),fn&&fl(te,tt),Ue}function Mn(te,Y,re,we){if(typeof re=="object"&&re!==null&&re.type===I&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case A:e:{for(var Ue=re.key,Xe=Y;Xe!==null;){if(Xe.key===Ue){if(Ue=re.type,Ue===I){if(Xe.tag===7){h(te,Xe.sibling),Y=k(Xe,re.props.children),Y.return=te,te=Y;break e}}else if(Xe.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Z&&e6(Ue)===Xe.type){h(te,Xe.sibling),Y=k(Xe,re.props),Y.ref=Vd(te,Xe,re),Y.return=te,te=Y;break e}h(te,Xe);break}else c(te,Xe);Xe=Xe.sibling}re.type===I?(Y=xl(re.props.children,te.mode,we,re.key),Y.return=te,te=Y):(we=Kp(re.type,re.key,re.props,null,te.mode,we),we.ref=Vd(te,Y,re),we.return=te,te=we)}return O(te);case M:e:{for(Xe=re.key;Y!==null;){if(Y.key===Xe)if(Y.tag===4&&Y.stateNode.containerInfo===re.containerInfo&&Y.stateNode.implementation===re.implementation){h(te,Y.sibling),Y=k(Y,re.children||[]),Y.return=te,te=Y;break e}else{h(te,Y);break}else c(te,Y);Y=Y.sibling}Y=E1(re,te.mode,we),Y.return=te,te=Y}return O(te);case Z:return Xe=re._init,Mn(te,Y,Xe(re._payload),we)}if(Yt(re))return Fe(te,Y,re,we);if(ee(re))return He(te,Y,re,we);Ep(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Y!==null&&Y.tag===6?(h(te,Y.sibling),Y=k(Y,re),Y.return=te,te=Y):(h(te,Y),Y=k1(re,te.mode,we),Y.return=te,te=Y),O(te)):h(te,Y)}return Mn}var Vc=t6(!0),n6=t6(!1),Cp=Yo(null),Pp=null,Hc=null,Lv=null;function Nv(){Lv=Hc=Pp=null}function Dv(a){var c=Cp.current;rn(Cp),a._currentValue=c}function $v(a,c,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===h)break;a=a.return}}function zc(a,c){Pp=a,Lv=Hc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(zr=!0),a.firstContext=null)}function Ns(a){var c=a._currentValue;if(Lv!==a)if(a={context:a,memoizedValue:c,next:null},Hc===null){if(Pp===null)throw Error(n(308));Hc=a,Pp.dependencies={lanes:0,firstContext:a}}else Hc=Hc.next=a;return c}var hl=null;function jv(a){hl===null?hl=[a]:hl.push(a)}function r6(a,c,h,y){var k=c.interleaved;return k===null?(h.next=h,jv(c)):(h.next=k.next,k.next=h),c.interleaved=h,oo(a,y)}function oo(a,c){a.lanes|=c;var h=a.alternate;for(h!==null&&(h.lanes|=c),h=a,a=a.return;a!==null;)a.childLanes|=c,h=a.alternate,h!==null&&(h.childLanes|=c),h=a,a=a.return;return h.tag===3?h.stateNode:null}var Jo=!1;function Fv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s6(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ao(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function ea(a,c,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Et&2)!==0){var k=y.pending;return k===null?c.next=c:(c.next=k.next,k.next=c),y.pending=c,oo(a,h)}return k=y.interleaved,k===null?(c.next=c,jv(y)):(c.next=k.next,k.next=c),y.interleaved=c,oo(a,h)}function Rp(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Cd(a,h)}}function i6(a,c){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var k=null,P=null;if(h=h.firstBaseUpdate,h!==null){do{var O={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};P===null?k=P=O:P=P.next=O,h=h.next}while(h!==null);P===null?k=P=c:P=P.next=c}else k=P=c;h={baseState:y.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:y.shared,effects:y.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}function Ap(a,c,h,y){var k=a.updateQueue;Jo=!1;var P=k.firstBaseUpdate,O=k.lastBaseUpdate,F=k.shared.pending;if(F!==null){k.shared.pending=null;var G=F,se=G.next;G.next=null,O===null?P=se:O.next=se,O=G;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,F=ge.lastBaseUpdate,F!==O&&(F===null?ge.firstBaseUpdate=se:F.next=se,ge.lastBaseUpdate=G))}if(P!==null){var ye=k.baseState;O=0,ge=se=G=null,F=P;do{var me=F.lane,Te=F.eventTime;if((y&me)===me){ge!==null&&(ge=ge.next={eventTime:Te,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Fe=a,He=F;switch(me=c,Te=h,He.tag){case 1:if(Fe=He.payload,typeof Fe=="function"){ye=Fe.call(Te,ye,me);break e}ye=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=He.payload,me=typeof Fe=="function"?Fe.call(Te,ye,me):Fe,me==null)break e;ye=W({},ye,me);break e;case 2:Jo=!0}}F.callback!==null&&F.lane!==0&&(a.flags|=64,me=k.effects,me===null?k.effects=[F]:me.push(F))}else Te={eventTime:Te,lane:me,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ge===null?(se=ge=Te,G=ye):ge=ge.next=Te,O|=me;if(F=F.next,F===null){if(F=k.shared.pending,F===null)break;me=F,F=me.next,me.next=null,k.lastBaseUpdate=me,k.shared.pending=null}}while(!0);if(ge===null&&(G=ye),k.baseState=G,k.firstBaseUpdate=se,k.lastBaseUpdate=ge,c=k.shared.interleaved,c!==null){k=c;do O|=k.lane,k=k.next;while(k!==c)}else P===null&&(k.shared.lanes=0);gl|=O,a.lanes=O,a.memoizedState=ye}}function o6(a,c,h){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],k=y.callback;if(k!==null){if(y.callback=null,y=h,typeof k!="function")throw Error(n(191,k));k.call(y)}}}var Hd={},wi=Yo(Hd),zd=Yo(Hd),Bd=Yo(Hd);function pl(a){if(a===Hd)throw Error(n(174));return a}function Vv(a,c){switch(Jt(Bd,c),Jt(zd,a),Jt(wi,Hd),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:$t(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=$t(c,a)}rn(wi),Jt(wi,c)}function Bc(){rn(wi),rn(zd),rn(Bd)}function a6(a){pl(Bd.current);var c=pl(wi.current),h=$t(c,a.type);c!==h&&(Jt(zd,a),Jt(wi,h))}function Hv(a){zd.current===a&&(rn(wi),rn(zd))}var _n=Yo(0);function Tp(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var zv=[];function Bv(){for(var a=0;a<zv.length;a++)zv[a]._workInProgressVersionPrimary=null;zv.length=0}var Ip=R.ReactCurrentDispatcher,Uv=R.ReactCurrentBatchConfig,ml=0,xn=null,Wn=null,tr=null,Mp=!1,Ud=!1,Zd=0,nD=0;function xr(){throw Error(n(321))}function Zv(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!ei(a[h],c[h]))return!1;return!0}function Wv(a,c,h,y,k,P){if(ml=P,xn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Ip.current=a===null||a.memoizedState===null?oD:aD,a=h(y,k),Ud){P=0;do{if(Ud=!1,Zd=0,25<=P)throw Error(n(301));P+=1,tr=Wn=null,c.updateQueue=null,Ip.current=lD,a=h(y,k)}while(Ud)}if(Ip.current=Np,c=Wn!==null&&Wn.next!==null,ml=0,tr=Wn=xn=null,Mp=!1,c)throw Error(n(300));return a}function qv(){var a=Zd!==0;return Zd=0,a}function bi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tr===null?xn.memoizedState=tr=a:tr=tr.next=a,tr}function Ds(){if(Wn===null){var a=xn.alternate;a=a!==null?a.memoizedState:null}else a=Wn.next;var c=tr===null?xn.memoizedState:tr.next;if(c!==null)tr=c,Wn=a;else{if(a===null)throw Error(n(310));Wn=a,a={memoizedState:Wn.memoizedState,baseState:Wn.baseState,baseQueue:Wn.baseQueue,queue:Wn.queue,next:null},tr===null?xn.memoizedState=tr=a:tr=tr.next=a}return tr}function Wd(a,c){return typeof c=="function"?c(a):c}function Gv(a){var c=Ds(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=Wn,k=y.baseQueue,P=h.pending;if(P!==null){if(k!==null){var O=k.next;k.next=P.next,P.next=O}y.baseQueue=k=P,h.pending=null}if(k!==null){P=k.next,y=y.baseState;var F=O=null,G=null,se=P;do{var ge=se.lane;if((ml&ge)===ge)G!==null&&(G=G.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),y=se.hasEagerState?se.eagerState:a(y,se.action);else{var ye={lane:ge,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};G===null?(F=G=ye,O=y):G=G.next=ye,xn.lanes|=ge,gl|=ge}se=se.next}while(se!==null&&se!==P);G===null?O=y:G.next=F,ei(y,c.memoizedState)||(zr=!0),c.memoizedState=y,c.baseState=O,c.baseQueue=G,h.lastRenderedState=y}if(a=h.interleaved,a!==null){k=a;do P=k.lane,xn.lanes|=P,gl|=P,k=k.next;while(k!==a)}else k===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function Kv(a){var c=Ds(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=h.dispatch,k=h.pending,P=c.memoizedState;if(k!==null){h.pending=null;var O=k=k.next;do P=a(P,O.action),O=O.next;while(O!==k);ei(P,c.memoizedState)||(zr=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),h.lastRenderedState=P}return[P,y]}function l6(){}function c6(a,c){var h=xn,y=Ds(),k=c(),P=!ei(y.memoizedState,k);if(P&&(y.memoizedState=k,zr=!0),y=y.queue,Yv(f6.bind(null,h,y,a),[a]),y.getSnapshot!==c||P||tr!==null&&tr.memoizedState.tag&1){if(h.flags|=2048,qd(9,d6.bind(null,h,y,k,c),void 0,null),nr===null)throw Error(n(349));(ml&30)!==0||u6(h,c,k)}return k}function u6(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=xn.updateQueue,c===null?(c={lastEffect:null,stores:null},xn.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function d6(a,c,h,y){c.value=h,c.getSnapshot=y,h6(c)&&p6(a)}function f6(a,c,h){return h(function(){h6(c)&&p6(a)})}function h6(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!ei(a,h)}catch{return!0}}function p6(a){var c=oo(a,1);c!==null&&ii(c,a,1,-1)}function m6(a){var c=bi();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wd,lastRenderedState:a},c.queue=a,a=a.dispatch=iD.bind(null,xn,a),[c.memoizedState,a]}function qd(a,c,h,y){return a={tag:a,create:c,destroy:h,deps:y,next:null},c=xn.updateQueue,c===null?(c={lastEffect:null,stores:null},xn.updateQueue=c,c.lastEffect=a.next=a):(h=c.lastEffect,h===null?c.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,c.lastEffect=a)),a}function g6(){return Ds().memoizedState}function Op(a,c,h,y){var k=bi();xn.flags|=a,k.memoizedState=qd(1|c,h,void 0,y===void 0?null:y)}function Lp(a,c,h,y){var k=Ds();y=y===void 0?null:y;var P=void 0;if(Wn!==null){var O=Wn.memoizedState;if(P=O.destroy,y!==null&&Zv(y,O.deps)){k.memoizedState=qd(c,h,P,y);return}}xn.flags|=a,k.memoizedState=qd(1|c,h,P,y)}function v6(a,c){return Op(8390656,8,a,c)}function Yv(a,c){return Lp(2048,8,a,c)}function y6(a,c){return Lp(4,2,a,c)}function _6(a,c){return Lp(4,4,a,c)}function x6(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function w6(a,c,h){return h=h!=null?h.concat([a]):null,Lp(4,4,x6.bind(null,c,a),h)}function Xv(){}function b6(a,c){var h=Ds();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&Zv(c,y[1])?y[0]:(h.memoizedState=[a,c],a)}function S6(a,c){var h=Ds();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&Zv(c,y[1])?y[0]:(a=a(),h.memoizedState=[a,c],a)}function k6(a,c,h){return(ml&21)===0?(a.baseState&&(a.baseState=!1,zr=!0),a.memoizedState=h):(ei(h,c)||(h=tp(),xn.lanes|=h,gl|=h,a.baseState=!0),c)}function rD(a,c){var h=Dt;Dt=h!==0&&4>h?h:4,a(!0);var y=Uv.transition;Uv.transition={};try{a(!1),c()}finally{Dt=h,Uv.transition=y}}function E6(){return Ds().memoizedState}function sD(a,c,h){var y=sa(a);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},C6(a))P6(c,h);else if(h=r6(a,c,h,y),h!==null){var k=Ar();ii(h,a,y,k),R6(h,c,y)}}function iD(a,c,h){var y=sa(a),k={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(C6(a))P6(c,k);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var O=c.lastRenderedState,F=P(O,h);if(k.hasEagerState=!0,k.eagerState=F,ei(F,O)){var G=c.interleaved;G===null?(k.next=k,jv(c)):(k.next=G.next,G.next=k),c.interleaved=k;return}}catch{}finally{}h=r6(a,c,k,y),h!==null&&(k=Ar(),ii(h,a,y,k),R6(h,c,y))}}function C6(a){var c=a.alternate;return a===xn||c!==null&&c===xn}function P6(a,c){Ud=Mp=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function R6(a,c,h){if((h&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Cd(a,h)}}var Np={readContext:Ns,useCallback:xr,useContext:xr,useEffect:xr,useImperativeHandle:xr,useInsertionEffect:xr,useLayoutEffect:xr,useMemo:xr,useReducer:xr,useRef:xr,useState:xr,useDebugValue:xr,useDeferredValue:xr,useTransition:xr,useMutableSource:xr,useSyncExternalStore:xr,useId:xr,unstable_isNewReconciler:!1},oD={readContext:Ns,useCallback:function(a,c){return bi().memoizedState=[a,c===void 0?null:c],a},useContext:Ns,useEffect:v6,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,Op(4194308,4,x6.bind(null,c,a),h)},useLayoutEffect:function(a,c){return Op(4194308,4,a,c)},useInsertionEffect:function(a,c){return Op(4,2,a,c)},useMemo:function(a,c){var h=bi();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var y=bi();return c=h!==void 0?h(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=sD.bind(null,xn,a),[y.memoizedState,a]},useRef:function(a){var c=bi();return a={current:a},c.memoizedState=a},useState:m6,useDebugValue:Xv,useDeferredValue:function(a){return bi().memoizedState=a},useTransition:function(){var a=m6(!1),c=a[0];return a=rD.bind(null,a[1]),bi().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var y=xn,k=bi();if(fn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),nr===null)throw Error(n(349));(ml&30)!==0||u6(y,c,h)}k.memoizedState=h;var P={value:h,getSnapshot:c};return k.queue=P,v6(f6.bind(null,y,P,a),[a]),y.flags|=2048,qd(9,d6.bind(null,y,P,h,c),void 0,null),h},useId:function(){var a=bi(),c=nr.identifierPrefix;if(fn){var h=io,y=so;h=(y&~(1<<32-os(y)-1)).toString(32)+h,c=":"+c+"R"+h,h=Zd++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=nD++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},aD={readContext:Ns,useCallback:b6,useContext:Ns,useEffect:Yv,useImperativeHandle:w6,useInsertionEffect:y6,useLayoutEffect:_6,useMemo:S6,useReducer:Gv,useRef:g6,useState:function(){return Gv(Wd)},useDebugValue:Xv,useDeferredValue:function(a){var c=Ds();return k6(c,Wn.memoizedState,a)},useTransition:function(){var a=Gv(Wd)[0],c=Ds().memoizedState;return[a,c]},useMutableSource:l6,useSyncExternalStore:c6,useId:E6,unstable_isNewReconciler:!1},lD={readContext:Ns,useCallback:b6,useContext:Ns,useEffect:Yv,useImperativeHandle:w6,useInsertionEffect:y6,useLayoutEffect:_6,useMemo:S6,useReducer:Kv,useRef:g6,useState:function(){return Kv(Wd)},useDebugValue:Xv,useDeferredValue:function(a){var c=Ds();return Wn===null?c.memoizedState=a:k6(c,Wn.memoizedState,a)},useTransition:function(){var a=Kv(Wd)[0],c=Ds().memoizedState;return[a,c]},useMutableSource:l6,useSyncExternalStore:c6,useId:E6,unstable_isNewReconciler:!1};function ni(a,c){if(a&&a.defaultProps){c=W({},c),a=a.defaultProps;for(var h in a)c[h]===void 0&&(c[h]=a[h]);return c}return c}function Qv(a,c,h,y){c=a.memoizedState,h=h(y,c),h=h==null?c:W({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Dp={isMounted:function(a){return(a=a._reactInternals)?Ts(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var y=Ar(),k=sa(a),P=ao(y,k);P.payload=c,h!=null&&(P.callback=h),c=ea(a,P,k),c!==null&&(ii(c,a,k,y),Rp(c,a,k))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var y=Ar(),k=sa(a),P=ao(y,k);P.tag=1,P.payload=c,h!=null&&(P.callback=h),c=ea(a,P,k),c!==null&&(ii(c,a,k,y),Rp(c,a,k))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Ar(),y=sa(a),k=ao(h,y);k.tag=2,c!=null&&(k.callback=c),c=ea(a,k,y),c!==null&&(ii(c,a,y,h),Rp(c,a,y))}};function A6(a,c,h,y,k,P,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,P,O):c.prototype&&c.prototype.isPureReactComponent?!Od(h,y)||!Od(k,P):!0}function T6(a,c,h){var y=!1,k=Xo,P=c.contextType;return typeof P=="object"&&P!==null?P=Ns(P):(k=Hr(c)?ul:_r.current,y=c.contextTypes,P=(y=y!=null)?Dc(a,k):Xo),c=new c(h,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Dp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=k,a.__reactInternalMemoizedMaskedChildContext=P),c}function I6(a,c,h,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,y),c.state!==a&&Dp.enqueueReplaceState(c,c.state,null)}function Jv(a,c,h,y){var k=a.stateNode;k.props=h,k.state=a.memoizedState,k.refs={},Fv(a);var P=c.contextType;typeof P=="object"&&P!==null?k.context=Ns(P):(P=Hr(c)?ul:_r.current,k.context=Dc(a,P)),k.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(Qv(a,c,P,h),k.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(c=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),c!==k.state&&Dp.enqueueReplaceState(k,k.state,null),Ap(a,h,k,y),k.state=a.memoizedState),typeof k.componentDidMount=="function"&&(a.flags|=4194308)}function Uc(a,c){try{var h="",y=c;do h+=oe(y),y=y.return;while(y);var k=h}catch(P){k=`
41
+ Error generating stack: `+P.message+`
42
+ `+P.stack}return{value:a,source:c,stack:k,digest:null}}function e1(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function t1(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var cD=typeof WeakMap=="function"?WeakMap:Map;function M6(a,c,h){h=ao(-1,h),h.tag=3,h.payload={element:null};var y=c.value;return h.callback=function(){Bp||(Bp=!0,g1=y),t1(a,c)},h}function O6(a,c,h){h=ao(-1,h),h.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var k=c.value;h.payload=function(){return y(k)},h.callback=function(){t1(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(h.callback=function(){t1(a,c),typeof y!="function"&&(na===null?na=new Set([this]):na.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})}),h}function L6(a,c,h){var y=a.pingCache;if(y===null){y=a.pingCache=new cD;var k=new Set;y.set(c,k)}else k=y.get(c),k===void 0&&(k=new Set,y.set(c,k));k.has(h)||(k.add(h),a=SD.bind(null,a,c,h),c.then(a,a))}function N6(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function D6(a,c,h,y,k){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=ao(-1,1),c.tag=2,ea(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=k,a)}var uD=R.ReactCurrentOwner,zr=!1;function Rr(a,c,h,y){c.child=a===null?n6(c,null,h,y):Vc(c,a.child,h,y)}function $6(a,c,h,y,k){h=h.render;var P=c.ref;return zc(c,k),y=Wv(a,c,h,y,P,k),h=qv(),a!==null&&!zr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,lo(a,c,k)):(fn&&h&&Av(c),c.flags|=1,Rr(a,c,y,k),c.child)}function j6(a,c,h,y,k){if(a===null){var P=h.type;return typeof P=="function"&&!S1(P)&&P.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=P,F6(a,c,P,y,k)):(a=Kp(h.type,null,y,c,c.mode,k),a.ref=c.ref,a.return=c,c.child=a)}if(P=a.child,(a.lanes&k)===0){var O=P.memoizedProps;if(h=h.compare,h=h!==null?h:Od,h(O,y)&&a.ref===c.ref)return lo(a,c,k)}return c.flags|=1,a=oa(P,y),a.ref=c.ref,a.return=c,c.child=a}function F6(a,c,h,y,k){if(a!==null){var P=a.memoizedProps;if(Od(P,y)&&a.ref===c.ref)if(zr=!1,c.pendingProps=y=P,(a.lanes&k)!==0)(a.flags&131072)!==0&&(zr=!0);else return c.lanes=a.lanes,lo(a,c,k)}return n1(a,c,h,y,k)}function V6(a,c,h){var y=c.pendingProps,k=y.children,P=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Jt(Wc,hs),hs|=h;else{if((h&1073741824)===0)return a=P!==null?P.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Jt(Wc,hs),hs|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:h,Jt(Wc,hs),hs|=y}else P!==null?(y=P.baseLanes|h,c.memoizedState=null):y=h,Jt(Wc,hs),hs|=y;return Rr(a,c,k,h),c.child}function H6(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function n1(a,c,h,y,k){var P=Hr(h)?ul:_r.current;return P=Dc(c,P),zc(c,k),h=Wv(a,c,h,y,P,k),y=qv(),a!==null&&!zr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,lo(a,c,k)):(fn&&y&&Av(c),c.flags|=1,Rr(a,c,h,k),c.child)}function z6(a,c,h,y,k){if(Hr(h)){var P=!0;xp(c)}else P=!1;if(zc(c,k),c.stateNode===null)jp(a,c),T6(c,h,y),Jv(c,h,y,k),y=!0;else if(a===null){var O=c.stateNode,F=c.memoizedProps;O.props=F;var G=O.context,se=h.contextType;typeof se=="object"&&se!==null?se=Ns(se):(se=Hr(h)?ul:_r.current,se=Dc(c,se));var ge=h.getDerivedStateFromProps,ye=typeof ge=="function"||typeof O.getSnapshotBeforeUpdate=="function";ye||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==y||G!==se)&&I6(c,O,y,se),Jo=!1;var me=c.memoizedState;O.state=me,Ap(c,y,O,k),G=c.memoizedState,F!==y||me!==G||Vr.current||Jo?(typeof ge=="function"&&(Qv(c,h,ge,y),G=c.memoizedState),(F=Jo||A6(c,h,F,y,me,G,se))?(ye||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=G),O.props=y,O.state=G,O.context=se,y=F):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{O=c.stateNode,s6(a,c),F=c.memoizedProps,se=c.type===c.elementType?F:ni(c.type,F),O.props=se,ye=c.pendingProps,me=O.context,G=h.contextType,typeof G=="object"&&G!==null?G=Ns(G):(G=Hr(h)?ul:_r.current,G=Dc(c,G));var Te=h.getDerivedStateFromProps;(ge=typeof Te=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==ye||me!==G)&&I6(c,O,y,G),Jo=!1,me=c.memoizedState,O.state=me,Ap(c,y,O,k);var Fe=c.memoizedState;F!==ye||me!==Fe||Vr.current||Jo?(typeof Te=="function"&&(Qv(c,h,Te,y),Fe=c.memoizedState),(se=Jo||A6(c,h,se,y,me,Fe,G)||!1)?(ge||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(y,Fe,G),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(y,Fe,G)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Fe),O.props=y,O.state=Fe,O.context=G,y=se):(typeof O.componentDidUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),y=!1)}return r1(a,c,h,y,P,k)}function r1(a,c,h,y,k,P){H6(a,c);var O=(c.flags&128)!==0;if(!y&&!O)return k&&q4(c,h,!1),lo(a,c,P);y=c.stateNode,uD.current=c;var F=O&&typeof h.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&O?(c.child=Vc(c,a.child,null,P),c.child=Vc(c,null,F,P)):Rr(a,c,F,P),c.memoizedState=y.state,k&&q4(c,h,!0),c.child}function B6(a){var c=a.stateNode;c.pendingContext?Z4(a,c.pendingContext,c.pendingContext!==c.context):c.context&&Z4(a,c.context,!1),Vv(a,c.containerInfo)}function U6(a,c,h,y,k){return Fc(),Ov(k),c.flags|=256,Rr(a,c,h,y),c.child}var s1={dehydrated:null,treeContext:null,retryLane:0};function i1(a){return{baseLanes:a,cachePool:null,transitions:null}}function Z6(a,c,h){var y=c.pendingProps,k=_n.current,P=!1,O=(c.flags&128)!==0,F;if((F=O)||(F=a!==null&&a.memoizedState===null?!1:(k&2)!==0),F?(P=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(k|=1),Jt(_n,k&1),a===null)return Mv(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(O=y.children,a=y.fallback,P?(y=c.mode,P=c.child,O={mode:"hidden",children:O},(y&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=O):P=Yp(O,y,0,null),a=xl(a,y,h,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=i1(h),c.memoizedState=s1,a):o1(c,O));if(k=a.memoizedState,k!==null&&(F=k.dehydrated,F!==null))return dD(a,c,O,y,F,k,h);if(P){P=y.fallback,O=c.mode,k=a.child,F=k.sibling;var G={mode:"hidden",children:y.children};return(O&1)===0&&c.child!==k?(y=c.child,y.childLanes=0,y.pendingProps=G,c.deletions=null):(y=oa(k,G),y.subtreeFlags=k.subtreeFlags&14680064),F!==null?P=oa(F,P):(P=xl(P,O,h,null),P.flags|=2),P.return=c,y.return=c,y.sibling=P,c.child=y,y=P,P=c.child,O=a.child.memoizedState,O=O===null?i1(h):{baseLanes:O.baseLanes|h,cachePool:null,transitions:O.transitions},P.memoizedState=O,P.childLanes=a.childLanes&~h,c.memoizedState=s1,y}return P=a.child,a=P.sibling,y=oa(P,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=h),y.return=c,y.sibling=null,a!==null&&(h=c.deletions,h===null?(c.deletions=[a],c.flags|=16):h.push(a)),c.child=y,c.memoizedState=null,y}function o1(a,c){return c=Yp({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function $p(a,c,h,y){return y!==null&&Ov(y),Vc(c,a.child,null,h),a=o1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function dD(a,c,h,y,k,P,O){if(h)return c.flags&256?(c.flags&=-257,y=e1(Error(n(422))),$p(a,c,O,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=y.fallback,k=c.mode,y=Yp({mode:"visible",children:y.children},k,0,null),P=xl(P,k,O,null),P.flags|=2,y.return=c,P.return=c,y.sibling=P,c.child=y,(c.mode&1)!==0&&Vc(c,a.child,null,O),c.child.memoizedState=i1(O),c.memoizedState=s1,P);if((c.mode&1)===0)return $p(a,c,O,null);if(k.data==="$!"){if(y=k.nextSibling&&k.nextSibling.dataset,y)var F=y.dgst;return y=F,P=Error(n(419)),y=e1(P,y,void 0),$p(a,c,O,y)}if(F=(O&a.childLanes)!==0,zr||F){if(y=nr,y!==null){switch(O&-O){case 4:k=2;break;case 16:k=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(y.suspendedLanes|O))!==0?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,oo(a,k),ii(y,a,k,-1))}return b1(),y=e1(Error(n(421))),$p(a,c,O,y)}return k.data==="$?"?(c.flags|=128,c.child=a.child,c=kD.bind(null,a),k._reactRetry=c,null):(a=P.treeContext,fs=Ko(k.nextSibling),ds=c,fn=!0,ti=null,a!==null&&(Os[Ls++]=so,Os[Ls++]=io,Os[Ls++]=dl,so=a.id,io=a.overflow,dl=c),c=o1(c,y.children),c.flags|=4096,c)}function W6(a,c,h){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),$v(a.return,c,h)}function a1(a,c,h,y,k){var P=a.memoizedState;P===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:k}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=h,P.tailMode=k)}function q6(a,c,h){var y=c.pendingProps,k=y.revealOrder,P=y.tail;if(Rr(a,c,y.children,h),y=_n.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&W6(a,h,c);else if(a.tag===19)W6(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Jt(_n,y),(c.mode&1)===0)c.memoizedState=null;else switch(k){case"forwards":for(h=c.child,k=null;h!==null;)a=h.alternate,a!==null&&Tp(a)===null&&(k=h),h=h.sibling;h=k,h===null?(k=c.child,c.child=null):(k=h.sibling,h.sibling=null),a1(c,!1,k,h,P);break;case"backwards":for(h=null,k=c.child,c.child=null;k!==null;){if(a=k.alternate,a!==null&&Tp(a)===null){c.child=k;break}a=k.sibling,k.sibling=h,h=k,k=a}a1(c,!0,h,null,P);break;case"together":a1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function jp(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function lo(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),gl|=c.lanes,(h&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,h=oa(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=oa(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function fD(a,c,h){switch(c.tag){case 3:B6(c),Fc();break;case 5:a6(c);break;case 1:Hr(c.type)&&xp(c);break;case 4:Vv(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,k=c.memoizedProps.value;Jt(Cp,y._currentValue),y._currentValue=k;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Jt(_n,_n.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?Z6(a,c,h):(Jt(_n,_n.current&1),a=lo(a,c,h),a!==null?a.sibling:null);Jt(_n,_n.current&1);break;case 19:if(y=(h&c.childLanes)!==0,(a.flags&128)!==0){if(y)return q6(a,c,h);c.flags|=128}if(k=c.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Jt(_n,_n.current),y)break;return null;case 22:case 23:return c.lanes=0,V6(a,c,h)}return lo(a,c,h)}var G6,l1,K6,Y6;G6=function(a,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},l1=function(){},K6=function(a,c,h,y){var k=a.memoizedProps;if(k!==y){a=c.stateNode,pl(wi.current);var P=null;switch(h){case"input":k=Lt(a,k),y=Lt(a,y),P=[];break;case"select":k=W({},k,{value:void 0}),y=W({},y,{value:void 0}),P=[];break;case"textarea":k=rt(a,k),y=rt(a,y),P=[];break;default:typeof k.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=vp)}Rs(h,y);var O;h=null;for(se in k)if(!y.hasOwnProperty(se)&&k.hasOwnProperty(se)&&k[se]!=null)if(se==="style"){var F=k[se];for(O in F)F.hasOwnProperty(O)&&(h||(h={}),h[O]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(s.hasOwnProperty(se)?P||(P=[]):(P=P||[]).push(se,null));for(se in y){var G=y[se];if(F=k!=null?k[se]:void 0,y.hasOwnProperty(se)&&G!==F&&(G!=null||F!=null))if(se==="style")if(F){for(O in F)!F.hasOwnProperty(O)||G&&G.hasOwnProperty(O)||(h||(h={}),h[O]="");for(O in G)G.hasOwnProperty(O)&&F[O]!==G[O]&&(h||(h={}),h[O]=G[O])}else h||(P||(P=[]),P.push(se,h)),h=G;else se==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,F=F?F.__html:void 0,G!=null&&F!==G&&(P=P||[]).push(se,G)):se==="children"?typeof G!="string"&&typeof G!="number"||(P=P||[]).push(se,""+G):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(s.hasOwnProperty(se)?(G!=null&&se==="onScroll"&&nn("scroll",a),P||F===G||(P=[])):(P=P||[]).push(se,G))}h&&(P=P||[]).push("style",h);var se=P;(c.updateQueue=se)&&(c.flags|=4)}},Y6=function(a,c,h,y){h!==y&&(c.flags|=4)};function Gd(a,c){if(!fn)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function wr(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(c)for(var k=a.child;k!==null;)h|=k.lanes|k.childLanes,y|=k.subtreeFlags&14680064,y|=k.flags&14680064,k.return=a,k=k.sibling;else for(k=a.child;k!==null;)h|=k.lanes|k.childLanes,y|=k.subtreeFlags,y|=k.flags,k.return=a,k=k.sibling;return a.subtreeFlags|=y,a.childLanes=h,c}function hD(a,c,h){var y=c.pendingProps;switch(Tv(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wr(c),null;case 1:return Hr(c.type)&&_p(),wr(c),null;case 3:return y=c.stateNode,Bc(),rn(Vr),rn(_r),Bv(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(kp(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ti!==null&&(_1(ti),ti=null))),l1(a,c),wr(c),null;case 5:Hv(c);var k=pl(Bd.current);if(h=c.type,a!==null&&c.stateNode!=null)K6(a,c,h,y,k),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return wr(c),null}if(a=pl(wi.current),kp(c)){y=c.stateNode,h=c.type;var P=c.memoizedProps;switch(y[xi]=c,y[jd]=P,a=(c.mode&1)!==0,h){case"dialog":nn("cancel",y),nn("close",y);break;case"iframe":case"object":case"embed":nn("load",y);break;case"video":case"audio":for(k=0;k<Nd.length;k++)nn(Nd[k],y);break;case"source":nn("error",y);break;case"img":case"image":case"link":nn("error",y),nn("load",y);break;case"details":nn("toggle",y);break;case"input":Kt(y,P),nn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!P.multiple},nn("invalid",y);break;case"textarea":Be(y,P),nn("invalid",y)}Rs(h,P),k=null;for(var O in P)if(P.hasOwnProperty(O)){var F=P[O];O==="children"?typeof F=="string"?y.textContent!==F&&(P.suppressHydrationWarning!==!0&&gp(y.textContent,F,a),k=["children",F]):typeof F=="number"&&y.textContent!==""+F&&(P.suppressHydrationWarning!==!0&&gp(y.textContent,F,a),k=["children",""+F]):s.hasOwnProperty(O)&&F!=null&&O==="onScroll"&&nn("scroll",y)}switch(h){case"input":Ce(y),En(y,P,!0);break;case"textarea":Ce(y),pt(y);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(y.onclick=vp)}y=k,c.updateQueue=y,y!==null&&(c.flags|=4)}else{O=k.nodeType===9?k:k.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=An(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=O.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=O.createElement(h,{is:y.is}):(a=O.createElement(h),h==="select"&&(O=a,y.multiple?O.multiple=!0:y.size&&(O.size=y.size))):a=O.createElementNS(a,h),a[xi]=c,a[jd]=y,G6(a,c,!1,!1),c.stateNode=a;e:{switch(O=yr(h,y),h){case"dialog":nn("cancel",a),nn("close",a),k=y;break;case"iframe":case"object":case"embed":nn("load",a),k=y;break;case"video":case"audio":for(k=0;k<Nd.length;k++)nn(Nd[k],a);k=y;break;case"source":nn("error",a),k=y;break;case"img":case"image":case"link":nn("error",a),nn("load",a),k=y;break;case"details":nn("toggle",a),k=y;break;case"input":Kt(a,y),k=Lt(a,y),nn("invalid",a);break;case"option":k=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},k=W({},y,{value:void 0}),nn("invalid",a);break;case"textarea":Be(a,y),k=rt(a,y),nn("invalid",a);break;default:k=y}Rs(h,k),F=k;for(P in F)if(F.hasOwnProperty(P)){var G=F[P];P==="style"?vn(a,G):P==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&Jn(a,G)):P==="children"?typeof G=="string"?(h!=="textarea"||G!=="")&&Xt(a,G):typeof G=="number"&&Xt(a,""+G):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?G!=null&&P==="onScroll"&&nn("scroll",a):G!=null&&C(a,P,G,O))}switch(h){case"input":Ce(a),En(a,y,!1);break;case"textarea":Ce(a),pt(a);break;case"option":y.value!=null&&a.setAttribute("value",""+de(y.value));break;case"select":a.multiple=!!y.multiple,P=y.value,P!=null?Le(a,!!y.multiple,P,!1):y.defaultValue!=null&&Le(a,!!y.multiple,y.defaultValue,!0);break;default:typeof k.onClick=="function"&&(a.onclick=vp)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return wr(c),null;case 6:if(a&&c.stateNode!=null)Y6(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(h=pl(Bd.current),pl(wi.current),kp(c)){if(y=c.stateNode,h=c.memoizedProps,y[xi]=c,(P=y.nodeValue!==h)&&(a=ds,a!==null))switch(a.tag){case 3:gp(y.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&gp(y.nodeValue,h,(a.mode&1)!==0)}P&&(c.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[xi]=c,c.stateNode=y}return wr(c),null;case 13:if(rn(_n),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(fn&&fs!==null&&(c.mode&1)!==0&&(c.flags&128)===0)J4(),Fc(),c.flags|=98560,P=!1;else if(P=kp(c),y!==null&&y.dehydrated!==null){if(a===null){if(!P)throw Error(n(318));if(P=c.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[xi]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;wr(c),P=!1}else ti!==null&&(_1(ti),ti=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(_n.current&1)!==0?qn===0&&(qn=3):b1())),c.updateQueue!==null&&(c.flags|=4),wr(c),null);case 4:return Bc(),l1(a,c),a===null&&Dd(c.stateNode.containerInfo),wr(c),null;case 10:return Dv(c.type._context),wr(c),null;case 17:return Hr(c.type)&&_p(),wr(c),null;case 19:if(rn(_n),P=c.memoizedState,P===null)return wr(c),null;if(y=(c.flags&128)!==0,O=P.rendering,O===null)if(y)Gd(P,!1);else{if(qn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=Tp(a),O!==null){for(c.flags|=128,Gd(P,!1),y=O.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=h,h=c.child;h!==null;)P=h,a=y,P.flags&=14680066,O=P.alternate,O===null?(P.childLanes=0,P.lanes=a,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=O.childLanes,P.lanes=O.lanes,P.child=O.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=O.memoizedProps,P.memoizedState=O.memoizedState,P.updateQueue=O.updateQueue,P.type=O.type,a=O.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return Jt(_n,_n.current&1|2),c.child}a=a.sibling}P.tail!==null&&Qt()>qc&&(c.flags|=128,y=!0,Gd(P,!1),c.lanes=4194304)}else{if(!y)if(a=Tp(O),a!==null){if(c.flags|=128,y=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Gd(P,!0),P.tail===null&&P.tailMode==="hidden"&&!O.alternate&&!fn)return wr(c),null}else 2*Qt()-P.renderingStartTime>qc&&h!==1073741824&&(c.flags|=128,y=!0,Gd(P,!1),c.lanes=4194304);P.isBackwards?(O.sibling=c.child,c.child=O):(h=P.last,h!==null?h.sibling=O:c.child=O,P.last=O)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=Qt(),c.sibling=null,h=_n.current,Jt(_n,y?h&1|2:h&1),c):(wr(c),null);case 22:case 23:return w1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(hs&1073741824)!==0&&(wr(c),c.subtreeFlags&6&&(c.flags|=8192)):wr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function pD(a,c){switch(Tv(c),c.tag){case 1:return Hr(c.type)&&_p(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Bc(),rn(Vr),rn(_r),Bv(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Hv(c),null;case 13:if(rn(_n),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Fc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return rn(_n),null;case 4:return Bc(),null;case 10:return Dv(c.type._context),null;case 22:case 23:return w1(),null;case 24:return null;default:return null}}var Fp=!1,br=!1,mD=typeof WeakSet=="function"?WeakSet:Set,De=null;function Zc(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){Cn(a,c,y)}else h.current=null}function c1(a,c,h){try{h()}catch(y){Cn(a,c,y)}}var X6=!1;function gD(a,c){if(wv=Pr,a=A4(),hv(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var k=y.anchorOffset,P=y.focusNode;y=y.focusOffset;try{h.nodeType,P.nodeType}catch{h=null;break e}var O=0,F=-1,G=-1,se=0,ge=0,ye=a,me=null;t:for(;;){for(var Te;ye!==h||k!==0&&ye.nodeType!==3||(F=O+k),ye!==P||y!==0&&ye.nodeType!==3||(G=O+y),ye.nodeType===3&&(O+=ye.nodeValue.length),(Te=ye.firstChild)!==null;)me=ye,ye=Te;for(;;){if(ye===a)break t;if(me===h&&++se===k&&(F=O),me===P&&++ge===y&&(G=O),(Te=ye.nextSibling)!==null)break;ye=me,me=ye.parentNode}ye=Te}h=F===-1||G===-1?null:{start:F,end:G}}else h=null}h=h||{start:0,end:0}}else h=null;for(bv={focusedElem:a,selectionRange:h},Pr=!1,De=c;De!==null;)if(c=De,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,De=a;else for(;De!==null;){c=De;try{var Fe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Fe!==null){var He=Fe.memoizedProps,Mn=Fe.memoizedState,te=c.stateNode,Y=te.getSnapshotBeforeUpdate(c.elementType===c.type?He:ni(c.type,He),Mn);te.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var re=c.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(we){Cn(c,c.return,we)}if(a=c.sibling,a!==null){a.return=c.return,De=a;break}De=c.return}return Fe=X6,X6=!1,Fe}function Kd(a,c,h){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var k=y=y.next;do{if((k.tag&a)===a){var P=k.destroy;k.destroy=void 0,P!==void 0&&c1(c,h,P)}k=k.next}while(k!==y)}}function Vp(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&a)===a){var y=h.create;h.destroy=y()}h=h.next}while(h!==c)}}function u1(a){var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof c=="function"?c(a):c.current=a}}function Q6(a){var c=a.alternate;c!==null&&(a.alternate=null,Q6(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[xi],delete c[jd],delete c[Cv],delete c[QN],delete c[JN])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function J6(a){return a.tag===5||a.tag===3||a.tag===4}function eS(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||J6(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function d1(a,c,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(a,c):h.insertBefore(a,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(a,h)):(c=h,c.appendChild(a)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=vp));else if(y!==4&&(a=a.child,a!==null))for(d1(a,c,h),a=a.sibling;a!==null;)d1(a,c,h),a=a.sibling}function f1(a,c,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(f1(a,c,h),a=a.sibling;a!==null;)f1(a,c,h),a=a.sibling}var ur=null,ri=!1;function ta(a,c,h){for(h=h.child;h!==null;)tS(a,c,h),h=h.sibling}function tS(a,c,h){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount(bc,h)}catch{}switch(h.tag){case 5:br||Zc(h,c);case 6:var y=ur,k=ri;ur=null,ta(a,c,h),ur=y,ri=k,ur!==null&&(ri?(a=ur,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):ur.removeChild(h.stateNode));break;case 18:ur!==null&&(ri?(a=ur,h=h.stateNode,a.nodeType===8?Ev(a.parentNode,h):a.nodeType===1&&Ev(a,h),tn(a)):Ev(ur,h.stateNode));break;case 4:y=ur,k=ri,ur=h.stateNode.containerInfo,ri=!0,ta(a,c,h),ur=y,ri=k;break;case 0:case 11:case 14:case 15:if(!br&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){k=y=y.next;do{var P=k,O=P.destroy;P=P.tag,O!==void 0&&((P&2)!==0||(P&4)!==0)&&c1(h,c,O),k=k.next}while(k!==y)}ta(a,c,h);break;case 1:if(!br&&(Zc(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(F){Cn(h,c,F)}ta(a,c,h);break;case 21:ta(a,c,h);break;case 22:h.mode&1?(br=(y=br)||h.memoizedState!==null,ta(a,c,h),br=y):ta(a,c,h);break;default:ta(a,c,h)}}function nS(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new mD),c.forEach(function(y){var k=ED.bind(null,a,y);h.has(y)||(h.add(y),y.then(k,k))})}}function si(a,c){var h=c.deletions;if(h!==null)for(var y=0;y<h.length;y++){var k=h[y];try{var P=a,O=c,F=O;e:for(;F!==null;){switch(F.tag){case 5:ur=F.stateNode,ri=!1;break e;case 3:ur=F.stateNode.containerInfo,ri=!0;break e;case 4:ur=F.stateNode.containerInfo,ri=!0;break e}F=F.return}if(ur===null)throw Error(n(160));tS(P,O,k),ur=null,ri=!1;var G=k.alternate;G!==null&&(G.return=null),k.return=null}catch(se){Cn(k,c,se)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)rS(c,a),c=c.sibling}function rS(a,c){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(si(c,a),Si(a),y&4){try{Kd(3,a,a.return),Vp(3,a)}catch(He){Cn(a,a.return,He)}try{Kd(5,a,a.return)}catch(He){Cn(a,a.return,He)}}break;case 1:si(c,a),Si(a),y&512&&h!==null&&Zc(h,h.return);break;case 5:if(si(c,a),Si(a),y&512&&h!==null&&Zc(h,h.return),a.flags&32){var k=a.stateNode;try{Xt(k,"")}catch(He){Cn(a,a.return,He)}}if(y&4&&(k=a.stateNode,k!=null)){var P=a.memoizedProps,O=h!==null?h.memoizedProps:P,F=a.type,G=a.updateQueue;if(a.updateQueue=null,G!==null)try{F==="input"&&P.type==="radio"&&P.name!=null&&_t(k,P),yr(F,O);var se=yr(F,P);for(O=0;O<G.length;O+=2){var ge=G[O],ye=G[O+1];ge==="style"?vn(k,ye):ge==="dangerouslySetInnerHTML"?Jn(k,ye):ge==="children"?Xt(k,ye):C(k,ge,ye,se)}switch(F){case"input":ht(k,P);break;case"textarea":Me(k,P);break;case"select":var me=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!P.multiple;var Te=P.value;Te!=null?Le(k,!!P.multiple,Te,!1):me!==!!P.multiple&&(P.defaultValue!=null?Le(k,!!P.multiple,P.defaultValue,!0):Le(k,!!P.multiple,P.multiple?[]:"",!1))}k[jd]=P}catch(He){Cn(a,a.return,He)}}break;case 6:if(si(c,a),Si(a),y&4){if(a.stateNode===null)throw Error(n(162));k=a.stateNode,P=a.memoizedProps;try{k.nodeValue=P}catch(He){Cn(a,a.return,He)}}break;case 3:if(si(c,a),Si(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{tn(c.containerInfo)}catch(He){Cn(a,a.return,He)}break;case 4:si(c,a),Si(a);break;case 13:si(c,a),Si(a),k=a.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(m1=Qt())),y&4&&nS(a);break;case 22:if(ge=h!==null&&h.memoizedState!==null,a.mode&1?(br=(se=br)||ge,si(c,a),br=se):si(c,a),Si(a),y&8192){if(se=a.memoizedState!==null,(a.stateNode.isHidden=se)&&!ge&&(a.mode&1)!==0)for(De=a,ge=a.child;ge!==null;){for(ye=De=ge;De!==null;){switch(me=De,Te=me.child,me.tag){case 0:case 11:case 14:case 15:Kd(4,me,me.return);break;case 1:Zc(me,me.return);var Fe=me.stateNode;if(typeof Fe.componentWillUnmount=="function"){y=me,h=me.return;try{c=y,Fe.props=c.memoizedProps,Fe.state=c.memoizedState,Fe.componentWillUnmount()}catch(He){Cn(y,h,He)}}break;case 5:Zc(me,me.return);break;case 22:if(me.memoizedState!==null){oS(ye);continue}}Te!==null?(Te.return=me,De=Te):oS(ye)}ge=ge.sibling}e:for(ge=null,ye=a;;){if(ye.tag===5){if(ge===null){ge=ye;try{k=ye.stateNode,se?(P=k.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(F=ye.stateNode,G=ye.memoizedProps.style,O=G!=null&&G.hasOwnProperty("display")?G.display:null,F.style.display=gn("display",O))}catch(He){Cn(a,a.return,He)}}}else if(ye.tag===6){if(ge===null)try{ye.stateNode.nodeValue=se?"":ye.memoizedProps}catch(He){Cn(a,a.return,He)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;ge===ye&&(ge=null),ye=ye.return}ge===ye&&(ge=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:si(c,a),Si(a),y&4&&nS(a);break;case 21:break;default:si(c,a),Si(a)}}function Si(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(J6(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var k=y.stateNode;y.flags&32&&(Xt(k,""),y.flags&=-33);var P=eS(a);f1(a,P,k);break;case 3:case 4:var O=y.stateNode.containerInfo,F=eS(a);d1(a,F,O);break;default:throw Error(n(161))}}catch(G){Cn(a,a.return,G)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function vD(a,c,h){De=a,sS(a)}function sS(a,c,h){for(var y=(a.mode&1)!==0;De!==null;){var k=De,P=k.child;if(k.tag===22&&y){var O=k.memoizedState!==null||Fp;if(!O){var F=k.alternate,G=F!==null&&F.memoizedState!==null||br;F=Fp;var se=br;if(Fp=O,(br=G)&&!se)for(De=k;De!==null;)O=De,G=O.child,O.tag===22&&O.memoizedState!==null?aS(k):G!==null?(G.return=O,De=G):aS(k);for(;P!==null;)De=P,sS(P),P=P.sibling;De=k,Fp=F,br=se}iS(a)}else(k.subtreeFlags&8772)!==0&&P!==null?(P.return=k,De=P):iS(a)}}function iS(a){for(;De!==null;){var c=De;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:br||Vp(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!br)if(h===null)y.componentDidMount();else{var k=c.elementType===c.type?h.memoizedProps:ni(c.type,h.memoizedProps);y.componentDidUpdate(k,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&o6(c,P,y);break;case 3:var O=c.updateQueue;if(O!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}o6(c,O,h)}break;case 5:var F=c.stateNode;if(h===null&&c.flags&4){h=F;var G=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&h.focus();break;case"img":G.src&&(h.src=G.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var se=c.alternate;if(se!==null){var ge=se.memoizedState;if(ge!==null){var ye=ge.dehydrated;ye!==null&&tn(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}br||c.flags&512&&u1(c)}catch(me){Cn(c,c.return,me)}}if(c===a){De=null;break}if(h=c.sibling,h!==null){h.return=c.return,De=h;break}De=c.return}}function oS(a){for(;De!==null;){var c=De;if(c===a){De=null;break}var h=c.sibling;if(h!==null){h.return=c.return,De=h;break}De=c.return}}function aS(a){for(;De!==null;){var c=De;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Vp(4,c)}catch(G){Cn(c,h,G)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var k=c.return;try{y.componentDidMount()}catch(G){Cn(c,k,G)}}var P=c.return;try{u1(c)}catch(G){Cn(c,P,G)}break;case 5:var O=c.return;try{u1(c)}catch(G){Cn(c,O,G)}}}catch(G){Cn(c,c.return,G)}if(c===a){De=null;break}var F=c.sibling;if(F!==null){F.return=c.return,De=F;break}De=c.return}}var yD=Math.ceil,Hp=R.ReactCurrentDispatcher,h1=R.ReactCurrentOwner,$s=R.ReactCurrentBatchConfig,Et=0,nr=null,jn=null,dr=0,hs=0,Wc=Yo(0),qn=0,Yd=null,gl=0,zp=0,p1=0,Xd=null,Br=null,m1=0,qc=1/0,co=null,Bp=!1,g1=null,na=null,Up=!1,ra=null,Zp=0,Qd=0,v1=null,Wp=-1,qp=0;function Ar(){return(Et&6)!==0?Qt():Wp!==-1?Wp:Wp=Qt()}function sa(a){return(a.mode&1)===0?1:(Et&2)!==0&&dr!==0?dr&-dr:tD.transition!==null?(qp===0&&(qp=tp()),qp):(a=Dt,a!==0||(a=window.event,a=a===void 0?16:c4(a.type)),a)}function ii(a,c,h,y){if(50<Qd)throw Qd=0,v1=null,Error(n(185));eo(a,h,y),((Et&2)===0||a!==nr)&&(a===nr&&((Et&2)===0&&(zp|=h),qn===4&&ia(a,dr)),Ur(a,y),h===1&&Et===0&&(c.mode&1)===0&&(qc=Qt()+500,wp&&Qo()))}function Ur(a,c){var h=a.callbackNode;rv(a,c);var y=Ec(a,a===nr?dr:0);if(y===0)h!==null&&Bo(h),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(h!=null&&Bo(h),c===1)a.tag===0?eD(cS.bind(null,a)):G4(cS.bind(null,a)),YN(function(){(Et&6)===0&&Qo()}),h=null;else{switch(to(y)){case 1:h=xd;break;case 4:h=Jh;break;case 16:h=Uo;break;case 536870912:h=bd;break;default:h=Uo}h=vS(h,lS.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function lS(a,c){if(Wp=-1,qp=0,(Et&6)!==0)throw Error(n(327));var h=a.callbackNode;if(Gc()&&a.callbackNode!==h)return null;var y=Ec(a,a===nr?dr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=Gp(a,y);else{c=y;var k=Et;Et|=2;var P=dS();(nr!==a||dr!==c)&&(co=null,qc=Qt()+500,yl(a,c));do try{wD();break}catch(F){uS(a,F)}while(!0);Nv(),Hp.current=P,Et=k,jn!==null?c=0:(nr=null,dr=0,c=qn)}if(c!==0){if(c===2&&(k=Ed(a),k!==0&&(y=k,c=y1(a,k))),c===1)throw h=Yd,yl(a,0),ia(a,y),Ur(a,Qt()),h;if(c===6)ia(a,y);else{if(k=a.current.alternate,(y&30)===0&&!_D(k)&&(c=Gp(a,y),c===2&&(P=Ed(a),P!==0&&(y=P,c=y1(a,P))),c===1))throw h=Yd,yl(a,0),ia(a,y),Ur(a,Qt()),h;switch(a.finishedWork=k,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:_l(a,Br,co);break;case 3:if(ia(a,y),(y&130023424)===y&&(c=m1+500-Qt(),10<c)){if(Ec(a,0)!==0)break;if(k=a.suspendedLanes,(k&y)!==y){Ar(),a.pingedLanes|=a.suspendedLanes&k;break}a.timeoutHandle=kv(_l.bind(null,a,Br,co),c);break}_l(a,Br,co);break;case 4:if(ia(a,y),(y&4194240)===y)break;for(c=a.eventTimes,k=-1;0<y;){var O=31-os(y);P=1<<O,O=c[O],O>k&&(k=O),y&=~P}if(y=k,y=Qt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*yD(y/1960))-y,10<y){a.timeoutHandle=kv(_l.bind(null,a,Br,co),y);break}_l(a,Br,co);break;case 5:_l(a,Br,co);break;default:throw Error(n(329))}}}return Ur(a,Qt()),a.callbackNode===h?lS.bind(null,a):null}function y1(a,c){var h=Xd;return a.current.memoizedState.isDehydrated&&(yl(a,c).flags|=256),a=Gp(a,c),a!==2&&(c=Br,Br=h,c!==null&&_1(c)),a}function _1(a){Br===null?Br=a:Br.push.apply(Br,a)}function _D(a){for(var c=a;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var k=h[y],P=k.getSnapshot;k=k.value;try{if(!ei(P(),k))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ia(a,c){for(c&=~p1,c&=~zp,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-os(c),y=1<<h;a[h]=-1,c&=~y}}function cS(a){if((Et&6)!==0)throw Error(n(327));Gc();var c=Ec(a,0);if((c&1)===0)return Ur(a,Qt()),null;var h=Gp(a,c);if(a.tag!==0&&h===2){var y=Ed(a);y!==0&&(c=y,h=y1(a,y))}if(h===1)throw h=Yd,yl(a,0),ia(a,c),Ur(a,Qt()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,_l(a,Br,co),Ur(a,Qt()),null}function x1(a,c){var h=Et;Et|=1;try{return a(c)}finally{Et=h,Et===0&&(qc=Qt()+500,wp&&Qo())}}function vl(a){ra!==null&&ra.tag===0&&(Et&6)===0&&Gc();var c=Et;Et|=1;var h=$s.transition,y=Dt;try{if($s.transition=null,Dt=1,a)return a()}finally{Dt=y,$s.transition=h,Et=c,(Et&6)===0&&Qo()}}function w1(){hs=Wc.current,rn(Wc)}function yl(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,KN(h)),jn!==null)for(h=jn.return;h!==null;){var y=h;switch(Tv(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&_p();break;case 3:Bc(),rn(Vr),rn(_r),Bv();break;case 5:Hv(y);break;case 4:Bc();break;case 13:rn(_n);break;case 19:rn(_n);break;case 10:Dv(y.type._context);break;case 22:case 23:w1()}h=h.return}if(nr=a,jn=a=oa(a.current,null),dr=hs=c,qn=0,Yd=null,p1=zp=gl=0,Br=Xd=null,hl!==null){for(c=0;c<hl.length;c++)if(h=hl[c],y=h.interleaved,y!==null){h.interleaved=null;var k=y.next,P=h.pending;if(P!==null){var O=P.next;P.next=k,y.next=O}h.pending=y}hl=null}return a}function uS(a,c){do{var h=jn;try{if(Nv(),Ip.current=Np,Mp){for(var y=xn.memoizedState;y!==null;){var k=y.queue;k!==null&&(k.pending=null),y=y.next}Mp=!1}if(ml=0,tr=Wn=xn=null,Ud=!1,Zd=0,h1.current=null,h===null||h.return===null){qn=1,Yd=c,jn=null;break}e:{var P=a,O=h.return,F=h,G=c;if(c=dr,F.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var se=G,ge=F,ye=ge.tag;if((ge.mode&1)===0&&(ye===0||ye===11||ye===15)){var me=ge.alternate;me?(ge.updateQueue=me.updateQueue,ge.memoizedState=me.memoizedState,ge.lanes=me.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var Te=N6(O);if(Te!==null){Te.flags&=-257,D6(Te,O,F,P,c),Te.mode&1&&L6(P,se,c),c=Te,G=se;var Fe=c.updateQueue;if(Fe===null){var He=new Set;He.add(G),c.updateQueue=He}else Fe.add(G);break e}else{if((c&1)===0){L6(P,se,c),b1();break e}G=Error(n(426))}}else if(fn&&F.mode&1){var Mn=N6(O);if(Mn!==null){(Mn.flags&65536)===0&&(Mn.flags|=256),D6(Mn,O,F,P,c),Ov(Uc(G,F));break e}}P=G=Uc(G,F),qn!==4&&(qn=2),Xd===null?Xd=[P]:Xd.push(P),P=O;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var te=M6(P,G,c);i6(P,te);break e;case 1:F=G;var Y=P.type,re=P.stateNode;if((P.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(na===null||!na.has(re)))){P.flags|=65536,c&=-c,P.lanes|=c;var we=O6(P,F,c);i6(P,we);break e}}P=P.return}while(P!==null)}hS(h)}catch(Ue){c=Ue,jn===h&&h!==null&&(jn=h=h.return);continue}break}while(!0)}function dS(){var a=Hp.current;return Hp.current=Np,a===null?Np:a}function b1(){(qn===0||qn===3||qn===2)&&(qn=4),nr===null||(gl&268435455)===0&&(zp&268435455)===0||ia(nr,dr)}function Gp(a,c){var h=Et;Et|=2;var y=dS();(nr!==a||dr!==c)&&(co=null,yl(a,c));do try{xD();break}catch(k){uS(a,k)}while(!0);if(Nv(),Et=h,Hp.current=y,jn!==null)throw Error(n(261));return nr=null,dr=0,qn}function xD(){for(;jn!==null;)fS(jn)}function wD(){for(;jn!==null&&!_d();)fS(jn)}function fS(a){var c=gS(a.alternate,a,hs);a.memoizedProps=a.pendingProps,c===null?hS(a):jn=c,h1.current=null}function hS(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=hD(h,c,hs),h!==null){jn=h;return}}else{if(h=pD(h,c),h!==null){h.flags&=32767,jn=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{qn=6,jn=null;return}}if(c=c.sibling,c!==null){jn=c;return}jn=c=a}while(c!==null);qn===0&&(qn=5)}function _l(a,c,h){var y=Dt,k=$s.transition;try{$s.transition=null,Dt=1,bD(a,c,h,y)}finally{$s.transition=k,Dt=y}return null}function bD(a,c,h,y){do Gc();while(ra!==null);if((Et&6)!==0)throw Error(n(327));h=a.finishedWork;var k=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var P=h.lanes|h.childLanes;if(np(a,P),a===nr&&(jn=nr=null,dr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Up||(Up=!0,vS(Uo,function(){return Gc(),null})),P=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||P){P=$s.transition,$s.transition=null;var O=Dt;Dt=1;var F=Et;Et|=4,h1.current=null,gD(a,h),rS(h,a),zN(bv),Pr=!!wv,bv=wv=null,a.current=h,vD(h),Jg(),Et=F,Dt=O,$s.transition=P}else a.current=h;if(Up&&(Up=!1,ra=a,Zp=k),P=a.pendingLanes,P===0&&(na=null),ep(h.stateNode),Ur(a,Qt()),c!==null)for(y=a.onRecoverableError,h=0;h<c.length;h++)k=c[h],y(k.value,{componentStack:k.stack,digest:k.digest});if(Bp)throw Bp=!1,a=g1,g1=null,a;return(Zp&1)!==0&&a.tag!==0&&Gc(),P=a.pendingLanes,(P&1)!==0?a===v1?Qd++:(Qd=0,v1=a):Qd=0,Qo(),null}function Gc(){if(ra!==null){var a=to(Zp),c=$s.transition,h=Dt;try{if($s.transition=null,Dt=16>a?16:a,ra===null)var y=!1;else{if(a=ra,ra=null,Zp=0,(Et&6)!==0)throw Error(n(331));var k=Et;for(Et|=4,De=a.current;De!==null;){var P=De,O=P.child;if((De.flags&16)!==0){var F=P.deletions;if(F!==null){for(var G=0;G<F.length;G++){var se=F[G];for(De=se;De!==null;){var ge=De;switch(ge.tag){case 0:case 11:case 15:Kd(8,ge,P)}var ye=ge.child;if(ye!==null)ye.return=ge,De=ye;else for(;De!==null;){ge=De;var me=ge.sibling,Te=ge.return;if(Q6(ge),ge===se){De=null;break}if(me!==null){me.return=Te,De=me;break}De=Te}}}var Fe=P.alternate;if(Fe!==null){var He=Fe.child;if(He!==null){Fe.child=null;do{var Mn=He.sibling;He.sibling=null,He=Mn}while(He!==null)}}De=P}}if((P.subtreeFlags&2064)!==0&&O!==null)O.return=P,De=O;else e:for(;De!==null;){if(P=De,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Kd(9,P,P.return)}var te=P.sibling;if(te!==null){te.return=P.return,De=te;break e}De=P.return}}var Y=a.current;for(De=Y;De!==null;){O=De;var re=O.child;if((O.subtreeFlags&2064)!==0&&re!==null)re.return=O,De=re;else e:for(O=Y;De!==null;){if(F=De,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Vp(9,F)}}catch(Ue){Cn(F,F.return,Ue)}if(F===O){De=null;break e}var we=F.sibling;if(we!==null){we.return=F.return,De=we;break e}De=F.return}}if(Et=k,Qo(),Is&&typeof Is.onPostCommitFiberRoot=="function")try{Is.onPostCommitFiberRoot(bc,a)}catch{}y=!0}return y}finally{Dt=h,$s.transition=c}}return!1}function pS(a,c,h){c=Uc(h,c),c=M6(a,c,1),a=ea(a,c,1),c=Ar(),a!==null&&(eo(a,1,c),Ur(a,c))}function Cn(a,c,h){if(a.tag===3)pS(a,a,h);else for(;c!==null;){if(c.tag===3){pS(c,a,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(na===null||!na.has(y))){a=Uc(h,a),a=O6(c,a,1),c=ea(c,a,1),a=Ar(),c!==null&&(eo(c,1,a),Ur(c,a));break}}c=c.return}}function SD(a,c,h){var y=a.pingCache;y!==null&&y.delete(c),c=Ar(),a.pingedLanes|=a.suspendedLanes&h,nr===a&&(dr&h)===h&&(qn===4||qn===3&&(dr&130023424)===dr&&500>Qt()-m1?yl(a,0):p1|=h),Ur(a,c)}function mS(a,c){c===0&&((a.mode&1)===0?c=1:(c=kc,kc<<=1,(kc&130023424)===0&&(kc=4194304)));var h=Ar();a=oo(a,c),a!==null&&(eo(a,c,h),Ur(a,h))}function kD(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),mS(a,h)}function ED(a,c){var h=0;switch(a.tag){case 13:var y=a.stateNode,k=a.memoizedState;k!==null&&(h=k.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),mS(a,h)}var gS;gS=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||Vr.current)zr=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return zr=!1,fD(a,c,h);zr=(a.flags&131072)!==0}else zr=!1,fn&&(c.flags&1048576)!==0&&K4(c,Sp,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;jp(a,c),a=c.pendingProps;var k=Dc(c,_r.current);zc(c,h),k=Wv(null,c,y,a,k,h);var P=qv();return c.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Hr(y)?(P=!0,xp(c)):P=!1,c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,Fv(c),k.updater=Dp,c.stateNode=k,k._reactInternals=c,Jv(c,y,a,h),c=r1(null,c,y,!0,P,h)):(c.tag=0,fn&&P&&Av(c),Rr(null,c,k,h),c=c.child),c;case 16:y=c.elementType;e:{switch(jp(a,c),a=c.pendingProps,k=y._init,y=k(y._payload),c.type=y,k=c.tag=PD(y),a=ni(y,a),k){case 0:c=n1(null,c,y,a,h);break e;case 1:c=z6(null,c,y,a,h);break e;case 11:c=$6(null,c,y,a,h);break e;case 14:c=j6(null,c,y,ni(y.type,a),h);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ni(y,k),n1(a,c,y,k,h);case 1:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ni(y,k),z6(a,c,y,k,h);case 3:e:{if(B6(c),a===null)throw Error(n(387));y=c.pendingProps,P=c.memoizedState,k=P.element,s6(a,c),Ap(c,y,null,h);var O=c.memoizedState;if(y=O.element,P.isDehydrated)if(P={element:y,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){k=Uc(Error(n(423)),c),c=U6(a,c,y,h,k);break e}else if(y!==k){k=Uc(Error(n(424)),c),c=U6(a,c,y,h,k);break e}else for(fs=Ko(c.stateNode.containerInfo.firstChild),ds=c,fn=!0,ti=null,h=n6(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Fc(),y===k){c=lo(a,c,h);break e}Rr(a,c,y,h)}c=c.child}return c;case 5:return a6(c),a===null&&Mv(c),y=c.type,k=c.pendingProps,P=a!==null?a.memoizedProps:null,O=k.children,Sv(y,k)?O=null:P!==null&&Sv(y,P)&&(c.flags|=32),H6(a,c),Rr(a,c,O,h),c.child;case 6:return a===null&&Mv(c),null;case 13:return Z6(a,c,h);case 4:return Vv(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Vc(c,null,y,h):Rr(a,c,y,h),c.child;case 11:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ni(y,k),$6(a,c,y,k,h);case 7:return Rr(a,c,c.pendingProps,h),c.child;case 8:return Rr(a,c,c.pendingProps.children,h),c.child;case 12:return Rr(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(y=c.type._context,k=c.pendingProps,P=c.memoizedProps,O=k.value,Jt(Cp,y._currentValue),y._currentValue=O,P!==null)if(ei(P.value,O)){if(P.children===k.children&&!Vr.current){c=lo(a,c,h);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var F=P.dependencies;if(F!==null){O=P.child;for(var G=F.firstContext;G!==null;){if(G.context===y){if(P.tag===1){G=ao(-1,h&-h),G.tag=2;var se=P.updateQueue;if(se!==null){se=se.shared;var ge=se.pending;ge===null?G.next=G:(G.next=ge.next,ge.next=G),se.pending=G}}P.lanes|=h,G=P.alternate,G!==null&&(G.lanes|=h),$v(P.return,h,c),F.lanes|=h;break}G=G.next}}else if(P.tag===10)O=P.type===c.type?null:P.child;else if(P.tag===18){if(O=P.return,O===null)throw Error(n(341));O.lanes|=h,F=O.alternate,F!==null&&(F.lanes|=h),$v(O,h,c),O=P.sibling}else O=P.child;if(O!==null)O.return=P;else for(O=P;O!==null;){if(O===c){O=null;break}if(P=O.sibling,P!==null){P.return=O.return,O=P;break}O=O.return}P=O}Rr(a,c,k.children,h),c=c.child}return c;case 9:return k=c.type,y=c.pendingProps.children,zc(c,h),k=Ns(k),y=y(k),c.flags|=1,Rr(a,c,y,h),c.child;case 14:return y=c.type,k=ni(y,c.pendingProps),k=ni(y.type,k),j6(a,c,y,k,h);case 15:return F6(a,c,c.type,c.pendingProps,h);case 17:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ni(y,k),jp(a,c),c.tag=1,Hr(y)?(a=!0,xp(c)):a=!1,zc(c,h),T6(c,y,k),Jv(c,y,k,h),r1(null,c,y,!0,a,h);case 19:return q6(a,c,h);case 22:return V6(a,c,h)}throw Error(n(156,c.tag))};function vS(a,c){return wc(a,c)}function CD(a,c,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function js(a,c,h,y){return new CD(a,c,h,y)}function S1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function PD(a){if(typeof a=="function")return S1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===j)return 11;if(a===H)return 14}return 2}function oa(a,c){var h=a.alternate;return h===null?(h=js(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function Kp(a,c,h,y,k,P){var O=2;if(y=a,typeof a=="function")S1(a)&&(O=1);else if(typeof a=="string")O=5;else e:switch(a){case I:return xl(h.children,k,P,c);case T:O=8,k|=8;break;case L:return a=js(12,h,c,k|2),a.elementType=L,a.lanes=P,a;case K:return a=js(13,h,c,k),a.elementType=K,a.lanes=P,a;case U:return a=js(19,h,c,k),a.elementType=U,a.lanes=P,a;case Q:return Yp(h,k,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:O=10;break e;case B:O=9;break e;case j:O=11;break e;case H:O=14;break e;case Z:O=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=js(O,h,c,k),c.elementType=a,c.type=y,c.lanes=P,c}function xl(a,c,h,y){return a=js(7,a,y,c),a.lanes=h,a}function Yp(a,c,h,y){return a=js(22,a,y,c),a.elementType=Q,a.lanes=h,a.stateNode={isHidden:!1},a}function k1(a,c,h){return a=js(6,a,null,c),a.lanes=h,a}function E1(a,c,h){return c=js(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function RD(a,c,h,y,k){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=al(0),this.expirationTimes=al(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=al(0),this.identifierPrefix=y,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function C1(a,c,h,y,k,P,O,F,G){return a=new RD(a,c,h,F,G),c===1?(c=1,P===!0&&(c|=8)):c=0,P=js(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fv(P),a}function AD(a,c,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:c,implementation:h}}function yS(a){if(!a)return Xo;a=a._reactInternals;e:{if(Ts(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Hr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(Hr(h))return W4(a,h,c)}return c}function _S(a,c,h,y,k,P,O,F,G){return a=C1(h,y,!0,a,k,P,O,F,G),a.context=yS(null),h=a.current,y=Ar(),k=sa(h),P=ao(y,k),P.callback=c??null,ea(h,P,k),a.current.lanes=k,eo(a,k,y),Ur(a,y),a}function Xp(a,c,h,y){var k=c.current,P=Ar(),O=sa(k);return h=yS(h),c.context===null?c.context=h:c.pendingContext=h,c=ao(P,O),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=ea(k,c,O),a!==null&&(ii(a,k,O,P),Rp(a,k,O)),O}function Qp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function xS(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function P1(a,c){xS(a,c),(a=a.alternate)&&xS(a,c)}function TD(){return null}var wS=typeof reportError=="function"?reportError:function(a){console.error(a)};function R1(a){this._internalRoot=a}Jp.prototype.render=R1.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));Xp(a,c,null,null)},Jp.prototype.unmount=R1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;vl(function(){Xp(null,a,null,null)}),c[no]=null}};function Jp(a){this._internalRoot=a}Jp.prototype.unstable_scheduleHydration=function(a){if(a){var c=sp();a={blockedOn:null,target:a,priority:c};for(var h=0;h<Qs.length&&c!==0&&c<Qs[h].priority;h++);Qs.splice(h,0,a),h===0&&he(a)}};function A1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function e0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function bS(){}function ID(a,c,h,y,k){if(k){if(typeof y=="function"){var P=y;y=function(){var se=Qp(O);P.call(se)}}var O=_S(c,y,a,0,null,!1,!1,"",bS);return a._reactRootContainer=O,a[no]=O.current,Dd(a.nodeType===8?a.parentNode:a),vl(),O}for(;k=a.lastChild;)a.removeChild(k);if(typeof y=="function"){var F=y;y=function(){var se=Qp(G);F.call(se)}}var G=C1(a,0,!1,null,null,!1,!1,"",bS);return a._reactRootContainer=G,a[no]=G.current,Dd(a.nodeType===8?a.parentNode:a),vl(function(){Xp(c,G,h,y)}),G}function t0(a,c,h,y,k){var P=h._reactRootContainer;if(P){var O=P;if(typeof k=="function"){var F=k;k=function(){var G=Qp(O);F.call(G)}}Xp(c,O,a,k)}else O=ID(h,c,a,k,y);return Qp(O)}Pd=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=ol(c.pendingLanes);h!==0&&(Cd(c,h|1),Ur(c,Qt()),(Et&6)===0&&(qc=Qt()+500,Qo()))}break;case 13:vl(function(){var y=oo(a,1);if(y!==null){var k=Ar();ii(y,a,1,k)}}),P1(a,1)}},ll=function(a){if(a.tag===13){var c=oo(a,134217728);if(c!==null){var h=Ar();ii(c,a,134217728,h)}P1(a,134217728)}},rp=function(a){if(a.tag===13){var c=sa(a),h=oo(a,c);if(h!==null){var y=Ar();ii(h,a,c,y)}P1(a,c)}},sp=function(){return Dt},ip=function(a,c){var h=Dt;try{return Dt=a,c()}finally{Dt=h}},Ks=function(a,c,h){switch(c){case"input":if(ht(a,h),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var y=h[c];if(y!==a&&y.form===a.form){var k=yp(y);if(!k)throw Error(n(90));Ge(y),ht(y,k)}}}break;case"textarea":Me(a,h);break;case"select":c=h.value,c!=null&&Le(a,!!h.multiple,c,!1)}},Ke=x1,Tt=vl;var MD={usingClientEntryPoint:!1,Events:[Fd,Lc,yp,Qi,ss,x1]},Jd={findFiberByHostInstance:cl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},OD={bundleType:Jd.bundleType,version:Jd.version,rendererPackageName:Jd.rendererPackageName,rendererConfig:Jd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=yd(a),a===null?null:a.stateNode},findFiberByHostInstance:Jd.findFiberByHostInstance||TD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var n0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n0.isDisabled&&n0.supportsFiber)try{bc=n0.inject(OD),Is=n0}catch{}}return Zr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MD,Zr.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A1(c))throw Error(n(200));return AD(a,c,null,h)},Zr.createRoot=function(a,c){if(!A1(a))throw Error(n(299));var h=!1,y="",k=wS;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(k=c.onRecoverableError)),c=C1(a,1,!1,null,null,h,!1,y,k),a[no]=c.current,Dd(a.nodeType===8?a.parentNode:a),new R1(c)},Zr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=yd(c),a=a===null?null:a.stateNode,a},Zr.flushSync=function(a){return vl(a)},Zr.hydrate=function(a,c,h){if(!e0(c))throw Error(n(200));return t0(null,a,c,!0,h)},Zr.hydrateRoot=function(a,c,h){if(!A1(a))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,k=!1,P="",O=wS;if(h!=null&&(h.unstable_strictMode===!0&&(k=!0),h.identifierPrefix!==void 0&&(P=h.identifierPrefix),h.onRecoverableError!==void 0&&(O=h.onRecoverableError)),c=_S(c,null,a,1,h??null,k,!1,P,O),a[no]=c.current,Dd(a),y)for(a=0;a<y.length;a++)h=y[a],k=h._getVersion,k=k(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,k]:c.mutableSourceEagerHydrationData.push(h,k);return new Jp(c)},Zr.render=function(a,c,h){if(!e0(c))throw Error(n(200));return t0(null,a,c,!1,h)},Zr.unmountComponentAtNode=function(a){if(!e0(a))throw Error(n(40));return a._reactRootContainer?(vl(function(){t0(null,null,a,!1,function(){a._reactRootContainer=null,a[no]=null})}),!0):!1},Zr.unstable_batchedUpdates=x1,Zr.unstable_renderSubtreeIntoContainer=function(a,c,h,y){if(!e0(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return t0(a,c,h,!1,y)},Zr.version="18.3.1-next-f1338f8080-20240426",Zr}var yk;function jR(){if(yk)return vy.exports;yk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),vy.exports=pV(),vy.exports}var _k;function mV(){if(_k)return p0;_k=1;var t=jR();return p0.createRoot=t.createRoot,p0.hydrateRoot=t.hydrateRoot,p0}var gV=mV();const vV=_g(gV),Ro={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function FR(t){return"init"in t}function f2(t){return typeof t.write=="function"}function yV(t){return!!t.onMount}function xk(t){return"v"in t||"e"in t}function $m(t){if("e"in t)throw t.e;if((Ro?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function jm(t){return typeof(t==null?void 0:t.then)=="function"}function _V(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function VR(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function HR(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function xV(t){return!!t.INTERNAL_onInit}const wV=(t,e,n,...r)=>n.read(...r),bV=(t,e,n,...r)=>n.write(...r),SV=(t,e,n)=>n.INTERNAL_onInit(e),kV=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},EV=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),xV(n)&&l(t,e,n)}return i},CV=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=p=>{try{p()}catch(g){d.push(g)}};do{l.f&&f(l.f);const p=new Set;for(const g of s){const v=(n=r.get(g))==null?void 0:n.l;if(v)for(const w of v)p.add(w)}s.clear();for(const g of o)p.add(g);o.clear();for(const g of i)p.add(g);i.clear();for(const g of p)f(g);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},PV=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,p=new WeakSet,g=[],v=[];for(const w of s)g.push(w),v.push(i(t,e,w));for(;g.length;){const w=g.length-1,_=g[w],x=v[w];if(p.has(_)){g.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===x.n)u.push(_),d.push(x);else if((Ro?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),g.pop(),v.pop();continue}f.add(_);for(const b of HR(_,x,n))f.has(b)||(g.push(b),v.push(i(t,e,b)))}for(let w=u.length-1;w>=0;--w){const _=u[w],x=d[w];let b=!1;for(const E of x.d.keys())if(E!==_&&s.has(E)){b=!0;break}b&&(r.set(_,x.n),o(t,e,_),l(t,e,_)),r.delete(_)}},h2=new WeakSet,RV=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],p=t[12],g=t[13],v=t[14],w=t[16],_=t[17],x=t[20],b=t[26],E=t[28],C=f(t,e,n),R=E[0];if(xk(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===R)return C.m=R,C;let H=!1;for(const[Z,Q]of C.d)if(v(t,e,Z).n!==Q){H=!0;break}if(!H)return C.m=R,C}let A=!0;const M=new Set(C.d.keys()),I=()=>{for(const H of M)C.d.delete(H)},T=()=>{if(i.has(n)){const H=!l.size;_(t,e,n),H&&(g(t,e),p(t,e))}},L=H=>{var Z;if(H===n){const z=f(t,e,H);if(!xk(z))if(FR(H))x(t,e,H,H.init);else throw new Error("no atom init");return $m(z)}const Q=v(t,e,H);try{return $m(Q)}finally{M.delete(H),C.d.set(H,Q.n),jm(C.v)&&VR(n,C.v,Q),i.has(n)&&((Z=i.get(H))==null||Z.t.add(n)),A||T()}};let D,B;const j={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(Ro?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Ro?"production":void 0)!=="production"&&!f2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!B&&f2(n)&&(B=(...H)=>{if((Ro?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return w(t,e,n,H)}finally{g(t,e),p(t,e)}}),B}},K=C.n,U=o.get(n)===K;try{(Ro?"production":void 0)!=="production"&&h2.delete(e);const H=d(t,e,n,L,j);if((Ro?"production":void 0)!=="production"&&h2.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,H),jm(H)){b(t,e,H,()=>D==null?void 0:D.abort());const Z=()=>{I(),T()};H.then(Z,Z)}else I();return(r=u.r)==null||r.call(u,n),C.m=R,C}catch(H){if(_V(H))throw H;return delete C.v,C.e=H,++C.n,C.m=R,C}finally{A=!1,C.n!==K&&U&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},AV=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of HR(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},TV=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],p=t[15],g=t[16],v=t[17],w=t[20],_=t[28];let x=!0;const b=C=>$m(f(t,e,C)),E=(C,...R)=>{var A;const M=l(t,e,C);try{if(C===n){if(!FR(C))throw new Error("atom not writable");(Ro?"production":void 0)!=="production"&&h2.add(e);const I=M.n,T=R[0];w(t,e,C,T),v(t,e,C),I!==M.n&&(++_[0],s.add(C),p(t,e,C),(A=i.c)==null||A.call(i,C));return}else return g(t,e,C,R)}finally{x||(d(t,e),u(t,e))}};try{return o(t,e,n,b,E,...r)}finally{x=!1}},IV=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],p=l(t,e,n),g=s.get(n);if(g&&p.d.size>0){for(const[v,w]of p.d)if(!g.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),g.d.add(v),w!==_.n&&(i.add(v),u(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of g.d)if(!p.d.has(v)){g.d.delete(v);const w=f(t,e,v);w==null||w.t.delete(n)}}},MV=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],p=t[14],g=t[16],v=t[18],w=u(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())v(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),f2(n)&&yV(n)){const x=()=>{let b=!0;const E=(...C)=>{try{return g(t,e,n,C)}finally{b||(f(t,e),d(t,e))}};try{const C=l(t,e,n,E);C&&(_.u=()=>{b=!0;try{C()}finally{b=!1}})}finally{b=!1}};i.add(x)}(r=o.m)==null||r.call(o,n)}return _},OV=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let g=!1;for(const v of p.t)if((r=i.get(v))!=null&&r.d.has(n)){g=!0;break}if(!g){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const v of f.d.keys()){const w=d(t,e,v);w==null||w.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return p},LV=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(jm(r))for(const d of o.d.keys())VR(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,jm(u)&&i(t,e,u))},NV=(t,e,n)=>{const r=t[14];return $m(r(t,e,n))},DV=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},$V=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},jV=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},FV=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},zR=new WeakMap;function VV(t){const e=zR.get(t);if((Ro?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function HV(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},wV,bV,SV,kV,EV,CV,PV,RV,AV,TV,IV,MV,OV,LV,NV,DV,$V,void 0,new WeakMap,jV,FV,[0]].map((o,l)=>t[l]||o);zR.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const BR={};let zV=0;function ut(t,e){const n=`atom${++zV}`,r={toString(){return(BR?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=BV,r.write=UV),e&&(r.write=e),r}function BV(t){return t(this)}function UV(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function ZV(){return HV()}let ff;function WV(){return ff||(ff=ZV(),(BR?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ff),globalThis.__JOTAI_DEFAULT_STORE__!==ff&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ff}const qV={},GV=m.createContext(void 0);function Eg(t){return m.useContext(GV)||WV()}const p2=t=>typeof(t==null?void 0:t.then)=="function",m2=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},KV=_e.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(m2(t),t)}),xy=new WeakMap,wk=(t,e,n)=>{const r=VV(t),s=r[26];let i=xy.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=g=>v=>{u===g&&o(v)},f=g=>v=>{u===g&&l(v)},p=()=>{try{const g=n();p2(g)?(xy.set(g,i),u=g,g.then(d(g),f(g)),s(r,t,g,p)):o(g)}catch(g){l(g)}};e.then(d(e),f(e)),s(r,t,e,p)}),xy.set(e,i)),i};function lt(t,e){const{delay:n,unstable_promiseStatus:r=!_e.use}={},s=Eg(),[[i,o,l],u]=m.useReducer(f=>{const p=s.get(t);return Object.is(f[0],p)&&f[1]===s&&f[2]===t?f:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),m.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const p=s.get(t);p2(p)&&m2(wk(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
+
44
+ Migration guide:
45
+
46
+ Create a custom hook like the following.
47
+
48
+ function useAtomValueWithDelay<Value>(
49
+ atom: Atom<Value>,
50
+ options: { delay: number },
51
+ ): Value {
52
+ const { delay } = options
53
+ const store = useStore(options)
54
+ const [value, setValue] = useState(() => store.get(atom))
55
+ useEffect(() => {
56
+ const unsub = store.sub(atom, () => {
57
+ setTimeout(() => setValue(store.get(atom)), delay)
58
+ })
59
+ return unsub
60
+ }, [store, atom, delay])
61
+ return value
62
+ }
63
+ `),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),m.useDebugValue(d),p2(d)){const f=wk(s,d,()=>s.get(t));return r&&m2(f),KV(f)}return d}function vt(t,e){const n=Eg();return m.useCallback((...s)=>{if((qV?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function UR(t,e){return[lt(t),vt(t)]}const pw=m.createContext({});function mw(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const YV=typeof window<"u",gw=YV?m.useLayoutEffect:m.useEffect,Cg=m.createContext(null);function vw(t,e){t.indexOf(e)===-1&&t.push(e)}function Fm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Zi=(t,e,n)=>n>e?e:n<t?t:n;let Pg=()=>{};const Va={},ZR=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),WR=t=>typeof t=="object"&&t!==null,qR=t=>/^0[^.\s]+$/u.test(t);function GR(t){let e;return()=>(e===void 0&&(e=t()),e)}const qs=t=>t,Vh=(...t)=>t.reduce((e,n)=>r=>n(e(r))),oh=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class yw{constructor(){this.subscriptions=[]}add(e){return vw(this.subscriptions,e),()=>Fm(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xs=t=>t*1e3,Bs=t=>t/1e3,KR=(t,e)=>e?t*(1e3/e):0,YR=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,XV=1e-7,QV=12;function JV(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=YR(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>XV&&++l<QV);return o}function Hh(t,e,n,r){if(t===e&&n===r)return qs;const s=i=>JV(i,0,1,t,n);return i=>i===0||i===1?i:YR(s(i),e,r)}const XR=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,QR=t=>e=>1-t(1-e),JR=Hh(.33,1.53,.69,.99),_w=QR(JR),eA=XR(_w),tA=t=>t>=1?1:(t*=2)<1?.5*_w(t):.5*(2-Math.pow(2,-10*(t-1))),xw=t=>1-Math.sin(Math.acos(t)),nA=QR(xw),rA=XR(xw),eH=Hh(.42,0,1,1),tH=Hh(0,0,.58,1),sA=Hh(.42,0,.58,1),nH=t=>Array.isArray(t)&&typeof t[0]!="number",iA=t=>Array.isArray(t)&&typeof t[0]=="number",rH={linear:qs,easeIn:eH,easeInOut:sA,easeOut:tH,circIn:xw,circInOut:rA,circOut:nA,backIn:_w,backInOut:eA,backOut:JR,anticipate:tA},sH=t=>typeof t=="string",bk=t=>{if(iA(t)){Pg(t.length===4);const[e,n,r,s]=t;return Hh(e,n,r,s)}else if(sH(t))return rH[t];return t},m0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function iH(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,p=!1)=>{const v=p&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const oH=40;function oA(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=m0.reduce((C,R)=>(C[R]=iH(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:g,render:v,postRender:w}=o,_=()=>{const C=Va.useManualTiming,R=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(R-s.timestamp,oH),1)),s.timestamp=R,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),p.process(s),g.process(s),v.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:m0.reduce((C,R)=>{const A=o[R];return C[R]=(M,I=!1,T=!1)=>(n||x(),A.schedule(M,I,T)),C},{}),cancel:C=>{for(let R=0;R<m0.length;R++)o[m0[R]].cancel(C)},state:s,steps:o}}const{schedule:Gt,cancel:Ha,state:hr,steps:wy}=oA(typeof requestAnimationFrame<"u"?requestAnimationFrame:qs,!0);let q0;function aH(){q0=void 0}const Dr={now:()=>(q0===void 0&&Dr.set(hr.isProcessing||Va.useManualTiming?hr.timestamp:performance.now()),q0),set:t=>{q0=t,queueMicrotask(aH)}},aA=t=>e=>typeof e=="string"&&e.startsWith(t),lA=aA("--"),lH=aA("var(--"),ww=t=>lH(t)?cH.test(t.split("/*")[0].trim()):!1,cH=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sk(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const cd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ah={...cd,transform:t=>Zi(0,1,t)},g0={...cd,default:1},Ff=t=>Math.round(t*1e5)/1e5,bw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function uH(t){return t==null}const dH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Sw=(t,e)=>n=>!!(typeof n=="string"&&dH.test(n)&&n.startsWith(t)||e&&!uH(n)&&Object.prototype.hasOwnProperty.call(n,e)),cA=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(bw);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},fH=t=>Zi(0,255,t),by={...cd,transform:t=>Math.round(fH(t))},Vl={test:Sw("rgb","red"),parse:cA("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+by.transform(t)+", "+by.transform(e)+", "+by.transform(n)+", "+Ff(ah.transform(r))+")"};function hH(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const g2={test:Sw("#"),parse:hH,transform:Vl.transform},zh=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),_o=zh("deg"),zi=zh("%"),Ve=zh("px"),pH=zh("vh"),mH=zh("vw"),kk={...zi,parse:t=>zi.parse(t)/100,transform:t=>zi.transform(t*100)},mu={test:Sw("hsl","hue"),parse:cA("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+zi.transform(Ff(e))+", "+zi.transform(Ff(n))+", "+Ff(ah.transform(r))+")"},Hn={test:t=>Vl.test(t)||g2.test(t)||mu.test(t),parse:t=>Vl.test(t)?Vl.parse(t):mu.test(t)?mu.parse(t):g2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Vl.transform(t):mu.transform(t),getAnimatableNone:t=>{const e=Hn.parse(t);return e.alpha=0,Hn.transform(e)}},gH=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vH(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(bw))==null?void 0:e.length)||0)+(((n=t.match(gH))==null?void 0:n.length)||0)>0}const uA="number",dA="color",yH="var",_H="var(",Ek="${}",xH=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(xH,u=>(Hn.test(u)?(r.color.push(i),s.push(dA),n.push(Hn.parse(u))):u.startsWith(_H)?(r.var.push(i),s.push(yH),n.push(u)):(r.number.push(i),s.push(uA),n.push(parseFloat(u))),++i,Ek)).split(Ek);return{values:n,split:l,indexes:r,types:s}}function wH(t){return Gu(t).values}function fA({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===uA?s+=Ff(r[i]):o===dA?s+=Hn.transform(r[i]):s+=r[i]}return s}}function bH(t){return fA(Gu(t))}const SH=t=>typeof t=="number"?0:Hn.test(t)?Hn.getAnimatableNone(t):t,kH=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:SH(t);function EH(t){const e=Gu(t);return fA(e)(e.values.map((r,s)=>kH(r,e.split[s])))}const gi={test:vH,parse:wH,createTransformer:bH,getAnimatableNone:EH};function Sy(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function CH({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,u=2*n-l;s=Sy(u,l,t+1/3),i=Sy(u,l,t),o=Sy(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Vm(t,e){return n=>n>0?e:t}const qt=(t,e,n)=>t+(e-t)*n,ky=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},PH=[g2,Vl,mu],RH=t=>PH.find(e=>e.test(t));function Ck(t){const e=RH(t);if(!e)return!1;let n=e.parse(t);return e===mu&&(n=CH(n)),n}const Pk=(t,e)=>{const n=Ck(t),r=Ck(e);if(!n||!r)return Vm(t,e);const s={...n};return i=>(s.red=ky(n.red,r.red,i),s.green=ky(n.green,r.green,i),s.blue=ky(n.blue,r.blue,i),s.alpha=qt(n.alpha,r.alpha,i),Vl.transform(s))},v2=new Set(["none","hidden"]);function AH(t,e){return v2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function TH(t,e){return n=>qt(t,e,n)}function kw(t){return typeof t=="number"?TH:typeof t=="string"?ww(t)?Vm:Hn.test(t)?Pk:OH:Array.isArray(t)?hA:typeof t=="object"?Hn.test(t)?Pk:IH:Vm}function hA(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>kw(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function IH(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=kw(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function MH(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const OH=(t,e)=>{const n=gi.createTransformer(e),r=Gu(t),s=Gu(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?v2.has(t)&&!s.values.length||v2.has(e)&&!r.values.length?AH(t,e):Vh(hA(MH(r,s),s.values),n):Vm(t,e)};function pA(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?qt(t,e,n):kw(t)(t,e)}const LH=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Gt.update(e,n),stop:()=>Ha(e),now:()=>hr.isProcessing?hr.timestamp:Dr.now()}},mA=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Hm=2e4;function Ew(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Hm;)e+=n,r=t.next(e);return e>=Hm?1/0:e}function NH(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Ew(r),Hm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Bs(s)}}const Pn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function y2(t,e){return t*Math.sqrt(1-e*e)}const DH=12;function $H(t,e,n){let r=n;for(let s=1;s<DH;s++)r=r-t(r)/e(r);return r}const Ey=.001;function jH({duration:t=Pn.duration,bounce:e=Pn.bounce,velocity:n=Pn.velocity,mass:r=Pn.mass}){let s,i,o=1-e;o=Zi(Pn.minDamping,Pn.maxDamping,o),t=Zi(Pn.minDuration,Pn.maxDuration,Bs(t)),o<1?(s=d=>{const f=d*o,p=f*t,g=f-n,v=y2(d,o),w=Math.exp(-p);return Ey-g/v*w},i=d=>{const p=d*o*t,g=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=y2(Math.pow(d,2),o);return(-s(d)+Ey>0?-1:1)*((g-v)*w)/_}):(s=d=>{const f=Math.exp(-d*t),p=(d-n)*t+1;return-Ey+f*p},i=d=>{const f=Math.exp(-d*t),p=(n-d)*(t*t);return f*p});const l=5/t,u=$H(s,i,l);if(t=xs(t),isNaN(u))return{stiffness:Pn.stiffness,damping:Pn.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const FH=["duration","bounce"],VH=["stiffness","damping","mass"];function Rk(t,e){return e.some(n=>t[n]!==void 0)}function HH(t){let e={velocity:Pn.velocity,stiffness:Pn.stiffness,damping:Pn.damping,mass:Pn.mass,isResolvedFromDuration:!1,...t};if(!Rk(t,VH)&&Rk(t,FH))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Zi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Pn.mass,stiffness:s,damping:i}}else{const n=jH({...t,velocity:0});e={...e,...n,mass:Pn.mass},e.isResolvedFromDuration=!0}return e}function zm(t=Pn.visualDuration,e=Pn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:p,velocity:g,isResolvedFromDuration:v}=HH({...n,velocity:-Bs(n.velocity||0)}),w=g||0,_=d/(2*Math.sqrt(u*f)),x=o-i,b=Bs(Math.sqrt(u/f)),E=Math.abs(x)<5;r||(r=E?Pn.restSpeed.granular:Pn.restSpeed.default),s||(s=E?Pn.restDelta.granular:Pn.restDelta.default);let C,R,A,M,I,T;if(_<1)A=y2(b,_),M=(w+_*b*x)/A,C=D=>{const B=Math.exp(-_*b*D);return o-B*(M*Math.sin(A*D)+x*Math.cos(A*D))},I=_*b*M+x*A,T=_*b*x-M*A,R=D=>Math.exp(-_*b*D)*(I*Math.sin(A*D)+T*Math.cos(A*D));else if(_===1){C=B=>o-Math.exp(-b*B)*(x+(w+b*x)*B);const D=w+b*x;R=B=>Math.exp(-b*B)*(b*D*B-w)}else{const D=b*Math.sqrt(_*_-1);C=U=>{const H=Math.exp(-_*b*U),Z=Math.min(D*U,300);return o-H*((w+_*b*x)*Math.sinh(Z)+D*x*Math.cosh(Z))/D};const B=(w+_*b*x)/D,j=_*b*B-x*D,K=_*b*x-B*D;R=U=>{const H=Math.exp(-_*b*U),Z=Math.min(D*U,300);return H*(j*Math.sinh(Z)+K*Math.cosh(Z))}}const L={calculatedDuration:v&&p||null,velocity:D=>xs(R(D)),next:D=>{if(!v&&_<1){const j=Math.exp(-_*b*D),K=Math.sin(A*D),U=Math.cos(A*D),H=o-j*(M*K+x*U),Z=xs(j*(I*K+T*U));return l.done=Math.abs(Z)<=r&&Math.abs(o-H)<=s,l.value=l.done?o:H,l}const B=C(D);if(v)l.done=D>=p;else{const j=xs(R(D));l.done=Math.abs(j)<=r&&Math.abs(o-B)<=s}return l.value=l.done?o:B,l},toString:()=>{const D=Math.min(Ew(L),Hm),B=mA(j=>L.next(D*j).value,D,30);return D+"ms "+B},toTransition:()=>{}};return L}zm.applyToOptions=t=>{const e=NH(t,100,zm);return t.ease=e.ease,t.duration=xs(e.duration),t.type="keyframes",t};const zH=5;function gA(t,e,n){const r=Math.max(e-zH,0);return KR(n-t(r),e-r)}function _2({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const p=t[0],g={done:!1,value:p},v=T=>l!==void 0&&T<l||u!==void 0&&T>u,w=T=>l===void 0?u:u===void 0||Math.abs(l-T)<Math.abs(u-T)?l:u;let _=n*e;const x=p+_,b=o===void 0?x:o(x);b!==x&&(_=b-p);const E=T=>-_*Math.exp(-T/r),C=T=>b+E(T),R=T=>{const L=E(T),D=C(T);g.done=Math.abs(L)<=d,g.value=g.done?b:D};let A,M;const I=T=>{v(g.value)&&(A=T,M=zm({keyframes:[g.value,w(g.value)],velocity:gA(C,T,g.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:T=>{let L=!1;return!M&&A===void 0&&(L=!0,R(T),I(T)),A!==void 0&&T>=A?M.next(T-A):(!L&&R(T),g)}}}function BH(t,e,n){const r=[],s=n||Va.mix||pA,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||qs:e;l=Vh(u,l)}r.push(l)}return r}function UH(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Pg(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=BH(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(f<t[p+1]);p++);const g=oh(t[p],t[p+1],f);return l[p](g)};return n?f=>d(Zi(t[0],t[i-1],f)):d}function ZH(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=oh(0,e,r);t.push(qt(n,1,s))}}function WH(t){const e=[0];return ZH(e,t.length-1),e}function qH(t,e){return t.map(n=>n*e)}function GH(t,e){return t.map(()=>e||sA).splice(0,t.length-1)}function Vf({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=nH(r)?r.map(bk):bk(r),i={done:!1,value:e[0]},o=qH(n&&n.length===e.length?n:WH(e),t),l=UH(o,e,{ease:Array.isArray(s)?s:GH(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const KH=t=>t!==null;function Rg(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(KH),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const YH={decay:_2,inertia:_2,tween:Vf,keyframes:Vf,spring:zm};function vA(t){typeof t.type=="string"&&(t.type=YH[t.type])}class Cw{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const XH=t=>t/100;class Bm extends Cw{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Dr.now()&&this.tick(Dr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;vA(e);const{type:n=Vf,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||Vf;u!==Vf&&typeof l[0]!="number"&&(this.mixKeyframes=Vh(XH,pA(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Ew(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:g,repeatDelay:v,type:w,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,R=r;if(p){const T=Math.min(this.currentTime,s)/l;let L=Math.floor(T),D=T%1;!D&&T>=1&&(D=1),D===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(g==="reverse"?(D=1-D,v&&(D-=v/l)):g==="mirror"&&(R=o)),C=Zi(0,1,D)*l}let A;E?(this.delayState.value=f[0],A=this.delayState):A=R.next(C),i&&!E&&(A.value=i(A.value));let{done:M}=A;!E&&u!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return I&&w!==_2&&(A.value=Rg(f,this.options,x,this.speed)),_&&_(A.value),I&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return Bs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Bs(e)}get time(){return Bs(this.currentTime)}set time(e){e=xs(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return gA(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(Dr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Bs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=LH,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Dr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function QH(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Hl=t=>t*180/Math.PI,x2=t=>{const e=Hl(Math.atan2(t[1],t[0]));return w2(e)},JH={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:x2,rotateZ:x2,skewX:t=>Hl(Math.atan(t[1])),skewY:t=>Hl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},w2=t=>(t=t%360,t<0&&(t+=360),t),Ak=x2,Tk=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ik=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ez={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tk,scaleY:Ik,scale:t=>(Tk(t)+Ik(t))/2,rotateX:t=>w2(Hl(Math.atan2(t[6],t[5]))),rotateY:t=>w2(Hl(Math.atan2(-t[2],t[0]))),rotateZ:Ak,rotate:Ak,skewX:t=>Hl(Math.atan(t[4])),skewY:t=>Hl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function b2(t){return t.includes("scale")?1:0}function S2(t,e){if(!t||t==="none")return b2(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=ez,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=JH,s=l}if(!s)return b2(e);const i=r[e],o=s[1].split(",").map(nz);return typeof i=="function"?i(o):o[i]}const tz=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return S2(n,e)};function nz(t){return parseFloat(t.trim())}const ud=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dd=new Set([...ud,"pathRotation"]),Mk=t=>t===cd||t===Ve,rz=new Set(["x","y","z"]),sz=ud.filter(t=>!rz.has(t));function iz(t){const e=[];return sz.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Pa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>S2(e,"x"),y:(t,{transform:e})=>S2(e,"y")};Pa.translateX=Pa.x;Pa.translateY=Pa.y;const tc=new Set;let k2=!1,E2=!1,C2=!1;function yA(){if(E2){const t=Array.from(tc).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=iz(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}E2=!1,k2=!1,tc.forEach(t=>t.complete(C2)),tc.clear()}function _A(){tc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(E2=!0)})}function oz(){C2=!0,_A(),yA(),C2=!1}class Pw{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(tc.add(this),k2||(k2=!0,Gt.read(_A),Gt.resolveKeyframes(yA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}QH(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),tc.delete(this)}cancel(){this.state==="scheduled"&&(tc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const az=t=>t.startsWith("--");function xA(t,e,n){az(e)?t.style.setProperty(e,n):t.style[e]=n}const lz={};function wA(t,e){const n=GR(t);return()=>lz[e]??n()}const cz=wA(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bA=wA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Ok={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xf([0,.65,.55,1]),circOut:xf([.55,0,1,.45]),backIn:xf([.31,.01,.66,-.59]),backOut:xf([.33,1.53,.69,.99])};function SA(t,e){if(t)return typeof t=="function"?bA()?mA(t,e):"ease-out":iA(t)?xf(t):Array.isArray(t)?t.map(n=>SA(n,e)||Ok.easeOut):Ok[t]}function uz(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const p=SA(l,s);Array.isArray(p)&&(f.easing=p);const g={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(f,g)}function kA(t){return typeof t=="function"&&"applyToOptions"in t}function dz({type:t,...e}){return kA(t)&&bA()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class EA extends Cw{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Pg(typeof e.type!="string");const d=dz(e);this.animation=uz(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Rg(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),xA(n,r,f),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Bs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Bs(e)}get time(){return Bs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xs(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&cz()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),qs):s(this)}}const CA={anticipate:tA,backInOut:eA,circInOut:rA};function fz(t){return t in CA}function hz(t){typeof t.ease=="string"&&fz(t.ease)&&(t.ease=CA[t.ease])}const Cy=10;class pz extends EA{constructor(e){hz(e),vA(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new Bm({...o,autoplay:!1}),u=Math.max(Cy,Dr.now()-this.startTime),d=Zi(0,Cy,u-Cy),f=l.sample(u).value,{name:p}=this.options;i&&p&&xA(i,p,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const Lk=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gi.test(t)||t==="0")&&!t.startsWith("url("));function mz(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function gz(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=Lk(s,e),l=Lk(i,e);return!o||!l?!1:mz(t)||(n==="spring"||kA(n))&&r}function P2(t){t.duration=0,t.type="keyframes"}const PA=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),vz=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function yz(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&vz.test(t[e]))return!0;return!1}const _z=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),xz=GR(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wz(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return xz()&&n&&(PA.has(n)||_z.has(n)&&yz(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const bz=40;class Sz extends Cw{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Dr.now();const g={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...p},v=(f==null?void 0:f.KeyframeResolver)||Pw;this.keyframeResolver=new v(l,(_,x,b)=>this.onKeyframesResolved(_,x,g,!b),u,d,f),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,E;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Dr.now();let p=!0;gz(e,i,o,l)||(p=!1,(Va.instantAnimations||!u)&&(f==null||f(Rg(e,r,n))),e[0]=e[e.length-1],P2(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>bz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&wz(v),_=(E=(b=v.motionValue)==null?void 0:b.owner)==null?void 0:E.current;let x;if(w)try{x=new pz({...v,element:_})}catch{x=new Bm(v)}else x=new Bm(v);x.finished.then(()=>{this.notifyFinished()}).catch(qs),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),oz()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function RA(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const Nk=30,kz=t=>!isNaN(parseFloat(t));class Ez{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Dr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Dr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=kz(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new yw);const r=this.events[e].add(n);return e==="change"?()=>{r(),Gt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Dr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Nk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Nk);return KR(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ku(t,e){return new Ez(t,e)}function AA(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Rw(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?AA(n,t):n}const Cz={type:"spring",stiffness:500,damping:25,restSpeed:10},Pz=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Rz={type:"keyframes",duration:.8},Az={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Tz=(t,{keyframes:e})=>e.length>2?Rz:dd.has(t)?t.startsWith("scale")?Pz(e[1]):Cz:Az,Iz=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Mz(t){for(const e in t)if(!Iz.has(e))return!0;return!1}const Aw=(t,e,n,r={},s,i)=>o=>{const l=Rw(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-xs(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};Mz(l)||Object.assign(f,Tz(t,f)),f.duration&&(f.duration=xs(f.duration)),f.repeatDelay&&(f.repeatDelay=xs(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(P2(f),f.delay===0&&(p=!0)),(Va.instantAnimations||Va.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(p=!0,P2(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,p&&!i&&e.get()!==void 0){const g=Rg(f.keyframes,l);if(g!==void 0){Gt.update(()=>{f.onUpdate(g),f.onComplete()});return}}return l.isSync?new Bm(f):new Sz(f)},Oz=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Lz(t){const e=Oz.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function TA(t,e,n=1){const[r,s]=Lz(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return ZR(o)?parseFloat(o):o}return ww(s)?TA(s,e,n+1):s}function Dk(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Tw(t,e,n,r){if(typeof e=="function"){const[s,i]=Dk(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=Dk(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function nc(t,e,n){const r=t.getProps();return Tw(r,e,n!==void 0?n:r.custom,t)}const IA=new Set(["width","height","top","left","right","bottom",...ud]),R2=t=>Array.isArray(t);function Nz(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ku(n))}function Dz(t){return R2(t)?t[t.length-1]||0:t}function $z(t,e){const n=nc(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Dz(i[o]);Nz(t,o,l)}}const gr=t=>!!(t&&t.getVelocity);function jz(t){return!!(gr(t)&&t.add)}function A2(t,e){const n=t.getValue("willChange");if(jz(n))return n.add(e);if(!n&&Va.WillChange){const r=new Va.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Iw(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Fz="framerAppearId",MA="data-"+Iw(Fz);function OA(t){return t.props[MA]}function Vz({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function LA(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?AA(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],g=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,p);for(const w in l){const _=t.getValue(w,t.latestValues[w]??null),x=l[w];if(x===void 0||g&&Vz(g,w))continue;const b={delay:n,...Rw(i||{},w)};f&&(b.skipAnimations=!0);const E=_.get();if(E!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===E&&!b.velocity){Gt.update(()=>_.set(x));continue}let C=!1;if(window.MotionHandoffAnimation){const M=OA(t);if(M){const I=window.MotionHandoffAnimation(M,w,Gt);I!==null&&(b.startTime=I,C=!0)}}A2(t,w);const R=d??t.shouldReduceMotion;_.start(Aw(w,_,x,R&&IA.has(w)?{type:!1}:b,t,C));const A=_.animation;A&&p.push(A)}if(o){const w=()=>Gt.update(()=>{o&&$z(t,o)});p.length?Promise.all(p).then(w):w()}return p}function T2(t,e,n={}){var u;const r=nc(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(LA(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:g}=s;return Hz(t,e,d,f,p,g,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function Hz(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(T2(u,e,{...o,delay:n+(typeof r=="function"?0:r)+RA(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function zz(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>T2(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=T2(t,e,n);else{const s=typeof e=="function"?nc(t,e,n.custom):e;r=Promise.all(LA(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Bz={test:t=>t==="auto",parse:t=>t},NA=t=>e=>e.test(t),DA=[cd,Ve,zi,_o,mH,pH,Bz],$k=t=>DA.find(NA(t));function Uz(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||qR(t):!0}const Zz=new Set(["brightness","contrast","saturate","opacity"]);function Wz(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(bw)||[];if(!r)return t;const s=n.replace(r,"");let i=Zz.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const qz=/\b([a-z-]*)\(.*?\)/gu,I2={...gi,getAnimatableNone:t=>{const e=t.match(qz);return e?e.map(Wz).join(" "):t}},M2={...gi,getAnimatableNone:t=>{const e=gi.parse(t);return gi.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},jk={...cd,transform:Math.round},Gz={rotate:_o,pathRotation:_o,rotateX:_o,rotateY:_o,rotateZ:_o,scale:g0,scaleX:g0,scaleY:g0,scaleZ:g0,skew:_o,skewX:_o,skewY:_o,distance:Ve,translateX:Ve,translateY:Ve,translateZ:Ve,x:Ve,y:Ve,z:Ve,perspective:Ve,transformPerspective:Ve,opacity:ah,originX:kk,originY:kk,originZ:Ve},Um={borderWidth:Ve,borderTopWidth:Ve,borderRightWidth:Ve,borderBottomWidth:Ve,borderLeftWidth:Ve,borderRadius:Ve,borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomRightRadius:Ve,borderBottomLeftRadius:Ve,width:Ve,maxWidth:Ve,height:Ve,maxHeight:Ve,top:Ve,right:Ve,bottom:Ve,left:Ve,inset:Ve,insetBlock:Ve,insetBlockStart:Ve,insetBlockEnd:Ve,insetInline:Ve,insetInlineStart:Ve,insetInlineEnd:Ve,padding:Ve,paddingTop:Ve,paddingRight:Ve,paddingBottom:Ve,paddingLeft:Ve,paddingBlock:Ve,paddingBlockStart:Ve,paddingBlockEnd:Ve,paddingInline:Ve,paddingInlineStart:Ve,paddingInlineEnd:Ve,margin:Ve,marginTop:Ve,marginRight:Ve,marginBottom:Ve,marginLeft:Ve,marginBlock:Ve,marginBlockStart:Ve,marginBlockEnd:Ve,marginInline:Ve,marginInlineStart:Ve,marginInlineEnd:Ve,fontSize:Ve,backgroundPositionX:Ve,backgroundPositionY:Ve,...Gz,zIndex:jk,fillOpacity:ah,strokeOpacity:ah,numOctaves:jk},Kz={...Um,color:Hn,backgroundColor:Hn,outlineColor:Hn,fill:Hn,stroke:Hn,borderColor:Hn,borderTopColor:Hn,borderRightColor:Hn,borderBottomColor:Hn,borderLeftColor:Hn,filter:I2,WebkitFilter:I2,mask:M2,WebkitMask:M2},$A=t=>Kz[t],Yz=new Set([I2,M2]);function jA(t,e){let n=$A(t);return Yz.has(n)||(n=gi),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Xz=new Set(["auto","none","0"]);function Qz(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Xz.has(i)&&Gu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=jA(n,s)}class Jz extends Pw{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let f=0;f<e.length;f++){let p=e[f];if(typeof p=="string"&&(p=p.trim(),ww(p))){const g=TA(p,n.current);g!==void 0&&(e[f]=g),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!IA.has(r)||e.length!==2)return;const[s,i]=e,o=$k(s),l=$k(i),u=Sk(s),d=Sk(i);if(u!==d&&Pa[r]){this.needsMeasurement=!0;return}if(o!==l)if(Mk(o)&&Mk(l))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else Pa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||Uz(e[s]))&&r.push(s);r.length&&Qz(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pa[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Pa[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const Mw=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function FA(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const O2=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function G0(t){return WR(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Ow}=oA(queueMicrotask,!1),ui={x:!1,y:!1};function VA(){return ui.x||ui.y}function eB(t){return t==="x"||t==="y"?ui[t]?null:(ui[t]=!0,()=>{ui[t]=!1}):ui.x||ui.y?null:(ui.x=ui.y=!0,()=>{ui.x=ui.y=!1})}function HA(t,e){const n=FA(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function tB(t){return!(t.pointerType==="touch"||VA())}function nB(t,e,n={}){const[r,s,i]=HA(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),f()},g=x=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),u&&(u=!1,p(x))},v=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},w=x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}p(x)}},_=x=>{if(!tB(x))return;u=!1;const b=e(o,x);typeof b=="function"&&(d=b,o.addEventListener("pointerleave",w,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const zA=(t,e)=>e?t===e?!0:zA(t,e.parentElement):!1,Lw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,rB=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sB(t){return rB.has(t.tagName)||t.isContentEditable===!0}const iB=new Set(["INPUT","SELECT","TEXTAREA"]);function oB(t){return iB.has(t.tagName)||t.isContentEditable===!0}const K0=new WeakSet;function Fk(t){return e=>{e.key==="Enter"&&t(e)}}function Py(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const aB=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Fk(()=>{if(K0.has(n))return;Py(n,"down");const s=Fk(()=>{Py(n,"up")}),i=()=>Py(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Vk(t){return Lw(t)&&!VA()}const Hk=new WeakSet;function lB(t,e,n={}){const[r,s,i]=HA(t,n),o=l=>{const u=l.currentTarget;if(!Vk(l)||Hk.has(l))return;K0.add(u),n.stopPropagation&&Hk.add(l);const d=e(u,l),f={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",g,f),window.removeEventListener("pointercancel",v,f),K0.has(u)&&K0.delete(u),Vk(w)&&typeof d=="function"&&d(w,{success:_})},g=w=>{p(w,u===window||u===document||n.useGlobalTarget||zA(u,w.target))},v=w=>{p(w,!1)};window.addEventListener("pointerup",g,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),G0(l)&&(l.addEventListener("focus",d=>aB(d,s)),!sB(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Nw(t){return WR(t)&&"ownerSVGElement"in t}const Y0=new WeakMap;let pa;const BA=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:Nw(r)&&"getBBox"in r?r.getBBox()[e]:r[n],cB=BA("inline","width","offsetWidth"),uB=BA("block","height","offsetHeight");function dB({target:t,borderBoxSize:e}){var n;(n=Y0.get(t))==null||n.forEach(r=>{r(t,{get width(){return cB(t,e)},get height(){return uB(t,e)}})})}function fB(t){t.forEach(dB)}function hB(){typeof ResizeObserver>"u"||(pa=new ResizeObserver(fB))}function pB(t,e){pa||hB();const n=FA(t);return n.forEach(r=>{let s=Y0.get(r);s||(s=new Set,Y0.set(r,s)),s.add(e),pa==null||pa.observe(r)}),()=>{n.forEach(r=>{const s=Y0.get(r);s==null||s.delete(e),s!=null&&s.size||pa==null||pa.unobserve(r)})}}const X0=new Set;let gu;function mB(){gu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};X0.forEach(e=>e(t))},window.addEventListener("resize",gu)}function gB(t){return X0.add(t),gu||mB(),()=>{X0.delete(t),!X0.size&&typeof gu=="function"&&(window.removeEventListener("resize",gu),gu=void 0)}}function zk(t,e){return typeof t=="function"?gB(t):pB(t,e)}function vB(t){return Nw(t)&&t.tagName==="svg"}const yB=[...DA,Hn,gi],_B=t=>yB.find(NA(t)),Bk=()=>({translate:0,scale:1,origin:0,originPoint:0}),vu=()=>({x:Bk(),y:Bk()}),Uk=()=>({min:0,max:0}),Yn=()=>({x:Uk(),y:Uk()}),xB=new WeakMap;function Ag(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function lh(t){return typeof t=="string"||Array.isArray(t)}const Dw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$w=["initial",...Dw];function Tg(t){return Ag(t.animate)||$w.some(e=>lh(t[e]))}function UA(t){return!!(Tg(t)||t.variants)}function wB(t,e,n){for(const r in e){const s=e[r],i=n[r];if(gr(s))t.addValue(r,s);else if(gr(i))t.addValue(r,Ku(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,Ku(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Zm={current:null},jw={current:!1},bB=typeof window<"u";function ZA(){if(jw.current=!0,!!bB)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Zm.current=t.matches;t.addEventListener("change",e),e()}else Zm.current=!1}const Zk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wm={};function WA(t){Wm=t}function SB(){return Wm}class kB{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Pw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Dr.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Gt.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Tg(n),this.isVariantNode=UA(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const w=g[v];d[v]!==void 0&&gr(w)&&w.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,xB.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(jw.current||ZA(),this.shouldReduceMotion=Zm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Ha(this.notifyUpdate),Ha(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&PA.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,p=new EA({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:xs(f)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const r=dd.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Gt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Wm){const n=Wm[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Yn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Zk.length;r++){const s=Zk[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=wB(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Ku(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(ZR(r)||qR(r))?r=parseFloat(r):!_B(r)&&gi.test(n)&&(r=jA(e,n)),this.setBaseTarget(e,gr(r)?r.get():r)),gr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Tw(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!gr(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new yw),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Ow.render(this.render)}}class qA extends kB{constructor(){super(...arguments),this.KeyframeResolver=Jz}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;gr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ya{constructor(e){this.isMounted=!1,this.node=e}update(){}}function GA({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function EB({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function CB(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ry(t){return t===void 0||t===1}function L2({scale:t,scaleX:e,scaleY:n}){return!Ry(t)||!Ry(e)||!Ry(n)}function $l(t){return L2(t)||KA(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function KA(t){return Wk(t.x)||Wk(t.y)}function Wk(t){return t&&t!=="0%"}function qm(t,e,n){const r=t-n,s=e*r;return n+s}function qk(t,e,n,r,s){return s!==void 0&&(t=qm(t,s,r)),qm(t,n,r)+e}function N2(t,e=0,n=1,r,s){t.min=qk(t.min,e,n,r,s),t.max=qk(t.max,e,n,r,s)}function YA(t,{x:e,y:n}){N2(t.x,e.translate,e.scale,e.originPoint),N2(t.y,n.translate,n.scale,n.originPoint)}const Gk=.999999999999,Kk=1.0000000000001;function PB(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Di(t.x,-i.scroll.offset.x),Di(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,YA(t,o)),r&&$l(i.latestValues)&&Q0(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<Kk&&e.x>Gk&&(e.x=1),e.y<Kk&&e.y>Gk&&(e.y=1)}function Di(t,e){t.min+=e,t.max+=e}function Yk(t,e,n,r,s=.5){const i=qt(t.min,t.max,s);N2(t,e,n,i,r)}function Xk(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Q0(t,e,n){const r=n??t;Yk(t.x,Xk(e.x,r.x),e.scaleX,e.scale,e.originX),Yk(t.y,Xk(e.y,r.y),e.scaleY,e.scale,e.originY)}function XA(t,e){return GA(CB(t.getBoundingClientRect(),e))}function RB(t,e,n){const r=XA(t,n),{scroll:s}=e;return s&&(Di(r.x,s.offset.x),Di(r.y,s.offset.y)),r}const AB={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},TB=ud.length;function IB(t,e,n){let r="",s=!0;for(let o=0;o<TB;o++){const l=ud[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const f=parseFloat(u);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=O2(u,Um[l]);if(!d){s=!1;const p=AB[l]||l;r+=`${p}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${O2(i,Um.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function Fw(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(dd.has(u)){o=!0;continue}else if(lA(u)){s[u]=d;continue}else{const f=O2(d,Um[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=IB(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function QA(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Qk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const hf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ve.test(t))t=parseFloat(t);else return t;const n=Qk(t,e.target.x),r=Qk(t,e.target.y);return`${n}% ${r}%`}},MB={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=gi.parse(t);if(s.length>5)return r;const i=gi.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=qt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},D2={borderRadius:{...hf,applyTo:[...Mw]},borderTopLeftRadius:hf,borderTopRightRadius:hf,borderBottomLeftRadius:hf,borderBottomRightRadius:hf,boxShadow:MB};function JA(t,{layout:e,layoutId:n}){return dd.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!D2[t]||t==="opacity")}function Vw(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(gr(r[l])||s&&gr(s[l])||JA(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function OB(t){return window.getComputedStyle(t)}class LB extends qA{constructor(){super(...arguments),this.type="html",this.renderInstance=QA}mount(e){Pg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(dd.has(n))return(r=this.projection)!=null&&r.isProjecting?b2(n):tz(e,n);{const s=OB(e),i=(lA(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return XA(e,n)}build(e,n,r){Fw(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Vw(e,n,r)}}const NB={offset:"stroke-dashoffset",array:"stroke-dasharray"},DB={offset:"strokeDashoffset",array:"strokeDasharray"};function $B(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?NB:DB;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const jB=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(Fw(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g}=t;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const v of jB)p[v]!==void 0&&(g[v]=p[v],delete p[v]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&$B(p,s,i,o,!1)}const tT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),nT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function FB(t,e,n,r){QA(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(tT.has(s)?s:Iw(s),e.attrs[s])}function rT(t,e,n){const r=Vw(t,e,n);for(const s in t)if(gr(t[s])||gr(e[s])){const i=ud.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class VB extends qA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Yn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(dd.has(n)){const r=$A(n);return r&&r.default||0}return n=tT.has(n)?n:Iw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return rT(e,n,r)}build(e,n,r){eT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){FB(e,n,r,s)}mount(e){this.isSVGTag=nT(e.tagName),super.mount(e)}}const HB=$w.length;function sT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?sT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<HB;n++){const r=$w[n],s=t.props[r];(lh(s)||s===!1)&&(e[r]=s)}return e}function iT(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const zB=[...Dw].reverse(),BB=Dw.length;function UB(t){return e=>Promise.all(e.map(({animation:n,options:r})=>zz(t,n,r)))}function ZB(t){let e=UB(t),n=Jk(),r=!0,s=!1;const i=d=>(f,p)=>{var v;const g=nc(t,p,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:w,transitionEnd:_,...x}=g;f={...f,...x,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,p=sT(t.parent)||{},g=[],v=new Set;let w={},_=1/0;for(let b=0;b<BB;b++){const E=zB[b],C=n[E],R=f[E]!==void 0?f[E]:p[E],A=lh(R),M=E===d?C.isActive:null;M===!1&&(_=b);let I=R===p[E]&&R!==f[E]&&A;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={...w},!C.isActive&&M===null||!R&&!C.prevProp||Ag(R)||typeof R=="boolean")continue;if(E==="exit"&&C.isActive&&M!==!0){C.prevResolvedValues&&(w={...w,...C.prevResolvedValues});continue}const T=WB(C.prevProp,R);let L=T||E===d&&C.isActive&&!I&&A||b>_&&A,D=!1;const B=Array.isArray(R)?R:[R];let j=B.reduce(i(E),{});M===!1&&(j={});const{prevResolvedValues:K={}}=C,U={...K,...j},H=z=>{L=!0,v.has(z)&&(D=!0,v.delete(z)),C.needsAnimating[z]=!0;const ee=t.getValue(z);ee&&(ee.liveStyle=!1)};for(const z in U){const ee=j[z],W=K[z];if(w.hasOwnProperty(z))continue;let N=!1;R2(ee)&&R2(W)?N=!iT(ee,W)||T:N=ee!==W,N?ee!=null?H(z):v.add(z):ee!==void 0&&v.has(z)?H(z):C.protectedKeys[z]=!0}C.prevProp=R,C.prevResolvedValues=j,C.isActive&&(w={...w,...j}),(r||s)&&t.blockInitialAnimation&&(L=!1);const Z=I&&T;L&&(!Z||D)&&g.push(...B.map(z=>{const ee={type:E};if(typeof z=="string"&&(r||s)&&!Z&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,N=nc(W,z);if(W.enteringChildren&&N){const{delayChildren:X}=N.transition||{};ee.delay=RA(W.enteringChildren,t,X)}}return{animation:z,options:ee}}))}if(v.size){const b={};if(typeof f.initial!="boolean"){const E=nc(t,Array.isArray(f.initial)?f.initial[0]:f.initial);E&&E.transition&&(b.transition=E.transition)}v.forEach(E=>{const C=t.getBaseTarget(E),R=t.getValue(E);R&&(R.liveStyle=!0),b[E]=C??null}),g.push({animation:b})}let x=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(g):Promise.resolve()}function u(d,f){var g;if(n[d].isActive===f)return Promise.resolve();(g=t.variantChildren)==null||g.forEach(v=>{var w;return(w=v.animationState)==null?void 0:w.setActive(d,f)}),n[d].isActive=f;const p=l(d);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Jk(),s=!0}}}function WB(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!iT(e,t):!1}function El(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Jk(){return{animate:El(!0),whileInView:El(),whileHover:El(),whileTap:El(),whileDrag:El(),whileFocus:El(),exit:El()}}function $2(t,e){t.min=e.min,t.max=e.max}function ai(t,e){$2(t.x,e.x),$2(t.y,e.y)}function eE(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const oT=1e-4,qB=1-oT,GB=1+oT,aT=.01,KB=0-aT,YB=0+aT;function $r(t){return t.max-t.min}function XB(t,e,n){return Math.abs(t-e)<=n}function tE(t,e,n,r=.5){t.origin=r,t.originPoint=qt(e.min,e.max,t.origin),t.scale=$r(n)/$r(e),t.translate=qt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=qB&&t.scale<=GB||isNaN(t.scale))&&(t.scale=1),(t.translate>=KB&&t.translate<=YB||isNaN(t.translate))&&(t.translate=0)}function Hf(t,e,n,r){tE(t.x,e.x,n.x,r?r.originX:void 0),tE(t.y,e.y,n.y,r?r.originY:void 0)}function nE(t,e,n,r=0){const s=r?qt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+$r(e)}function QB(t,e,n,r){nE(t.x,e.x,n.x,r==null?void 0:r.x),nE(t.y,e.y,n.y,r==null?void 0:r.y)}function rE(t,e,n,r=0){const s=r?qt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+$r(e)}function Gm(t,e,n,r){rE(t.x,e.x,n.x,r==null?void 0:r.x),rE(t.y,e.y,n.y,r==null?void 0:r.y)}function sE(t,e,n,r,s){return t-=e,t=qm(t,1/n,r),s!==void 0&&(t=qm(t,1/s,r)),t}function JB(t,e=0,n=1,r=.5,s,i=t,o=t){if(zi.test(e)&&(e=parseFloat(e),e=qt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=qt(i.min,i.max,r);t===i&&(l-=e),t.min=sE(t.min,e,n,l,s),t.max=sE(t.max,e,n,l,s)}function iE(t,e,[n,r,s],i,o){JB(t,e[n],e[r],e[s],e.scale,i,o)}const eU=["x","scaleX","originX"],tU=["y","scaleY","originY"];function oE(t,e,n,r){iE(t.x,e,eU,n?n.x:void 0,r?r.x:void 0),iE(t.y,e,tU,n?n.y:void 0,r?r.y:void 0)}function aE(t){return t.translate===0&&t.scale===1}function lT(t){return aE(t.x)&&aE(t.y)}function lE(t,e){return t.min===e.min&&t.max===e.max}function nU(t,e){return lE(t.x,e.x)&&lE(t.y,e.y)}function cE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function cT(t,e){return cE(t.x,e.x)&&cE(t.y,e.y)}function uE(t){return $r(t.x)/$r(t.y)}function dE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ii(t){return[t("x"),t("y")]}function rU(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:p,rotateX:g,rotateY:v,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),w&&(r+=`skewX(${w}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const sU=Mw.length,fE=t=>typeof t=="string"?parseFloat(t):t,hE=t=>typeof t=="number"||Ve.test(t);function iU(t,e,n,r,s,i){s?(t.opacity=qt(0,n.opacity??1,oU(r)),t.opacityExit=qt(e.opacity??1,0,aU(r))):i&&(t.opacity=qt(e.opacity??1,n.opacity??1,r));for(let o=0;o<sU;o++){const l=Mw[o];let u=pE(e,l),d=pE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||hE(u)===hE(d)?(t[l]=Math.max(qt(fE(u),fE(d),r),0),(zi.test(d)||zi.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=qt(e.rotate||0,n.rotate||0,r))}function pE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const oU=uT(0,.5,nA),aU=uT(.5,.95,qs);function uT(t,e,n){return r=>r<t?0:r>e?1:n(oh(t,e,r))}function lU(t,e,n){const r=gr(t)?t:Ku(t);return r.start(Aw("",r,e,n)),r.animation}function ch(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const cU=(t,e)=>t.depth-e.depth;class uU{constructor(){this.children=[],this.isDirty=!1}add(e){vw(this.children,e),this.isDirty=!0}remove(e){Fm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(cU),this.isDirty=!1,this.children.forEach(e)}}function dU(t,e){const n=Dr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Ha(r),t(i-e))};return Gt.setup(r,!0),()=>Ha(r)}function J0(t){return gr(t)?t.get():t}class fU{constructor(){this.members=[]}add(e){vw(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Fm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Fm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const em={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ay=["","X","Y","Z"],hU=1e3;let pU=0;function Ty(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function dT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=OA(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Gt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&dT(r)}function fT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=pU++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(vU),this.nodes.forEach(SU),this.nodes.forEach(kU),this.nodes.forEach(yU)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new uU)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new yw),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Nw(o)&&!vB(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let f,p=0;const g=()=>this.root.updateBlockedByResize=!1;Gt.read(()=>{p=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,f&&f(),f=dU(g,250),em.hasAnimatedSinceResize&&(em.hasAnimatedSinceResize=!1,this.nodes.forEach(vE)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||AU,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),b=!this.targetLayout||!cT(this.targetLayout,v),E=!p&&g;if(this.options.layoutRoot||this.resumeFrom||E||p&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Rw(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,E,C.path)}else p||vE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ha(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(EU),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(xU),this.nodes.forEach(mE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(gE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(wU),this.nodes.forEach(bU),this.nodes.forEach(mU),this.nodes.forEach(gU)):this.nodes.forEach(gE),this.clearAllSnapshots();const l=Dr.now();hr.delta=Zi(0,1e3/60,l-hr.timestamp),hr.timestamp=l,hr.isProcessing=!0,wy.update.process(hr),wy.preRender.process(hr),wy.render.process(hr),hr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ow.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_U),this.sharedNodes.forEach(CU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Gt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Gt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$r(this.snapshot.measuredBox.x)&&!$r(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Yn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!lT(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||$l(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),TU(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Yn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(IU))){const{scroll:f}=this.root;f&&(Di(l.x,f.offset.x),Di(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=Yn();if(ai(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:g}=f;f!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&ai(l,o),Di(l.x,p.offset.x),Di(l.y,p.offset.y))}return l}applyTransform(o,l=!1,u){var f,p;const d=u||Yn();ai(d,o);for(let g=0;g<this.path.length;g++){const v=this.path[g];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Di(d.x,-v.scroll.offset.x),Di(d.y,-v.scroll.offset.y)),$l(v.latestValues)&&Q0(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return $l(this.latestValues)&&Q0(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const l=Yn();ai(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!$l(f.latestValues))continue;let p;f.instance&&(L2(f.latestValues)&&f.updateSnapshot(),p=Yn(),ai(p,f.measurePageBox())),oE(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return $l(this.latestValues)&&oE(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==hr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=hr.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Yn(),this.targetWithTransforms=Yn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),QB(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ai(this.target,this.layout.layoutBox),YA(this.target,this.targetDelta)):ai(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||L2(this.parent.latestValues)||KA(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Yn(),this.relativeTargetOrigin=Yn(),Gm(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),ai(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===hr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;ai(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;PB(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Yn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(eE(this.prevProjectionDelta.x,this.projectionDelta.x),eE(this.prevProjectionDelta.y,this.projectionDelta.y)),Hf(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!dE(this.projectionDelta.x,this.prevProjectionDelta.x)||!dE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vu(),this.projectionDelta=vu(),this.projectionDeltaWithTransform=vu()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},g=vu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Yn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,b=this.getStack(),E=!b||b.members.length<=1,C=!!(x&&!E&&this.options.crossfade===!0&&!this.path.some(RU));this.animationProgress=0;let R;const A=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=M=>{const I=M/1e3,T=A==null?void 0:A(I);T?(g.x.translate=T.x,g.x.scale=qt(o.x.scale,1,I),g.x.origin=o.x.origin,g.x.originPoint=o.x.originPoint,g.y.translate=T.y,g.y.scale=qt(o.y.scale,1,I),g.y.origin=o.y.origin,g.y.originPoint=o.y.originPoint):(yE(g.x,o.x,I),yE(g.y,o.y,I)),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gm(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),PU(this.relativeTarget,this.relativeTargetOrigin,v,I),R&&nU(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Yn()),ai(R,this.relativeTarget)),x&&(this.animationValues=p,iU(p,f,this.latestValues,I,C,E)),T&&T.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=T.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ha(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Gt.update(()=>{em.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ku(0)),this.motionValue.jump(0,!1),this.currentAnimation=lU(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:f}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&hT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Yn();const p=$r(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const g=$r(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+g}ai(l,u),Q0(l,f),Hf(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new fU),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&Ty("z",o,d,this.animationValues);for(let f=0;f<Ay.length;f++)Ty(`rotate${Ay[f]}`,o,d,this.animationValues),Ty(`skew${Ay[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=J0(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=J0(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!$l(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=rU(this.projectionDeltaWithTransform,this.treeScale,f);u&&(p=u(f,p)),o.transform=p;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const w in D2){if(f[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:b}=D2[w],E=p==="none"?f[w]:_(f[w],d);if(x){const C=x.length;for(let R=0;R<C;R++)o[x[R]]=E}else b?this.options.visualElement.renderState.vars[w]=E:o[w]=E}this.options.layoutId&&(o.pointerEvents=d===this?J0(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(mE),this.root.sharedNodes.clear()}}}function mU(t){t.updateLayout()}function gU(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Ii(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=$r(g);g.min=r[p].min,g.max=g.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";$2(o?e.measuredBox[p]:e.layoutBox[p],r[p])}else hT(i,e.layoutBox,r)&&Ii(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=$r(r[p]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+v)});const l=vu();Hf(l,r,e.layoutBox);const u=vu();o?Hf(u,t.applyTransform(s,!0),e.measuredBox):Hf(u,r,e.layoutBox);const d=!lT(l);let f=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:v}=p;if(g&&v){const w=t.options.layoutAnchor||void 0,_=Yn();Gm(_,e.layoutBox,g.layoutBox,w);const x=Yn();Gm(x,r,v.layoutBox,w),cT(_,x)||(f=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function vU(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function yU(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function _U(t){t.clearSnapshot()}function mE(t){t.clearMeasurements()}function xU(t){t.isLayoutDirty=!0,t.updateLayout()}function gE(t){t.isLayoutDirty=!1}function wU(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function bU(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function vE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function SU(t){t.resolveTargetDelta()}function kU(t){t.calcProjection()}function EU(t){t.resetSkewAndRotation()}function CU(t){t.removeLeadSnapshot()}function yE(t,e,n){t.translate=qt(e.translate,0,n),t.scale=qt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function _E(t,e,n,r){t.min=qt(e.min,n.min,r),t.max=qt(e.max,n.max,r)}function PU(t,e,n,r){_E(t.x,e.x,n.x,r),_E(t.y,e.y,n.y,r)}function RU(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const AU={duration:.45,ease:[.4,0,.1,1]},xE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),wE=xE("applewebkit/")&&!xE("chrome/")?Math.round:qs;function bE(t){t.min=wE(t.min),t.max=wE(t.max)}function TU(t){bE(t.x),bE(t.y)}function hT(t,e,n){return t==="position"||t==="preserve-aspect"&&!XB(uE(e),uE(n),.2)}function IU(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const MU=fT({attachResizeListener:(t,e)=>ch(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Iy={current:void 0},pT=fT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Iy.current){const t=new MU({});t.mount(window),t.setOptions({layoutScroll:!0}),Iy.current=t}return Iy.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Hw=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function SE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function OU(...t){return e=>{let n=!1;const r=t.map(s=>{const i=SE(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():SE(t[s],null)}}}}function LU(...t){return m.useCallback(OU(...t),t)}class NU extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(G0(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=G0(r)&&r.offsetWidth||0,i=G0(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function DU({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var g;const o=m.useId(),l=m.useRef(null),u=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=m.useContext(Hw),f=i!==!1?((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref):void 0,p=LU(l,f);return m.useInsertionEffect(()=>{const{width:v,height:w,top:_,left:x,right:b,bottom:E,direction:C}=u.current;if(e||i===!1||!l.current||!v||!w)return;const R=C==="rtl",A=n==="left"?R?`right: ${b}`:`left: ${x}`:R?`left: ${x}`:`right: ${b}`,M=r==="bottom"?`bottom: ${E}`:`top: ${_}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const T=s??document.head;return T.appendChild(I),I.sheet&&I.sheet.insertRule(`
64
+ [data-motion-pop-id="${o}"] {
65
+ position: absolute !important;
66
+ width: ${v}px !important;
67
+ height: ${w}px !important;
68
+ ${A}px !important;
69
+ ${M}px !important;
70
+ }
71
+ `),()=>{var L;(L=l.current)==null||L.removeAttribute("data-motion-pop-id"),T.contains(I)&&T.removeChild(I)}},[e]),S.jsx(NU,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:p})})}const $U=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=mw(jU),p=m.useId(),g=m.useRef(n),v=m.useRef(r);gw(()=>{g.current=n,v.current=r});let w=!0,_=m.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{f.set(x,!0);for(const b of f.values())if(!b)return;r&&r()},register:x=>(f.set(x,!1),()=>{var b;f.delete(x),!g.current&&!f.size&&((b=v.current)==null||b.call(v))})}),[n,f,r]);return i&&w&&(_={..._}),m.useMemo(()=>{f.forEach((x,b)=>f.set(b,!1))},[n]),m.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(DU,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),S.jsx(Cg.Provider,{value:_,children:t})};function jU(){return new Map}function mT(t=!0){const e=m.useContext(Cg);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=m.useId();m.useEffect(()=>{if(t)return s(i)},[t]);const o=m.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const v0=t=>t.key||"";function kE(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const ws=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,p]=mT(o),g=m.useMemo(()=>kE(t),[t]),v=o&&!f?[]:g.map(v0),w=m.useRef(!0),_=m.useRef(g),x=mw(()=>new Map),b=m.useRef(new Set),[E,C]=m.useState(g),[R,A]=m.useState(g);gw(()=>{w.current=!1,_.current=g;for(let T=0;T<R.length;T++){const L=v0(R[T]);v.includes(L)?(x.delete(L),b.current.delete(L)):x.get(L)!==!0&&x.set(L,!1)}},[R,v.length,v.join("-")]);const M=[];if(g!==E){let T=[...g];for(let L=0;L<R.length;L++){const D=R[L],B=v0(D);v.includes(B)||(T.splice(L,0,D),M.push(D))}return i==="wait"&&M.length&&(T=M),A(kE(T)),C(g),null}const{forceRender:I}=m.useContext(pw);return S.jsx(S.Fragment,{children:R.map(T=>{const L=v0(T),D=o&&!f?!1:g===R||v.includes(L),B=()=>{if(b.current.has(L))return;if(x.has(L))b.current.add(L),x.set(L,!0);else return;let j=!0;x.forEach(K=>{K||(j=!1)}),j&&(I==null||I(),A(_.current),o&&(p==null||p()),r&&r())};return S.jsx($U,{isPresent:D,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:B,anchorX:l,anchorY:u,children:T},L)})})},gT=m.createContext({strict:!1}),EE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let CE=!1;function FU(){if(CE)return;const t={};for(const e in EE)t[e]={isEnabled:n=>EE[e].some(r=>!!n[r])};WA(t),CE=!0}function vT(){return FU(),SB()}function VU(t){const e=vT();for(const n in t)e[n]={...e[n],...t[n]};WA(e)}const HU=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Km(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||HU.has(t)}let yT=t=>!Km(t);function zU(t){typeof t=="function"&&(yT=e=>e.startsWith("on")?!Km(e):t(e))}try{zU(require("@emotion/is-prop-valid").default)}catch{}function BU(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||gr(t[s])||(yT(s)||n===!0&&Km(s)||!e&&!Km(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Ig=m.createContext({});function UU(t,e){if(Tg(t)){const{initial:n,animate:r}=t;return{initial:n===!1||lh(n)?n:void 0,animate:lh(r)?r:void 0}}return t.inherit!==!1?e:{}}function ZU(t){const{initial:e,animate:n}=UU(t,m.useContext(Ig));return m.useMemo(()=>({initial:e,animate:n}),[PE(e),PE(n)])}function PE(t){return Array.isArray(t)?t.join(" "):t}const zw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _T(t,e,n){for(const r in e)!gr(e[r])&&!JA(r,n)&&(t[r]=e[r])}function WU({transformTemplate:t},e){return m.useMemo(()=>{const n=zw();return Fw(n,e,t),Object.assign({},n.vars,n.style)},[e])}function qU(t,e){const n=t.style||{},r={};return _T(r,n,t),Object.assign(r,WU(t,e)),r}function GU(t,e){const n={},r=qU(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const xT=()=>({...zw(),attrs:{}});function KU(t,e,n,r){const s=m.useMemo(()=>{const i=xT();return eT(i,e,nT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};_T(i,t.style,t),s.style={...i,...s.style}}return s}const YU=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bw(t){return typeof t!="string"||t.includes("-")?!1:!!(YU.indexOf(t)>-1||/[A-Z]/u.test(t))}function XU(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??Bw(t)?KU:GU)(e,r,s,t),d=BU(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:p}=e,g=m.useMemo(()=>gr(p)?p.get():p,[p]);return m.createElement(t,{...f,children:g})}function QU({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:JU(n,r,s,t),renderState:e()}}function JU(t,e,n,r){const s={},i=r(t,{});for(const g in i)s[g]=J0(i[g]);let{initial:o,animate:l}=t;const u=Tg(t),d=UA(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const p=f?l:o;if(p&&typeof p!="boolean"&&!Ag(p)){const g=Array.isArray(p)?p:[p];for(let v=0;v<g.length;v++){const w=Tw(t,g[v]);if(w){const{transitionEnd:_,transition:x,...b}=w;for(const E in b){let C=b[E];if(Array.isArray(C)){const R=f?C.length-1:0;C=C[R]}C!==null&&(s[E]=C)}for(const E in _)s[E]=_[E]}}}return s}const wT=t=>(e,n)=>{const r=m.useContext(Ig),s=m.useContext(Cg),i=()=>QU(t,e,r,s);return n?i():mw(i)},eZ=wT({scrapeMotionValuesFromProps:Vw,createRenderState:zw}),tZ=wT({scrapeMotionValuesFromProps:rT,createRenderState:xT}),nZ=Symbol.for("motionComponentSymbol");function rZ(t,e,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const bT=m.createContext({});function lu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function sZ(t,e,n,r,s,i){var C,R;const{visualElement:o}=m.useContext(Ig),l=m.useContext(gT),u=m.useContext(Cg),d=m.useContext(Hw),f=d.reducedMotion,p=d.skipAnimations,g=m.useRef(null),v=m.useRef(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const w=g.current,_=m.useContext(bT);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&iZ(g.current,n,s,_);const x=m.useRef(!1);m.useInsertionEffect(()=>{w&&x.current&&w.update(n,u)});const b=n[MA],E=m.useRef(!!b&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,b))&&((R=window.MotionHasOptimisedAnimation)==null?void 0:R.call(window,b)));return gw(()=>{v.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),E.current&&w.animationState&&w.animationState.animateChanges())}),m.useEffect(()=>{w&&(!E.current&&w.animationState&&w.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,b)}),E.current=!1),w.enteringChildren=void 0)}),w}function iZ(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ST(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&lu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function ST(t){if(t)return t.options.allowProjection!==!1?t.projection:ST(t.parent)}function My(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&VU(r);const i=n?n==="svg":Bw(t),o=i?tZ:eZ;function l(d,f){let p;const g={...m.useContext(Hw),...d,layoutId:oZ(d)},{isStatic:v}=g,w=ZU(d),_=o(d,v);if(!v&&typeof window<"u"){aZ();const x=lZ(g);p=x.MeasureLayout,w.visualElement=sZ(t,_,g,s,x.ProjectionNode,i)}return S.jsxs(Ig.Provider,{value:w,children:[p&&w.visualElement?S.jsx(p,{visualElement:w.visualElement,...g}):null,XU(t,d,rZ(_,w.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=m.forwardRef(l);return u[nZ]=t,u}function oZ({layoutId:t}){const e=m.useContext(pw).id;return e&&t!==void 0?e+"-"+t:t}function aZ(t,e){m.useContext(gT).strict}function lZ(t){const e=vT(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function cZ(t,e){if(typeof Proxy>"u")return My;const n=new Map,r=(i,o)=>My(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,My(o,void 0,t,e)),n.get(o))})}const uZ=(t,e)=>e.isSVG??Bw(t)?new VB(e):new LB(e,{allowProjection:t!==m.Fragment});class dZ extends Ya{constructor(e){super(e),e.animationState||(e.animationState=ZB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ag(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let fZ=0;class hZ extends Ya{constructor(){super(...arguments),this.id=fZ++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=nc(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...p}=u;for(const g in p)(i=this.node.getValue(g))==null||i.jump(p[g])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const pZ={animation:{Feature:dZ},exit:{Feature:hZ}};function Bh(t){return{point:{x:t.pageX,y:t.pageY}}}const mZ=t=>e=>Lw(e)&&t(e,Bh(e));function zf(t,e,n,r){return ch(t,e,mZ(n),r)}const kT=({current:t})=>t?t.ownerDocument.defaultView:null,RE=(t,e)=>Math.abs(t-e);function gZ(t,e){const n=RE(t.x,e.x),r=RE(t.y,e.y);return Math.sqrt(n**2+r**2)}const AE=new Set(["auto","scroll"]);class ET{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=y0(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Oy(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=gZ(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:b}=w,{timestamp:E}=hr;this.history.push({...b,timestamp:E});const{onStart:C,onMove:R}=this.handlers;_||(C&&C(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=y0(_,this.transformPagePoint),Gt.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Oy(w.type==="pointercancel"?this.lastMoveEventInfo:y0(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,C),b&&b(w,C)},!Lw(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=Bh(e),d=y0(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=hr;this.history=[{...f,timestamp:p}];const{onSessionStart:g}=n;g&&g(e,Oy(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Vh(zf(this.contextWindow,"pointermove",this.handlePointerMove,v),zf(this.contextWindow,"pointerup",this.handlePointerUp,v),zf(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(AE.has(r.overflowX)||AE.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Gt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ha(this.updatePoint)}}function y0(t,e){return e?{point:e(t.point)}:t}function TE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Oy({point:t},e){return{point:t,delta:TE(t,CT(e)),offset:TE(t,vZ(e)),velocity:yZ(e,.1)}}function vZ(t){return t[0]}function CT(t){return t[t.length-1]}function yZ(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=CT(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>xs(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>xs(e)*2&&(r=t[1]);const i=Bs(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _Z(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?qt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?qt(n,t,r.max):Math.min(t,n)),t}function IE(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function xZ(t,{top:e,left:n,bottom:r,right:s}){return{x:IE(t.x,n,s),y:IE(t.y,e,r)}}function ME(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function wZ(t,e){return{x:ME(t.x,e.x),y:ME(t.y,e.y)}}function bZ(t,e){let n=.5;const r=$r(t),s=$r(e);return s>r?n=oh(e.min,e.max-r,t.min):r>s&&(n=oh(t.min,t.max-s,e.min)),Zi(0,1,n)}function SZ(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const j2=.35;function kZ(t=j2){return t===!1?t=0:t===!0&&(t=j2),{x:OE(t,"left","right"),y:OE(t,"top","bottom")}}function OE(t,e,n){return{min:LE(t,e),max:LE(t,n)}}function LE(t,e){return typeof t=="number"?t:t[e]||0}const EZ=new WeakMap;class CZ{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Yn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(Bh(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:v,dragPropagation:w,onDragStart:_}=this.getProps();if(v&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eB(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ii(b=>{let E=this.getAxisMotionValue(b).get()||0;if(zi.test(E)){const{projection:C}=this.visualElement;if(C&&C.layout){const R=C.layout.layoutBox[b];R&&(E=$r(R)*(parseFloat(E)/100))}}this.originPoint[b]=E}),_&&Gt.update(()=>_(p,g),!1,!0),A2(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=g;if(w&&this.currentDirection===null){this.currentDirection=RZ(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",g.point,b),this.updateAxis("y",g.point,b),this.visualElement.render(),x&&Gt.update(()=>x(p,g),!1,!0)},u=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new ET(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:kT(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Gt.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!_0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=_Z(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&lu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=xZ(r.layoutBox,e):this.constraints=!1,this.elastic=kZ(n),s!==this.constraints&&!lu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ii(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=SZ(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lu(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=RB(r,s.root,this.visualElement.getTransformPagePoint());let o=wZ(s.layout.layoutBox,i);if(n){const l=n(EB(o));this.hasMutatedConstraints=!!l,l&&(o=GA(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Ii(f=>{if(!_0(f,n,this.currentDirection))return;let p=u&&u[f]||{};(o===!0||o===f)&&(p={min:0,max:0});const g=s?200:1e6,v=s?40:1e7,w={type:"inertia",velocity:r?e[f]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,w)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return A2(this.visualElement,e),r.start(Aw(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ii(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Ii(n=>{const{drag:r}=this.getProps();if(!_0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-qt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ii(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=bZ({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ii(o=>{if(!_0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(qt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;EZ.set(this.visualElement,this);const e=this.visualElement.current,n=zf(e,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),g=d.target,v=g!==e&&oB(g);f&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();lu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=PZ(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Gt.read(s);const l=ch(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Ii(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=d[p].translate,g.set(g.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=j2,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function NE(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function PZ(t,e,n){const r=zk(t,NE(n)),s=zk(e,NE(n));return()=>{r(),s()}}function _0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function RZ(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class AZ extends Ya{constructor(e){super(e),this.removeGroupControls=qs,this.removeListeners=qs,this.controls=new CZ(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qs}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ly=t=>(e,n)=>{t&&Gt.update(()=>t(e,n),!1,!0)};class TZ extends Ya{constructor(){super(...arguments),this.removePointerDownListener=qs}onPointerDown(e){this.session=new ET(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kT(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ly(e),onStart:Ly(n),onMove:Ly(r),onEnd:(i,o)=>{delete this.session,s&&Gt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=zf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ny=!1;class IZ extends m.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Ny&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),em.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Ny=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Gt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Ow.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Ny=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function PT(t){const[e,n]=mT(),r=m.useContext(pw);return S.jsx(IZ,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(bT),isPresent:e,safeToRemove:n})}const MZ={pan:{Feature:TZ},drag:{Feature:AZ,ProjectionNode:pT,MeasureLayout:PT}};function DE(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Gt.postRender(()=>i(e,Bh(e)))}class OZ extends Ya{mount(){const{current:e}=this.node;e&&(this.unmount=nB(e,(n,r)=>(DE(this.node,r,"Start"),s=>DE(this.node,s,"End"))))}unmount(){}}class LZ extends Ya{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Vh(ch(this.node.current,"focus",()=>this.onFocus()),ch(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $E(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Gt.postRender(()=>i(e,Bh(e)))}class NZ extends Ya{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=lB(e,(s,i)=>($E(this.node,i,"Start"),(o,{success:l})=>$E(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const F2=new WeakMap,Dy=new WeakMap,DZ=t=>{const e=F2.get(t.target);e&&e(t)},$Z=t=>{t.forEach(DZ)};function jZ({root:t,...e}){const n=t||document;Dy.has(n)||Dy.set(n,{});const r=Dy.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver($Z,{root:t,...e})),r[s]}function FZ(t,e,n){const r=jZ(e);return F2.set(t,n),r.observe(t),()=>{F2.delete(t),r.unobserve(t)}}const VZ={some:0,all:1};class HZ extends Ya{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:VZ[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:g}=this.node.getProps(),v=f?p:g;v&&v(d)};this.stopObserver=FZ(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(zZ(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function zZ({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const BZ={inView:{Feature:HZ},tap:{Feature:NZ},focus:{Feature:LZ},hover:{Feature:OZ}},UZ={layout:{ProjectionNode:pT,MeasureLayout:PT}},ZZ={...pZ,...BZ,...MZ,...UZ},To=cZ(ZZ,uZ);function WZ(){!jw.current&&ZA();const[t]=m.useState(Zm.current);return t}const vi=To;var Uh=jR();const qZ=_g(Uh);function GZ(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const KZ=t=>{switch(t){case"success":return QZ;case"info":return eW;case"warning":return JZ;case"error":return tW;default:return null}},YZ=Array(12).fill(0),XZ=({visible:t,className:e})=>_e.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},_e.createElement("div",{className:"sonner-spinner"},YZ.map((n,r)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),QZ=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},_e.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JZ=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},_e.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),eW=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tW=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nW=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rW=()=>{const[t,e]=_e.useState(document.hidden);return _e.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let sW=1;const iW=100,jE=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:sW++};class oW{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-iW;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=jE(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],_e.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(lW(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!_e.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=jE(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Wr=new oW,aW=(t,e)=>Wr.message(t,e),lW=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",cW=aW,uW=()=>Wr.toasts,dW=()=>Wr.getActiveToasts(),Pt=Object.assign(cW,{success:Wr.success,info:Wr.info,warning:Wr.warning,error:Wr.error,custom:Wr.custom,message:Wr.message,promise:Wr.promise,dismiss:Wr.dismiss,loading:Wr.loading},{getHistory:uW,getToasts:dW});GZ("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function x0(t){return t.label!==void 0}const fW=3,hW="24px",pW="16px",FE=4e3,mW=356,gW=14,vW=45,yW=200;function Ei(...t){return t.filter(Boolean).join(" ")}function _W(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const xW=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:p,unstyled:g,interacting:v,setHeights:w,visibleToasts:_,heights:x,index:b,toasts:E,expanded:C,removeToast:R,defaultRichColors:A,closeButton:M,style:I,cancelButtonStyle:T,actionButtonStyle:L,className:D="",descriptionClassName:B="",duration:j,position:K,gap:U,expandByDefault:H,classNames:Z,icons:Q,closeButtonAriaLabel:z="Close toast"}=t,[ee,W]=_e.useState(null),[N,X]=_e.useState(null),[ie,ne]=_e.useState(!1),[oe,fe]=_e.useState(!1),[xe,de]=_e.useState(!1),[ae,Oe]=_e.useState(!1),[Ce,Ge]=_e.useState(!1),[dt,Lt]=_e.useState(0),[Kt,_t]=_e.useState(0),ht=_e.useRef(p.duration||j||FE),En=_e.useRef(null),kt=_e.useRef(null),Yt=b===0,Le=b+1<=_,rt=p.type,Be=rt??"default",Me=p.dismissible!==!1,pt=p.className||"",An=p.descriptionClassName||"",$t=_e.useMemo(()=>x.findIndex(Ke=>Ke.toastId===p.id)||0,[x,p.id]),Pe=_e.useMemo(()=>{var Ke;return(Ke=p.closeButton)!=null?Ke:M},[p.closeButton,M]),Jn=_e.useMemo(()=>p.duration||j||FE,[p.duration,j]),Xt=_e.useRef(0),Tn=_e.useRef(0),rl=_e.useRef(0),gn=_e.useRef(null),[vn,gd]=K.split("-"),Rs=_e.useMemo(()=>x.reduce((Ke,Tt,jt)=>jt>=$t?Ke:Ke+Tt.height,0),[x,$t]),yr=rW(),er=_e.useMemo(()=>{var Ke;return(Ke=t.swipeDirections)!=null?Ke:_W(K)},[t.swipeDirections,K]),Xi=p.invert||f,Ks=rt==="loading";Tn.current=_e.useMemo(()=>$t*U+Rs,[$t,Rs]),_e.useEffect(()=>{ht.current=Jn},[Jn]),_e.useEffect(()=>{ne(!0)},[]),_e.useEffect(()=>{const Ke=kt.current;if(Ke){const Tt=Ke.getBoundingClientRect().height;return _t(Tt),w(jt=>[{toastId:p.id,height:Tt,position:p.position},...jt]),()=>w(jt=>jt.filter(Zn=>Zn.toastId!==p.id))}},[w,p.id]),_e.useLayoutEffect(()=>{if(!ie)return;const Ke=kt.current,Tt=Ke.style.height;Ke.style.height="auto";const jt=Ke.getBoundingClientRect().height;Ke.style.height=Tt,_t(jt),w(Zn=>Zn.find(zt=>zt.toastId===p.id)?Zn.map(zt=>zt.toastId===p.id?{...zt,height:jt}:zt):[{toastId:p.id,height:jt,position:p.position},...Zn])},[ie,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const Dn=_e.useCallback(()=>{fe(!0),Lt(Tn.current),w(Ke=>Ke.filter(Tt=>Tt.toastId!==p.id)),setTimeout(()=>{R(p)},yW)},[p,R,w,Tn]);_e.useEffect(()=>{if(p.promise&&rt==="loading"||p.duration===1/0||p.type==="loading")return;let Ke;return C||v||yr?(()=>{if(rl.current<Xt.current){const Zn=new Date().getTime()-Xt.current;ht.current=ht.current-Zn}rl.current=new Date().getTime()})():(()=>{ht.current!==1/0&&(Xt.current=new Date().getTime(),Ke=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Dn()},ht.current))})(),()=>clearTimeout(Ke)},[C,v,p,rt,yr,Dn]),_e.useEffect(()=>{p.delete&&(Dn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Dn,p.delete]);function As(){var Ke;if(Q!=null&&Q.loading){var Tt;return _e.createElement("div",{className:Ei(Z==null?void 0:Z.loader,p==null||(Tt=p.classNames)==null?void 0:Tt.loader,"sonner-loader"),"data-visible":rt==="loading"},Q.loading)}return _e.createElement(XZ,{className:Ei(Z==null?void 0:Z.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader),visible:rt==="loading"})}const sl=p.icon||(Q==null?void 0:Q[rt])||KZ(rt);var Qi,ss;return _e.createElement("li",{tabIndex:0,ref:kt,className:Ei(D,pt,Z==null?void 0:Z.toast,p==null||(e=p.classNames)==null?void 0:e.toast,Z==null?void 0:Z[Be],p==null||(n=p.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(Qi=p.richColors)!=null?Qi:A,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":ie,"data-promise":!!p.promise,"data-swiped":Ce,"data-removed":oe,"data-visible":Le,"data-y-position":vn,"data-x-position":gd,"data-index":b,"data-front":Yt,"data-swiping":xe,"data-dismissible":Me,"data-type":rt,"data-invert":Xi,"data-swipe-out":ae,"data-swipe-direction":N,"data-expanded":!!(C||H&&ie),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":E.length-b,"--offset":`${oe?dt:Tn.current}px`,"--initial-height":H?"auto":`${Kt}px`,...I,...p.style},onDragEnd:()=>{de(!1),W(null),gn.current=null},onPointerDown:Ke=>{Ke.button!==2&&(Ks||!Me||(En.current=new Date,Lt(Tn.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(de(!0),gn.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,Tt,jt;if(ae||!Me)return;gn.current=null;const Zn=Number(((Ke=kt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),is=Number(((Tt=kt.current)==null?void 0:Tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),zt=new Date().getTime()-((jt=En.current)==null?void 0:jt.getTime()),$n=ee==="x"?Zn:is,Fr=Math.abs($n)/zt;if((ee==="x"?er.includes(Zn>0?"right":"left"):er.includes(is>0?"bottom":"top"))&&(Math.abs($n)>=vW||Fr>.11)){Lt(Tn.current),p.onDismiss==null||p.onDismiss.call(p,p),X(ee==="x"?Zn>0?"right":"left":is>0?"down":"up"),Dn(),Oe(!0);return}else{var cr,In;(cr=kt.current)==null||cr.style.setProperty("--swipe-amount-x","0px"),(In=kt.current)==null||In.style.setProperty("--swipe-amount-y","0px")}Ge(!1),de(!1),W(null)},onPointerMove:Ke=>{var Tt,jt,Zn;if(!gn.current||!Me||((Tt=window.getSelection())==null?void 0:Tt.toString().length)>0)return;const zt=Ke.clientY-gn.current.y,$n=Ke.clientX-gn.current.x;!ee&&(Math.abs($n)>1||Math.abs(zt)>1)&&W(Math.abs($n)>Math.abs(zt)?"x":"y");let Fr={x:0,y:0};const Ys=cr=>1/(1.5+Math.abs(cr)/20);if(ee==="y"){if(er.includes("top")||er.includes("bottom"))if(er.includes("top")&&zt<0||er.includes("bottom")&&zt>0)Fr.y=zt;else{const cr=zt*Ys(zt);Fr.y=Math.abs(cr)<Math.abs(zt)?cr:zt}}else if(ee==="x"&&(er.includes("left")||er.includes("right")))if(er.includes("left")&&$n<0||er.includes("right")&&$n>0)Fr.x=$n;else{const cr=$n*Ys($n);Fr.x=Math.abs(cr)<Math.abs($n)?cr:$n}(Math.abs(Fr.x)>0||Math.abs(Fr.y)>0)&&Ge(!0),(jt=kt.current)==null||jt.style.setProperty("--swipe-amount-x",`${Fr.x}px`),(Zn=kt.current)==null||Zn.style.setProperty("--swipe-amount-y",`${Fr.y}px`)}},Pe&&!p.jsx&&rt!=="loading"?_e.createElement("button",{"aria-label":z,"data-disabled":Ks,"data-close-button":!0,onClick:Ks||!Me?()=>{}:()=>{Dn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ei(Z==null?void 0:Z.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(ss=Q==null?void 0:Q.close)!=null?ss:nW):null,(rt||p.icon||p.promise)&&p.icon!==null&&((Q==null?void 0:Q[rt])!==null||p.icon)?_e.createElement("div",{"data-icon":"",className:Ei(Z==null?void 0:Z.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},rt==="loading"?p.icon||As():p.promise?As():null,rt!=="loading"?sl:null):null,_e.createElement("div",{"data-content":"",className:Ei(Z==null?void 0:Z.content,p==null||(i=p.classNames)==null?void 0:i.content)},_e.createElement("div",{"data-title":"",className:Ei(Z==null?void 0:Z.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?_e.createElement("div",{"data-description":"",className:Ei(B,An,Z==null?void 0:Z.description,p==null||(l=p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),_e.isValidElement(p.cancel)?p.cancel:p.cancel&&x0(p.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:Ke=>{x0(p.cancel)&&Me&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ke),Dn())},className:Ei(Z==null?void 0:Z.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_e.isValidElement(p.action)?p.action:p.action&&x0(p.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Ke=>{x0(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ke),!Ke.defaultPrevented&&Dn())},className:Ei(Z==null?void 0:Z.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function VE(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function wW(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?pW:hW;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const bW=_e.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:p,theme:g="light",richColors:v,duration:w,style:_,visibleToasts:x=fW,toastOptions:b,dir:E=VE(),gap:C=gW,icons:R,customAriaLabel:A,containerAriaLabel:M="Notifications"}=e,[I,T]=_e.useState([]),L=_e.useMemo(()=>r?I.filter(ne=>ne.toasterId===r):I.filter(ne=>!ne.toasterId),[I,r]),D=_e.useMemo(()=>Array.from(new Set([i].concat(L.filter(ne=>ne.position).map(ne=>ne.position)))),[L,i]),[B,j]=_e.useState([]),[K,U]=_e.useState(!1),[H,Z]=_e.useState(!1),[Q,z]=_e.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ee=_e.useRef(null),W=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=_e.useRef(null),X=_e.useRef(!1),ie=_e.useCallback(ne=>{T(oe=>{var fe;return(fe=oe.find(xe=>xe.id===ne.id))!=null&&fe.delete||Wr.dismiss(ne.id),oe.filter(({id:xe})=>xe!==ne.id)})},[]);return _e.useEffect(()=>Wr.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{T(oe=>oe.map(fe=>fe.id===ne.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{qZ.flushSync(()=>{T(oe=>{const fe=oe.findIndex(xe=>xe.id===ne.id);return fe!==-1?[...oe.slice(0,fe),{...oe[fe],...ne},...oe.slice(fe+1)]:[ne,...oe]})})})}),[]),_e.useEffect(()=>{if(g!=="system"){z(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:oe})=>{z(oe?"dark":"light")})}catch{ne.addListener(({matches:fe})=>{try{z(fe?"dark":"light")}catch(xe){console.error(xe)}})}},[g]),_e.useEffect(()=>{I.length<=1&&U(!1)},[I]),_e.useEffect(()=>{const ne=oe=>{var fe;if(o.length>0&&o.every(ae=>oe[ae]||oe.code===ae)){var de;U(!0),(de=ee.current)==null||de.focus()}oe.code==="Escape"&&(document.activeElement===ee.current||(fe=ee.current)!=null&&fe.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[o]),_e.useEffect(()=>{if(ee.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,X.current=!1)}},[ee.current]),_e.createElement("section",{ref:n,"aria-label":A??`${M} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((ne,oe)=>{var fe;const[xe,de]=ne.split("-");return L.length?_e.createElement("ol",{key:ne,dir:E==="auto"?VE():E,tabIndex:-1,ref:ee,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":xe,"data-x-position":de,style:{"--front-toast-height":`${((fe=B[0])==null?void 0:fe.height)||0}px`,"--width":`${mW}px`,"--gap":`${C}px`,..._,...wW(f,p)},onBlur:ae=>{X.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(X.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||X.current||(X.current=!0,N.current=ae.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{H||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},L.filter(ae=>!ae.position&&oe===0||ae.position===ne).map((ae,Oe)=>{var Ce,Ge;return _e.createElement(xW,{key:ae.id,icons:R,index:Oe,toast:ae,defaultRichColors:v,duration:(Ce=b==null?void 0:b.duration)!=null?Ce:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Ge=b==null?void 0:b.closeButton)!=null?Ge:u,interacting:H,position:ne,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:ie,toasts:L.filter(dt=>dt.position==ae.position),heights:B.filter(dt=>dt.position==ae.position),setHeights:j,expandByDefault:l,gap:C,expanded:K,swipeDirections:e.swipeDirections})})):null}))}),SW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),m.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),kW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),EW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),CW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),PW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),m.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),RW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),AW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),TW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),IW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),m.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),MW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),m.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),OW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),LW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),m.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),NW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),m.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),DW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),m.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),$W=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),m.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),jW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),FW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),m.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),VW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),m.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),HW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),m.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),zW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),m.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),BW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),m.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),UW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),m.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),ZW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),m.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),WW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),m.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),qW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),m.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M215,219.85a8,8,0,0,1-7,4.15H160a8,8,0,0,1-6.75-3.71l-40.49-63.63L53.92,221.38a8,8,0,0,1-11.84-10.76l61.77-68L41.25,44.3A8,8,0,0,1,48,32H96a8,8,0,0,1,6.75,3.71l40.49,63.63,58.84-64.72a8,8,0,0,1,11.84,10.76l-61.77,67.95,62.6,98.38A8,8,0,0,1,215,219.85Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.06,212.78l-63.42-99.66L212.44,44A6,6,0,1,0,203.56,36L143,102.62l-41.9-65.84A6,6,0,0,0,96,34H48a6,6,0,0,0-5.06,9.22l63.42,99.66L43.56,212A6,6,0,0,0,52.44,220L113,153.38l41.9,65.84A6,6,0,0,0,160,222h48a6,6,0,0,0,5.06-9.22ZM163.29,210,58.93,46H92.71L197.07,210Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M211.37,213.85,147.13,112.9,211,42.69A4,4,0,0,0,205,37.31L142.68,105.9,99.38,37.85A4,4,0,0,0,96,36H48a4,4,0,0,0-3.37,6.15L108.87,143.1,45,213.31A4,4,0,1,0,51,218.69l62.36-68.59,43.3,68.05A4,4,0,0,0,160,220h48a4,4,0,0,0,3.37-6.15ZM162.2,212,55.29,44H93.8L200.71,212Z"}))]]),GW=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),en=m.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:p,weight:g="regular",mirrored:v=!1,...w}=m.useContext(GW);return m.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...w,...d},!!n&&m.createElement("title",null,n),l,u.get(i??g))});en.displayName="IconBase";const RT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:SW}));RT.displayName="ArrowLeftIcon";const KW=RT,AT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:kW}));AT.displayName="ArrowSquareOutIcon";const YW=AT,TT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:EW}));TT.displayName="ArrowUpIcon";const XW=TT,IT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:CW}));IT.displayName="CaretDownIcon";const QW=IT,MT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:PW}));MT.displayName="CaretRightIcon";const JW=MT,OT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:RW}));OT.displayName="ChatCircleIcon";const eq=OT,LT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:AW}));LT.displayName="CheckIcon";const NT=LT,DT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:TW}));DT.displayName="CircleNotchIcon";const Mg=DT,$T=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:IW}));$T.displayName="CopyIcon";const uh=$T,jT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:MW}));jT.displayName="DotsThreeIcon";const tq=jT,FT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:OW}));FT.displayName="FolderOpenIcon";const nq=FT,VT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:LW}));VT.displayName="FolderSimpleIcon";const rq=VT,HT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:NW}));HT.displayName="MagnifyingGlassIcon";const sq=HT,zT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:DW}));zT.displayName="PencilSimpleIcon";const BT=zT,UT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:$W}));UT.displayName="PushPinIcon";const V2=UT,ZT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:jW}));ZT.displayName="SidebarSimpleIcon";const iq=ZT,WT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:FW}));WT.displayName="SignInIcon";const oq=WT,qT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:VW}));qT.displayName="SignOutIcon";const aq=qT,GT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:HW}));GT.displayName="SparkleIcon";const $y=GT,KT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:zW}));KT.displayName="SquaresFourIcon";const lq=KT,YT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:BW}));YT.displayName="SwatchesIcon";const XT=YT,QT=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:UW}));QT.displayName="TrashIcon";const JT=QT,eI=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:ZW}));eI.displayName="UserIcon";const cq=eI,tI=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:WW}));tI.displayName="XIcon";const nI=tI,rI=m.forwardRef((t,e)=>m.createElement(en,{ref:e,...t,weights:qW}));rI.displayName="XLogoIcon";const uq=rI,HE="/assets/arena-Db0j1set.png";function sI(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=sI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function iI(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=sI(t))&&(r&&(r+=" "),r+=e);return r}const dq=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},fq=(t,e)=>({classGroupId:t,validator:e}),oI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Ym="-",zE=[],hq="arbitrary..",pq=t=>{const e=gq(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return mq(o);const l=o.split(Ym),u=l[0]===""&&l.length>1?1:0;return aI(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?dq(d,u):u:d||zE}return n[o]||zE}}},aI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=aI(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(Ym):t.slice(e).join(Ym),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},mq=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?hq+r:void 0})(),gq=t=>{const{theme:e,classGroups:n}=t;return vq(n,e)},vq=(t,e)=>{const n=oI();for(const r in t){const s=t[r];Uw(s,n,r,e)}return n},Uw=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];yq(o,e,n,r)}},yq=(t,e,n,r)=>{if(typeof t=="string"){_q(t,e,n);return}if(typeof t=="function"){xq(t,e,n,r);return}wq(t,e,n,r)},_q=(t,e,n)=>{const r=t===""?e:lI(e,t);r.classGroupId=n},xq=(t,e,n,r)=>{if(bq(t)){Uw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(fq(n,t))},wq=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];Uw(u,lI(e,l),n,r)}},lI=(t,e)=>{let n=t;const r=e.split(Ym),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=oI(),n.nextPart.set(o,l)),n=l}return n},bq=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Sq=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},H2="!",BE=":",kq=[],UE=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Eq=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const f=s.length;for(let _=0;_<f;_++){const x=s[_];if(o===0&&l===0){if(x===BE){i.push(s.slice(u,_)),u=_+1;continue}if(x==="/"){d=_;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.slice(u);let g=p,v=!1;p.endsWith(H2)?(g=p.slice(0,-1),v=!0):p.startsWith(H2)&&(g=p.slice(1),v=!0);const w=d&&d>u?d-u:void 0;return UE(i,v,g,w)};if(e){const s=e+BE,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):UE(kq,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Cq=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",u=e.has(o);l||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},Pq=t=>({cache:Sq(t.cacheSize),parseClassName:Eq(t),sortModifiers:Cq(t),postfixLookupClassGroupIds:Rq(t),...pq(t)}),Rq=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},Aq=/\s+/,Tq=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(Aq);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:v,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let b=!!x,E;if(b){const I=_.substring(0,x);E=r(I);const T=E&&o[E]?r(_):void 0;T&&T!==E&&(E=T,b=!1)}else E=r(_);if(!E){if(!b){d=p+(d.length>0?" "+d:d);continue}if(E=r(_),!E){d=p+(d.length>0?" "+d:d);continue}b=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),R=w?C+H2:C,A=R+E;if(l.indexOf(A)>-1)continue;l.push(A);const M=s(E,b);for(let I=0;I<M.length;++I){const T=M[I];l.push(R+T)}d=p+(d.length>0?" "+d:d)}return d},Iq=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=cI(n))&&(s&&(s+=" "),s+=r);return s},cI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=cI(t[r]))&&(n&&(n+=" "),n+=e);return n},Mq=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,p)=>p(f),t());return n=Pq(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=Tq(u,n);return s(u,f),f};return i=o,(...u)=>i(Iq(...u))},Oq=[],Gn=t=>{const e=n=>n[t]||Oq;return e.isThemeGetter=!0,e.themeKey=t,e},uI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lq=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Nq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dq=/\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$/,$q=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,jq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,da=t=>Lq.test(t),ft=t=>!!t&&!Number.isNaN(Number(t)),Ci=t=>!!t&&Number.isInteger(Number(t)),jy=t=>t.endsWith("%")&&ft(t.slice(0,-1)),ho=t=>Nq.test(t),fI=()=>!0,Vq=t=>Dq.test(t)&&!$q.test(t),Zw=()=>!1,Hq=t=>jq.test(t),zq=t=>Fq.test(t),Bq=t=>!Ne(t)&&!$e(t),Uq=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),Zq=t=>Xa(t,mI,Zw),Ne=t=>uI.test(t),Cl=t=>Xa(t,gI,Vq),ZE=t=>Xa(t,Jq,ft),Wq=t=>Xa(t,yI,fI),qq=t=>Xa(t,vI,Zw),WE=t=>Xa(t,hI,Zw),Gq=t=>Xa(t,pI,zq),w0=t=>Xa(t,_I,Hq),$e=t=>dI.test(t),pf=t=>pc(t,gI),Kq=t=>pc(t,vI),qE=t=>pc(t,hI),Yq=t=>pc(t,mI),Xq=t=>pc(t,pI),b0=t=>pc(t,_I,!0),Qq=t=>pc(t,yI,!0),Xa=(t,e,n)=>{const r=uI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},pc=(t,e,n=!1)=>{const r=dI.exec(t);return r?r[1]?e(r[1]):n:!1},hI=t=>t==="position"||t==="percentage",pI=t=>t==="image"||t==="url",mI=t=>t==="length"||t==="size"||t==="bg-size",gI=t=>t==="length",Jq=t=>t==="number",vI=t=>t==="family-name",yI=t=>t==="number"||t==="weight",_I=t=>t==="shadow",eG=()=>{const t=Gn("color"),e=Gn("font"),n=Gn("text"),r=Gn("font-weight"),s=Gn("tracking"),i=Gn("leading"),o=Gn("breakpoint"),l=Gn("container"),u=Gn("spacing"),d=Gn("radius"),f=Gn("shadow"),p=Gn("inset-shadow"),g=Gn("text-shadow"),v=Gn("drop-shadow"),w=Gn("blur"),_=Gn("perspective"),x=Gn("aspect"),b=Gn("ease"),E=Gn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...R(),$e,Ne],M=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],T=()=>[$e,Ne,u],L=()=>[da,"full","auto",...T()],D=()=>[Ci,"none","subgrid",$e,Ne],B=()=>["auto",{span:["full",Ci,$e,Ne]},Ci,$e,Ne],j=()=>[Ci,"auto",$e,Ne],K=()=>["auto","min","max","fr",$e,Ne],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...T()],Q=()=>[da,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],z=()=>[l,da,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ee=()=>[da,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],W=()=>[t,$e,Ne],N=()=>[...R(),qE,WE,{position:[$e,Ne]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",Yq,Zq,{size:[$e,Ne]}],ne=()=>[jy,pf,Cl],oe=()=>["","none","full",d,$e,Ne],fe=()=>["",ft,pf,Cl],xe=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[ft,jy,qE,WE],Oe=()=>["","none",w,$e,Ne],Ce=()=>["none",ft,$e,Ne],Ge=()=>["none",ft,$e,Ne],dt=()=>[ft,$e,Ne],Lt=()=>[da,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ho],breakpoint:[ho],color:[fI],container:[ho],"drop-shadow":[ho],ease:["in","out","in-out"],font:[Bq],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ho],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ho],shadow:[ho],spacing:["px",ft],text:[ho],"text-shadow":[ho],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",da,Ne,$e,x]}],container:["container"],"container-type":[{"@container":["","normal","size",$e,Ne]}],"container-named":[Uq],columns:[{columns:[ft,"auto",Ne,$e,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",$e,Ne]}],basis:[{basis:[da,"full","auto",l,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,da,"auto","initial","none",Ne]}],grow:[{grow:["",ft,$e,Ne]}],shrink:[{shrink:["",ft,$e,Ne]}],order:[{order:[Ci,"first","last","none",$e,Ne]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...z()]}],"min-inline-size":[{"min-inline":["auto",...z()]}],"max-inline-size":[{"max-inline":["none",...z()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[l,"screen",...Q()]}],"min-w":[{"min-w":[l,"screen","none",...Q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh","none",...Q()]}],"font-size":[{text:["base",n,pf,Cl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Qq,Wq]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jy,Ne]}],"font-family":[{font:[Kq,qq,e]}],"font-features":[{"font-features":[Ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,$e,Ne]}],"line-clamp":[{"line-clamp":[ft,"none",$e,ZE]}],leading:[{leading:["none",i,...T()]}],"list-image":[{"list-image":["none",$e,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",$e,Cl]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[ft,"auto",$e,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"tab-size":[{tab:[Ci,$e,Ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,$e,Ne],radial:["",$e,Ne],conic:["",Ci,$e,Ne]},Xq,Gq]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,$e,Ne]}],"outline-w":[{outline:["",ft,pf,Cl]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","inner","none",f,b0,w0]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",p,b0,w0]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[ft,Cl]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",g,b0,w0]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[ft,$e,Ne]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[$e,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Ne]}],filter:[{filter:["","none",$e,Ne]}],blur:[{blur:Oe()}],brightness:[{brightness:[ft,$e,Ne]}],contrast:[{contrast:[ft,$e,Ne]}],"drop-shadow":[{"drop-shadow":["","none",v,b0,w0]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",ft,$e,Ne]}],"hue-rotate":[{"hue-rotate":[ft,$e,Ne]}],invert:[{invert:["",ft,$e,Ne]}],saturate:[{saturate:[ft,$e,Ne]}],sepia:[{sepia:["",ft,$e,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Ne]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[ft,$e,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[ft,$e,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,$e,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,$e,Ne]}],"backdrop-invert":[{"backdrop-invert":["",ft,$e,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[ft,$e,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[ft,$e,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,$e,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",$e,Ne]}],ease:[{ease:["linear","initial",b,$e,Ne]}],delay:[{delay:[ft,$e,Ne]}],animate:[{animate:["none",E,$e,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,$e,Ne]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Ge()}],"scale-x":[{"scale-x":Ge()}],"scale-y":[{"scale-y":Ge()}],"scale-z":[{"scale-z":Ge()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[$e,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Lt()}],"translate-x":[{"translate-x":Lt()}],"translate-y":[{"translate-y":Lt()}],"translate-z":[{"translate-z":Lt()}],"translate-none":["translate-none"],zoom:[{zoom:[Ci,$e,Ne]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,Ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",$e,Ne]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[ft,pf,Cl,ZE]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tG=Mq(eG);function Ht(...t){return tG(iI(t))}const tm=({provider:t,className:e})=>t==="x"?S.jsx(uq,{className:Ht("h-6 w-6",e),"aria-hidden":"true"}):t==="pinterest"?S.jsx("svg",{viewBox:"0 0 24 24",className:Ht("h-6 w-6",e),"aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}):S.jsx("span",{"aria-hidden":"true",className:Ht("h-6 w-6 bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url(${HE})`,maskImage:`url(${HE})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}});var Ot;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ot||(Ot={}));var GE;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(GE||(GE={}));const ze=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ma=t=>{switch(typeof t){case"undefined":return ze.undefined;case"string":return ze.string;case"number":return Number.isNaN(t)?ze.nan:ze.number;case"boolean":return ze.boolean;case"function":return ze.function;case"bigint":return ze.bigint;case"symbol":return ze.symbol;case"object":return Array.isArray(t)?ze.array:t===null?ze.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ze.promise:typeof Map<"u"&&t instanceof Map?ze.map:typeof Set<"u"&&t instanceof Set?ze.set:typeof Date<"u"&&t instanceof Date?ze.date:ze.object;default:return ze.unknown}},Se=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Lo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return s(this),r}static assert(e){if(!(e instanceof Lo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Lo.create=t=>new Lo(t);const z2=(t,e)=>{let n;switch(t.code){case Se.invalid_type:t.received===ze.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ot.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(t.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(t.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(t.options)}, received '${t.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ot.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Se.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Se.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ot.assertNever(t)}return{message:n}};let nG=z2;function rG(){return nG}const sG=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function Ie(t,e){const n=rG(),r=sG({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===z2?void 0:z2].filter(s=>!!s)});t.common.issues.push(r)}class ks{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return it;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return ks.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return it;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const it=Object.freeze({status:"aborted"}),wf=t=>({status:"dirty",value:t}),Gs=t=>({status:"valid",value:t}),KE=t=>t.status==="aborted",YE=t=>t.status==="dirty",Yu=t=>t.status==="valid",Xm=t=>typeof Promise<"u"&&t instanceof Promise;var Ze;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ze||(Ze={}));class za{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const XE=(t,e)=>{if(Yu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Lo(t.common.issues);return this._error=n,this._error}}};function yt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:s}}class At{get description(){return this._def.description}_getType(e){return ma(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ma(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ks,ctx:{common:e.parent.common,data:e.data,parsedType:ma(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ma(e)},s=this._parseSync({data:e,path:r.path,parent:r});return XE(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ma(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Yu(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Yu(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ma(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Xm(s)?s:Promise.resolve(s));return XE(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:Se.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Qu({schema:this,typeName:ot.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Oa.create(this,this._def)}nullable(){return Ju.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bi.create(this)}promise(){return tg.create(this,this._def)}or(e){return Jm.create([this,e],this._def)}and(e){return eg.create(this,e,this._def)}transform(e){return new Qu({...yt(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new U2({...yt(this._def),innerType:this,defaultValue:n,typeName:ot.ZodDefault})}brand(){return new PG({typeName:ot.ZodBranded,type:this,...yt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Z2({...yt(this._def),innerType:this,catchValue:n,typeName:ot.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ww.create(this,e)}readonly(){return W2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const iG=/^c[^\s-]{8,}$/i,oG=/^[0-9a-z]+$/,aG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cG=/^[a-z0-9_-]{21}$/i,uG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fy;const pG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_G=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xI="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xG=new RegExp(`^${xI}$`);function wI(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function wG(t){return new RegExp(`^${wI(t)}$`)}function bG(t){let e=`${xI}T${wI(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function SG(t,e){return!!((e==="v4"||!e)&&pG.test(t)||(e==="v6"||!e)&&gG.test(t))}function kG(t,e){if(!uG.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function EG(t,e){return!!((e==="v4"||!e)&&mG.test(t)||(e==="v6"||!e)&&vG.test(t))}class Ra extends At{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ze.string){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_type,expected:ze.string,received:i.parsedType}),it}const r=new ks;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?Ie(s,{code:Se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Ie(s,{code:Se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")fG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"email",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Fy||(Fy=new RegExp(hG,"u")),Fy.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"emoji",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")lG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"uuid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")cG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"nanoid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")iG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cuid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")oG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cuid2",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")aG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"ulid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Ie(s,{validation:"url",code:Se.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"regex",code:Se.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?bG(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?xG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?wG(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?dG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"duration",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?SG(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"ip",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?kG(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"jwt",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?EG(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cidr",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?yG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"base64",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?_G.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"base64url",code:Se.invalid_string,message:i.message}),r.dirty()):Ot.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:Se.invalid_string,...Ze.errToObj(r)})}_addCheck(e){return new Ra({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ze.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ze.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ze.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ze.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ze.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ze.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ze.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ze.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ze.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ze.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ze.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ze.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ze.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ze.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ze.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ze.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ze.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ze.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ze.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ze.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ze.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ze.errToObj(n)})}nonempty(e){return this.min(1,Ze.errToObj(e))}trim(){return new Ra({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ra({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ra({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ra.create=t=>new Ra({checks:[],typeName:ot.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...yt(t)});function CG(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class dh extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ze.number){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_type,expected:ze.number,received:i.parsedType}),it}let r;const s=new ks;for(const i of this._def.checks)i.kind==="int"?Ot.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?CG(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.not_finite,message:i.message}),s.dirty()):Ot.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new dh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new dh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ze.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ze.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ot.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dh.create=t=>new dh({checks:[],typeName:ot.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...yt(t)});class fh extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ze.bigint)return this._getInvalidInput(e);let r;const s=new ks;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ot.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ie(n,{code:Se.invalid_type,expected:ze.bigint,received:n.parsedType}),it}gte(e,n){return this.setLimit("min",e,!0,Ze.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ze.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ze.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ze.toString(n))}setLimit(e,n,r,s){return new fh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(e){return new fh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ze.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}fh.create=t=>new fh({checks:[],typeName:ot.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...yt(t)});class QE extends At{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ze.boolean){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:ze.boolean,received:r.parsedType}),it}return Gs(e.data)}}QE.create=t=>new QE({typeName:ot.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...yt(t)});class Qm extends At{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ze.date){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_type,expected:ze.date,received:i.parsedType}),it}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_date}),it}const r=new ks;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ot.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ze.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ze.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Qm.create=t=>new Qm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ot.ZodDate,...yt(t)});class JE extends At{_parse(e){if(this._getType(e)!==ze.symbol){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:ze.symbol,received:r.parsedType}),it}return Gs(e.data)}}JE.create=t=>new JE({typeName:ot.ZodSymbol,...yt(t)});class eC extends At{_parse(e){if(this._getType(e)!==ze.undefined){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:ze.undefined,received:r.parsedType}),it}return Gs(e.data)}}eC.create=t=>new eC({typeName:ot.ZodUndefined,...yt(t)});class tC extends At{_parse(e){if(this._getType(e)!==ze.null){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:ze.null,received:r.parsedType}),it}return Gs(e.data)}}tC.create=t=>new tC({typeName:ot.ZodNull,...yt(t)});class nC extends At{constructor(){super(...arguments),this._any=!0}_parse(e){return Gs(e.data)}}nC.create=t=>new nC({typeName:ot.ZodAny,...yt(t)});class rC extends At{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gs(e.data)}}rC.create=t=>new rC({typeName:ot.ZodUnknown,...yt(t)});class Ba extends At{_parse(e){const n=this._getOrReturnCtx(e);return Ie(n,{code:Se.invalid_type,expected:ze.never,received:n.parsedType}),it}}Ba.create=t=>new Ba({typeName:ot.ZodNever,...yt(t)});class sC extends At{_parse(e){if(this._getType(e)!==ze.undefined){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:ze.void,received:r.parsedType}),it}return Gs(e.data)}}sC.create=t=>new sC({typeName:ot.ZodVoid,...yt(t)});class Bi extends At{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==ze.array)return Ie(n,{code:Se.invalid_type,expected:ze.array,received:n.parsedType}),it;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Ie(n,{code:o?Se.too_big:Se.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ie(n,{code:Se.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ie(n,{code:Se.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new za(n,o,n.path,l)))).then(o=>ks.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new za(n,o,n.path,l)));return ks.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Bi({...this._def,minLength:{value:e,message:Ze.toString(n)}})}max(e,n){return new Bi({...this._def,maxLength:{value:e,message:Ze.toString(n)}})}length(e,n){return new Bi({...this._def,exactLength:{value:e,message:Ze.toString(n)}})}nonempty(e){return this.min(1,e)}}Bi.create=(t,e)=>new Bi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...yt(e)});function cu(t){if(t instanceof zn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Oa.create(cu(r))}return new zn({...t._def,shape:()=>e})}else return t instanceof Bi?new Bi({...t._def,type:cu(t.element)}):t instanceof Oa?Oa.create(cu(t.unwrap())):t instanceof Ju?Ju.create(cu(t.unwrap())):t instanceof lc?lc.create(t.items.map(e=>cu(e))):t}class zn extends At{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ot.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ze.object){const d=this._getOrReturnCtx(e);return Ie(d,{code:Se.invalid_type,expected:ze.object,received:d.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ba&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const f=i[d],p=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new za(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Ba){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(Ie(s,{code:Se.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const p=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new za(s,p,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const p=await f.key,g=await f.value;d.push({key:p,value:g,alwaysSet:f.alwaysSet})}return d}).then(d=>ks.mergeObjectSync(r,d)):ks.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ze.errToObj,new zn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ze.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new zn({...this._def,unknownKeys:"strip"})}passthrough(){return new zn({...this._def,unknownKeys:"passthrough"})}extend(e){return new zn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new zn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ot.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new zn({...this._def,catchall:e})}pick(e){const n={};for(const r of Ot.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ot.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}deepPartial(){return cu(this)}partial(e){const n={};for(const r of Ot.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new zn({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ot.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Oa;)i=i._def.innerType;n[r]=i}return new zn({...this._def,shape:()=>n})}keyof(){return bI(Ot.objectKeys(this.shape))}}zn.create=(t,e)=>new zn({shape:()=>t,unknownKeys:"strip",catchall:Ba.create(),typeName:ot.ZodObject,...yt(e)});zn.strictCreate=(t,e)=>new zn({shape:()=>t,unknownKeys:"strict",catchall:Ba.create(),typeName:ot.ZodObject,...yt(e)});zn.lazycreate=(t,e)=>new zn({shape:t,unknownKeys:"strip",catchall:Ba.create(),typeName:ot.ZodObject,...yt(e)});class Jm extends At{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Lo(l.ctx.common.issues));return Ie(n,{code:Se.invalid_union,unionErrors:o}),it}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new Lo(u));return Ie(n,{code:Se.invalid_union,unionErrors:l}),it}}get options(){return this._def.options}}Jm.create=(t,e)=>new Jm({options:t,typeName:ot.ZodUnion,...yt(e)});function B2(t,e){const n=ma(t),r=ma(e);if(t===e)return{valid:!0,data:t};if(n===ze.object&&r===ze.object){const s=Ot.objectKeys(e),i=Ot.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=B2(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===ze.array&&r===ze.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],u=B2(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===ze.date&&r===ze.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class eg extends At{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(KE(i)||KE(o))return it;const l=B2(i.value,o.value);return l.valid?((YE(i)||YE(o))&&n.dirty(),{status:n.value,value:l.data}):(Ie(r,{code:Se.invalid_intersection_types}),it)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eg.create=(t,e,n)=>new eg({left:t,right:e,typeName:ot.ZodIntersection,...yt(n)});class lc extends At{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ze.array)return Ie(r,{code:Se.invalid_type,expected:ze.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Ie(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(Ie(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new za(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>ks.mergeArray(n,o)):ks.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new lc({...this._def,rest:e})}}lc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lc({items:t,typeName:ot.ZodTuple,rest:null,...yt(e)})};class iC extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ze.map)return Ie(r,{code:Se.invalid_type,expected:ze.map,received:r.parsedType}),it;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new za(r,l,r.path,[d,"key"])),value:i._parse(new za(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return it;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}iC.create=(t,e,n)=>new iC({valueType:e,keyType:t,typeName:ot.ZodMap,...yt(n)});class hh extends At{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ze.set)return Ie(r,{code:Se.invalid_type,expected:ze.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ie(r,{code:Se.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ie(r,{code:Se.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const f of u){if(f.status==="aborted")return it;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>i._parse(new za(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new hh({...this._def,minSize:{value:e,message:Ze.toString(n)}})}max(e,n){return new hh({...this._def,maxSize:{value:e,message:Ze.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}hh.create=(t,e)=>new hh({valueType:t,minSize:null,maxSize:null,typeName:ot.ZodSet,...yt(e)});class oC extends At{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}oC.create=(t,e)=>new oC({getter:t,typeName:ot.ZodLazy,...yt(e)});class aC extends At{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ie(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:e.data}}get value(){return this._def.value}}aC.create=(t,e)=>new aC({value:t,typeName:ot.ZodLiteral,...yt(e)});function bI(t,e){return new Xu({values:t,typeName:ot.ZodEnum,...yt(e)})}class Xu extends At{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ie(n,{expected:Ot.joinValues(r),received:n.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ie(n,{received:n.data,code:Se.invalid_enum_value,options:r}),it}return Gs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Xu.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xu.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Xu.create=bI;class lC extends At{_parse(e){const n=Ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ze.string&&r.parsedType!==ze.number){const s=Ot.objectValues(n);return Ie(r,{expected:Ot.joinValues(s),received:r.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(Ot.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Ot.objectValues(n);return Ie(r,{received:r.data,code:Se.invalid_enum_value,options:s}),it}return Gs(e.data)}get enum(){return this._def.values}}lC.create=(t,e)=>new lC({values:t,typeName:ot.ZodNativeEnum,...yt(e)});class tg extends At{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ze.promise&&n.common.async===!1)return Ie(n,{code:Se.invalid_type,expected:ze.promise,received:n.parsedType}),it;const r=n.parsedType===ze.promise?n.data:Promise.resolve(n.data);return Gs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tg.create=(t,e)=>new tg({type:t,typeName:ot.ZodPromise,...yt(e)});class Qu extends At{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{Ie(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return it;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?it:u.status==="dirty"||n.value==="dirty"?wf(u.value):u});{if(n.value==="aborted")return it;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"||n.value==="dirty"?wf(l.value):l}}if(s.type==="refinement"){const o=l=>{const u=s.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?it:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Yu(o))return it;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Yu(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):it);Ot.assertNever(s)}}Qu.create=(t,e,n)=>new Qu({schema:t,typeName:ot.ZodEffects,effect:e,...yt(n)});Qu.createWithPreprocess=(t,e,n)=>new Qu({schema:e,effect:{type:"preprocess",transform:t},typeName:ot.ZodEffects,...yt(n)});class Oa extends At{_parse(e){return this._getType(e)===ze.undefined?Gs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oa.create=(t,e)=>new Oa({innerType:t,typeName:ot.ZodOptional,...yt(e)});class Ju extends At{_parse(e){return this._getType(e)===ze.null?Gs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ju.create=(t,e)=>new Ju({innerType:t,typeName:ot.ZodNullable,...yt(e)});class U2 extends At{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}U2.create=(t,e)=>new U2({innerType:t,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...yt(e)});class Z2 extends At{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Xm(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Z2.create=(t,e)=>new Z2({innerType:t,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...yt(e)});class cC extends At{_parse(e){if(this._getType(e)!==ze.nan){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:ze.nan,received:r.parsedType}),it}return{status:"valid",value:e.data}}}cC.create=t=>new cC({typeName:ot.ZodNaN,...yt(t)});class PG extends At{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ww extends At{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?it:i.status==="dirty"?(n.dirty(),wf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Ww({in:e,out:n,typeName:ot.ZodPipeline})}}class W2 extends At{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Yu(s)&&(s.value=Object.freeze(s.value)),s);return Xm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}W2.create=(t,e)=>new W2({innerType:t,typeName:ot.ZodReadonly,...yt(e)});var ot;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ot||(ot={}));const bf=Ra.create;Ba.create;Bi.create;const SI=zn.create;Jm.create;eg.create;lc.create;const RG=Xu.create;tg.create;Oa.create;Ju.create;const AG=SI({hash:bf().regex(/^[a-f0-9]{64}$/),mimeType:RG(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),TG=SI({id:bf().min(1),title:bf().trim().min(1),url:bf().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:bf().optional(),image:AG.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),IG=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=TG.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const u=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));u&&!u.image&&o.image&&(u.id===o.id||!n.has(o.id))&&(u.id=o.id,u.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},MG=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":null},OG=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=m.useState(!1),i=!!e&&!r,o=t.url?MG(t.url):null,l=t.url??(i?e:void 0),u=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return S.jsxs(u,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),l&&n()},className:"border-main-border bg-main-input text-content hover:border-content-muted/50 flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-2 focus-visible:-outline-offset-2",children:[i?S.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,i&&o?S.jsx(tm,{provider:o,className:Ht("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):S.jsx("span",{className:Ht("max-w-40 truncate",!i&&"py-1.5 pl-2"),children:d})]})},kI=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Vo(),l=IG(t);return l?S.jsx("div",{className:Ht("ph-no-capture flex min-w-0 flex-wrap gap-1.5 pr-3 pb-2",i),"aria-label":"References",children:l.map(u=>{var p;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return S.jsx(OG,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${u.id}:${((p=u.image)==null?void 0:p.hash)??""}:${f??""}`)})}):null},Pie=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},Rie=t=>{if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},LG=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},uC=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,dC=iI,NG=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return dC(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],p=i==null?void 0:i[d];if(f===null)return null;const g=uC(f)||uC(p);return s[d][g]}),l=n&&Object.entries(n).reduce((d,f)=>{let[p,g]=f;return g===void 0||(d[p]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:p,className:g,...v}=f;return Object.entries(v).every(w=>{let[_,x]=w;return Array.isArray(x)?x.includes({...i,...l}[_]):{...i,...l}[_]===x})?[...d,p,g]:d},[]);return dC(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},EI={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},CI=m.createContext(null);function Zh(){const t=m.useContext(CI);return t?t.classes:EI.pill}function DG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function $G({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{DG(()=>r(i))},[]);return S.jsx(CI.Provider,{value:{shape:n,setShape:s,classes:EI[n]},children:t})}const jG=NG(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),fC={default:16,compact:14},FG={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)]"},PI=m.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:u="button",...d},f)=>{const p=e??"secondary",g=n??"default",v=g==="icon"||g==="icon-compact",w=g==="compact"||g==="icon-compact",_=w?fC.compact:fC.default,x=Zh();return S.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:Ht(jG({variant:p,size:g,iconLeft:!v&&!!s,iconRight:!v&&!!i}),x.button,t),children:[S.jsx("span",{"aria-hidden":!0,className:Ht("absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active/button:[transition-duration:80ms,80ms] motion-reduce:transition-none",FG[p])}),S.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[S.jsxs("span",{className:Ht("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?S.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,S.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?S.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?S.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:S.jsx("svg",{className:w?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:S.jsx("path",{d:"M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});PI.displayName="Button";var VG=Object.defineProperty,fd=(t,e)=>VG(t,"name",{value:e,configurable:!0}),RI=!!(typeof window<"u"&&window.document&&window.document.createElement);function ln(t,e,{checkForDefaultPrevented:n=!0}={}){return fd(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}fd(ln,"composeEventHandlers");function HG(t){var e;if(!RI)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}fd(HG,"getOwnerWindow");function q2(t){if(!RI)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}fd(q2,"getOwnerDocument");function AI(t,e=!1){const{activeElement:n}=q2(t);if(!(n!=null&&n.nodeName))return null;if(TI(n)&&n.contentDocument)return AI(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=q2(n).getElementById(r);if(s)return s}}return n}fd(AI,"getActiveElement");function TI(t){return t.tagName==="IFRAME"}fd(TI,"isFrame");var zG=Object.defineProperty,qw=(t,e)=>zG(t,"name",{value:e,configurable:!0});function G2(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}qw(G2,"setRef");function II(...t){return e=>{let n=!1;const r=t.map(s=>{const i=G2(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():G2(t[s],null)}}}}qw(II,"composeRefs");function un(...t){return m.useCallback(II(...t),t)}qw(un,"useComposedRefs");var BG=Object.defineProperty,zs=(t,e)=>BG(t,"name",{value:e,configurable:!0});function UG(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=zs(i=>{const{children:o,...l}=i,u=m.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=m.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return zs(s,"useContext"),[r,s]}zs(UG,"createContext");function Ki(t,e=[]){let n=[];function r(i,o){const l=m.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=zs(p=>{var b;const{scope:g,children:v,...w}=p,_=((b=g==null?void 0:g[t])==null?void 0:b[u])||l,x=m.useMemo(()=>w,Object.values(w));return S.jsx(_.Provider,{value:x,children:v})},"Provider");d.displayName=i+"Provider";function f(p,g,v={}){var b;const{optional:w=!1}=v,_=((b=g==null?void 0:g[t])==null?void 0:b[u])||l,x=m.useContext(_);if(x)return x;if(o!==void 0)return o;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return zs(f,"useContext"),[d,f]}zs(r,"createContext");const s=zs(()=>{const i=n.map(o=>m.createContext(o));return zs(function(l){const u=(l==null?void 0:l[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,MI(s,...e)]}zs(Ki,"createContextScope");function MI(...t){const e=t[0];if(t.length===1)return e;const n=zs(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return zs(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...l,...p}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}zs(MI,"composeContextScopes");var ZG=Object.defineProperty,yi=(t,e)=>ZG(t,"name",{value:e,configurable:!0});function Ua(t){const e=m.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];K2(s)&&typeof S0=="function"&&(s=S0(s._payload)),m.Children.forEach(s,g=>{var v;if($I(g)){l=!0;const w=g;let _="child"in w.props?w.props.child:w.props.children;K2(_)&&typeof S0=="function"&&(_=S0(_._payload)),o=WG(w,_),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(g)}),o?o=m.cloneElement(o,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(o=s);const d=o?DI(o):void 0,f=un(r,d);if(!o){if(s||s===0)throw new Error(l?KG(t):GG(t));return s}const p=NI(i,o.props??{});return o.type!==m.Fragment&&(p.ref=r?f:d),m.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}yi(Ua,"createSlot");var OI=Symbol.for("radix.slottable");function LI(t){const e=yi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=OI,e}yi(LI,"createSlottable");var WG=yi((t,e)=>{if("child"in t.props){const n=t.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,t.props.children(n.props.children)):null}return m.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function NI(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}yi(NI,"mergeProps");function DI(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}yi(DI,"getElementRef");function $I(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OI}yi($I,"isSlottable");var qG=Symbol.for("react.lazy");function K2(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===qG&&"_payload"in t&&jI(t._payload)}yi(K2,"isLazyComponent");function jI(t){return typeof t=="object"&&t!==null&&"then"in t}yi(jI,"isPromiseLike");var GG=yi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),KG=yi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S0=Dh[" use ".trim().toString()],YG=Object.defineProperty,XG=(t,e)=>YG(t,"name",{value:e,configurable:!0}),QG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nn=QG.reduce((t,e)=>{const n=Ua(`Primitive.${e}`),r=m.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function FI(t,e){t&&Uh.flushSync(()=>t.dispatchEvent(e))}XG(FI,"dispatchDiscreteCustomEvent");var JG=Object.defineProperty,eK=(t,e)=>JG(t,"name",{value:e,configurable:!0});function cc(t){const e=m.useRef(t);return m.useEffect(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}eK(cc,"useCallbackRef");var tK=Object.defineProperty,ir=(t,e)=>tK(t,"name",{value:e,configurable:!0}),Y2="dismissableLayer.update",nK="dismissableLayer.pointerDownOutside",rK="dismissableLayer.focusOutside",hC,VI=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Gw=m.forwardRef(ir(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,p=m.useContext(VI),[g,v]=m.useState(null),w=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),x=un(n,v),b=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?b.indexOf(E):-1,R=g?b.indexOf(g):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,M=R>=C,I=m.useRef(!1),T=zI(j=>{o==null||o(j),u==null||u(j),j.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(j=>{if(!(j instanceof Node))return!1;const K=[...p.branches].some(U=>U.contains(j));return M&&!K},[p.branches,M])}),L=BI(j=>{if(s&&I.current)return;const K=j.target;[...p.branches].some(H=>H.contains(K))||(l==null||l(j),u==null||u(j),j.defaultPrevented||d==null||d())},w),D=g?R===b.length-1:!1,B=cc(j=>{j.key==="Escape"&&(i==null||i(j),!j.defaultPrevented&&d&&(j.preventDefault(),d()))});return m.useEffect(()=>{if(D)return w.addEventListener("keydown",B,{capture:!0}),()=>w.removeEventListener("keydown",B,{capture:!0})},[w,D,B]),m.useEffect(()=>{if(g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(hC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),X2(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(g),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=hC))}},[g,w,r,p]),m.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),X2())},[g,p]),m.useEffect(()=>{const j=ir(()=>_({}),"handleUpdate");return document.addEventListener(Y2,j),()=>document.removeEventListener(Y2,j)},[]),S.jsx(Nn.div,{...f,ref:x,style:{pointerEvents:A?M?"auto":"none":void 0,...e.style},onFocusCapture:ln(e.onFocusCapture,L.onFocusCapture),onBlurCapture:ln(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:ln(e.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function HI(){const t=m.useContext(VI),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}ir(HI,"useDismissableLayerSurface");var sK=ir(()=>!0,"IS_TRUE");function zI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=sK}=e,l=cc(t),u=m.useRef(!1),d=m.useRef(!1),f=m.useRef(new Map),p=m.useRef(()=>{});return m.useEffect(()=>{function g(){d.current=!1,s.current=!1,f.current.clear()}ir(g,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}ir(v,"isOutsideInteractionIntercepted");function w(C){if(!d.current)return;const R=C.target;R instanceof Node&&[...i].some(M=>M.contains(R))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}ir(w,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}ir(_,"handleInteractionBubble");const x=ir(C=>{if(C.target&&!u.current){let R=function(){n.removeEventListener("click",p.current);const M=v();g(),M||Kw(nK,l,A,{discrete:!0})};if(ir(R,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.current),g(),u.current=!1;return}const A={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?R():(n.removeEventListener("click",p.current),p.current=R,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),g();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of b)n.addEventListener(C,w,!0),n.addEventListener(C,_);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const C of b)n.removeEventListener(C,w,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:ir(()=>u.current=!0,"onPointerDownCapture")}}ir(zI,"usePointerDownOutside");function BI(t,e=globalThis==null?void 0:globalThis.document){const n=cc(t),r=m.useRef(!1);return m.useEffect(()=>{const s=ir(i=>{i.target&&!r.current&&Kw(rK,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:ir(()=>r.current=!0,"onFocusCapture"),onBlurCapture:ir(()=>r.current=!1,"onBlurCapture")}}ir(BI,"useFocusOutside");function X2(){const t=new CustomEvent(Y2);document.dispatchEvent(t)}ir(X2,"dispatchUpdate");function Kw(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?FI(s,i):s.dispatchEvent(i)}ir(Kw,"handleAndDispatchCustomEvent");var Xr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},iK=Object.defineProperty,oK=(t,e)=>iK(t,"name",{value:e,configurable:!0}),aK=Dh[" useId ".trim().toString()]||(()=>{}),lK=0;function La(t){const[e,n]=m.useState(aK());return Xr(()=>{t||n(r=>r??String(lK++))},[t]),t||(e?`radix-${e}`:"")}oK(La,"useId");const cK=["top","right","bottom","left"],Za=Math.min,Io=Math.max,ng=Math.round,k0=Math.floor,Mo=t=>({x:t,y:t}),uK={left:"right",right:"left",bottom:"top",top:"bottom"};function UI(t,e,n){return Io(t,Za(e,n))}function No(t,e){return typeof t=="function"?t(e):t}function Wa(t){return t.split("-")[0]}function hd(t){return t.split("-")[1]}function Yw(t){return t==="x"?"y":"x"}function Xw(t){return t==="y"?"height":"width"}function Vi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Qw(t){return Yw(Vi(t))}function dK(t,e,n){n===void 0&&(n=!1);const r=hd(t),s=Qw(t),i=Xw(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=rg(o)),[o,rg(o)]}function fK(t){const e=rg(t);return[Q2(t),e,Q2(e)]}function Q2(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const pC=["left","right"],mC=["right","left"],hK=["top","bottom"],pK=["bottom","top"];function mK(t,e,n){switch(t){case"top":case"bottom":return n?e?mC:pC:e?pC:mC;case"left":case"right":return e?hK:pK;default:return[]}}function gK(t,e,n,r){const s=hd(t);let i=mK(Wa(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Q2)))),i}function rg(t){const e=Wa(t);return uK[e]+t.slice(e.length)}function vK(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function ZI(t){return typeof t!="number"?vK(t):{top:t,right:t,bottom:t,left:t}}function sg(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function gC(t,e,n){let{reference:r,floating:s}=t;const i=Vi(e),o=Qw(e),l=Xw(o),u=Wa(e),d=i==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}const w=hd(e);return w&&(v[o]+=g*(w==="end"?1:-1)*(n&&d?-1:1)),v}async function yK(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=No(e,t),w=ZI(v),x=l[g?p==="floating"?"reference":"floating":p],b=sg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),E=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),R=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},A=sg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:C,strategy:u}):E);return{top:(b.top-A.top+w.top)/R.y,bottom:(A.bottom-b.bottom+w.bottom)/R.y,left:(b.left-A.left+w.left)/R.x,right:(A.right-b.right+w.right)/R.x}}const _K=50,xK=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:yK},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:p}=gC(d,r,u),g=r,v=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:b,fn:E}=x,{x:C,y:R,data:A,reset:M}=await E({x:f,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,p=R??p,w[b]={...w[b],...A},M&&v<_K&&(v++,typeof M=="object"&&(M.placement&&(g=M.placement),M.rects&&(d=M.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):M.rects),{x:f,y:p}=gC(d,g,u)),_=-1)}return{x:f,y:p,placement:g,strategy:s,middlewareData:w}},wK=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=No(t,e)||{};if(d==null)return{};const p=ZI(f),g={x:n,y:r},v=Qw(s),w=Xw(v),_=await o.getDimensions(d),x=v==="y",b=x?"top":"left",E=x?"bottom":"right",C=x?"clientHeight":"clientWidth",R=i.reference[w]+i.reference[v]-g[v]-i.floating[w],A=g[v]-i.reference[v],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=M?M[C]:0;(!I||!await(o.isElement==null?void 0:o.isElement(M)))&&(I=l.floating[C]||i.floating[w]);const T=R/2-A/2,L=I/2-_[w]/2-1,D=Za(p[b],L),B=Za(p[E],L),j=I-_[w]-B,K=I/2-_[w]/2+T,U=UI(D,K,j),H=!u.arrow&&hd(s)!=null&&K!==U&&i.reference[w]/2-(K<D?D:B)-_[w]/2<0,Z=H?K<D?K-D:K-j:0;return{[v]:g[v]+Z,data:{[v]:U,centerOffset:K-U-Z,...H&&{alignmentOffset:Z}},reset:H}}}),bK=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=No(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Wa(s),E=Vi(l),C=Wa(l)===l,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=g||(C||!_?[rg(l)]:fK(l)),M=w!=="none";!g&&M&&A.push(...gK(l,_,w,R));const I=[l,...A],T=await u.detectOverflow(e,x),L=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(T[b]),p){const U=dK(s,o,R);L.push(T[U[0]],T[U[1]])}if(D=[...D,{placement:s,overflows:L}],!L.every(U=>U<=0)){var B,j;const U=(((B=i.flip)==null?void 0:B.index)||0)+1,H=I[U];if(H&&(!(p==="alignment"?E!==Vi(H):!1)||D.every(z=>Vi(z.placement)===E?z.overflows[0]>0:!0)))return{data:{index:U,overflows:D},reset:{placement:H}};let Z=(j=D.filter(Q=>Q.overflows[0]<=0).sort((Q,z)=>Q.overflows[1]-z.overflows[1])[0])==null?void 0:j.placement;if(!Z)switch(v){case"bestFit":{var K;const Q=(K=D.filter(z=>{if(M){const ee=Vi(z.placement);return ee===E||ee==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(ee=>ee>0).reduce((ee,W)=>ee+W,0)]).sort((z,ee)=>z[1]-ee[1])[0])==null?void 0:K[0];Q&&(Z=Q);break}case"initialPlacement":Z=l;break}if(s!==Z)return{reset:{placement:Z}}}return{}}}};function vC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yC(t){return cK.some(e=>t[e]>=0)}const SK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=No(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=vC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:yC(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=vC(o,n.floating);return{data:{escapedOffsets:l,escaped:yC(l)}}}default:return{}}}}},WI=new Set(["left","top"]);async function kK(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Wa(n),l=hd(n),u=Vi(n)==="y",d=WI.has(o)?-1:1,f=i&&u?-1:1,p=No(e,t);let{mainAxis:g,crossAxis:v,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(v=l==="end"?w*-1:w),u?{x:v*f,y:g*d}:{x:g*d,y:v*f}}const EK=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,u=await kK(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},CK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:E=>{let{x:C,y:R}=E;return{x:C,y:R}}},...d}=No(t,e),f={x:n,y:r},p=await i.detectOverflow(e,d),g=Vi(s),v=Yw(g);let w=f[v],_=f[g];const x=(E,C)=>UI(C+p[E==="y"?"top":"left"],C,C-p[E==="y"?"bottom":"right"]);o&&(w=x(v,w)),l&&(_=x(g,_));const b=u.fn({...e,[v]:w,[g]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[v]:o,[g]:l}}}}}},PK=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=No(t,e),g={x:s,y:i},v=Vi(o),w=Yw(v);let _=g[w],x=g[v];const b=No(d,e),E=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(f){const A=w==="y"?"height":"width",M=l.reference[w]-l.floating[A]+E.mainAxis,I=l.reference[w]+l.reference[A]-E.mainAxis;_<M?_=M:_>I&&(_=I)}if(p){var C,R;const A=w==="y"?"width":"height",M=WI.has(Wa(o)),I=l.reference[v]-l.floating[A]+(M&&((C=u.offset)==null?void 0:C[v])||0)+(M?0:E.crossAxis),T=l.reference[v]+l.reference[A]+(M?0:((R=u.offset)==null?void 0:R[v])||0)-(M?E.crossAxis:0);x<I?x=I:x>T&&(x=T)}return{[w]:_,[v]:x}}}},RK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=No(t,e),u=await s.detectOverflow(e,l),d=Wa(n),f=hd(n),p=Vi(n)==="y",{width:g,height:v}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=g-u.left-u.right,E=Za(v-u[w],x),C=Za(g-u[_],b),R=e.middlewareData.shift,A=!R;let M=E,I=C;R!=null&&R.enabled.x&&(I=b),R!=null&&R.enabled.y&&(M=x),A&&!f&&(p?I=g-2*Io(u.left,u.right):M=v-2*Io(u.top,u.bottom)),await o({...e,availableWidth:I,availableHeight:M});const T=await s.getDimensions(i.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Og(){return typeof window<"u"}function pd(t){return qI(t)?(t.nodeName||"").toLowerCase():"#document"}function Qr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ho(t){var e;return(e=(qI(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qI(t){return Og()?t instanceof Node||t instanceof Qr(t).Node:!1}function Wi(t){return Og()?t instanceof Element||t instanceof Qr(t).Element:!1}function Qa(t){return Og()?t instanceof HTMLElement||t instanceof Qr(t).HTMLElement:!1}function _C(t){return!Og()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qr(t).ShadowRoot}function Lg(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=qi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function AK(t){return/^(table|td|th)$/.test(pd(t))}function Ng(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const TK=/transform|translate|scale|rotate|perspective|filter/,IK=/paint|layout|strict|content/,Pl=t=>!!t&&t!=="none";let Vy;function Jw(t){const e=Wi(t)?qi(t):t;return Pl(e.transform)||Pl(e.translate)||Pl(e.scale)||Pl(e.rotate)||Pl(e.perspective)||!eb()&&(Pl(e.backdropFilter)||Pl(e.filter))||TK.test(e.willChange||"")||IK.test(e.contain||"")}function MK(t){let e=uc(t);for(;Qa(e)&&!ph(e);){if(Jw(e))return e;if(Ng(e))return null;e=uc(e)}return null}function eb(){return Vy==null&&(Vy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vy}function ph(t){return/^(html|body|#document)$/.test(pd(t))}function qi(t){return Qr(t).getComputedStyle(t)}function Dg(t){return Wi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function uc(t){if(pd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_C(t)&&t.host||Ho(t);return _C(e)?e.host:e}function GI(t){const e=uc(t);return ph(e)?(t.ownerDocument||t).body:Qa(e)&&Lg(e)?e:GI(e)}function mh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=GI(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Qr(s);if(i){const l=J2(o);return e.concat(o,o.visualViewport||[],Lg(s)?s:[],l&&n?mh(l):[])}else return e.concat(s,mh(s,[],n))}function J2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function KI(t){const e=qi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Qa(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=ng(n)!==i||ng(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function tb(t){return Wi(t)?t:t.contextElement}function Su(t){const e=tb(t);if(!Qa(e))return Mo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=KI(e);let o=(i?ng(n.width):n.width)/r,l=(i?ng(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const OK=Mo(0);function YI(t){const e=Qr(t);return!eb()||!e.visualViewport?OK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function LK(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Qr(t)}function dc(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=tb(t);let o=Mo(1);e&&(r?Wi(r)&&(o=Su(r)):o=Su(t));const l=LK(i,n,r)?YI(i):Mo(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,p=s.height/o.y;if(i&&r){const g=Qr(i),v=Wi(r)?Qr(r):r;let w=g,_=J2(w);for(;_&&v!==w;){const x=Su(_),b=_.getBoundingClientRect(),E=qi(_),C=b.left+(_.clientLeft+parseFloat(E.paddingLeft))*x.x,R=b.top+(_.clientTop+parseFloat(E.paddingTop))*x.y;u*=x.x,d*=x.y,f*=x.x,p*=x.y,u+=C,d+=R,w=Qr(_),_=J2(w)}}return sg({width:f,height:p,x:u,y:d})}function $g(t,e){const n=Dg(t).scrollLeft;return e?e.left+n:dc(Ho(t)).left+n}function XI(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-$g(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function NK(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Ho(r),l=e?Ng(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Mo(1);const f=Mo(0),p=Qa(r);if((p||!i)&&((pd(r)!=="body"||Lg(o))&&(u=Dg(r)),p)){const v=dc(r);d=Su(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!p&&!i?XI(o,u):Mo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-u.scrollTop*d.y+f.y+g.y}}function DK(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function $K(t){const e=Dg(t),n=t.ownerDocument.body,r=Io(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Io(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+$g(t);const o=-e.scrollTop;return qi(n).direction==="rtl"&&(i+=Io(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const jK=25;function FK(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Qr(t),i=Ho(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const g=!eb()||e==="fixed";r?g||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,g&&(d=o.offsetLeft,f=o.offsetTop))}if($g(i)<=0){const g=i.ownerDocument,v=g.body,w=getComputedStyle(v),_=g.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-v.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;b<=jK&&(l-=b)}return{width:l,height:u,x:d,y:f}}function VK(t,e){const n=dc(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Su(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function xC(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=FK(t,n,e);else if(e==="document")r=$K(Ho(t));else if(Wi(e))r=VK(e,n);else{const s=YI(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return sg(r)}function HK(t,e){const n=e.get(t);if(n)return n;let r=mh(t,[],!1).filter(l=>Wi(l)&&pd(l)!=="body"),s=null;const i=qi(t).position==="fixed";let o=i?uc(t):t;for(;Wi(o)&&!ph(o);){const l=qi(o),u=Jw(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==o):s=l,o=uc(o)}return e.set(t,r),r}function zK(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Ng(e)?[]:HK(e,this._c):[].concat(n),r],l=xC(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,p=l.left;for(let g=1;g<o.length;g++){const v=xC(e,o[g],s);u=Io(v.top,u),d=Za(v.right,d),f=Za(v.bottom,f),p=Io(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function BK(t){const{width:e,height:n}=KI(t);return{width:e,height:n}}function UK(t,e,n){const r=Qa(e),s=Ho(e),i=n==="fixed",o=dc(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Mo(0);if((r||!i)&&((pd(e)!=="body"||Lg(s))&&(l=Dg(e)),r)){const g=dc(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&s&&(u.x=$g(s));const d=s&&!r&&!i?XI(s,l):Mo(0),f=o.left+l.scrollLeft-u.x-d.x,p=o.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function Hy(t){return qi(t).position==="static"}function wC(t,e){if(!Qa(t)||qi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ho(t)===n&&(n=n.ownerDocument.body),n}function QI(t,e){const n=Qr(t);if(Ng(t))return n;if(!Qa(t)){let s=uc(t);for(;s&&!ph(s);){if(Wi(s)&&!Hy(s))return s;s=uc(s)}return n}let r=wC(t,e);for(;r&&AK(r)&&Hy(r);)r=wC(r,e);return r&&ph(r)&&Hy(r)&&!Jw(r)?n:r||MK(t)||n}const ZK=async function(t){const e=this.getOffsetParent||QI,n=this.getDimensions,r=await n(t.floating);return{reference:UK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WK(t){return qi(t).direction==="rtl"}const qK={convertOffsetParentRelativeRectToViewportRelativeRect:NK,getDocumentElement:Ho,getClippingRect:zK,getOffsetParent:QI,getElementRects:ZK,getClientRects:DK,getDimensions:BK,getScale:Su,isElement:Wi,isRTL:WK};function JI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function GK(t,e,n){let r=null,s;const i=Ho(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),o();const g=t.getBoundingClientRect(),{left:v,top:w,width:_,height:x}=g;if(f||e(),!_||!x)return;const b=k0(w),E=k0(i.clientWidth-(v+_)),C=k0(i.clientHeight-(w+x)),R=k0(v),M={rootMargin:-b+"px "+-E+"px "+-C+"px "+-R+"px",threshold:Io(0,Za(1,p))||1};let I=!0;function T(L){const D=L[0].intersectionRatio;if(!JI(g,t.getBoundingClientRect()))return l();if(D!==p){if(!I)return l();D?l(!1,D):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(T,{...M,root:i.ownerDocument})}catch{r=new IntersectionObserver(T,M)}r.observe(t)}const u=Qr(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function KK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=tb(t),f=s||i?[...d?mh(d):[],...e?mh(e):[]]:[];f.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const p=d&&l?GK(d,n,i):null;let g=-1,v=null;o&&(v=new ResizeObserver(b=>{let[E]=b;E&&E.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let w,_=u?dc(t):null;u&&x();function x(){const b=dc(t);_&&!JI(_,b)&&n(),_=b,w=requestAnimationFrame(x)}return n(),()=>{var b;f.forEach(E=>{s&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),p==null||p(),(b=v)==null||b.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const YK=EK,XK=CK,QK=bK,JK=RK,eY=SK,bC=wK,tY=PK,nY=(t,e,n)=>{const r=new Map,s=n??{},i={...qK,...s.platform,_c:r};return xK(t,e,{...s,platform:i})};var rY=typeof document<"u",sY=function(){},nm=rY?m.useLayoutEffect:sY;function ig(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!ig(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!ig(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function eM(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function SC(t,e){const n=eM(t);return Math.round(e*n)/n}function zy(t){const e=m.useRef(t);return nm(()=>{e.current=t}),e}function iY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,p]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,v]=m.useState(r);ig(g,r)||v(r);const[w,_]=m.useState(null),[x,b]=m.useState(null),E=m.useCallback(z=>{z!==M.current&&(M.current=z,_(z))},[]),C=m.useCallback(z=>{z!==I.current&&(I.current=z,b(z))},[]),R=i||w,A=o||x,M=m.useRef(null),I=m.useRef(null),T=m.useRef(f),L=u!=null,D=zy(u),B=zy(s),j=zy(d),K=m.useCallback(()=>{if(!M.current||!I.current)return;const z={placement:e,strategy:n,middleware:g};B.current&&(z.platform=B.current),nY(M.current,I.current,z).then(ee=>{const W={...ee,isPositioned:j.current!==!1};U.current&&!ig(T.current,W)&&(T.current=W,Uh.flushSync(()=>{p(W)}))})},[g,e,n,B,j]);nm(()=>{d===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const U=m.useRef(!1);nm(()=>(U.current=!0,()=>{U.current=!1}),[]),nm(()=>{if(R&&(M.current=R),A&&(I.current=A),R&&A){if(D.current)return D.current(R,A,K);K()}},[R,A,K,D,L]);const H=m.useMemo(()=>({reference:M,floating:I,setReference:E,setFloating:C}),[E,C]),Z=m.useMemo(()=>({reference:R,floating:A}),[R,A]),Q=m.useMemo(()=>{const z={position:n,left:0,top:0};if(!Z.floating)return z;const ee=SC(Z.floating,f.x),W=SC(Z.floating,f.y);return l?{...z,transform:"translate("+ee+"px, "+W+"px)",...eM(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:W}},[n,l,Z.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:K,refs:H,elements:Z,floatingStyles:Q}),[f,K,H,Z,Q])}const oY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?bC({element:r.current,padding:s}).fn(n):{}:r?bC({element:r,padding:s}).fn(n):{}}}},aY=(t,e)=>{const n=YK(t);return{name:n.name,fn:n.fn,options:[t,e]}},lY=(t,e)=>{const n=XK(t);return{name:n.name,fn:n.fn,options:[t,e]}},cY=(t,e)=>({fn:tY(t).fn,options:[t,e]}),uY=(t,e)=>{const n=QK(t);return{name:n.name,fn:n.fn,options:[t,e]}},dY=(t,e)=>{const n=JK(t);return{name:n.name,fn:n.fn,options:[t,e]}},fY=(t,e)=>{const n=eY(t);return{name:n.name,fn:n.fn,options:[t,e]}},hY=(t,e)=>{const n=oY(t);return{name:n.name,fn:n.fn,options:[t,e]}};var pY=Object.defineProperty,mY=(t,e)=>pY(t,"name",{value:e,configurable:!0});function nb(t){const[e,n]=m.useState(void 0);return Xr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=t.offsetWidth,l=t.offsetHeight;n({width:o,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}mY(nb,"useSize");var gY=Object.defineProperty,Na=(t,e)=>gY(t,"name",{value:e,configurable:!0}),tM="Popper",[nM,jg]=Ki(tM),[vY,rM]=nM(tM),yY=Na(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return S.jsx(vY,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),_Y="PopperAnchor",xY=m.forwardRef(Na(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=rM(_Y,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=un(n,d),p=m.useRef(null);m.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&u(p.current)});const g=o.placementState&&Fg(o.placementState),v=g==null?void 0:g[0],w=g==null?void 0:g[1];return s?null:S.jsx(Nn.div,{"data-radix-popper-side":v,"data-radix-popper-align":w,...i,ref:f})},"PopperAnchor")),sM="PopperContent",[wY,Aie]=nM(sM),bY=m.forwardRef(Na(function(e,n){var ae,Oe,Ce,Ge,dt,Lt,Kt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,b=rM(sM,r),[E,C]=m.useState(null),R=un(n,C),[A,M]=m.useState(null),I=nb(A),T=(I==null?void 0:I.width)??0,L=(I==null?void 0:I.height)??0,D=s+(o!=="center"?"-"+o:""),B=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},j=Array.isArray(f)?f:[f],K=j.length>0,U={padding:B,boundary:j.filter(iM),altBoundary:K},{refs:H,floatingStyles:Z,placement:Q,isPositioned:z,middlewareData:ee}=iY({strategy:"fixed",placement:D,whileElementsMounted:Na((..._t)=>KK(..._t,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[aY({mainAxis:i+L,alignmentAxis:l}),d&&lY({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?cY():void 0,...U}),d&&uY({...U}),dY({...U,apply:Na(({elements:_t,rects:ht,availableWidth:En,availableHeight:kt})=>{const{width:Yt,height:Le}=ht.reference,rt=_t.floating.style;rt.setProperty("--radix-popper-available-width",`${En}px`),rt.setProperty("--radix-popper-available-height",`${kt}px`),rt.setProperty("--radix-popper-anchor-width",`${Yt}px`),rt.setProperty("--radix-popper-anchor-height",`${Le}px`)},"apply")}),A&&hY({element:A,padding:u}),SY({arrowWidth:T,arrowHeight:L}),v&&fY({strategy:"referenceHidden",...U,boundary:K?U.boundary:void 0})]}),W=b.setPlacementState;Xr(()=>(W(Q),()=>{W(void 0)}),[Q,W]);const[N,X]=Fg(Q),ie=cc(_);Xr(()=>{z&&(ie==null||ie())},[z,ie]);const ne=(ae=ee.arrow)==null?void 0:ae.x,oe=(Oe=ee.arrow)==null?void 0:Oe.y,fe=((Ce=ee.arrow)==null?void 0:Ce.centerOffset)!==0,[xe,de]=m.useState();return Xr(()=>{E&&de(window.getComputedStyle(E).zIndex)},[E]),S.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:z?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(Ge=ee.transformOrigin)==null?void 0:Ge.x,(dt=ee.transformOrigin)==null?void 0:dt.y].join(" "),...((Lt=ee.hide)==null?void 0:Lt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(wY,{scope:r,placedSide:N,placedAlign:X,onArrowChange:M,arrowX:ne,arrowY:oe,shouldHideArrow:fe,children:S.jsx(Nn.div,{"data-side":N,"data-align":X,...x,ref:R,style:{...x.style,animation:z?(Kt=x.style)==null?void 0:Kt.animation:"none"}})})})},"PopperContent"));function iM(t){return t!==null}Na(iM,"isNotNull");var SY=Na(t=>({name:"transformOrigin",options:t,fn(e){var x,b,E;const{placement:n,rects:r,middlewareData:s}=e,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=Fg(n),p={start:"0%",center:"50%",end:"100%"}[f],g=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,v=(((E=s.arrow)==null?void 0:E.y)??0)+u/2;let w="",_="";return d==="bottom"?(w=o?p:`${g}px`,_=`${-u}px`):d==="top"?(w=o?p:`${g}px`,_=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,_=o?p:`${v}px`):d==="left"&&(w=`${r.floating.width+u}px`,_=o?p:`${v}px`),{data:{x:w,y:_}}}}),"transformOrigin");function Fg(t){const[e,n="center"]=t.split("-");return[e,n]}Na(Fg,"getSideAndAlignFromPlacement");var oM=yY,aM=xY,lM=bY,kY=Object.defineProperty,EY=(t,e)=>kY(t,"name",{value:e,configurable:!0}),rb=m.forwardRef(EY(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Xr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Uh.createPortal(S.jsx(Nn.div,{...s,ref:n}),l):null},"Portal")),CY=Object.defineProperty,Do=(t,e)=>CY(t,"name",{value:e,configurable:!0});function cM(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Do(cM,"useStateMachine");var Ja=Do(t=>{const{present:e,children:n}=t,r=uM(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=dM(r.ref,fM(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function uM(t){const[e,n]=m.useState(),r=m.useRef(null),s=m.useRef(t),i=m.useRef("none"),o=m.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=cM(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{u==="mounted"?(i.current=o.current??uu(r.current),o.current=void 0):i.current="none"},[u]),Xr(()=>{const f=r.current,p=s.current;if(p!==t){const v=i.current,w=uu(f);t?(o.current=w,d("MOUNT")):w==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&v!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Xr(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,g=Do(w=>{const x=uu(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},"handleAnimationEnd"),v=Do(w=>{w.target===e&&(i.current=uu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,o.current=uu(p)}else r.current=null;n(f)},[])}}Do(uM,"usePresence");function ex(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Do(ex,"setRef");function dM(...t){const e=m.useRef(t);return e.current=t,m.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=ex(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():ex(r[o],null)}}},[])}Do(dM,"useStableComposedRefs");function uu(t){return(t==null?void 0:t.animationName)||"none"}Do(uu,"getAnimationName");function fM(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Do(fM,"getElementRef");var PY=Object.defineProperty,RY=(t,e)=>PY(t,"name",{value:e,configurable:!0}),kC=Dh[" useEffectEvent ".trim().toString()],EC=Dh[" useInsertionEffect ".trim().toString()];function hM(t){if(typeof kC=="function")return kC(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof EC=="function"?EC(()=>{e.current=t}):Xr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}RY(hM,"useEffectEvent");var AY=Object.defineProperty,Wh=(t,e)=>AY(t,"name",{value:e,configurable:!0}),TY=Dh[" useInsertionEffect ".trim().toString()]||Xr;function el({prop:t,defaultProp:e,onChange:n=Wh(()=>{},"onChange"),caller:r}){const[s,i,o]=pM({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var p;if(l){const g=mM(f)?f(t):f;g!==t&&((p=o.current)==null||p.call(o,g))}else i(f)},[l,t,i,o]);return[u,d]}Wh(el,"useControllableState");function pM({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return TY(()=>{i.current=e},[e]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}Wh(pM,"useUncontrolledState");function mM(t){return typeof t=="function"}Wh(mM,"isFunction");var CC=Symbol("RADIX:SYNC_STATE");function IY(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=hM(o),f=[{...n,state:i}];r&&f.push(r);const[p,g]=m.useReducer((x,b)=>{if(b.type===CC)return{...x,state:b.state};const E=t(x,b);return u&&!Object.is(E.state,x.state)&&d(E.state),E},...f),v=p.state,w=m.useRef(v);m.useEffect(()=>{w.current!==v&&(w.current=v,u||d(v))},[v,w,u]);const _=m.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return m.useEffect(()=>{u&&!Object.is(s,p.state)&&g({type:CC,state:s})},[s,p.state,u]),[_,g]}Wh(IY,"useControllableStateReducer");var MY=Object.defineProperty,OY=(t,e)=>MY(t,"name",{value:e,configurable:!0}),LY=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NY=m.forwardRef(OY(function(e,n){return S.jsx(Nn.span,{...e,ref:n,style:{...LY,...e.style}})},"VisuallyHidden")),DY=NY,$Y=Object.defineProperty,ar=(t,e)=>$Y(t,"name",{value:e,configurable:!0}),[sb,Tie]=Ki("Tooltip",[jg]),ib=jg(),jY="TooltipProvider",FY=700,tx="tooltip.open",[VY,ob]=sb(jY),HY=ar(t=>{const{__scopeTooltip:e,delayDuration:n=FY,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=m.useRef(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),S.jsx(VY,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),nx="Tooltip",[zY,qh]=sb(nx),BY=ar(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=ob(nx,t.__scopeTooltip),d=ib(e),[f,p]=m.useState(null),[g,v]=m.useState(void 0),w=La(),_=m.useRef(0),x=o??u.disableHoverableContent,b=l??u.delayDuration,E=m.useRef(!1),[C,R]=el({prop:r,defaultProp:s??!1,onChange:ar(D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(tx))):u.onClose(),i==null||i(D)},"onChange"),caller:nx}),A=m.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),M=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,R(!0)},[R]),I=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,R(!1)},[R]),T=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{E.current=!0,R(!0),_.current=0},b)},[b,R]);m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const L=g??w;return S.jsx(oM,{...d,children:S.jsx(zY,{scope:e,contentId:L,setContentId:v,open:C,stateAttribute:A,trigger:f,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{u.isOpenDelayedRef.current?T():M()},[u.isOpenDelayedRef,T,M]),onTriggerLeave:m.useCallback(()=>{x?I():(window.clearTimeout(_.current),_.current=0)},[I,x]),onOpen:M,onClose:I,disableHoverableContent:x,children:n})})},"Tooltip"),PC="TooltipTrigger",UY=m.forwardRef(ar(function(e,n){const{__scopeTooltip:r,...s}=e,i=qh(PC,r),o=ob(PC,r),l=ib(r),u=m.useRef(null),d=un(n,u,i.onTriggerChange),f=m.useRef(!1),p=m.useRef(!1),g=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),S.jsx(aM,{asChild:!0,...l,children:S.jsx(Nn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:ln(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:ln(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:ln(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:ln(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:ln(e.onBlur,i.onClose),onClick:ln(e.onClick,i.onClose)})})},"TooltipTrigger")),gM="TooltipPortal",[ZY,WY]=sb(gM,{forceMount:void 0}),qY=ar(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=qh(gM,e);return S.jsx(ZY,{scope:e,forceMount:n,children:S.jsx(Ja,{present:n||i.open,children:S.jsx(rb,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),gh="TooltipContent",GY=m.forwardRef(ar(function(e,n){const r=WY(gh,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=qh(gh,e.__scopeTooltip);return S.jsx(Ja,{present:s||l.open,children:l.disableHoverableContent?S.jsx(vM,{side:i,...o,ref:n}):S.jsx(KY,{side:i,...o,ref:n})})},"TooltipContent")),KY=m.forwardRef(ar(function(e,n){const r=qh(gh,e.__scopeTooltip),s=ob(gh,e.__scopeTooltip),i=m.useRef(null),o=un(n,i),[l,u]=m.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:g}=s,v=m.useCallback(()=>{u(null),g(!1)},[g]),w=m.useCallback((_,x)=>{const b=_.currentTarget,E={x:_.clientX,y:_.clientY},C=yM(E,b.getBoundingClientRect()),R=_M(E,C),A=xM(x.getBoundingClientRect()),M=bM([...R,...A]);u(M),g(!0)},[g]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&p){const _=ar(b=>w(b,p),"handleTriggerLeave"),x=ar(b=>w(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,v]),m.useEffect(()=>{if(l){const _=ar(x=>{const b=x.target,E={x:x.clientX,y:x.clientY},C=(d==null?void 0:d.contains(b))||(p==null?void 0:p.contains(b)),R=!wM(E,l);C?v():R&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,l,f,v]),S.jsx(vM,{...e,ref:o})},"TooltipContentHoverable")),YY=LI("TooltipContent"),vM=m.forwardRef(ar(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=qh(gh,r),p=ib(r),{onClose:g}=f;m.useEffect(()=>(document.addEventListener(tx,g),()=>document.removeEventListener(tx,g)),[g]),m.useEffect(()=>{if(f.trigger){const w=ar(_=>{_.target instanceof Node&&_.target.contains(f.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[f.trigger,g]);const{setContentId:v}=f;return Xr(()=>(v(o),()=>{v(void 0)}),[o,v]),S.jsx(Gw,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:w=>w.preventDefault(),onDismiss:g,children:S.jsxs(lM,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(YY,{children:s}),i?S.jsx(DY,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function yM(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}ar(yM,"getExitSideFromRect");function _M(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}ar(_M,"getPaddedExitPoints");function xM(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}ar(xM,"getPointsFromRect");function wM(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,f=l.y,p=u.x,g=u.y;f>r!=g>r&&n<(p-d)*(r-f)/(g-f)+d&&(s=!s)}return s}ar(wM,"isPointInPolygon");function bM(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),SM(e)}ar(bM,"getHull");function SM(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}ar(SM,"getHullPresorted");var XY=HY,QY=BY,JY=UY,eX=qY,tX=GY;const Bf={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},kM=m.createContext(null);function EM({value:t,children:e}){return S.jsx(kM.Provider,{value:t,children:e})}function nX(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function ab({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=m.useState(!1),f=o!==void 0?o:u,[p,g]=m.useState(!1),v=Zh(),w=m.useContext(kM);m.useEffect(()=>{f&&g(!0)},[f]);const _=()=>{f||g(!1)},x=nX(n);return S.jsx(XY,{delayDuration:s,children:S.jsxs(QY,{open:f,onOpenChange:b=>{d(b),l==null||l(b)},children:[S.jsx(JY,{asChild:!0,children:e}),p&&S.jsx(eX,{forceMount:!0,container:w??void 0,children:S.jsx(tX,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(To.div,{className:Ht("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:Bf.medium},initial:{opacity:0,scale:.8,...x},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Oo=m.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(PI,{ref:r,...n});return t?S.jsx(ab,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:t}),e?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});Oo.displayName="Button";var rX=Object.defineProperty,jr=(t,e)=>rX(t,"name",{value:e,configurable:!0}),By="focusScope.autoFocusOnMount",Uy="focusScope.autoFocusOnUnmount",RC={bubbles:!1,cancelable:!0},CM=m.forwardRef(jr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=m.useState(null),f=cc(i),p=cc(o),g=m.useRef(null),v=un(n,d),w=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let x=function(R){if(w.paused||!u)return;const A=R.target;u.contains(A)?g.current=A:xo(g.current,{select:!0})},b=function(R){if(w.paused||!u)return;const A=R.relatedTarget;A!==null&&(u.contains(A)||xo(g.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const M of R)M.removedNodes.length>0&&xo(u)};jr(x,"handleFocusIn"),jr(b,"handleFocusOut"),jr(E,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",b);const C=new MutationObserver(E);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),C.disconnect()}}},[s,u,w.paused]),m.useEffect(()=>{if(u){AC.add(w);const x=document.activeElement;if(!u.contains(x)){const E=new CustomEvent(By,RC);u.addEventListener(By,f),u.dispatchEvent(E),E.defaultPrevented||(PM(MM(lb(u)),{select:!0}),document.activeElement===x&&xo(u))}return()=>{u.removeEventListener(By,f),setTimeout(()=>{const E=new CustomEvent(Uy,RC);u.addEventListener(Uy,p),u.dispatchEvent(E),E.defaultPrevented||xo(x??document.body,{select:!0}),u.removeEventListener(Uy,p),AC.remove(w)},0)}}},[u,f,p,w]);const _=m.useCallback(x=>{if(!r&&!s||w.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(b&&E){const C=x.currentTarget,[R,A]=RM(C);R&&A?!x.shiftKey&&E===A?(x.preventDefault(),r&&xo(R,{select:!0})):x.shiftKey&&E===R&&(x.preventDefault(),r&&xo(A,{select:!0})):E===C&&x.preventDefault()}},[r,s,w.paused]);return S.jsx(Nn.div,{tabIndex:-1,...l,ref:v,onKeyDown:_})},"FocusScope"));function PM(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(xo(r,{select:e}),document.activeElement!==n)return}jr(PM,"focusFirst");function RM(t){const e=lb(t),n=rx(e,t),r=rx(e.reverse(),t);return[n,r]}jr(RM,"getTabbableEdges");function lb(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:jr(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}jr(lb,"getTabbableCandidates");function rx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):AM(r,{upTo:e})))return r}jr(rx,"findVisible");function AM(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}jr(AM,"isHidden");function TM(t){return t instanceof HTMLInputElement&&"select"in t}jr(TM,"isSelectableInput");function xo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&TM(t)&&e&&t.select()}}jr(xo,"focus");var AC=IM();function IM(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=sx(t,e),t.unshift(e)},remove(e){var n;t=sx(t,e),(n=t[0])==null||n.resume()}}}jr(IM,"createFocusScopesStack");function sx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}jr(sx,"arrayRemove");function MM(t){return t.filter(e=>e.tagName!=="A")}jr(MM,"removeLinks");var sX=Object.defineProperty,cb=(t,e)=>sX(t,"name",{value:e,configurable:!0}),E0=0,Pi=null;function iX(t){return Vg(),t.children}cb(iX,"FocusGuards");function Vg(){m.useEffect(()=>{Pi||(Pi={start:ix(),end:ix()});const{start:t,end:e}=Pi;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),E0++,()=>{E0===1&&(Pi==null||Pi.start.remove(),Pi==null||Pi.end.remove(),Pi=null),E0=Math.max(0,E0-1)}},[])}cb(Vg,"useFocusGuards");function ix(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}cb(ix,"createFocusGuard");var $i=function(){return $i=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$i.apply(this,arguments)};function OM(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function oX(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var rm="right-scroll-bar-position",sm="width-before-scroll-bar",aX="with-scroll-bars-hidden",lX="--removed-body-scroll-bar-size";function Zy(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function cX(t,e){var n=m.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var uX=typeof window<"u"?m.useLayoutEffect:m.useEffect,TC=new WeakMap;function dX(t,e){var n=cX(null,function(r){return t.forEach(function(s){return Zy(s,r)})});return uX(function(){var r=TC.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||Zy(l,null)}),i.forEach(function(l){s.has(l)||Zy(l,o)})}TC.set(n,t)},[t]),n}function fX(t){return t}function hX(t,e){e===void 0&&(e=fX);var n=[],r=!1,s={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]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function pX(t){t===void 0&&(t={});var e=hX(null);return e.options=$i({async:!0,ssr:!1},t),e}var LM=function(t){var e=t.sideCar,n=OM(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,$i({},n))};LM.isSideCarExport=!0;function mX(t,e){return t.useMedium(e),LM}var NM=pX(),Wy=function(){},Hg=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:Wy,onWheelCapture:Wy,onTouchMoveCapture:Wy}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,g=t.sideCar,v=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,b=t.as,E=b===void 0?"div":b,C=t.gapMode,R=OM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,M=dX([n,e]),I=$i($i({},R),s);return m.createElement(m.Fragment,null,f&&m.createElement(A,{sideCar:NM,removeScrollBar:d,shards:p,noRelative:v,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?m.cloneElement(m.Children.only(l),$i($i({},I),{ref:M})):m.createElement(E,$i({},I,{className:u,ref:M}),l))});Hg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hg.classNames={fullWidth:sm,zeroRight:rm};var gX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vX(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=gX();return e&&t.setAttribute("nonce",e),t}function yX(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function _X(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var xX=function(){var t=0,e=null;return{add:function(n){t==0&&(e=vX())&&(yX(e,n),_X(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},wX=function(){var t=xX();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},DM=function(){var t=wX(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},bX={left:0,top:0,right:0,gap:0},qy=function(t){return parseInt(t||"",10)||0},SX=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[qy(n),qy(r),qy(s)]},kX=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return bX;var e=SX(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},EX=DM(),ku="data-scroll-locked",CX=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
72
+ .`.concat(aX,` {
73
+ overflow: hidden `).concat(r,`;
74
+ padding-right: `).concat(l,"px ").concat(r,`;
75
+ }
76
+ body[`).concat(ku,`] {
77
+ overflow: hidden `).concat(r,`;
78
+ overscroll-behavior: contain;
79
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
+ padding-left: `.concat(s,`px;
81
+ padding-top: `).concat(i,`px;
82
+ padding-right: `).concat(o,`px;
83
+ margin-left:0;
84
+ margin-top:0;
85
+ margin-right: `).concat(l,"px ").concat(r,`;
86
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
87
+ }
88
+
89
+ .`).concat(rm,` {
90
+ right: `).concat(l,"px ").concat(r,`;
91
+ }
92
+
93
+ .`).concat(sm,` {
94
+ margin-right: `).concat(l,"px ").concat(r,`;
95
+ }
96
+
97
+ .`).concat(rm," .").concat(rm,` {
98
+ right: 0 `).concat(r,`;
99
+ }
100
+
101
+ .`).concat(sm," .").concat(sm,` {
102
+ margin-right: 0 `).concat(r,`;
103
+ }
104
+
105
+ body[`).concat(ku,`] {
106
+ `).concat(lX,": ").concat(l,`px;
107
+ }
108
+ `)},IC=function(){var t=parseInt(document.body.getAttribute(ku)||"0",10);return isFinite(t)?t:0},PX=function(){m.useEffect(function(){return document.body.setAttribute(ku,(IC()+1).toString()),function(){var t=IC()-1;t<=0?document.body.removeAttribute(ku):document.body.setAttribute(ku,t.toString())}},[])},RX=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;PX();var i=m.useMemo(function(){return kX(s)},[s]);return m.createElement(EX,{styles:CX(i,!e,s,n?"":"!important")})},ox=!1;if(typeof window<"u")try{var C0=Object.defineProperty({},"passive",{get:function(){return ox=!0,!0}});window.addEventListener("test",C0,C0),window.removeEventListener("test",C0,C0)}catch{ox=!1}var nu=ox?{passive:!1}:!1,AX=function(t){return t.tagName==="TEXTAREA"},$M=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!AX(t)&&n[e]==="visible")},TX=function(t){return $M(t,"overflowY")},IX=function(t){return $M(t,"overflowX")},MC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=jM(t,r);if(s){var i=FM(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},MX=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},OX=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},jM=function(t,e){return t==="v"?TX(e):IX(e)},FM=function(t,e){return t==="v"?MX(e):OX(e)},LX=function(t,e){return t==="h"&&e==="rtl"?-1:1},NX=function(t,e,n,r,s){var i=LX(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,p=0,g=0;do{if(!l)break;var v=FM(t,l),w=v[0],_=v[1],x=v[2],b=_-x-i*w;(w||b)&&jM(t,l)&&(p+=b,g+=w);var E=l.parentNode;l=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(d=!0),d},P0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},OC=function(t){return[t.deltaX,t.deltaY]},LC=function(t){return t&&"current"in t?t.current:t},DX=function(t,e){return t[0]===e[0]&&t[1]===e[1]},$X=function(t){return`
109
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
110
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
+ `)},jX=0,ru=[];function FX(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(jX++)[0],i=m.useState(DM)[0],o=m.useRef(t);m.useEffect(function(){o.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=oX([t.lockRef.current],(t.shards||[]).map(LC),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=m.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var b=P0(_),E=n.current,C="deltaX"in _?_.deltaX:E[0]-b[0],R="deltaY"in _?_.deltaY:E[1]-b[1],A,M=_.target,I=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in _&&I==="h"&&M.type==="range")return!1;var T=window.getSelection(),L=T&&T.anchorNode,D=L?L===M||L.contains(M):!1;if(D)return!1;var B=MC(I,M);if(!B)return!0;if(B?A=I:(A=I==="v"?"h":"v",B=MC(I,M)),!B)return!1;if(!r.current&&"changedTouches"in _&&(C||R)&&(r.current=A),!A)return!0;var j=r.current||A;return NX(j,x,_,j==="h"?C:R)},[]),u=m.useCallback(function(_){var x=_;if(!(!ru.length||ru[ru.length-1]!==i)){var b="deltaY"in x?OC(x):P0(x),E=e.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&DX(A.delta,b)})[0];if(E&&E.should){x.cancelable&&x.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(LC).filter(Boolean).filter(function(A){return A.contains(x.target)}),R=C.length>0?l(x,C[0]):!o.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),d=m.useCallback(function(_,x,b,E){var C={name:_,delta:x,target:b,should:E,shadowParent:VX(b)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(R){return R!==C})},1)},[]),f=m.useCallback(function(_){n.current=P0(_),r.current=void 0},[]),p=m.useCallback(function(_){d(_.type,OC(_),_.target,l(_,t.lockRef.current))},[]),g=m.useCallback(function(_){d(_.type,P0(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return ru.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,nu),document.addEventListener("touchmove",u,nu),document.addEventListener("touchstart",f,nu),function(){ru=ru.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,nu),document.removeEventListener("touchmove",u,nu),document.removeEventListener("touchstart",f,nu)}},[]);var v=t.removeScrollBar,w=t.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:$X(s)}):null,v?m.createElement(RX,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function VX(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const HX=mX(NM,FX);var ub=m.forwardRef(function(t,e){return m.createElement(Hg,$i({},t,{ref:e,sideCar:HX}))});ub.classNames=Hg.classNames;var zX=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},su=new WeakMap,R0=new WeakMap,A0={},Gy=0,VM=function(t){return t&&(t.host||VM(t.parentNode))},BX=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=VM(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},UX=function(t,e,n,r){var s=BX(e,Array.isArray(t)?t:[t]);A0[n]||(A0[n]=new WeakMap);var i=A0[n],o=[],l=new Set,u=new Set(s),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};s.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))f(g);else try{var v=g.getAttribute(r),w=v!==null&&v!=="false",_=(su.get(g)||0)+1,x=(i.get(g)||0)+1;su.set(g,_),i.set(g,x),o.push(g),_===1&&w&&R0.set(g,!0),x===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return f(e),l.clear(),Gy++,function(){o.forEach(function(p){var g=su.get(p)-1,v=i.get(p)-1;su.set(p,g),i.set(p,v),g||(R0.has(p)||p.removeAttribute(r),R0.delete(p)),v||p.removeAttribute(n)}),Gy--,Gy||(su=new WeakMap,su=new WeakMap,R0=new WeakMap,A0={})}},HM=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=zX(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),UX(r,s,n,"aria-hidden")):function(){return null}},ZX=Object.defineProperty,_i=(t,e)=>ZX(t,"name",{value:e,configurable:!0}),db="Dialog",[zM,Iie]=Ki(db),[WX,zo]=zM(db),fb=_i(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=m.useRef(null),u=m.useRef(null),[d,f]=el({prop:r,defaultProp:s??!1,onChange:i,caller:db}),[p,g]=m.useState(0),[v,w]=m.useState(0);return S.jsx(WX,{scope:e,triggerRef:l,contentRef:u,contentId:La(),titleId:La(),descriptionId:La(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:g,setDescriptionCount:w,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(_=>!_),[f]),modal:o,children:n})},"Dialog"),BM="DialogPortal",[qX,UM]=zM(BM,{forceMount:void 0}),hb=_i(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=zo(BM,e);return S.jsx(qX,{scope:e,forceMount:n,children:m.Children.map(r,o=>S.jsx(Ja,{present:n||i.open,children:S.jsx(rb,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),ax="DialogOverlay",pb=m.forwardRef(_i(function(e,n){const r=UM(ax,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=zo(ax,e.__scopeDialog);return o.modal?S.jsx(Ja,{present:s||o.open,children:S.jsx(KX,{...i,ref:n})}):null},"DialogOverlay")),GX=Ua("DialogOverlay.RemoveScroll"),KX=m.forwardRef(_i(function(e,n){const{__scopeDialog:r,...s}=e,i=zo(ax,r),o=HI(),l=un(n,o);return S.jsx(ub,{as:GX,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(Nn.div,{"data-state":yb(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),vh="DialogContent",mb=m.forwardRef(_i(function(e,n){const r=UM(vh,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=zo(vh,e.__scopeDialog);return S.jsx(Ja,{present:s||o.open,children:o.modal?S.jsx(YX,{...i,ref:n}):S.jsx(XX,{...i,ref:n})})},"DialogContent")),YX=m.forwardRef(_i(function(e,n){const r=zo(vh,e.__scopeDialog),s=m.useRef(null),i=un(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return HM(o)},[]),S.jsx(ZM,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ln(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ln(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:ln(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),XX=m.forwardRef(_i(function(e,n){const r=zo(vh,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(ZM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),ZM=m.forwardRef(_i(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=zo(vh,r);return Vg(),S.jsx(S.Fragment,{children:S.jsx(CM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Gw,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":yb(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),QX="DialogTitle",gb=m.forwardRef(_i(function(e,n){const{__scopeDialog:r,...s}=e,i=zo(QX,r),{setTitleCount:o}=i;return Xr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(Nn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),JX="DialogDescription",vb=m.forwardRef(_i(function(e,n){const{__scopeDialog:r,...s}=e,i=zo(JX,r),{setDescriptionCount:o}=i;return Xr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(Nn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function yb(t){return t?"open":"closed"}_i(yb,"getState");var eQ=Object.defineProperty,tl=(t,e)=>eQ(t,"name",{value:e,configurable:!0}),_b="Popover",[WM,Mie]=Ki(_b,[jg]),xb=jg(),[tQ,md]=WM(_b),nQ=tl(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=xb(e),u=m.useRef(null),[d,f]=m.useState(!1),[p,g]=el({prop:r,defaultProp:s??!1,onChange:i,caller:_b});return S.jsx(oM,{...l,children:S.jsx(tQ,{scope:e,contentId:La(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(v=>!v),[g]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),rQ="PopoverTrigger",sQ=m.forwardRef(tl(function(e,n){const{__scopePopover:r,...s}=e,i=md(rQ,r),o=xb(r),l=un(n,i.triggerRef),u=S.jsx(Nn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":wb(i.open),...s,ref:l,onClick:ln(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(aM,{asChild:!0,...o,children:u})},"PopoverTrigger")),qM="PopoverPortal",[iQ,oQ]=WM(qM,{forceMount:void 0}),aQ=tl(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=md(qM,e);return S.jsx(iQ,{scope:e,forceMount:n,children:S.jsx(Ja,{present:n||i.open,children:S.jsx(rb,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),yh="PopoverContent",lQ=m.forwardRef(tl(function(e,n){const r=oQ(yh,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=md(yh,e.__scopePopover);return S.jsx(Ja,{present:s||o.open,children:o.modal?S.jsx(uQ,{...i,ref:n}):S.jsx(dQ,{...i,ref:n})})},"PopoverContent")),cQ=Ua("PopoverContent.RemoveScroll"),uQ=m.forwardRef(tl(function(e,n){const r=md(yh,e.__scopePopover),s=m.useRef(null),i=un(n,s),o=m.useRef(!1);return m.useEffect(()=>{const l=s.current;if(l)return HM(l)},[]),S.jsx(ub,{as:cQ,allowPinchZoom:!0,children:S.jsx(GM,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ln(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:ln(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:ln(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),dQ=m.forwardRef(tl(function(e,n){const r=md(yh,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(GM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),GM=m.forwardRef(tl(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,...g}=e,v=md(yh,r),w=xb(r);return Vg(),S.jsx(CM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Gw,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(lM,{"data-state":wb(v.open),role:"dialog",id:v.contentId,...w,...g,ref:n,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function wb(t){return t?"open":"closed"}tl(wb,"getState");var bb=nQ,Sb=sQ,kb=aQ,Eb=lQ;const _h={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},fQ="data-hover-dead-zone";function KM(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=m.useRef(new Map),[i,o]=m.useState(null),[l,u]=m.useState([]),d=m.useRef([]),f=m.useRef(0),p=m.useRef(null),g=m.useRef(null),v=m.useCallback(()=>{const C=[];return s.current.forEach((R,A)=>{C[A]={top:R.offsetTop,height:R.offsetHeight,left:R.offsetLeft,width:R.offsetWidth}}),C},[]),w=m.useCallback(()=>{if(!t.current)return;const R=v();d.current=R,u(R)},[t,v]),_=m.useCallback((C,R)=>{R?s.current.set(C,R):s.current.delete(C),g.current!==null&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(()=>{g.current=null,w()})},[w]),x=m.useCallback(C=>{const R=C.clientX,A=C.clientY,M=C.target instanceof Element&&C.target.closest(`[${fQ}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const I=t.current;if(!I)return;if(M){o(null);return}const T=v(),L=d.current;(T.length!==L.length||T.some((ie,ne)=>{const oe=L[ne];return!oe||!ie||ie.top!==oe.top||ie.height!==oe.height||ie.left!==oe.left||ie.width!==oe.width}))&&(d.current=T,u(T));const B=I.getBoundingClientRect(),j=n==="x"?R:A;let K=null,U=1/0,H=null;const Z=d.current,Q=n==="x"?I.scrollLeft:I.scrollTop,z=n==="x"?I.clientLeft:I.clientTop,ee=n==="x"?B.left:B.top,W=n==="x"?I.offsetWidth:I.offsetHeight,N=n==="x"?B.width:B.height,X=W>0?N/W:1;for(let ie=0;ie<Z.length;ie++){const ne=Z[ie];if(!ne)continue;const oe=n==="x"?ne.left:ne.top,fe=ee+(z+oe-Q)*X,xe=(n==="x"?ne.width:ne.height)*X,de=fe+xe;j>=fe&&j<=de&&(H=ie);let ae=0;j<fe?ae=fe-j:j>de&&(ae=j-de),ae<U&&(U=ae,K=ie)}o(H??(U<=r?K:null))})},[n,t,r,v]),b=m.useCallback(()=>{f.current+=1,w()},[w]),E=m.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return m.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),g.current!==null&&cancelAnimationFrame(g.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:b,onMouseLeave:E},registerItem:_,measureItems:w}}function hQ(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let im=0;const pQ=()=>{im+=1;let t=!1;return()=>{t||(t=!0,im=Math.max(0,im-1))}},mQ=()=>im>0,gQ='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',YM=({itemSelector:t=gQ,loop:e=!1,onDismiss:n}={})=>{const r=m.useRef(null),s=m.useRef(null),i=m.useRef(n),o=m.useRef(!1);i.current=n;const l=m.useCallback(f=>{var p;if(r.current=f,f){o.current=!1;const g=pQ(),v=f.ownerDocument.defaultView;let w;const _=()=>{v==null||v.clearTimeout(w),w=v==null?void 0:v.setTimeout(()=>{const x=f.ownerDocument.activeElement;(x==null?void 0:x.tagName)==="IFRAME"&&!f.contains(x)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(w),g()}}else(p=s.current)==null||p.call(s),s.current=null},[]),u=f=>{o.current&&f.preventDefault()},d=m.useCallback(f=>{var E;const{key:p}=f;if(p!=="ArrowDown"&&p!=="ArrowUp"&&p!=="Home"&&p!=="End")return;const g=r.current;if(!g)return;const v=Array.from(g.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const w=v.indexOf(document.activeElement),_=v.length-1,x=C=>{if(w===-1)return C===1?0:_;const R=w+C;return e?(R+v.length)%v.length:Math.min(Math.max(R,0),_)};let b;p==="Home"?b=0:p==="End"?b=_:p==="ArrowDown"?b=x(1):b=x(-1),(E=v[b])==null||E.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var om={exports:{}},vQ=om.exports,NC;function yQ(){return NC||(NC=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(vQ,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,x){var b=_[x];if(typeof b.bind=="function")return b.bind(_);try{return Function.prototype.bind.call(b,_)}catch{return function(){return Function.prototype.apply.apply(b,[_,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),x=0;x<s.length;x++){var b=s[x];this[b]=x<_?e:this.methodFactory(b,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function g(_,x,b){return d(_)||p.apply(this,arguments)}function v(_,x){var b=this,E,C,R,A="loglevel";typeof _=="string"?A+=":"+_:typeof _=="symbol"&&(A=void 0);function M(B){var j=(s[B]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=j;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+j+";"}catch{}}}function I(){var B;if(!(typeof window===n||!A)){try{B=window.localStorage[A]}catch{}if(typeof B===n)try{var j=window.document.cookie,K=encodeURIComponent(A),U=j.indexOf(K+"=");U!==-1&&(B=/^([^;]+)/.exec(j.slice(U+K.length+1))[1])}catch{}return b.levels[B]===void 0&&(B=void 0),B}}function T(){if(!(typeof window===n||!A)){try{window.localStorage.removeItem(A)}catch{}try{window.document.cookie=encodeURIComponent(A)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(B){var j=B;if(typeof j=="string"&&b.levels[j.toUpperCase()]!==void 0&&(j=b.levels[j.toUpperCase()]),typeof j=="number"&&j>=0&&j<=b.levels.SILENT)return j;throw new TypeError("log.setLevel() called with invalid level: "+B)}b.name=_,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=x||g,b.getLevel=function(){return R??C??E},b.setLevel=function(B,j){return R=L(B),j!==!1&&M(R),f.call(b)},b.setDefaultLevel=function(B){C=L(B),I()||b.setLevel(B,!1)},b.resetLevel=function(){R=null,T(),f.call(b)},b.enableAll=function(B){b.setLevel(b.levels.TRACE,B)},b.disableAll=function(B){b.setLevel(b.levels.SILENT,B)},b.rebuild=function(){if(o!==b&&(E=L(o.getLevel())),f.call(b),o===b)for(var B in i)i[B].rebuild()},E=L(o?o.getLevel():"WARN");var D=I();D!=null&&(R=L(D)),f.call(b)}o=new v,o.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[x];return b||(b=i[x]=new v(x,o.methodFactory)),b};var w=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=w),o},o.getLoggers=function(){return i},o.default=o,o})})(om)),om.exports}var _Q=yQ();const di=_g(_Q),xQ="INFO",wQ=xQ.toUpperCase();di.setLevel(di.levels[wQ]||di.levels.INFO);const Ps=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>di.trace(`${e}${n}`,...r),debug:(n,...r)=>di.debug(`${e}${n}`,...r),info:(n,...r)=>di.info(`${e}${n}`,...r),warn:(n,...r)=>di.warn(`${e}${n}`,...r),error:(n,...r)=>{di.error(`${e}${n}`,...r);try{const i=r.map(l=>l instanceof Error?l.message:String(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Ee.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>di.info(`${e}API: ${n}`,...r),hook:(n,...r)=>di.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>di.debug(`${e}Mount: ${n}`,...r)}},DC=Ps("useVariantsUiState"),bQ={groups:[],rows:{}},T0={pinned:[],order:bQ},Sf="pinned",SQ="top",Ky=t=>`rows:${t}`,$C=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},kQ=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),EQ=(t,e)=>n=>{if(t===Sf){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===SQ?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},CQ=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState(T0),s=m.useRef(n);s.current=n;const i=m.useRef(!1),o=m.useRef([]),l=m.useCallback(v=>{t&&fetch(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:v})}).catch(w=>{DC.warn("persist failed — arrangement kept for this session only",w)})},[t,e]);m.useEffect(()=>{if(r(T0),s.current=T0,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const w=await fetch(`/api/variants/ui-state${e}`);if(!w.ok||v)return;const _=await w.json();if(v)return;let x=_.uiState??T0;const b=o.current;o.current=[];for(const E of b)x=E(x);i.current=!0,s.current=x,r(x),b.length>0&&l(x)}catch(w){DC.warn("load failed — arrangement is session-local until reload",w)}})(),()=>{v=!0}},[t,e,l]);const u=m.useCallback(v=>{const w=v(s.current);s.current=w,r(w),i.current?l(w):o.current.push(v)},[l]),d=m.useCallback(v=>{const w=!s.current.pinned.includes(v);u(w?$C(v):kQ(v))},[u]),f=m.useCallback(v=>{s.current.pinned.includes(v)||u($C(v))},[u]),p=m.useCallback((v,w)=>{u(EQ(v,w))},[u]),g=m.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:g,listOrder:n.order,togglePin:d,pinItem:f,reorder:p}},PQ=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=m.useState(null),u=m.useCallback(p=>{const g=e.current;return g?Array.from(g.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[e]),d=m.useCallback(p=>{if(!n){o&&l(null);return}const g=e.current;if(!g)return;if(r){const b=g.querySelector(r);if(b){const E=b.getBoundingClientRect();if(p.clientY>=E.top&&p.clientY<=E.bottom){o&&l(null);return}}}if(s){const b=g.querySelector(s),E=b==null?void 0:b.getBoundingClientRect();if(!E||p.clientY<E.top||p.clientY>E.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const w=g.getBoundingClientRect().top;let _=v.length;for(let b=0;b<v.length;b++){const E=v[b].getBoundingClientRect();if(p.clientY<E.top+E.height/2){_=b;break}}let x;_===0?x=v[0].getBoundingClientRect().top-w-1:_===v.length?x=v[v.length-1].getBoundingClientRect().bottom-w:x=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-w,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:x})},[e,n,o,u,r,s]),f=m.useCallback(()=>{if(!n||!o)return;l(null);const p=u(o.container).map(w=>w.dataset.reorderKey).filter(w=>!!w),g=p.indexOf(n.key);if(g===-1)return;p.splice(g,1);const v=o.index>g?o.index-1:o.index;p.splice(v,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},XM=(t,e)=>`style:${t}:${e}`,QM=t=>`text:${t}`,JM=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},eO=t=>JM(t)[0],I0=(t,e)=>JM(t).includes(e),RQ=t=>{const e=eO(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${XM(e,t.property)}${n}`:`${QM(e)}${n}`},fr=[];for(let t=0;t<256;++t)fr.push((t+256).toString(16).slice(1));function AQ(t,e=0){return(fr[t[e+0]]+fr[t[e+1]]+fr[t[e+2]]+fr[t[e+3]]+"-"+fr[t[e+4]]+fr[t[e+5]]+"-"+fr[t[e+6]]+fr[t[e+7]]+"-"+fr[t[e+8]]+fr[t[e+9]]+"-"+fr[t[e+10]]+fr[t[e+11]]+fr[t[e+12]]+fr[t[e+13]]+fr[t[e+14]]+fr[t[e+15]]).toLowerCase()}const TQ=new Uint8Array(16);function IQ(){return crypto.getRandomValues(TQ)}function jC(t,e,n){return crypto.randomUUID?crypto.randomUUID():MQ(t)}function MQ(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??IQ();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,AQ(r)}const OQ=300;class LQ{constructor(){la(this,"history",{current:new Map,past:[],future:[]});la(this,"pendingChanges",new Map);la(this,"currentBatchId",null);la(this,"debounceTimer",null);la(this,"onChangeCallbacks",[]);la(this,"stateBeforePending",null);la(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=jC(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=eO(e.elementId),r=e.type==="style"?XM(n,e.property):QM(n),s=Array.from(this.history.current.entries()).find(([o])=>o===r||o.startsWith(`${r}:`));if(s){const o=s[1];e.type==="style"&&o.type==="style"?e.oldValue=o.oldValue:e.type==="text"&&o.type==="text"&&(e.oldText=o.oldText)}const i=RQ(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},OQ),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){this.pendingChanges.size>0&&this.commitPending();const e=this.history.past.pop();if(!e)return null;const n=new Map(this.history.current);this.history.future.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of n)this.history.current.has(s)||r.push(i);return r}redo(){const e=this.history.future.pop();if(!e)return null;const n=new Map(this.history.current);this.history.past.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of this.history.current)n.has(s)||r.push(i);return r}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&I0(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&I0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>I0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>I0(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=jC(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const og={kind:"base"};function xh(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function NQ(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const DQ={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},tO=Object.fromEntries(Object.entries(DQ).map(([t,e])=>[t,{isEnabled:e.default}]));ut("view");const nO=ut(!0),rO=ut(null),$Q=ut("chat"),sO=ut(0),jQ=ut({name:null,email:null}),FC=ut(og);ut(null);const wh=new Map,FQ=t=>{const e=xh(t);let n=wh.get(e);return n||(n=new LQ,wh.set(e,n)),n};ut(t=>FQ(t(FC)),(t,e,n)=>{wh.set(xh(t(FC)),n)});const VQ=t=>{for(const e of[...wh.keys()])e==="base"||t.has(e)||wh.delete(e)},bh=ut(new Map),VC=ut(null);ut(null);const lx=ut(0),ag=ut(null),cx=ut(!1),ux=ut(null),iO=ut(!1),oO=ut(!1),dx=ut(null),am=ut(null),ed=ut(null),Cb=ut(null),$o=ut(null),aO=ut(!1),Gh=ut({active:!1}),lO=ut([]),HC=ut(null),HQ=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&NQ(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},zQ=ut(null,(t,e,n)=>{const r=u=>{const d=u??og;return d.kind==="variant"&&!n.has(xh(d))},s=t(bh);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e(bh,u)}const o=t(VC);o&&r(o.target)&&(e(VC,null),e(qQ,!1));const l=t(HC);l&&(i!=null&&i.has(l.commentId))&&e(HC,null),VQ(n)}),fx=ut(tO),BQ=ut(!1),zg=ut(null),Bg=ut(!0),UQ=ut(!1),cO=ut(!1),uO=ut(null),ZQ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Ug=ut(ZQ()),WQ=ut(null),qQ=ut(!1);ut(0);ut(0);function GQ(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const KQ=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Pb=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:KQ.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),dO=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=m.useState(!1),p=i?o??t:t,g=u.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${g?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),g?S.jsxs(bb,{open:d,onOpenChange:f,children:[S.jsx(Sb,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(QW,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(kb,{children:S.jsx(Eb,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(v=>{const w=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[w?S.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},fc=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(ab,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Zg="/__rivet/preview",zC=`${Zg}/variant/`,BC=`${Zg}/history/`,fO=t=>t?t.startsWith("/")?t:`/${t}`:"/",YQ=t=>`${Zg}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${fO(t.routePath)}`,XQ=t=>`${Zg}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${fO(t.routePath)}`,QQ=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(zC)||e.pathname.startsWith(BC)}catch{return t.startsWith(zC)||t.startsWith(BC)}},UC=t=>{var s,i,o,l;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?YQ({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((o=r.executionPlan)==null?void 0:o.mode)!=="vite_app"&&((l=n.preview)==null?void 0:l.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},ZC="/rivet/",hO=t=>{if(!t.startsWith(ZC))return null;const e=t.slice(ZC.length);return!e||e==="/"?null:`/${e}`},td=(t,e=fetch)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},JQ=(t,e=fetch)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),td(r,e))}},lg=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},WC=6,pO="original",Rb="Original",mO="The original state of your app before any variants were generated.",qC=200,gO="h-6 w-6 rounded",hx=[.33,1,.68,1],px=.22,On=Ps("AgentVariantsPanel"),Yy=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},iu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},eJ=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Xy(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const tJ=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},vO=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},nJ="original",mx="pinned-section";function yO(t){return`rivet:collapsedRuns:${t}`}function M0(t){try{const e=window.localStorage.getItem(yO(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Qy(t,e){try{window.localStorage.setItem(yO(t),JSON.stringify([...e]))}catch{}}const GC=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=tJ(s,e);let o="";s.kind==="original"?o=nJ:i&&(o=vO(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function Ri(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const rJ=t=>{var n,r;const e=((r=(n=t.actions)==null?void 0:n.commit)==null?void 0:r.enabled)??t.status==="succeeded";return t.status==="succeeded"&&e},Uf=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},_O=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},sJ=t=>t.status==="succeeded"&&!Uf(t)&&(!t.previewUnavailable||_O(t)),Jy=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},KC=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},iJ=t=>{var e;return rJ(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},YC=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),oJ=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),aJ=()=>{var Zo,Wo,Qs,op;const t=Eg(),e=lt(Gh),n=lt(aO),r=m.useRef(!1),s=lt(lO),i=lt(zg),o=lt(Bg),l=lt(fx),u=((Zo=l.deployPrototype)==null?void 0:Zo.isEnabled)??!1,d=((Wo=l.canvasShare)==null?void 0:Wo.isEnabled)??!1,f=((Qs=l.variantSend)==null?void 0:Qs.isEnabled)??!1,p=((op=l.designContextViewer)==null?void 0:op.isEnabled)??!1,g=lt(cO),v=lt(uO),w=vt(lx),_=vt(ag),x=vt(cx),b=vt(ux),E=vt(iO),C=vt(oO),R=vt(ed),A=lt(ed),M=vt(Cb),I=vt(rO);m.useEffect(()=>(I("Directions"),()=>I(null)),[I]);const T=lt($o),L=vt($o),D=m.useCallback(($=!1)=>{if(JQ(T),L(null),$&&T){const le=lg("ended",T);Ee.capture(le.event,le.properties)}},[L,T]),B=lt(dx),j=vt(dx),K=lt(am),U=vt(am),H=K?`${K.sessionId}:${K.variantId}`:null,[Z,Q]=m.useState(""),[z,ee]=m.useReducer($=>$+1,0),W=m.useMemo(()=>i!==null?M0(i):new Set,[i,z]),N=m.useCallback($=>{if(i===null)return;const le=new Set(M0(i));le.delete($)||le.add($),Qy(i,le),ee()},[i]),[X,ie]=m.useState(null),[ne,oe]=m.useState(null),[fe,xe]=m.useState(!1),[de,ae]=m.useState({}),[Oe,Ce]=m.useState(null),[Ge,dt]=m.useState({}),[Lt,Kt]=m.useState(null),[_t,ht]=m.useState([]),En=m.useRef([]);En.current=_t;const[kt,Yt]=m.useState(!1),[Le]=m.useState(()=>LG(window.location.search)),rt=m.useRef(!1),Be=m.useRef(!1);Be.current=Le!==null||K!==null||B!==null||kt;const Me=m.useMemo(()=>e.active?e.variants:[],[e]),pt=m.useMemo(()=>Me.filter(iJ),[Me]),An=m.useMemo(()=>YC(pt,de),[pt,de]),$t=(Oe==null?void 0:Oe.key)===An?Oe.shareUrl:null,Pe=e.active?e.sessionId:null,Jn=m.useMemo(()=>{const $=new Set;for(const le of Me)le.adoptedSource&&$.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return $},[Me]),Xt=m.useMemo(()=>[..._t.filter(le=>le.sessionId!==Pe&&!Jn.has(`${le.sessionId}:${le.variantId}`))].sort((le,ke)=>{const he=new Date(le.createdAt).getTime(),pe=new Date(ke.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(he)?0:he)}),[Jn,_t,Pe]),Tn=m.useMemo(()=>K?Me.find($=>{var le,ke;return((le=$.adoptedSource)==null?void 0:le.sessionId)===K.sessionId&&((ke=$.adoptedSource)==null?void 0:ke.variantId)===K.variantId})??null:null,[K,Me]),rl=m.useMemo(()=>K?Xt.find($=>$.sessionId===K.sessionId&&$.variantId===K.variantId)??null:null,[K,Xt]),gn=e.active?e.projectContext:null,vn=(gn==null?void 0:gn.kind)==="fresh"?gn.workspacePath:i,gd=!e.active&&Xt.length>0&&Xt.every($=>$.projectKind==="fresh"),Rs=e.active?eJ(gn):!!i&&!gd,yr=m.useMemo(()=>vn?`?projectPath=${encodeURIComponent(vn)}`:"",[vn]),{pinnedKeys:er,pinnedKeySet:Xi,listOrder:Ks,togglePin:Dn,pinItem:As,reorder:sl}=CQ(vn),Qi=m.useRef(null),ss=m.useRef(null),Ke=typeof window>"u"?"/":hO(window.location.pathname)??"/",Tt=m.useRef(null),jt=m.useRef(!1),Zn=m.useCallback(($,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),Yy(),Tt.current={kind:"live",variantId:$,startX:le.clientX,startY:le.clientY,committed:!1})},[]),is=m.useCallback(($,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),Yy(),Tt.current={kind:"past",entry:$,startX:le.clientX,startY:le.clientY,committed:!1})},[]);m.useEffect(()=>{const $=he=>{const pe=Tt.current;if(!pe)return;const be=he.clientX-pe.startX,Ye=he.clientY-pe.startY;if(!pe.committed){if(be*be+Ye*Ye<WC*WC)return;if(Yy(),pe.kind==="live"){const Re=Me.find(yn=>yn.workItemId===pe.variantId);if(!Re||Re.status!=="succeeded"){Tt.current=null;return}const tn=UC({sessionId:Pe,variant:Re,projectContext:gn,routePath:Ke});R({sessionId:Pe??"",variantId:Re.workItemId,label:Re.label||"Direction",url:tn,source:"live",runLabel:Re.runLabel,description:Re.description})}else{const{entry:Re}=pe,tn=iu(Re),yn=tn?XQ({sessionId:Re.sessionId,variantId:Re.variantId,routePath:Ke}):`/api/variants/history/${encodeURIComponent(Re.sessionId)}/${encodeURIComponent(Re.variantId)}/preview${yr}`;if(R({sessionId:Re.sessionId,variantId:Re.variantId,label:Re.label||"Direction",url:yn,source:tn?"history-dev-server":"history-static",runLabel:Re.runLabel,description:Re.brief}),tn){const Pr=KC(`/api/variants/history/${encodeURIComponent(Re.sessionId)}/${encodeURIComponent(Re.variantId)}/run${yr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Pr,{method:"POST"})).ok)return;const cs=KC(yn,"replay",String(Date.now()));R(at=>!at||at.sessionId!==Re.sessionId||at.variantId!==Re.variantId||at.source!=="history-dev-server"?at:{...at,url:cs}),L(at=>{if(!at)return at;const Ft=Js=>!Js||Js.sessionId!==Re.sessionId||Js.variantId!==Re.variantId?Js:{...Js,url:cs};return{...at,left:Ft(at.left),right:Ft(at.right)}})}catch(ls){On.warn("history replay drag boot failed",ls)}})()}}pe.committed=!0}M({x:he.clientX,y:he.clientY})},le=()=>{const he=Tt.current;he!=null&&he.committed&&(jt.current=!0,window.setTimeout(()=>{jt.current=!1},0)),Tt.current=null,M(null)},ke=he=>{if(he.key!=="Escape")return;const pe=Tt.current;pe!=null&&pe.committed&&(pe.kind==="past"&&iu(pe.entry)&&td({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),Tt.current=null,R(null),M(null))};return window.addEventListener("pointermove",$),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",ke),()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",ke)}},[Me,Pe,gn,Ke,yr,R,M,L]);const zt=m.useCallback(()=>{var $;($=Tt.current)!=null&&$.committed&&(jt.current=!0,window.setTimeout(()=>{jt.current=!1},0)),Tt.current=null,M(null),A&&(A.source==="history-dev-server"&&td({sessionId:A.sessionId,variantId:A.variantId,source:"history-dev-server"}),R(null))},[A,R,M]),$n=m.useCallback(($,le)=>{const ke=!Xi.has($);Ee.capture(ke?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:le}),Dn($)},[Xi,Dn]),Fr=m.useCallback(()=>{A&&(Ee.capture("variants_panel.direction_pinned",{method:"drag"}),As(`row:past:${A.sessionId}:${A.variantId}`),zt())},[A,zt,As]),Ys=m.useCallback($=>{Ee.capture("variants_panel.direction_unpinned",{method:"drag"}),Dn($),zt()},[Dn,zt]),cr=m.useCallback(($,le)=>{sl($,le),zt()},[sl,zt]),In=m.useMemo(()=>{var le;if(kt||H)return null;const $=B?Me.find(ke=>ke.workItemId===B):null;return B&&!$?null:$?Uf($)?$.workItemId:null:e.active?((le=Me.find(ke=>{var he,pe;return Uf(ke)&&(((he=ke.preview)==null?void 0:he.kind)==="static_artifact"||((pe=ke.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[B,H,kt,e,Me]),il=kt||Rs&&B===null&&H===null&&In===null,gc=m.useCallback(async $=>{var ke,he,pe,be;if(!Pe)return;const le=($==null?void 0:$.workItemId)??null;ie({kind:"switch",variantId:le??void 0});try{if(((ke=$==null?void 0:$.preview)==null?void 0:ke.kind)==="static_artifact"){if(x(!1),b(null),((he=$.refinement)==null?void 0:he.status)==="succeeded"){const Re=$.preview.url.includes("?")?"&":"?";_(`${$.preview.url}${Re}refinement=${encodeURIComponent($.refinement.workItemId)}`)}else _($.preview.url);w(Re=>Re+1);return}if(le&&Pe&&e.active&&e.projectContext.kind==="fresh"&&((pe=e.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((be=$==null?void 0:$.preview)==null?void 0:be.kind)!=="dev_server"){x(!1),b(null),_(`/api/variants/${Pe}/static/${le}`),w(Re=>Re+1);return}const Ye=$&&le?UC({sessionId:Pe,variant:$,projectContext:e.active?e.projectContext:null,routePath:Ke}):null;if(Ye){x(!1),b(null),_(Ye),w(Re=>Re+1);return}Ee.capture("variants_panel.preview_display_failed",{sessionId:Pe,variantId:le,previewKind:$?Jy($):"none",hasPreview:!!($!=null&&$.preview),hasPort:typeof($==null?void 0:$.port)=="number",errorMessage:"No addressable dev-server preview URL"}),x(!1),b(null)}catch(Ye){On.warn("preview display failed",Ye),Ee.capture("variants_panel.preview_display_failed",{sessionId:Pe,variantId:le,previewKind:$?Jy($):"none",hasPreview:!!($!=null&&$.preview),hasPort:typeof($==null?void 0:$.port)=="number",errorMessage:Ye instanceof Error?Ye.message:String(Ye)}),x(!1),b(null)}finally{ie(null)}},[Pe,e,Ke,w,_,x,b]),vc=m.useRef(!1),yc=m.useRef(null),Ts=m.useRef(0),Ji=m.useCallback(()=>{if(Ts.current++,E(!1),C(!1),!vc.current)return;const $=yc.current;vc.current=!1,yc.current=null;const le=$?new URLSearchParams({sessionId:$.sessionId,variantId:$.variantId}):null,ke=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(ke,{method:"POST"}).catch(he=>On.warn("history replay stop failed",he))},[E,C]),vd=m.useCallback(async $=>{if(Pe){ie({kind:"switch",variantId:$.workItemId});try{const le=await fetch(`/api/variants/${Pe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:$.workItemId})});if(!le.ok){const ke=await Ri(le);throw new Error(ke.message??`Preview restoration failed (${le.status})`)}}catch(le){On.warn("preview restoration failed",le),Ee.capture("variants_panel.preview_display_failed",{sessionId:Pe,variantId:$.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{ie(null)}}},[Pe]),_c=m.useCallback($=>{var be,Ye,Re,tn,yn;if(jt.current){jt.current=!1;return}const le=Uf($),ke=$.status==="pending"||$.status==="running"||sJ($);Ji();const he=Jy($),pe=Me.find(Pr=>Pr.workItemId===B);Ee.capture("variants_panel.preview_requested",{sessionId:Pe,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:$.workItemId,variantStatus:$.status,isPreviewReady:le,isArmed:ke,previewKind:he,hasPreview:!!$.preview,hasPort:typeof $.port=="number",viewEnabled:((Ye=(be=$.actions)==null?void 0:be.view)==null?void 0:Ye.enabled)??null,previewUnavailableReason:((Re=$.previewUnavailable)==null?void 0:Re.reason)??null}),j($.workItemId),U(null),le?(ss.current=$.workItemId,Yt(!1),D(!0),gc($)):(ss.current=null,Yt(!1),_(null),x(!1),ke&&Ee.capture("variants_panel.preview_armed",{sessionId:Pe,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:$.workItemId,variantStatus:$.status,previewKind:he,hasPreview:!!$.preview,hasPort:typeof $.port=="number",viewEnabled:((yn=(tn=$.actions)==null?void 0:tn.view)==null?void 0:yn.enabled)??null}),_O($)&&vd($)),Ee.capture("variants_panel.preview_switched",{sessionId:Pe,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:$.workItemId,armed:ke})},[B,Pe,D,j,U,Ji,vd,gc,Me,_,x]),yd=e.active?`${e.sessionId}:${e.stage}`:"inactive",xc=m.useRef(!1);m.useEffect(()=>{if(o)return;let $=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${yr}`,{credentials:"same-origin"});if(!le.ok)return;const ke=await le.json();if($)return;const he=(ke.variants??[]).filter(pe=>{var be,Ye;return((be=pe.preview)==null?void 0:be.kind)==="static"||((Ye=pe.serve)==null?void 0:Ye.kind)==="static"||iu(pe)});if(!xc.current&&!Be.current&&yd==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((be,Ye)=>new Date(Ye.createdAt).getTime()-new Date(be.createdAt).getTime()).find(be=>!iu(be));pe&&(xc.current=!0,U({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static",references:pe.references,projectPath:vn??void 0}),Yt(!1),_(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${yr}`))}if(U(pe=>{if(!pe)return pe;const be=he.find(Ye=>Ye.sessionId===pe.sessionId&&Ye.variantId===pe.variantId);return!be||JSON.stringify(pe.references)===JSON.stringify(be.references)?pe:{...pe,references:be.references}}),oJ(En.current,he))return;En.current=he,ht(he)}catch(le){On.warn("Failed to load past variants",le)}})(),()=>{$=!0}},[o,vn,yd,yr,_,U]);const wc=m.useCallback(()=>{vc.current=!1,yc.current=null,E(!1),C(!1),U(null),j(null),Yt(!0),x(!1),b(null),_(null),w($=>$+1)},[j,E,C,w,_,b,U,x]),Bo=m.useCallback($=>{if(jt.current){jt.current=!1;return}if(D(!0),U({sessionId:$.sessionId,variantId:$.variantId,previewKind:iu($)?"dev_server":"static",references:$.references,projectPath:vn??void 0}),j(null),Yt(!1),iu($)){const le=++Ts.current;vc.current=!0,yc.current={sessionId:$.sessionId,variantId:$.variantId},E(!0),C(!0),(async()=>{ie({kind:"switch"}),Ee.capture("variants_panel.history_replay_started",{sessionId:$.sessionId,variantId:$.variantId});const ke=he=>Ee.capture("variants_panel.history_replay_failed",{sessionId:$.sessionId,variantId:$.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/run${yr}`,{method:"POST"});if(le!==Ts.current)return;if(!he.ok){const{errorCode:pe}=await Ri(he);On.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),ke({httpStatus:he.status,errorCode:pe}),wc();return}C(!1),x(!0),b(null),_(null),w(pe=>pe+1),Ee.capture("variants_panel.history_replay_ready",{sessionId:$.sessionId,variantId:$.variantId})}catch(he){if(le!==Ts.current)return;On.warn("history replay failed",he),ke({errorMessage:he instanceof Error?he.message:String(he)}),wc()}finally{ie(null)}})();return}Ji(),x(!1),b(null),_(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/preview${yr}`)},[vn,wc,ie,E,C,w,U,j,_,b,D,x,Ji,yr]);m.useEffect(()=>{if(!Le||rt.current)return;const $=_t.find(le=>le.sessionId===Le.sessionId&&le.variantId===Le.variantId);$&&(rt.current=!0,Bo($))},[Le,_t,Bo]);const _d=m.useCallback(async()=>{Ji();const $=()=>{D(!0),j(null),U(null),Yt(!0),ss.current=null,x(!1),b(null),_(null),w(le=>le+1)};if(!Pe){$();return}ie({kind:"switch"});try{const le=await fetch(`/api/variants/${Pe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){On.warn(`switch to original failed: HTTP ${le.status}`);return}$(),x(!0),Ee.capture("variants_panel.preview_switched",{sessionId:Pe,fromVariantId:B,toVariantId:null,target:"original",armed:!1})}catch(le){On.warn("preview-port original switch failed",le)}finally{ie(null)}},[B,Pe,j,U,w,_,b,D,x,Ji]),Jg=m.useCallback(async $=>{var ke,he;const le=((he=(ke=$.actions)==null?void 0:ke.commit)==null?void 0:he.enabled)??$.status==="succeeded";if(!(!Pe||!le)){Ee.capture("variants_panel.commit_clicked",{sessionId:Pe,variantId:$.workItemId,variantLabel:$.label}),ie({kind:"commit",variantId:$.workItemId});try{const pe=await fetch(`/api/variants/${Pe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:$.workItemId})});if(!pe.ok){const{message:Ye,errorCode:Re}=await Ri(pe);On.warn(`commit failed: HTTP ${pe.status} ${Re??""} ${Ye??""}`),Ee.capture("variants_panel.commit_failed",{sessionId:Pe,variantId:$.workItemId,httpStatus:pe.status,errorCode:Re??null,errorMessage:Ye??null}),Pt.error("Couldn't send direction",{description:Ye??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const be=await pe.json().catch(()=>null);Ee.capture("variants_panel.commit_succeeded",{sessionId:Pe,variantId:$.workItemId,payloadKind:(be==null?void 0:be.payloadKind)??null,duplicate:(be==null?void 0:be.duplicate)??!1}),Pt.success(`Sent "${$.label}" to your project`,{description:(be==null?void 0:be.payloadKind)==="project-created"?`Project created at ${(be==null?void 0:be.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(be==null?void 0:be.payloadKind)!=="project-created"&&(_(null),x(!1),w(Ye=>Ye+1))}catch(pe){On.warn("commit failed",pe),Ee.capture("variants_panel.commit_failed",{sessionId:Pe,variantId:$.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),Pt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{ie(null)}}},[Pe,w,_,x]),Qt=m.useCallback(async($,le,ke)=>{Ee.capture("variants_panel.deploy_clicked",{sessionId:$,variantId:le,variantLabel:ke});try{const he=await fetch(`/api/variants/${$}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...i?{projectPath:i}:{}})});if(!he.ok){const{message:Ye,errorCode:Re}=await Ri(he);return On.warn(`deploy failed: HTTP ${he.status} ${Re??""} ${Ye??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:$,variantId:le,httpStatus:he.status,errorCode:Re??null,errorMessage:Ye??null}),Pt.error("Couldn't deploy this direction",{description:Ye??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const pe=await he.json().catch(()=>null),be=pe==null?void 0:pe.shareUrl;return be?(await navigator.clipboard.writeText(be).catch(()=>{}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:$,variantId:le}),Pt.success(`"${ke}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(be,"_blank","noopener")}}),be):(Pt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return On.warn("deploy failed",he),Ee.capture("variants_panel.deploy_failed",{sessionId:$,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),Pt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),ev=m.useCallback(async $=>{if(!Pe)return;const le=de[$.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),Pt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}ie({kind:"deploy",variantId:$.workItemId});try{const ke=await Qt(Pe,$.workItemId,$.label);ke&&ae(he=>({...he,[$.workItemId]:ke}))}finally{ie(null)}},[Pe,de,Qt]),xd=m.useCallback(async()=>{if(!(!Pe||pt.length===0)){if($t){await navigator.clipboard.writeText($t).catch(()=>{}),Pt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open($t,"_blank","noopener")}});return}Ee.capture("variants_panel.deploy_clicked",{sessionId:Pe,variantId:"canvas",variantLabel:"Canvas",variantCount:pt.length}),ie({kind:"deploy-canvas"});try{const $=await fetch(`/api/variants/${Pe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:pt.map(be=>be.workItemId),...i?{projectPath:i}:{}})});if(!$.ok){const{message:be,errorCode:Ye}=await Ri($);On.warn(`canvas deploy failed: HTTP ${$.status} ${Ye??""} ${be??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:Pe,variantId:"canvas",httpStatus:$.status,errorCode:Ye??null,errorMessage:be??null,variantCount:pt.length}),Pt.error("Couldn't share this canvas",{description:be??`The server rejected the request (HTTP ${$.status}). Try again.`});return}const le=await $.json().catch(()=>null),ke=le==null?void 0:le.shareUrl;if(!ke){Pt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(be=>typeof be.variantId=="string"&&typeof be.shareUrl=="string").map(be=>[be.variantId,be.shareUrl])),pe=Object.keys(he).length>0?{...de,...he}:de;pe!==de&&ae(pe),await navigator.clipboard.writeText(ke).catch(()=>{}),Ce({key:YC(pt,pe),shareUrl:ke}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:Pe,variantId:"canvas",variantCount:pt.length}),Pt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}})}catch($){On.warn("canvas deploy failed",$),Ee.capture("variants_panel.deploy_failed",{sessionId:Pe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:$ instanceof Error?$.message:String($),variantCount:pt.length}),Pt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{ie(null)}}},[$t,pt,de,i,Pe]),Jh=m.useCallback(async $=>{const le=`${$.sessionId}:${$.variantId}`,ke=Ge[le];if(ke){await navigator.clipboard.writeText(ke).catch(()=>{}),Pt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}});return}Kt(le);try{const he=await Qt($.sessionId,$.variantId,$.label);he&&dt(pe=>({...pe,[le]:he}))}finally{Kt(null)}},[Ge,Qt]),Uo=m.useCallback(async $=>{if(Pe){Ee.capture("variants_panel.remove_clicked",{sessionId:Pe,variantId:$.workItemId,variantLabelLength:$.label.length}),ie({kind:"remove",variantId:$.workItemId});try{const le=await fetch(`/api/variants/${Pe}/${$.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:ke}=await Ri(le);On.warn(`remove failed: HTTP ${le.status} ${ke??""}`),Pt.error("Couldn't remove direction",{description:ke??`The server rejected the request (HTTP ${le.status}). Try again.`});return}($.workItemId===In||$.workItemId===B)&&(j(null),_(null),x(!1),w(ke=>ke+1))}catch(le){On.warn("remove failed",le),Pt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{ie(null)}}},[Pe,B,In,j,_,x,w]),wd=m.useCallback(async $=>{if(!vn){Pt.error("Couldn't remove direction",{description:"No project path available."});return}Ee.capture("variants_panel.remove_past_clicked",{sessionId:$.sessionId,variantId:$.variantId});const le=`${$.sessionId}:${$.variantId}`,ke=he=>he.sessionId===$.sessionId&&he.variantId===$.variantId;ie({kind:"remove",variantId:le}),ht(he=>he.filter(pe=>!ke(pe))),H===le&&(U(null),_(null),x(!1),w(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:vn})});if(!he.ok){const{message:pe}=await Ri(he);ht(be=>be.some(ke)?be:[...be,$]),Pt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){On.warn("remove past failed",he),ht(pe=>pe.some(ke)?pe:[...pe,$]),Pt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{ie(null)}},[vn,H,U,_,x,w]),bd=m.useCallback($=>{oe($)},[]),bc=m.useCallback($=>{if(!$.label||!$.run)return;const le=$.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),ke=$.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);le.length===0&&ke.length===0||oe({kind:"run",label:$.label,variants:le,entries:ke})},[]),Is=m.useCallback(async()=>{if(!(!ne||fe)){xe(!0);try{if(ne.kind==="active")await Uo(ne.variant);else if(ne.kind==="past")await wd(ne.entry);else{for(const $ of ne.variants)await Uo($);for(const $ of ne.entries)await wd($)}}finally{xe(!1),oe(null)}}},[ne,fe,Uo,wd]),[ep,os]=m.useState(null),[tv,Sd]=m.useState(null),nv=m.useCallback($=>{Sd($)},[]),Sc=m.useCallback(()=>{Sd(null)},[]),kc=m.useCallback(async $=>{const le=$.trim();if(le)try{await navigator.clipboard.writeText(le),Pt.success("Copied")}catch{Pt.error("Couldn't copy")}},[]),ol=m.useCallback(async($,le)=>{Sd(null);const ke=le.trim();if(!ke||$.kind==="original")return;if($.kind==="active"){if(!Pe||ke===$.variant.label)return;Ee.capture("variants_panel.rename",{sessionId:Pe,variantId:$.variant.workItemId,labelLength:ke.length,past:!1});try{const be=await fetch(`/api/variants/${Pe}/${$.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke})});if(!be.ok){const{message:Ye}=await Ri(be);Pt.error("Couldn't rename direction",{description:Ye??`The server rejected the request (HTTP ${be.status}). Try again.`})}}catch(be){On.warn("rename failed",be),Pt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=$;if(ke===he.label.trim())return;if(!vn){Pt.error("Couldn't rename direction",{description:"No project path available."});return}Ee.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:ke.length,past:!0});const pe=be=>be.sessionId===he.sessionId&&be.variantId===he.variantId;ht(be=>be.map(Ye=>pe(Ye)?{...Ye,label:ke}:Ye));try{const be=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke,projectPath:vn})});if(!be.ok){const{message:Ye}=await Ri(be);ht(Re=>Re.map(tn=>pe(tn)?{...tn,label:he.label}:tn)),Pt.error("Couldn't rename direction",{description:Ye??`The server rejected the request (HTTP ${be.status}). Try again.`})}}catch(be){On.warn("rename failed",be),ht(Ye=>Ye.map(Re=>pe(Re)?{...Re,label:he.label}:Re)),Pt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Pe,vn]),[Ec,kd]=m.useState(null),rv=m.useCallback($=>{kd($)},[]),Ed=m.useCallback(()=>{kd(null)},[]),tp=m.useCallback(async($,le)=>{if(kd(null),!$.label||!$.run)return;const ke=$.label,he=le.trim();if(!he||he===ke)return;Ee.capture("variants_panel.rename_run",{runLabelLength:he.length});const pe="requestId"in $.run?$.run.requestId:void 0,be=pe?$.key:vO({sessionId:$.run.sessionId,runLabel:he}),Ye=be!==$.key;let Re=!1,tn=!1;if(i!==null&&Ye){const at=M0(i);Re=at.has($.key),tn=at.has(be),Re&&(at.add(be),Qy(i,at),ee())}const yn=at=>{if(i===null||!Ye)return;const Ft=M0(i);at?Ft.delete($.key):(Re?Ft.add($.key):Ft.delete($.key),tn?Ft.add(be):Ft.delete(be)),Qy(i,Ft),ee()},Pr=new Set($.rows.flatMap(at=>at.kind==="past"?[`${at.entry.sessionId}:${at.entry.variantId}`]:[])),ls=at=>Pr.has(`${at.sessionId}:${at.variantId}`);ht(at=>at.map(Ft=>ls(Ft)?{...Ft,runLabel:he}:Ft));const cs=()=>ht(at=>at.map(Ft=>ls(Ft)?{...Ft,runLabel:ke}:Ft));try{const at=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:$.run.sessionId,...pe?{requestId:pe}:{},runLabel:ke,label:he,...vn?{projectPath:vn}:{}})});if(at.ok)yn(!0);else{const{message:Ft}=await Ri(at);cs(),yn(!1),Pt.error("Couldn't rename run",{description:Ft??`The server rejected the request (HTTP ${at.status}). Try again.`})}}catch(at){On.warn("run rename failed",at),cs(),yn(!1),Pt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[vn,i,ht]);m.useEffect(()=>{const $=n&&!r.current;if(r.current=n,Qi.current!==Pe){const ke=Qi.current===null;Qi.current=Pe;const he=t.get(am);if($&&Le&&(he==null?void 0:he.sessionId)===Le.sessionId&&(he==null?void 0:he.variantId)===Le.variantId||(ss.current=null,Ce(null),_(null),x(!1),b(null),D(),j(null),U(null),Yt(!1),xc.current=!1,!ke))return}if(H||kt||!In||e.active!==!0||ss.current===In)return;const le=Me.find(ke=>ke.workItemId===In);le&&(ss.current=In,D(),gc(le))},[Pe,n,Le,t,H,kt,In,e,Me,gc,D,j,U,_,b,x]),m.useEffect(()=>{!K||!Tn||(ss.current=null,U(null),j(Tn.workItemId),Yt(!1))},[Tn,K,Pe,j,U]),m.useEffect(()=>{!K||Tn||rl||U(null)},[Tn,K,rl,Pe,U,Xt]),m.useEffect(()=>{const $=Z.trim().toLowerCase(),le=[...Me.map(Re=>({kind:"active",variant:Re})),...Xt.map(Re=>({kind:"past",entry:Re})),...Rs?[{kind:"original"}]:[]],ke=$?le.filter(Re=>XC(Re,$)):le,{pinned:he,unpinned:pe}=QC(e3(GC(ke,Pe),Ks),er,Pe),be=[...W.has(mx)?[]:he,...pe.flatMap(Re=>Re.key!==""&&W.has(Re.key)?[]:Re.rows)];if(be.length===0)return;const Ye=Re=>{if(mQ())return;if(Re.key==="Enter"){const Ft=Me.find(Js=>Js.workItemId===ep);Ft&&(Re.preventDefault(),_c(Ft));return}if(Re.key!=="ArrowUp"&&Re.key!=="ArrowDown")return;Re.preventDefault();const tn=B??In;let yn=tn?`live:${tn}`:null;H?yn=`past:${H}`:il&&(yn=pO);const Pr=yn?be.findIndex(Ft=>nd(Ft)===yn):-1;let ls;if(Pr===-1?ls=Re.key==="ArrowDown"?0:be.length-1:Re.key==="ArrowDown"?ls=Math.min(Pr+1,be.length-1):ls=Math.max(Pr-1,0),ls===Pr)return;const cs=be[ls];cs.kind==="active"?_c(cs.variant):cs.kind==="past"?Bo(cs.entry):_d();const at=document.querySelector(`[data-variant-key="${nd(cs)}"]`);at instanceof HTMLElement&&at.focus({preventScroll:!0})};return window.addEventListener("keydown",Ye),()=>window.removeEventListener("keydown",Ye)},[Me,Xt,Z,Rs,W,er,Ks,Pe,B,H,il,In,ep,_c,Bo,_d]);const al=Me.find($=>$.workItemId===In)??null,eo=H?Xt.find($=>`${$.sessionId}:${$.variantId}`===H)??null:null,np=!!eo,Cd=e.active?e.artifacts??[]:[],to=[...(e.active?Me:[]).map($=>({kind:"active",variant:$})),...Xt.map($=>({kind:"past",entry:$})),...Rs?[{kind:"original"}]:[]],Pd=Z.trim().toLowerCase(),ll=Pd?to.filter($=>XC($,Pd)):to,rp=e3(GC(ll,Pe),Ks),{pinned:sp,unpinned:ip}=QC(rp,er,Pe);let Cc=null;A&&(Cc=A.source==="live"?`live:${A.variantId}`:`past:${A.sessionId}:${A.variantId}`);const Pc=new Set(Me.map($=>$.requestId).filter(Boolean)),Xs=s.filter($=>!Pc.has($.requestId)),as=Xs.length>0,Ms=o&&!as&&to.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[to.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(sq,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:Z,onChange:$=>Q($.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[as?S.jsx(SJ,{groups:Xs}):null,Ms?S.jsx(kJ,{}):null,e.active&&to.length===0&&!as&&!Ms?S.jsx(EJ,{}):null,!e.active&&!as&&!Ms&&Xt.length===0&&!Rs?S.jsx(CJ,{isMCPSession:g,mcpEditor:v}):null,to.length>0&&ll.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",Z.trim(),"”."]}):null,ll.length>0?S.jsx(hJ,{groups:ip,pinned:sp,pinnedKeys:Xi,draggedRowKey:Cc,onDropPin:Fr,onDropUnpin:Ys,onTogglePin:$n,onReorder:cr,collapsedRuns:W,onToggleRun:N,activeVariantId:B??In,activePastKey:H,isOriginalSelected:il,busy:X,editingKey:tv,onSelectActive:_c,onSelectPast:Bo,onSelectOriginal:_d,onActivePointerDown:Zn,onPastPointerDown:is,onHover:os,onRemove:$=>bd({kind:"active",variant:$}),onRemovePast:$=>bd({kind:"past",entry:$}),onStartRename:nv,onCommitRename:ol,onCancelRename:Sc,editingRunKey:Ec,onStartRunRename:rv,onCommitRunRename:tp,onCancelRunRename:Ed,onRemoveRun:bc,onCopyVariantContext:kc,activeSessionId:e.active?e.sessionId:null,projectPath:vn}):null,e.active&&p?S.jsx(_J,{artifacts:Cd}):null]}),np&&eo?S.jsx(gJ,{entry:eo,deploying:Lt===H,deployedUrl:H?Ge[H]??null:null,onDeploy:Jh,isDeployDisabled:!u}):null,!np&&e.active?S.jsx(bJ,{selectedVariant:al,busy:X,onSend:Jg,onDeploy:ev,onDeployCanvas:xd,canDeploy:u&&(gn==null?void 0:gn.kind)==="fresh",canDeployCanvas:u&&d&&(gn==null?void 0:gn.kind)==="fresh",canSendToAgent:f,canvasVariantCount:pt.length,canvasDeployedUrl:$t,deployedUrl:al?de[al.workItemId]??null:null}):null,S.jsx(cJ,{target:ne,isConfirming:fe,onCancel:()=>oe(null),onConfirm:Is})]})},lJ=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",cJ=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=lJ(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(fb,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:S.jsxs(hb,{children:[S.jsx(pb,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(mb,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(gb,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(vb,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},nd=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:pO,XC=(t,e)=>t.kind==="active"?Xy(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Xy(e,t.entry.label,t.entry.runLabel,t.entry.brief):Xy(e,Rb,mO),xO=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,wO=(t,e)=>xO(nd(t),e),QC=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const u=[];for(const d of l.rows){const f=wO(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},JC=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},e3=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:JC(r.rows,s,nd)}});return JC(n,e.groups,r=>r.key)},uJ=t=>t.length<=qC?t:`${t.slice(0,qC-1)}…`,dJ=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,fJ=t=>{var i,o;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(l=>!!l).join(`
112
+ `);if(!t.reference)return e;const n=((o=t.projectPath)==null?void 0:o.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
113
+ `);return e?`${e}
114
+
115
+ ${s}`:s},hJ=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:p,isOriginalSelected:g,busy:v,editingKey:w,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:A,onRemovePast:M,onStartRename:I,onCommitRename:T,onCancelRename:L,editingRunKey:D,onStartRunRename:B,onCommitRunRename:j,onCancelRunRename:K,onRemoveRun:U,onCopyVariantContext:H,activeSessionId:Z,projectPath:Q})=>{const z=m.useRef(null),{activeIndex:ee,itemRects:W,sessionRef:N,handlers:X,registerItem:ie}=KM(z,{snapTolerancePx:5}),[ne,oe]=m.useState(!1),[fe,xe]=m.useState(!1),de=u.has(mx),ae=r!==null,Oe=m.useMemo(()=>{if(!r)return null;const Le=xO(r,Z);if(n.has(Le))return{container:Sf,key:Le};const rt=t.find(Be=>Be.rows.some(Me=>nd(Me)===r));return rt?{container:Ky(rt.key),key:r}:null},[r,n,t,Z]),Ce=(Oe==null?void 0:Oe.container)===Sf,{dropTarget:Ge,onPointerMove:dt,onPointerUp:Lt}=PQ({containerRef:z,dragged:Oe,yieldToSelector:Ce?void 0:"[data-pinned-drop-zone]",restrictToSelector:Ce?"[data-pinned-drop-zone]":void 0,onReorder:l}),Kt=ee!==null?W[ee]:null,_t=Le=>Le.kind==="active"?Le.variant.workItemId===f:Le.kind==="past"?`${Le.entry.sessionId}:${Le.entry.variantId}`===p:g,ht=(Le,rt,Be,Me)=>{const pt=nd(Le),An=wO(Le,Z);return S.jsx(mJ,{rowKey:pt,row:Le,index:rt,isSelected:_t(Le),isEditing:w===pt,isPinned:n.has(An),onTogglePin:$t=>o(An,$t),reorderContainer:Be,reorderKey:Be===Sf?An:pt,isNested:Me,busy:v,registerItem:ie,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:A,onRemovePast:M,onStartRename:I,onCommitRename:T,onCancelRename:L,onCopyVariantContext:H,activeSessionId:Z,projectPath:Q},pt)};let En=0;const kt=Le=>{if(Le.key==="")return Le.rows.map(pt=>ht(pt,En++,Ky(Le.key),!1));const rt=u.has(Le.key),Be=rt?null:Le.rows.map(pt=>ht(pt,En++,Ky(Le.key),!0)),Me=Le.label;return S.jsx(pJ,{label:Me??Rb,collapsed:rt,onToggle:()=>d(Le.key),directionCount:Le.rows.length,isEditing:Me!==null&&D===Le.key,onStartRename:Me!==null?()=>B(Le.key):void 0,onCommitRename:Me!==null?pt=>j(Le,pt):void 0,onCancelRename:K,onRemove:Me!==null?()=>U(Le):void 0,children:Be},Le.key)},Yt=e.length>0||ae;return S.jsxs("div",{ref:z,className:"relative",onMouseEnter:X.onMouseEnter,onMouseMove:X.onMouseMove,onMouseLeave:X.onMouseLeave,onPointerMove:dt,onPointerUp:Le=>{var rt;if(Ce&&Oe){const Be=(rt=z.current)==null?void 0:rt.querySelector("[data-pinned-drop-zone]"),Me=Be==null?void 0:Be.getBoundingClientRect();if(!(Me!==void 0&&Le.clientY>=Me.top&&Le.clientY<=Me.bottom)){i(Oe.key);return}}Lt()},children:[Oe&&Ge?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Ge.top}}):null,S.jsx(ws,{children:Kt&&S.jsx(vi.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height},animate:{opacity:1,top:Kt.top,left:Kt.left,width:Kt.width,height:Kt.height},exit:{opacity:0,transition:{duration:.06}},transition:{..._h.fast,opacity:{duration:.08}}},N.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(ws,{initial:!1,children:Yt?S.jsxs(vi.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:px,ease:hx},"data-pinned-drop-zone":"",className:Ht("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",ae&&"ring-content-muted/30 ring-1",ae&&ne&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:ae?()=>oe(!0):void 0,onPointerLeave:ae?()=>oe(!1):void 0,onPointerUp:ae?()=>{oe(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(mx),"aria-expanded":!de,"aria-label":`${de?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(V2,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(ws,{initial:!1,children:!de&&S.jsx(vi.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:px,ease:hx},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Le=>ht(Le,En++,Sf,!1))}):null},"body")})]},"pinned-section"):null}),Yt&&t.length>0?S.jsxs("li",{className:Ht("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Ce&&"ring-content-muted/30 ring-1",Ce&&fe&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:Ce?()=>xe(!0):void 0,onPointerLeave:Ce?()=>xe(!1):void 0,onPointerUp:Ce?()=>xe(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx(lq,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Le=>kt(Le))})]}):t.map(Le=>kt(Le))]})]})},bO=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=YM({onDismiss:()=>e(!1)});return S.jsxs(bb,{open:t,onOpenChange:e,children:[S.jsx(fc,{label:n,children:S.jsx(Sb,{asChild:!0,children:S.jsx(Oo,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:gO,children:S.jsx(tq,{size:15,weight:"bold"})})})}),S.jsx(kb,{children:S.jsx(Eb,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label]},o.key))})})]})},pJ=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=Vo(),[p,g]=m.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(BT,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:S.jsx(JT,{size:13,weight:"bold"}),onSelect:u}]:[]],w=e?S.jsx(rq,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(nq,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[w,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(SO,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(ws,{initial:!1,children:!e&&S.jsx(vi.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){g(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[w,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:Ht("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",p&&"pointer-events-auto opacity-100"),children:S.jsx(bO,{open:p,onOpenChange:g,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(ws,{initial:!1,children:!e&&S.jsx(vi.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:px,ease:hx},className:"overflow-hidden",children:d},"body")})]})},mJ=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:p,onSelectActive:g,onSelectPast:v,onSelectOriginal:w,onActivePointerDown:_,onPastPointerDown:x,onHover:b,onRemove:E,onRemovePast:C,onStartRename:R,onCommitRename:A,onCancelRename:M,onCopyVariantContext:I,activeSessionId:T,projectPath:L})=>{var ae,Oe;const D=m.useRef(null);hQ(p,n,D);const[B,j]=m.useState(!1),K=e.kind==="active",U=e.kind==="original",H=e.kind==="active"?e.variant:null,Z=e.kind==="past"?e.entry:null,Q=H?H.status==="succeeded":!0,z=H?Uf(H):!0,ee=H!==null&&(H.status==="pending"||H.status==="running"),W=(H==null?void 0:H.status)==="failed",N=(H==null?void 0:H.status)==="cancelled",X=H!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===H.workItemId,ie=H!==null&&(((ae=H.refinement)==null?void 0:ae.status)==="pending"||((Oe=H.refinement)==null?void 0:Oe.status)==="running");let ne=Rb;H?ne=H.label||`Direction ${n+1}`:Z&&(ne=Z.label.trim()||"Untitled direction");let oe=mO;H?oe=H.description:Z&&(oe=Z.brief);const fe=oe?uJ(oe):null,xe=dJ(e,T),de=xe?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:S.jsx("div",{className:Ht("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(SO,{initial:ne,onCommit:Ce=>A(e,Ce),onCancel:M}),fe&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:fe})]})})}):S.jsxs("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:Ht("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:H?()=>b(H.workItemId):void 0,onMouseLeave:K?()=>b(null):void 0,children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":H==null?void 0:H.workItemId,"data-variant-key":t,onClick:Ce=>{if(Ce.metaKey||Ce.ctrlKey){j(!0);return}const Ge=window.getSelection();Ge&&!Ge.isCollapsed||(e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):w())},onKeyDown:Ce=>{(Ce.key==="Enter"||Ce.key===" ")&&(Ce.preventDefault(),Ce.stopPropagation(),e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):w())},onPointerDown:Ce=>{Ce.metaKey||Ce.ctrlKey||(e.kind==="active"?z&&_(e.variant.workItemId,Ce):e.kind==="past"&&x(e.entry,Ce))},"aria-pressed":r,"aria-disabled":K?!1:void 0,"aria-busy":ee||ie,className:Ht("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",z&&"cursor-grab active:cursor-grabbing",!z&&"cursor-pointer"),style:z?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(ee||ie)&&S.jsx(Pb,{className:"text-content-muted shrink-0 text-sm","data-testid":ie&&!ee?"variant-refining":void 0}),S.jsx(fc,{label:"Double-click to rename",disabled:U,children:S.jsx("span",{onDoubleClick:Ce=>{Ce.stopPropagation(),U||R(t)},className:Ht("min-w-0 flex-1 truncate text-sm font-medium select-text",U?"cursor-default":"cursor-text",Q||r?"text-content":"text-content-muted"),children:ne})}),W&&S.jsx(fc,{label:(H==null?void 0:H.errorMessage)??(H==null?void 0:H.errorCode)??"Failed",disabled:!(H!=null&&H.errorMessage)&&!(H!=null&&H.errorCode),children:S.jsx("span",{className:"shrink-0",children:S.jsx(t3,{label:"Failed"})})}),N&&S.jsx(t3,{label:"Cancelled"})]}),fe&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:fe})]})}),U?null:S.jsx(kI,{references:(H==null?void 0:H.references)??(Z==null?void 0:Z.references),source:K?"active":"history",sessionId:(Z==null?void 0:Z.sessionId)??T,variantId:(Z==null?void 0:Z.variantId)??(H==null?void 0:H.workItemId),projectPath:L,className:d?"pl-[33px]":"pl-3"}),S.jsxs("div",{className:Ht("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150 motion-reduce:transition-none","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",B&&"pointer-events-auto opacity-100"),children:[S.jsx(Oo,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:Ce=>Ce.stopPropagation(),onKeyDown:Ce=>Ce.stopPropagation(),onClick:Ce=>{Ce.stopPropagation(),o("button")},className:gO,children:S.jsx(V2,{weight:i?"fill":"bold"})}),S.jsx(bO,{open:B,onOpenChange:j,triggerLabel:"Direction actions",actions:[...oe||xe?[{key:"copy",label:de,icon:S.jsx(uh,{size:13,weight:"bold"}),onSelect:()=>I(fJ({label:ne,description:oe,reference:xe,projectPath:L}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(V2,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...U?[]:[{key:"rename",label:"Rename",icon:S.jsx(BT,{size:13,weight:"bold"}),onSelect:()=>R(t)},{key:"remove",label:"Remove",icon:S.jsx(JT,{size:13,weight:"bold"}),disabled:X,onSelect:()=>{e.kind==="active"?E(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},SO=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=m.useState(t),i=m.useRef(!1),o=m.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},t3=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),gJ=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(uh,{size:12,weight:"bold"}):null,o]})]})},vJ={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},yJ={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},_J=({artifacts:t})=>{const[e,n]=m.useState(null),r=m.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(o=>o===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(xJ,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},xJ=({artifact:t,isExpanded:e,onToggle:n})=>{const r=yJ[t.kind],s=t.source?vJ[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),o=t.kind==="design_context"&&!!t.viewUrl,l=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return o?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Ee.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(YW,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":l,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(wJ,{artifact:t})}):null]})},wJ=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),bJ=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:f})=>{var I,T,L,D;const p=t?((T=(I=t.actions)==null?void 0:I.commit)==null?void 0:T.enabled)??t.status==="succeeded":!1,g=p&&e===null,v=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,b=o&&u>0,C=w?"Deploying…":f?"Copy link":"Share",A=_?"Sharing…":d?"Copy canvas link":"Share canvas",M=v?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),f?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(dO,{primaryLabel:C,primaryIcon:f&&!w?uh:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:b?[{label:A,icon:d&&!_?uh:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!g,title:(D=(L=t==null?void 0:t.actions)==null?void 0:L.commit)==null?void 0:D.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:M}):null]})]})},kO=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(Pb,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),SJ=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(kO,{},`${e.requestId}-${r}`)))}),kJ=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(kO,{},e))}),EJ=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),n3="Try different ways to create a dropdown that feels fluid and dynamic",CJ=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=GQ(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(n3).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",n3,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(NT,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(uh,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},PJ="rivet:show-projects",RJ=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},AJ=({onClose:t})=>{const e=lt(rO),n=lt(zg),r=RJ(window.location.search),s=(n==null?void 0:n.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let i=e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{});return r&&(i=S.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:S.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[S.jsx("li",{className:"shrink-0",children:S.jsx("button",{onClick:()=>window.parent.postMessage(PJ,r),className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),S.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:S.jsx(JW,{className:"h-3 w-3"})}),S.jsx("li",{className:"min-w-0",children:S.jsx("span",{"aria-current":"page",title:s,className:"text-content block truncate font-medium",children:s})})]})})),S.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[i,S.jsx(fc,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,"aria-label":"Close panel",className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors",children:S.jsx(iq,{className:"h-4 w-4",weight:"bold"})})})]})},hc=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library"))return fetch(t,e);const n=new Headers(e.headers);return n.set("Authorization",uV()),fetch(t,{...e,headers:n})},TJ=5e3,IJ=()=>{const t=window.location.pathname.startsWith("/rivet/library");return vm({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await hc(t?"/api/account":"/api/config",{signal:e});if(!n.ok)throw new Error("Could not load your account.");if(t)return n.json();const r=await n.json();return{isAuthenticated:r.agentModeAvailable,name:r.name,email:r.email,userId:r.userId}},refetchInterval:TJ,retry:!1})},cg="rivet_just_signed_in",MJ=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},e_=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),r3=Ps("useLogin"),OJ=2e3,LJ=60,s3="Connecting to Google...",i3="https://rivet-proxy.onrender.com",NJ=`<!doctype html>
116
+ <html lang="en">
117
+ <head>
118
+ <meta charset="utf-8" />
119
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
120
+ <title>${s3}</title>
121
+ <style>
122
+ :root { color-scheme: light dark; }
123
+ body {
124
+ margin: 0;
125
+ min-height: 100vh;
126
+ display: grid;
127
+ place-items: center;
128
+ font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
129
+ background: #111215;
130
+ color: #f3f4f6;
131
+ }
132
+ .panel {
133
+ border: 1px solid rgba(255, 255, 255, 0.16);
134
+ border-radius: 12px;
135
+ padding: 18px 22px;
136
+ background: rgba(255, 255, 255, 0.06);
137
+ font-size: 14px;
138
+ }
139
+ </style>
140
+ </head>
141
+ <body>
142
+ <div class="panel">${s3}</div>
143
+ </body>
144
+ </html>`,EO=(t="editor_gate")=>{const e=Vo(),[n,r]=m.useState(!1),[s,i]=m.useState(null);return{startLogin:m.useCallback(async()=>{var p;const l=globalThis.crypto.randomUUID(),u=Date.now();r(!0),i(null);const d=e_({outcome:"started",authAttemptId:l,entryPoint:t,startedAt:u,now:u});e==null||e.capture(d.event,d.properties);let f=null;try{if(f=window.open("","_blank"),!f)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{f.document.open(),f.document.write(NJ),f.document.close()}catch(w){r3.warn("Failed to render loading state in auth popup:",w)}const g=await fetch(`${i3}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core"})}),v=await g.json();if(!g.ok||!v.success||!v.authUrl||!v.sessionId||!v.pollSecret)throw new Error(v.error||v.message||"Failed to start Google login");if(f.closed)throw new Error("Sign-in window was closed before Google login started.");f.location.href=v.authUrl;for(let w=0;w<LJ;w+=1){if(f.closed)throw new Error("Sign-in window was closed before authentication completed.");const x=await(await fetch(`${i3}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v.sessionId,pollSecret:v.pollSecret})})).json();if(x.success&&x.token&&((p=x.user)!=null&&p.email)){if(!(await hc("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:x.token,refreshToken:x.refreshToken,userId:x.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");f.close(),window.sessionStorage.setItem(cg,"1");const E=e_({outcome:"completed",authAttemptId:l,entryPoint:t,startedAt:u,now:Date.now()});e==null||e.capture(E.event,E.properties),window.location.reload();return}if(x.error&&x.error!=="Pending")throw new Error(x.error||"Google login failed");await new Promise(b=>setTimeout(b,OJ))}throw new Error("Authentication timed out. Please try again.")}catch(g){f&&!f.closed&&f.close();const v=g instanceof Error?g.message:"Failed to start login flow";r3.warn("Login failed:",v);const w=e_({outcome:"failed",authAttemptId:l,entryPoint:t,startedAt:u,now:Date.now(),failureReason:MJ(v)});e==null||e.capture(w.event,w.properties),i(v),r(!1)}},[e,t]),isStartingLogin:n,loginError:s}},DJ=Ps("useIntegrations"),t_=["integrations"],$J="rivet:connect-result",jJ=t=>typeof t=="object"&&t!==null&&t.type===$J,FJ=ut(null),o3=async()=>{const t=await hc("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},VJ=()=>{const t=cP(),[e,n]=UR(FJ),r=vm({queryKey:t_,queryFn:o3,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:t_,refetchType:"none"}),t.fetchQuery({queryKey:t_,queryFn:o3})),[t]),i=m.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await hc(`/api/integrations/${l}/connect`,{method:"POST"}),f=await d.json().catch(()=>({}));if(!d.ok||!f.authUrl)throw u.close(),new Error(f.error||`Could not connect ${l}`);return u.location.href=f.authUrl,await new Promise(p=>{let g=!1,v=null;const w=async(x,b=!1)=>{if(!g){g=!0,window.removeEventListener("message",_),v&&clearInterval(v);try{const C=(await s()).some(R=>R.provider===l&&R.status==="connected");p(b&&C?"connected":x)}catch{p(x)}}},_=x=>{if(jJ(x.data)&&x.data.provider===l){if(x.data.status==="error"){DJ.warn(`Connect failed for ${l}:`,x.data.message),w("failed");return}w("connected")}};window.addEventListener("message",_),v=setInterval(()=>{u.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),o=m.useCallback(async l=>{n(l);try{const u=await hc(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},Rl=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),a3=Ps("ConnectorsModal"),HJ=[{provider:"x",name:"X",description:"Save bookmarked posts and images as design inspiration.",tileClassName:"bg-black text-white",icon:S.jsx(tm,{provider:"x"})},{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(tm,{provider:"pinterest"})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(tm,{provider:"arena"})}],zJ=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const o=(e==null?void 0:e.status)==="connected",l=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,o?S.jsx(NT,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),o&&l?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:l}):null]}),o?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},gx=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=VJ(),f=Vo(),[p,g]=m.useState(null),v=b=>s.find(E=>E.provider===b),w=m.useCallback(b=>{const E=Date.now(),C=Rl({action:"connect",outcome:"started",provider:b,entryPoint:n});f==null||f.capture(C.event,C.properties),u(b).then(R=>{const A=Date.now()-E;if(R==="connected"){const I=Rl({action:"connect",outcome:"completed",provider:b,entryPoint:n,durationMs:A});f==null||f.capture(I.event,I.properties);return}const M=Rl({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:A,failureReason:R==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(M.event,M.properties)}).catch(R=>{const A=R instanceof Error?R.message:"Could not connect.",M=Rl({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-E,failureReason:A.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(M.event,M.properties),a3.warn(`Connect error for ${b}:`,A),Pt.error(A)})},[u,n,f]),_=m.useCallback(b=>{const E=Date.now(),C=Rl({action:"disconnect",outcome:"started",provider:b,entryPoint:n});f==null||f.capture(C.event,C.properties),d(b).then(()=>{const R=Rl({action:"disconnect",outcome:"completed",provider:b,entryPoint:n,durationMs:Date.now()-E});f==null||f.capture(R.event,R.properties)}).catch(R=>{const A=R instanceof Error?R.message:"Could not disconnect.",M=Rl({action:"disconnect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-E,failureReason:"request_failed"});f==null||f.capture(M.event,M.properties),a3.warn(`Disconnect error for ${b}:`,A),Pt.error(A)})},[n,d,f]),x=n==="onboarding";return S.jsx(fb,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(hb,{children:[S.jsx(pb,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(mb,{ref:g,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(EM,{value:p,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(gb,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(Oo,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(nI,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(vb,{className:"text-content-subtle text-sm",children:"Connect your accounts to save design inspiration in Rivet."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:HJ.map(b=>S.jsx(zJ,{meta:b,integration:v(b.provider),isPending:i||l===b.provider,isHighlighted:r===b.provider,onConnect:()=>w(b.provider),onDisconnect:()=>_(b.provider)},b.provider))}),x?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},l3=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),BJ=Ps("SupportTicketModal"),c3=5e3,n_="feedback",UJ=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},ZJ=async t=>{let e;try{e=await t.json()}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=UJ(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},WJ=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Vo(),[s,i]=m.useState(""),[o,l]=m.useState(!1),[u,d]=m.useState(null),f=m.useCallback(()=>{i("")},[]),p=m.useCallback(()=>{o||(f(),e())},[o,e,f]),g=m.useCallback(async()=>{const x=s.trim();if(!(!x||o)){l(!0);try{const b=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,E=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),R=await hc("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:n_,message:x,contactEmail:C||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:E??void 0,appVersion:"0.18.2",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!R.ok){const A=await ZJ(R);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:n_,has_posthog_session_id:!!b}),Pt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(b){const E=b instanceof Error?b.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:n_,error:E}),BJ.error("Failed to submit support ticket:",E),Pt.error("Could not send feedback",{description:E})}finally{l(!1)}}},[n,o,s,e,r,f]),v=m.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())},[g]),w=c3-s.length,_=o||s.trim().length===0;return S.jsx(fb,{open:t,onOpenChange:x=>!x&&p(),children:S.jsxs(hb,{children:[S.jsx(pb,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(mb,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(EM,{value:u,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(gb,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(Oo,{onClick:p,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(nI,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(vb,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:v,maxLength:c3,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[S.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:w}),S.jsx(Oo,{onClick:g,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?S.jsx(Mg,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(XW,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},qJ=Ps("ProfileAvatar"),CO=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},GJ=(t,e)=>CO(t,e).charAt(0).toUpperCase(),KJ=({className:t="",side:e="bottom",align:n="end"})=>{var K,U,H;const r=IJ(),s=((K=r.data)==null?void 0:K.name)??null,i=((U=r.data)==null?void 0:U.email)??null,o=((H=r.data)==null?void 0:H.isAuthenticated)===!0,l=Vo(),{startLogin:u,isStartingLogin:d,loginError:f}=EO("account_menu"),[p,g]=m.useState(!1),[v,w]=m.useState(!1),[_,x]=m.useState(!1),[b,E]=m.useState(!1),{containerRef:C,onKeyDown:R,onCloseAutoFocus:A}=YM({onDismiss:()=>j(!1)}),M=GJ(s,i);if(r.isPending)return S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(l3,{className:"h-8 w-8 rounded-full"}),S.jsx(l3,{className:"h-3.5 w-16"})]});const I=CO(s,i),T=(s==null?void 0:s.trim())||null,L=(i==null?void 0:i.trim())||null,D=async()=>{E(!0);try{const Z=await hc("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!Z.ok)throw new Error(`Logout failed: ${Z.status}`)}catch(Z){qJ.warn("Logout request failed",Z),Pt.error("Could not log out. Please try again."),E(!1);return}window.location.reload()};let B="Log in";o&&(B=I||"Account"),r.error&&!r.data&&(B="Account unavailable");const j=Z=>{g(Z),l==null||l.capture(`visual_editor_account_menu_${Z?"opened":"closed"}`,{is_authenticated:o})};return S.jsxs(S.Fragment,{children:[S.jsxs(bb,{open:p,onOpenChange:j,children:[S.jsx(Sb,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:M||S.jsx(cq,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:B})]})}),S.jsx(kb,{children:S.jsxs(Eb,{"data-rivet-private":!0,ref:C,onKeyDown:R,onCloseAutoFocus:A,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[T||L?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[T?S.jsx("div",{className:"text-content truncate text-sm font-medium",children:T}):null,L?S.jsx("div",{className:"text-content-muted truncate text-xs",children:L}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{j(!1),w(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(XT,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{j(!1),x(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[S.jsx(eq,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:D,disabled:b,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(aq,{className:"h-4 w-4",weight:"bold"}),b?"Logging out…":"Log out"]}):null,!o&&!r.error?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[S.jsx(oq,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?S.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?S.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?S.jsx(gx,{isOpen:!0,onClose:()=>w(!1)}):null,S.jsx(WJ,{isOpen:_,onClose:()=>x(!1),contactEmail:i??void 0})]})},YJ=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(AJ,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(aJ,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:S.jsx(KJ,{side:"top",align:"start"})})]});async function XJ(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const u3=Ps("useServerConfig"),PO=[250,500,1e3,2e3,4e3],d3=PO.length+1,QJ=async()=>{var n;const t=await fetch("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},JJ=()=>{const[t,e]=m.useState(null),[n,r]=m.useState(!0),[s,i]=m.useState(null),o=m.useCallback(async()=>{try{r(!0),i(null);const l=await XJ(QJ,{delaysMs:PO,onRetry:(u,d,f)=>{u3.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,u)}});return e(l),l}catch(l){const u=l instanceof Error?l.message:"Failed to fetch server config";throw i(u),u3.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},eee="#1C1C20",po=[118,118,124],f3=.85,tee=3,nee=.15,O0=36,ree=4.4,see=.7,iee=3.5,oee=.8,h3=9,aee=11,lee=[1.35,1.12,.95,.85],cee=[0,1.1,2.3,3.1],uee=[0,.35,.16,.13],dee=[.9,.5,.4,.35],Al=3,r_=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],L0=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},lm=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Tl=(t,e)=>(Math.round(t/e-.5)+.5)*e,fee=Math.sin(Math.PI/3),p3=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*fee;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},hee=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-h3}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-h3}return lm(.5-r/(2*aee))},RO=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=vt(sO),r=m.useRef(null),s=m.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(B=>B+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=O0,g=O0,v=null,w=null,_=0,x=-1;const b=new Array(33),E=B=>{const j=Math.round(B*32);let K=b[j];if(!K){const U=j/32,H=Math.round(po[0]+(255-po[0])*U),Z=Math.round(po[1]+(255-po[1])*U),Q=Math.round(po[2]+(255-po[2])*U);K=`rgba(${H}, ${Z}, ${Q}, ${f3})`,b[j]=K}return K},C=B=>{const j=1-.35*B,K=Math.round(po[0]*j),U=Math.round(po[1]*j),H=Math.round(po[2]*j);return`rgba(${K}, ${U}, ${H}, ${f3})`},R=B=>{let j=Math.floor(Math.random()*r_.length);j===x&&(j=(j+1)%r_.length),x=j;const K=[0,0,0,0],U=r_[j].map((N,X)=>{const ie=N.level,ne=K[ie]++,oe=cee[ie]+ne*uee[ie],fe=dee[ie]+L0(j*131+X*17+5)*.2;if(N.hline){const ae=Tl((N.y??0)*f,g);return{hline:!0,x1:Tl(N.x1*d,p),x2:Tl(N.x2*d,p),y1:ae,y2:ae,level:ie,start:oe,dur:fe}}const xe=Tl(N.x1*d,p),de=Tl((N.y1??0)*f,g);return{hline:!1,x1:xe,y1:de,x2:Math.max(Tl(N.x2*d,p),xe+p),y2:Math.max(Tl((N.y2??0)*f,g),de+g),level:ie,start:oe,dur:fe}}),H=U.reduce((N,X)=>Math.max(N,X.start+X.dur),0),Z=u.length,Q=new Float32Array(Z*Al),z=new Int16Array(Z*Al).fill(-1),ee=new Uint8Array(Z),W=U[0];for(let N=0;N<Z;N++){const X=u[N];X.x>W.x1&&X.x<W.x2&&X.y>W.y1&&X.y<W.y2&&(ee[N]=1);const ie=N*Al;for(let ne=0;ne<U.length;ne++){const oe=hee(X.x,X.y,U[ne]);if(oe<=.02)continue;let fe=ie;for(let xe=ie;xe<ie+Al;xe++){if(z[xe]===-1){fe=xe;break}Q[xe]<Q[fe]&&(fe=xe)}(z[fe]===-1||oe>Q[fe])&&(Q[fe]=oe,z[fe]=ne)}}return{startT:B,buildEnd:H,els:U,frame:W,cellQ:Q,cellEl:z,inFrame:ee}},A=()=>{const B=i.getBoundingClientRect();d=Math.max(1,B.width),f=Math.max(1,B.height);const j=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*j),i.height=Math.round(f*j),o.setTransform(j,0,0,j,0,0);const K=Math.max(8,Math.round(d/O0)),U=Math.max(6,Math.round(f/O0));p=d/K,g=f/U,u=[];for(let H=0;H<U;H++){const Z=U>1?H/(U-1):.5,Q=ree*(1+see*.4*(Z*2-1));for(let z=0;z<K;z++){const ee=H*8191+z*131+1,W={x:(z+.5)*p,y:(H+.5)*g,size:Q,seed:ee,phase:L0(ee),kind:0};W.kind=Math.floor(L0(ee*97)*3),u.push(W)}}w=null,v=null},M=new Float32Array(32),I=B=>{o.fillStyle=eee,o.fillRect(0,0,d,f),v||(v=R(B+.2)),B>=v.startT+v.buildEnd+iee&&(w=v,_=B,v=R(B+.2));let j=0;w&&(j=1-lm((B-_)/oee),j<=0&&(w=null));const K=v;for(let W=0;W<K.els.length;W++){const N=K.els[W];M[W]=lm(Math.min(1,Math.max(0,(B-K.startT-N.start)/N.dur)))}const U=M[0],H=C(0),Z=C(U),Q=j>0?C(j):H,z=j>0?C(Math.max(U,j)):Z,ee=u.length;for(let W=0;W<ee;W++){const N=u[W];let X=0,ie=0;const ne=W*Al;for(let Ce=ne;Ce<ne+Al;Ce++){const Ge=K.cellEl[Ce];if(Ge<0)break;const dt=K.cellQ[Ce]*M[Ge];dt>X&&(X=dt,ie=K.els[Ge].level)}if(w)for(let Ce=ne;Ce<ne+Al;Ce++){const Ge=w.cellEl[Ce];if(Ge<0)break;const dt=w.cellQ[Ce]*j;dt>X&&(X=dt,ie=w.els[Ge].level)}const oe=B/tee+N.phase,fe=Math.floor(oe),xe=oe-fe,de=lm(Math.min(xe,1-xe)/nee),ae=Math.floor(L0(N.seed*97+fe*7919)*3);ae!==N.kind&&X<.02&&de<.05&&(N.kind=ae);const Oe=Math.max(de*(1-X),X);if(!(Oe<.01))if(X<.02){const Ce=K.inFrame[W]===1,Ge=w?w.inFrame[W]===1:!1;Ce?o.fillStyle=Ge?z:Z:o.fillStyle=Ge?Q:H;const dt=Math.max(Ce?U:0,Ge?j:0);p3(o,N.kind,N.x,N.y,N.size*Oe*(1-.2*dt))}else{o.fillStyle=E(X);const Ce=1+(lee[ie]-1)*X;p3(o,N.kind,N.x,N.y,N.size*Oe*Ce)}}};A();let T=0;if(l)v=R(-100),I(0);else{const B=performance.now(),j=K=>{I((K-B)/1e3),T=requestAnimationFrame(j)};T=requestAnimationFrame(j)}const L=new ResizeObserver(()=>{A(),l&&(v=R(-100),I(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(T),L.disconnect(),e&&n(B=>B-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},pee=async(t=null)=>{if(t)return mee(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return N0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return N0()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:N0()},AO=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},mee=t=>AO(t),N0=()=>AO("/"),s_=Ps("usePreviewUpstreamHealth"),gee=500,vee=4e3,yee=15e3,_ee=3,xee=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??gee,i=e.probeMsWhileUp??vee,o=e.firstUnreachableCaptureAfterMs??yee,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=m.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[p,g]=m.useState(t==="static"),[v,w]=m.useState(0),[_,x]=m.useState(null),[b,E]=m.useState(0),[C,R]=m.useState(!1),[A,M]=m.useState(!1),[I,T]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){g(!0),x(null),E(0),R(!1),M(!0),T(null);return}if(d){g(!1),x(null),E(0),R(!1),M(!0),T("upstream_unreachable"),n.current=null;return}let L=!0;const D=Date.now();x(D),E(0),R(!1),g(!1),M(!1),T("upstream_unreachable");const B={current:!1},j={current:!1},K={current:!1},U={current:null},H={current:!1},Z={current:!1},Q={current:0},z={current:!1},ee={current:null};let W=null;const N=()=>{K.current||(K.current=!0,L&&M(!0))},X=()=>{W!==null&&(clearTimeout(W),W=null)},ie=(oe,fe)=>{X(),W=setTimeout(fe,oe)},ne=async()=>{var dt;if(!L)return;E(Lt=>Lt+1);const{isOk:oe,unavailableReason:fe,upstreamStatus:xe}=await pee(u);if(!L)return;N(),ee.current=xe;const de=oe&&xe!==null&&xe>=500;de&&Z.current?Q.current+=1:oe&&!de&&(Q.current=0);const ae=Q.current>=_ee;if(ae&&!z.current&&xe!==null&&(z.current=!0,Ee==null||Ee.capture("preview_upstream_error_responses",{framework:t,upstream_status:xe,consecutive_count:Q.current}),s_.warn(`Preview upstream is listening but has served ${Q.current} consecutive ${xe} responses`),(dt=f.current)==null||dt.call(f,{upstreamStatus:xe,consecutiveCount:Q.current})),oe&&!ae){de||(Z.current=!0,z.current=!1);const Lt=!H.current;H.current=!0,g(!0),T(null),U.current=null,j.current=!1,R(!1),B.current?Lt&&(Ee==null||Ee.capture("preview_upstream_restored",{framework:t})):(B.current=!0,Ee==null||Ee.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),ie(i,ne);return}const Ce=H.current;H.current=!1,g(!1),T(fe),U.current===null&&(U.current=Date.now(),j.current=!1,R(!1)),Ce&&(Ee==null||Ee.capture("preview_upstream_lost",{framework:t,upstream_status:xe}),w(Lt=>Lt+1),s_.warn("Preview upstream became unavailable after it was ready"));const Ge=Date.now()-U.current;Ge>=o&&!j.current&&(j.current=!0,R(!0),Ee==null||Ee.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ge,upstream_status:ee.current}),s_.warn("Dev server did not become ready within timeout window")),ie(s,ne)};return n.current=()=>ie(0,ne),ie(0,ne),()=>{L=!1,n.current=null,X()}},[t,s,i,o,u,d]),m.useEffect(()=>{var D;if(t==="static"||l===void 0)return;const L=r.current;r.current=l,L!==null&&L!==l&&((D=n.current)==null||D.call(n))},[t,l]),{isUpstreamReady:p,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:A,unavailableReason:I}};function wee(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const TO=t=>{var e;return t!=="embedded"||typeof window>"u"?"":((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.previewOrigin)??`${window.location.protocol}//localhost:${window.location.port}`},IO=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${TO(t)}${e}`:e,bee="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",See=t=>bee,kee=Ps("PreviewSurface"),m3=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",MO=({target:t,src:e,framework:n,remountKey:r})=>(lt(Ug),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:See(),onLoad:()=>{Ee==null||Ee.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:m3(e,t),framework:n}))},onError:()=>{Ee==null||Ee.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:m3(e,t),framework:n})),kee.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),Eee=m.lazy(()=>aP(()=>Promise.resolve().then(()=>one),void 0)),Cee={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},Pee={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Ree={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Eu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:p=!1,className:g=""})=>{const v=m.useCallback(_=>{_&&d&&(Ee==null||Ee.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),w=!!(e||n||r||u||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${Cee[o]} ${g}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,w?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:Pee[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:Ree[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},vx=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Eu,{...r,size:n,busy:!0,backdrop:S.jsx(RO,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Eu,{...r,size:n,busy:!0,backdrop:S.jsx(m.Suspense,{fallback:null,children:S.jsx(Eee,{className:"absolute inset-0"})})}):S.jsx(Eu,{...r,size:n,busy:!0,media:S.jsx(Mg,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),OO=({icon:t,...e})=>S.jsx(Eu,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Ab=t=>S.jsx(Eu,{...t,tone:"error",role:"alert"}),g3="/static/",Aee=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(g3)}catch{return t.endsWith(g3)}},Tee=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="dependency_install_failed"?"The direction is saved, but its dependencies couldn’t be prepared. Fix the installation error, then retry the preview.":t==="compile_error"?"The direction is saved, but its app couldn’t compile. Fix the app error, then retry the preview.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",Iee=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"?{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:Tee(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,Mee=({issue:t,retryTarget:e})=>{const n=Vo(),r=m.useRef(!1),[s,i]=m.useState(!1),[o,l]=m.useState(null),u=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const d=await fetch(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!d.ok){const f=await d.json().catch(()=>({}));throw new Error(f.message??"The preview could not restart. Try again.")}}catch(d){l(d instanceof Error?d.message:"The preview could not restart. Try again.")}finally{r.current=!1,i(!1)}}};return S.jsxs(Eu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:e&&!s?[{label:"Retry preview",onClick:()=>void u()}]:void 0,children:[s?S.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?S.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null]})},Oee=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var rt;const r=lt(lx),s=vt(lx),i=lt(ag),o=vt(ag),l=lt(Gh),u=lt(zg),d=lt(Ug),f=lt(cx),p=lt(ux),g=lt(iO),v=lt(oO),w=vt(ux),_=lt($o),x=lt(am),b=vt(cx),E=l.active&&l.projectContext.kind==="fresh",C=lt(dx),R=l.active?l.variants.find(Be=>Be.workItemId===C&&(Be.status==="pending"||Be.status==="running"||Be.status==="succeeded"&&!Be.preview&&typeof Be.port!="number"&&(!Be.previewUnavailable||Be.previewUnavailable.reason==="idle_timeout")))??null:null,A=l.active&&l.variants.some(Be=>Be.status==="pending"||Be.status==="running"),M=E||A,I=l.active?l.variants.find(Be=>Be.workItemId===C)??null:null,T=I?Iee(I):null,L=e==="static"&&i!==null&&Aee(i);m.useEffect(()=>{l.active||b(!1)},[l.active,b]);const D=m.useRef(!1);m.useEffect(()=>{const Be=!!(_!=null&&_.left||_!=null&&_.right),Me=Be&&!D.current;D.current=Be;const pt=l.active?l.sessionId:null;!pt||!wee({enteringSplit:Me,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:f&&p!==null})||(b(!1),w(null),s(An=>An+1),fetch(`/api/variants/${encodeURIComponent(pt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[_,l,f,p,b,w,s]);const j=m.useMemo(()=>{var Pe;if(f||i&&!L||!l.active)return null;const{stage:Be,variants:Me}=l,pt=Be==="ready"||Be==="degraded",An=Me.some(Jn=>{var Xt,Tn;return((Xt=Jn.refinement)==null?void 0:Xt.status)==="pending"||((Tn=Jn.refinement)==null?void 0:Tn.status)==="running"});if(!pt&&!An)return null;const $t=Me.find(Jn=>{var Xt;return Jn.status==="succeeded"&&((Xt=Jn.preview)==null?void 0:Xt.kind)==="static_artifact"});return((Pe=$t==null?void 0:$t.preview)==null?void 0:Pe.kind)==="static_artifact"?$t.preview.url:null},[L,i,f,l])??i,K=m.useMemo(()=>!l.active||!j?null:l.variants.find(Be=>{var Me;return((Me=Be.preview)==null?void 0:Me.kind)==="static_artifact"&&j.startsWith(Be.preview.url)})??null,[j,l]),U=m.useMemo(()=>{if((x==null?void 0:x.previewKind)==="static")return{kind:"variant",sessionId:x.sessionId,variantId:x.variantId};if(!l.active)return og;if(K)return{kind:"variant",sessionId:l.sessionId,variantId:K.workItemId};if(j){const Me=j.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),pt=Me!=null&&Me[1]?decodeURIComponent(Me[1]):null,An=Me!=null&&Me[2]?decodeURIComponent(Me[2]):null;if(pt===l.sessionId&&An&&l.variants.some(Jn=>Jn.workItemId===An))return{kind:"variant",sessionId:l.sessionId,variantId:An};const $t=j.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Pe=$t!=null&&$t[1]?decodeURIComponent($t[1]):null;if(Pe&&l.variants.some(Jn=>Jn.workItemId===Pe))return{kind:"variant",sessionId:l.sessionId,variantId:Pe}}const Be=!!(_!=null&&_.left||_!=null&&_.right);return(!Be||E)&&!j&&f&&p&&l.variants.some(Me=>Me.workItemId===p)?{kind:"variant",sessionId:l.sessionId,variantId:p}:(!Be||E)&&!j&&C&&l.variants.some(Me=>Me.workItemId===C)?{kind:"variant",sessionId:l.sessionId,variantId:C}:og},[x,K,l,f,p,j,_,E,C]),H=m.useRef(null);m.useEffect(()=>{var An,$t;if(!K||((An=K.preview)==null?void 0:An.kind)!=="static_artifact"||(($t=K.refinement)==null?void 0:$t.status)!=="succeeded")return;const Be=`${K.workItemId}:${K.refinement.workItemId}`;if(H.current===Be)return;H.current=Be;const Me=K.preview.url.includes("?")?"&":"?",pt=`${K.preview.url}${Me}refinement=${encodeURIComponent(K.refinement.workItemId)}`;j!==pt&&(o(pt),s(Pe=>Pe+1))},[j,K,s,o,l]);const Z=j!==null&&QQ(j),Q=j!==null&&!Z||E&&!f&&!Z,{isUpstreamReady:z,iframeRemountKey:ee,probeAttemptCount:W,initialProbeComplete:N}=xee(e,{rerunProbeImmediatelyOnVersion:r,probePath:Z?j:null,skip:Q}),[X,ie]=m.useState(()=>g&&z?r:null),ne=m.useRef(null);m.useEffect(()=>{if(!g){ne.current=null,ie(null);return}if(X===r){ne.current=null;return}const Be=ne.current;if(!Be||Be.remountKey!==r){ne.current={remountKey:r,probeAttemptCount:W};return}z&&W>Be.probeAttemptCount&&(ne.current=null,ie(r))},[X,r,g,W,z]);const fe=j!==null&&!Z||z,de=v||g&&X!==r||g&&!fe,ae=`${ee}:${r}`,Oe=hO(window.location.pathname),Ce=e==="static"?`/static${Oe??"/"}`:Oe??"/",Ge=TO(d);let dt=null;j&&(dt=IO({agentApplyMode:d,url:j}));const Kt=R||T||de?"about:blank":(Z&&!fe?"about:blank":dt)??(fe?`${Ge}${Ce}`:"about:blank"),_t=R??(l.active&&U.kind==="variant"&&U.sessionId===l.sessionId?l.variants.find(Be=>Be.workItemId===U.variantId):void 0),ht=x?x.references:_t==null?void 0:_t.references,En=(x==null?void 0:x.sessionId)??(l.active?l.sessionId:null),kt=(x==null?void 0:x.variantId)??(_t==null?void 0:_t.workItemId),Yt=!!R||!!T||!fe&&N;let Le=null;if(de)Le=S.jsx(vx,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(R)Le=S.jsx(vx,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(T){const Be=l.active&&I&&T.state==="preview_unavailable"&&((rt=I.previewUnavailable)==null?void 0:rt.reason)!=="missing_static_entry"?{sessionId:l.sessionId,variantId:I.workItemId}:void 0;Le=S.jsx(Mee,{issue:T,retryTarget:Be},I==null?void 0:I.workItemId)}else Yt&&(Le=M?S.jsx(OO,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Ab,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return S.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:[ht!=null&&ht.length?S.jsx("div",{className:"border-divider bg-main shrink-0 border-b px-6 pt-3",children:S.jsx(kI,{references:ht,source:x?"history":"active",sessionId:En,variantId:kt,projectPath:(x==null?void 0:x.projectPath)??u,className:"flex-wrap overflow-x-visible pr-0"})}):null,S.jsxs("div",{className:"relative min-h-0 flex-1",children:[Le,S.jsx(MO,{target:U,src:Kt,framework:e,remountKey:ae})]})]})};function v3({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=lt($o),u=vt($o),d=Vo(),f=lt(Gh),p=lt(Ug),g=m.useRef(!1),v=m.useCallback(()=>{g.current||(g.current=!0,td({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=m.useCallback(()=>{if(o){u(null);const I=lg("ended",l);d==null||d.capture(I.event,I.properties);return}v();const R={...l};delete R[t];const A=R.left||R.right?R:null;u(A);const M=lg(A?"updated":"ended",A??l);d==null||d.capture(M.event,M.properties)},[o,d,u,t,l,v]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(R=>R.workItemId===n)??null,[e,n,f]),b=m.useMemo(()=>{var A,M;let R=r;if(((A=x==null?void 0:x.preview)==null?void 0:A.kind)==="static_artifact"&&((M=x.refinement)==null?void 0:M.status)==="succeeded"){const I=x.preview.url.includes("?")?"&":"?";R=`${x.preview.url}${I}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return IO({agentApplyMode:p,url:R})},[p,x,r]),E=((C=x==null?void 0:x.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(fc,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(MO,{target:_,src:b,framework:"static",remountKey:E})})]})}function Lee(){const t=lt(ed),e=lt(Cb);return!t||!e?null:Uh.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function Nee(){const t=lt(ed),e=lt(Cb),n=lt($o),r=vt(ed),s=vt($o),i=Vo(),o=m.useRef(null),[l,u]=m.useState(null),[d,f]=m.useState("hidden");m.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const p=m.useCallback((v,w)=>{const _=o.current;if(!_)return null;const x=_.getBoundingClientRect();return v<x.left||v>x.right||w<x.top||w>x.bottom?null:v<(x.left+x.right)/2?"left":"right"},[]);if(m.useEffect(()=>{if(!t||!e)return;const v=p(e.x,e.y);u(w=>w===v?w:v),f(w=>{if(w==="exiting")return w;const _=v!==null?"visible":"hidden";return w===_?w:_})},[t,e,p]),m.useEffect(()=>{if(!t)return;const v=w=>{const _=p(w.clientX,w.clientY);if(_&&t.url){const x={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==x.sessionId||b.variantId!==x.variantId)&&td(b);const E={...n??{},[_]:x};s(E);const C=lg(n?"updated":"started",E);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else td(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,p,i,r,s,n]),!t)return null;const g=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:g,"aria-hidden":"true",children:[S.jsx(y3,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(y3,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function y3({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const LO=(t,e,n)=>{var i,o;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(l=>l.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((o=r.refinement)==null?void 0:o.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},_3=(t,e)=>{if(!t)return;const n=LO(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},Dee=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(RO,{trackGlobalLoaderCount:!1})})}),$ee=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=JJ();return m.useEffect(()=>{r().catch(o=>{Ee==null||Ee.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:d3})})},[r]),s?S.jsx(Dee,{}):i||!n?S.jsx(Ab,{fill:"surface",size:"sm",state:"preview_config_error",title:"Couldn't load preview",description:"We couldn't load the preview configuration.",actions:[{label:"Retry",onClick:()=>{Ee==null||Ee.capture("preview_config_retry_clicked"),r().catch(o=>{Ee==null||Ee.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:d3})})}}]}):S.jsx(jee,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function jee(t){const e=lt($o),n=lt(ed),r=lt(Gh),s=lt(ag),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var A,M;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(A=i??o)==null?void 0:A.variantId,x=r.variants.filter(I=>{var T;return I.status==="succeeded"&&((T=I.preview)==null?void 0:T.kind)==="static_artifact"&&I.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=x.find(I=>{var T;return((T=I.preview)==null?void 0:T.kind)==="static_artifact"&&I.preview.url===b})??x[0];if(((M=C==null?void 0:C.preview)==null?void 0:M.kind)!=="static_artifact")return;const R=LO(r,r.sessionId,C.workItemId);if(R)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:R,source:"live"}},[r,i,o,s]),u=_3(i,r)??(o?l:void 0),d=_3(o,r)??(i?l:void 0),f=!i&&!!u,p=!o&&!!d,g=!!(u||d),v=S.jsx(Oee,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${g?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&S.jsx(v3,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),!(u&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:v}),d&&S.jsx(v3,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(Nee,{}),S.jsx(Lee,{})]})})}function wo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function NO(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
145
+ * GSAP 3.15.0
146
+ * https://gsap.com
147
+ *
148
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
149
+ * Subject to the terms at https://gsap.com/standard-license
150
+ * @author: Jack Doyle, jack@greensock.com
151
+ */var bs={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Sh={duration:.5,overwrite:!1,delay:0},Tb,vr,pn,Us=1e8,Zt=1/Us,yx=Math.PI*2,Fee=yx/4,Vee=0,DO=Math.sqrt,Hee=Math.cos,zee=Math.sin,lr=function(e){return typeof e=="string"},Rn=function(e){return typeof e=="function"},jo=function(e){return typeof e=="number"},Ib=function(e){return typeof e>"u"},Gi=function(e){return typeof e=="object"},Jr=function(e){return e!==!1},Mb=function(){return typeof window<"u"},D0=function(e){return Rn(e)||lr(e)},$O=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Cr=Array.isArray,Bee=/random\([^)]+\)/g,Uee=/,\s*/g,x3=/(?:-?\.?\d|\.)+/gi,jO=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,yu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,i_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,FO=/[+-]=-?[.\d]+/,Zee=/[^,'"\[\]\s]+/gi,Wee=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Sn,Mi,_x,Ob,Es={},ug={},VO,HO=function(e){return(ug=rd(e,Es))&&rs},Lb=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},kh=function(e,n){return!n&&console.warn(e)},zO=function(e,n){return e&&(Es[e]=n)&&ug&&(ug[e]=n)||Es},Eh=function(){return 0},qee={suppressEvents:!0,isStart:!0,kill:!1},cm={suppressEvents:!0,kill:!1},Gee={suppressEvents:!0},Nb={},Da=[],xx={},BO,ms={},o_={},w3=30,um=[],Db="",$b=function(e){var n=e[0],r,s;if(Gi(n)||Rn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=um.length;s--&&!um[s].targetTest(n););r=um[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new d9(e[s],r)))||e.splice(s,1);return e},rc=function(e){return e._gsap||$b(Zs(e))[0]._gsap},UO=function(e,n,r){return(r=e[n])&&Rn(r)?e[n]():Ib(r)&&e.getAttribute&&e.getAttribute(n)||r},es=function(e,n){return(e=e.split(",")).forEach(n)||e},Ln=function(e){return Math.round(e*1e5)/1e5||0},bn=function(e){return Math.round(e*1e7)/1e7||0},Cu=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},Kee=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},dg=function(){var e=Da.length,n=Da.slice(0),r,s;for(xx={},Da.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},jb=function(e){return!!(e._initted||e._startAt||e.add)},ZO=function(e,n,r,s){Da.length&&!vr&&dg(),e.render(n,r,!!(vr&&n<0&&jb(e))),Da.length&&!vr&&dg()},WO=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(Zee).length<2?n:lr(e)?e.trim():e},qO=function(e){return e},Cs=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},Yee=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},rd=function(e,n){for(var r in n)e[r]=n[r];return e},b3=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=Gi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},fg=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Zf=function(e){var n=e.parent||Sn,r=e.keyframes?Yee(Cr(e.keyframes)):Cs;if(Jr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Xee=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},GO=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},Wg=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},qa=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},sc=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},Qee=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},wx=function(e,n,r,s){return e._startAt&&(vr?e._startAt.revert(cm):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Jee=function t(e){return!e||e._ts&&t(e.parent)},S3=function(e){return e._repeat?sd(e._tTime,e=e.duration()+e._rDelay)*e:0},sd=function(e,n){var r=Math.floor(e=bn(e/n));return e&&r===e?r-1:r},hg=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},qg=function(e){return e._end=bn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Zt)||0))},Gg=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=bn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),qg(e),r._dirty||sc(r,e)),e},KO=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=hg(e.rawTime(),n),(!n._dur||Kh(0,n.totalDuration(),r)-n._tTime>Zt)&&n.render(r,!0)),sc(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Zt}},ji=function(e,n,r,s){return n.parent&&qa(n),n._start=bn((jo(r)?r:r||e!==Sn?Vs(e,r,n):e._time)+n._delay),n._end=bn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),GO(e,n,"_first","_last",e._sort?"_start":0),bx(n)||(e._recent=n),s||KO(e,n),e._ts<0&&Gg(e,e._tTime),e},YO=function(e,n){return(Es.ScrollTrigger||Lb("scrollTrigger",n))&&Es.ScrollTrigger.create(n,e)},XO=function(e,n,r,s,i){if(Vb(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!vr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&BO!==vs.frame)return Da.push(e),e._lazy=[i,s],1},ete=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},bx=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},tte=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&ete(e)&&!(!e._initted&&bx(e))||(e._ts<0||e._dp._ts<0)&&!bx(e))?0:1,l=e._rDelay,u=0,d,f,p;if(l&&e._repeat&&(u=Kh(0,e._tDur,n),f=sd(u,l),e._yoyo&&f&1&&(o=1-o),f!==sd(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||vr||s||e._zTime===Zt||!n&&e._zTime){if(!e._initted&&XO(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?Zt:0),r||(r=n&&!p),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&wx(e,n,r,!0),e._onUpdate&&!r&&ys(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&ys(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&qa(e,1),!r&&!vr&&(ys(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},nte=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},id=function(e,n,r,s){var i=e._repeat,o=bn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:bn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&Gg(e,e._tTime=e._tDur*l),e.parent&&qg(e),r||sc(e.parent,e),e},k3=function(e){return e instanceof Kr?sc(e):id(e,e._dur)},rte={_start:0,endTime:Eh,totalDuration:Eh},Vs=function t(e,n,r){var s=e.labels,i=e._recent||rte,o=e.duration()>=Us?i.endTime(!1):e._dur,l,u,d;return lr(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(Cr(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},Wf=function(e,n,r){var s=jo(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=Jr(u.vars.inherit)&&u.parent;o.immediateRender=Jr(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Un(n[0],o,n[i+1])},nl=function(e,n){return e||e===0?n(e):n},Kh=function(e,n,r){return r<e?e:r>n?n:r},kr=function(e,n){return!lr(e)||!(n=Wee.exec(e))?"":n[1]},ste=function(e,n,r){return nl(r,function(s){return Kh(e,n,s)})},Sx=[].slice,QO=function(e,n){return e&&Gi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&Gi(e[0]))&&!e.nodeType&&e!==Mi},ite=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return lr(s)&&!n||QO(s,1)?(i=r).push.apply(i,Zs(s)):r.push(s)})||r},Zs=function(e,n,r){return pn&&!n&&pn.selector?pn.selector(e):lr(e)&&!r&&(_x||!od())?Sx.call((n||Ob).querySelectorAll(e),0):Cr(e)?ite(e,r):QO(e)?Sx.call(e,0):e?[e]:[]},kx=function(e){return e=Zs(e)[0]||kh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Zs(n,r.querySelectorAll?r:r===e?kh("Invalid scope")||Ob.createElement("div"):e)}},JO=function(e){return e.sort(function(){return .5-Math.random()})},e9=function(e){if(Rn(e))return e;var n=Gi(e)?e:{each:e},r=ic(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,p=s;return lr(s)?f=p={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],p=s[1]),function(g,v,w){var _=(w||n).length,x=o[_],b,E,C,R,A,M,I,T,L;if(!x){if(L=n.grid==="auto"?0:(n.grid||[1,Us])[1],!L){for(I=-Us;I<(I=w[L++].getBoundingClientRect().left)&&L<_;);L<_&&L--}for(x=o[_]=[],b=u?Math.min(L,_)*f-.5:s%L,E=L===Us?0:u?_*p/L-.5:s/L|0,I=0,T=Us,M=0;M<_;M++)C=M%L-b,R=E-(M/L|0),x[M]=A=d?Math.abs(d==="y"?R:C):DO(C*C+R*R),A>I&&(I=A),A<T&&(T=A);s==="random"&&JO(x),x.max=I-T,x.min=T,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(L>_?_-1:d?d==="y"?_/L:L:Math.max(L,_/L))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=kr(n.amount||n.each)||0,r=r&&_<0?yte(r):r}return _=(x[g]-x.min)/x.max||0,bn(x.b+(r?r(_):_)*x.v)+x.u}},Ex=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=bn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(jo(r)?0:kr(r))}},t9=function(e,n){var r=Cr(e),s,i;return!r&&Gi(e)&&(s=r=e.radius||Us,e.values?(e=Zs(e.values),(i=!jo(e[0]))&&(s*=s)):e=Ex(e.increment)),nl(n,r?Rn(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Us,f=0,p=e.length,g,v;p--;)i?(g=e[p].x-l,v=e[p].y-u,g=g*g+v*v):g=Math.abs(e[p]-l),g<d&&(d=g,f=p);return f=!s||d<=s?e[f]:o,i||f===o||jo(o)?f:f+kr(o)}:Ex(e))},n9=function(e,n,r,s){return nl(Cr(e)?!n:r===!0?!!(r=0):!s,function(){return Cr(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},ote=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},ate=function(e,n){return function(r){return e(parseFloat(r))+(n||kr(r))}},lte=function(e,n,r){return s9(e,n,0,1,r)},r9=function(e,n,r){return nl(r,function(s){return e[~~n(s)]})},cte=function t(e,n,r){var s=n-e;return Cr(e)?r9(e,t(0,e.length),n):nl(r,function(i){return(s+(i-e)%s)%s+e})},ute=function t(e,n,r){var s=n-e,i=s*2;return Cr(e)?r9(e,t(0,e.length-1),n):nl(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Ch=function(e){return e.replace(Bee,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(Uee);return n9(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},s9=function(e,n,r,s,i){var o=n-e,l=s-r;return nl(i,function(u){return r+((u-e)/o*l||0)})},dte=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=lr(e),l={},u,d,f,p,g;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Cr(e)&&!Cr(n)){for(f=[],p=e.length,g=p-2,d=1;d<p;d++)f.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(g,~~w);return f[_](w-_)},r=n}else s||(e=rd(Cr(e)?[]:{},e));if(!f){for(u in n)Fb.call(l,e,u,"get",n[u]);i=function(w){return Bb(w,l)||(o?e.p:e)}}}return nl(r,i)},E3=function(e,n,r){var s=e.labels,i=Us,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},ys=function(e,n,r){var s=e.vars,i=s[n],o=pn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&Da.length&&dg(),l&&(pn=l),f=u?i.apply(d,u):i.call(d),pn=o,f},kf=function(e){return qa(e),e.scrollTrigger&&e.scrollTrigger.kill(!!vr),e.progress()<1&&ys(e,"onInterrupt"),e},_u,i9=[],o9=function(e){if(e)if(e=!e.name&&e.default||e,Mb()||e.headless){var n=e.name,r=Rn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Eh,render:Bb,add:Fb,kill:Rte,modifier:Pte,rawVars:0},o={targetTest:0,get:0,getSetter:zb,aliases:{},register:0};if(od(),e!==s){if(ms[n])return;Cs(s,Cs(fg(e,i),o)),rd(s.prototype,rd(i,fg(e,o))),ms[s.prop=n]=s,e.targetTest&&(um.push(s),Nb[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}zO(n,s),e.register&&e.register(rs,s,ts)}else i9.push(e)},Ut=255,Ef={aqua:[0,Ut,Ut],lime:[0,Ut,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ut],navy:[0,0,128],white:[Ut,Ut,Ut],olive:[128,128,0],yellow:[Ut,Ut,0],orange:[Ut,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ut,0,0],pink:[Ut,192,203],cyan:[0,Ut,Ut],transparent:[Ut,Ut,Ut,0]},a_=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*Ut+.5|0},a9=function(e,n,r){var s=e?jo(e)?[e>>16,e>>8&Ut,e&Ut]:0:Ef.black,i,o,l,u,d,f,p,g,v,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Ef[e])s=Ef[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&Ut,s&Ut,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Ut,e&Ut]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(x3),!n)u=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=a_(u+1/3,i,o),s[1]=a_(u,i,o),s[2]=a_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(jO),r&&s.length<4&&(s[3]=1),s}else s=e.match(x3)||Ef.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Ut,o=s[1]/Ut,l=s[2]/Ut,p=Math.max(i,o,l),g=Math.min(i,o,l),f=(p+g)/2,p===g?u=d=0:(v=p-g,d=f>.5?v/(2-p-g):v/(p+g),u=p===i?(o-l)/v+(o<l?6:0):p===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},l9=function(e){var n=[],r=[],s=-1;return e.split($a).forEach(function(i){var o=i.match(yu)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},C3=function(e,n,r){var s="",i=(e+s).match($a),o=n?"hsla(":"rgba(",l=0,u,d,f,p;if(!i)return e;if(i=i.map(function(g){return(g=a9(g,n,1))&&o+(n?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),r&&(f=l9(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace($a,"1").split(yu),p=d.length-1;l<p;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split($a),p=d.length-1;l<p;l++)s+=d[l]+i[l];return s+d[p]},$a=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Ef)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),fte=/hsl[a]?\(/,c9=function(e){var n=e.join(" "),r;if($a.lastIndex=0,$a.test(n))return r=fte.test(n),e[1]=C3(e[1],r),e[0]=C3(e[0],r,l9(e[1])),!0},Ph,vs=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,p,g,v,w=function _(x){var b=t()-s,E=x===!0,C,R,A,M;if((b>e||b<0)&&(r+=b-n),s+=b,A=s-r,C=A-o,(C>0||E)&&(M=++p.frame,g=A-p.time*1e3,p.time=A=A/1e3,o+=C+(C>=i?4:i-C),R=1),E||(u=d(_)),R)for(v=0;v<l.length;v++)l[v](A,g,M,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return g/(1e3/(x||60))},wake:function(){VO&&(!_x&&Mb()&&(Mi=_x=window,Ob=Mi.document||{},Es.gsap=rs,(Mi.gsapVersions||(Mi.gsapVersions=[])).push(rs.version),HO(ug||Mi.GreenSockGlobals||!Mi.gsap&&Mi||{}),i9.forEach(o9)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),d=f||function(x){return setTimeout(x,o-p.time*1e3+1|0)},Ph=1,w(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),Ph=0,d=Eh},lagSmoothing:function(x,b){e=x||1/0,n=Math.min(b||33,e)},fps:function(x){i=1e3/(x||240),o=p.time*1e3+i},add:function(x,b,E){var C=b?function(R,A,M,I){x(R,A,M,I),p.remove(C)}:x;return p.remove(x),l[E?"unshift":"push"](C),od(),C},remove:function(x,b){~(b=l.indexOf(x))&&l.splice(b,1)&&v>=b&&v--},_listeners:l},p})(),od=function(){return!Ph&&vs.wake()},bt={},hte=/^[\d.\-M][\d.\-,\s]/,pte=/["']/g,mte=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace(pte,"").trim():+d,s=u.substr(l+1).trim();return n},gte=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},vte=function(e){var n=(e+"").split("("),r=bt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[mte(n[1])]:gte(e).split(",").map(WO)):bt._CE&&hte.test(e)?bt._CE("",e):r},yte=function(e){return function(n){return 1-e(1-n)}},ic=function(e,n){return e&&(Rn(e)?e:bt[e]||vte(e))||n},mc=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return es(e,function(l){bt[l]=Es[l]=i,bt[o=l.toLowerCase()]=r;for(var u in i)bt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=bt[l+"."+u]=i[u]}),i},u9=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},l_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/yx*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*zee((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:u9(l);return i=yx/i,u.config=function(d,f){return t(e,d,f)},u},c_=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:u9(r);return s.config=function(i){return t(e,i)},s};es("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;mc(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});bt.Linear.easeNone=bt.none=bt.Linear.easeIn;mc("Elastic",l_("in"),l_("out"),l_());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};mc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);mc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});mc("Circ",function(t){return-(DO(1-t*t)-1)});mc("Sine",function(t){return t===1?1:-Hee(t*Fee)+1});mc("Back",c_("in"),c_("out"),c_());bt.SteppedEase=bt.steps=Es.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-Zt;return function(l){return((s*Kh(0,o,l)|0)+i)*r}}};Sh.ease=bt["quad.out"];es("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Db+=t+","+t+"Params,"});var d9=function(e,n){this.id=Vee++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:UO,this.set=n?n.getSetter:zb},Rh=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,id(this,+n.duration,1,1),this.data=n.data,pn&&(this._ctx=pn,pn.data.push(this)),Ph||vs.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,id(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(od(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Gg(this,r),!i._dp||i.parent||KO(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&ji(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Zt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),ZO(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+S3(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+S3(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?sd(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Zt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?hg(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Zt?0:this._rts,this.totalTime(Kh(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),qg(this),Qee(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(od(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Zt&&(this._tTime-=Zt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=bn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ji(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Jr(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?hg(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Gee);var s=vr;return vr=r,jb(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),vr=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,k3(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,k3(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(Vs(this,r),Jr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Jr(s)),this._dur||(this._zTime=-Zt),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Zt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Zt,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-Zt)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=Rn(r)?r:qO,u=function(){var f=s.then;s.then=null,i&&i(),Rn(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){kf(this)},t})();Cs(Rh.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Zt,_prom:0,_ps:!1,_rts:1});var Kr=(function(t){NO(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Jr(r.sortChildren),Sn&&ji(r.parent||Sn,wo(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&YO(wo(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Wf(0,arguments,this),this},n.from=function(s,i,o){return Wf(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Wf(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Zf(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Un(s,i,Vs(this,o),1),this},n.call=function(s,i,o){return ji(this,Un.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new Un(s,o,Vs(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,Zf(o).immediateRender=Jr(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,p){return l.startAt=o,Zf(l).immediateRender=Jr(l.immediateRender),this.staggerTo(s,i,l,u,d,f,p)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:bn(s),p=this._zTime<0!=s<0&&(this._initted||!d),g,v,w,_,x,b,E,C,R,A,M,I;if(this!==Sn&&f>u&&s>=0&&(f=u),f!==this._tTime||o||p){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),g=f,R=this._start,C=this._ts,b=!C,p&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(M=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,o);if(g=bn(f%x),f===u?(_=this._repeat,g=d):(A=bn(f/x),_=~~A,_&&_===A&&(g=d,_--),g>d&&(g=d)),A=sd(this._tTime,x),!l&&this._tTime&&A!==_&&this._tTime-A*x-this._dur<=0&&(A=_),M&&_&1&&(g=d-g,I=1),_!==A&&!this._lock){var T=M&&A&1,L=T===(M&&_&1);if(_<A&&(T=!T),l=T?0:f%d?d:f,this._lock=1,this.render(l||(I?0:bn(_*x)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&ys(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(this.invalidate()._lock=1,A=_),l&&l!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,L&&(this._lock=2,l=T?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(E=nte(this,bn(l),bn(g)),E&&(f-=g-(g=E._start))),this._tTime=f,this._time=g,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!A&&(ys(this,"onStart"),this._tTime!==f))return this;if(g>=l&&s>=0)for(v=this._first;v;){if(w=v._next,(v._act||g>=v._start)&&v._ts&&E!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(g-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(g-v._start)*v._ts,i,o),g!==this._time||!this._ts&&!b){E=0,w&&(f+=this._zTime=-Zt);break}}v=w}else{v=this._last;for(var D=s<0?s:g;v;){if(w=v._prev,(v._act||D<=v._end)&&v._ts&&E!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(D-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(D-v._start)*v._ts,i,o||vr&&jb(v)),g!==this._time||!this._ts&&!b){E=0,w&&(f+=this._zTime=D?-Zt:Zt);break}}v=w}}if(E&&!i&&(this.pause(),E.render(g>=l?0:-Zt)._zTime=g>=l?1:-1,this._ts))return this._start=R,qg(this),this.render(s,i,o);this._onUpdate&&!i&&ys(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(R===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&qa(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(ys(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(jo(i)||(i=Vs(this,i,s)),!(s instanceof Rh)){if(Cr(s))return s.forEach(function(l){return o.add(l,i)}),this;if(lr(s))return this.addLabel(s,i);if(Rn(s))s=Un.delayedCall(0,s);else return this}return this!==s?ji(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-Us);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Un?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return lr(s)?this.removeLabel(s):Rn(s)?this.killTweensOf(s):(s.parent===this&&Wg(this,s),s===this._recent&&(this._recent=this._last),sc(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=bn(vs.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=Vs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Un.delayedCall(0,i||Eh,o);return l.data="isPause",this._hasPause=1,ji(this,l,Vs(this,s))},n.removePause=function(s){var i=this._first;for(s=Vs(this,s);i;)i._start===s&&i.data==="isPause"&&qa(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Aa!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Zs(s),u=this._first,d=jo(i),f;u;)u instanceof Un?Kee(u._targets,l)&&(d?(!Aa||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Vs(o,s),u=i,d=u.startAt,f=u.onStart,p=u.onStartParams,g=u.immediateRender,v,w=Un.to(o,Cs({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||Zt,onStart:function(){if(o.pause(),!v){var x=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());w._dur!==x&&id(w,x,0,1).render(w._time,!0,!0),v=1}f&&f.apply(w,p||[])}},i));return g?w.render(0):w},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Cs({startAt:{time:Vs(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),E3(this,Vs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),E3(this,Vs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Zt)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=bn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return sc(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),sc(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Us,d,f,p;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(p=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,ji(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!p&&!o._dp||p&&p.smoothChildTiming)&&(o._start+=bn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;id(o,o===Sn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(Sn._ts&&(ZO(Sn,hg(s,Sn)),BO=vs.frame),vs.frame>=w3){w3+=bs.autoSleep||120;var i=Sn._first;if((!i||!i._ts)&&bs.autoSleep&&vs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||vs.sleep()}}},e})(Rh);Cs(Kr.prototype,{_lock:0,_hasPause:0,_forcing:0});var _te=function(e,n,r,s,i,o,l){var u=new ts(this._pt,e,n,0,1,v9,null,i),d=0,f=0,p,g,v,w,_,x,b,E;for(u.b=r,u.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=Ch(s)),o&&(E=[r,s],o(E,e,n),r=E[0],s=E[1]),g=r.match(i_)||[];p=i_.exec(s);)w=p[0],_=s.substring(d,p.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),w!==g[f++]&&(x=parseFloat(g[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:x,c:w.charAt(1)==="="?Cu(x,w)-x:parseFloat(w)-x,m:v&&v<4?Math.round:0},d=i_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(FO.test(s)||b)&&(u.e=0),this._pt=u,u},Fb=function(e,n,r,s,i,o,l,u,d,f){Rn(s)&&(s=s(i||0,e,o));var p=e[n],g=r!=="get"?r:Rn(p)?d?e[n.indexOf("set")||!Rn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,v=Rn(p)?d?kte:m9:Hb,w;if(lr(s)&&(~s.indexOf("random(")&&(s=Ch(s)),s.charAt(1)==="="&&(w=Cu(g,s)+(kr(g)||0),(w||w===0)&&(s=w))),!f||g!==s||Cx)return!isNaN(g*s)&&s!==""?(w=new ts(this._pt,e,n,+g||0,s-(g||0),typeof p=="boolean"?Cte:g9,0,v),d&&(w.fp=d),l&&w.modifier(l,this,e),this._pt=w):(!p&&!(n in e)&&Lb(n,s),_te.call(this,e,n,g,s,v,u||bs.stringFilter,d))},xte=function(e,n,r,s,i){if(Rn(e)&&(e=qf(e,i,n,r,s)),!Gi(e)||e.style&&e.nodeType||Cr(e)||$O(e))return lr(e)?qf(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=qf(e[l],i,n,r,s);return o},f9=function(e,n,r,s,i,o){var l,u,d,f;if(ms[e]&&(l=new ms[e]).init(i,l.rawVars?n[e]:xte(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new ts(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==_u))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Aa,Cx,Vb=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,p=s.yoyoEase,g=s.keyframes,v=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,b=e.parent,E=b&&b.data==="nested"?b.vars.targets:x,C=e._overwrite==="auto"&&!Tb,R=e.timeline,A=s.easeReverse||p,M,I,T,L,D,B,j,K,U,H,Z,Q,z;if(R&&(!g||!i)&&(i="none"),e._ease=ic(i,Sh.ease),e._rEase=A&&(ic(A)||e._ease),e._from=!R&&!!s.runBackwards,e._from&&(e.ratio=1),!R||g&&!s.stagger){if(K=x[0]?rc(x[0]).harness:0,Q=K&&s[K.prop],M=fg(s,Nb),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&w?cm:qee),_._lazy=0),o){if(qa(e._startAt=Un.set(x,Cs({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&Jr(u),startAt:null,delay:0,onUpdate:d&&function(){return ys(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(vr||!l&&!v)&&e._startAt.revert(cm),l&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&w&&!_){if(n&&(l=!1),T=Cs({overwrite:!1,data:"isFromStart",lazy:l&&!_&&Jr(u),immediateRender:l,stagger:0,parent:b},M),Q&&(T[K.prop]=Q),qa(e._startAt=Un.set(x,T)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(vr?e._startAt.revert(cm):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,Zt,Zt);else if(!n)return}for(e._pt=e._ptCache=0,u=w&&Jr(u)||u&&!w,I=0;I<x.length;I++){if(D=x[I],j=D._gsap||$b(x)[I]._gsap,e._ptLookup[I]=H={},xx[j.id]&&Da.length&&dg(),Z=E===x?I:E.indexOf(D),K&&(U=new K).init(D,Q||M,e,Z,E)!==!1&&(e._pt=L=new ts(e._pt,D,U.name,0,1,U.render,U,0,U.priority),U._props.forEach(function(ee){H[ee]=L}),U.priority&&(B=1)),!K||Q)for(T in M)ms[T]&&(U=f9(T,M,e,Z,D,E))?U.priority&&(B=1):H[T]=L=Fb.call(e,D,T,"get",M[T],Z,E,0,s.stringFilter);e._op&&e._op[I]&&e.kill(D,e._op[I]),C&&e._pt&&(Aa=e,Sn.killTweensOf(D,H,e.globalTime(n)),z=!e.parent,Aa=0),e._pt&&u&&(xx[j.id]=1)}B&&y9(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!z,g&&n<=0&&R.render(Us,!0,!0)},wte=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,p,g,v;if(!d)for(d=e._ptCache[n]=[],g=e._ptLookup,v=e._targets.length;v--;){if(f=g[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return Cx=1,e.vars[n]="+=0",Vb(e,l),Cx=0,u?kh(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)p=d[v],f=p._pt||p,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,p.e&&(p.e=Ln(r)+kr(p.e)),p.b&&(p.b=f.s+kr(p.b))},bte=function(e,n){var r=e[0]?rc(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=rd({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},Ste=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Cr(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},qf=function(e,n,r,s,i){return Rn(e)?e.call(n,r,s,i):lr(e)&&~e.indexOf("random(")?Ch(e):e},h9=Db+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",p9={};es(h9+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return p9[t]=1});var Un=(function(t){NO(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:Zf(s))||this;var u=l.vars,d=u.duration,f=u.delay,p=u.immediateRender,g=u.stagger,v=u.overwrite,w=u.keyframes,_=u.defaults,x=u.scrollTrigger,b=s.parent||Sn,E=(Cr(r)||$O(r)?jo(r[0]):"length"in s)?[r]:Zs(r),C,R,A,M,I,T,L,D;if(l._targets=E.length?$b(E):kh("GSAP target "+r+" not found. https://gsap.com",!bs.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,w||g||D0(d)||D0(f)){s=l.vars;var B=s.easeReverse||s.yoyoEase;if(C=l.timeline=new Kr({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:E}),C.kill(),C.parent=C._dp=wo(l),C._start=0,g||D0(d)||D0(f)){if(M=E.length,L=g&&e9(g),Gi(g))for(I in g)~h9.indexOf(I)&&(D||(D={}),D[I]=g[I]);for(R=0;R<M;R++)A=fg(s,p9),A.stagger=0,B&&(A.easeReverse=B),D&&rd(A,D),T=E[R],A.duration=+qf(d,wo(l),R,T,E),A.delay=(+qf(f,wo(l),R,T,E)||0)-l._delay,!g&&M===1&&A.delay&&(l._delay=f=A.delay,l._start+=f,A.delay=0),C.to(T,A,L?L(R,T,E):0),C._ease=bt.none;C.duration()?d=f=0:l.timeline=0}else if(w){Zf(Cs(C.vars.defaults,{ease:"none"})),C._ease=ic(w.ease||s.ease||"none");var j=0,K,U,H;if(Cr(w))w.forEach(function(Z){return C.to(E,Z,">")}),C.duration();else{A={};for(I in w)I==="ease"||I==="easeEach"||Ste(I,w[I],A,w.easeEach);for(I in A)for(K=A[I].sort(function(Z,Q){return Z.t-Q.t}),j=0,R=0;R<K.length;R++)U=K[R],H={ease:U.e,duration:(U.t-(R?K[R-1].t:0))/100*d},H[I]=U.v,C.to(E,H,j),j+=H.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!Tb&&(Aa=wo(l),Sn.killTweensOf(E),Aa=0),ji(b,wo(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(p||!d&&!w&&l._start===bn(b._time)&&Jr(p)&&Jee(wo(l))&&b.data!=="nested")&&(l._tTime=-Zt,l.render(Math.max(0,-f)||0)),x&&YO(wo(l),x),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,f=s<0,p=s>u-Zt&&!f?u:s<Zt?0:s,g,v,w,_,x,b,E,C;if(!d)tte(this,s,i,o);else if(p!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(g=p,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(g=bn(p%_),p===u?(w=this._repeat,g=d):(x=bn(p/_),w=~~x,w&&w===x?(g=d,w--):g>d&&(g=d)),b=this._yoyo&&w&1,b&&(g=d-g),x=sd(this._tTime,_),g===l&&!o&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!b&&!this._lock&&g!==_&&this._initted&&(this._lock=o=1,this.render(bn(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(XO(this,f?s:g,o,i,p))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var R=g<l;if(R!==this._inv){var A=R?l:d-l;this._inv=R,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=A?(R?-1:1)/A:0,this._invScale=R?-this.ratio:1-this.ratio,this._invEase=R?this._rEase:this._ease}this.ratio=E=this._invRatio+this._invScale*this._invEase((g-this._invTime)*this._invRecip)}else this.ratio=E=this._ease(g/d);if(this._from&&(this.ratio=E=1-E),this._tTime=p,this._time=g,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&p&&!i&&!x&&(ys(this,"onStart"),this._tTime!==p))return this;for(v=this._pt;v;)v.r(E,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(g/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&wx(this,s,i,o),ys(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&ys(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(f&&!this._onUpdate&&wx(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&qa(this,1),!i&&!(f&&!l)&&(p||l||b)&&(ys(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,u){Ph||vs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||Vb(this,d),f=this._ease(d/this._dur),wte(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(Gg(this,0),this.parent||GO(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?kf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!vr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Aa&&Aa.vars.overwrite!==!0)._first||kf(this),this.parent&&o!==this.timeline.totalDuration()&&id(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Zs(s):l,d=this._ptLookup,f=this._pt,p,g,v,w,_,x,b;if((!i||i==="all")&&Xee(l,u))return i==="all"&&(this._pt=0),kf(this);for(p=this._op=this._op||[],i!=="all"&&(lr(i)&&(_={},es(i,function(E){return _[E]=1}),i=_),i=bte(l,i)),b=l.length;b--;)if(~u.indexOf(l[b])){g=d[b],i==="all"?(p[b]=i,w=g,v={}):(v=p[b]=p[b]||{},w=i);for(_ in w)x=g&&g[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&Wg(this,x,"_pt"),delete g[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&kf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Wf(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return Wf(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return Sn.killTweensOf(s,i,o)},e})(Rh);Cs(Un.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});es("staggerTo,staggerFrom,staggerFromTo",function(t){Un[t]=function(){var e=new Kr,n=Sx.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Hb=function(e,n,r){return e[n]=r},m9=function(e,n,r){return e[n](r)},kte=function(e,n,r,s){return e[n](s.fp,r)},Ete=function(e,n,r){return e.setAttribute(n,r)},zb=function(e,n){return Rn(e[n])?m9:Ib(e[n])&&e.setAttribute?Ete:Hb},g9=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},Cte=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},v9=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},Bb=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Pte=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},Rte=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?Wg(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Ate=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},y9=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},ts=(function(){function t(n,r,s,i,o,l,u,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||g9,this.d=u||this,this.set=d||Hb,this.pr=f||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=Ate,this.m=r,this.mt=i,this.tween=s},t})();es(Db+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return Nb[t]=1});Es.TweenMax=Es.TweenLite=Un;Es.TimelineLite=Es.TimelineMax=Kr;Sn=new Kr({sortChildren:!1,defaults:Sh,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});bs.stringFilter=c9;var oc=[],dm={},Tte=[],P3=0,Ite=0,u_=function(e){return(dm[e]||Tte).map(function(n){return n()})},Px=function(){var e=Date.now(),n=[];e-P3>2&&(u_("matchMediaInit"),oc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Mi.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),u_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),P3=e,u_("matchMedia"))},_9=(function(){function t(n,r){this.selector=r&&kx(r),this.data=[],this._r=[],this.isReverted=!1,this.id=Ite++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){Rn(r)&&(i=s,s=r,r=Rn);var o=this,l=function(){var d=pn,f=o.selector,p;return d&&d!==o&&d.data.push(o),i&&(o.selector=kx(i)),pn=o,p=s.apply(o,arguments),Rn(p)&&o._r.push(p),pn=d,o.selector=f,o.isReverted=!1,p};return o.last=l,r===Rn?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=pn;pn=null,r(this),pn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof Un&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),u=i.data.length,d;u--;)d=i.data[u],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,p){return p.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof Kr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Un)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s)for(var o=oc.length;o--;)oc[o].id===this.id&&oc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),Mte=(function(){function t(n){this.contexts=[],this.scope=n,pn&&pn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){Gi(r)||(r={matches:r});var o=new _9(0,i||this.scope),l=o.conditions={},u,d,f;pn&&!o.selector&&(o.selector=pn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=Mi.matchMedia(r[d]),u&&(oc.indexOf(o)<0&&oc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(Px):u.addEventListener("change",Px)));return f&&s(o,function(p){return o.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),pg={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return o9(s)})},timeline:function(e){return new Kr(e)},getTweensOf:function(e,n){return Sn.getTweensOf(e,n)},getProperty:function(e,n,r,s){lr(e)&&(e=Zs(e)[0]);var i=rc(e||{}).get,o=r?qO:WO;return r==="native"&&(r=""),e&&(n?o((ms[n]&&ms[n].get||i)(e,n,r,s)):function(l,u,d){return o((ms[l]&&ms[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Zs(e),e.length>1){var s=e.map(function(f){return rs.quickSetter(f,n,r)}),i=s.length;return function(f){for(var p=i;p--;)s[p](f)}}e=e[0]||{};var o=ms[n],l=rc(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var p=new o;_u._pt=0,p.init(e,r?f+r:f,_u,0,[e]),p.render(1,p),_u._pt&&Bb(1,_u)}:l.set(e,u);return o?d:function(f){return d(e,u,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=rs.to(e,Cs((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return Sn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ic(e.ease,Sh.ease)),b3(Sh,e||{})},config:function(e){return b3(bs,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!ms[l]&&!Es[l]&&kh(n+" effect requires "+l+" plugin.")}),o_[n]=function(l,u,d){return r(Zs(l),Cs(u||{},i),d)},o&&(Kr.prototype[n]=function(l,u,d){return this.add(o_[n](l,Gi(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){bt[e]=ic(n)},parseEase:function(e,n){return arguments.length?ic(e,n):bt},getById:function(e){return Sn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Kr(e),s,i;for(r.smoothChildTiming=Jr(e.smoothChildTiming),Sn.remove(r),r._dp=0,r._time=r._tTime=Sn._time,s=Sn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Un&&s.vars.onComplete===s._targets[0]))&&ji(r,s,s._start-s._delay),s=i;return ji(Sn,r,0),r},context:function(e,n){return e?new _9(e,n):pn},matchMedia:function(e){return new Mte(e)},matchMediaRefresh:function(){return oc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||Px()},addEventListener:function(e,n){var r=dm[e]||(dm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=dm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:cte,wrapYoyo:ute,distribute:e9,random:n9,snap:t9,normalize:lte,getUnit:kr,clamp:ste,splitColor:a9,toArray:Zs,selector:kx,mapRange:s9,pipe:ote,unitize:ate,interpolate:dte,shuffle:JO},install:HO,effects:o_,ticker:vs,updateRoot:Kr.updateRoot,plugins:ms,globalTimeline:Sn,core:{PropTween:ts,globals:zO,Tween:Un,Timeline:Kr,Animation:Rh,getCache:rc,_removeLinkedListItem:Wg,reverting:function(){return vr},context:function(e){return e&&pn&&(pn.data.push(e),e._ctx=pn),pn},suppressOverwrites:function(e){return Tb=e}}};es("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return pg[t]=Un[t]});vs.add(Kr.updateRoot);_u=pg.to({},{duration:0});var Ote=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},Lte=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=Ote(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},d_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(lr(i)&&(u={},es(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}Lte(l,i)}}}},rs=pg.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)vr?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},d_("roundProps",Ex),d_("modifiers"),d_("snap",t9))||pg;Un.version=Kr.version=rs.version="3.15.0";VO=1;Mb()&&od();bt.Power0;bt.Power1;bt.Power2;bt.Power3;bt.Power4;bt.Linear;bt.Quad;bt.Cubic;bt.Quart;bt.Quint;bt.Strong;bt.Elastic;bt.Back;bt.SteppedEase;bt.Bounce;bt.Sine;bt.Expo;bt.Circ;/*!
152
+ * CSSPlugin 3.15.0
153
+ * https://gsap.com
154
+ *
155
+ * Copyright 2008-2026, GreenSock. All rights reserved.
156
+ * Subject to the terms at https://gsap.com/standard-license
157
+ * @author: Jack Doyle, jack@greensock.com
158
+ */var R3,Ta,Pu,Ub,zl,A3,Zb,Nte=function(){return typeof window<"u"},Fo={},jl=180/Math.PI,Ru=Math.PI/180,ou=Math.atan2,T3=1e8,Wb=/([A-Z])/g,Dte=/(left|right|width|margin|padding|x)/i,$te=/[\s,\(]\S/,Hi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Rx=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},jte=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},Fte=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},Vte=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},Hte=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},x9=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},w9=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},zte=function(e,n,r){return e.style[n]=r},Bte=function(e,n,r){return e.style.setProperty(n,r)},Ute=function(e,n,r){return e._gsap[n]=r},Zte=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},Wte=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},qte=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},kn="transform",ns=kn+"Origin",Gte=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Fo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Hi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=bo(s,l)}):this.tfm[e]=o.x?o[e]:bo(s,e),e===ns&&(this.tfm.zOrigin=o.zOrigin);else return Hi.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(kn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(ns,n,"")),e=kn}(i||n)&&this.props.push(e,n,i[e])},b9=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Kte=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(Wb,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=Zb(),(!i||!i.isStart)&&!r[kn]&&(b9(r),s.zOrigin&&r[ns]&&(r[ns]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},S9=function(e,n){var r={target:e,props:[],revert:Kte,save:Gte};return e._gsap||rs.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},k9,Ax=function(e,n){var r=Ta.createElementNS?Ta.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Ta.createElement(e);return r&&r.style?r:Ta.createElement(e)},_s=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Wb,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,ad(n)||n,1)||""},I3="O,Moz,ms,Ms,Webkit".split(","),ad=function(e,n,r){var s=n||zl,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(I3[o]+e in i););return o<0?null:(o===3?"ms":o>=0?I3[o]:"")+e},Tx=function(){Nte()&&window.document&&(R3=window,Ta=R3.document,Pu=Ta.documentElement,zl=Ax("div")||{style:{}},Ax("div"),kn=ad(kn),ns=kn+"Origin",zl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",k9=!!ad("perspective"),Zb=rs.core.reverting,Ub=1)},M3=function(e){var n=e.ownerSVGElement,r=Ax("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Pu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Pu.removeChild(r),i},O3=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},E9=function(e){var n,r;try{n=e.getBBox()}catch{n=M3(e),r=1}return n&&(n.width||n.height)||r||(n=M3(e)),n&&!n.width&&!n.x&&!n.y?{x:+O3(e,["x","cx","x1"])||0,y:+O3(e,["y","cy","y1"])||0,width:0,height:0}:n},C9=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&E9(e))},Ga=function(e,n){if(n){var r=e.style,s;n in Fo&&n!==ns&&(n=kn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Wb,"-$1").toLowerCase())):r.removeAttribute(n)}},Ia=function(e,n,r,s,i,o){var l=new ts(e._pt,n,r,0,1,o?w9:x9);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},L3={deg:1,rad:1,turn:1},Yte={grid:1,flex:1},Ka=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=zl.style,u=Dte.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),p=100,g=s==="px",v=s==="%",w,_,x,b;if(s===o||!i||L3[s]||L3[o])return i;if(o!=="px"&&!g&&(i=t(e,n,r,"px")),b=e.getCTM&&C9(e),(v||o==="%")&&(Fo[n]||~n.indexOf("adius")))return w=b?e.getBBox()[u?"width":"height"]:e[f],Ln(v?i/w*p:i/100*w);if(l[u?"width":"height"]=p+(g?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,b&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Ta||!_.appendChild)&&(_=Ta.body),x=_._gsap,x&&v&&x.width&&u&&x.time===vs.time&&!x.uncache)return Ln(i/x.width*p);if(v&&(n==="height"||n==="width")){var E=e.style[n];e.style[n]=p+s,w=e[f],E?e.style[n]=E:Ga(e,n)}else(v||o==="%")&&!Yte[_s(_,"display")]&&(l.position=_s(e,"position")),_===e&&(l.position="static"),_.appendChild(zl),w=zl[f],_.removeChild(zl),l.position="absolute";return u&&v&&(x=rc(_),x.time=vs.time,x.width=_[f]),Ln(g?w*i/p:w&&i?p/w*i:0)},bo=function(e,n,r,s){var i;return Ub||Tx(),n in Hi&&n!=="transform"&&(n=Hi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Fo[n]&&n!=="transform"?(i=Th(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:gg(_s(e,ns))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=mg[n]&&mg[n](e,n,r)||_s(e,n)||UO(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Ka(e,n,i,r)+r:i},Xte=function(e,n,r,s){if(!r||r==="none"){var i=ad(n,e,1),o=i&&_s(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=_s(e,"borderTopColor"))}var l=new ts(this._pt,e.style,n,0,1,v9),u=0,d=0,f,p,g,v,w,_,x,b,E,C,R,A;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=_s(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=_s(e,n)||s,_?e.style[n]=_:Ga(e,n)),f=[r,s],c9(f),r=f[0],s=f[1],g=r.match(yu)||[],A=s.match(yu)||[],A.length){for(;p=yu.exec(s);)x=p[0],E=s.substring(u,p.index),w?w=(w+1)%5:(E.substr(-5)==="rgba("||E.substr(-5)==="hsla(")&&(w=1),x!==(_=g[d++]||"")&&(v=parseFloat(_)||0,R=_.substr((v+"").length),x.charAt(1)==="="&&(x=Cu(v,x)+R),b=parseFloat(x),C=x.substr((b+"").length),u=yu.lastIndex-C.length,C||(C=C||bs.units[n]||R,u===s.length&&(s+=C,l.e+=C)),R!==C&&(v=Ka(e,n,_,C)||0),l._pt={_next:l._pt,p:E||d===1?E:",",s:v,c:b-v,m:w&&w<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?w9:x9;return FO.test(s)&&(l.e=0),this._pt=l,l},N3={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Qte=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=N3[r]||r,n[1]=N3[s]||s,n.join(" ")},Jte=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],Fo[l]&&(u=1,l=l==="transformOrigin"?ns:kn),Ga(r,l);u&&(Ga(r,kn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Th(r,1),o.uncache=1,b9(s)))}},mg={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new ts(e._pt,n,r,0,0,Jte);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Ah=[1,0,0,1,0,0],P9={},R9=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},D3=function(e){var n=_s(e,kn);return R9(n)?Ah:n.substr(7).match(jO).map(Ln)},qb=function(e,n){var r=e._gsap||rc(e),s=e.style,i=D3(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Ah:i):(i===Ah&&!e.offsetParent&&e!==Pu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Pu.appendChild(e)),i=D3(e),u?s.display=u:Ga(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Pu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Ix=function(e,n,r,s,i,o){var l=e._gsap,u=i||qb(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,p=l.xOffset||0,g=l.yOffset||0,v=u[0],w=u[1],_=u[2],x=u[3],b=u[4],E=u[5],C=n.split(" "),R=parseFloat(C[0])||0,A=parseFloat(C[1])||0,M,I,T,L;r?u!==Ah&&(I=v*x-w*_)&&(T=R*(x/I)+A*(-_/I)+(_*E-x*b)/I,L=R*(-w/I)+A*(v/I)-(v*E-w*b)/I,R=T,A=L):(M=E9(e),R=M.x+(~C[0].indexOf("%")?R/100*M.width:R),A=M.y+(~(C[1]||C[0]).indexOf("%")?A/100*M.height:A)),s||s!==!1&&l.smooth?(b=R-d,E=A-f,l.xOffset=p+(b*v+E*_)-b,l.yOffset=g+(b*w+E*x)-E):l.xOffset=l.yOffset=0,l.xOrigin=R,l.yOrigin=A,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[ns]="0px 0px",o&&(Ia(o,l,"xOrigin",d,R),Ia(o,l,"yOrigin",f,A),Ia(o,l,"xOffset",p,l.xOffset),Ia(o,l,"yOffset",g,l.yOffset)),e.setAttribute("data-svg-origin",R+" "+A)},Th=function(e,n){var r=e._gsap||new d9(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=_s(e,ns)||"0",f,p,g,v,w,_,x,b,E,C,R,A,M,I,T,L,D,B,j,K,U,H,Z,Q,z,ee,W,N,X,ie,ne,oe;return f=p=g=_=x=b=E=C=R=0,v=w=1,r.svg=!!(e.getCTM&&C9(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[kn]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[kn]!=="none"?u[kn]:"")),s.scale=s.rotate=s.translate="none"),I=qb(e,r.svg),r.svg&&(r.uncache?(z=e.getBBox(),d=r.xOrigin-z.x+"px "+(r.yOrigin-z.y)+"px",Q=""):Q=!n&&e.getAttribute("data-svg-origin"),Ix(e,Q||d,!!Q||r.originIsAbsolute,r.smooth!==!1,I)),A=r.xOrigin||0,M=r.yOrigin||0,I!==Ah&&(B=I[0],j=I[1],K=I[2],U=I[3],f=H=I[4],p=Z=I[5],I.length===6?(v=Math.sqrt(B*B+j*j),w=Math.sqrt(U*U+K*K),_=B||j?ou(j,B)*jl:0,E=K||U?ou(K,U)*jl+_:0,E&&(w*=Math.abs(Math.cos(E*Ru))),r.svg&&(f-=A-(A*B+M*K),p-=M-(A*j+M*U))):(oe=I[6],ie=I[7],W=I[8],N=I[9],X=I[10],ne=I[11],f=I[12],p=I[13],g=I[14],T=ou(oe,X),x=T*jl,T&&(L=Math.cos(-T),D=Math.sin(-T),Q=H*L+W*D,z=Z*L+N*D,ee=oe*L+X*D,W=H*-D+W*L,N=Z*-D+N*L,X=oe*-D+X*L,ne=ie*-D+ne*L,H=Q,Z=z,oe=ee),T=ou(-K,X),b=T*jl,T&&(L=Math.cos(-T),D=Math.sin(-T),Q=B*L-W*D,z=j*L-N*D,ee=K*L-X*D,ne=U*D+ne*L,B=Q,j=z,K=ee),T=ou(j,B),_=T*jl,T&&(L=Math.cos(T),D=Math.sin(T),Q=B*L+j*D,z=H*L+Z*D,j=j*L-B*D,Z=Z*L-H*D,B=Q,H=z),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,b=180-b),v=Ln(Math.sqrt(B*B+j*j+K*K)),w=Ln(Math.sqrt(Z*Z+oe*oe)),T=ou(H,Z),E=Math.abs(T)>2e-4?T*jl:0,R=ne?1/(ne<0?-ne:ne):0),r.svg&&(Q=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!R9(_s(e,kn)),Q&&e.setAttribute("transform",Q))),Math.abs(E)>90&&Math.abs(E)<270&&(i?(v*=-1,E+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-1,E+=E<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=g+o,r.scaleX=Ln(v),r.scaleY=Ln(w),r.rotation=Ln(_)+l,r.rotationX=Ln(x)+l,r.rotationY=Ln(b)+l,r.skewX=E+l,r.skewY=C+l,r.transformPerspective=R+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[ns]=gg(d)),r.xOffset=r.yOffset=0,r.force3D=bs.force3D,r.renderTransform=r.svg?tne:k9?A9:ene,r.uncache=0,r},gg=function(e){return(e=e.split(" "))[0]+" "+e[1]},f_=function(e,n,r){var s=kr(n);return Ln(parseFloat(n)+parseFloat(Ka(e,"x",r+"px",s)))+s},ene=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,A9(e,n)},Il="0deg",mf="0px",Ml=") ",A9=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,p=r.rotationX,g=r.skewX,v=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,b=r.force3D,E=r.target,C=r.zOrigin,R="",A=b==="auto"&&e&&e!==1||b===!0;if(C&&(p!==Il||f!==Il)){var M=parseFloat(f)*Ru,I=Math.sin(M),T=Math.cos(M),L;M=parseFloat(p)*Ru,L=Math.cos(M),o=f_(E,o,I*L*-C),l=f_(E,l,-Math.sin(M)*-C),u=f_(E,u,T*L*-C+C)}x!==mf&&(R+="perspective("+x+Ml),(s||i)&&(R+="translate("+s+"%, "+i+"%) "),(A||o!==mf||l!==mf||u!==mf)&&(R+=u!==mf||A?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Ml),d!==Il&&(R+="rotate("+d+Ml),f!==Il&&(R+="rotateY("+f+Ml),p!==Il&&(R+="rotateX("+p+Ml),(g!==Il||v!==Il)&&(R+="skew("+g+", "+v+Ml),(w!==1||_!==1)&&(R+="scale("+w+", "+_+Ml),E.style[kn]=R||"translate(0, 0)"},tne=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,p=r.scaleX,g=r.scaleY,v=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,b=r.yOffset,E=r.forceCSS,C=parseFloat(o),R=parseFloat(l),A,M,I,T,L;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Ru,d*=Ru,A=Math.cos(u)*p,M=Math.sin(u)*p,I=Math.sin(u-d)*-g,T=Math.cos(u-d)*g,d&&(f*=Ru,L=Math.tan(d-f),L=Math.sqrt(1+L*L),I*=L,T*=L,f&&(L=Math.tan(f),L=Math.sqrt(1+L*L),A*=L,M*=L)),A=Ln(A),M=Ln(M),I=Ln(I),T=Ln(T)):(A=p,T=g,M=I=0),(C&&!~(o+"").indexOf("px")||R&&!~(l+"").indexOf("px"))&&(C=Ka(v,"x",o,"px"),R=Ka(v,"y",l,"px")),(w||_||x||b)&&(C=Ln(C+w-(w*A+_*I)+x),R=Ln(R+_-(w*M+_*T)+b)),(s||i)&&(L=v.getBBox(),C=Ln(C+s/100*L.width),R=Ln(R+i/100*L.height)),L="matrix("+A+","+M+","+I+","+T+","+C+","+R+")",v.setAttribute("transform",L),E&&(v.style[kn]=L)},nne=function(e,n,r,s,i){var o=360,l=lr(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?jl:1),d=u-s,f=s+d+"deg",p,g;return l&&(p=i.split("_")[1],p==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),p==="cw"&&d<0?d=(d+o*T3)%o-~~(d/o)*o:p==="ccw"&&d>0&&(d=(d-o*T3)%o-~~(d/o)*o)),e._pt=g=new ts(e._pt,n,r,s,d,jte),g.e=f,g.u="deg",e._props.push(r),g},$3=function(e,n){for(var r in n)e[r]=n[r];return e},rne=function(e,n,r){var s=$3({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,p,g,v,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[kn]=n,l=Th(r,1),Ga(r,kn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[kn],o[kn]=n,l=Th(r,1),o[kn]=d);for(u in Fo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=kr(d),w=kr(f),p=v!==w?Ka(r,u,d,w):parseFloat(d),g=parseFloat(f),e._pt=new ts(e._pt,l,u,p,g-p,Rx),e._pt.u=w||0,e._props.push(u));$3(l,s)};es("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});mg[e>1?"border"+t:t]=function(l,u,d,f,p){var g,v;if(arguments.length<4)return g=o.map(function(w){return bo(l,w,d)}),v=g.join(" "),v.split(g[0]).length===5?g[0]:v;g=(f+"").split(" "),v={},o.forEach(function(w,_){return v[w]=g[_]=g[_]||g[(_-1)/2|0]}),l.init(u,v,p)}});var T9={name:"css",register:Tx,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,p,g,v,w,_,x,b,E,C,R,A,M,I,T,L;Ub||Tx(),this.styles=this.styles||S9(e),T=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(ms[_]&&f9(_,n,r,s,e,i)))){if(v=typeof f,w=mg[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Ch(f)),w)w(this,e,_,f,r)&&(I=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",$a.lastIndex=0,$a.test(d)||(x=kr(d),b=kr(f),b?x!==b&&(d=Ka(e,_,d,b)+b):x&&(f+=x)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),T.push(_,0,l[_]);else if(v!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],lr(d)&&~d.indexOf("random(")&&(d=Ch(d)),kr(d+"")||d==="auto"||(d+=bs.units[_]||kr(bo(e,_))||""),(d+"").charAt(1)==="="&&(d=bo(e,_))):d=bo(e,_),g=parseFloat(d),E=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),E&&(f=f.substr(2)),p=parseFloat(f),_ in Hi&&(_==="autoAlpha"&&(g===1&&bo(e,"visibility")==="hidden"&&p&&(g=0),T.push("visibility",0,l.visibility),Ia(this,l,"visibility",g?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=Hi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in Fo,C){if(this.styles.save(_),L=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=_s(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=f,f=_s(e,"perspective"),D?e.style.perspective=D:Ga(e,"perspective")}p=parseFloat(f)}if(R||(A=e._gsap,A.renderTransform&&!n.parseTransform||Th(e,n.parseTransform),M=n.smoothOrigin!==!1&&A.smooth,R=this._pt=new ts(this._pt,l,kn,0,1,A.renderTransform,A,0,-1),R.dep=1),_==="scale")this._pt=new ts(this._pt,A,"scaleY",A.scaleY,(E?Cu(A.scaleY,E+p):p)-A.scaleY||0,Rx),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){T.push(ns,0,l[ns]),f=Qte(f),A.svg?Ix(e,f,0,M,0,this):(b=parseFloat(f.split(" ")[2])||0,b!==A.zOrigin&&Ia(this,A,"zOrigin",A.zOrigin,b),Ia(this,l,_,gg(d),gg(f)));continue}else if(_==="svgOrigin"){Ix(e,f,1,M,0,this);continue}else if(_ in P9){nne(this,A,_,g,E?Cu(g,E+f):f);continue}else if(_==="smoothOrigin"){Ia(this,A,"smooth",A.smooth,f);continue}else if(_==="force3D"){A[_]=f;continue}else if(_==="transform"){rne(this,f,e);continue}}else _ in l||(_=ad(_)||_);if(C||(p||p===0)&&(g||g===0)&&!$te.test(f)&&_ in l)x=(d+"").substr((g+"").length),p||(p=0),b=kr(f)||(_ in bs.units?bs.units[_]:x),x!==b&&(g=Ka(e,_,d,b)),this._pt=new ts(this._pt,C?A:l,_,g,(E?Cu(g,E+p):p)-g,!C&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?Hte:Rx),this._pt.u=b||0,C&&L!==f?(this._pt.b=d,this._pt.e=L,this._pt.r=Vte):x!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=Fte);else if(_ in l)Xte.call(this,e,_,d,E?E+f:f);else if(_ in e)this.add(e,_,d||e[_],E?E+f:f,s,i);else if(_!=="parseTransform"){Lb(_,f);continue}C||(_ in l?T.push(_,0,l[_]):typeof e[_]=="function"?T.push(_,2,e[_]()):T.push(_,1,d||e[_])),o.push(_)}}I&&y9(this)},render:function(e,n){if(n.tween._time||!Zb())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:bo,aliases:Hi,getSetter:function(e,n,r){var s=Hi[n];return s&&s.indexOf(",")<0&&(n=s),n in Fo&&n!==ns&&(e._gsap.x||bo(e,"x"))?r&&A3===r?n==="scale"?Zte:Ute:(A3=r||{})&&(n==="scale"?Wte:qte):e.style&&!Ib(e.style[n])?zte:~n.indexOf("-")?Bte:zb(e,n)},core:{_removeProperty:Ga,_getMatrix:qb}};rs.utils.checkPrefix=ad;rs.core.getStyleSaver=S9;(function(t,e,n,r){var s=es(t+","+e+","+n,function(i){Fo[i]=1});es(e,function(i){bs.units[i]="deg",P9[i]=1}),Hi[s[13]]=t+","+e,es(r,function(i){var o=i.split(":");Hi[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");es("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){bs.units[t]="px"});rs.registerPlugin(T9);var ci=rs.registerPlugin(T9)||rs;ci.core.Tween;const fm="/assets/logo-animation",h_=1280,sne=[{id:"eraser",src:`${fm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${fm}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${fm}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],ine=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],Mx=({className:t})=>{const e=m.useRef(null),n=m.useRef(null),r=m.useRef(null);return m.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(b,E)=>b+Math.random()*(E-b);let d=null,f,p=1;const g=sne.map(b=>({...b})),v=()=>{s.querySelectorAll(".la-obj").forEach(T=>T.remove());const b=s.getBoundingClientRect(),E=b.width||h_,C=b.height||h_*.64;p=E/h_,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,M=[],I=(T,L,D)=>{const B=document.createElement("div");return B.className="la-obj",B.style.width=`${L}px`,B.innerHTML=`<img src="${T}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(B),B};return ine.forEach((T,L)=>{const D=T.w*p,B=I(`${fm}/sea/${T.k}.png`,D,L%2===0);ci.set(B,{x:T.x*E-D/2,y:T.y*C-D/2,rotation:T.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),M.push({el:B,hero:!1,rest:1})}),g.forEach(T=>{const L=T.cssW*p;T.el=I(T.src,L,!!T.flip),T.finalScale=T.fit*A/(T.cssW*p),ci.set(T.el,{x:T.seaX*E-L/2,y:T.seaY*C-T.cssH*p/2,rotation:T.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),M.push({el:T.el,hero:!0,rest:150/T.cssW})}),M},w=(b,E)=>{const C=s.getBoundingClientRect(),R=o.getBoundingClientRect();return{x:R.left-C.left+b/326*R.width,y:R.top-C.top+E/337*R.height}},_=()=>{d&&d.revert();const b=v();if(l){d=ci.context(()=>{b.filter(R=>!R.hero).forEach(R=>ci.set(R.el,{scale:0})),g.forEach(R=>{if(!R.el)return;const A=w(R.localX,R.localY);ci.set(R.el,{x:A.x-R.cssW*p/2,y:A.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale})})},s);return}const E=[],C=[];d=ci.context(()=>{const R=ci.timeline();R.to(b.map(A=>A.el),{scale:A=>b[A].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),R.add(()=>{b.forEach(({el:A,hero:M},I)=>{const T=M?E:C,L=I%2?1:-1;T.push(ci.to(A,{rotation:"+="+u(2.5,6)*L,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),ci.to(A,{y:"+="+u(5,11)*L,x:"+="+u(4,9)*-L,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),R.to({},{duration:1.1}),R.add("pick"),g.forEach((A,M)=>{A.el&&R.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+M*.08)}),R.add("clear","pick+=0.7"),R.add(()=>C.forEach(A=>A.kill()),"clear"),R.to(b.filter(A=>!A.hero).map(A=>A.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),R.add("assemble","clear+=0.25"),R.add(()=>E.forEach(A=>A.kill()),"assemble"),g.forEach((A,M)=>{if(!A.el||A.finalScale===void 0)return;const I=w(A.localX,A.localY);R.to(A.el,{x:I.x-A.cssW*p/2,y:I.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+M*.12)}),g.forEach(A=>{!A.el||A.finalScale===void 0||R.to(A.el,{scale:A.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};ci.ticker.fps(12),_();const x=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(b=>b.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},one=Object.freeze(Object.defineProperty({__proto__:null,default:Mx},Symbol.toStringTag,{value:"Module"})),j3=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),ane=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(Mx,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(j3,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(Mx,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(j3,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),lne="data:image/svg+xml,%3csvg%20width='94'%20height='24'%20viewBox='0%200%2094%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M-0.000156164%2023.832V7.704H5.11184L6.47984%208.424C7.58384%207.704%209.04784%207.344%2010.8718%207.344C12.0718%207.344%2013.1278%207.476%2014.0398%207.74C14.9518%207.98%2015.6838%208.244%2016.2358%208.532C16.8118%208.82%2017.1718%209.024%2017.3158%209.144L15.5158%2013.824C15.2758%2013.656%2014.8198%2013.428%2014.1478%2013.14C13.4998%2012.852%2012.7318%2012.588%2011.8438%2012.348C10.9558%2012.084%2010.0198%2011.952%209.03584%2011.952H8.63984C7.96784%2011.952%207.45184%2012.072%207.09184%2012.312C6.73184%2012.528%206.55184%2013.02%206.55184%2013.788V23.832H-0.000156164ZM23.464%206.156C21.04%206.156%2019.828%205.124%2019.828%203.06C19.828%201.908%2020.128%201.116%2020.728%200.684C21.352%200.227999%2022.264%20-1.43051e-06%2023.464%20-1.43051e-06C24.736%20-1.43051e-06%2025.66%200.227999%2026.236%200.684C26.836%201.116%2027.136%201.908%2027.136%203.06C27.136%205.124%2025.912%206.156%2023.464%206.156ZM20.152%2023.832V7.704H26.704V23.832H20.152ZM37.4767%2023.832L29.6647%207.704H36.9007L40.3207%2016.524L41.2567%2019.116H41.6167L42.5527%2016.524L46.0087%207.704H53.1727L52.5967%209.9L45.4327%2023.832H37.4767ZM61.1953%2023.832C59.6113%2023.832%2058.3873%2023.604%2057.5233%2023.148C56.6833%2022.692%2056.1073%2022.068%2055.7953%2021.276C55.4833%2020.46%2055.3273%2019.524%2055.3273%2018.468V13.032C55.3273%2012.072%2055.4833%2011.196%2055.7953%2010.404C56.1313%209.588%2056.7193%208.94%2057.5593%208.46C58.3993%207.956%2059.6113%207.704%2061.1953%207.704H68.6473C70.5193%207.704%2071.9473%207.932%2072.9313%208.388C73.9393%208.82%2074.6233%209.444%2074.9833%2010.26C75.3673%2011.052%2075.5593%2011.976%2075.5593%2013.032V17.64H69.2593C67.0993%2017.64%2065.4553%2017.592%2064.3273%2017.496C63.2233%2017.4%2062.4433%2017.34%2061.9873%2017.316V17.856C61.9633%2018.816%2062.5393%2019.296%2063.7153%2019.296H64.8313C66.7513%2019.296%2068.5273%2019.26%2070.1593%2019.188C71.7913%2019.092%2073.0033%2019.008%2073.7953%2018.936L75.9553%2022.356C75.9553%2022.596%2075.7513%2022.824%2075.3433%2023.04C74.9353%2023.256%2074.2153%2023.448%2073.1833%2023.616C72.1753%2023.76%2070.7353%2023.832%2068.8633%2023.832H61.1953ZM61.9873%2014.184H68.8993V13.68C68.8993%2013.2%2068.8513%2012.864%2068.7553%2012.672C68.6833%2012.48%2068.4313%2012.36%2067.9993%2012.312C67.5673%2012.264%2066.8353%2012.24%2065.8033%2012.24H63.7153C62.5633%2012.24%2061.9873%2012.72%2061.9873%2013.68V14.184ZM85.8224%2023.832C83.9984%2023.832%2082.7504%2023.448%2082.0784%2022.68C81.4064%2021.912%2081.0704%2020.76%2081.0704%2019.224V12.24H78.1184V7.704H79.6304C80.0384%207.704%2080.3624%207.632%2080.6024%207.488C80.8664%207.32%2081.0344%207.032%2081.1064%206.624L81.7904%202.772H87.6944V7.704H93.7064V12.24H87.6944V17.82C87.6944%2018.42%2087.8384%2018.816%2088.1264%2019.008C88.4144%2019.2%2088.8464%2019.296%2089.4224%2019.296H93.0224L93.7424%2023.472C93.2384%2023.544%2092.4704%2023.628%2091.4384%2023.724C90.4064%2023.796%2089.2784%2023.832%2088.0544%2023.832H85.8224Z'%20fill='%23FF3300'/%3e%3c/svg%3e",cne=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:lne,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(Mg,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),une="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.5245%206.60961C66.8741%202.95923%2060.9556%202.95922%2057.3053%206.60961L8.61753%2055.2973C4.96715%2058.9477%204.96714%2064.8662%208.61752%2068.5166L26.3518%2086.2508C30.0022%2089.9012%2035.9206%2089.9012%2039.571%2086.2508L92.033%2033.7889C93.5989%2032.2229%2093.5989%2029.684%2092.033%2028.1181L70.5245%206.60961Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M119.208%2068.5159C122.858%2064.8655%20122.858%2058.947%20119.208%2055.2966L70.5199%206.60891C66.8695%202.95853%2060.951%202.95851%2057.3007%206.6089L32.8391%2031.0705L88.1364%2086.3678C91.7868%2090.0182%2097.7053%2090.0182%20101.356%2086.3678L119.208%2068.5159Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M64.0164%2077.3398L44.0436%2097.3127C41.1057%20100.251%2041.1057%20105.014%2044.0436%20107.952L58.5067%20122.415C61.4446%20125.353%2066.2079%20125.353%2069.1458%20122.415L83.7991%20107.762C86.737%20104.824%2086.737%20100.06%2083.7991%2097.1225L64.0164%2077.3398Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3c/svg%3e",vg=44,gf=8,$0=16,dne=4,F3=-18,fne=.18,hne=[.22,1,.36,1],V3=.92,pne=1,mne=.95,gne=.4,vne=[.19,1,.22,1],p_=0,yne=1,_ne=0,xne=0,wne=0,I9=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+gf,s=Math.max(r,e.width-vg-gf),i=Math.max(gf,e.height-vg-gf);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(gf,t.y))}},Gb=()=>({width:window.innerWidth,height:window.innerHeight}),bne=({position:t,boundsLeftPx:e=0})=>I9({position:t,viewport:Gb(),boundsLeft:e}),Sne=()=>{if(typeof window>"u")return{x:$0,y:$0};const t=Gb();return{x:t.width-vg-$0,y:t.height-vg-$0}},kne=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=dne,Ene=t=>t.button===void 0||t.button<=wne,H3=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Cne=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=m.useRef(null),u=m.useRef(!1),[d,f]=m.useState(!1),[p,g]=m.useState(!1),v=n?!1:{opacity:p_,scale:V3,x:F3},w=n?{opacity:p_}:{opacity:p_,scale:V3,x:F3},_=n?{duration:xne}:{duration:fne,ease:hne,scale:{duration:gne,ease:vne}},x=m.useCallback(()=>{const A=l.current;A&&(u.current=A.hasMoved),l.current=null,f(!1)},[]),b=m.useCallback(A=>{const M=l.current;if(!M)return;const I=H3(A),T=I.x-M.startPointer.x,L=I.y-M.startPointer.y,D=M.hasMoved||kne({deltaX:T,deltaY:L});l.current={...M,hasMoved:D},D&&o(I9({position:{x:M.startPosition.x+T,y:M.startPosition.y+L},viewport:Gb(),boundsLeft:s}))},[o,s]),E=m.useCallback(A=>{if(l.current||!Ene(A))return;const M=H3(A);l.current={startPointer:M,startPosition:r,hasMoved:!1},f(!0)},[r]),C=m.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),R=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x}):null,S.jsx(ws,{children:t?S.jsx(fc,{label:R,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(vi.button,{type:"button","aria-label":R,"data-cy":"reopen-panel",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),initial:v,animate:{opacity:yne,scale:pne,x:_ne},whileTap:{scale:mne},exit:w,transition:_,onPointerDown:E,onMouseDown:E,onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x,onClick:C,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:une,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},m_=Ps("useConfig"),Pne=300*1e3,Rne=1800*1e3,Ane=60*1e3,Tne=300*1e3,Ine=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},Mne=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},One=t=>({...tO,...t??{}}),Lne=()=>{const t=lt(fx),e=vt(fx),n=vt(cO),r=vt(uO),s=vt(Ug),i=vt(WQ),o=vt(UQ),l=vt(BQ),u=vt(Bg),d=vt(jQ),f=m.useCallback(b=>{o(b.agentModeAvailable),d({name:b.name??null,email:b.email??null}),b.isMCPSession&&n(!0),b.mcpEditor&&r(b.mcpEditor),s(b.agentApplyMode??Mne()??null),i(b.queueAccessToken??Ine())},[s,o,n,r,i,d]),p=vm({queryKey:["rivet-config"],queryFn:async()=>{const b=await fetch("/api/config");if(!b.ok)throw new Error(`Failed to fetch config: ${b.statusText}`);return await b.json()},staleTime:Pne,gcTime:Rne}),g=vm({queryKey:["rivet-feature-flags"],queryFn:async()=>{const b=await fetch("/api/feature-flags");if(!b.ok)throw new Error(`Failed to fetch feature flags: ${b.statusText}`);return await b.json()},staleTime:Ane,gcTime:Tne}),{refetch:v}=p,{refetch:w}=g;m.useLayoutEffect(()=>{p.data&&(f(p.data),u(!1),m_.info("Config loaded:",p.data)),g.data&&(e(One(g.data.featureFlags)),l(!0))},[p.data,g.data,f,u,e,l]),m.useLayoutEffect(()=>{p.error&&(l(!0),u(!1),m_.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),g.error&&(l(!0),m_.warn("Failed to load feature flags:",g.error instanceof Error?g.error.message:"Failed to load feature flags"))},[p.error,g.error,u,l]);const _=m.useCallback(async()=>{const[b]=await Promise.all([v(),w()]);return b.data?b.data:null},[v,w]);let x=null;return p.error instanceof Error?x=p.error.message:p.error&&(x="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&g.isPending,error:x,refetchConfig:_}},au=Ps("useOAuthCallback"),Nne="https://rivet-proxy.onrender.com",Dne=()=>{const[t,e]=m.useState({isProcessing:!1,isComplete:!1,error:null});return m.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{au.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),g=f.get("refresh_token"),w=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");au.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${Nne}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:g}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(au.info("OAuth authentication completed successfully"),r)return;if((l=x.user)!=null&&l.id?(Ee.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Ee.alias(x.user.email,x.user.id)):(u=x.user)!=null&&u.email&&Ee.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const E=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:g,userId:x.user.id}),signal:n.signal});E.ok||au.warn(`Local auth store returned ${E.status}`)}catch(E){if(r)return;au.warn("Failed to store auth locally:",E)}if(r)return;window.sessionStorage.setItem(cg,"1");const b=window.location.pathname;window.history.replaceState({},document.title,b),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;const p=f instanceof Error?f.message:"Unknown error occurred";au.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},g_=Ps("useAgentVariantsSession"),$ne=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,z3=(t,e,n)=>{e.size===0&&!n||t.set(bh,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},jne=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,o]of t){if(o.status!=="sending"||!o.awaitingSnapshotOutcome||o.variantRequest!==void 0)continue;const l=o.target;if(!l||l.kind!=="variant"||l.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(d=>d.workItemId===l.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...o,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...o,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},Fne=({enabled:t=!0}={})=>{const e=vt(Gh),n=vt(aO),r=vt(nO),s=vt($Q),i=vt(lO),o=vt(zQ),l=Eg(),u=m.useRef(null);m.useEffect(()=>{if(n(!1),!t)return;const d=new EventSource("/api/variants/events");return d.onmessage=f=>{try{const p=JSON.parse(f.data),g=u.current;if(p.active){const _=new Set(p.variants.map(x=>x.requestId).filter(x=>!!x));i(x=>x.filter(E=>!_.has(E.requestId))),z3(l,_,!1),l.set(bh,x=>{let b=x;for(const E of p.variants){const C=E.adoptedSource;C&&(b=HQ(b,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:p.sessionId,variantId:E.workItemId}))}return b}),l.set(bh,x=>jne(x,p)),p.sessionId!==u.current&&(u.current=p.sessionId,r(!0),s("directions"))}else u.current=null,z3(l,new Set,$ne(p));e(p),n(!0);const v=!p.active&&g!==null,w=p.active&&p.sessionId!==g;if(w&&fetch(`/api/variants/${p.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(_=>g_.warn("failed to reset preview-port on session switch",_)),v||w){const _=new Set;if(p.active)for(const b of p.variants)_.add(xh({kind:"variant",sessionId:p.sessionId,variantId:b.workItemId}));const x=l.get($o);for(const b of[x==null?void 0:x.left,x==null?void 0:x.right])b&&_.add(xh({kind:"variant",sessionId:b.sessionId,variantId:b.variantId}));o(_)}}catch(p){g_.warn("failed to parse SSE event payload",p)}},d.onerror=f=>{g_.warn("SSE error (auto-reconnects)",f)},()=>{d.close()}},[t,e,n,r,s,i,o,l])};var Vne=Object.defineProperty,or=(t,e)=>Vne(t,"name",{value:e,configurable:!0});function Kb(t){const e=t+"CollectionProvider",[n,r]=Ki(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=or(_=>{const{scope:x,children:b}=_,E=m.useRef(null),C=m.useRef(new Map).current;return S.jsx(s,{scope:x,itemMap:C,collectionRef:E,children:b})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=Ua(l),d=m.forwardRef((_,x)=>{const{scope:b,children:E}=_,C=i(l,b),R=un(x,C.collectionRef);return S.jsx(u,{ref:R,children:E})});d.displayName=l;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=Ua(f),v=m.forwardRef((_,x)=>{const{scope:b,children:E,...C}=_,R=m.useRef(null),A=un(x,R),M=i(f,b);return m.useEffect(()=>(M.itemMap.set(R,{ref:R,...C}),()=>void M.itemMap.delete(R))),S.jsx(g,{[p]:"",ref:A,children:E})});v.displayName=f;function w(_){const x=i(t+"CollectionConsumer",_);return m.useCallback(()=>{const E=x.collectionRef.current;if(!E)return[];const C=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((M,I)=>C.indexOf(M.ref.current)-C.indexOf(I.ref.current))},[x.collectionRef,x.itemMap])}return or(w,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},w,r]}or(Kb,"createCollection");var B3=new WeakMap,Vn,ps,v_=(ps=class extends Map{constructor(n){super(n);Je(this,Vn);Ae(this,Vn,[...super.keys()]),B3.set(this,!0)}set(n,r){return B3.get(this)&&(this.has(n)?q(this,Vn)[q(this,Vn).indexOf(n)]=n:q(this,Vn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=q(this,Vn).length,l=Yb(n);let u=l>=0?l:o+l;const d=u<0||u>=o?-1:u;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const f=this.size+(i?0:1);l<0&&u++;const p=[...q(this,Vn)];let g,v=!1;for(let w=u;w<f;w++)if(u===w){let _=p[w];p[w]===r&&(_=p[w+1]),i&&this.delete(r),g=this.get(_),this.set(r,s)}else{!v&&p[w-1]===r&&(v=!0);const _=p[v?w:w-1],x=g;g=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new ps(this);return i.insert(n,r,s),i}before(n){const r=q(this,Vn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=q(this,Vn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=q(this,Vn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=q(this,Vn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ae(this,Vn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&q(this,Vn).splice(q(this,Vn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=hm(q(this,Vn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=hm(q(this,Vn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return q(this,Vn).indexOf(n)}keyAt(n){return hm(q(this,Vn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new ps(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new ps(s)}reduce(...n){const[r,s]=n;let i=0,o=s??this.at(0);for(const l of this)i===0&&n.length===1?o=l:o=Reflect.apply(r,this,[o,l,i,this]),i++;return o}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,o,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new ps(r)}toReversed(){const n=new ps;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new ps(r)}slice(n,r){const s=new ps;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let o=n;o<=i;o++){const l=this.keyAt(o),u=this.get(l);s.set(l,u)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},Vn=new WeakMap,or(ps,"OrderedDict"),ps);function hm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=M9(t,e);return n===-1?void 0:t[n]}or(hm,"at");function M9(t,e){const n=t.length,r=Yb(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}or(M9,"toSafeIndex");function Yb(t){return t!==t||t===0?0:Math.trunc(t)}or(Yb,"toSafeInteger");function Hne(t){const e=t+"CollectionProvider",[n,r]=Ki(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new v_,setItemMap:or(()=>{},"setItemMap")}),o=or(({state:C,...R})=>C?S.jsx(u,{...R,state:C}):S.jsx(l,{...R}),"CollectionProvider");o.displayName=e;const l=or(C=>{const R=x();return S.jsx(u,{...C,state:R})},"CollectionInit");l.displayName=e+"Init";const u=or(C=>{const{scope:R,children:A,state:M}=C,I=m.useRef(null),[T,L]=m.useState(null),D=un(I,L),[B,j]=M;return m.useEffect(()=>{if(!T)return;const K=N9(()=>{});return K.observe(T,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[T]),S.jsx(s,{scope:R,itemMap:B,setItemMap:j,collectionRef:D,collectionRefObject:I,collectionElement:T,children:A})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=Ua(d),p=m.forwardRef((C,R)=>{const{scope:A,children:M}=C,I=i(d,A),T=un(R,I.collectionRef);return S.jsx(f,{ref:T,children:M})});p.displayName=d;const g=t+"CollectionItemSlot",v="data-radix-collection-item",w=Ua(g),_=m.forwardRef((C,R)=>{const{scope:A,children:M,...I}=C,T=m.useRef(null),[L,D]=m.useState(null),B=un(R,T,D),j=i(g,A),{setItemMap:K}=j,U=m.useRef(I);O9(U.current,I)||(U.current=I);const H=U.current;return m.useEffect(()=>{const Z=H;return K(Q=>L?Q.has(L)?Q.set(L,{...Z,element:L}).toSorted(Ox):(Q.set(L,{...Z,element:L}),Q.toSorted(Ox)):Q),()=>{K(Q=>!L||!Q.has(L)?Q:(Q.delete(L),new v_(Q)))}},[L,H,K]),S.jsx(w,{[v]:"",ref:B,children:M})});_.displayName=g;function x(){return m.useState(new v_)}or(x,"useInitCollection");function b(C){const{itemMap:R}=i(t+"CollectionConsumer",C);return R}return or(b,"useCollection"),[{Provider:o,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:b,useInitCollection:x}]}or(Hne,"createCollection");function O9(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}or(O9,"shallowEqual");function L9(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}or(L9,"isElementPreceding");function Ox(t,e){return!t[1].element||!e[1].element?0:L9(t[1].element,e[1].element)?-1:1}or(Ox,"sortByDocumentPosition");function N9(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}or(N9,"getChildListObserver");var zne=Object.defineProperty,Yh=(t,e)=>zne(t,"name",{value:e,configurable:!0}),Xb="Collapsible",[Bne,D9]=Ki(Xb),[Une,Qb]=Bne(Xb),Zne=m.forwardRef(Yh(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=el({prop:s,defaultProp:i??!1,onChange:l,caller:Xb});return S.jsx(Une,{scope:r,disabled:o,contentId:La(),open:d,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),children:S.jsx(Nn.div,{"data-state":Kg(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),Wne="CollapsibleTrigger",qne=m.forwardRef(Yh(function(e,n){const{__scopeCollapsible:r,...s}=e,i=Qb(Wne,r);return S.jsx(Nn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Kg(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:ln(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),$9="CollapsibleContent",Gne=m.forwardRef(Yh(function(e,n){const{forceMount:r,...s}=e,i=Qb($9,e.__scopeCollapsible);return S.jsx(Ja,{present:r||i.open,children:({present:o})=>S.jsx(Kne,{...s,ref:n,present:o})})},"CollapsibleContent")),Kne=m.forwardRef(Yh(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=Qb($9,r),[u,d]=m.useState(s),f=m.useRef(null),p=un(n,f),g=m.useRef(0),v=g.current,w=m.useRef(0),_=w.current,x=l.open||u,b=m.useRef(x),E=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),Xr(()=>{const C=f.current;if(C){E.current=E.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const R=C.getBoundingClientRect();g.current=R.height,w.current=R.width,b.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),d(s)}},[l.open,s]),S.jsx(Nn.div,{"data-state":Kg(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...o,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function Kg(t){return t?"open":"closed"}Yh(Kg,"getState");var Yne=Zne,Xne=qne,Qne=Gne,Jne=Object.defineProperty,ere=(t,e)=>Jne(t,"name",{value:e,configurable:!0}),tre=m.createContext(void 0);function Jb(t){const e=m.useContext(tre);return t||e||"ltr"}ere(Jb,"useDirection");var nre=Object.defineProperty,Ss=(t,e)=>nre(t,"name",{value:e,configurable:!0}),Yi="Accordion",rre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[e4,sre,ire]=Kb(Yi),[Yg,Oie]=Ki(Yi,[ire,D9]),t4=D9(),ore=m.forwardRef(Ss(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(e4.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(ure,{...o,ref:n}):S.jsx(cre,{...i,ref:n})})},"Accordion")),[j9,are]=Yg(Yi),[F9,lre]=Yg(Yi,{collapsible:!1}),cre=m.forwardRef(Ss(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ss(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=el({prop:r,defaultProp:s??"",onChange:i,caller:Yi});return S.jsx(j9,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(F9,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(V9,{...l,ref:n})})})},"AccordionImplSingle")),ure=m.forwardRef(Ss(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ss(()=>{},"onValueChange"),...o}=e,[l,u]=el({prop:r,defaultProp:s??[],onChange:i,caller:Yi}),d=m.useCallback(p=>u((g=[])=>[...g,p]),[u]),f=m.useCallback(p=>u((g=[])=>g.filter(v=>v!==p)),[u]);return S.jsx(j9,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(F9,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(V9,{...o,ref:n})})})},"AccordionImplMultiple")),[dre,Xg]=Yg(Yi),V9=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o="vertical",...l}=e,u=m.useRef(null),d=un(u,n),f=sre(r),g=Jb(i)==="ltr",v=ln(e.onKeyDown,w=>{var L;if(!rre.includes(w.key))return;const _=w.target,x=f().filter(D=>{var B;return!((B=D.ref.current)!=null&&B.disabled)}),b=x.findIndex(D=>D.ref.current===_),E=x.length;if(b===-1)return;w.preventDefault();let C=b;const R=0,A=E-1,M=Ss(()=>{C=b+1,C>A&&(C=R)},"moveNext"),I=Ss(()=>{C=b-1,C<R&&(C=A)},"movePrev");switch(w.key){case"Home":C=R;break;case"End":C=A;break;case"ArrowRight":o==="horizontal"&&(g?M():I());break;case"ArrowDown":o==="vertical"&&M();break;case"ArrowLeft":o==="horizontal"&&(g?I():M());break;case"ArrowUp":o==="vertical"&&I();break}const T=C%E;(L=x[T].ref.current)==null||L.focus()});return S.jsx(dre,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(e4.Slot,{scope:r,children:S.jsx(Nn.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),Lx="AccordionItem",[fre,n4]=Yg(Lx),hre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=Xg(Lx,r),l=are(Lx,r),u=t4(r),d=La(),f=s&&l.value.includes(s)||!1,p=o.disabled||e.disabled;return S.jsx(fre,{scope:r,open:f,disabled:p,triggerId:d,children:S.jsx(Yne,{"data-orientation":o.orientation,"data-state":r4(f),...u,...i,ref:n,disabled:p,open:f,onOpenChange:g=>{g?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),pre="AccordionHeader",mre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,...s}=e,i=Xg(Yi,r),o=n4(pre,r);return S.jsx(Nn.h3,{"data-orientation":i.orientation,"data-state":r4(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),U3="AccordionTrigger",gre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,...s}=e,i=Xg(Yi,r),o=n4(U3,r),l=lre(U3,r),u=t4(r);return S.jsx(e4.ItemSlot,{scope:r,children:S.jsx(Xne,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),vre="AccordionContent",yre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,...s}=e,i=Xg(Yi,r),o=n4(vre,r),l=t4(r);return S.jsx(Qne,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function r4(t){return t?"open":"closed"}Ss(r4,"getState");var H9=ore,_re=hre,xre=mre,wre=gre,bre=yre;/**
159
+ * @license lucide-react v1.48.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const Sre=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
164
+ * @license lucide-react v1.48.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */function kre(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Sre(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
169
+ * @license lucide-react v1.48.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const Ere=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
174
+ * @license lucide-react v1.48.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const Cre=t=>{const e=Ere(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
179
+ * @license lucide-react v1.48.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const Nx=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
184
+ * @license lucide-react v1.48.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const Ol={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
189
+ * @license lucide-react v1.48.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */function y_(t){return t!=null}function Pre(t,e={}){var g,v;const n=e.attributeNames??{},r=w=>n[w]??w,s=t.size??t.width??Ol.width,i=t.size??t.height??Ol.height,o=((g=t.aliases)==null?void 0:g.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?Nx(...u):Nx("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??Ol["stroke-width"])*Number(t.size??t.width??Ol.width)/Number(e.size??e.width??Ol.width):e.strokeWidth??Ol["stroke-width"];return["svg",{...Object.entries(Ol).reduce((w,[_,x])=>(w[r(_)]=x,w),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&y_(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&y_(e.width)&&{[r("width")]:e.width},..."height"in e&&y_(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(w=>{const[_,x,b]=w,E=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...x}:x;return b?[_,E,b]:[_,E]})]}/**
194
+ * @license lucide-react v1.48.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */function Rre(t,e={}){return Pre(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
199
+ * @license lucide-react v1.48.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const Are=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Tre=m.createContext({}),Ire=()=>m.useContext(Tre),Mre=m.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...p},g)=>{const{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:_=!1,nonScalingStroke:x=!1,color:b="currentColor",className:E=""}=Ire()??{},C=!!u||Are(p),[R,A,M=[]]=Rre(f,{color:t??b,width:n??e??v,height:r??e??v,strokeWidth:s??w,absoluteStrokeWidth:i??_,nonScalingStroke:o??x,className:Nx(E,l),hasA11yProp:C,attributes:p});return m.createElement(R,{ref:g,...A},[...M.map(([I,T])=>m.createElement(I,T)),...Array.isArray(u)?u:[u]])});/**
204
+ * @license lucide-react v1.48.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */function nt(t,e=[],n=[]){const r=typeof t=="string"?kre(t,e,n):t,s=m.forwardRef(({className:i,...o},l)=>m.createElement(Mre,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Cre(r.name)),s}/**
209
+ * @license lucide-react v1.48.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const z9={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};z9.node;const Ore=nt(z9);/**
214
+ * @license lucide-react v1.48.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const B9={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};B9.node;const Lre=nt(B9);/**
219
+ * @license lucide-react v1.48.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const U9={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};U9.node;const Nre=nt(U9);/**
224
+ * @license lucide-react v1.48.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const Z9={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};Z9.node;const Dre=nt(Z9);/**
229
+ * @license lucide-react v1.48.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const W9={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};W9.node;const $re=nt(W9);/**
234
+ * @license lucide-react v1.48.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const q9={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};q9.node;const jre=nt(q9);/**
239
+ * @license lucide-react v1.48.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const G9={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};G9.node;const Fre=nt(G9);/**
244
+ * @license lucide-react v1.48.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const K9={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};K9.node;const Vre=nt(K9);/**
249
+ * @license lucide-react v1.48.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */const Y9={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Y9.node;const Hre=nt(Y9);/**
254
+ * @license lucide-react v1.48.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ */const X9={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};X9.node;const zre=nt(X9);/**
259
+ * @license lucide-react v1.48.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */const Q9={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Q9.node;const Bre=nt(Q9);/**
264
+ * @license lucide-react v1.48.0 - ISC
265
+ *
266
+ * This source code is licensed under the ISC license.
267
+ * See the LICENSE file in the root directory of this source tree.
268
+ */const J9={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};J9.node;const Ure=nt(J9);/**
269
+ * @license lucide-react v1.48.0 - ISC
270
+ *
271
+ * This source code is licensed under the ISC license.
272
+ * See the LICENSE file in the root directory of this source tree.
273
+ */const eL={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};eL.node;const Zre=nt(eL);/**
274
+ * @license lucide-react v1.48.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */const tL={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};tL.node;const Wre=nt(tL);/**
279
+ * @license lucide-react v1.48.0 - ISC
280
+ *
281
+ * This source code is licensed under the ISC license.
282
+ * See the LICENSE file in the root directory of this source tree.
283
+ */const nL={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};nL.node;const qre=nt(nL);/**
284
+ * @license lucide-react v1.48.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */const rL={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};rL.node;const Gre=nt(rL);/**
289
+ * @license lucide-react v1.48.0 - ISC
290
+ *
291
+ * This source code is licensed under the ISC license.
292
+ * See the LICENSE file in the root directory of this source tree.
293
+ */const sL={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};sL.node;const Kre=nt(sL);/**
294
+ * @license lucide-react v1.48.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */const iL={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};iL.node;const Yre=nt(iL);/**
299
+ * @license lucide-react v1.48.0 - ISC
300
+ *
301
+ * This source code is licensed under the ISC license.
302
+ * See the LICENSE file in the root directory of this source tree.
303
+ */const oL={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};oL.node;const Xre=nt(oL);/**
304
+ * @license lucide-react v1.48.0 - ISC
305
+ *
306
+ * This source code is licensed under the ISC license.
307
+ * See the LICENSE file in the root directory of this source tree.
308
+ */const aL={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};aL.node;const Qre=nt(aL);/**
309
+ * @license lucide-react v1.48.0 - ISC
310
+ *
311
+ * This source code is licensed under the ISC license.
312
+ * See the LICENSE file in the root directory of this source tree.
313
+ */const lL={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};lL.node;const Jre=nt(lL);/**
314
+ * @license lucide-react v1.48.0 - ISC
315
+ *
316
+ * This source code is licensed under the ISC license.
317
+ * See the LICENSE file in the root directory of this source tree.
318
+ */const cL={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};cL.node;const ese=nt(cL);/**
319
+ * @license lucide-react v1.48.0 - ISC
320
+ *
321
+ * This source code is licensed under the ISC license.
322
+ * See the LICENSE file in the root directory of this source tree.
323
+ */const uL={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};uL.node;const tse=nt(uL);/**
324
+ * @license lucide-react v1.48.0 - ISC
325
+ *
326
+ * This source code is licensed under the ISC license.
327
+ * See the LICENSE file in the root directory of this source tree.
328
+ */const dL={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};dL.node;const nse=nt(dL);/**
329
+ * @license lucide-react v1.48.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */const fL={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};fL.node;const rse=nt(fL);/**
334
+ * @license lucide-react v1.48.0 - ISC
335
+ *
336
+ * This source code is licensed under the ISC license.
337
+ * See the LICENSE file in the root directory of this source tree.
338
+ */const hL={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};hL.node;const sse=nt(hL);/**
339
+ * @license lucide-react v1.48.0 - ISC
340
+ *
341
+ * This source code is licensed under the ISC license.
342
+ * See the LICENSE file in the root directory of this source tree.
343
+ */const pL={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};pL.node;const ise=nt(pL);/**
344
+ * @license lucide-react v1.48.0 - ISC
345
+ *
346
+ * This source code is licensed under the ISC license.
347
+ * See the LICENSE file in the root directory of this source tree.
348
+ */const mL={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};mL.node;const ose=nt(mL);/**
349
+ * @license lucide-react v1.48.0 - ISC
350
+ *
351
+ * This source code is licensed under the ISC license.
352
+ * See the LICENSE file in the root directory of this source tree.
353
+ */const gL={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};gL.node;const ase=nt(gL);/**
354
+ * @license lucide-react v1.48.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */const vL={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};vL.node;const lse=nt(vL);/**
359
+ * @license lucide-react v1.48.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */const yL={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};yL.node;const cse=nt(yL);/**
364
+ * @license lucide-react v1.48.0 - ISC
365
+ *
366
+ * This source code is licensed under the ISC license.
367
+ * See the LICENSE file in the root directory of this source tree.
368
+ */const _L={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};_L.node;const use=nt(_L);/**
369
+ * @license lucide-react v1.48.0 - ISC
370
+ *
371
+ * This source code is licensed under the ISC license.
372
+ * See the LICENSE file in the root directory of this source tree.
373
+ */const xL={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};xL.node;const dse=nt(xL);/**
374
+ * @license lucide-react v1.48.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */const wL={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};wL.node;const fse=nt(wL);/**
379
+ * @license lucide-react v1.48.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */const bL={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};bL.node;const hse=nt(bL);/**
384
+ * @license lucide-react v1.48.0 - ISC
385
+ *
386
+ * This source code is licensed under the ISC license.
387
+ * See the LICENSE file in the root directory of this source tree.
388
+ */const SL={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};SL.node;const pse=nt(SL);/**
389
+ * @license lucide-react v1.48.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const kL={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};kL.node;const mse=nt(kL);/**
394
+ * @license lucide-react v1.48.0 - ISC
395
+ *
396
+ * This source code is licensed under the ISC license.
397
+ * See the LICENSE file in the root directory of this source tree.
398
+ */const EL={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};EL.node;const gse=nt(EL);/**
399
+ * @license lucide-react v1.48.0 - ISC
400
+ *
401
+ * This source code is licensed under the ISC license.
402
+ * See the LICENSE file in the root directory of this source tree.
403
+ */const CL={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};CL.node;const vse=nt(CL);/**
404
+ * @license lucide-react v1.48.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */const PL={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};PL.node;const yse=nt(PL);/**
409
+ * @license lucide-react v1.48.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */const RL={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};RL.node;const _se=nt(RL);/**
414
+ * @license lucide-react v1.48.0 - ISC
415
+ *
416
+ * This source code is licensed under the ISC license.
417
+ * See the LICENSE file in the root directory of this source tree.
418
+ */const AL={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};AL.node;const xse=nt(AL);/**
419
+ * @license lucide-react v1.48.0 - ISC
420
+ *
421
+ * This source code is licensed under the ISC license.
422
+ * See the LICENSE file in the root directory of this source tree.
423
+ */const TL={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};TL.node;const wse=nt(TL);/**
424
+ * @license lucide-react v1.48.0 - ISC
425
+ *
426
+ * This source code is licensed under the ISC license.
427
+ * See the LICENSE file in the root directory of this source tree.
428
+ */const IL={name:"user",size:24,node:[["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"}]]};IL.node;const bse=nt(IL);/**
429
+ * @license lucide-react v1.48.0 - ISC
430
+ *
431
+ * This source code is licensed under the ISC license.
432
+ * See the LICENSE file in the root directory of this source tree.
433
+ */const ML={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};ML.node;const Sse=nt(ML);/**
434
+ * @license lucide-react v1.48.0 - ISC
435
+ *
436
+ * This source code is licensed under the ISC license.
437
+ * See the LICENSE file in the root directory of this source tree.
438
+ */const OL={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};OL.node;const kse=nt(OL),Ese={"chevron-right":Vre,"chevron-down":Fre,pipette:cse,x:kse,copy:Bre,menu:tse,dot:Ure,monitor:rse,sun:wse,moon:sse,"rectangle-horizontal":fse,circle:Hre,"square-library":_se,clock:zre,star:xse,settings:gse,plus:dse,"arrow-left":Ore,"arrow-right":Lre,"arrow-up":Nre,search:mse,loader:Qre,users:Sse,lock:Jre,mail:ese,bell:Dre,shield:vse,palette:ose,lightbulb:Yre,rocket:hse,heart:Wre,paintbrush:ise,brain:$re,globe:Zre,user:bse,image:Gre,link:Xre,check:jre,"rotate-ccw":pse,play:use,pause:ase,home:qre,"message-circle":nse,inbox:Kre,pencil:lse,"skip-forward":yse},Z3={lucide:Ese},LL=m.createContext(null);function Cse(t){const e=m.useContext(LL);return e?Z3[e.iconLibrary][t]:Z3.lucide[t]}function Pse({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return S.jsx(LL.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const NL=m.createContext(null);function s4(){return m.useContext(NL)}const DL=m.createContext(null);function $L(){const t=m.useContext(DL);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Rse=m.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=m.useRef(null),l=m.useRef(new Map),[u,d]=m.useState(new Map),{activeIndex:f,setActiveIndex:p,itemRects:g,sessionRef:v,handlers:w,registerItem:_,measureItems:x}=KM(o),b=m.useCallback((de,ae)=>{ae?l.current.set(de,ae):l.current.delete(de)},[]),E=m.useCallback(()=>{if(!o.current)return;const de=new Map;l.current.forEach((ae,Oe)=>{de.set(Oe,{top:ae.offsetTop,left:ae.offsetLeft,width:ae.offsetWidth,height:ae.offsetHeight})}),d(de)},[]),[C,R]=m.useState(()=>r==="single"?t.defaultValue??"":""),[A,M]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,T=t.onValueChange,L=t.value,D=new Set(r==="multiple"?t.value??A:(()=>{const de=t.value??C;return de?[de]:[]})()),B=m.useCallback(de=>{const ae=t;ae.onValueChange?ae.onValueChange(de):R(de)},[I]),j=m.useCallback(de=>{const ae=t;ae.onValueChange?ae.onValueChange(de):M(de)},[T]),K=m.useCallback(de=>{if(r==="multiple"){const ae=t.value??A;j(ae.filter(Oe=>Oe!==de))}else B("")},[r,B,j,A,L]);m.useEffect(()=>{x(),E()},[x,E,n]);const U=[...D].join(",");m.useEffect(()=>{x(),E()},[x,E,U]);const[H,Z]=m.useState(null),Q=f!==null?g[f]:null,z=H!==null?g[H]:null,ee=f!==null&&!u.has(f),W=Zh(),{value:N,defaultValue:X,onValueChange:ie,collapsible:ne,type:oe,...fe}=i,xe=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:j}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:B};return S.jsx(NL.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:f,grouped:!0,remeasure:()=>{x(),E()},openValues:D,openItemRects:u,toggleValue:K},children:S.jsx(H9,{...xe,asChild:!0,children:S.jsxs("div",{ref:de=>{o.current=de,typeof e=="function"?e(de):e&&(e.current=de)},onMouseEnter:w.onMouseEnter,onMouseMove:de=>{const ae=o.current;if(ae){const Oe=ae.getBoundingClientRect(),Ce=ae.offsetHeight,Ge=Oe.height,dt=Ce>0?Ge/Ce:1,Lt=(de.clientY-Oe.top)/dt+ae.scrollTop;for(const[Kt,_t]of u){const ht=g[Kt];if(!ht)continue;const En=ht.top+ht.height,kt=_t.top+_t.height;if(Lt>=En&&Lt<=kt){p(null);return}}}w.onMouseMove(de)},onMouseLeave:w.onMouseLeave,onFocus:de=>{var Oe;const ae=(Oe=de.target.closest("[data-proximity-index]"))==null?void 0:Oe.getAttribute("data-proximity-index");if(ae!=null){const Ce=Number(ae);p(Ce),Z(de.target.matches(":focus-visible")?Ce:null)}},onBlur:de=>{var ae;(ae=o.current)!=null&&ae.contains(de.relatedTarget)||(Z(null),p(null))},className:Ht("relative flex flex-col gap-0.5 w-72 max-w-full",s),...fe,children:[S.jsx(ws,{children:[...u.entries()].map(([de,ae])=>S.jsx(To.div,{className:`absolute ${W.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ae.top,left:ae.left,width:ae.width,height:ae.height,opacity:ee?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${de}`))}),S.jsx(ws,{children:Q&&S.jsx(To.div,{className:`absolute ${W.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Q.top,left:Q.left,width:Q.width,height:Q.height},animate:{opacity:1,top:Q.top,left:Q.left,width:Q.width,height:Q.height},exit:{opacity:0,transition:{duration:.06}},transition:{..._h.fast,opacity:{duration:.08}}},v.current)}),S.jsx(ws,{children:z&&S.jsx(To.div,{className:`absolute ${W.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:z.left-2,top:z.top-2,width:z.width+4,height:z.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{..._h.fast,opacity:{duration:.08}}})}),n]})})})});Rse.displayName="AccordionGroup";const jL=m.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=m.useState(()=>e==="single"?r??"":""),[p,g]=m.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??p:(()=>{const E=s??d;return E?[E]:[]})()),w=m.useCallback(E=>{i?i(E):f(E)},[i]),_=m.useCallback(E=>{i?i(E):g(E)},[i]),x=m.useCallback(E=>{e==="multiple"?_((s??p).filter(R=>R!==E)):w("")},[e,s,p,w,_]),b=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return S.jsx(H9,{...b,asChild:!0,children:S.jsx("div",{ref:u,className:Ht("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(FL.Provider,{value:v,children:S.jsx(VL.Provider,{value:x,children:t})})})})});jL.displayName="Accordion";const FL=m.createContext(new Set),VL=m.createContext(()=>{}),HL=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=s4(),d=m.useContext(FL),f=m.useContext(VL),p=Zh(),g=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=m.useRef(null),w=m.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):f(t)},[u,f,t]);return m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,v.current),()=>u.registerItem(e,null)},[e,u]),m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return g?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,g]),S.jsx(DL.Provider,{value:{index:e,value:t,isOpen:g,onToggle:w,triggerRef:v},children:S.jsxs(_re,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:Ht(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&S.jsx(ws,{children:g&&S.jsx(To.div,{className:`absolute inset-0 ${p.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});HL.displayName="AccordionItem";const zL=m.forwardRef(({children:t,className:e,...n},r)=>{const s=Cse("chevron-right"),i=s4(),{index:o,isOpen:l,triggerRef:u}=$L(),d=Zh(),[f,p]=m.useState(!1),g=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx(xre,{asChild:!0,children:S.jsx("div",{children:S.jsxs(wre,{ref:r,className:Ht(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Bf.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:Ht("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||g?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?Bf.semibold:Bf.normal},children:t})]}),S.jsx(To.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:_h.fast,children:S.jsx(s,{size:16,strokeWidth:l||g?2:1.5,className:Ht("transition-[color,stroke-width] duration-80",l||g?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:u,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(ws,{children:f&&S.jsx(To.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});zL.displayName="AccordionTrigger";const BL=m.forwardRef(({children:t,className:e,...n},r)=>{const s=s4(),{isOpen:i}=$L();return S.jsx(ws,{initial:!1,children:i&&S.jsx(bre,{forceMount:!0,asChild:!0,...n,children:S.jsx(To.div,{ref:r,className:Ht("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{..._h.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});BL.displayName="AccordionContent";const pm=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(jL,{type:"multiple",defaultValue:e,className:Ht("w-full",n),children:t}),Ase=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(HL,{value:t,className:Ht("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(zL,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(BL,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};pm.Item=Ase;const Tse=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(Mg,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),Ise=()=>{const t=m.useRef(Date.now()),[e,n]=m.useState(0);return m.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},Mse=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},W3="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",q3="M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",Ose="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",mm=["Applying","Thinking","Planning","Crafting"],Lse=mm.reduce((t,e)=>t.length>=e.length?t:e),Nse=20,Dse="Still working — runs can take a few minutes.",$se=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=Ise();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%mm.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=Nse?Dse:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(vi.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(vi.path,{animate:{d:[W3,q3,Ose,q3,W3]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Bf.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:Lse}),S.jsx(ws,{mode:"popLayout",initial:!1,children:S.jsx(vi.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:mm[n]},mm[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:Mse(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var jse=Object.defineProperty,Fse=(t,e)=>jse(t,"name",{value:e,configurable:!0});function i4(t,[e,n]){return Math.min(n,Math.max(e,t))}Fse(i4,"clamp");var Vse=Object.defineProperty,Hse=(t,e)=>Vse(t,"name",{value:e,configurable:!0});function UL(t){const e=m.useRef({value:t,previous:t});return m.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}Hse(UL,"usePrevious");var zse=Object.defineProperty,Mt=(t,e)=>zse(t,"name",{value:e,configurable:!0}),ZL=["PageUp","PageDown"],WL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],qL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xh="Slider",[Dx,Bse,Use]=Kb(Xh),[o4,Lie]=Ki(Xh,[Use]),[Zse,Qh]=o4(Xh),Wse=m.forwardRef(Mt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[s],value:p,onValueChange:g=Mt(()=>{},"onValueChange"),onValueCommit:v=Mt(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,b=m.useRef(new Set),E=m.useRef(0),C=m.useRef(!1),A=l==="horizontal"?qse:Gse,[M,I]=m.useState(null),T=un(n,I),[L=[],D]=el({prop:p,defaultProp:f,onChange:Mt(Q=>{var ee;(ee=[...b.current][E.current])==null||ee.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,g(Q)},"onChange")}),B=m.useRef(L),j=m.useRef(L);m.useEffect(()=>{const Q=_?M==null?void 0:M.ownerDocument.getElementById(_):M==null?void 0:M.closest("form");if(Q instanceof HTMLFormElement){const z=Mt(()=>D(j.current),"reset");return Q.addEventListener("reset",z),()=>Q.removeEventListener("reset",z)}},[M,_,D]);function K(Q){const z=tN(L,Q);Z(Q,z)}Mt(K,"handleSlideStart");function U(Q){Z(Q,E.current)}Mt(U,"handleSlideMove");function H(){String(L)!==String(B.current)&&v(L)}Mt(H,"handleSlideEnd");function Z(Q,z,{commit:ee}={commit:!1}){const W=l4(o),N=Gf(Math.round((Q-s)/o)*o+s,W),X=i4(N,[s,i]);D((ie=[])=>{const ne=JL(ie,X,z);if(sN(ne,d*o)){E.current=ne.indexOf(X);const oe=String(ne)!==String(ie);return oe&&ee&&v(ne),oe?ne:ie}else return ie})}return Mt(Z,"updateValues"),S.jsx(Zse,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:E,thumbs:b.current,values:L,orientation:l,form:_,children:S.jsx(Dx.Provider,{scope:e.__scopeSlider,children:S.jsx(Dx.Slot,{scope:e.__scopeSlider,children:S.jsx(A,{"aria-disabled":u,"data-disabled":u?"":void 0,...x,ref:T,onPointerDown:ln(x.onPointerDown,()=>{u||(B.current=L,C.current=!1)}),min:s,max:i,inverted:w,onSlideStart:u?void 0:K,onSlideMove:u?void 0:U,onSlideEnd:u?void 0:H,onHomeKeyDown:()=>{u||(C.current=!0,Z(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,Z(i,L.length-1,{commit:!0}))},onStepKeyDown:({event:Q,direction:z})=>{if(!u){C.current=!0;const N=ZL.includes(Q.key)||Q.shiftKey&&WL.includes(Q.key)?10:1,X=E.current,ie=L[X],ne=iN(ie,{min:s,step:o,direction:z,multiplier:N});Z(ne,X,{commit:!0})}}})})})})},"Slider")),[GL,KL]=o4(Xh,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qse=m.forwardRef(Mt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...p}=e,[g,v]=m.useState(null),w=un(n,v),_=m.useRef(void 0),x=Jb(i),b=x==="ltr",E=b&&!o||!b&&o;function C(R){const A=_.current||g.getBoundingClientRect(),M=[0,A.width],T=Qg(M,E?[r,s]:[s,r]);return _.current=A,T(R-A.left)}return Mt(C,"getValueFromPointer"),S.jsx(GL,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:S.jsx(YL,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const A=C(R.clientX);l==null||l(A)},onSlideMove:R=>{const A=C(R.clientX);u==null||u(A)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:R=>{const M=qL[E?"from-left":"from-right"].includes(R.key);f==null||f({event:R,direction:M?-1:1})}})})},"SliderHorizontal")),Gse=m.forwardRef(Mt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,p=m.useRef(null),g=un(n,p),v=m.useRef(void 0),w=!i;function _(x){const b=v.current||p.current.getBoundingClientRect(),E=[0,b.height],R=Qg(E,w?[s,r]:[r,s]);return v.current=b,R(x-b.top)}return Mt(_,"getValueFromPointer"),S.jsx(GL,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:S.jsx(YL,{"data-orientation":"vertical",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const b=_(x.clientY);o==null||o(b)},onSlideMove:x=>{const b=_(x.clientY);l==null||l(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:x=>{const E=qL[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:E?-1:1})}})})},"SliderVertical")),YL=m.forwardRef(Mt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,p=Qh(Xh,r);return S.jsx(Nn.span,{...f,ref:n,onKeyDown:ln(e.onKeyDown,g=>{g.key==="Home"?(l(g),g.preventDefault()):g.key==="End"?(u(g),g.preventDefault()):ZL.concat(WL).includes(g.key)&&(d(g),g.preventDefault())}),onPointerDown:ln(e.onPointerDown,g=>{const v=g.target;v.setPointerCapture(g.pointerId),g.preventDefault(),p.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(g)}),onPointerMove:ln(e.onPointerMove,g=>{g.target.hasPointerCapture(g.pointerId)&&i(g)}),onPointerUp:ln(e.onPointerUp,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&(v.releasePointerCapture(g.pointerId),o(g))})})},"SliderImpl")),Kse="SliderTrack",Yse=m.forwardRef(Mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Qh(Kse,r);return S.jsx(Nn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),G3="SliderRange",Xse=m.forwardRef(Mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Qh(G3,r),o=KL(G3,r),l=m.useRef(null),u=un(n,l),d=i.values.length,f=i.values.map(v=>a4(v,i.min,i.max)),p=d>1?Math.min(...f):0,g=100-Math.max(...f);return S.jsx(Nn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:g+"%"}})},"SliderRange")),Qse="SliderThumb",[Jse,XL]=o4(Qse),eie="SliderThumbProvider";function QL(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Qh(eie,e),o=Bse(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(x=>x.ref.current===l):-1,[o,l]),f=nb(l),p=l?!!i.form||!!l.closest("form"):!0,g=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=g===void 0?0:a4(g,i.min,i.max);m.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:g,name:v,form:i.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:w,size:f};return S.jsx(Jse,{scope:e,..._,children:oN(s)?s(_):r})}Mt(QL,"SliderThumbProvider");var __="SliderThumbTrigger",tie=m.forwardRef(Mt(function(e,n){const{__scopeSlider:r,...s}=e,i=Qh(__,r),o=KL(__,r),{index:l,value:u,percent:d,size:f,onThumbChange:p}=XL(__,r),g=un(n,p),v=eN(l,i.values.length),w=f==null?void 0:f[o.size],_=w?nN(w,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(Dx.ItemSlot,{scope:r,children:S.jsx(Nn.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:g,style:u===void 0?{display:"none"}:e.style,onFocus:ln(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),nie=m.forwardRef(Mt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(QL,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(tie,{...i,ref:n,__scopeSlider:r}),l?S.jsx(sie,{__scopeSlider:r},o):null]})})},"SliderThumb")),rie="SliderBubbleInput",sie=m.forwardRef(Mt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=XL(rie,e),l=m.useRef(null),u=un(l,r),d=UL(s);return m.useEffect(()=>{const f=l.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&v){const w=new Event("input",{bubbles:!0});v.call(f,s),f.dispatchEvent(w)}},[d,s]),S.jsx(Nn.input,{style:{display:"none"},name:i,form:o,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function JL(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Mt(JL,"getNextSortedValues");function a4(t,e,n){const i=100/(n-e)*(t-e);return i4(i,[0,100])}Mt(a4,"convertValueToPercentage");function eN(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Mt(eN,"getLabel");function tN(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}Mt(tN,"getClosestValueIndex");function nN(t,e,n){const r=t/2,i=Qg([0,50],[0,r]);return(r-i(e)*n)*n}Mt(nN,"getThumbInBoundsOffset");function rN(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Mt(rN,"getStepsBetweenValues");function sN(t,e){if(e>0){const n=rN(t);return Math.min(...n)>=e}return!0}Mt(sN,"hasMinStepsBetweenValues");function Qg(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}Mt(Qg,"linearScale");function l4(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}Mt(l4,"getDecimalCount");function Gf(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Mt(Gf,"roundValue");function iN(t,{min:e,step:n,direction:r,multiplier:s}){const i=l4(n),o=(t-e)/n,l=Math.round(o),u=Gf(l*n+e,i)===Gf(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),Gf(d*n+e,i)}Mt(iN,"getNextStepValue");function oN(t){return typeof t=="function"}Mt(oN,"isFunction");const $x=m.forwardRef(({className:t,...e},n)=>S.jsxs(Wse,{ref:n,className:Ht("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(Yse,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(Xse,{className:"absolute h-full bg-primary"})}),S.jsx(nie,{className:Ht("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));$x.displayName="Slider";const iie=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],oie=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],aie=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],j0=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],lie=()=>{window.location.hash=""},mo=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),K3=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),cie=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",uie=()=>{const t=j0.filter(n=>n.status==="showcased").length,e=j0.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:lie,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(KW,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(XT,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(mo,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(Oo,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(Oo,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(Oo,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(dO,{primaryLabel:"Ship",primaryIcon:$y,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(fc,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(ab,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(mo,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(K3,{swatches:iie})}),S.jsx(mo,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(K3,{swatches:oie})}),S.jsx(mo,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(mo,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:aie.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(mo,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(pm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(pm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx($y,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(pm.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx($x,{defaultValue:[64],max:100,step:1}),S.jsx($x,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(mo,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(Tse,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(Pb,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx($se,{hint:"Reading selected elements"})})]})}),S.jsx(mo,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(vx,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(OO,{icon:S.jsx($y,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Ab,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(mo,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:j0.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:j0.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${cie(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},die=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",jx=274,yg=395,x_=Math.min(yg,Math.round((jx+yg)/2*1.1)),Y3="rivet:panelWidth:v2",fie=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},hie=({projectPath:t})=>{const e=lt(sO)>0,[n,r]=UR(nO),s=WZ(),[i,o]=m.useState(()=>{if(typeof window>"u")return x_;const R=Number(window.localStorage.getItem(Y3));return Number.isFinite(R)&&R>=jx&&R<=yg?R:x_}),[l,u]=m.useState(!1),[d,f]=m.useState(Sne),p=n?i:0,[g,v]=m.useState(n);m.useEffect(()=>{if(!n){v(!1);return}f(R=>bne({position:R,boundsLeftPx:i}))},[n,i]),m.useEffect(()=>{window.localStorage.setItem(Y3,String(i))},[i]),m.useEffect(()=>{if(!n)return;const R=A=>{A.key==="Escape"&&(fie(A.target)||(A.preventDefault(),r(!1)))};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,r]);const w=m.useCallback(R=>{R.preventDefault(),R.stopPropagation();const A=R.clientX,M=i;u(!0);const I=L=>{const D=Math.min(yg,Math.max(jx,M+(L.clientX-A)));o(D)},T=()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T),u(!1)};window.addEventListener("pointermove",I),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)},[i]),_=m.useCallback(()=>o(x_),[]),x=Dne(),b=lt(Bg);Fne({enabled:!b});const E=x.isProcessing?"Completing authentication...":null,C=vt(zg);return m.useEffect(()=>{C(t??null)},[t,C]),S.jsxs(vi.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[E!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(cne,{message:E})}):null,S.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:S.jsx($ee,{})}),S.jsx(S.Fragment,{children:e?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:g?i:0},children:S.jsxs(vi.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&v(!0)},style:{width:i,willChange:"transform"},children:[S.jsx(YJ,{onClose:()=>r(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:w,onDoubleClick:_,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${l?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),l&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(Cne,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:f,onToggle:()=>r(R=>!R)})]})}),S.jsx(bW,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},Fx="rivet_connect_deep_link",pie=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(Fx);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(Fx,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},mie=pie(),gie=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(cg)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(mie);m.useEffect(()=>{n&&window.sessionStorage.removeItem(cg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=Lne(),p=vt(Bg),{startLogin:g,isStartingLogin:v,loginError:w}=EO(),[_,x]=m.useState(!1);m.useEffect(()=>{l!=null&&l.userId?(Ee.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&Ee.alias(l.email,l.userId)):l!=null&&l.email&&Ee.identify(l.email,{email:l.email})},[l==null?void 0:l.userId,l==null?void 0:l.email]),m.useEffect(()=>{l&&Ee.register({source:"visual_editor",surface:"visual_editor"})},[l]);const b=l!=null&&l.agentModeAvailable!==!0,E=die(t),C=m.useCallback(async()=>{x(!0),p(!0);try{await u()}finally{p(!1),x(!1)}},[u,p]);if(m.useEffect(()=>{const I=()=>{const T=window.location.hash;e(T)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),E==="design-system")return S.jsx(uie,{});if(!d&&l===null&&!_){const I=f||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:I}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{C()},children:"Retry"})]})})}if(b)return S.jsx(ane,{isSigningIn:v,onStartSignIn:()=>{g()},errorMessage:w,displayMode:"full"});const A=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,M=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!A;return S.jsxs(S.Fragment,{children:[S.jsx(hie,{projectPath:l==null?void 0:l.projectPath}),S.jsx(gx,{context:"onboarding",isOpen:M,onClose:()=>s(!0)}),S.jsx(gx,{context:"menu",isOpen:A,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(Fx),o(null)}})]})};dV();const vie=m.lazy(()=>aP(()=>import("./LibraryApp-NAzSe5xc.js"),[])),yie=window.location.pathname.startsWith("/rivet/library"),_ie="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",xie=new m7,wie={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},bie=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),aN=document.getElementById("root");if(!aN)throw new Error("Rivet root element is missing");vV.createRoot(aN).render(S.jsx(_e.StrictMode,{children:S.jsx(rV,{apiKey:_ie,options:{api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...wie,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.18.2",env:"production"})}},children:S.jsx(cV,{fallback:S.jsx(bie,{}),children:S.jsx(BD,{client:xie,children:S.jsx($G,{defaultShape:"rounded",children:S.jsx(Pse,{defaultLibrary:"lucide",children:yie?S.jsx(m.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx(vie,{})}):S.jsx(gie,{})})})})})})}));export{gb as A,Oo as B,Eb as C,fb as D,vb as E,Pt as F,une as G,mse as H,Eie as I,Pie as J,vm as K,Rie as L,Ore as M,KJ as N,bW as O,kb as P,c7 as Q,bb as R,$h as S,Sb as T,PJ as U,kse as X,g7 as a,_7 as b,m as c,x7 as d,S7 as e,w7 as f,f7 as g,Kf as h,qr as i,k7 as j,E7 as k,b7 as l,pP as m,pr as n,nt as o,Vo as p,YM as q,fP as r,O1 as s,S as t,cP as u,V2 as v,lse as w,hb as x,pb as y,mb as z};